orderdetails.vue 31 KB

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