index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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. console.log('reportStatus', this.reportStatus)
  156. });
  157. },
  158. next() {
  159. if (!this.radioInfo) {
  160. uni.showToast({
  161. title: "请选择您的考试身份",
  162. icon: "none",
  163. });
  164. return;
  165. }
  166. let data = {
  167. applyId: this.listData.applyId,
  168. applyStatus: this.radioInfo,
  169. goodsId: this.goodsId,
  170. applyId: this.applyId,
  171. gradeId: this.gradeId,
  172. orderGoodsId: this.orderGoodsId,
  173. };
  174. this.$api.getApplysubscribeNext(data).then((res) => {
  175. if (res.data.code === 500) {
  176. uni.showModal({
  177. content: res.data.msg,
  178. showCancel: false,
  179. });
  180. } else {
  181. if (res.data.data === 1 || res.data.data === 2) {
  182. this.$navTo.togo("/pages2/appointment/order", {
  183. applyId: this.listData.applyId,
  184. applyStatus: this.radioInfo,
  185. goodsId: this.goodsId,
  186. dataId: res.data.data,
  187. applyId: this.applyId,
  188. orderGoodsId: this.orderGoodsId,
  189. reportStatus: this.reportStatus,
  190. });
  191. }
  192. if (res.data.data === 3) {
  193. this.$api
  194. .goodsList({
  195. makeGoodsId: this.goodsId,
  196. goodsType: 3,
  197. orderGoodsId: this.orderGoodsId,
  198. })
  199. .then((res) => {
  200. if (res.data.code === 200) {
  201. if (res.data.rows.length) {
  202. console.log(res.data.rows[0].goodsId);
  203. this.goodsIdBK = res.data.rows[0].goodsId;
  204. }
  205. }
  206. });
  207. this.showTip = true;
  208. }
  209. }
  210. });
  211. },
  212. submit() {
  213. if (!this.goodsIdBK) {
  214. uni.showModal({
  215. showCancel: false,
  216. content: "请联系管理员配置补考商品",
  217. });
  218. } else {
  219. this.showTip = false;
  220. this.$store.commit("updateBackApplyData", {
  221. goodsId: this.goodsId,
  222. orderGoodsId: this.orderGoodsId,
  223. gradeId: this.gradeId,
  224. applyId: this.applyId,
  225. });
  226. this.$navTo.togo("/pages2/order/confirm_list", {
  227. id: this.goodsIdBK,
  228. isBK: "1",
  229. orderGoodsId: this.orderGoodsId,
  230. });
  231. }
  232. },
  233. },
  234. };
  235. </script>
  236. <style>
  237. page {
  238. background-color: #eaeef1;
  239. }
  240. .appointmentType .u-radio__label {
  241. margin-left: 16rpx !important;
  242. margin-right: 116rpx !important;
  243. }
  244. .tipModel .u-mode-center-box {
  245. background-color: transparent !important;
  246. }
  247. </style>
  248. <style scoped lang="scss">
  249. .appointment {
  250. padding: 16rpx;
  251. .appointmentItem {
  252. background: #ffffff;
  253. border-radius: 16rpx;
  254. margin-bottom: 16rpx;
  255. .item {
  256. padding: 24rpx 0;
  257. }
  258. .labelName {
  259. font-size: 28rpx;
  260. font-family: PingFang SC;
  261. font-weight: 500;
  262. color: #999999;
  263. margin-bottom: 16rpx;
  264. line-height: 1;
  265. }
  266. .valName {
  267. font-size: 30rpx;
  268. font-family: PingFang SC;
  269. font-weight: 500;
  270. color: #333333;
  271. }
  272. }
  273. .appointmentHead {
  274. padding: 16rpx;
  275. .imgBox {
  276. overflow: hidden;
  277. image {
  278. border-radius: 24rpx;
  279. display: block;
  280. width: 100%;
  281. }
  282. }
  283. .title {
  284. padding: 24rpx 28rpx 31rpx 31rpx;
  285. font-size: 30rpx;
  286. font-weight: bold;
  287. font-family: PingFang SC;
  288. color: #333333;
  289. }
  290. }
  291. .appointmentTime {
  292. padding: 10rpx 30rpx 0;
  293. }
  294. .appointmentMajor {
  295. padding: 34rpx 30rpx 24rpx;
  296. }
  297. .appointmentInfo {
  298. padding: 8rpx 30rpx;
  299. }
  300. .appointmentType {
  301. padding: 8rpx 30rpx 4rpx;
  302. .u-radio__label {
  303. margin-left: 16rpx;
  304. margin-right: 116rpx;
  305. }
  306. }
  307. .btn {
  308. width: 526rpx;
  309. height: 80rpx;
  310. line-height: 80rpx;
  311. background: #007aff;
  312. border-radius: 40rpx;
  313. font-size: 30rpx;
  314. font-family: PingFang SC;
  315. font-weight: bold;
  316. color: #ffffff;
  317. margin: 40rpx auto;
  318. text-align: center;
  319. }
  320. }
  321. .tipBox {
  322. width: 640rpx;
  323. padding: 30rpx 36rpx 40rpx;
  324. background: #ffffff;
  325. border-radius: 24rpx;
  326. font-family: PingFang SC;
  327. .title {
  328. text-align: center;
  329. font-size: 30rpx;
  330. font-weight: bold;
  331. color: #333333;
  332. margin-bottom: 40rpx;
  333. }
  334. .main {
  335. font-size: 30rpx;
  336. font-weight: 500;
  337. color: #666666;
  338. line-height: 48rpx;
  339. margin-bottom: 40rpx;
  340. }
  341. .btn {
  342. display: flex;
  343. justify-content: center;
  344. .btn1 {
  345. width: 200rpx;
  346. height: 80rpx;
  347. line-height: 80rpx;
  348. text-align: center;
  349. background: #f5f5f5;
  350. border-radius: 40px;
  351. font-size: 30rpx;
  352. font-weight: bold;
  353. color: #007aff;
  354. margin: 0 20rpx;
  355. &.submit {
  356. background: #007aff;
  357. color: #fff;
  358. }
  359. }
  360. }
  361. }
  362. </style>