index.vue 9.3 KB

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