orderdetails.vue 32 KB

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