detail.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903
  1. <template>
  2. <view class="order-detail">
  3. <zs-skeleton type="orderDetail" :loading="pageLoading"></zs-skeleton>
  4. <view class="status-box">
  5. <view class="text-box">
  6. <view class="status" v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT'&&!isNotTime">
  7. 等待支付,剩余<u-count-down :time="closeTime" format="mm:ss" @finish="finish"></u-count-down>
  8. </view>
  9. <view class="status" v-else>
  10. {{info.goodsList[0] |filterType }}
  11. </view>
  12. </view>
  13. </view>
  14. <view class="content progress" v-if="info.goodsList[0].goodsState == 'APPLY_REFUND' || info.goodsList[0].goodsState == 'REFUNDED'||info.goodsList[0].goodsState == 'APPLY_REFUNDING'" @click="refundDetail">
  15. <view class="progress-title">
  16. 退款进度
  17. </view>
  18. <view class="progress-desc">
  19. 查看退款详情
  20. </view>
  21. </view>
  22. <view class="content shop-box" v-if="!isVisual">
  23. <view class="shop-name">
  24. {{info.shopInfo.shopName}}
  25. </view>
  26. <view class="address">
  27. {{info.shopInfo.address}}
  28. </view>
  29. </view>
  30. <view class="content" v-if="info.goodsList[0].jobFlowMap == 'XiaoJu'">
  31. <view class="title">
  32. 加油明细
  33. </view>
  34. <view class="item">
  35. <view class="label">
  36. 油号
  37. </view>
  38. <view class="value">
  39. {{info.goodsList[0].goodsInfo.itemName || '-'}}
  40. </view>
  41. </view>
  42. <view class="item">
  43. <view class="label">
  44. 油枪号
  45. </view>
  46. <view class="value">
  47. {{info.goodsList[0].goodsInfo.gunNo}}号
  48. </view>
  49. </view>
  50. <view class="item">
  51. <view class="label">
  52. 加油升数
  53. </view>
  54. <view class="value">
  55. {{(info.goodsList[0].goodsInfo.litre/1000).toFixed(2)}}升
  56. </view>
  57. </view>
  58. </view>
  59. <view class="content info" v-if="info.goodsList[0].jobFlowMap !== 'XiaoJu'">
  60. <view class="order-info">
  61. <image class="icon" :src="info.goodsList[0].goodsInfo.goodsPath" mode=""></image>
  62. <view class="shop-info">
  63. <view class="title">
  64. {{info.goodsList[0].goodsInfo.goodsName}}
  65. </view>
  66. <view class="goods-desc" v-if="!isVisual">
  67. {{info.goodsList[0].goodsInfo.goodsDescribe}}
  68. </view>
  69. <view class="price-box">
  70. <view class="price">
  71. ¥{{info.goodsList[0].goodsInfo.realPrice}}
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="content code-box" v-if="info.goodsList[0].jobFlowMap != 'P802'&&info.goodsList[0].goodsState == 'WAIT_USE'&&info.goodsList[0].goodsName!='二维码支付'">
  78. <view class="title">
  79. 券码信息
  80. </view>
  81. <!-- <view class="code-btn" @click="checkCode">
  82. 查看券码 <image class="jiantou" src="../../static/jiantou-icon.png" mode=""></image>
  83. </view> -->
  84. <uqrcode class="qrcode" ref="uqrcode" type="2d" auto canvas-id="qrcode" :value="codeData" :loading="loading" :options="{ margin: 20 }">
  85. <template v-slot:loading>
  86. <text style="color: black;">拼命加载中...</text>
  87. </template>
  88. </uqrcode>
  89. </view>
  90. <!-- <view class="content" v-if="info.goodsList[0].goodsState == 'USED'">
  91. <view class="title">
  92. 消费记录
  93. </view>
  94. <view class="item">
  95. <view class="label">
  96. 消费时间
  97. </view>
  98. <view class="value">
  99. {{$u.timeFormat(info.goodsList[0].verifyModel.checkTime,'yyyy-mm-dd hh:MM:ss')}}
  100. </view>
  101. </view>
  102. <view class="item">
  103. <view class="label">
  104. 消费门店
  105. </view>
  106. <view class="value">
  107. {{info.goodsList[0].verifyModel.shopName}}
  108. </view>
  109. </view>
  110. </view> -->
  111. <view class="content">
  112. <view class="title">
  113. 订单信息
  114. </view>
  115. <view class="item">
  116. <view class="label">
  117. 订单编号
  118. </view>
  119. <view class="value">
  120. {{info.orderNo}}
  121. </view>
  122. </view>
  123. <view class="item" v-if="info.goodsList[0].goodsState == 'WAIT_USE'">
  124. <view class="label">
  125. 付款方式
  126. </view>
  127. <view class="value">
  128. {{info.payment | filterPay}}
  129. </view>
  130. </view>
  131. <view class="item">
  132. <view class="label">
  133. 下单时间
  134. </view>
  135. <view class="value">
  136. {{$u.timeFormat(info.createTime,'yyyy-mm-dd hh:MM:ss')}}
  137. </view>
  138. </view>
  139. <view class="item" v-if="info.goodsList[0].goodsState != 'WAIT_PAYMENT' && info.goodsList[0].goodsState != 'CLOSE'">
  140. <view class="label">
  141. 支付时间
  142. </view>
  143. <view class="value" >
  144. {{payTime}}
  145. </view>
  146. </view>
  147. </view>
  148. <view class="content" v-if="info.goodsList[0].jobFlowMap == 'XiaoJu'">
  149. <view class="title">
  150. 交易信息
  151. </view>
  152. <view class="item">
  153. <view class="label">
  154. 订单金额
  155. </view>
  156. <view class="value">
  157. ¥{{info.totalAmount}}
  158. </view>
  159. </view>
  160. <view class="item">
  161. <view class="label">
  162. 服务费
  163. </view>
  164. <view class="value">
  165. ¥{{(info.goodsList[0].goodsInfo.serviceFee/100).toFixed(2)}}
  166. </view>
  167. </view>
  168. <view class="item" >
  169. <view class="label">
  170. 优惠减免金额
  171. </view>
  172. <view class="value ">
  173. -¥{{info.discountAmount}}
  174. </view>
  175. </view>
  176. <view class="item">
  177. <view class="label">
  178. 支付金额
  179. </view>
  180. <view class="value">
  181. ¥{{info.payAmount}}
  182. </view>
  183. </view>
  184. </view>
  185. <view class="content" v-else>
  186. <view class="title">
  187. 交易信息
  188. </view>
  189. <view class="item">
  190. <view class="label">
  191. 商品金额
  192. </view>
  193. <view class="value black">
  194. ¥{{info.goodsList[0].goodsInfo.realPrice}}
  195. </view>
  196. </view>
  197. <view class="item" >
  198. <view class="label">
  199. 优惠券
  200. </view>
  201. <view class="value red">
  202. -¥{{info.discountAmount}}
  203. </view>
  204. </view>
  205. <view class="item">
  206. <view class="label">
  207. 合计
  208. </view>
  209. <view class="value">
  210. <text class="red fs28">¥{{info.payAmount}}</text>
  211. </view>
  212. </view>
  213. </view>
  214. <view class="input-box" v-if="isVisual">
  215. <view class="label">
  216. 充值账号
  217. </view>
  218. <view class="value">
  219. {{info.goodsList[0].extend.account}}
  220. </view>
  221. </view>
  222. <template>
  223. <view class="content refund-box" v-if="info.goodsList[0].goodsState == 'APPLY_REFUND'||(info.goodsList[0].refundLog&&info.goodsList[0].refundLog.remark)">
  224. <view class="title">
  225. 退款原因
  226. </view>
  227. <view class="refund-msg">
  228. {{info.goodsList[0].refundLog.remark}}
  229. </view>
  230. </view>
  231. <button type="default" :loading="btnLoading" v-if="info.goodsList[0].goodsState == 'APPLY_REFUND'" class="pay-btn" @click="cancelReply" >取消退款</button>
  232. </template>
  233. <view class="btn-box" v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT'">
  234. <button class="cancel-btn" v-if="info.goodsList[0].jobFlowMap == 'XiaoJu'" @click="cancel('XiaoJu')" :loading="btnLoading">
  235. 取消订单
  236. </button>
  237. <button class="cancel-btn" v-else @click="cancel('other')" :loading="btnLoading">
  238. 取消订单
  239. </button>
  240. <button class="btn" @click="pay" :loading="btnLoading">
  241. 立即支付
  242. </button>
  243. </view>
  244. <!-- <button type="default" :loading="btnLoading" class="pay-btn" v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT'&&info.goodsList[0].jobFlowMap !== 'XiaoJu'" @click="pay" >立即支付</button> -->
  245. <view class="content apply-box" v-else-if="(info.goodsList[0].goodsState == 'WAIT_USE'||info.goodsList[0].goodsState == 'USED')&&info.goodsList[0].jobFlowMap == 'XiaoJu'" @click="handleCall">
  246. <view class="label">
  247. 如有申请退款,请联系滴滴客服
  248. </view>
  249. <view class="value">
  250. 滴滴客服电话:4000016553
  251. </view>
  252. </view>
  253. <view class="content apply-box" v-else-if="(info.goodsList[0].goodsState == 'WAIT_USE'||info.goodsList[0].goodsState == 'USED')&&info.goodsList[0].refundLog.refund != 'REFUSAL_REFUND'&&isRefund()&&info.goodsList[0].jobFlowMap !== 'XiaoJu'&&info.goodsList[0].jobFlowMap != 'P802'" @click="apply">
  254. <view class="label">
  255. 退款申请
  256. </view>
  257. <view class="value">
  258. 如引发商品争议,可申请平台介入处理
  259. </view>
  260. <image class="jiantou" src="../../static/jiantou-icon.png" mode=""></image>
  261. </view>
  262. <view class="content apply-box" v-if="info.goodsList[0].refundLog&&info.goodsList[0].refundLog.refund == 'REFUSAL_REFUND'">
  263. <view class="title">
  264. 已拒绝
  265. </view>
  266. <view class="value">
  267. 拒绝理由:{{info.goodsList[0].refundLog.conclusion}}
  268. </view>
  269. </view>
  270. <button type="default" :loading="btnLoading1" v-if="info.goodsList[0].refundLog&&info.goodsList[0].refundLog.refund == 'REFUSAL_REFUND'&&!info.goodsList[0].refundLog.platInter" class="pay-btn" @click="refundIntervene" >申请介入处理</button>
  271. <!-- 二维码 -->
  272. <u-overlay :show="show" v-if="show" :opacity="0.6">
  273. <view class="wrap" @click.stop="close">
  274. <uqrcode ref="uqrcode" type="2d" auto canvas-id="qrcode" :value="codeData" :loading="loading" :options="{ margin: 20 }">
  275. <template v-slot:loading>
  276. <text style="color: black;">拼命加载中...</text>
  277. </template>
  278. </uqrcode>
  279. </view>
  280. </u-overlay>
  281. </view>
  282. </template>
  283. <script>
  284. import {qrCode,closeOrder} from '@/api/order.js'
  285. import {payDetails,queryPayOrder,unRefund,refundIntervene} from '@/api/payment.js';
  286. import {cancelOrder} from '@/api/refuel.js'
  287. export default {
  288. data() {
  289. return {
  290. isVisual:false,//是否是虚拟商品
  291. codeData:'123',
  292. show:false,
  293. loading:false,
  294. pageLoading:true,
  295. btnLoading:false,
  296. btnLoading1:false,
  297. oldBright:0,
  298. info:{
  299. // goodsList:[{goodsState:'CLOSE'}]
  300. },
  301. isNotTime:false
  302. }
  303. },
  304. watch: {
  305. // isNotTime(val) {
  306. // if(this.isNotTime){
  307. // this.payDetails(this.info.orderNo)
  308. // }
  309. // }
  310. },
  311. filters: {
  312. filterType: function(val) {
  313. if(val.refundLog&&val.refundLog.refund == 'REFUSAL_REFUND'&&!val.change){
  314. return '拒绝退款'
  315. }
  316. else if(val.goodsState == 'APPLY_REFUND'){
  317. return '退款审核中'
  318. }else if(val.goodsState == 'CLOSE'){
  319. return '关闭订单'
  320. }else if(val.goodsState == 'REFUNDED'){
  321. return '已退款'
  322. }else if(val.goodsState == 'REFUSAL_REFUND'){
  323. return '拒绝退款'
  324. }else if(val.goodsState == 'APPLY_REFUNDING'){
  325. return '退款中'
  326. }else if(val.goodsState == 'USED'){
  327. return '订单已完成'
  328. }else if(val.goodsState == 'WAIT_PAYMENT'){
  329. return '待付款'
  330. }else if(val.goodsState == 'WAIT_USE'){
  331. return '待使用'
  332. }else{
  333. return ''
  334. }
  335. },
  336. filterPay(val){
  337. if(val){
  338. if(val.paymentWay == 'wx.unifiedOrder'){
  339. return '微信支付'
  340. }else if(val.paymentWay == 'trade.create'){
  341. return '支付宝支付'
  342. }else if(val.paymentWay == 'uac.miniOrder'){
  343. return '云闪付支付'
  344. }
  345. }
  346. else{
  347. return '-'
  348. }
  349. }
  350. },
  351. computed: {
  352. closeTime() {
  353. return (this.info.createTime + 1000*60*30) - new Date().getTime()
  354. },
  355. payTime(){
  356. // if(this.info.goodsList[0].extend&&!this.info.goodsList[0].extend.hasOwnProperty('account')){
  357. if(this.info.goodsList[0].extend&&this.info.goodsList[0].jobFlowMap == 'XiaoJu'){
  358. console.log(1);
  359. if(this.info.goodsList[0].extend.hasOwnProperty('notifyOrderInfo')){
  360. return this.info.goodsList[0].extend.notifyOrderInfo.payTime
  361. }else{
  362. return '-'
  363. }
  364. }else{
  365. console.log(2);
  366. if(this.info.payment && this.info.payment.paymentTime){
  367. return uni.$u.timeFormat(this.info.payment.paymentTime,'yyyy-mm-dd hh:MM:ss')
  368. }else{
  369. return '-'
  370. }
  371. }
  372. }
  373. },
  374. methods: {
  375. // 申请客服介入
  376. refundIntervene(){
  377. let that = this
  378. uni.showModal({
  379. title: '提示',
  380. content: '确认申请客服介入吗?',
  381. success: function (res) {
  382. if (res.confirm) {
  383. that.btnLoading1 = true
  384. refundIntervene(that.info.goodsList[0].id).then(res=>{
  385. that.btnLoading1 = false
  386. if(res.state == 'Success'){
  387. that.payDetails(that.info.orderNo)
  388. }
  389. })
  390. } else if (res.cancel) {
  391. console.log('用户点击取消');
  392. }
  393. }
  394. });
  395. },
  396. isRefund(){
  397. if(!this.info.goodsList[0].verifyModel){//没核销
  398. return true
  399. }else if(this.info.goodsList[0].verifyModel && (new Date().getTime() < (this.info.goodsList[0].verifyModel.checkTime + 1000*60*60*48))){// 已核销 并且没超过48小时
  400. return true
  401. }else{
  402. return false
  403. }
  404. },
  405. finish(){
  406. this.isNotTime = true
  407. this.payDetails(this.info.orderNo)
  408. },
  409. refundDetail(){
  410. uni.navigateTo({
  411. url:`/my/order/refundDetail?id=${this.info.orderNo}`
  412. })
  413. },
  414. checkCode() {
  415. this.codeData = ''
  416. this.$nextTick(()=>{
  417. this.show = true
  418. this.loading = true
  419. let that = this
  420. // uni.getScreenBrightness({
  421. // success(res) {
  422. // // 获取用户手机亮度 保存起来
  423. // that.oldBright = res.value
  424. // setTimeout(()=>{
  425. // uni.setScreenBrightness({
  426. // value:1
  427. // })
  428. // },200)
  429. // }
  430. // })
  431. qrCode(this.info.goodsList[0].id).then(res=>{
  432. this.loading = false
  433. if(res.state == 'Success'){
  434. this.codeData = res.content
  435. }
  436. })
  437. })
  438. },
  439. close(){
  440. this.show = false
  441. // uni.setScreenBrightness({
  442. // value:this.oldBright
  443. // })
  444. },
  445. handleCall(){
  446. uni.makePhoneCall({
  447. phoneNumber: '4000016553'//仅为示例
  448. });
  449. },
  450. apply(){
  451. let that = this
  452. if(this.info.goodsList[0].jobFlowMap == 'XiaoJu'){
  453. uni.navigateTo({
  454. url:'./webView'
  455. })
  456. }else{
  457. uni.navigateTo({
  458. url:'./refund',
  459. success: function(res) {
  460. // 通过eventChannel向被打开页面传送数据
  461. res.eventChannel.emit('orderInfo', that.info)
  462. }
  463. })
  464. }
  465. },
  466. // 获取订单详情
  467. payDetails(orderNo){
  468. payDetails(orderNo).then(res=>{
  469. this.pageLoading = false
  470. this.info = res.content
  471. if(this.info.goodsList[0].jobFlowMap == 'P802'){
  472. this.isVisual = true
  473. }
  474. if(!this.info.goodsList[0].refundLog){
  475. this.info.goodsList[0].refundLog = {}
  476. }
  477. if(this.info.goodsList[0].jobFlowMap != 'P802'&&this.info.goodsList[0].goodsState == 'WAIT_USE'&&this.info.goodsList[0].goodsName!='二维码支付'){
  478. qrCode(this.info.goodsList[0].id).then(res=>{
  479. this.loading = false
  480. if(res.state == 'Success'){
  481. this.codeData = res.content
  482. }
  483. })
  484. }
  485. // try{
  486. // let extend = JSON.parse(this.info.goodsList[0].extend)
  487. // if(extend.account){
  488. // this.isVisual = true
  489. // }
  490. // }catch(e){
  491. // //TODO handle the exception
  492. // }
  493. })
  494. },
  495. // 取消支付
  496. cancel(type){
  497. uni.showLoading({
  498. title: '取消中'
  499. })
  500. if(type == 'XiaoJu'){
  501. let obj = this.info.goodsList[0].extend
  502. cancelOrder(obj).then(res=>{
  503. if(res.state == 'Success'){
  504. uni.showToast({
  505. title: '取消成功',
  506. icon: 'success'
  507. })
  508. this.payDetails(this.info.orderNo)
  509. }
  510. })
  511. }else{
  512. closeOrder(this.info.orderNo).then(res=>{
  513. if(res.state == 'Success'){
  514. uni.showToast({
  515. title: '取消成功',
  516. icon: 'success'
  517. })
  518. this.payDetails(this.info.orderNo)
  519. }
  520. })
  521. }
  522. },
  523. // 支付
  524. pay(){
  525. let that = this
  526. if(this.info.goodsList[0].jobFlowMap == 'XiaoJu'){
  527. let {xjOrderId,tradeId} = this.info.goodsList[0].extend
  528. uni.navigateToMiniProgram({
  529. appId:"wx0d252f6ed9755862", // 滴滴加油小程序appId
  530. path: `packageA/pages/open-energy-pay/index?orderId=${xjOrderId}&tradeId=${tradeId}`, // 滴滴加油收银台页面地址,需要拼接orderId和tradeId
  531. envVersion: 'release', // 固定release
  532. })
  533. }else{
  534. if (this.btnLoading) return
  535. this.btnLoading = true
  536. uni.showLoading({
  537. title: '支付中'
  538. })
  539. let miniPayRequest = JSON.parse(this.info.payment.miniPayRequest)
  540. uni.requestPayment({
  541. "provider": "wxpay",
  542. "orderInfo": miniPayRequest,
  543. "appid": miniPayRequest.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
  544. "paySign": miniPayRequest.paySign,
  545. "nonceStr": miniPayRequest.nonceStr, // 随机字符串
  546. "package": miniPayRequest.package, // 固定值
  547. // "prepayid": miniPayRequest.package, // 统一下单订单号
  548. "timeStamp": miniPayRequest.timeStamp, // 时间戳(单位:秒)
  549. "signType": miniPayRequest.signType, //签名算法
  550. success(msg) {
  551. console.log('msg', msg);
  552. queryPayOrder(that.info.orderNo).then(res1 => {
  553. if (res1.state == 'Success') {
  554. uni.hideLoading()
  555. uni.showToast({
  556. title: '支付成功',
  557. icon: 'success'
  558. })
  559. that.btnLoading = false
  560. that.payDetails(that.info.orderNo)
  561. }
  562. })
  563. },
  564. fail(e) {
  565. that.btnLoading = false
  566. uni.hideLoading()
  567. uni.showToast({
  568. title: '取消支付',
  569. icon: 'fail'
  570. })
  571. // 取消支付后,获取支付信息以备再次支付
  572. that.payDetails(that.info.orderNo)
  573. console.log('err', e,this);
  574. }
  575. })
  576. }
  577. },
  578. // 取消退款申请
  579. cancelReply(){
  580. if (this.btnLoading) return
  581. this.btnLoading = true
  582. uni.showLoading({
  583. title: '取消中'
  584. })
  585. unRefund({id:this.info.goodsList[0].id}).then(res=>{
  586. this.btnLoading = false
  587. uni.hideLoading()
  588. if (res.state == 'Success') {
  589. this.payDetails(this.info.orderNo)
  590. uni.showToast({
  591. title:'取消成功',
  592. icon:'success'
  593. })
  594. }
  595. })
  596. }
  597. },
  598. onReady() {
  599. },
  600. onLoad(options) {
  601. this.info.orderNo = options.id
  602. },
  603. onShow() {
  604. this.pageLoading = true
  605. this.payDetails(this.info.orderNo)
  606. },
  607. created() {
  608. // this.info = JSON.parse(uni.getStorageSync('order'))
  609. }
  610. }
  611. </script>
  612. <style lang="scss">
  613. .order-detail{
  614. background: #F9F9F9;
  615. min-height: 100vh;
  616. padding-bottom: 100rpx;
  617. .status-box{
  618. padding: 24rpx 24rpx 4rpx;
  619. display: flex;
  620. justify-content: space-between;
  621. .text-box{
  622. color: #181818;
  623. .status{
  624. font-weight: bold;
  625. font-size: 32rpx;
  626. display: flex;
  627. .u-count-down__text{
  628. color: $uni-color-primary!important;
  629. }
  630. }
  631. .notice{
  632. font-size: 24rpx;
  633. margin-top: 20rpx;
  634. }
  635. }
  636. }
  637. .progress{
  638. .progress-title{
  639. font-weight: 600;
  640. font-size: 32rpx;
  641. color: #181818;
  642. }
  643. .progress-desc{
  644. font-weight: 300;
  645. font-size: 24rpx;
  646. color: #AAAAAA;
  647. margin-top: 15rpx;
  648. }
  649. }
  650. .shop-box{
  651. width: 690rpx;
  652. // margin: 0 30rpx;
  653. // padding: 24rpx 24rpx 30rpx;
  654. background: #fff;
  655. border-radius: 16rpx;
  656. margin-top: -30rpx;
  657. box-sizing: border-box;
  658. .shop-name{
  659. font-weight: 600;
  660. font-size: 32rpx;
  661. color: #181818;
  662. width: 100%;
  663. white-space: nowrap;
  664. overflow: hidden;
  665. text-overflow: ellipsis;
  666. }
  667. .address{
  668. font-weight: 300;
  669. font-size: 24rpx;
  670. color: #AAAAAA;
  671. margin-top: 20rpx;
  672. width: 100%;
  673. white-space: nowrap;
  674. overflow: hidden;
  675. text-overflow: ellipsis;
  676. }
  677. }
  678. .black{
  679. color: #222222!important;
  680. }
  681. .red{
  682. color: red!important;
  683. }
  684. .fs28{
  685. font-size: 28rpx!important;
  686. font-weight: bold;
  687. }
  688. .code-box{
  689. // .left{
  690. // .title{
  691. // font-weight: 500;
  692. // font-size: 28rpx;
  693. // color: #222222;
  694. // }
  695. // .codeNum{
  696. // font-weight: 300;
  697. // font-size: 24rpx;
  698. // color: #AAAAAA;
  699. // margin-top: 15rpx;
  700. // }
  701. // }
  702. .qrcode{
  703. display: flex;
  704. align-items: center;
  705. justify-content: center;
  706. margin-top: 20rpx;
  707. }
  708. .code-btn{
  709. display: flex;
  710. align-items: center;
  711. font-weight: 300;
  712. font-size: 24rpx;
  713. color: #AAAAAA;
  714. .jiantou{
  715. width: 24rpx;
  716. height: 24rpx;
  717. }
  718. }
  719. }
  720. .input-box{
  721. margin: 20rpx 30rpx;
  722. padding: 28rpx 24rpx;
  723. background: #FFFFFF;
  724. border-radius: 16rpx 16rpx 16rpx 16rpx;
  725. display: flex;
  726. align-items: center;
  727. justify-content: space-between;
  728. .label {
  729. color: #222;
  730. font-size: 28rpx;
  731. }
  732. .value {
  733. font-size: 28rpx;
  734. color: #AAAAAA;
  735. }
  736. }
  737. .content{
  738. margin: 20rpx 30rpx;
  739. padding: 28rpx 24rpx;
  740. border-radius: 16rpx;
  741. background: #fff;
  742. .title{
  743. font-weight: 600;
  744. font-size: 28rpx;
  745. color: #222222;
  746. }
  747. .item{
  748. display: flex;
  749. align-items: center;
  750. justify-content: space-between;
  751. margin-top: 28rpx;
  752. .label{
  753. font-size: 28rpx;
  754. color: #AAAAAA;
  755. }
  756. .value{
  757. font-size: 28rpx;
  758. color: #222222;
  759. }
  760. }
  761. }
  762. .pay-btn{
  763. background: $uni-color-primary;
  764. width: 688rpx;
  765. height: 80rpx;
  766. line-height: 80rpx;
  767. border-radius: 46rpx;
  768. color: #fff;
  769. margin-top: 50rpx;
  770. }
  771. .refund-box{
  772. .refund-msg{
  773. font-weight: 300;
  774. font-size: 24rpx;
  775. color: #222222;
  776. margin-top: 15rpx;
  777. line-height: 40rpx;
  778. }
  779. }
  780. .apply-box{
  781. position: relative;
  782. .label{
  783. font-weight: 600;
  784. font-size: 28rpx;
  785. color: #222222;
  786. }
  787. .value{
  788. color: #999999;
  789. font-size: 24rpx;
  790. margin-top: 15rpx;
  791. }
  792. .jiantou{
  793. position: absolute;
  794. top: 50%;
  795. right: 24rpx;
  796. transform: translateY(-50%);
  797. width: 24rpx;
  798. height: 24rpx;
  799. }
  800. }
  801. .btn-box {
  802. position: fixed;
  803. bottom: 0%;
  804. left: 0%;
  805. width: 100%;
  806. display: flex;
  807. align-items: center;
  808. justify-content: flex-end;
  809. box-sizing: border-box;
  810. padding: 10rpx 24rpx env(safe-area-inset-bottom);
  811. background: #fff;
  812. border-top: 1rpx solid #EEEEEE;
  813. .cancel-btn{
  814. width: 240rpx;
  815. height: 80rpx;
  816. line-height: 80rpx;
  817. text-align: center;
  818. border-radius: 40rpx;
  819. border: 2rpx solid #EE4320;
  820. font-weight: 600;
  821. font-size: 28rpx;
  822. color: #EE4320;
  823. margin: 0;
  824. }
  825. .btn {
  826. width: 240rpx;
  827. height: 80rpx;
  828. line-height: 80rpx;
  829. text-align: center;
  830. background: $uni-color-primary;
  831. border-radius: 40rpx;
  832. font-weight: 600;
  833. font-size: 28rpx;
  834. color: #FFFFFF;
  835. margin: 0;
  836. margin-left: 20rpx;
  837. }
  838. }
  839. .info{
  840. .order-info{
  841. display: flex;
  842. .icon{
  843. width: 164rpx;
  844. height: 164rpx;
  845. border-radius: 16rpx;
  846. flex-shrink: 0;
  847. }
  848. .shop-info{
  849. display: flex;
  850. flex-direction: column;
  851. justify-content: space-between;
  852. padding-left: 24rpx;
  853. flex: 1;
  854. box-sizing: border-box;
  855. .title{
  856. color: #181818;
  857. font-size: 28rpx;
  858. width: 450rpx;
  859. white-space: nowrap;
  860. overflow: hidden;
  861. text-overflow: ellipsis;
  862. }
  863. .price-box{
  864. display: flex;
  865. align-items: center;
  866. justify-content: space-between;
  867. .price{
  868. color: #181818;
  869. color: $uni-color-primary;
  870. font-size: 32rpx;
  871. font-weight: bold;
  872. }
  873. }
  874. .start-time,.goods-desc{
  875. font-size: 24rpx;
  876. color: #AAAAAA;
  877. width: 450rpx;
  878. white-space: nowrap;
  879. overflow: hidden;
  880. text-overflow: ellipsis;
  881. }
  882. }
  883. }
  884. }
  885. .wrap{
  886. display: flex;
  887. justify-content: center;
  888. align-items: center;
  889. height: 100vh;
  890. overflow: hidden;
  891. }
  892. }
  893. </style>
  894. <!-- <template>
  895. <view class="order-detail">
  896. <zs-skeleton type="orderDetail" :loading="pageLoading"></zs-skeleton>
  897. <view class="status-box">
  898. <view class="text-box">
  899. <view class="status" v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT'&&!isNotTime">
  900. 等待支付,剩余<u-count-down :time="closeTime" format="mm:ss" @finish="finish"></u-count-down>
  901. </view>
  902. <view class="status" v-else>
  903. {{info.goodsList[0] |filterType }}
  904. </view>
  905. </view>
  906. </view>
  907. <view class="content progress" v-if="info.goodsList[0].goodsState == 'APPLY_REFUND' || info.goodsList[0].goodsState == 'REFUNDED'||info.goodsList[0].goodsState == 'APPLY_REFUNDING'" @click="refundDetail">
  908. <view class="progress-title">
  909. 退款进度
  910. </view>
  911. <view class="progress-desc">
  912. 查看退款详情
  913. </view>
  914. </view>
  915. <view class="content shop-box" v-if="!isVisual">
  916. <view class="shop-name">
  917. {{info.shopInfo.shopName}}
  918. </view>
  919. <view class="address">
  920. {{info.shopInfo.address}}
  921. </view>
  922. </view>
  923. <view class="content" v-if="info.goodsList[0].jobFlowMap == 'XiaoJu'">
  924. <view class="title">
  925. 加油明细
  926. </view>
  927. <view class="item">
  928. <view class="label">
  929. 油号
  930. </view>
  931. <view class="value">
  932. {{info.goodsList[0].goodsInfo.itemName || '-'}}
  933. </view>
  934. </view>
  935. <view class="item">
  936. <view class="label">
  937. 油枪号
  938. </view>
  939. <view class="value">
  940. {{info.goodsList[0].goodsInfo.gunNo}}号
  941. </view>
  942. </view>
  943. <view class="item">
  944. <view class="label">
  945. 加油升数
  946. </view>
  947. <view class="value">
  948. {{(info.goodsList[0].goodsInfo.litre/1000).toFixed(2)}}升
  949. </view>
  950. </view>
  951. </view>
  952. <view class="content info" v-if="info.goodsList[0].jobFlowMap !== 'XiaoJu'">
  953. <view class="order-info">
  954. <image class="icon" :src="info.goodsList[0].goodsInfo.goodsPath" mode=""></image>
  955. <view class="shop-info">
  956. <view class="title">
  957. {{info.goodsList[0].goodsInfo.goodsName}}
  958. </view>
  959. <template v-if="!isVisual">
  960. <view class="goods-desc">
  961. {{info.goodsList[0].goodsInfo.goodsDescribe}}
  962. </view>
  963. <view class="price-box">
  964. <view class="price">
  965. ¥{{info.goodsList[0].goodsInfo.realPrice}}
  966. </view>
  967. </view>
  968. </template>
  969. <view class="price-box" v-else>
  970. <view class="price">
  971. ¥{{info.payAmount}}
  972. </view>
  973. </view>
  974. </view>
  975. </view>
  976. </view>
  977. <view class="content code-box" v-if="info.goodsList[0].jobFlowMap != 'video2'&&info.goodsList[0].jobFlowMap != 'P802'&&info.goodsList[0].goodsState == 'WAIT_USE'&&info.goodsList[0].goodsName!='二维码支付'">
  978. <view class="title">
  979. 券码信息
  980. </view>
  981. <uqrcode class="qrcode" ref="uqrcode" type="2d" auto canvas-id="qrcode" :value="codeData" :loading="loading" :options="{ margin: 20 }">
  982. <template v-slot:loading>
  983. <text style="color: black;">拼命加载中...</text>
  984. </template>
  985. </uqrcode>
  986. </view>
  987. <view class="content">
  988. <view class="title">
  989. 订单信息
  990. </view>
  991. <view class="item">
  992. <view class="label">
  993. 订单编号
  994. </view>
  995. <view class="value">
  996. {{info.orderNo}}
  997. </view>
  998. </view>
  999. <view class="item" v-if="info.goodsList[0].goodsState == 'WAIT_USE'">
  1000. <view class="label">
  1001. 付款方式
  1002. </view>
  1003. <view class="value">
  1004. {{info.payment | filterPay}}
  1005. </view>
  1006. </view>
  1007. <view class="item">
  1008. <view class="label">
  1009. 下单时间
  1010. </view>
  1011. <view class="value">
  1012. {{$u.timeFormat(info.createTime,'yyyy-mm-dd hh:MM:ss')}}
  1013. </view>
  1014. </view>
  1015. <view class="item" v-if="info.goodsList[0].goodsState != 'WAIT_PAYMENT' && info.goodsList[0].goodsState != 'CLOSE'">
  1016. <view class="label">
  1017. 支付时间
  1018. </view>
  1019. <view class="value" >
  1020. {{payTime}}
  1021. </view>
  1022. </view>
  1023. </view>
  1024. <view class="content" v-if="info.goodsList[0].jobFlowMap == 'XiaoJu'">
  1025. <view class="title">
  1026. 交易信息
  1027. </view>
  1028. <view class="item">
  1029. <view class="label">
  1030. 订单金额
  1031. </view>
  1032. <view class="value">
  1033. ¥{{info.totalAmount}}
  1034. </view>
  1035. </view>
  1036. <view class="item">
  1037. <view class="label">
  1038. 服务费
  1039. </view>
  1040. <view class="value">
  1041. ¥{{(info.goodsList[0].goodsInfo.serviceFee/100).toFixed(2)}}
  1042. </view>
  1043. </view>
  1044. <view class="item" >
  1045. <view class="label">
  1046. 优惠减免金额
  1047. </view>
  1048. <view class="value ">
  1049. -¥{{info.discountAmount}}
  1050. </view>
  1051. </view>
  1052. <view class="item">
  1053. <view class="label">
  1054. 支付金额
  1055. </view>
  1056. <view class="value">
  1057. ¥{{info.payAmount}}
  1058. </view>
  1059. </view>
  1060. </view>
  1061. <view class="content" v-else>
  1062. <view class="title">
  1063. 交易信息
  1064. </view>
  1065. <view class="item">
  1066. <view class="label">
  1067. 商品金额
  1068. </view>
  1069. <view class="value black">
  1070. ¥{{info.payAmount}}
  1071. </view>
  1072. </view>
  1073. <view class="item" >
  1074. <view class="label">
  1075. 优惠券
  1076. </view>
  1077. <view class="value red">
  1078. -¥{{info.discountAmount}}
  1079. </view>
  1080. </view>
  1081. <view class="item">
  1082. <view class="label">
  1083. 合计
  1084. </view>
  1085. <view class="value">
  1086. <text class="red fs28">¥{{info.payAmount}}</text>
  1087. </view>
  1088. </view>
  1089. </view>
  1090. <view class="input-box" v-if="isVisual">
  1091. <view class="label">
  1092. 充值账号
  1093. </view>
  1094. <view class="value">
  1095. {{info.goodsList[0].goodsInfo.rechargeAccount}}
  1096. </view>
  1097. </view>
  1098. <template>
  1099. <view class="content refund-box" v-if="info.goodsList[0].goodsState == 'APPLY_REFUND'||(info.goodsList[0].refundLog&&info.goodsList[0].refundLog.remark)">
  1100. <view class="title">
  1101. 退款原因
  1102. </view>
  1103. <view class="refund-msg">
  1104. {{info.goodsList[0].refundLog.remark}}
  1105. </view>
  1106. </view>
  1107. <button type="default" :loading="btnLoading" v-if="info.goodsList[0].goodsState == 'APPLY_REFUND'" class="pay-btn" @click="cancelReply" >取消退款</button>
  1108. </template>
  1109. <view class="btn-box" v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT'">
  1110. <button class="cancel-btn" v-if="info.goodsList[0].jobFlowMap == 'XiaoJu'" @click="cancel('XiaoJu')" :loading="btnLoading">
  1111. 取消订单
  1112. </button>
  1113. <button class="cancel-btn" v-else @click="cancel('other')" :loading="btnLoading">
  1114. 取消订单
  1115. </button>
  1116. <button class="btn" @click="pay" :loading="btnLoading">
  1117. 立即支付
  1118. </button>
  1119. </view>
  1120. <view class="content apply-box" v-else-if="(info.goodsList[0].goodsState == 'WAIT_USE'||info.goodsList[0].goodsState == 'USED')&&info.goodsList[0].jobFlowMap == 'XiaoJu'" @click="handleCall">
  1121. <view class="label">
  1122. 如有申请退款,请联系滴滴客服
  1123. </view>
  1124. <view class="value">
  1125. 滴滴客服电话:4000016553
  1126. </view>
  1127. </view>
  1128. <view class="content apply-box" v-else-if="(info.goodsList[0].goodsState == 'WAIT_USE'||info.goodsList[0].goodsState == 'USED')&&info.goodsList[0].refundLog.refund != 'REFUSAL_REFUND'&&isRefund()&&info.goodsList[0].jobFlowMap !== 'XiaoJu'&&info.goodsList[0].jobFlowMap != 'video2'&&info.goodsList[0].jobFlowMap != 'P802'" @click="apply">
  1129. <view class="label">
  1130. 退款申请
  1131. </view>
  1132. <view class="value">
  1133. 如引发商品争议,可申请平台介入处理
  1134. </view>
  1135. <image class="jiantou" src="../../static/jiantou-icon.png" mode=""></image>
  1136. </view>
  1137. <view class="content apply-box" v-if="info.goodsList[0].refundLog&&info.goodsList[0].refundLog.refund == 'REFUSAL_REFUND'">
  1138. <view class="title">
  1139. 已拒绝
  1140. </view>
  1141. <view class="value">
  1142. 拒绝理由:{{info.goodsList[0].refundLog.conclusion}}
  1143. </view>
  1144. </view>
  1145. <button type="default" :loading="btnLoading1" v-if="info.goodsList[0].refundLog&&info.goodsList[0].refundLog.refund == 'REFUSAL_REFUND'&&!info.goodsList[0].refundLog.platInter" class="pay-btn" @click="refundIntervene" >申请介入处理</button>
  1146. <u-overlay :show="show" v-if="show" :opacity="0.6">
  1147. <view class="wrap" @click.stop="close">
  1148. <uqrcode ref="uqrcode" type="2d" auto canvas-id="qrcode" :value="codeData" :loading="loading" :options="{ margin: 20 }">
  1149. <template v-slot:loading>
  1150. <text style="color: black;">拼命加载中...</text>
  1151. </template>
  1152. </uqrcode>
  1153. </view>
  1154. </u-overlay>
  1155. </view>
  1156. </template>
  1157. <script>
  1158. import {qrCode,closeOrder} from '@/api/order.js'
  1159. import {payDetails,queryPayOrder,unRefund,refundIntervene} from '@/api/payment.js';
  1160. import {cancelOrder} from '@/api/refuel.js'
  1161. export default {
  1162. data() {
  1163. return {
  1164. isVisual:false,//是否是虚拟商品
  1165. codeData:'123',
  1166. show:false,
  1167. loading:false,
  1168. pageLoading:true,
  1169. btnLoading:false,
  1170. btnLoading1:false,
  1171. oldBright:0,
  1172. info:{
  1173. // goodsList:[{goodsState:'CLOSE'}]
  1174. },
  1175. isNotTime:false
  1176. }
  1177. },
  1178. watch: {
  1179. // isNotTime(val) {
  1180. // if(this.isNotTime){
  1181. // this.payDetails(this.info.orderNo)
  1182. // }
  1183. // }
  1184. },
  1185. filters: {
  1186. filterType: function(val) {
  1187. if(val.refundLog&&val.refundLog.refund == 'REFUSAL_REFUND'&&!val.change){
  1188. return '拒绝退款'
  1189. }
  1190. else if(val.goodsState == 'APPLY_REFUND'){
  1191. return '退款审核中'
  1192. }else if(val.goodsState == 'CLOSE'){
  1193. return '关闭订单'
  1194. }else if(val.goodsState == 'REFUNDED'){
  1195. return '已退款'
  1196. }else if(val.goodsState == 'REFUSAL_REFUND'){
  1197. return '拒绝退款'
  1198. }else if(val.goodsState == 'APPLY_REFUNDING'){
  1199. return '退款中'
  1200. }else if(val.goodsState == 'USED'){
  1201. return '订单已完成'
  1202. }else if(val.goodsState == 'WAIT_PAYMENT'){
  1203. return '待付款'
  1204. }else if(val.goodsState == 'WAIT_USE'){
  1205. return '待使用'
  1206. }else{
  1207. return ''
  1208. }
  1209. },
  1210. filterPay(val){
  1211. if(val){
  1212. if(val.paymentWay == 'wx.unifiedOrder'){
  1213. return '微信支付'
  1214. }else if(val.paymentWay == 'trade.create'){
  1215. return '支付宝支付'
  1216. }else if(val.paymentWay == 'uac.miniOrder'){
  1217. return '云闪付支付'
  1218. }
  1219. }
  1220. else{
  1221. return '-'
  1222. }
  1223. }
  1224. },
  1225. computed: {
  1226. closeTime() {
  1227. return (this.info.createTime + 1000*60*30) - new Date().getTime()
  1228. },
  1229. payTime(){
  1230. // if(this.info.goodsList[0].extend&&!this.info.goodsList[0].extend.hasOwnProperty('account')){
  1231. if(this.info.goodsList[0].extend&&this.info.goodsList[0].jobFlowMap == 'XiaoJu'){
  1232. console.log(1);
  1233. if(this.info.goodsList[0].extend.hasOwnProperty('notifyOrderInfo')){
  1234. return this.info.goodsList[0].extend.notifyOrderInfo.payTime
  1235. }else{
  1236. return '-'
  1237. }
  1238. }else{
  1239. console.log(2);
  1240. if(this.info.payment && this.info.payment.paymentTime){
  1241. return uni.$u.timeFormat(this.info.payment.paymentTime,'yyyy-mm-dd hh:MM:ss')
  1242. }else{
  1243. return '-'
  1244. }
  1245. }
  1246. }
  1247. },
  1248. methods: {
  1249. // 申请客服介入
  1250. refundIntervene(){
  1251. let that = this
  1252. uni.showModal({
  1253. title: '提示',
  1254. content: '确认申请客服介入吗?',
  1255. success: function (res) {
  1256. if (res.confirm) {
  1257. that.btnLoading1 = true
  1258. refundIntervene(that.info.goodsList[0].id).then(res=>{
  1259. that.btnLoading1 = false
  1260. if(res.state == 'Success'){
  1261. that.payDetails(that.info.orderNo)
  1262. }
  1263. })
  1264. } else if (res.cancel) {
  1265. console.log('用户点击取消');
  1266. }
  1267. }
  1268. });
  1269. },
  1270. isRefund(){
  1271. if(!this.info.goodsList[0].verifyModel){//没核销
  1272. return true
  1273. }else if(this.info.goodsList[0].verifyModel && (new Date().getTime() < (this.info.goodsList[0].verifyModel.checkTime + 1000*60*60*48))){// 已核销 并且没超过48小时
  1274. return true
  1275. }else{
  1276. return false
  1277. }
  1278. },
  1279. finish(){
  1280. this.isNotTime = true
  1281. this.payDetails(this.info.orderNo)
  1282. },
  1283. refundDetail(){
  1284. uni.navigateTo({
  1285. url:`/my/order/refundDetail?id=${this.info.orderNo}`
  1286. })
  1287. },
  1288. checkCode() {
  1289. this.codeData = ''
  1290. this.$nextTick(()=>{
  1291. this.show = true
  1292. this.loading = true
  1293. let that = this
  1294. // uni.getScreenBrightness({
  1295. // success(res) {
  1296. // // 获取用户手机亮度 保存起来
  1297. // that.oldBright = res.value
  1298. // setTimeout(()=>{
  1299. // uni.setScreenBrightness({
  1300. // value:1
  1301. // })
  1302. // },200)
  1303. // }
  1304. // })
  1305. qrCode(this.info.goodsList[0].id).then(res=>{
  1306. this.loading = false
  1307. if(res.state == 'Success'){
  1308. this.codeData = res.content
  1309. }
  1310. })
  1311. })
  1312. },
  1313. close(){
  1314. this.show = false
  1315. // uni.setScreenBrightness({
  1316. // value:this.oldBright
  1317. // })
  1318. },
  1319. handleCall(){
  1320. uni.makePhoneCall({
  1321. phoneNumber: '4000016553'//仅为示例
  1322. });
  1323. },
  1324. apply(){
  1325. let that = this
  1326. if(this.info.goodsList[0].jobFlowMap == 'XiaoJu'){
  1327. uni.navigateTo({
  1328. url:'./webView'
  1329. })
  1330. }else{
  1331. uni.navigateTo({
  1332. url:'./refund',
  1333. success: function(res) {
  1334. // 通过eventChannel向被打开页面传送数据
  1335. res.eventChannel.emit('orderInfo', that.info)
  1336. }
  1337. })
  1338. }
  1339. },
  1340. // 获取订单详情
  1341. payDetails(orderNo){
  1342. payDetails(orderNo).then(res=>{
  1343. this.pageLoading = false
  1344. this.info = res.content
  1345. if(this.info.goodsList[0].jobFlowMap =='video2'||this.info.goodsList[0].jobFlowMap =='P802'){
  1346. this.isVisual = true
  1347. }
  1348. if(!this.info.goodsList[0].refundLog){
  1349. this.info.goodsList[0].refundLog = {}
  1350. }
  1351. if(this.info.goodsList[0].jobFlowMap != 'video2'&&this.info.goodsList[0].jobFlowMap != 'P802'&&this.info.goodsList[0].goodsState == 'WAIT_USE'&&this.info.goodsList[0].goodsName!='二维码支付'){
  1352. qrCode(this.info.goodsList[0].id).then(res=>{
  1353. this.loading = false
  1354. if(res.state == 'Success'){
  1355. this.codeData = res.content
  1356. }
  1357. })
  1358. }
  1359. // try{
  1360. // let extend = JSON.parse(this.info.goodsList[0].extend)
  1361. // if(extend.account){
  1362. // this.isVisual = true
  1363. // }
  1364. // }catch(e){
  1365. // //TODO handle the exception
  1366. // }
  1367. })
  1368. },
  1369. // 取消支付
  1370. cancel(type){
  1371. uni.showLoading({
  1372. title: '取消中'
  1373. })
  1374. if(type == 'XiaoJu'){
  1375. let obj = this.info.goodsList[0].extend
  1376. cancelOrder(obj).then(res=>{
  1377. if(res.state == 'Success'){
  1378. uni.showToast({
  1379. title: '取消成功',
  1380. icon: 'success'
  1381. })
  1382. this.payDetails(this.info.orderNo)
  1383. }
  1384. })
  1385. }else{
  1386. closeOrder(this.info.orderNo).then(res=>{
  1387. if(res.state == 'Success'){
  1388. uni.showToast({
  1389. title: '取消成功',
  1390. icon: 'success'
  1391. })
  1392. this.payDetails(this.info.orderNo)
  1393. }
  1394. })
  1395. }
  1396. },
  1397. // 支付
  1398. pay(){
  1399. let that = this
  1400. if(this.info.goodsList[0].jobFlowMap == 'XiaoJu'){
  1401. let {xjOrderId,tradeId} = this.info.goodsList[0].extend
  1402. uni.navigateToMiniProgram({
  1403. appId:"wx0d252f6ed9755862", // 滴滴加油小程序appId
  1404. path: `packageA/pages/open-energy-pay/index?orderId=${xjOrderId}&tradeId=${tradeId}`, // 滴滴加油收银台页面地址,需要拼接orderId和tradeId
  1405. envVersion: 'release', // 固定release
  1406. })
  1407. }else{
  1408. if (this.btnLoading) return
  1409. this.btnLoading = true
  1410. uni.showLoading({
  1411. title: '支付中'
  1412. })
  1413. let miniPayRequest = JSON.parse(this.info.payment.miniPayRequest)
  1414. uni.requestPayment({
  1415. "provider": "wxpay",
  1416. "orderInfo": miniPayRequest,
  1417. "appid": miniPayRequest.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
  1418. "paySign": miniPayRequest.paySign,
  1419. "nonceStr": miniPayRequest.nonceStr, // 随机字符串
  1420. "package": miniPayRequest.package, // 固定值
  1421. // "prepayid": miniPayRequest.package, // 统一下单订单号
  1422. "timeStamp": miniPayRequest.timeStamp, // 时间戳(单位:秒)
  1423. "signType": miniPayRequest.signType, //签名算法
  1424. success(msg) {
  1425. console.log('msg', msg);
  1426. queryPayOrder(that.info.orderNo).then(res1 => {
  1427. if (res1.state == 'Success') {
  1428. uni.hideLoading()
  1429. uni.showToast({
  1430. title: '支付成功',
  1431. icon: 'success'
  1432. })
  1433. that.btnLoading = false
  1434. that.payDetails(that.info.orderNo)
  1435. }
  1436. })
  1437. },
  1438. fail(e) {
  1439. that.btnLoading = false
  1440. uni.hideLoading()
  1441. uni.showToast({
  1442. title: '取消支付',
  1443. icon: 'fail'
  1444. })
  1445. // 取消支付后,获取支付信息以备再次支付
  1446. that.payDetails(that.info.orderNo)
  1447. console.log('err', e,this);
  1448. }
  1449. })
  1450. }
  1451. },
  1452. // 取消退款申请
  1453. cancelReply(){
  1454. if (this.btnLoading) return
  1455. this.btnLoading = true
  1456. uni.showLoading({
  1457. title: '取消中'
  1458. })
  1459. unRefund({id:this.info.goodsList[0].id}).then(res=>{
  1460. this.btnLoading = false
  1461. uni.hideLoading()
  1462. if (res.state == 'Success') {
  1463. this.payDetails(this.info.orderNo)
  1464. uni.showToast({
  1465. title:'取消成功',
  1466. icon:'success'
  1467. })
  1468. }
  1469. })
  1470. }
  1471. },
  1472. onReady() {
  1473. },
  1474. onLoad(options) {
  1475. this.info.orderNo = options.id
  1476. },
  1477. onShow() {
  1478. this.pageLoading = true
  1479. this.payDetails(this.info.orderNo)
  1480. },
  1481. created() {
  1482. // this.info = JSON.parse(uni.getStorageSync('order'))
  1483. }
  1484. }
  1485. </script>
  1486. <style lang="scss">
  1487. .order-detail{
  1488. background: #F9F9F9;
  1489. min-height: 100vh;
  1490. padding-bottom: 100rpx;
  1491. .status-box{
  1492. padding: 24rpx 24rpx 4rpx;
  1493. display: flex;
  1494. justify-content: space-between;
  1495. .text-box{
  1496. color: #181818;
  1497. .status{
  1498. font-weight: bold;
  1499. font-size: 32rpx;
  1500. display: flex;
  1501. .u-count-down__text{
  1502. color: $uni-color-primary!important;
  1503. }
  1504. }
  1505. .notice{
  1506. font-size: 24rpx;
  1507. margin-top: 20rpx;
  1508. }
  1509. }
  1510. }
  1511. .progress{
  1512. .progress-title{
  1513. font-weight: 600;
  1514. font-size: 32rpx;
  1515. color: #181818;
  1516. }
  1517. .progress-desc{
  1518. font-weight: 300;
  1519. font-size: 24rpx;
  1520. color: #AAAAAA;
  1521. margin-top: 15rpx;
  1522. }
  1523. }
  1524. .shop-box{
  1525. width: 690rpx;
  1526. // margin: 0 30rpx;
  1527. // padding: 24rpx 24rpx 30rpx;
  1528. background: #fff;
  1529. border-radius: 16rpx;
  1530. margin-top: -30rpx;
  1531. box-sizing: border-box;
  1532. .shop-name{
  1533. font-weight: 600;
  1534. font-size: 32rpx;
  1535. color: #181818;
  1536. width: 100%;
  1537. white-space: nowrap;
  1538. overflow: hidden;
  1539. text-overflow: ellipsis;
  1540. }
  1541. .address{
  1542. font-weight: 300;
  1543. font-size: 24rpx;
  1544. color: #AAAAAA;
  1545. margin-top: 20rpx;
  1546. width: 100%;
  1547. white-space: nowrap;
  1548. overflow: hidden;
  1549. text-overflow: ellipsis;
  1550. }
  1551. }
  1552. .black{
  1553. color: #222222!important;
  1554. }
  1555. .red{
  1556. color: red!important;
  1557. }
  1558. .fs28{
  1559. font-size: 28rpx!important;
  1560. font-weight: bold;
  1561. }
  1562. .code-box{
  1563. // .left{
  1564. // .title{
  1565. // font-weight: 500;
  1566. // font-size: 28rpx;
  1567. // color: #222222;
  1568. // }
  1569. // .codeNum{
  1570. // font-weight: 300;
  1571. // font-size: 24rpx;
  1572. // color: #AAAAAA;
  1573. // margin-top: 15rpx;
  1574. // }
  1575. // }
  1576. .qrcode{
  1577. display: flex;
  1578. align-items: center;
  1579. justify-content: center;
  1580. margin-top: 20rpx;
  1581. }
  1582. .code-btn{
  1583. display: flex;
  1584. align-items: center;
  1585. font-weight: 300;
  1586. font-size: 24rpx;
  1587. color: #AAAAAA;
  1588. .jiantou{
  1589. width: 24rpx;
  1590. height: 24rpx;
  1591. }
  1592. }
  1593. }
  1594. .input-box{
  1595. margin: 20rpx 30rpx;
  1596. padding: 28rpx 24rpx;
  1597. background: #FFFFFF;
  1598. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1599. display: flex;
  1600. align-items: center;
  1601. justify-content: space-between;
  1602. .label {
  1603. color: #222;
  1604. font-size: 28rpx;
  1605. }
  1606. .value {
  1607. font-size: 28rpx;
  1608. color: #AAAAAA;
  1609. }
  1610. }
  1611. .content{
  1612. margin: 20rpx 30rpx;
  1613. padding: 28rpx 24rpx;
  1614. border-radius: 16rpx;
  1615. background: #fff;
  1616. .title{
  1617. font-weight: 600;
  1618. font-size: 28rpx;
  1619. color: #222222;
  1620. }
  1621. .item{
  1622. display: flex;
  1623. align-items: center;
  1624. justify-content: space-between;
  1625. margin-top: 28rpx;
  1626. .label{
  1627. font-size: 28rpx;
  1628. color: #AAAAAA;
  1629. }
  1630. .value{
  1631. font-size: 28rpx;
  1632. color: #222222;
  1633. }
  1634. }
  1635. }
  1636. .pay-btn{
  1637. background: $uni-color-primary;
  1638. width: 688rpx;
  1639. height: 80rpx;
  1640. line-height: 80rpx;
  1641. border-radius: 46rpx;
  1642. color: #fff;
  1643. margin-top: 50rpx;
  1644. }
  1645. .refund-box{
  1646. .refund-msg{
  1647. font-weight: 300;
  1648. font-size: 24rpx;
  1649. color: #222222;
  1650. margin-top: 15rpx;
  1651. line-height: 40rpx;
  1652. }
  1653. }
  1654. .apply-box{
  1655. position: relative;
  1656. .label{
  1657. font-weight: 600;
  1658. font-size: 28rpx;
  1659. color: #222222;
  1660. }
  1661. .value{
  1662. color: #999999;
  1663. font-size: 24rpx;
  1664. margin-top: 15rpx;
  1665. }
  1666. .jiantou{
  1667. position: absolute;
  1668. top: 50%;
  1669. right: 24rpx;
  1670. transform: translateY(-50%);
  1671. width: 24rpx;
  1672. height: 24rpx;
  1673. }
  1674. }
  1675. .btn-box {
  1676. position: fixed;
  1677. bottom: 0%;
  1678. left: 0%;
  1679. width: 100%;
  1680. display: flex;
  1681. align-items: center;
  1682. justify-content: flex-end;
  1683. box-sizing: border-box;
  1684. padding: 10rpx 24rpx env(safe-area-inset-bottom);
  1685. background: #fff;
  1686. border-top: 1rpx solid #EEEEEE;
  1687. .cancel-btn{
  1688. width: 240rpx;
  1689. height: 80rpx;
  1690. line-height: 80rpx;
  1691. text-align: center;
  1692. border-radius: 40rpx;
  1693. border: 2rpx solid #EE4320;
  1694. font-weight: 600;
  1695. font-size: 28rpx;
  1696. color: #EE4320;
  1697. margin: 0;
  1698. }
  1699. .btn {
  1700. width: 240rpx;
  1701. height: 80rpx;
  1702. line-height: 80rpx;
  1703. text-align: center;
  1704. background: $uni-color-primary;
  1705. border-radius: 40rpx;
  1706. font-weight: 600;
  1707. font-size: 28rpx;
  1708. color: #FFFFFF;
  1709. margin: 0;
  1710. margin-left: 20rpx;
  1711. }
  1712. }
  1713. .info{
  1714. .order-info{
  1715. display: flex;
  1716. .icon{
  1717. width: 164rpx;
  1718. height: 164rpx;
  1719. border-radius: 16rpx;
  1720. flex-shrink: 0;
  1721. }
  1722. .shop-info{
  1723. display: flex;
  1724. flex-direction: column;
  1725. justify-content: space-between;
  1726. padding-left: 24rpx;
  1727. flex: 1;
  1728. box-sizing: border-box;
  1729. .title{
  1730. color: #181818;
  1731. font-size: 28rpx;
  1732. width: 450rpx;
  1733. white-space: nowrap;
  1734. overflow: hidden;
  1735. text-overflow: ellipsis;
  1736. }
  1737. .price-box{
  1738. display: flex;
  1739. align-items: center;
  1740. justify-content: space-between;
  1741. .price{
  1742. color: #181818;
  1743. color: $uni-color-primary;
  1744. font-size: 32rpx;
  1745. font-weight: bold;
  1746. }
  1747. }
  1748. .start-time,.goods-desc{
  1749. font-size: 24rpx;
  1750. color: #AAAAAA;
  1751. width: 450rpx;
  1752. white-space: nowrap;
  1753. overflow: hidden;
  1754. text-overflow: ellipsis;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. .wrap{
  1760. display: flex;
  1761. justify-content: center;
  1762. align-items: center;
  1763. height: 100vh;
  1764. overflow: hidden;
  1765. }
  1766. }
  1767. </style> -->