orderdetails.vue 33 KB

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