index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. <text class="valName">{{ listData.applyIntroduce || ''}}</text>
  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. orderGoodsId:"",
  87. applyStatus: '',
  88. applyId:0,
  89. listData: {
  90. applyStatus: []
  91. }, //页面数据
  92. radioInfo: '',
  93. goodsIdBK: null //补考商品ID
  94. };
  95. },
  96. onLoad(option) {
  97. this.applyId = option.applyId;
  98. this.goodsId = Number(option.goodsId);
  99. this.gradeId = Number(option.gradeId);
  100. this.orderGoodsId = Number(option.orderGoodsId) || ''
  101. this.getInfo();
  102. },
  103. methods: {
  104. getInfo() {
  105. var data = {
  106. goodsId: this.goodsId,
  107. gradeId: this.gradeId,
  108. orderGoodsId:this.orderGoodsId,
  109. applyId:this.applyId
  110. };
  111. this.$api.getApplysubscribe(data).then(res => {
  112. if (res.data.data.applyStatus) {
  113. res.data.data.applyStatus = res.data.data.applyStatus.split(',');
  114. }
  115. this.listData = res.data.data;
  116. });
  117. },
  118. next() {
  119. if (!this.radioInfo) {
  120. uni.showToast({
  121. title: '请选择您的考试身份',
  122. icon: 'none'
  123. });
  124. return;
  125. }
  126. let data = {
  127. applyId: this.listData.applyId,
  128. applyStatus: this.radioInfo,
  129. goodsId: this.goodsId,
  130. applyId:this.applyId,
  131. gradeId: this.gradeId,
  132. orderGoodsId:this.orderGoodsId
  133. };
  134. this.$api.getApplysubscribeNext(data).then(res => {
  135. if (res.data.code === 500) {
  136. uni.showModal({
  137. content: res.data.msg,
  138. showCancel: false
  139. });
  140. } else {
  141. if (res.data.data === 1 || res.data.data === 2) {
  142. this.$navTo.togo('/pages2/appointment/order', {
  143. applyId: this.listData.applyId,
  144. applyStatus: this.radioInfo,
  145. goodsId: this.goodsId,
  146. dataId: res.data.data,
  147. applyId:this.applyId,
  148. orderGoodsId: this.orderGoodsId
  149. });
  150. }
  151. if (res.data.data === 3) {
  152. this.$api.goodsList({ makeGoodsId: this.goodsId,goodsType:3,orderGoodsId:this.orderGoodsId }).then(res => {
  153. if (res.data.code === 200) {
  154. if(res.data.rows.length){
  155. console.log(res.data.rows[0].goodsId)
  156. this.goodsIdBK = res.data.rows[0].goodsId;
  157. }
  158. }
  159. });
  160. this.showTip = true;
  161. }
  162. }
  163. });
  164. },
  165. submit() {
  166. if(!this.goodsIdBK){
  167. uni.showModal({
  168. showCancel:false,
  169. content:"请联系管理员配置补考商品"
  170. })
  171. }else{
  172. this.showTip = false;
  173. this.$store.commit('updateBackApplyData',{
  174. goodsId: this.goodsId,
  175. orderGoodsId:this.orderGoodsId,
  176. gradeId: this.gradeId,
  177. applyId:this.applyId
  178. })
  179. this.$navTo.togo('/pages2/order/confirm_list', {
  180. id: this.goodsIdBK,
  181. isBK:'1',
  182. orderGoodsId:this.orderGoodsId
  183. });
  184. }
  185. }
  186. }
  187. };
  188. </script>
  189. <style>
  190. page {
  191. background-color: #eaeef1;
  192. }
  193. .appointmentType .u-radio__label {
  194. margin-left: 16rpx !important;
  195. margin-right: 116rpx !important;
  196. }
  197. .tipModel .u-mode-center-box {
  198. background-color: transparent !important;
  199. }
  200. </style>
  201. <style scoped lang="scss">
  202. .appointment {
  203. padding: 16rpx;
  204. .appointmentItem {
  205. background: #ffffff;
  206. border-radius: 16rpx;
  207. margin-bottom: 16rpx;
  208. .item {
  209. padding: 24rpx 0;
  210. }
  211. .labelName {
  212. font-size: 28rpx;
  213. font-family: PingFang SC;
  214. font-weight: 500;
  215. color: #999999;
  216. margin-bottom: 16rpx;
  217. line-height: 1;
  218. }
  219. .valName {
  220. font-size: 30rpx;
  221. font-family: PingFang SC;
  222. font-weight: 500;
  223. color: #333333;
  224. }
  225. }
  226. .appointmentHead {
  227. padding: 16rpx;
  228. .imgBox {
  229. overflow: hidden;
  230. image {
  231. border-radius:24rpx;
  232. display: block;
  233. width:100%;
  234. }
  235. }
  236. .title {
  237. padding: 24rpx 28rpx 31rpx 31rpx;
  238. font-size: 30rpx;
  239. font-weight: bold;
  240. font-family: PingFang SC;
  241. color: #333333;
  242. }
  243. }
  244. .appointmentTime {
  245. padding: 10rpx 30rpx 0;
  246. }
  247. .appointmentMajor {
  248. padding: 34rpx 30rpx 24rpx;
  249. }
  250. .appointmentInfo {
  251. padding: 8rpx 30rpx;
  252. }
  253. .appointmentType {
  254. padding: 8rpx 30rpx 4rpx;
  255. .u-radio__label {
  256. margin-left: 16rpx;
  257. margin-right: 116rpx;
  258. }
  259. }
  260. .btn {
  261. width: 526rpx;
  262. height: 80rpx;
  263. line-height: 80rpx;
  264. background: #007aff;
  265. border-radius: 40rpx;
  266. font-size: 30rpx;
  267. font-family: PingFang SC;
  268. font-weight: bold;
  269. color: #ffffff;
  270. margin: 40rpx auto;
  271. text-align: center;
  272. }
  273. }
  274. .tipBox {
  275. width: 640rpx;
  276. padding: 30rpx 36rpx 40rpx;
  277. background: #ffffff;
  278. border-radius: 24rpx;
  279. font-family: PingFang SC;
  280. .title {
  281. text-align: center;
  282. font-size: 30rpx;
  283. font-weight: bold;
  284. color: #333333;
  285. margin-bottom: 40rpx;
  286. }
  287. .main {
  288. font-size: 30rpx;
  289. font-weight: 500;
  290. color: #666666;
  291. line-height: 48rpx;
  292. margin-bottom: 40rpx;
  293. }
  294. .btn {
  295. display: flex;
  296. justify-content: center;
  297. .btn1 {
  298. width: 200rpx;
  299. height: 80rpx;
  300. line-height: 80rpx;
  301. text-align: center;
  302. background: #f5f5f5;
  303. border-radius: 40px;
  304. font-size: 30rpx;
  305. font-weight: bold;
  306. color: #007aff;
  307. margin: 0 20rpx;
  308. &.submit {
  309. background: #007aff;
  310. color: #fff;
  311. }
  312. }
  313. }
  314. }
  315. </style>