index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978
  1. <template>
  2. <view>
  3. <view class='order-details'>
  4. <!-- 给header上与data上加on为退款订单-->
  5. <view class='header bg-color acea-row row-middle' :class='isGoodsReturn ? "on":""'>
  6. <view class='pictrue' v-if="isGoodsReturn==false">
  7. <image :src="orderInfo.status_pic"></image>
  8. </view>
  9. <view class='data' :class='isGoodsReturn ? "on":""'>
  10. <view class='state'>{{orderInfo._status._msg}}</view>
  11. <view>{{orderInfo.add_time_y}}<text class='time'>{{orderInfo.add_time_h}}</text></view>
  12. </view>
  13. </view>
  14. <view v-if="isGoodsReturn==false">
  15. <view class='nav'>
  16. <view class='navCon acea-row row-between-wrapper'>
  17. <view :class="status.type == 0 || status.type == -9 ? 'on':''">待付款</view>
  18. <view :class="status.type == 1 ? 'on':''">{{orderInfo.shipping_type==1 ? '待发货':'待核销'}}</view>
  19. <view :class="status.type == 2 ? 'on':''" v-if="orderInfo.shipping_type == 1">待收货</view>
  20. <view :class="status.type == 3 ? 'on':''">待评价</view>
  21. <view :class="status.type == 4 ? 'on':''">已完成</view>
  22. </view>
  23. <view class='progress acea-row row-between-wrapper'>
  24. <view class='iconfont' :class='(status.type == 0 || status.type == -9 ? "icon-webicon318":"icon-yuandianxiao") + " " + (status.type >= 0 ? "font-color":"")'></view>
  25. <view class='line' :class='status.type > 0 ? "bg-color":""'></view>
  26. <view class='iconfont' :class='(status.type == 1 ? "icon-webicon318":"icon-yuandianxiao") + " " + (status.type >= 1 ? "font-color":"")'></view>
  27. <view class='line' :class='status.type > 1 ? "bg-color":""' v-if="orderInfo.shipping_type == 1"></view>
  28. <view class='iconfont' :class='(status.type == 2 ? "icon-webicon318":"icon-yuandianxiao") + " " +(status.type >= 2 ? "font-color":"")'
  29. v-if="orderInfo.shipping_type == 1"></view>
  30. <view class='line' :class='status.type > 2 ? "bg-color":""'></view>
  31. <view class='iconfont' :class='(status.type == 3 ? "icon-webicon318":"icon-yuandianxiao") + " " + (status.type >= 3 ? "font-color":"")'></view>
  32. <view class='line' :class='status.type > 3 ? "bg-color":""'></view>
  33. <view class='iconfont' :class='(status.type == 4 ? "icon-webicon318":"icon-yuandianxiao") + " " + (status.type >= 4 ? "font-color":"")'></view>
  34. </view>
  35. </view>
  36. <!-- 拒绝退款 -->
  37. <view class="refund" v-if="orderInfo.refund_reason">
  38. <view class="title">
  39. <image src="/static/images/shuoming.png" mode=""></image>
  40. 商家拒绝退款
  41. </view>
  42. <view class="con">拒绝原因:{{orderInfo.refund_reason}}</view>
  43. </view>
  44. <view class="writeOff" v-if="orderInfo.shipping_type == 2 && orderInfo.paid">
  45. <view class="title">核销信息</view>
  46. <view class="grayBg">
  47. <view class="pictrue">
  48. <image :src="orderInfo.code"></image>
  49. </view>
  50. </view>
  51. <view class="gear">
  52. <image src="../../static/images/writeOff.jpg"></image>
  53. </view>
  54. <view class="num">{{orderInfo._verify_code}}</view>
  55. <view class="rules">
  56. <view class="item">
  57. <view class="rulesTitle acea-row row-middle">
  58. <text class="iconfont icon-shijian"></text>核销时间
  59. </view>
  60. <view class="info">
  61. 每日:<text class="time">{{orderInfo.system_store.day_time}}</text>
  62. </view>
  63. </view>
  64. <view class="item">
  65. <view class="rulesTitle acea-row row-middle">
  66. <text class="iconfont icon-shuoming1"></text>使用说明
  67. </view>
  68. <view class="info">可将二维码出示给店员扫描或提供数字核销码</view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="map acea-row row-between-wrapper" v-if="orderInfo.shipping_type == 2">
  73. <view>自提地址信息</view>
  74. <view class="place cart-color acea-row row-center-wrapper" @tap="showMaoLocation">
  75. <text class="iconfont icon-weizhi"></text>查看位置
  76. </view>
  77. </view>
  78. <view class='address' v-if="orderInfo.shipping_type === 1">
  79. <view class='name'>{{orderInfo.real_name}}<text class='phone'>{{orderInfo.user_phone}}</text></view>
  80. <view>{{orderInfo.user_address}}</view>
  81. </view>
  82. <view class='address' v-else style="margin-top:0;">
  83. <view class='name' @tap="makePhone">{{orderInfo.system_store.name}}<text class='phone'>{{orderInfo.system_store.phone}}</text><text
  84. class="iconfont icon-tonghua font-color"></text></view>
  85. <view>{{orderInfo.system_store._detailed_address}}</view>
  86. </view>
  87. <view class='line' v-if="orderInfo.shipping_type === 1">
  88. <image src='../../static/images/line.jpg'></image>
  89. </view>
  90. </view>
  91. <orderGoods :evaluate='evaluate' :orderId="order_id" :cartInfo="cartInfo" :jump="true"></orderGoods>
  92. <div class="goodCall" @click="goGoodCall">
  93. <!-- #ifdef H5 -->
  94. <span class="iconfont icon-kefu"></span><span>联系客服</span>
  95. <!-- #endif -->
  96. <!-- #ifdef MP -->
  97. <button open-type='contact' hover-class='none'>
  98. <span class="iconfont icon-kefu"></span><span>联系客服</span>
  99. </button>
  100. <!-- #endif -->
  101. </div>
  102. <view class='wrapper'>
  103. <view class='item acea-row row-between'>
  104. <view>订单编号:</view>
  105. <view class='conter acea-row row-middle row-right'>{{orderInfo.order_id}}
  106. <!-- #ifndef H5 -->
  107. <text class='copy' @tap='copy'>复制</text>
  108. <!-- #endif -->
  109. <!-- #ifdef H5 -->
  110. <text class='copy copy-data' :data-clipboard-text="orderInfo.order_id">复制</text>
  111. <!-- #endif -->
  112. </view>
  113. </view>
  114. <view class='item acea-row row-between'>
  115. <view>下单时间:</view>
  116. <view class='conter'>{{(orderInfo.add_time_y || '') +' '+(orderInfo.add_time_h || 0)}}</view>
  117. </view>
  118. <view class='item acea-row row-between'>
  119. <view>支付状态:</view>
  120. <view class='conter' v-if="orderInfo.paid">已支付</view>
  121. <view class='conter' v-else>未支付</view>
  122. </view>
  123. <view class='item acea-row row-between'>
  124. <view>支付方式:</view>
  125. <view class='conter'>{{orderInfo._status._payType}}</view>
  126. </view>
  127. <view class='item acea-row row-between' v-if="orderInfo.mark">
  128. <view>买家留言:</view>
  129. <view class='conter'>{{orderInfo.mark}}</view>
  130. </view>
  131. </view>
  132. <!-- 退款订单详情 -->
  133. <view class='wrapper' v-if="isGoodsReturn">
  134. <view class='item acea-row row-between'>
  135. <view>收货人:</view>
  136. <view class='conter'>{{orderInfo.real_name}}</view>
  137. </view>
  138. <view class='item acea-row row-between'>
  139. <view>联系电话:</view>
  140. <view class='conter'>{{orderInfo.user_phone}}</view>
  141. </view>
  142. <view class='item acea-row row-between'>
  143. <view>收货地址:</view>
  144. <view class='conter'>{{orderInfo.user_address}}</view>
  145. </view>
  146. </view>
  147. <view v-if="orderInfo.status!=0">
  148. <view class='wrapper' v-if='orderInfo.delivery_type=="express"'>
  149. <view class='item acea-row row-between'>
  150. <view>配送方式:</view>
  151. <view class='conter'>发货</view>
  152. </view>
  153. <view class='item acea-row row-between'>
  154. <view>快递公司:</view>
  155. <view class='conter'>{{orderInfo.delivery_name || ''}}</view>
  156. </view>
  157. <view class='item acea-row row-between'>
  158. <view>快递号:</view>
  159. <view class='conter'>{{orderInfo.delivery_id || ''}}</view>
  160. </view>
  161. </view>
  162. <view class='wrapper' v-else-if='orderInfo.delivery_type=="send"'>
  163. <view class='item acea-row row-between'>
  164. <view>配送方式::</view>
  165. <view class='conter'>送货</view>
  166. </view>
  167. <view class='item acea-row row-between'>
  168. <view>配送人姓名:</view>
  169. <view class='conter'>{{orderInfo.delivery_name || ''}}</view>
  170. </view>
  171. <view class='item acea-row row-between'>
  172. <view>联系电话:</view>
  173. <view class='conter acea-row row-middle row-right'>{{orderInfo.delivery_id || ''}}<text class='copy' @tap='goTel'>拨打</text></view>
  174. </view>
  175. </view>
  176. <view class='wrapper' v-else-if='orderInfo.delivery_type=="fictitious"'>
  177. <view class='item acea-row row-between'>
  178. <view>虚拟发货:</view>
  179. <view class='conter'>已发货,请注意查收</view>
  180. </view>
  181. </view>
  182. </view>
  183. <view class='wrapper'>
  184. <view class='item acea-row row-between'>
  185. <view>支付金额:</view>
  186. <view class='conter'>¥{{orderInfo.total_price}}</view>
  187. </view>
  188. <view class='item acea-row row-between' v-if='orderInfo.coupon_id'>
  189. <view>优惠券抵扣:</view>
  190. <view class='conter'>-¥{{orderInfo.coupon_price}}</view>
  191. </view>
  192. <view class='item acea-row row-between' v-if="orderInfo.use_integral > 0">
  193. <view>积分抵扣:</view>
  194. <view class='conter'>-¥{{orderInfo.deduction_price}}</view>
  195. </view>
  196. <view class='item acea-row row-between' v-if="orderInfo.pay_postage > 0">
  197. <view>运费:</view>
  198. <view class='conter'>¥{{orderInfo.pay_postage}}</view>
  199. </view>
  200. <view class='actualPay acea-row row-right'>实付款:<text class='money font-color'>¥{{orderInfo.pay_price}}</text></view>
  201. </view>
  202. <view style='height:120rpx;'></view>
  203. <view class='footer acea-row row-right row-middle' v-if="isGoodsReturn==false || status.type == 9">
  204. <view class="qs-btn" v-if="status.type == 0 || status.type == -9" @click.stop="cancelOrder">取消订单</view>
  205. <view class='bnt bg-color' v-if="status.type==0" @tap='pay_open(orderInfo.order_id)'>立即付款</view>
  206. <!-- #ifdef MP -->
  207. <view @tap="openSubcribe('/pages/users/goods_return/index?orderId='+orderInfo.order_id)" class='bnt cancel'
  208. v-else-if="orderInfo.paid === 1 && orderInfo.refund_status === 0">申请退款</view>
  209. <!-- #endif -->
  210. <!-- #ifndef MP -->
  211. <navigator hover-class="none" :url="'/pages/users/goods_return/index?orderId='+orderInfo.order_id" class='bnt cancel'
  212. v-else-if="orderInfo.paid === 1 && orderInfo.refund_status === 0">申请退款</navigator>
  213. <!-- #endif -->
  214. <view class='bnt bg-color' v-if="status.class_status==1" @tap='goJoinPink'>查看拼团</view>
  215. <navigator class='bnt cancel' v-if="orderInfo.delivery_type == 'express' && status.class_status==3 && status.type==2"
  216. hover-class='none' :url="'/pages/users/goods_logistics/index?orderId='+ orderInfo.order_id">查看物流</navigator>
  217. <view class='bnt bg-color' v-if="status.class_status==3" @tap='confirmOrder'>确认收货</view>
  218. <view class='bnt cancel' v-if="status.type==4" @tap='delOrder'>删除订单</view>
  219. <view class='bnt bg-color' v-if="status.class_status==5" @tap='goOrderConfirm'>再次购买</view>
  220. </view>
  221. </view>
  222. <home></home>
  223. <!-- #ifdef MP -->
  224. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
  225. <!-- #endif -->
  226. <payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
  227. </view>
  228. </template>
  229. <style scoped lang="scss">
  230. .goodCall {
  231. color: #e93323;
  232. text-align: center;
  233. width: 100%;
  234. height: 86rpx;
  235. padding: 0 30rpx;
  236. border-bottom: 1rpx solid #eee;
  237. font-size: 30rpx;
  238. line-height: 86rpx;
  239. background: #fff;
  240. .icon-kefu {
  241. font-size: 36rpx;
  242. margin-right: 15rpx;
  243. }
  244. /* #ifdef MP */
  245. button {
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. height: 86rpx;
  250. font-size: 30rpx;
  251. color: #e93323;
  252. }
  253. /* #endif */
  254. }
  255. .order-details .header {
  256. padding: 0 30rpx;
  257. height: 150rpx;
  258. }
  259. .order-details .header.on {
  260. background-color: #666 !important;
  261. }
  262. .order-details .header .pictrue {
  263. width: 110rpx;
  264. height: 110rpx;
  265. }
  266. .order-details .header .pictrue image {
  267. width: 100%;
  268. height: 100%;
  269. }
  270. .order-details .header .data {
  271. color: rgba(255, 255, 255, 0.8);
  272. font-size: 24rpx;
  273. margin-left: 27rpx;
  274. }
  275. .order-details .header .data.on {
  276. margin-left: 0;
  277. }
  278. .order-details .header .data .state {
  279. font-size: 30rpx;
  280. font-weight: bold;
  281. color: #fff;
  282. margin-bottom: 7rpx;
  283. }
  284. .order-details .header .data .time {
  285. margin-left: 20rpx;
  286. }
  287. .order-details .nav {
  288. background-color: #fff;
  289. font-size: 26rpx;
  290. color: #282828;
  291. padding: 25rpx 0;
  292. }
  293. .order-details .nav .navCon {
  294. padding: 0 40rpx;
  295. }
  296. .order-details .nav .on {
  297. color: #e93323;
  298. }
  299. .order-details .nav .progress {
  300. padding: 0 65rpx;
  301. margin-top: 10rpx;
  302. }
  303. .order-details .nav .progress .line {
  304. width: 100rpx;
  305. height: 2rpx;
  306. background-color: #939390;
  307. }
  308. .order-details .nav .progress .iconfont {
  309. font-size: 25rpx;
  310. color: #939390;
  311. margin-top: -2rpx;
  312. }
  313. .order-details .address {
  314. font-size: 26rpx;
  315. color: #868686;
  316. background-color: #fff;
  317. margin-top: 13rpx;
  318. padding: 35rpx 30rpx;
  319. }
  320. .order-details .address .name {
  321. font-size: 30rpx;
  322. color: #282828;
  323. margin-bottom: 15rpx;
  324. }
  325. .order-details .address .name .phone {
  326. margin-left: 40rpx;
  327. }
  328. .order-details .line {
  329. width: 100%;
  330. height: 3rpx;
  331. }
  332. .order-details .line image {
  333. width: 100%;
  334. height: 100%;
  335. display: block;
  336. }
  337. .order-details .wrapper {
  338. background-color: #fff;
  339. margin-top: 12rpx;
  340. padding: 30rpx;
  341. }
  342. .order-details .wrapper .item {
  343. font-size: 28rpx;
  344. color: #282828;
  345. }
  346. .order-details .wrapper .item~.item {
  347. margin-top: 20rpx;
  348. }
  349. .order-details .wrapper .item .conter {
  350. color: #868686;
  351. width: 460rpx;
  352. text-align: right;
  353. }
  354. .order-details .wrapper .item .conter .copy {
  355. font-size: 20rpx;
  356. color: #333;
  357. border-radius: 3rpx;
  358. border: 1rpx solid #666;
  359. padding: 3rpx 15rpx;
  360. margin-left: 24rpx;
  361. }
  362. .order-details .wrapper .actualPay {
  363. border-top: 1rpx solid #eee;
  364. margin-top: 30rpx;
  365. padding-top: 30rpx;
  366. }
  367. .order-details .wrapper .actualPay .money {
  368. font-weight: bold;
  369. font-size: 30rpx;
  370. }
  371. .order-details .footer {
  372. width: 100%;
  373. height: 100rpx;
  374. position: fixed;
  375. bottom: 0;
  376. left: 0;
  377. background-color: #fff;
  378. padding: 0 30rpx;
  379. box-sizing: border-box;
  380. }
  381. .order-details .footer .bnt {
  382. width: 176rpx;
  383. height: 60rpx;
  384. text-align: center;
  385. line-height: 60rpx;
  386. border-radius: 50rpx;
  387. color: #fff;
  388. font-size: 27rpx;
  389. }
  390. .order-details .footer .bnt.cancel {
  391. color: #aaa;
  392. border: 1rpx solid #ddd;
  393. }
  394. .order-details .footer .bnt~.bnt {
  395. margin-left: 18rpx;
  396. }
  397. .order-details .writeOff {
  398. background-color: #fff;
  399. margin-top: 13rpx;
  400. padding-bottom: 30rpx;
  401. }
  402. .order-details .writeOff .title {
  403. font-size: 30rpx;
  404. color: #282828;
  405. height: 87rpx;
  406. border-bottom: 1px solid #f0f0f0;
  407. padding: 0 30rpx;
  408. line-height: 87rpx;
  409. }
  410. .order-details .writeOff .grayBg {
  411. background-color: #f2f5f7;
  412. width: 590rpx;
  413. height: 384rpx;
  414. border-radius: 20rpx 20rpx 0 0;
  415. margin: 50rpx auto 0 auto;
  416. padding-top: 55rpx;
  417. }
  418. .order-details .writeOff .grayBg .pictrue {
  419. width: 290rpx;
  420. height: 290rpx;
  421. margin: 0 auto;
  422. }
  423. .order-details .writeOff .grayBg .pictrue image {
  424. width: 100%;
  425. height: 100%;
  426. display: block;
  427. }
  428. .order-details .writeOff .gear {
  429. width: 590rpx;
  430. height: 30rpx;
  431. margin: 0 auto;
  432. }
  433. .order-details .writeOff .gear image {
  434. width: 100%;
  435. height: 100%;
  436. display: block;
  437. }
  438. .order-details .writeOff .num {
  439. background-color: #f0c34c;
  440. width: 590rpx;
  441. height: 84rpx;
  442. color: #282828;
  443. font-size: 48rpx;
  444. margin: 0 auto;
  445. border-radius: 0 0 20rpx 20rpx;
  446. text-align: center;
  447. padding-top: 4rpx;
  448. }
  449. .order-details .writeOff .rules {
  450. margin: 46rpx 30rpx 0 30rpx;
  451. border-top: 1px solid #f0f0f0;
  452. padding-top: 10rpx;
  453. }
  454. .order-details .writeOff .rules .item {
  455. margin-top: 20rpx;
  456. }
  457. .order-details .writeOff .rules .item .rulesTitle {
  458. font-size: 28rpx;
  459. color: #282828;
  460. }
  461. .order-details .writeOff .rules .item .rulesTitle .iconfont {
  462. font-size: 30rpx;
  463. color: #333;
  464. margin-right: 8rpx;
  465. margin-top: 5rpx;
  466. }
  467. .order-details .writeOff .rules .item .info {
  468. font-size: 28rpx;
  469. color: #999;
  470. margin-top: 7rpx;
  471. }
  472. .order-details .writeOff .rules .item .info .time {
  473. margin-left: 20rpx;
  474. }
  475. .order-details .map {
  476. height: 86rpx;
  477. font-size: 30rpx;
  478. color: #282828;
  479. line-height: 86rpx;
  480. border-bottom: 1px solid #f0f0f0;
  481. margin-top: 13rpx;
  482. background-color: #fff;
  483. padding: 0 30rpx;
  484. }
  485. .order-details .map .place {
  486. font-size: 26rpx;
  487. width: 176rpx;
  488. height: 50rpx;
  489. border-radius: 25rpx;
  490. line-height: 50rpx;
  491. text-align: center;
  492. }
  493. .order-details .map .place .iconfont {
  494. font-size: 27rpx;
  495. height: 27rpx;
  496. line-height: 27rpx;
  497. margin: 2rpx 3rpx 0 0;
  498. }
  499. .order-details .address .name .iconfont {
  500. font-size: 34rpx;
  501. margin-left: 10rpx;
  502. }
  503. .refund {
  504. padding: 0 30rpx 30rpx;
  505. margin-top: 24rpx;
  506. background-color: #fff;
  507. .title {
  508. display: flex;
  509. align-items: center;
  510. font-size: 30rpx;
  511. color: #333;
  512. height: 86rpx;
  513. border-bottom: 1px solid #f5f5f5;
  514. image {
  515. width: 32rpx;
  516. height: 32rpx;
  517. margin-right: 10rpx;
  518. }
  519. }
  520. .con {
  521. padding-top: 25rpx;
  522. font-size: 28rpx;
  523. color: #868686;
  524. }
  525. }
  526. </style>
  527. <script>
  528. import {
  529. getOrderDetail,
  530. orderAgain,
  531. orderTake,
  532. orderDel,
  533. orderCancel
  534. } from '@/api/order.js';
  535. import {
  536. openOrderRefundSubscribe
  537. } from '@/utils/SubscribeMessage.js';
  538. import {
  539. getUserInfo
  540. } from '@/api/user.js';
  541. import home from '@/components/home';
  542. import payment from '@/components/payment';
  543. import orderGoods from "@/components/orderGoods";
  544. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  545. import {
  546. toLogin
  547. } from '@/libs/login.js';
  548. import {
  549. mapGetters
  550. } from "vuex";
  551. // #ifdef MP
  552. import authorize from '@/components/Authorize';
  553. // #endif
  554. export default {
  555. components: {
  556. payment,
  557. home,
  558. orderGoods,
  559. // #ifdef MP
  560. authorize
  561. // #endif
  562. },
  563. data() {
  564. return {
  565. order_id: '',
  566. evaluate: 0,
  567. cartInfo: [], //购物车产品
  568. orderInfo: {
  569. system_store: {},
  570. _status: {}
  571. }, //订单详情
  572. system_store: {},
  573. isGoodsReturn: false, //是否为退款订单
  574. status: {}, //订单底部按钮状态
  575. isClose: false,
  576. payMode: [{
  577. name: "微信支付",
  578. icon: "icon-weixinzhifu",
  579. value: 'weixin',
  580. title: '微信快捷支付'
  581. },
  582. {
  583. name: "余额支付",
  584. icon: "icon-yuezhifu",
  585. value: 'yue',
  586. title: '可用余额:',
  587. number: 0
  588. },
  589. ],
  590. pay_close: false,
  591. pay_order_id: '',
  592. totalPrice: '0',
  593. isAuto: false, //没有授权的不会自动授权
  594. isShowAuth: false //是否隐藏授权
  595. };
  596. },
  597. computed: mapGetters(['isLogin']),
  598. onLoad: function(options) {
  599. if (options.order_id) {
  600. this.$set(this, 'order_id', options.order_id);
  601. }
  602. },
  603. onShow() {
  604. if (this.isLogin) {
  605. this.getOrderInfo();
  606. this.getUserInfo();
  607. } else {
  608. // #ifdef H5 || APP-PLUS
  609. toLogin();
  610. // #endif
  611. // #ifdef MP
  612. this.isAuto = true;
  613. this.$set(this, 'isShowAuth', true);
  614. // #endif
  615. }
  616. },
  617. onHide: function() {
  618. this.isClose = true;
  619. },
  620. onReady: function() {
  621. // #ifdef H5
  622. this.$nextTick(function() {
  623. const clipboard = new ClipboardJS(".copy-data");
  624. clipboard.on("success", () => {
  625. this.$util.Tips({
  626. title: '复制成功'
  627. });
  628. });
  629. });
  630. // #endif
  631. },
  632. methods: {
  633. goGoodCall() {
  634. let self = this
  635. uni.navigateTo({
  636. url: `/pages/customer_list/index?orderId=${self.order_id}`
  637. })
  638. },
  639. openSubcribe: function(e) {
  640. let page = e;
  641. uni.showLoading({
  642. title: '正在加载',
  643. })
  644. openOrderRefundSubscribe().then(res => {
  645. uni.hideLoading();
  646. uni.navigateTo({
  647. url: page,
  648. });
  649. }).catch(() => {
  650. uni.hideLoading();
  651. });
  652. },
  653. /**
  654. * 事件回调
  655. *
  656. */
  657. onChangeFun: function(e) {
  658. let opt = e;
  659. let action = opt.action || null;
  660. let value = opt.value != undefined ? opt.value : null;
  661. (action && this[action]) && this[action](value);
  662. },
  663. /**
  664. * 拨打电话
  665. */
  666. makePhone: function() {
  667. uni.makePhoneCall({
  668. phoneNumber: this.system_store.phone
  669. })
  670. },
  671. /**
  672. * 打开地图
  673. *
  674. */
  675. showMaoLocation: function() {
  676. if (!this.system_store.latitude || !this.system_store.longitude) return this.$util.Tips({
  677. title: '缺少经纬度信息无法查看地图!'
  678. });
  679. uni.openLocation({
  680. latitude: parseFloat(this.system_store.latitude),
  681. longitude: parseFloat(this.system_store.longitude),
  682. scale: 8,
  683. name: this.system_store.name,
  684. address: this.system_store.address + this.system_store.detailed_address,
  685. success: function() {
  686. },
  687. });
  688. },
  689. /**
  690. * 关闭支付组件
  691. *
  692. */
  693. payClose: function() {
  694. this.pay_close = false;
  695. },
  696. /**
  697. * 打开支付组件
  698. *
  699. */
  700. pay_open: function() {
  701. this.pay_close = true;
  702. this.pay_order_id = this.orderInfo.order_id;
  703. this.totalPrice = this.orderInfo.pay_price;
  704. },
  705. /**
  706. * 支付成功回调
  707. *
  708. */
  709. pay_complete: function() {
  710. this.pay_close = false;
  711. this.pay_order_id = '';
  712. this.getOrderInfo();
  713. },
  714. /**
  715. * 支付失败回调
  716. *
  717. */
  718. pay_fail: function() {
  719. this.pay_close = false;
  720. this.pay_order_id = '';
  721. },
  722. /**
  723. * 登录授权回调
  724. *
  725. */
  726. onLoadFun: function() {
  727. this.getOrderInfo();
  728. this.getUserInfo();
  729. },
  730. /**
  731. * 获取用户信息
  732. *
  733. */
  734. getUserInfo: function() {
  735. let that = this;
  736. getUserInfo().then(res => {
  737. that.payMode[1].number = res.data.now_money;
  738. that.$set(that, 'payMode', that.payMode);
  739. })
  740. },
  741. /**
  742. * 获取订单详细信息
  743. *
  744. */
  745. getOrderInfo: function() {
  746. let that = this;
  747. uni.showLoading({
  748. title: "正在加载中"
  749. });
  750. getOrderDetail(this.order_id).then(res => {
  751. let _type = res.data._status._type;
  752. uni.hideLoading();
  753. that.$set(that, 'orderInfo', res.data);
  754. that.$set(that, 'cartInfo', res.data.cartInfo);
  755. that.$set(that, 'evaluate', _type == 3 ? 3 : 0);
  756. that.$set(that, 'system_store', res.data.system_store);
  757. if (this.orderInfo.refund_status != 0) {
  758. this.isGoodsReturn = true;
  759. }
  760. that.getOrderStatus();
  761. }).catch(err => {
  762. uni.hideLoading();
  763. that.$util.Tips({
  764. title: err
  765. }, '/pages/users/order_list/index');
  766. });
  767. },
  768. /**
  769. *
  770. * 剪切订单号
  771. */
  772. // #ifndef H5
  773. copy: function() {
  774. let that = this;
  775. uni.setClipboardData({
  776. data: this.orderInfo.order_id
  777. });
  778. },
  779. // #endif
  780. /**
  781. * 打电话
  782. */
  783. goTel: function() {
  784. uni.makePhoneCall({
  785. phoneNumber: this.orderInfo.delivery_id
  786. })
  787. },
  788. /**
  789. * 设置底部按钮
  790. *
  791. */
  792. getOrderStatus: function() {
  793. let orderInfo = this.orderInfo || {},
  794. _status = orderInfo._status || {
  795. _type: 0
  796. },
  797. status = {};
  798. let type = parseInt(_status._type),
  799. delivery_type = orderInfo.delivery_type,
  800. seckill_id = orderInfo.seckill_id ? parseInt(orderInfo.seckill_id) : 0,
  801. bargain_id = orderInfo.bargain_id ? parseInt(orderInfo.bargain_id) : 0,
  802. combination_id = orderInfo.combination_id ? parseInt(orderInfo.combination_id) : 0;
  803. status = {
  804. type: type == 9 ? -9 : type,
  805. class_status: 0
  806. };
  807. if (type == 1 && combination_id > 0) status.class_status = 1; //查看拼团
  808. if (type == 2 && delivery_type == 'express') status.class_status = 2; //查看物流
  809. if (type == 2) status.class_status = 3; //确认收货
  810. if (type == 4 || type == 0) status.class_status = 4; //删除订单
  811. if (!seckill_id && !bargain_id && !combination_id && (type == 3 || type == 4)) status.class_status = 5; //再次购买
  812. this.$set(this, 'status', status);
  813. },
  814. /**
  815. * 去拼团详情
  816. *
  817. */
  818. goJoinPink: function() {
  819. uni.navigateTo({
  820. url: '/pages/activity/goods_combination_status/index?id=' + this.orderInfo.pink_id,
  821. });
  822. },
  823. /**
  824. * 再此购买
  825. *
  826. */
  827. goOrderConfirm: function() {
  828. let that = this;
  829. orderAgain(that.orderInfo.order_id).then(res => {
  830. return uni.navigateTo({
  831. url: '/pages/users/order_confirm/index?cartId=' + res.data.cateId
  832. });
  833. });
  834. },
  835. confirmOrder: function() {
  836. let that = this;
  837. uni.showModal({
  838. title: '确认收货',
  839. content: '为保障权益,请收到货确认无误后,再确认收货',
  840. success: function(res) {
  841. if (res.confirm) {
  842. orderTake(that.order_id).then(res => {
  843. return that.$util.Tips({
  844. title: '操作成功',
  845. icon: 'success'
  846. }, function() {
  847. that.getOrderInfo();
  848. });
  849. }).catch(err => {
  850. return that.$util.Tips({
  851. title: err
  852. });
  853. })
  854. }
  855. }
  856. })
  857. },
  858. /**
  859. *
  860. * 删除订单
  861. */
  862. delOrder: function() {
  863. let that = this;
  864. orderDel(this.order_id).then(res => {
  865. return that.$util.Tips({
  866. title: '删除成功',
  867. icon: 'success'
  868. }, {
  869. tab: 3,
  870. url: 1
  871. });
  872. }).catch(err => {
  873. return that.$util.Tips({
  874. title: err
  875. });
  876. });
  877. },
  878. cancelOrder() {
  879. let self = this
  880. uni.showModal({
  881. title: '提示',
  882. content: '确认取消该订单?',
  883. success: function(res) {
  884. if (res.confirm) {
  885. orderCancel(self.orderInfo.order_id)
  886. .then((data) => {
  887. console.log(data)
  888. self.$util.Tips({
  889. title: data.msg
  890. }, {
  891. tab: 3
  892. })
  893. })
  894. .catch(() => {
  895. self.getDetail();
  896. });
  897. } else if (res.cancel) {
  898. console.log('用户点击取消');
  899. }
  900. }
  901. });
  902. },
  903. }
  904. }
  905. </script>
  906. <style>
  907. .qs-btn {
  908. width: auto;
  909. height: 60rpx;
  910. text-align: center;
  911. line-height: 60rpx;
  912. border-radius: 50rpx;
  913. color: #fff;
  914. font-size: 27rpx;
  915. padding: 0 3%;
  916. color: #aaa;
  917. border: 1px solid #ddd;
  918. margin-right: 20rpx;
  919. }
  920. </style>