index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <template>
  2. <div class='phone-order'>
  3. <view class='query_tab'>
  4. <view :class="{'phone_query_tab':tabFlag=='phone','phone_query_tab_no':tabFlag=='order'}"
  5. @click.native='tabClick(1)'>
  6. <text
  7. :class="{'phone_query_tab_font':tabFlag=='phone','phone_query_tab_font_no':tabFlag=='order'}">用手机号查找</text>
  8. </view>
  9. <view :class="{'phone_query_tab':tabFlag=='order','phone_query_tab_no':tabFlag=='phone'}"
  10. @click.native='tabClick(2)'>
  11. <text
  12. :class="{'phone_query_tab_font':tabFlag=='order','phone_query_tab_font_no':tabFlag=='phone'}">用订单号查找</text>
  13. </view>
  14. </view>
  15. <div class='phone-class'>
  16. <div v-show="tabFlag=='phone'">
  17. <div class='phone_tip_t'>请输入支付时的手机号码,即可查看已付款的测试结果:</div>
  18. <div class='page-connent'>
  19. <div class='verification-phone'>
  20. <uni-easyinput class="uni-mt-5 verification-phone1" style='height:40px' trim="all"
  21. placeholder="请输入手机号" v-model='phone' placeholder-style="font-size:28rpx"></uni-easyinput>
  22. </div>
  23. <div class='verification-code'>
  24. <uni-easyinput class="uni-mt-5 verification-code1" placeholder="请输入验证码" v-model.number="code"
  25. placeholder-style="font-size:28rpx">
  26. <template #right><text
  27. style="margin-right:20px;background:#F8F6F7;line-height:35px;color:#03A2AD"
  28. @click='sendCode()'>{{sendCodeFlag}}</text></template>
  29. </uni-easyinput>
  30. </div>
  31. <view style='width:600rpx;text-align:right;color: #767676;font-size: 24rpx;margin-top:20rpx'>没收到验证码?
  32. </view>
  33. <!-- <div class='tip-des'>请输入您在支付时填的手机号~ 如未留下过手机号,请切换用订单号查询</div> -->
  34. <div><button class='phone-button' @click='immediateQuery(1)'>立即查询</button></div>
  35. </div>
  36. </div>
  37. <div v-show="tabFlag=='order'" style='padding-bottom:20px'>
  38. <div style='padding-top:10px;margin-left:10px;' class='order_tip_t'>请输入支付后的订单编号,即可查看已付款的测试结果:</div>
  39. <div class='verification-phone' style='padding-left:10px;padding-right: 10px;margin-top:60rpx;'>
  40. <uni-easyinput class="uni-mt-5 verification-phone1" trim="all" placeholder="请输入订单号号"
  41. v-model='orderNo' placeholder-style="font-size:28rpx"></uni-easyinput>
  42. </div>
  43. <view @click="dialogToggle"
  44. style='width: 600rpx; margin: 40rpx auto; text-align: right;color:#767676;font-size: 24rpx;'>
  45. 不知道订单编号?</view>
  46. <div style='padding-left:10px;padding-right:10px;'><button class='phone-button'
  47. @click='immediateQuery(2)'>立即查询</button></div>
  48. </div>
  49. </div>
  50. <div class="history-all">
  51. <view class='main_scale_njhd'>
  52. <img class='main_xing_left'
  53. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/xing_left2.png" />
  54. <view class='main_scale_font_njhd'>历史订单</view>
  55. <img class='main_xing_right'
  56. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/xing_right2.png" />
  57. </view>
  58. <div v-for="(item ,index) in historyList " :key="index" class='history-tab'>
  59. <div class='history-name'>
  60. {{item.title}}
  61. </div>
  62. <div class='history-num'>
  63. <div>订单编号:</div>
  64. <div class='history-order-des'>{{item.orderNo}}</div>
  65. </div>
  66. <div class='history-status'>
  67. <div class='history-status-font'>订单状态:</div>
  68. <div class='history-status-des'>{{item.orderStatus}}</div>
  69. </div>
  70. <div class='view-report-out'><button class='view-report' @click="goResult(item.resultId)"
  71. size='mini'>立即查看</button></div>
  72. </div>
  73. <view><uni-load-more :status="status" /></view>
  74. </div>
  75. <!-- 提示窗示例 -->
  76. <uni-popup ref="alertDialog" type="dialog">
  77. <uni-popup-dialog :type="msgType" confirmText="确定" title="提示" @confirm="dialogConfirm" @close="dialogClose">
  78. <image src="https://test.jue-ming.com:8849/api/show?filePath=./webo/order_no.png" mode="widthFix"
  79. style="width: 600rpx;"></image>
  80. </uni-popup-dialog>
  81. </uni-popup>
  82. </div>
  83. </template>
  84. <script>
  85. export default {
  86. data() {
  87. return {
  88. //more 上拉加载更多
  89. //loading 加载中
  90. //no-more 没有更多数据
  91. status: 'no-more',
  92. //订单编号
  93. orderNo: '',
  94. //点击手机号查看还是订单号查看
  95. tabFlag: 'phone',
  96. //手机号
  97. phone: '',
  98. code: '',
  99. verification: null,
  100. //时间标志
  101. time: null,
  102. //倒计时数字
  103. timeCount: 60,
  104. //显示倒计时还是发送验证码
  105. sendCodeFlag: '发送验证码',
  106. historyList: [
  107. ],
  108. pageNum: 1,
  109. pageSize: 10
  110. }
  111. },
  112. onReachBottom() {
  113. console.log('滑动到距离底部100px的时候触发,可以放 。。业务逻辑');
  114. },
  115. methods: {
  116. tabClick(val) {
  117. if (val == 1) {
  118. this.tabFlag = 'phone'
  119. } else {
  120. this.tabFlag = 'order'
  121. }
  122. },
  123. //对订单号进行校验
  124. checkOrder() {
  125. if (this.orderNo == null || this.orderNo == '') {
  126. uni.showToast({
  127. title: '订单编号不能为空',
  128. icon: 'error'
  129. })
  130. return;
  131. }
  132. },
  133. //对手机号进行校验
  134. checkPhone() {
  135. var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;
  136. if (phoneReg.test(this.phone)) {
  137. return true;
  138. } else {
  139. uni.showToast({
  140. title: '请输入正确手机号',
  141. icon: 'error'
  142. })
  143. return false;
  144. }
  145. },
  146. // 校验短信验证码
  147. checkCode() {
  148. let reg = /^[0-9]\d{5}$/;
  149. if (reg.test(this.code)) {
  150. return true;
  151. } else {
  152. uni.showToast({
  153. title: '请输入6位短信验证码',
  154. icon: 'error'
  155. })
  156. return false;
  157. }
  158. },
  159. sendCode() {
  160. if (!this.checkPhone()) {
  161. return;
  162. }
  163. if (this.sendCodeFlag == '重新发送' || this.sendCodeFlag == '发送验证码') {
  164. this.timeCount = 60;
  165. clearInterval(this.time)
  166. //起一个定时器开始倒计时
  167. this.sendCodeFlag = this.timeCount + 's'
  168. this.time = setInterval(() => {
  169. this.timeCount -= 1;
  170. this.sendCodeFlag = this.timeCount + 's'
  171. //如果倒计时为0时则停止倒计时
  172. if (this.timeCount == 0) {
  173. clearInterval(this.time)
  174. this.sendCodeFlag = '重新发送'
  175. }
  176. }, 1000)
  177. this.$request.get({
  178. url: 'user/authCode',
  179. loadingTip: "加载中...",
  180. data: {
  181. phone: this.phone
  182. },
  183. }).then((res) => {
  184. if (res.code == 200) {
  185. this.verification = res.data;
  186. uni.showToast({
  187. title: '验证码已发送',
  188. icon: 'success',
  189. })
  190. }
  191. })
  192. }
  193. },
  194. immediateQuery(val) {
  195. if (val == '1') {
  196. //参数传输手机号和验证码,然后后台进行查询
  197. this.queryByphone();
  198. } else {
  199. //参数查询订单号,然后后台进行查询
  200. this.queryByorder();
  201. }
  202. },
  203. queryByphone() {
  204. if (this.checkPhone() && this.checkCode()) {
  205. this.$request.post({
  206. url: 'record/getRecordByModelPhone',
  207. loadingTip: "加载中...",
  208. data: {
  209. modelPhone: this.phone,
  210. authCode: this.code,
  211. pageNum: this.pageNum,
  212. pageSize: this.pageSize,
  213. verification: this.verification
  214. }
  215. }).then((res) => {
  216. if (res.data) {
  217. this.historyList = res.data.orderList;
  218. } else {
  219. this.historyList = [];
  220. uni.showToast({
  221. title: res.msg,
  222. icon: 'none'
  223. })
  224. }
  225. }).catch(err => {
  226. err = JSON.parse(err);
  227. uni.showToast({
  228. title: err.msg,
  229. icon: 'none'
  230. })
  231. })
  232. }
  233. },
  234. queryByorder() {
  235. if (!this.orderNo) {
  236. uni.showToast({
  237. icon: 'none',
  238. title: '请输入订单号'
  239. })
  240. return
  241. }
  242. this.$request.get({
  243. url: `api/orderInfo/queryOrderDetail/${this.orderNo}`,
  244. loadingTip: "加载中...",
  245. data: {
  246. }
  247. }).then((res) => {
  248. if (res.data) {
  249. this.historyList = [res.data];
  250. } else {
  251. this.historyList = [];
  252. }
  253. })
  254. },
  255. goResult(id) {
  256. uni.navigateTo({
  257. url: `/scaleTestResults/testResults/index?resultId=${id}&messageShare=1`
  258. })
  259. },
  260. dialogToggle(type) {
  261. this.msgType = type
  262. this.$refs.alertDialog.open()
  263. }
  264. }
  265. }
  266. </script>
  267. <style scoped>
  268. .phone-order {
  269. max-width: 750rpx;
  270. background: linear-gradient(180deg, #D8FFF2 0%, #46E2ED 42%, #BEFFE8 98%);
  271. padding-top: 30px;
  272. padding-left: 10px;
  273. padding-right: 10px;
  274. min-height: 100vh;
  275. }
  276. .phone-order-tab {
  277. z-index: 0;
  278. position: relative;
  279. display: flex;
  280. flex-direction: row;
  281. }
  282. .phone1 {
  283. position: absolute;
  284. width: 3.5rem;
  285. height: 1.2rem;
  286. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/phone1.png) no-repeat 50%;
  287. background-size: 100% 100%;
  288. left: 0;
  289. }
  290. .phone2 {
  291. position: absolute;
  292. width: 3.5rem;
  293. height: 1.1rem;
  294. z-index: -1;
  295. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/phone2.png) no-repeat 50%;
  296. background-size: 100% 100%;
  297. left: 0;
  298. top: 0.1rem;
  299. }
  300. .order1 {
  301. position: absolute;
  302. width: 3.5rem;
  303. height: 1.2rem;
  304. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/order1.png) no-repeat 50%;
  305. background-size: 100% 100%;
  306. right: 0;
  307. }
  308. .order2 {
  309. position: absolute;
  310. width: 3.5rem;
  311. height: 1.1rem;
  312. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/order2.png) no-repeat 50%;
  313. background-size: 100% 100%;
  314. z-index: -1;
  315. top: 0.1rem;
  316. right: 0;
  317. }
  318. .phone-1 {
  319. margin-top: 20px;
  320. margin-left: 15px;
  321. font-size: 18px;
  322. font-weight: 700;
  323. }
  324. .phone-2 {
  325. color: #a95842;
  326. margin-top: 18px;
  327. margin-left: 15px;
  328. font-size: 18px;
  329. font-weight: 700;
  330. }
  331. .order-1 {
  332. text-align: center;
  333. font-size: 18px;
  334. font-weight: 700;
  335. }
  336. .order-2 {
  337. color: #a95842;
  338. margin-top: 18px;
  339. margin-left: 40px;
  340. font-size: 18px;
  341. font-weight: 700;
  342. }
  343. .phone-class {
  344. background-color: #ffffff;
  345. border-bottom-left-radius: 10px;
  346. border-bottom-right-radius: 10px;
  347. }
  348. .page-connent {
  349. padding-top: 5px;
  350. padding-bottom: 20px;
  351. padding-left: 10px;
  352. padding-right: 10px;
  353. border-radius: 10px;
  354. }
  355. .verification-phone1>>>uni-view {
  356. width: 600rpx;
  357. height: 80rpx;
  358. background: #F8F6F7 !important;
  359. border-radius: 20rpx 20rpx 20rpx 20rpx;
  360. opacity: 1;
  361. margin: 0 auto;
  362. border: none;
  363. }
  364. .verification-code1>>>uni-view {
  365. width: 600rpx;
  366. height: 80rpx;
  367. background: #F8F6F7 !important;
  368. border-radius: 20rpx 20rpx 20rpx 20rpx;
  369. opacity: 1;
  370. margin: 0 auto;
  371. border: none;
  372. }
  373. .phone-button {
  374. width: 616rpx;
  375. background: linear-gradient(270deg, #00D8E7 0%, #069EBC 100%);
  376. box-shadow: inset 0rpx 0rpx 0rpx 0rpx rgba(47, 146, 255, 0.1936);
  377. border-radius: 73rpx 73rpx 73rpx 73rpx;
  378. opacity: 1;
  379. margin: 94rpx auto 60rpx;
  380. font-size: 32rpx;
  381. font-family: Source Han Sans-Regular, Source Han Sans;
  382. font-weight: 400;
  383. color: #FFFFFF;
  384. line-height: 80rpx;
  385. }
  386. .verification-code {
  387. margin-top: 46rpx;
  388. }
  389. .verification-phone {
  390. margin-top: 20px;
  391. }
  392. .verification-phone>>>.content-clear-icon {
  393. color: #57eded !important;
  394. border: 0px;
  395. }
  396. .tip-des {
  397. padding-top: 10px;
  398. font-size: 10px;
  399. }
  400. .history-tip {
  401. display: flex;
  402. justify-content: center;
  403. margin-top: 10px;
  404. margin-bottom: 20px;
  405. }
  406. .history-name {
  407. color: #656C74;
  408. font-size: 16px;
  409. line-height: 23px;
  410. margin-bottom: 10px;
  411. }
  412. .history-tab {
  413. background-color: #ffffff;
  414. border-radius: 10px;
  415. padding-left: 10px;
  416. padding-top: 10px;
  417. padding-bottom: 10px;
  418. margin-bottom: 20px;
  419. }
  420. .history-num {
  421. display: flex;
  422. font-size: 14px;
  423. font-family: Source Han Sans-Regular, Source Han Sans;
  424. font-weight: 400;
  425. color: #656C74;
  426. line-height: 20px;
  427. }
  428. .history-status {
  429. margin-top: 5px;
  430. display: flex;
  431. }
  432. .history-status-des {
  433. margin-left: 10px;
  434. font-size: 14px;
  435. font-family: Source Han Sans-Regular, Source Han Sans;
  436. font-weight: 400;
  437. line-height: 20px;
  438. background-image: -webkit-linear-gradient(top, #bc2f08, #d75d10, #de6912);
  439. -webkit-background-clip: text;
  440. -webkit-text-fill-color: transparent;
  441. }
  442. .history-order-des {
  443. margin-left: 10px;
  444. }
  445. .view-report {
  446. margin-top: 10px;
  447. margin-left: unset;
  448. margin-right: 12px;
  449. color: #ffffff;
  450. background: #E1FDFF;
  451. border: 1px solid #069EBC;
  452. color: #069EBC;
  453. border-radius: 36px;
  454. height: 40px;
  455. font-size: 16px;
  456. }
  457. .view-report-out {
  458. display: flex;
  459. justify-content: flex-end;
  460. }
  461. .history-all {
  462. padding-bottom: 20px;
  463. }
  464. .query_tab {
  465. display: flex;
  466. }
  467. .phone_query_tab {
  468. flex: 1;
  469. background: linear-gradient(180deg, #FFFFFF, #D6F69F);
  470. height: 40px;
  471. text-align: center;
  472. }
  473. .phone_query_tab_no {
  474. flex: 1;
  475. background: linear-gradient(180deg, #FFFFFF, #E2E2E2);
  476. height: 40px;
  477. text-align: center;
  478. }
  479. .phone_query_tab_font {
  480. line-height: 40px;
  481. color: #03A2AD;
  482. font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
  483. font-weight: 400;
  484. font-size: 20px;
  485. }
  486. .phone_query_tab_font_no {
  487. line-height: 40px;
  488. color: #767676;
  489. font-family: AlibabaPuHuiTi-Regular, AlibabaPuHuiTi;
  490. font-weight: 400;
  491. font-size: 20px;
  492. }
  493. .phone_tip_t {
  494. font-size: 24rpx;
  495. font-family: Source Han Sans-Regular, Source Han Sans;
  496. font-weight: 400;
  497. color: #656C74;
  498. line-height: 34rpx;
  499. text-align: center;
  500. padding-top: 44rpx;
  501. }
  502. .order_tip_t {
  503. font-size: 24rpx;
  504. font-family: Source Han Sans-Regular, Source Han Sans;
  505. font-weight: 400;
  506. color: #656C74;
  507. line-height: 34rpx;
  508. text-align: center;
  509. margin: 60rpx 0;
  510. }
  511. .main_scale_njhd {
  512. margin-top: 39px;
  513. display: flex;
  514. justify-content: center;
  515. align-items: center;
  516. margin-bottom: 20px;
  517. }
  518. .main_scale_font_njhd {
  519. font-size: 16px;
  520. font-family: AlibabaPuHuiTi-Heavy, AlibabaPuHuiTi;
  521. font-weight: 900;
  522. color: #000000;
  523. line-height: 30px;
  524. }
  525. .main_xing_left {
  526. height: 30px;
  527. width: 20px;
  528. margin-right: 20px;
  529. }
  530. .main_xing_right {
  531. height: 30px;
  532. width: 20px;
  533. margin-left: 20px;
  534. }
  535. .history-status-font {
  536. font-size: 14px;
  537. font-family: Source Han Sans-Regular, Source Han Sans;
  538. font-weight: 400;
  539. color: #656C74;
  540. line-height: 20px;
  541. }
  542. /deep/ .uni-easyinput__content {
  543. font-size: 32rpx;
  544. }
  545. /deep/ .uni-easyinput__content-input {
  546. font-size: 32rpx;
  547. }
  548. </style>