orderdetails.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. <template>
  2. <view class="pages">
  3. <view class="" :style="{height: navHeight+'px' }"></view>
  4. <view class="navbar-box">
  5. <u-navbar title="订单详情" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#fff'}" leftIconColor="#fff" bgColor="transparent"></u-navbar>
  6. </view>
  7. <u-loading-page :loading="loadingPage"></u-loading-page>
  8. <view class="page-wrap">
  9. <view class="status-content">
  10. <view class="status-item" v-if="orderDetails.status==0">
  11. <view class="text"><text v-if="countdown!='支付超期'"> 请尽快完成付款,还剩 </text>{{countdown}}</view>
  12. <view class="btn-wrap u-flex u-row-center" v-if="countdown!='支付超期'">
  13. <view class="btn cancel" @click="cancelOrder">取消订单</view>
  14. <view class="btn" @click="gotoPay(orderDetails.id)">立即支付</view>
  15. </view>
  16. </view>
  17. <view class="status-item" v-else-if="orderDetails.status==3">
  18. <view class="text"><text v-if="countdown!='演出已开始'">距离演出开始,还剩 </text>{{countdown}}</view>
  19. </view>
  20. <view class="status-item" v-else-if="orderDetails.status==6">
  21. <view class="text"><text>退款失败: </text>{{refundInfo.errReason}}</view>
  22. </view>
  23. <view class="status-item" v-else>
  24. <view class="text">{{orderDetails.status|filterOrderState}}</view>
  25. </view>
  26. </view>
  27. <view class="base-info">
  28. <view class="top u-flex u-row-between">
  29. <view class="name">{{orderDetails.theatreName}}</view>
  30. <!-- <view class="icon-wrap u-flex">
  31. <u-icon name="phone-fill" color="#999999" size="42rpx"></u-icon>
  32. <u-icon name="map-fill" color="#999999" size="42rpx"></u-icon>
  33. </view> -->
  34. </view>
  35. <view class="info u-flex u-row-between">
  36. <image class="img" :src="orderDetails.performImg"></image>
  37. <view class="text">
  38. <view class="name u-flex u-row-between">
  39. {{orderDetails.performName}}
  40. <!-- <text class="status">{{orderDetails.status|filterOrderState}}</text> -->
  41. </view>
  42. <view class="time">{{orderDetails.performDate}} {{orderDetails.performTimeStart}}</view>
  43. <view class="position u-flex u-row-between">
  44. <view class="">{{orderDetails.goodsName}}/{{orderDetails.seatTypeName}}</view>
  45. <view class="">X {{orderDetails.viewerNum}}</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="box qr-wrap" v-if="orderDetails.parentQrcodeStatus==0">
  51. <view class="title">二维码</view>
  52. <view class="qr-content">
  53. <view class="img-wrap">
  54. <!-- <image class="img" :src="orderDetails.performImg"></image> -->
  55. <view class="ayQrcode" @click="refreshCode">
  56. <ayQrcode v-show="!showSingleQR" ref="qrcode" :modal="modal_qr" :url="qrContent" @hideQrcode="hideQrcode" :height="180" :width="180" />
  57. </view>
  58. <!-- <image v-if="orderDetails.status==4" class="refund-ico" :src="staticUrl+'/img/refund-ico.png'"></image> -->
  59. </view>
  60. <!-- <view class="">{{orderDetails.viewersList.length}}张演出票</view> -->
  61. <!-- order-num del-line -->
  62. <view class="order-num">取票号:{{orderDetails.parentQrcodeNo}}</view>
  63. </view>
  64. </view>
  65. <view class="box viewers-list">
  66. <view class="title">观影人员</view>
  67. <view class="item u-flex u-row-around" v-for="(item,index) in orderDetails.viewersList" :key="index">
  68. <text>观影人员{{index + 1}}</text>
  69. <text style="width: 96rpx;">{{item.name}}</text>
  70. <text>{{item.idcard|maskID}}</text>
  71. <text v-if="orderDetails.status==3" @click="singleQR(item,index)" class="qrbtn">查看二维码</text>
  72. </view>
  73. </view>
  74. <view class="box order-info">
  75. <view class="title u-flex u-row-between">
  76. 订单信息
  77. <text class="btn" v-if="orderDetails.status==3" @click="refund">申请退款</text>
  78. </view>
  79. <view class="order-info-item" v-for="(item,index) in orderInfo[orderDetails.status]" :key="index">
  80. <text class="til">{{item.name}}</text>
  81. <text class="con">
  82. <text v-if="item.key=='payType'">{{orderDetails[item.key]|filterPayType}}</text>
  83. <text v-else-if="item.key=='realPrice'"> ¥ {{orderDetails[item.key]}}</text>
  84. <text v-else>{{orderDetails[item.key]}}</text>
  85. <text class="copy-btn" @click="copyOrderNum(orderDetails[item.key])" v-if="item.key=='orderNum'">复制</text>
  86. </text>
  87. </view>
  88. </view>
  89. <view class="box order-info refundInfo" v-if="orderDetails.status==4||orderDetails.status==5||orderDetails.status==6">
  90. <view class="title u-flex u-row-between">
  91. 退款信息
  92. </view>
  93. <view class="order-info-item">
  94. <text class="til">退款单号</text>
  95. <text class="con">{{refundInfo.id}}</text>
  96. <text class="copy-btn" @click="copyOrderNum(refundInfo.id)" >复制</text>
  97. </view>
  98. <view class="order-info-item">
  99. <text class="til">申请时间</text>
  100. <text class="con">{{refundInfo.refundTime}}</text>
  101. </view>
  102. <view class="order-info-item">
  103. <text class="til">订单金额</text>
  104. <text class="con">¥ {{refundInfo.orderAmount}}</text>
  105. </view>
  106. <view class="order-info-item">
  107. <text class="til">退款金额</text>
  108. <text class="con">¥ {{refundInfo.refundAmount}}</text>
  109. </view>
  110. <view class="order-info-item">
  111. <text class="til">退款原因</text>
  112. <text class="con">{{refundInfo.refundReason}}</text>
  113. </view>
  114. <view class="order-info-item" v-if="orderDetails.status==6">
  115. <text class="til">失败原因</text>
  116. <text class="con">{{refundInfo.errReason}}</text>
  117. </view>
  118. <view class="order-info-item">
  119. <text class="til">退款状态</text>
  120. <text class="con">{{refundInfo.status|filterRefundState}}</text>
  121. </view>
  122. </view>
  123. <view class="box tips">
  124. <view class="title">观影须知</view>
  125. <u-parse :content="formerNotice"></u-parse>
  126. <!-- <view class="tips-item" v-for="(item,index) in tipsArr" :key="index">
  127. {{item}}
  128. </view> -->
  129. </view>
  130. </view>
  131. <u-popup :show="showSingleQR" @close="closeSingleQR" @open="openSingleQR" @touchmove.stop.prevent="handleMoveQrcode" :round="10" mode="center">
  132. <view class="singleQR-wrap">
  133. <view class="title">
  134. 二维码
  135. <!-- <u-icon class="close" @click="closeSingleQR" name="close" color="#333" size="36rpx"></u-icon> -->
  136. </view>
  137. <view class="single-info">
  138. <view class="item">姓名:{{singleInfo.name}}</view>
  139. <view class="item">身份证号码:{{singleInfo.idcard|maskID}}</view>
  140. <view class="item">座位:{{singleInfo.seatName}}</view>
  141. <view class="item">状态:{{singleInfo.status|filterSingleState}}</view>
  142. </view>
  143. <view class="singleQrcode">
  144. <ayQrcode ref="singleqrcode" :modal="singleModalQr" :url="singleQrContent" @hideQrcode="hideSingleQrcode" :height="180" :width="180" />
  145. </view>
  146. <view class="order-num">取票号:{{singleInfo.qrcodeNo}}</view>
  147. </view>
  148. </u-popup>
  149. <u-toast ref="uToast"></u-toast>
  150. </view>
  151. </template>
  152. <script>
  153. import { systemInfo } from "@/mixin.js";
  154. import ayQrcode from "@/components/ay-qrcode/ay-qrcode.vue"
  155. export default {
  156. mixins:[systemInfo],
  157. components:{
  158. ayQrcode
  159. },
  160. data() {
  161. return {
  162. timer: null,
  163. modal_qr: false,
  164. qrContent: {}, // 要生成的二维码值
  165. id:'',
  166. loadingPage:true,
  167. staticUrl:this.$commonConfig.staticUrl,
  168. orderDetails:{},
  169. deadline: null, // 设置截止时间为某个日期的时间戳
  170. countdown: '', // 用于显示倒计时时间
  171. // 状态(0待支付,2超时取消,3支付完成,待使用,4退款中,5己退款,6退款失败,7己使用,8己超期)
  172. orderInfo:{
  173. 0:[{name:'需付金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'}],
  174. 1:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
  175. 2:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
  176. 3:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
  177. 4:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
  178. 5:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'},{name:'备注信息',key:'remark'}],
  179. 6:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'},{name:'备注信息',key:'remark'}],
  180. 7:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payWay'},{name:'支付时间',key:'payTime'}],
  181. 8:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'备注信息',key:'remark'}],
  182. 9:[{name:'订单金额',key:'realPrice'},{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'备注信息',key:'remark'}],
  183. },
  184. tipsArr:[
  185. '1.请提前到达影院现场,找到自助取票机,打印纸质电影票,完成取票',
  186. '2.如现场自助取票机无法打印电影票,请联系影院工作人员处理',
  187. '3.凭打印好的纸质电影票、检票入场观影',
  188. '4.如果订单使用了兑换券,或购买了特殊场次,暂不支持退票和改签'
  189. ],
  190. params:{
  191. },
  192. singleInfo:{idcard:''},//观影人信息
  193. showSingleQR:false,//显示单人二维码
  194. singleModalQr:false,
  195. singleQrContent:{},
  196. formerNotice:'',
  197. countdownTimer:null,//订单倒计时
  198. templateIdList:[],//微信小程序订阅消息
  199. refundInfo:{status:null},//退款信息
  200. }
  201. },
  202. onShow() {
  203. this.getOrderDetails(this.id);
  204. },
  205. onLoad(page) {
  206. console.log('page',page);
  207. this.id = page.id;
  208. this.getSystemInfo();
  209. this.getTemplateIdList();//获取模板列表
  210. },
  211. onUnload() {
  212. // 页面离开时停止计时器
  213. // clearInterval(this.timer)
  214. clearInterval(this.countdownTimer)
  215. },
  216. mounted() {
  217. // 每秒更新倒计时时间
  218. this.countdownTimer = setInterval(() => {
  219. const now = new Date().getTime();
  220. const distance = this.deadline - now;
  221. // console.log('distance',distance);
  222. if(this.orderDetails.status==0 && distance<0){
  223. this.countdown = '支付超期';
  224. return
  225. }else if(this.orderDetails.status==3 && distance<0){
  226. this.countdown = '演出已开始';
  227. return
  228. }
  229. // 计算倒计时时间,可以根据需求自定义显示方式
  230. const days = Math.floor(distance / (1000 * 60 * 60 * 24));
  231. const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  232. const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  233. const seconds = Math.floor((distance % (1000 * 60)) / 1000);
  234. // 更新倒计时时间
  235. this.countdown = `${days}天 ${hours}小时 ${minutes}分钟 ${seconds}秒`;
  236. }, 1000);
  237. },
  238. methods: {
  239. leftClick(e){
  240. let pages = getCurrentPages();
  241. if(pages.length==1){
  242. uni.$u.route('/pages/index/index')
  243. }else{
  244. uni.navigateBack()
  245. };
  246. },
  247. getTemplateIdList(){
  248. this.$u.api.templateIdList({templateLabel:'order_pay'}).then(res=>{
  249. console.log('getTemplateIdList',res.data);
  250. this.templateIdList = res.data.list.map(item=>{
  251. return item.templateId
  252. });
  253. // if(this.templateIdList.length>0){
  254. // this.templateEven();
  255. // }
  256. }).catch(err=>{
  257. console.log('getTemplateIdList',err);
  258. })
  259. },
  260. // 展示二维码
  261. showQrcode() {
  262. let _this = this;
  263. this.modal_qr = true;
  264. // uni.showLoading()
  265. setTimeout(function() {
  266. // uni.hideLoading()
  267. _this.$refs.qrcode.crtQrCode()
  268. }, 50)
  269. },
  270. //传入组件的方法
  271. hideQrcode() {
  272. this.modal_qr = false;
  273. },
  274. refreshCode(){
  275. this.qrContent = {};
  276. this.qrContent.qrcode = this.orderDetails.parentQrcodeNo;
  277. this.qrContent.time = Date.now();
  278. this.qrContent = JSON.stringify(this.qrContent);
  279. this.showQrcode()
  280. },
  281. hideSingleQrcode(){
  282. this.singleModalQr = false;
  283. },
  284. getOrderDetails(id){
  285. this.$u.api.orderDetails({id:id}).then(res=>{
  286. this.loadingPage = false;
  287. this.orderDetails = res.data;
  288. this.refundInfo = res.data.refundInfo||{};
  289. if(res.data.status==0){//待支付
  290. this.deadline = new Date(`${res.data.cancelDateTime}`).getTime();
  291. }else if(res.data.status==3){//待使用
  292. this.deadline = new Date(`${res.data.performDateTime}`).getTime();
  293. }
  294. if(res.data.parentQrcodeStatus==0){
  295. this.qrContent = {};
  296. this.qrContent.qrcode = res.data.parentQrcodeNo;
  297. this.qrContent.time = Date.now();
  298. this.qrContent = JSON.stringify(this.qrContent);
  299. let that = this;
  300. that.showQrcode();//一加载生成二维码
  301. // this.refreshCode()
  302. }
  303. this.getPerformerNotice();
  304. // console.log('this.deadline',this.deadline);
  305. // console.log('orderDetails',JSON.parse(JSON.stringify(res.data)));
  306. }).catch(err=>{
  307. uni.$u.toast('获取数据失败,!请重试')
  308. uni.navigateBack();
  309. console.log('getOrderDetails',err);
  310. })
  311. },
  312. singleQR(item,index){
  313. let that = this;
  314. console.log('singleQR',item);
  315. this.showSingleQR = true;
  316. this.singleInfo = item;
  317. this.singleQrContent = {};
  318. this.singleQrContent.qrcode = item.qrcodeNo;
  319. this.singleQrContent.time = Date.now();
  320. this.singleQrContent = JSON.stringify(this.singleQrContent);
  321. that.showSingleQrcode();//一加载生成二维码
  322. },
  323. // 展示二维码
  324. showSingleQrcode() {
  325. let _this = this;
  326. this.singleModalQr = true;
  327. // uni.showLoading()
  328. setTimeout(function() {
  329. // uni.hideLoading()
  330. _this.$refs.singleqrcode.crtQrCode()
  331. }, 50)
  332. },
  333. closeSingleQR(){
  334. this.showSingleQR = false;
  335. },
  336. openSingleQR(){
  337. },
  338. clickEven(fun,item){
  339. // console.log('fun',fun);
  340. let funObj = {
  341. pay: this.pay,
  342. logistics:this.logistics,
  343. evaluate:this.evaluate,
  344. refund:this.refund,
  345. cancelOrder:this.cancelOrder,
  346. viewRefund:this.viewRefund,
  347. confirmReceipt:this.confirmReceipt
  348. };
  349. // console.log('funObj[fun]',funObj[fun]);
  350. if (fun in funObj) {
  351. funObj[fun](item);
  352. }
  353. },
  354. pay(item){
  355. // this.gotoPay(this.orderDetails.id);
  356. this.setTemplate(this.orderDetails.id);
  357. // console.log('pay',item);
  358. // uni.$u.route('/center/pay', {
  359. // orderId: item.id,
  360. // // openid: that.vuex_wechatOpenid,
  361. // payAmount:item.orderPrice
  362. // });
  363. },
  364. logistics(item){
  365. // console.log('logistics',item);
  366. uni.$u.route('/center/distribution', {
  367. orderId: item.id
  368. });
  369. },
  370. evaluate(item){
  371. // console.log('logistics',item);
  372. uni.$u.route('/shopping/evaluate', {
  373. id: item.id
  374. });
  375. },
  376. refund(item){
  377. console.log('this.orderDetails',this.orderDetails);
  378. uni.$u.route('/center/refund', {
  379. id: this.orderDetails.id,
  380. realPrice:this.orderDetails.realPrice
  381. });
  382. },
  383. cancelOrder(item){
  384. let that = this;
  385. uni.showModal({
  386. title: '提示',
  387. content: '确认取消吗!',
  388. success: res => {
  389. if (res.confirm) {
  390. this.$u.api.cancelOrder({orderId:that.orderDetails.id}).then(res=>{
  391. this.$refs.uToast.show({
  392. message:res.msg,
  393. complete() {
  394. that.getOrderDetails(that.orderDetails.id);
  395. }
  396. });
  397. // uni.$u.toast(res.msg);
  398. console.log('res',res.data);
  399. }).catch(err=>{
  400. console.log('cancelOrder',err);
  401. })
  402. }
  403. }
  404. });
  405. // console.log('logistics',item);
  406. },
  407. confirmReceipt(item){
  408. let that = this;
  409. uni.showModal({
  410. title: '提示',
  411. content: '确认收货吗!',
  412. success: res => {
  413. if (res.confirm) {
  414. this.$u.api.confirmReceipt({orderId:item.id}).then(res=>{
  415. uni.showToast({
  416. title:res.msg,
  417. duration:2000,
  418. complete() {
  419. that.evaluate(item)
  420. that.getOrderDetails(that.id);
  421. }
  422. });
  423. console.log('res',res.data);
  424. }).catch(err=>{
  425. console.log('confirmReceipt',err);
  426. })
  427. }
  428. }
  429. })
  430. },
  431. goMap(){
  432. uni.openLocation({
  433. latitude: Number(this.pickupInfo.pickupLatitude), //维度
  434. longitude: Number(this.pickupInfo.pickupLongitude), //经度
  435. name: "商行地址", //目的地定位名称
  436. scale: 15, //缩放比例
  437. address: this.pickupInfo.pickupAddress //导航详细地址
  438. })
  439. },
  440. copyOrderNum(orderNum){
  441. // console.log('copyOrderNum',orderNum);
  442. uni.setClipboardData({
  443. data: orderNum,
  444. success: function () {
  445. uni.showToast({
  446. title: '复制成功'
  447. });
  448. },
  449. fail(e) {
  450. // console.log('copyOrderNumfail',e);
  451. uni.showToast({
  452. title: '复制失败',
  453. icon:"error"
  454. });
  455. }
  456. });
  457. },
  458. // 设置小程序订阅消息
  459. setTemplate(orderId) {
  460. let that = this;
  461. console.log('templateIdList',this.templateIdList);
  462. uni.requestSubscribeMessage({
  463. tmplIds: that.templateIdList,
  464. success (res) {
  465. // that.gotoPay();
  466. console.log("success:",res);
  467. },
  468. fail (res) {
  469. console.log("fail:",res);
  470. },
  471. complete (res) {
  472. that.gotoPay(orderId);
  473. console.log("complete:",res);
  474. }
  475. })
  476. },
  477. gotoPay(orderId){
  478. this.$u.api.gotoPay({orderId:orderId,openid:''}).then(res=>{
  479. this.payResult = res.data.payInfo;
  480. this.payResult.package = res.data.payInfo.packageValue;
  481. this.wxPay()
  482. // if(this.params.paymentMode==1||this.params.paymentMode==4){
  483. // this.wxPay()
  484. // }else{
  485. // uni.$u.route('/shopping/paysuccess');
  486. // }
  487. console.log('gotoPayres',res.data);
  488. }).catch(err=>{
  489. this.paypass = '';
  490. this.checkPassShow = false;
  491. console.log('gotoPay',err);
  492. })
  493. },
  494. wxPay(){
  495. let that = this;
  496. uni.requestPayment({
  497. ... this.payResult,
  498. "provider": "wxpay",
  499. "orderInfo": {
  500. // "appid": "wx499********7c70e", // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
  501. // "noncestr": "c5sEwbaNPiXAF3iv", // 随机字符串
  502. // "package": "Sign=WXPay", // 固定值
  503. // "partnerid": "148*****52", // 微信支付商户号
  504. // "prepayid": "wx202254********************fbe90000", // 统一下单订单号
  505. // "timestamp": 1597935292, // 时间戳(单位:秒)
  506. // "sign": "A842B45937F6EFF60DEC7A2EAA52D5A0" // 签名,这里用的 MD5/RSA 签名
  507. },
  508. success(res) {
  509. that.payQuery();
  510. },
  511. fail(e) {
  512. console.log('wxPayfail',e);
  513. }
  514. })
  515. },
  516. payQuery(){
  517. let that = this;
  518. let retryCount = 0;
  519. let maxRetryCount = 5; // 设置最大重试次数
  520. let interval = 2000; // 设置间隔时间为2秒
  521. let timeout = 10000; // 设置超时时间为10秒
  522. let timer;
  523. uni.showLoading({
  524. title:'支付结果查询中'
  525. })
  526. timer = setInterval(() => {
  527. retryCount++;
  528. if (retryCount > maxRetryCount || retryCount * interval > timeout) {
  529. clearInterval(timer);
  530. uni.hideLoading();
  531. console.log("支付查询超时或达到最大重试次数");
  532. // 在这里添加超时或达到最大重试次数的处理逻辑
  533. this.reloadList()
  534. } else {
  535. console.log("第" + retryCount + "次查询");
  536. // 调用查询支付状态的方法
  537. // 如果支付状态为成功,则清除定时器并处理成功的逻辑
  538. // 如果支付状态为失败,则清除定时器并处理失败的逻辑
  539. this.$u.api.payQuery({orderId:this.orderId}).then(res=>{
  540. // 0-未支付 1-已支付 2-支付中 3-支付失败 4-支付退款
  541. let payStatus = res.data.payStatus;
  542. if(payStatus===1){
  543. uni.$u.route('/center/paysuccess');
  544. }else if(payStatus===0||payStatus===2){
  545. this.payQuery()
  546. }else if(payStatus===3){
  547. uni.toast('支付失败')
  548. }
  549. clearInterval(timer);
  550. }).catch(err=>{
  551. console.log('payQuery',err);
  552. }).finally(()=>{
  553. uni.hideLoading()
  554. })
  555. }
  556. }, interval);
  557. },
  558. getPerformerNotice(){
  559. this.$u.api.performerNotice({performId:this.orderDetails.performId}).then(res=>{
  560. // console.log('getPerformerNotice',res.data);
  561. this.formerNotice = res.data.performNotice;
  562. }).catch(err=>{
  563. console.log('getPerformerNotice',err);
  564. })
  565. },
  566. handleMoveQrcode(){
  567. console.log('handleMoveQrcode');
  568. return false
  569. }
  570. }
  571. }
  572. </script>
  573. <style>
  574. page{
  575. background: linear-gradient(180deg, #ED0000 0%, #F9FBFD 50%,#F9FBFD 100%);
  576. background-repeat: no-repeat;
  577. }
  578. </style>
  579. <style lang="scss" scoped>
  580. .status-content{
  581. text-align: center;
  582. padding-top: 30rpx;
  583. margin-bottom: 52rpx;
  584. .text{
  585. font-size: 32rpx;
  586. font-weight: 400;
  587. color: #FFFFFF;
  588. margin-bottom: 52rpx;
  589. }
  590. .btn-wrap{
  591. margin-bottom: 40rpx;
  592. .btn{
  593. height: 64rpx;
  594. line-height: 64rpx;
  595. padding: 0 28rpx;
  596. border-radius: 8rpx;
  597. border: 2rpx solid #FFFFFF;
  598. font-size: 24rpx;
  599. font-weight: 500;
  600. color: #FFFFFF;
  601. &.cancel{
  602. border-color: #F9B4B4;
  603. color: #F9B4B4;
  604. }
  605. &:not(:last-of-type){
  606. margin-right: 100rpx;
  607. }
  608. }
  609. }
  610. }
  611. .base-info{
  612. background: #FFFFFF;
  613. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(221,221,221,0.5);
  614. border-radius: 20rpx;
  615. overflow: hidden;
  616. margin-bottom: 24rpx;
  617. .top{
  618. padding: 36rpx 24rpx;
  619. background: #F9FAFD;
  620. font-size: 24rpx;
  621. font-weight: 400;
  622. color: #7F7F7F;
  623. }
  624. .info{
  625. padding: 28rpx 20rpx 30rpx 24rpx;
  626. .img{
  627. width: 180rpx;
  628. height: 160rpx;
  629. }
  630. .text{
  631. font-size: 24rpx;
  632. font-weight: 400;
  633. color: #7F7F7F;
  634. padding-left: 26rpx;
  635. flex: 1;
  636. .name{
  637. font-size: 28rpx;
  638. font-weight: bold;
  639. color: #363636;
  640. margin-bottom: 20rpx;
  641. }
  642. .time{
  643. margin-bottom: 20rpx;
  644. }
  645. .position{
  646. margin-bottom: 20rpx;
  647. }
  648. .status{
  649. font-size: 24rpx;
  650. font-weight: 400;
  651. color: #EE0606;
  652. }
  653. }
  654. }
  655. }
  656. .box{
  657. margin-bottom: 24rpx;
  658. background: #FFFFFF;
  659. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(221,221,221,0.5);
  660. border-radius: 20rpx;
  661. padding: 36rpx 24rpx;
  662. .title{
  663. font-size: 28rpx;
  664. font-weight: bold;
  665. color: #2D2D2D;
  666. padding-bottom: 20rpx;
  667. margin-bottom: 24rpx;
  668. border-bottom: 1px solid #F4F4F4;
  669. .btn{
  670. height: 40rpx;
  671. line-height: 40rpx;
  672. padding: 0 20rpx;
  673. border-radius: 8rpx;
  674. border: 2rpx solid #606060;
  675. font-size: 24rpx;
  676. font-weight: 400;
  677. color: #606060;
  678. cursor: pointer;
  679. }
  680. }
  681. }
  682. .order-info{
  683. .order-info-item{
  684. font-size: 30rpx;
  685. font-weight: 400;
  686. color: #333333;
  687. padding: 10rpx 0;
  688. // &:not(:last-child){
  689. // border-bottom: 0.5px solid #eee;
  690. // }
  691. .til{
  692. font-size: 24rpx;
  693. font-weight: 400;
  694. color: #999999;
  695. margin-right: 40rpx;
  696. }
  697. .copy-btn{
  698. margin-left: 32rpx;
  699. height: 30rpx;
  700. line-height: 30rpx;
  701. padding: 0 14rpx;
  702. border-radius: 8rpx;
  703. font-size: 20rpx;
  704. font-weight: 400;
  705. color: #999999;
  706. background: #EDEDED;
  707. }
  708. }
  709. }
  710. .tips{
  711. .tips-item{
  712. font-size: 24rpx;
  713. font-weight: 400;
  714. color: #7F7F7F;
  715. line-height: 36rpx;
  716. margin-bottom: 20rpx;
  717. }
  718. }
  719. .qr-wrap{
  720. .qr-content{
  721. text-align: center;
  722. font-size: 24rpx;
  723. font-weight: 400;
  724. color: #7F7F7F;
  725. }
  726. .img-wrap{
  727. position: relative;
  728. }
  729. .ayQrcode,.img{
  730. width: 180px;
  731. height: 180px;
  732. display: block;
  733. margin: 0 auto 20rpx;
  734. }
  735. .refund-ico{
  736. width: 200rpx;
  737. height: 152rpx;
  738. position: absolute;
  739. bottom: -10rpx;
  740. right: 60rpx;
  741. }
  742. }
  743. .order-num{
  744. position: relative;
  745. margin: 30rpx auto 0;
  746. font-size: 24rpx;
  747. font-weight: 400;
  748. color: #363636;
  749. border: 1px solid #363636;
  750. padding: 5rpx 20rpx;
  751. border-radius: 8rpx;
  752. width: fit-content;
  753. &.del-line{
  754. color: #BCBCBC;
  755. border: 1px solid #BCBCBC;
  756. }
  757. &.del-line::after{
  758. content: '';
  759. width: 110%;
  760. height: 1px;
  761. background-color: #BCBCBC;
  762. position: absolute;
  763. top: 50%;
  764. left: -5%;
  765. }
  766. }
  767. .viewers-list{
  768. .item{
  769. font-size: 24rpx;
  770. color: #999;
  771. margin-bottom: 10px;
  772. .qrbtn{
  773. color: #EE0606;
  774. }
  775. }
  776. }
  777. .singleQR-wrap{
  778. padding: 0 24rpx 50rpx;
  779. box-sizing: border-box;
  780. min-width: 80vw;
  781. .title{
  782. text-align: center;
  783. height: 94rpx;
  784. line-height: 94rpx;
  785. font-size: 28rpx;
  786. font-weight: bold;
  787. color: #2D2D2D;
  788. border-bottom: 2rpx solid #F4F4F4;
  789. margin-bottom: 24rpx;
  790. }
  791. .single-info{
  792. margin-bottom: 24rpx;
  793. .item{
  794. font-size: 24rpx;
  795. font-weight: 400;
  796. color: #363636;
  797. margin-bottom: 10rpx;
  798. }
  799. }
  800. .singleQrcode{
  801. width: 160px;
  802. height: 160px;
  803. margin: 24rpx auto 54rpx;
  804. }
  805. }
  806. </style>