index.vue 31 KB

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