index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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 class="btn1 cancel" @click="submitunder">线下申请</view>
  81. </view>
  82. </view>
  83. </u-popup>
  84. </view>
  85. </template>
  86. <script>
  87. import { mapGetters } from "vuex";
  88. export default {
  89. data() {
  90. return {
  91. showTip: false,
  92. radiolist: [
  93. { name: "1", label: "非补考学员" },
  94. { name: "2", label: "补考学员" },
  95. ],
  96. goodsId: 0,
  97. gradeId: 0,
  98. orderGoodsId: "",
  99. applyStatus: "",
  100. applyId: 0,
  101. listData: {
  102. applyStatus: [],
  103. }, //页面数据
  104. radioInfo: "",
  105. goodsIdBK: null, //补考商品ID
  106. reportStatus: 0, // 是否线上签署疫情防控承诺书, 1是,0否
  107. };
  108. },
  109. onLoad(option) {
  110. this.applyId = option.applyId || '';
  111. this.goodsId = Number(option.goodsId);
  112. this.gradeId = Number(option.gradeId);
  113. this.orderGoodsId = Number(option.orderGoodsId) || "";
  114. },
  115. onShow() {
  116. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  117. return;
  118. }
  119. if (this.applyId) {
  120. this.getInfo();
  121. } else {
  122. this.getAppoint()
  123. }
  124. },
  125. methods: {
  126. getAppoint() {
  127. this.$http({
  128. url: '/user/subscribe/listSubscribe',
  129. methods: 'get',
  130. data: {
  131. orderGoodsId: this.orderGoodsId,
  132. goodsId: this.goodsId,
  133. }
  134. }).then((res) => {
  135. console.log('----listSubscribe-', res)
  136. if (res.data.code == 200) {
  137. this.applyId = res.data.data.applyId
  138. this.getInfo()
  139. }
  140. })
  141. },
  142. getInfo() {
  143. var data = {
  144. goodsId: this.goodsId,
  145. gradeId: this.gradeId,
  146. orderGoodsId: this.orderGoodsId,
  147. applyId: this.applyId,
  148. };
  149. // /apply/subscribe
  150. this.$api.getApplysubscribe(data).then((res) => {
  151. if (res.data.data.applyStatus) {
  152. res.data.data.applyStatus = res.data.data.applyStatus.split(",");
  153. }
  154. this.listData = res.data.data;
  155. // this.reportStatus = res.data.data.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. submitunder(){
  234. this.$api
  235. .subscribesaveoffline({
  236. appId: this.applyId,
  237. orderGoodsId: this.orderGoodsId,
  238. })
  239. .then((res) => {
  240. this.showTip=false;
  241. console.log(res)
  242. uni.showModal({
  243. content:res.data.code === 200?'申请成功,请等待管理员审核': res.data.msg,
  244. showCancel: false,
  245. complete: () => {
  246. uni.navigateBack();
  247. }
  248. });
  249. });
  250. },
  251. },
  252. };
  253. </script>
  254. <style>
  255. page {
  256. background-color: #eaeef1;
  257. }
  258. .appointmentType .u-radio__label {
  259. margin-left: 16rpx !important;
  260. margin-right: 116rpx !important;
  261. }
  262. .tipModel .u-mode-center-box {
  263. background-color: transparent !important;
  264. }
  265. </style>
  266. <style scoped lang="scss">
  267. .appointment {
  268. padding: 16rpx;
  269. .appointmentItem {
  270. background: #ffffff;
  271. border-radius: 16rpx;
  272. margin-bottom: 16rpx;
  273. .item {
  274. padding: 24rpx 0;
  275. }
  276. .labelName {
  277. font-size: 28rpx;
  278. font-family: PingFang SC;
  279. font-weight: 500;
  280. color: #999999;
  281. margin-bottom: 16rpx;
  282. line-height: 1;
  283. }
  284. .valName {
  285. font-size: 30rpx;
  286. font-family: PingFang SC;
  287. font-weight: 500;
  288. color: #333333;
  289. }
  290. }
  291. .appointmentHead {
  292. padding: 16rpx;
  293. .imgBox {
  294. overflow: hidden;
  295. image {
  296. border-radius: 24rpx;
  297. display: block;
  298. width: 100%;
  299. }
  300. }
  301. .title {
  302. padding: 24rpx 28rpx 31rpx 31rpx;
  303. font-size: 30rpx;
  304. font-weight: bold;
  305. font-family: PingFang SC;
  306. color: #333333;
  307. }
  308. }
  309. .appointmentTime {
  310. padding: 10rpx 30rpx 0;
  311. }
  312. .appointmentMajor {
  313. padding: 34rpx 30rpx 24rpx;
  314. }
  315. .appointmentInfo {
  316. padding: 8rpx 30rpx;
  317. }
  318. .appointmentType {
  319. padding: 8rpx 30rpx 4rpx;
  320. .u-radio__label {
  321. margin-left: 16rpx;
  322. margin-right: 116rpx;
  323. }
  324. }
  325. .btn {
  326. width: 526rpx;
  327. height: 80rpx;
  328. line-height: 80rpx;
  329. background: #007aff;
  330. border-radius: 40rpx;
  331. font-size: 30rpx;
  332. font-family: PingFang SC;
  333. font-weight: bold;
  334. color: #ffffff;
  335. margin: 40rpx auto;
  336. text-align: center;
  337. }
  338. }
  339. .tipBox {
  340. width: 640rpx;
  341. padding: 30rpx 36rpx 40rpx;
  342. background: #ffffff;
  343. border-radius: 24rpx;
  344. font-family: PingFang SC;
  345. .title {
  346. text-align: center;
  347. font-size: 30rpx;
  348. font-weight: bold;
  349. color: #333333;
  350. margin-bottom: 40rpx;
  351. }
  352. .main {
  353. font-size: 30rpx;
  354. font-weight: 500;
  355. color: #666666;
  356. line-height: 48rpx;
  357. margin-bottom: 40rpx;
  358. }
  359. .btn {
  360. display: flex;
  361. justify-content: center;
  362. .btn1 {
  363. width: 200rpx;
  364. height: 80rpx;
  365. line-height: 80rpx;
  366. text-align: center;
  367. background: #f5f5f5;
  368. border-radius: 40px;
  369. font-size: 30rpx;
  370. font-weight: bold;
  371. color: #007aff;
  372. margin: 0 20rpx;
  373. &.submit {
  374. background: #007aff;
  375. color: #fff;
  376. }
  377. }
  378. }
  379. }
  380. </style>