index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <view class="safeArea">
  3. <nav-bar title="预约考试"></nav-bar>
  4. <view class="appointment">
  5. <view class="appointmentItem appointmentHead">
  6. <view class="imgBox"><image :src="$method.splitImgHost(listData.applyUrl)" mode="widthFix"></image></view>
  7. <u-line color="#EEEEEE" />
  8. <view class="title">{{ listData.applyName }}</view>
  9. </view>
  10. <view class="appointmentItem appointmentTime">
  11. <view class="item">
  12. <view class="labelName">报名时间:</view>
  13. <view class="valName">{{ $method.timestampToTime(listData.applyStartTime) }} ~ {{ $method.timestampToTime(listData.applyEndTime) }}</view>
  14. </view>
  15. <u-line color="#EEEEEE" />
  16. <view class="item">
  17. <view class="labelName">温馨提示:</view>
  18. <view class="valName">{{ listData.applyIntroduce || ''}}</view>
  19. </view>
  20. </view>
  21. <view class="appointmentItem appointmentMajor">
  22. <view class="top">
  23. <view class="labelName">报考专业:</view>
  24. <view class="valName">{{ listData.major || ''}}</view>
  25. </view>
  26. </view>
  27. <view class="appointmentItem appointmentInfo">
  28. <view class="item">
  29. <text class="labelName">
  30. <text style="opacity: 0;">姓</text>
  31. 名:
  32. </text>
  33. {{ listData.realname }}
  34. </view>
  35. <u-line color="#EEEEEE" />
  36. <view class="item">
  37. <text class="labelName">身份证:</text>
  38. {{ listData.idCard }}
  39. </view>
  40. </view>
  41. <view class="appointmentItem appointmentType">
  42. <view class="item">
  43. <view class="labelName">学员类型:</view>
  44. <u-radio-group placement="column" v-model="radioInfo">
  45. <u-radio
  46. :customStyle="{ marginBottom: '8px' }"
  47. v-for="(item, index) in radiolist"
  48. :key="index"
  49. :name="item.name"
  50. v-if="listData.applyStatus.indexOf(item.name) !== -1"
  51. >
  52. {{ item.label }}
  53. </u-radio>
  54. </u-radio-group>
  55. </view>
  56. </view>
  57. <view class="btn" @click="next">下一步</view>
  58. </view>
  59. <!-- 弹框-->
  60. <u-popup v-model="showTip" mode="center" class="tipModel">
  61. <view class="tipBox">
  62. <view class="title">温馨提示</view>
  63. <view class="main">
  64. <view class="item">您所报考的{{ listData.major }}专业,</view>
  65. <view class="item">考试次数已经用完。</view>
  66. <view class="item">需要预约考试的补考学员,</view>
  67. <view class="item">请先购买补考机会。</view>
  68. </view>
  69. <view class="btn">
  70. <view class="btn1 cancel" @click="showTip = false">知道了</view>
  71. <view class="btn1 submit" @click="submit">马上缴费</view>
  72. </view>
  73. </view>
  74. </u-popup>
  75. </view>
  76. </template>
  77. <script>
  78. import { mapGetters } from 'vuex';
  79. export default {
  80. data() {
  81. return {
  82. showTip: false,
  83. radiolist: [{ name: '1', label: '非补考学员' }, { name: '2', label: '补考学员' }],
  84. goodsId: 0,
  85. gradeId: 0,
  86. applyStatus: '',
  87. listData: {
  88. applyStatus: []
  89. }, //页面数据
  90. radioInfo: '',
  91. goodsIdBK: null //补考商品ID
  92. };
  93. },
  94. onLoad(option) {
  95. this.goodsId = Number(option.goodsId);
  96. this.gradeId = Number(option.gradeId);
  97. this.getInfo();
  98. },
  99. methods: {
  100. getInfo() {
  101. var data = {
  102. goodsId: this.goodsId,
  103. gradeId: this.gradeId
  104. };
  105. this.$api.getApplysubscribe(data).then(res => {
  106. if (res.data.data.applyStatus) {
  107. res.data.data.applyStatus = res.data.data.applyStatus.split(',');
  108. }
  109. this.listData = res.data.data;
  110. });
  111. },
  112. next() {
  113. if (!this.radioInfo) {
  114. uni.showToast({
  115. title: '请选择您的考试身份',
  116. icon: 'none'
  117. });
  118. return;
  119. }
  120. let data = {
  121. applyId: this.listData.applyId,
  122. applyStatus: this.radioInfo,
  123. goodsId: this.goodsId,
  124. gradeId: this.gradeId
  125. };
  126. this.$api.getApplysubscribeNext(data).then(res => {
  127. if (res.data.code === 500) {
  128. uni.showModal({
  129. content: res.data.msg,
  130. showCancel: false
  131. });
  132. } else {
  133. if (res.data.data === 1 || res.data.data === 2) {
  134. this.$navTo.togo('/pages2/appointment/order', {
  135. applyId: this.listData.applyId,
  136. applyStatus: this.radioInfo,
  137. goodsId: this.goodsId,
  138. dataId: res.data.data
  139. });
  140. }
  141. if (res.data.data === 3) {
  142. this.$api.goodsList({ makeGoodsId: this.goodsId,goodsType:3 }).then(res => {
  143. if (res.data.code === 200) {
  144. if(res.data.rows.length){
  145. console.log(res.data.rows[0].goodsId)
  146. this.goodsIdBK = res.data.rows[0].goodsId;
  147. }
  148. }
  149. });
  150. this.showTip = true;
  151. }
  152. }
  153. });
  154. },
  155. submit() {
  156. if(!this.goodsIdBK){
  157. uni.showModal({
  158. showCancel:false,
  159. content:"请联系管理员配置补考商品"
  160. })
  161. }else{
  162. this.showTip = false;
  163. this.$store.commit('updateBackApplyData',{
  164. goodsId: this.goodsId,
  165. gradeId: this.gradeId
  166. })
  167. this.$navTo.togo('/pages2/order/confirm_list', {
  168. id: this.goodsIdBK,
  169. isBK:'1'
  170. });
  171. }
  172. }
  173. }
  174. };
  175. </script>
  176. <style>
  177. page {
  178. background-color: #eaeef1;
  179. }
  180. .appointmentType .u-radio__label {
  181. margin-left: 16rpx !important;
  182. margin-right: 116rpx !important;
  183. }
  184. .tipModel .u-mode-center-box {
  185. background-color: transparent !important;
  186. }
  187. </style>
  188. <style scoped lang="scss">
  189. .appointment {
  190. padding: 16rpx;
  191. .appointmentItem {
  192. background: #ffffff;
  193. border-radius: 16rpx;
  194. margin-bottom: 16rpx;
  195. .item {
  196. padding: 24rpx 0;
  197. }
  198. .labelName {
  199. font-size: 28rpx;
  200. font-family: PingFang SC;
  201. font-weight: 500;
  202. color: #999999;
  203. margin-bottom: 16rpx;
  204. line-height: 1;
  205. }
  206. .valName {
  207. font-size: 30rpx;
  208. font-family: PingFang SC;
  209. font-weight: 500;
  210. color: #333333;
  211. }
  212. }
  213. .appointmentHead {
  214. padding: 16rpx;
  215. .imgBox {
  216. overflow: hidden;
  217. image {
  218. border-radius:24rpx;
  219. display: block;
  220. width:100%;
  221. }
  222. }
  223. .title {
  224. padding: 24rpx 28rpx 31rpx 31rpx;
  225. font-size: 30rpx;
  226. font-weight: bold;
  227. font-family: PingFang SC;
  228. color: #333333;
  229. }
  230. }
  231. .appointmentTime {
  232. padding: 10rpx 30rpx 0;
  233. }
  234. .appointmentMajor {
  235. padding: 34rpx 30rpx 24rpx;
  236. }
  237. .appointmentInfo {
  238. padding: 8rpx 30rpx;
  239. }
  240. .appointmentType {
  241. padding: 8rpx 30rpx 4rpx;
  242. .u-radio__label {
  243. margin-left: 16rpx;
  244. margin-right: 116rpx;
  245. }
  246. }
  247. .btn {
  248. width: 526rpx;
  249. height: 80rpx;
  250. line-height: 80rpx;
  251. background: #007aff;
  252. border-radius: 40rpx;
  253. font-size: 30rpx;
  254. font-family: PingFang SC;
  255. font-weight: bold;
  256. color: #ffffff;
  257. margin: 40rpx auto;
  258. text-align: center;
  259. }
  260. }
  261. .tipBox {
  262. width: 640rpx;
  263. padding: 30rpx 36rpx 40rpx;
  264. background: #ffffff;
  265. border-radius: 24rpx;
  266. font-family: PingFang SC;
  267. .title {
  268. text-align: center;
  269. font-size: 30rpx;
  270. font-weight: bold;
  271. color: #333333;
  272. margin-bottom: 40rpx;
  273. }
  274. .main {
  275. font-size: 30rpx;
  276. font-weight: 500;
  277. color: #666666;
  278. line-height: 48rpx;
  279. margin-bottom: 40rpx;
  280. }
  281. .btn {
  282. display: flex;
  283. justify-content: center;
  284. .btn1 {
  285. width: 200rpx;
  286. height: 80rpx;
  287. line-height: 80rpx;
  288. text-align: center;
  289. background: #f5f5f5;
  290. border-radius: 40px;
  291. font-size: 30rpx;
  292. font-weight: bold;
  293. color: #007aff;
  294. margin: 0 20rpx;
  295. &.submit {
  296. background: #007aff;
  297. color: #fff;
  298. }
  299. }
  300. }
  301. }
  302. </style>