orderdetails.vue 26 KB

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