"use strict"; const common_vendor = require("../../common/vendor.js"); const _sfc_main = { data() { return { //more 上拉加载更多 //loading 加载中 //no-more 没有更多数据 status: "no-more", //订单编号 orderNo: "", //点击手机号查看还是订单号查看 tabFlag: "phone", //手机号 phone: "", code: "", verification: null, //时间标志 time: null, //倒计时数字 timeCount: 60, //显示倒计时还是发送验证码 sendCodeFlag: "发送验证码", historyList: [], pageNum: 1, pageSize: 10 }; }, onReachBottom() { console.log("滑动到距离底部100px的时候触发,可以放 。。业务逻辑"); }, methods: { tabClick(val) { if (val == 1) { this.tabFlag = "phone"; } else { this.tabFlag = "order"; } }, //对订单号进行校验 checkOrder() { if (this.orderNo == null || this.orderNo == "") { common_vendor.index.showToast({ title: "订单编号不能为空", icon: "error" }); return; } }, //对手机号进行校验 checkPhone() { var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/; if (phoneReg.test(this.phone)) { return true; } else { common_vendor.index.showToast({ title: "请输入正确手机号", icon: "error" }); return false; } }, // 校验短信验证码 checkCode() { let reg = /^[0-9]\d{5}$/; if (reg.test(this.code)) { return true; } else { common_vendor.index.showToast({ title: "请输入6位短信验证码", icon: "error" }); return false; } }, sendCode() { if (!this.checkPhone()) { return; } if (this.sendCodeFlag == "重新发送" || this.sendCodeFlag == "发送验证码") { this.timeCount = 60; clearInterval(this.time); this.sendCodeFlag = this.timeCount + "s"; this.time = setInterval(() => { this.timeCount -= 1; this.sendCodeFlag = this.timeCount + "s"; if (this.timeCount == 0) { clearInterval(this.time); this.sendCodeFlag = "重新发送"; } }, 1e3); this.$request.get({ url: "user/authCode", loadingTip: "加载中...", data: { phone: this.phone } }).then((res) => { if (res.code == 200) { this.verification = res.data; common_vendor.index.showToast({ title: "验证码已发送", icon: "success" }); } }); } }, immediateQuery(val) { if (val == "1") { this.queryByphone(); } else { this.queryByorder(); } }, queryByphone() { if (this.checkPhone() && this.checkCode()) { this.$request.post({ url: "record/getRecordByModelPhone", loadingTip: "加载中...", data: { modelPhone: this.phone, authCode: this.code, pageNum: this.pageNum, pageSize: this.pageSize, verification: this.verification } }).then((res) => { if (res.data) { this.historyList = res.data.orderList; } else { this.historyList = []; common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }).catch((err) => { err = JSON.parse(err); common_vendor.index.showToast({ title: err.msg, icon: "none" }); }); } }, queryByorder() { if (!this.orderNo) { common_vendor.index.showToast({ icon: "none", title: "请输入订单号" }); return; } this.$request.get({ url: `api/orderInfo/queryOrderDetail/${this.orderNo}`, loadingTip: "加载中...", data: {} }).then((res) => { if (res.data) { this.historyList = [res.data]; } else { this.historyList = []; } }); }, goResult(id) { common_vendor.index.navigateTo({ url: `/scaleTestResults/testResults/index?resultId=${id}&messageShare=1` }); }, dialogToggle(type) { this.msgType = type; this.$refs.alertDialog.open(); } } }; if (!Array) { const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput"); const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more"); const _easycom_uni_popup_dialog2 = common_vendor.resolveComponent("uni-popup-dialog"); const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup"); (_easycom_uni_easyinput2 + _easycom_uni_load_more2 + _easycom_uni_popup_dialog2 + _easycom_uni_popup2)(); } const _easycom_uni_easyinput = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.js"; const _easycom_uni_load_more = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.js"; const _easycom_uni_popup_dialog = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.js"; const _easycom_uni_popup = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.js"; if (!Math) { (_easycom_uni_easyinput + _easycom_uni_load_more + _easycom_uni_popup_dialog + _easycom_uni_popup)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return { a: $data.tabFlag == "phone" ? 1 : "", b: $data.tabFlag == "order" ? 1 : "", c: $data.tabFlag == "phone" ? 1 : "", d: $data.tabFlag == "order" ? 1 : "", e: common_vendor.o(($event) => $options.tabClick(1)), f: $data.tabFlag == "order" ? 1 : "", g: $data.tabFlag == "phone" ? 1 : "", h: $data.tabFlag == "order" ? 1 : "", i: $data.tabFlag == "phone" ? 1 : "", j: common_vendor.o(($event) => $options.tabClick(2)), k: common_vendor.o(($event) => $data.phone = $event), l: common_vendor.p({ trim: "all", placeholder: "请输入手机号", ["placeholder-style"]: "font-size:28rpx", modelValue: $data.phone }), m: common_vendor.t($data.sendCodeFlag), n: common_vendor.o(($event) => $options.sendCode()), o: common_vendor.o(common_vendor.m(($event) => $data.code = $event, { number: true }, true)), p: common_vendor.p({ placeholder: "请输入验证码", ["placeholder-style"]: "font-size:28rpx", modelValue: $data.code }), q: common_vendor.o(($event) => $options.immediateQuery(1)), r: $data.tabFlag == "phone", s: common_vendor.o(($event) => $data.orderNo = $event), t: common_vendor.p({ trim: "all", placeholder: "请输入订单号号", ["placeholder-style"]: "font-size:28rpx", modelValue: $data.orderNo }), v: common_vendor.o((...args) => $options.dialogToggle && $options.dialogToggle(...args)), w: common_vendor.o(($event) => $options.immediateQuery(2)), x: $data.tabFlag == "order", y: common_vendor.f($data.historyList, (item, index, i0) => { return { a: common_vendor.t(item.title), b: common_vendor.t(item.orderNo), c: common_vendor.t(item.orderStatus), d: common_vendor.o(($event) => $options.goResult(item.resultId)), e: index }; }), z: common_vendor.p({ status: $data.status }), A: common_vendor.o(_ctx.dialogConfirm), B: common_vendor.o(_ctx.dialogClose), C: common_vendor.p({ type: _ctx.msgType, confirmText: "确定", title: "提示" }), D: common_vendor.sr("alertDialog", "c0552341-4"), E: common_vendor.p({ type: "dialog" }) }; } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c0552341"], ["__file", "E:/psy_web_share/paymentPage/queryByPhone/index.vue"]]); tt.createPage(MiniProgramPage);