detail.vue 44 KB

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