index.vue 9.2 KB

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