applydetails.vue 27 KB

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