index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. orderGoodsId:this.orderGoodsId,
  171. gradeId: this.gradeId,
  172. })
  173. this.$navTo.togo('/pages2/order/confirm_list', {
  174. id: this.goodsIdBK,
  175. isBK:'1',
  176. orderGoodsId:this.orderGoodsId
  177. });
  178. }
  179. }
  180. }
  181. };
  182. </script>
  183. <style>
  184. page {
  185. background-color: #eaeef1;
  186. }
  187. .appointmentType .u-radio__label {
  188. margin-left: 16rpx !important;
  189. margin-right: 116rpx !important;
  190. }
  191. .tipModel .u-mode-center-box {
  192. background-color: transparent !important;
  193. }
  194. </style>
  195. <style scoped lang="scss">
  196. .appointment {
  197. padding: 16rpx;
  198. .appointmentItem {
  199. background: #ffffff;
  200. border-radius: 16rpx;
  201. margin-bottom: 16rpx;
  202. .item {
  203. padding: 24rpx 0;
  204. }
  205. .labelName {
  206. font-size: 28rpx;
  207. font-family: PingFang SC;
  208. font-weight: 500;
  209. color: #999999;
  210. margin-bottom: 16rpx;
  211. line-height: 1;
  212. }
  213. .valName {
  214. font-size: 30rpx;
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. color: #333333;
  218. }
  219. }
  220. .appointmentHead {
  221. padding: 16rpx;
  222. .imgBox {
  223. overflow: hidden;
  224. image {
  225. border-radius:24rpx;
  226. display: block;
  227. width:100%;
  228. }
  229. }
  230. .title {
  231. padding: 24rpx 28rpx 31rpx 31rpx;
  232. font-size: 30rpx;
  233. font-weight: bold;
  234. font-family: PingFang SC;
  235. color: #333333;
  236. }
  237. }
  238. .appointmentTime {
  239. padding: 10rpx 30rpx 0;
  240. }
  241. .appointmentMajor {
  242. padding: 34rpx 30rpx 24rpx;
  243. }
  244. .appointmentInfo {
  245. padding: 8rpx 30rpx;
  246. }
  247. .appointmentType {
  248. padding: 8rpx 30rpx 4rpx;
  249. .u-radio__label {
  250. margin-left: 16rpx;
  251. margin-right: 116rpx;
  252. }
  253. }
  254. .btn {
  255. width: 526rpx;
  256. height: 80rpx;
  257. line-height: 80rpx;
  258. background: #007aff;
  259. border-radius: 40rpx;
  260. font-size: 30rpx;
  261. font-family: PingFang SC;
  262. font-weight: bold;
  263. color: #ffffff;
  264. margin: 40rpx auto;
  265. text-align: center;
  266. }
  267. }
  268. .tipBox {
  269. width: 640rpx;
  270. padding: 30rpx 36rpx 40rpx;
  271. background: #ffffff;
  272. border-radius: 24rpx;
  273. font-family: PingFang SC;
  274. .title {
  275. text-align: center;
  276. font-size: 30rpx;
  277. font-weight: bold;
  278. color: #333333;
  279. margin-bottom: 40rpx;
  280. }
  281. .main {
  282. font-size: 30rpx;
  283. font-weight: 500;
  284. color: #666666;
  285. line-height: 48rpx;
  286. margin-bottom: 40rpx;
  287. }
  288. .btn {
  289. display: flex;
  290. justify-content: center;
  291. .btn1 {
  292. width: 200rpx;
  293. height: 80rpx;
  294. line-height: 80rpx;
  295. text-align: center;
  296. background: #f5f5f5;
  297. border-radius: 40px;
  298. font-size: 30rpx;
  299. font-weight: bold;
  300. color: #007aff;
  301. margin: 0 20rpx;
  302. &.submit {
  303. background: #007aff;
  304. color: #fff;
  305. }
  306. }
  307. }
  308. }
  309. </style>