orderdetails.vue 31 KB

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