index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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. reportStatus: 0, // 是否线上签署疫情防控承诺书, 1是,0否
  106. };
  107. },
  108. onLoad(option) {
  109. this.applyId = option.applyId || '';
  110. this.goodsId = Number(option.goodsId);
  111. this.gradeId = Number(option.gradeId);
  112. this.orderGoodsId = Number(option.orderGoodsId) || "";
  113. },
  114. onShow() {
  115. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  116. return;
  117. }
  118. if (this.applyId) {
  119. this.getInfo();
  120. } else {
  121. this.getAppoint()
  122. }
  123. },
  124. methods: {
  125. getAppoint() {
  126. this.$http({
  127. url: '/user/subscribe/listSubscribe',
  128. methods: 'get',
  129. data: {
  130. orderGoodsId: this.orderGoodsId,
  131. goodsId: this.goodsId,
  132. }
  133. }).then((res) => {
  134. console.log('----listSubscribe-', res)
  135. if (res.data.code == 200) {
  136. this.applyId = res.data.data.applyId
  137. this.getInfo()
  138. }
  139. })
  140. },
  141. getInfo() {
  142. var data = {
  143. goodsId: this.goodsId,
  144. gradeId: this.gradeId,
  145. orderGoodsId: this.orderGoodsId,
  146. applyId: this.applyId,
  147. };
  148. // /apply/subscribe
  149. this.$api.getApplysubscribe(data).then((res) => {
  150. if (res.data.data.applyStatus) {
  151. res.data.data.applyStatus = res.data.data.applyStatus.split(",");
  152. }
  153. this.listData = res.data.data;
  154. // this.reportStatus = res.data.data.reportStatus
  155. });
  156. },
  157. next() {
  158. if (!this.radioInfo) {
  159. uni.showToast({
  160. title: "请选择您的考试身份",
  161. icon: "none",
  162. });
  163. return;
  164. }
  165. let data = {
  166. applyId: this.listData.applyId,
  167. applyStatus: this.radioInfo,
  168. goodsId: this.goodsId,
  169. applyId: this.applyId,
  170. gradeId: this.gradeId,
  171. orderGoodsId: this.orderGoodsId,
  172. };
  173. this.$api.getApplysubscribeNext(data).then((res) => {
  174. if (res.data.code === 500) {
  175. uni.showModal({
  176. content: res.data.msg,
  177. showCancel: false,
  178. });
  179. } else {
  180. if (res.data.data === 1 || res.data.data === 2) {
  181. this.$navTo.togo("/pages2/appointment/order", {
  182. applyId: this.listData.applyId,
  183. applyStatus: this.radioInfo,
  184. goodsId: this.goodsId,
  185. dataId: res.data.data,
  186. applyId: this.applyId,
  187. orderGoodsId: this.orderGoodsId,
  188. reportStatus: this.reportStatus,
  189. });
  190. }
  191. if (res.data.data === 3) {
  192. this.$api
  193. .goodsList({
  194. makeGoodsId: this.goodsId,
  195. goodsType: 3,
  196. orderGoodsId: this.orderGoodsId,
  197. })
  198. .then((res) => {
  199. if (res.data.code === 200) {
  200. if (res.data.rows.length) {
  201. console.log(res.data.rows[0].goodsId);
  202. this.goodsIdBK = res.data.rows[0].goodsId;
  203. }
  204. }
  205. });
  206. this.showTip = true;
  207. }
  208. }
  209. });
  210. },
  211. submit() {
  212. if (!this.goodsIdBK) {
  213. uni.showModal({
  214. showCancel: false,
  215. content: "请联系管理员配置补考商品",
  216. });
  217. } else {
  218. this.showTip = false;
  219. this.$store.commit("updateBackApplyData", {
  220. goodsId: this.goodsId,
  221. orderGoodsId: this.orderGoodsId,
  222. gradeId: this.gradeId,
  223. applyId: this.applyId,
  224. });
  225. this.$navTo.togo("/pages2/order/confirm_list", {
  226. id: this.goodsIdBK,
  227. isBK: "1",
  228. orderGoodsId: this.orderGoodsId,
  229. });
  230. }
  231. },
  232. },
  233. };
  234. </script>
  235. <style>
  236. page {
  237. background-color: #eaeef1;
  238. }
  239. .appointmentType .u-radio__label {
  240. margin-left: 16rpx !important;
  241. margin-right: 116rpx !important;
  242. }
  243. .tipModel .u-mode-center-box {
  244. background-color: transparent !important;
  245. }
  246. </style>
  247. <style scoped lang="scss">
  248. .appointment {
  249. padding: 16rpx;
  250. .appointmentItem {
  251. background: #ffffff;
  252. border-radius: 16rpx;
  253. margin-bottom: 16rpx;
  254. .item {
  255. padding: 24rpx 0;
  256. }
  257. .labelName {
  258. font-size: 28rpx;
  259. font-family: PingFang SC;
  260. font-weight: 500;
  261. color: #999999;
  262. margin-bottom: 16rpx;
  263. line-height: 1;
  264. }
  265. .valName {
  266. font-size: 30rpx;
  267. font-family: PingFang SC;
  268. font-weight: 500;
  269. color: #333333;
  270. }
  271. }
  272. .appointmentHead {
  273. padding: 16rpx;
  274. .imgBox {
  275. overflow: hidden;
  276. image {
  277. border-radius: 24rpx;
  278. display: block;
  279. width: 100%;
  280. }
  281. }
  282. .title {
  283. padding: 24rpx 28rpx 31rpx 31rpx;
  284. font-size: 30rpx;
  285. font-weight: bold;
  286. font-family: PingFang SC;
  287. color: #333333;
  288. }
  289. }
  290. .appointmentTime {
  291. padding: 10rpx 30rpx 0;
  292. }
  293. .appointmentMajor {
  294. padding: 34rpx 30rpx 24rpx;
  295. }
  296. .appointmentInfo {
  297. padding: 8rpx 30rpx;
  298. }
  299. .appointmentType {
  300. padding: 8rpx 30rpx 4rpx;
  301. .u-radio__label {
  302. margin-left: 16rpx;
  303. margin-right: 116rpx;
  304. }
  305. }
  306. .btn {
  307. width: 526rpx;
  308. height: 80rpx;
  309. line-height: 80rpx;
  310. background: #007aff;
  311. border-radius: 40rpx;
  312. font-size: 30rpx;
  313. font-family: PingFang SC;
  314. font-weight: bold;
  315. color: #ffffff;
  316. margin: 40rpx auto;
  317. text-align: center;
  318. }
  319. }
  320. .tipBox {
  321. width: 640rpx;
  322. padding: 30rpx 36rpx 40rpx;
  323. background: #ffffff;
  324. border-radius: 24rpx;
  325. font-family: PingFang SC;
  326. .title {
  327. text-align: center;
  328. font-size: 30rpx;
  329. font-weight: bold;
  330. color: #333333;
  331. margin-bottom: 40rpx;
  332. }
  333. .main {
  334. font-size: 30rpx;
  335. font-weight: 500;
  336. color: #666666;
  337. line-height: 48rpx;
  338. margin-bottom: 40rpx;
  339. }
  340. .btn {
  341. display: flex;
  342. justify-content: center;
  343. .btn1 {
  344. width: 200rpx;
  345. height: 80rpx;
  346. line-height: 80rpx;
  347. text-align: center;
  348. background: #f5f5f5;
  349. border-radius: 40px;
  350. font-size: 30rpx;
  351. font-weight: bold;
  352. color: #007aff;
  353. margin: 0 20rpx;
  354. &.submit {
  355. background: #007aff;
  356. color: #fff;
  357. }
  358. }
  359. }
  360. }
  361. </style>