index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. <template>
  2. <view :data-theme="theme">
  3. <view class='order-details'>
  4. <!-- 给header上与data上加on为退款订单-->
  5. <view class='header bg_color'>
  6. <view class='picTxt acea-row row-middle'>
  7. <view class='data'>
  8. <view v-if="orderInfo.refundStatus == 3" class='state'>已退款</view>
  9. <view v-else-if="shippingType == 2 && orderType == 'secondHand' && orderInfo.status == 1" class='state'>待自取</view>
  10. <view v-else class='state'>{{orderInfo.status | orderStatusFilter}}</view>
  11. <view v-if="orderInfo.refundReasonTime !== null">{{orderInfo.refundReasonTime}}</view>
  12. <view v-if="orderInfo.createTime && orderInfo.status>0">{{orderInfo.createTime}}</view>
  13. <view v-if="orderInfo.status===0">请在{{orderInfo.expirationTime}}前完成支付!</view>
  14. </view>
  15. <view class="">
  16. <image class="orderStatusPng" :src="urlDomain+`crmebimage/presets/orderStatus/${statusPng[orderInfo.status]}.png`" mode=""></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="borderPad" style="margin: -100rpx auto 0 auto;">
  21. <view v-if="orderInfo.status!==9 && (shippingType ===1 || shippingType ===3) && orderInfo.refundStatus !== 3" class='nav'>
  22. <view class='navCon acea-row row-between-wrapper'>
  23. <view :class="orderInfo.status == 0 ?'on':''">待付款</view>
  24. <view :class="orderInfo.status == 1 ? 'on':''">待发货</view>
  25. <view :class="orderInfo.status == 4 ? 'on':''">待收货</view>
  26. <view :class="orderInfo.status == 5 ? 'on':''">已收货</view>
  27. <view :class="orderInfo.status == 6 ? 'on':''">已完成</view>
  28. </view>
  29. <!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
  30. <view class='progress acea-row row-between-wrapper'>
  31. <view class='iconfont'
  32. :class='(orderInfo.status == 0 ? "icon-webicon318":"icon-yuandianxiao") + " " + (orderInfo.status >= 0 ? "font_color":"")'>
  33. </view>
  34. <view class='line' :class='orderInfo.status > 0 ? "bg_color":""'></view>
  35. <view class='iconfont'
  36. :class='(orderInfo.status == 1 ? "icon-webicon318":"icon-yuandianxiao") + " " +(orderInfo.status >= 1 ? "font_color":"")'>
  37. </view>
  38. <view class='line' :class='orderInfo.status > 2 ? "bg_color":""'></view>
  39. <view class='iconfont'
  40. :class='(orderInfo.status == 4 ? "icon-webicon318":"icon-yuandianxiao") + " " + (orderInfo.status >= 4 ? "font_color":"")'>
  41. </view>
  42. <view class='line' :class='orderInfo.status > 4 ? "bg_color":""'></view>
  43. <view class='iconfont'
  44. :class='(orderInfo.status == 5 ? "icon-webicon318":"icon-yuandianxiao") + " " + (orderInfo.status >= 5 ? "font_color":"")'>
  45. </view>
  46. <view class='line' :class='orderInfo.status > 5 ? "bg_color":""'></view>
  47. <view class='iconfont'
  48. :class='(orderInfo.status == 6 ? "icon-webicon318":"icon-yuandianxiao") + " " + (orderInfo.status >= 6 ? "font_color":"")'>
  49. </view>
  50. </view>
  51. </view>
  52. <view v-if="shippingType ===2 && orderInfo.refundStatus !== 3" class='nav'>
  53. <view class='navCon acea-row row-between-wrapper'>
  54. <view :class="orderInfo.status == 0 ?'on':''">待付款</view>
  55. <view :class="orderInfo.status == 3 ? 'on':''">{{orderType == 'secondHand' ? '待自取' : '待核销'}}</view>
  56. <view :class="orderInfo.status == 6 ? 'on':''">已收货</view>
  57. </view>
  58. <!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
  59. <view class='progress acea-row row-between-wrapper'>
  60. <view class='iconfont'
  61. :class='(orderInfo.status == 0 ? "icon-webicon318":"icon-yuandianxiao") + " " + (orderInfo.status >= 0 ? "font_color":"")'>
  62. </view>
  63. <view class='line' :class='orderInfo.status > 0 ? "bg_color":""'></view>
  64. <view class='iconfont'
  65. :class='(orderInfo.status == 3 ? "icon-webicon318":"icon-yuandianxiao") + " " +(orderInfo.status >= 3 ? "font_color":"")'>
  66. </view>
  67. <view class='line' :class='orderInfo.status > 4 ? "bg_color":""'></view>
  68. <view class='iconfont'
  69. :class='(orderInfo.status == 5 ? "icon-webicon318":"icon-yuandianxiao") + " " + (orderInfo.status >= 5 ? "font_color":"")'>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 收货地址只显示一次 -->
  74. <view v-if="isUserAddress && secondType !== ProductTypeEnum.Fictitious"
  75. class='wrapper borRadius14 address'>
  76. <view class='name'>{{userAddress[0].realName}}<text
  77. class='phone'>{{userAddress[0].userPhone}}</text></view>
  78. <view>{{userAddress[0].userAddress}}</view>
  79. </view>
  80. <block v-for="(item, index) in orderInfo.merchantOrderList" :key="item.merId">
  81. <view v-if="item.shippingType == 2 && orderInfo.status == 3 && orderInfo.refundStatus !== 3">
  82. <view class="writeOff borRadius14">
  83. <view class="title">核销信息</view>
  84. <view class="grayBg">
  85. <view class="pictrue">
  86. <image :src="codeImg"></image>
  87. </view>
  88. </view>
  89. <view class="gear">
  90. <image src="../static/images/writeOff.jpg"></image>
  91. </view>
  92. <view class="num">{{item.verifyCode}}</view>
  93. <view class="rules" v-if='item.systemStore'>
  94. <view class="item">
  95. <view class="rulesTitle acea-row row-middle">
  96. <text class="iconfont icon-shijian"></text>核销时间
  97. </view>
  98. <view class="info">
  99. 每日:<text class="time">{{item.systemStore.dayTime.replace(',','-')}}</text>
  100. </view>
  101. </view>
  102. <view class="item">
  103. <view class="rulesTitle acea-row row-middle">
  104. <text class="iconfont icon-shuoming1"></text>使用说明
  105. </view>
  106. <view class="info">可将二维码出示给店员扫描或提供数字核销码</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="map borRadius14">
  111. <view class='title item acea-row row-between-wrapper'>
  112. <view>自提地址信息</view>
  113. <view class="place cart-color acea-row row-center-wrapper" @tap="showMaoLocation(item)">
  114. <text class="iconfont icon-weizhi"></text>查看位置
  115. </view>
  116. </view>
  117. <view class="address">
  118. <view class='name' @tap="makePhone(item.merPhone)">{{item.merName}}<text
  119. class='phone'>{{item.merPhone}}</text><text
  120. class="iconfont icon-tonghua font-color"></text></view>
  121. <view>{{item.merAddressDetail}}</view>
  122. </view>
  123. </view>
  124. </view>
  125. <view class="borRadius14 orderGoodsBox">
  126. <orderGoods :orderInfo="item" :orderNo="orderNo" :cartInfo="item.orderInfoList" :jump="true"
  127. :orderData="orderInfo" :secondType="orderInfo.secondType"></orderGoods>
  128. <!-- v-if="orderInfo.status < 2" -->
  129. <view class="p-24">
  130. <view class='item acea-row row-between'>
  131. <view>配送方式:</view>
  132. <view v-if="Number(orderInfo.secondType) > 4" class='conter'>自动发货</view>
  133. <view v-else-if="Number(orderInfo.secondType) === 2" class='conter'>虚拟发货</view>
  134. <view v-else class='conter'>{{item.shippingType ==1 ? '商家配送': '到店自提'}}</view>
  135. </view>
  136. </view>
  137. <view class='flex justify-between userRemarkBox'>
  138. <view class="f-s-28 color28">买家留言:</view>
  139. <view class='cor-86 f-s-28 userRemark'>{{item.userRemark || '-'}}</view>
  140. <view v-show="!isShow" @click="isShow=!isShow">
  141. <view class='mark_show f-s-28'>{{item.userRemark}}</view>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- <view v-if="orderInfo.status > 1" class="p-24 wrapper borRadius14">
  146. <view class='item acea-row row-between'>
  147. <view>配送方式:</view>
  148. <view v-if="Number(orderInfo.secondType) > 4" class='conter'>自动发货</view>
  149. <view v-else-if="secondType === ProductTypeEnum.Fictitious" class='conter'>虚拟发货</view>
  150. <view v-else class='conter'>{{item.shippingType ==1 ? '商家配送': '到店自提'}}</view>
  151. </view>
  152. </view> -->
  153. </block>
  154. </view>
  155. <!-- 系统表单信息 "-->
  156. <view v-if="orderExtend.length" class="borderPad">
  157. <view class='wrapper borRadius14'>
  158. <systemFromInfo :orderExtend="orderExtend"></systemFromInfo>
  159. </view>
  160. </view>
  161. <!-- 订单信息 "-->
  162. <view class="borderPad">
  163. <view class='wrapper borRadius14'>
  164. <view class='item acea-row row-between'>
  165. <view>订单编号:</view>
  166. <view class='conter acea-row row-middle row-right' style="width: auto;"><text
  167. class="text-overflow">{{orderInfo.orderNo}}</text>
  168. <!-- #ifndef H5 -->
  169. <text class='copy line-heightOne' @tap='handleCopy(orderInfo.orderNo)'>复制</text>
  170. <!-- #endif -->
  171. <!-- #ifdef H5 -->
  172. <text class='copy copy-data' :data-clipboard-text="orderInfo.orderNo">复制</text>
  173. <!-- #endif -->
  174. </view>
  175. </view>
  176. <view class='item acea-row row-between'>
  177. <view>下单时间:</view>
  178. <view class='conter'>{{(orderInfo.createTime || 0)}}</view>
  179. </view>
  180. <view class='item acea-row row-between'>
  181. <view>支付状态:</view>
  182. <view class='conter' v-if="orderInfo.paid">已支付</view>
  183. <view class='conter' v-else>未支付</view>
  184. </view>
  185. <view
  186. v-show="(orderInfo.payType && secondType !== ProductTypeEnum.Integral) || (secondType === ProductTypeEnum.Integral && orderInfo.payPrice!=0)"
  187. class='item acea-row row-between'>
  188. <view>支付方式:</view>
  189. <view class='conter'>{{orderInfo.payType | payTypeFilter}}</view>
  190. </view>
  191. </view>
  192. <view>
  193. <view class='wrapper borRadius14' v-if='orderInfo.deliveryType=="express"'>
  194. <view class='item acea-row row-between'>
  195. <view>配送方式:</view>
  196. <view class='conter'>发货</view>
  197. </view>
  198. <view class='item acea-row row-between'>
  199. <view>快递公司:</view>
  200. <view class='conter'>{{orderInfo.deliveryName || ''}}</view>
  201. </view>
  202. <view class='item acea-row row-between'>
  203. <view>快递号:</view>
  204. <view class='conter'>{{orderInfo.deliveryId || ''}}</view>
  205. </view>
  206. </view>
  207. <view class='wrapper borRadius14' v-else-if='orderInfo.deliveryType=="send"'>
  208. <view class='item acea-row row-between'>
  209. <view>配送方式:</view>
  210. <view class='conter'>送货</view>
  211. </view>
  212. <view class='item acea-row row-between'>
  213. <view>配送人姓名:</view>
  214. <view class='conter'>{{orderInfo.deliveryName || ''}}</view>
  215. </view>
  216. <view class='item acea-row row-between'>
  217. <view>联系电话:</view>
  218. <view class='conter acea-row row-middle row-right'>{{orderInfo.deliveryId || ''}}<text
  219. class='copy' @tap='goTel'>拨打</text></view>
  220. </view>
  221. </view>
  222. <view class='wrapper borRadius14' v-else-if='orderInfo.deliveryType=="fictitious"'>
  223. <view class='item acea-row row-between'>
  224. <view>虚拟发货:</view>
  225. <view class='conter'>已发货,请注意查收</view>
  226. </view>
  227. </view>
  228. </view>
  229. <view class='wrapper borRadius14'>
  230. <view class='item acea-row row-between'>
  231. <view>商品总价:</view>
  232. <!-- 积分价格 -->
  233. <PointsPrice v-if="secondType === ProductTypeEnum.Integral" :pointsPrice="pointsPrice"
  234. :pointsGoodsStyle="hotPointsStyle"></PointsPrice>
  235. <!-- 其他价格 -->
  236. <view v-else class='conter'>¥{{orderInfo.proTotalPrice || 0}}</view>
  237. </view>
  238. <view class='item acea-row row-between' v-if="orderInfo.payPostage > 0">
  239. <view>运费:</view>
  240. <view class='conter'>¥{{orderInfo.payPostage || 0}}</view>
  241. </view>
  242. <view class='item acea-row row-between' v-if='orderInfo.svipDiscountPrice > 0'>
  243. <view>会员优惠:</view>
  244. <view class='conter'>-¥{{orderInfo.svipDiscountPrice || 0}}</view>
  245. </view>
  246. <view class='item acea-row row-between' v-if='orderInfo.merCouponPrice > 0'>
  247. <view>店铺优惠:</view>
  248. <view class='conter'>-¥{{orderInfo.merCouponPrice || 0}}</view>
  249. </view>
  250. <view class='item acea-row row-between' v-if='orderInfo.platCouponPrice > 0'>
  251. <view>平台优惠:</view>
  252. <view class='conter'>-¥{{orderInfo.platCouponPrice || 0}}</view>
  253. </view>
  254. <view class='item acea-row row-between' v-if="orderInfo.integralPrice > 0">
  255. <view>积分抵扣:</view>
  256. <view class='conter'>-¥{{orderInfo.integralPrice || 0}}</view>
  257. </view>
  258. <view v-show="secondType !== ProductTypeEnum.Integral" class='actualPay acea-row row-right'>
  259. 实付款<text class='money'>¥{{orderInfo.payPrice || 0}}</text>
  260. </view>
  261. </view>
  262. <view style='height:120rpx;'></view>
  263. <!-- 底部按钮 -->
  264. <view v-show="isShowBtn" class='footer acea-row row-right row-middle'>
  265. <view class="qs-btn" v-show="orderInfo.status==0" @click.stop="cancelOrder">取消订单</view>
  266. <view class='bnt bg_color' v-show="orderInfo.combinationId > 0" @tap='goJoinPink'>查看拼团</view>
  267. <view class='bnt cancel'
  268. v-show="Number(orderInfo.status) >1 &&Number(orderInfo.status) < 9 && orderInfo.status!=3&&shippingType===1"
  269. @tap='godeliverRecord'>发货记录
  270. </view>
  271. <view class='bnt bg_color' v-show="orderInfo.status==4 && orderInfo.refundStatus!==3 || orderType == 'secondHand' && shippingType == 2 && orderInfo.status == 1" @tap='confirmOrder'>确认收货</view>
  272. <view class='bnt cancel' v-show="orderInfo.status==6 || orderInfo.status==9" @tap='delOrder'>删除订单
  273. </view>
  274. <view class='bnt bg_color' v-show="orderInfo.status==0" @tap='goPay(orderInfo)'>立即付款</view>
  275. <view class='bnt bg_color' v-show="(orderInfo.status>0) && isBuyAgain" @tap='goOrderConfirm'>
  276. 再次购买</view>
  277. </view>
  278. </view>
  279. </view>
  280. </view>
  281. </template>
  282. <script>
  283. // +----------------------------------------------------------------------
  284. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  285. // +----------------------------------------------------------------------
  286. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  287. // +----------------------------------------------------------------------
  288. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  289. // +----------------------------------------------------------------------
  290. // | Author: CRMEB Team <admin@crmeb.com>
  291. // +----------------------------------------------------------------------
  292. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  293. import {
  294. getOrderDetail,
  295. orderTake,
  296. orderDel,
  297. orderCancel,
  298. strToBase64Api,
  299. orderStatusImgApi,
  300. } from '@/api/order.js';
  301. import {
  302. getSecondHandDetail,
  303. secondHandTake,
  304. secondHandDel,
  305. secondHandCancel,
  306. secondHandStatusImgApi
  307. } from '@/api/secondHand.js';
  308. import {
  309. cartBatchAddApi
  310. } from '@/api/product.js';
  311. import orderGoods from "../components/orderGoods";
  312. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  313. import {
  314. toLogin
  315. } from '@/libs/login.js';
  316. import {
  317. mapGetters
  318. } from "vuex";
  319. // #ifdef MP
  320. import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
  321. // #endif
  322. import {
  323. setThemeColor
  324. } from '@/utils/setTheme.js'
  325. import {
  326. Debounce
  327. } from '@/utils/validate.js'
  328. import {
  329. ProductTypeEnum,
  330. ProductMarketingTypeEnum
  331. } from "../../../enums/productEnums";
  332. import systemFromInfo from '@/components/systemFromInfo';
  333. import PointsPrice from '@/components/PointsPrice.vue';
  334. /**
  335. * 积分商品推荐样式
  336. */
  337. const hotPointsStyle = {
  338. iconStyle: {
  339. width: '28rpx',
  340. height: '28rpx'
  341. },
  342. priceStyle: {
  343. fontSize: '28rpx',
  344. },
  345. unitStyle: {
  346. fontSize: '26rpx',
  347. },
  348. }
  349. const app = getApp();
  350. export default {
  351. components: {
  352. orderGoods,
  353. easyLoadimage,
  354. systemFromInfo,
  355. PointsPrice
  356. },
  357. data() {
  358. return {
  359. codeImg: '',
  360. qrcodeSize: 100,
  361. orderNo: '',
  362. orderType: '',
  363. cartInfo: [], //购物车产品
  364. orderInfo: {
  365. systemStore: {},
  366. pstatus: {}
  367. }, //订单详情
  368. status: {}, //订单底部按钮状态
  369. totalPrice: '0',
  370. id: 0, //订单id
  371. uniId: '',
  372. utils: this.$util,
  373. againStatus: 0,
  374. type: 0, //订单类型 0-普通订单,1-视频号订单,2-秒杀订单
  375. secondType: 0, //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  376. isShow: true,
  377. theme: app.globalData.theme,
  378. bgColor: '#e93323',
  379. userAddress: [],
  380. shippingType: 1,
  381. statusPic: '',
  382. isUserAddress: false, //是否只显示一次收货地址
  383. ProductMarketingTypeEnum: ProductMarketingTypeEnum,
  384. ProductTypeEnum: ProductTypeEnum,
  385. orderExtend: [], //系统表单数据
  386. isSplitDelivery: false, //是否拆单发货
  387. deliveryType: '', // 配送方式
  388. hotPointsStyle: hotPointsStyle,
  389. urlDomain: this.$Cache.get("imgHost"),
  390. statusPng:['beforPay','beforSend','beforSend','beforSend','beforResaved','orderDone','orderDone','','','orderCancel']
  391. };
  392. },
  393. computed: {
  394. //是否可以再次购买
  395. isBuyAgain() {
  396. return this.type === ProductMarketingTypeEnum.Normal && this.secondType === ProductTypeEnum.Normal && !this
  397. .orderExtend.length
  398. },
  399. ...mapGetters(['isLogin', 'chatUrl', 'userInfo']),
  400. //积分价格
  401. pointsPrice() {
  402. return {
  403. redeemIntegral: this.orderInfo.redeemIntegral,
  404. price: this.orderInfo.proTotalPrice
  405. }
  406. },
  407. //是否展示底部操作按钮
  408. //<!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
  409. // <!-- 已退款的订单详情中,不支持任何操作。 orderInfo.refundStatus !== 3,拼团已退款订单还可进行【查看拼团】操作-->
  410. isShowBtn() {
  411. return (this.orderInfo.status!=3 && this.orderInfo.status!=1) || this.orderInfo.refundStatus !== 3 || (this.orderInfo.refundStatus == 3 && this.type !== this.ProductMarketingTypeEnum.Groupbuying)
  412. },
  413. },
  414. onLoad: function(options) {
  415. if (!options.orderNo) return this.$util.Tips({
  416. title: '缺少参数'
  417. }, {
  418. tab: 3,
  419. url: 1
  420. });
  421. if (options.orderType) this.orderType = options.orderType;
  422. this.$set(this, 'orderNo', options.orderNo);
  423. this.bgColor = setThemeColor();
  424. uni.setNavigationBarColor({
  425. frontColor: '#ffffff',
  426. backgroundColor: this.bgColor,
  427. });
  428. },
  429. onShow() {
  430. if (this.isLogin) {
  431. this.getOrderInfo();
  432. } else {
  433. toLogin();
  434. }
  435. },
  436. onHide: function() {
  437. this.isClose = true;
  438. },
  439. // 滚动监听
  440. onPageScroll(e) {
  441. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  442. uni.$emit('scroll');
  443. },
  444. onReady: function() {
  445. // #ifdef H5
  446. this.$nextTick(function() {
  447. const clipboard = new ClipboardJS(".copy-data");
  448. clipboard.on("success", () => {
  449. this.$util.Tips({
  450. title: '复制成功'
  451. });
  452. });
  453. });
  454. // #endif
  455. },
  456. methods: {
  457. //发货记录
  458. godeliverRecord() {
  459. uni.showLoading({
  460. title: '加载中...'
  461. });
  462. let order_logistics = `/pages/goods/order_logistics/index?orderNo=${this.orderInfo.orderNo}`
  463. let send_record = `/pages/goods/send_record/index?orderNo=${this.orderNo}&index=0`
  464. if (this.isSplitDelivery) {
  465. uni.navigateTo({
  466. url: order_logistics
  467. });
  468. } else {
  469. let url = this.deliveryType === 'express' ? order_logistics : send_record
  470. uni.navigateTo({
  471. url: url
  472. })
  473. }
  474. },
  475. /**
  476. * 打开支付组件
  477. *
  478. */
  479. goPay: Debounce(function(item) {
  480. uni.showLoading({
  481. title: '加载中...'
  482. });
  483. uni.navigateTo({
  484. url: `/pages/goods/order_payment/index?orderNo=${item.orderNo}&payPrice=${item.payPrice}`
  485. });
  486. }),
  487. /**
  488. * 拨打电话
  489. */
  490. makePhone: function(e) {
  491. uni.makePhoneCall({
  492. phoneNumber: e
  493. })
  494. },
  495. /**
  496. * 打开地图
  497. *
  498. */
  499. showMaoLocation: function(e) {
  500. if (!e.merLatitude || !e.merLongitude) return this.$util.Tips({
  501. title: '缺少经纬度信息无法查看地图!'
  502. });
  503. //#ifdef H5
  504. if (this.$wechat.isWeixin() === true) {
  505. this.$wechat.seeLocation({
  506. latitude: parseFloat(e.merLatitude),
  507. longitude: parseFloat(e.merLongitude),
  508. name: e.merName,
  509. address: e.merAddressDetail,
  510. }).then(res => {
  511. console.log('success');
  512. })
  513. } else {
  514. //#endif
  515. uni.openLocation({
  516. latitude: parseFloat(e.merLatitude),
  517. longitude: parseFloat(e.merLongitude),
  518. scale: 8,
  519. name: e.merName,
  520. address: e.merAddressDetail,
  521. success: function() {
  522. },
  523. });
  524. // #ifdef H5
  525. }
  526. //#endif
  527. },
  528. orderStatusImg() {
  529. let that = this;
  530. let api = that.orderType == 'secondHand' ? secondHandStatusImgApi : orderStatusImgApi;
  531. api().then(res => {
  532. res.data.map(item => {
  533. if (item.title === 'await_pay' && this.orderInfo.status === 0) {
  534. this.statusPic = item.pic
  535. } else if (item.title === 'await_shipped' && this.orderInfo.status === 1) {
  536. this.statusPic = item.pic
  537. } else if (item.title === 'receiving' && this.orderInfo.status === 3) {
  538. this.statusPic = item.pic
  539. } else if (item.title === 'spike' && this.orderInfo.status === 2) {
  540. this.statusPic = item.pic
  541. } else if (item.title === 'complete' && this.orderInfo.status === 4) {
  542. this.statusPic = item.pic
  543. }
  544. })
  545. }).catch(err => {
  546. that.$util.Tips({
  547. title: err
  548. });
  549. });
  550. },
  551. /**
  552. * 获取订单详细信息
  553. *
  554. */
  555. getOrderInfo: function() {
  556. let that = this;
  557. uni.showLoading({
  558. title: "正在加载中"
  559. });
  560. let api = this.orderType == 'secondHand' ? getSecondHandDetail : getOrderDetail;
  561. api(that.orderNo).then(res => {
  562. uni.hideLoading();
  563. let data = res.data;
  564. that.$set(that, 'orderInfo', data);
  565. that.$set(that, 'id', data.id);
  566. that.$set(that, 'type', data.type);
  567. that.$set(that, 'secondType', data.secondType);
  568. that.$set(that, 'orderExtend', data.orderExtend ? JSON.parse(data.orderExtend) : []);
  569. that.orderStatusImg();
  570. that.userAddress = data.merchantOrderList && data.merchantOrderList.filter(item => {
  571. return item.shippingType === 1
  572. })
  573. that.isUserAddress = that.userAddress.length > 0 ? true : false;
  574. if (data.status !== 0 || data.status !== 9) {
  575. if (data.merchantOrderList[0].shippingType == 2) that.markCode(data.merchantOrderList[
  576. 0].verifyCode);
  577. }
  578. that.$set(that, 'shippingType', data.merchantOrderList[0].shippingType);
  579. that.$set(that, 'cartInfo', data.merchantOrderList[0].orderInfoList);
  580. that.$set(that, 'isSplitDelivery', data.merchantOrderList[0].isSplitDelivery);
  581. that.$set(that, 'deliveryType', data.merchantOrderList[0].deliveryType);
  582. if (that.orderInfo.refundStatus > 0) {
  583. uni.setNavigationBarColor({
  584. frontColor: '#fff',
  585. backgroundColor: '#666666'
  586. })
  587. }
  588. // if (data.combinationId > 0 || data.bargainId > 0 || data.seckillId > 0) {
  589. // this.againStatus = 1;
  590. // }
  591. }).catch(err => {
  592. that.$util.Tips({
  593. title: err
  594. }, {
  595. tab: 4,
  596. url: '/pages/user/index'
  597. });
  598. });
  599. },
  600. /**
  601. *
  602. * 生成二维码
  603. */
  604. markCode(text) {
  605. strToBase64Api({
  606. height: '145',
  607. text: text,
  608. width: '145'
  609. }).then(res => {
  610. this.codeImg = res.data.code
  611. });
  612. },
  613. /**
  614. *
  615. * 剪切订单号
  616. */
  617. // #ifndef H5
  618. handleCopy: function(num) {
  619. uni.setClipboardData({
  620. data: num
  621. });
  622. },
  623. // #endif
  624. /**
  625. * 打电话
  626. */
  627. goTel: function() {
  628. uni.makePhoneCall({
  629. phoneNumber: this.orderInfo.deliveryId
  630. })
  631. },
  632. /**
  633. * 去拼团详情
  634. *
  635. */
  636. goJoinPink: function() {
  637. uni.navigateTo({
  638. url: '/pages/activity/goods_combination_status/index?id=' + this.orderInfo.pinkId,
  639. });
  640. },
  641. /**
  642. * 再此购买
  643. *
  644. */
  645. goOrderConfirm: Debounce(function() {
  646. uni.showLoading({
  647. title: '加载中...'
  648. });
  649. let cartListRequest = []
  650. let that = this;
  651. this.cartInfo.map(item => {
  652. cartListRequest.push({
  653. productId: parseFloat(item.productId),
  654. productAttrUnique: item.attrValueId,
  655. cartNum: parseFloat(item.payNum)
  656. })
  657. })
  658. cartBatchAddApi(cartListRequest).then(function(res) {
  659. uni.navigateTo({
  660. url: '/pages/order_addcart/order_addcart'
  661. })
  662. }).catch(res => {
  663. return this.$util.Tips({
  664. title: res
  665. });
  666. });
  667. }),
  668. //确认收货
  669. confirmOrder: Debounce(function() {
  670. let that = this;
  671. let applyRefundNum = 0;
  672. that.orderInfo.merchantOrderList.map((item) => {
  673. item.orderInfoList.map((i) => {
  674. applyRefundNum = Number(i.applyRefundNum) + Number(i.refundNum);
  675. });
  676. });
  677. // 如果有售后中的,提示
  678. if (applyRefundNum >0) return uni.showModal({
  679. title: '提示',
  680. content: '请先撤销售后,再进行收货操作',
  681. confirmText: '我知道了',
  682. success(res) {
  683. if (res.confirm) {
  684. return
  685. }
  686. }
  687. });
  688. uni.showModal({
  689. title: '确认收货',
  690. content: '为保障权益,请收到货确认无误后,再确认收货',
  691. success: function(res) {
  692. if (res.confirm) {
  693. let api = that.orderType == 'secondHand' ? secondHandTake : orderTake;
  694. api(that.orderNo).then(res => {
  695. return that.$util.Tips({
  696. title: '操作成功',
  697. icon: 'success'
  698. }, function() {
  699. that.getOrderInfo();
  700. });
  701. }).catch(err => {
  702. return that.$util.Tips({
  703. title: err
  704. });
  705. })
  706. }
  707. }
  708. })
  709. }),
  710. /**
  711. *
  712. * 删除订单
  713. */
  714. delOrder: Debounce(function() {
  715. uni.showModal({
  716. content: '确定删除该订单',
  717. cancelText: "取消",
  718. confirmText: "确定",
  719. showCancel: true,
  720. confirmColor: '#f55850',
  721. success: (res) => {
  722. if (res.confirm) {
  723. let that = this;
  724. let api = that.orderType == 'secondHand' ? secondHandDel : orderDel;
  725. api(this.orderNo).then(res => {
  726. return that.$util.Tips({
  727. title: '删除成功',
  728. icon: 'success'
  729. }, {
  730. tab: 4,
  731. url: '/pages/user/index'
  732. });
  733. }).catch(err => {
  734. return that.$util.Tips({
  735. title: err
  736. });
  737. });
  738. } else {
  739. }
  740. }
  741. })
  742. }),
  743. cancelOrder: Debounce(function() {
  744. let self = this
  745. uni.showModal({
  746. title: '提示',
  747. content: '确认取消该订单?',
  748. success: function(res) {
  749. if (res.confirm) {
  750. let api = self.orderType == 'secondHand' ? secondHandCancel : orderCancel;
  751. api(self.orderNo)
  752. .then((data) => {
  753. self.$util.Tips({
  754. title: '取消成功'
  755. }, {
  756. tab: 4,
  757. url: '/pages/user/index'
  758. })
  759. }).catch((err) => {
  760. self.$util.Tips({
  761. title: err
  762. })
  763. self.getDetail();
  764. });
  765. } else if (res.cancel) {
  766. console.log('用户点击取消');
  767. }
  768. }
  769. });
  770. })
  771. }
  772. }
  773. </script>
  774. <style scoped lang="scss">
  775. @import '../static/css/order_details.scss';
  776. .orderStatusPng{
  777. width: 128rpx;
  778. height: 128rpx;
  779. }
  780. .picTxt{
  781. justify-content: space-between;
  782. }
  783. </style>