index.vue 7.1 KB

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