applydetails.vue 27 KB

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