orderdetails.vue 33 KB

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