index.vue 33 KB

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