applydetails.vue 27 KB

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