index.vue 7.2 KB

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