orderdetails.vue 34 KB

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