index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  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. /**
  369. * 积分商品推荐样式
  370. */
  371. const hotPointsStyle = {
  372. iconStyle: {
  373. width: '28rpx',
  374. height: '28rpx'
  375. },
  376. priceStyle: {
  377. fontSize: '28rpx',
  378. },
  379. unitStyle: {
  380. fontSize: '26rpx',
  381. },
  382. }
  383. const app = getApp();
  384. export default {
  385. components: {
  386. orderGoods,
  387. easyLoadimage,
  388. systemFromInfo,
  389. PointsPrice
  390. },
  391. created() {
  392. let that = this;
  393. uni.getSystemInfo({
  394. success: function(res) {
  395. that.height = res.windowHeight;
  396. //res.windowHeight:获取整个窗口高度为px,*2为rpx;98为头部占据的高度;
  397. // #ifndef APP-PLUS || H5 || MP-ALIPAY
  398. that.navbarRight =
  399. res.windowWidth - uni.getMenuButtonBoundingClientRect().left;
  400. // #endif
  401. },
  402. });
  403. },
  404. data() {
  405. return {
  406. deliveryMark: '',
  407. companyName: '',
  408. companyOdd: '',
  409. codeImg: '',
  410. qrcodeSize: 100,
  411. orderNo: '',
  412. orderType: '',
  413. cartInfo: [], //购物车产品
  414. orderInfo: {
  415. systemStore: {},
  416. pstatus: {}
  417. }, //订单详情
  418. status: {}, //订单底部按钮状态
  419. totalPrice: '0',
  420. id: 0, //订单id
  421. uniId: '',
  422. height: '',
  423. utils: this.$util,
  424. againStatus: 0,
  425. type: 0, //订单类型 0-普通订单,1-视频号订单,2-秒杀订单
  426. secondType: 0, //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  427. isShow: true,
  428. theme: app.globalData.theme,
  429. bgColor: '#e93323',
  430. userAddress: [],
  431. shippingType: 1,
  432. statusPic: '',
  433. isUserAddress: false, //是否只显示一次收货地址
  434. ProductMarketingTypeEnum: ProductMarketingTypeEnum,
  435. ProductTypeEnum: ProductTypeEnum,
  436. orderExtend: [], //系统表单数据
  437. isSplitDelivery: false, //是否拆单发货
  438. deliveryType: '', // 配送方式
  439. hotPointsStyle: hotPointsStyle,
  440. urlDomain: this.$Cache.get("imgHost"),
  441. statusPng: ['beforPay', 'beforSend', 'beforSend', 'beforSend', 'beforResaved', 'orderDone', 'orderDone', '', '',
  442. 'orderCancel'
  443. ]
  444. };
  445. },
  446. computed: {
  447. //是否可以再次购买
  448. isBuyAgain() {
  449. return this.type === ProductMarketingTypeEnum.Normal && this.secondType === ProductTypeEnum.Normal && !this
  450. .orderExtend.length
  451. },
  452. ...mapGetters(['isLogin', 'chatUrl', "uid", 'userInfo']),
  453. //积分价格
  454. pointsPrice() {
  455. return {
  456. redeemIntegral: this.orderInfo.redeemIntegral,
  457. price: this.orderInfo.proTotalPrice
  458. }
  459. },
  460. //是否展示底部操作按钮
  461. //<!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
  462. // <!-- 已退款的订单详情中,不支持任何操作。 orderInfo.refundStatus !== 3,拼团已退款订单还可进行【查看拼团】操作-->
  463. isShowBtn() {
  464. return (this.orderInfo.status != 3 && this.orderInfo.status != 1) || this.orderInfo.refundStatus !== 3 || (this.orderInfo
  465. .refundStatus == 3 && this.type !== this.ProductMarketingTypeEnum.Groupbuying)
  466. },
  467. },
  468. onLoad: function(options) {
  469. if (!options.orderNo) return this.$util.Tips({
  470. title: '缺少参数'
  471. }, {
  472. tab: 3,
  473. url: 1
  474. });
  475. if (options.orderType) this.orderType = options.orderType;
  476. this.$set(this, 'orderNo', options.orderNo);
  477. this.bgColor = setThemeColor();
  478. uni.setNavigationBarColor({
  479. frontColor: '#ffffff',
  480. backgroundColor: this.bgColor,
  481. });
  482. },
  483. onShow() {
  484. if (this.isLogin) {
  485. this.getOrderInfo();
  486. } else {
  487. toLogin();
  488. }
  489. },
  490. onHide: function() {
  491. this.isClose = true;
  492. },
  493. // 滚动监听
  494. onPageScroll(e) {
  495. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  496. uni.$emit('scroll');
  497. },
  498. onReady: function() {
  499. // #ifdef H5
  500. this.$nextTick(function() {
  501. const clipboard = new ClipboardJS(".copy-data");
  502. clipboard.on("success", () => {
  503. this.$util.Tips({
  504. title: '复制成功'
  505. });
  506. });
  507. });
  508. // #endif
  509. },
  510. methods: {
  511. //发货记录
  512. godeliverRecord() {
  513. uni.showLoading({
  514. title: '加载中...'
  515. });
  516. let order_logistics = `/pages/goods/order_logistics/index?orderNo=${this.orderInfo.orderNo}`
  517. let send_record = `/pages/goods/send_record/index?orderNo=${this.orderNo}&index=0`
  518. if (this.isSplitDelivery) {
  519. uni.navigateTo({
  520. url: order_logistics
  521. });
  522. } else {
  523. let url = this.deliveryType === 'express' ? order_logistics : send_record
  524. uni.navigateTo({
  525. url: url
  526. })
  527. }
  528. },
  529. /**
  530. * 打开支付组件
  531. *
  532. */
  533. goPay: Debounce(function(item) {
  534. uni.showLoading({
  535. title: '加载中...'
  536. });
  537. uni.navigateTo({
  538. url: `/pages/goods/order_payment/index?orderNo=${item.orderNo}&payPrice=${item.payPrice}`
  539. });
  540. }),
  541. /**
  542. * 拨打电话
  543. */
  544. makePhone: function(e) {
  545. uni.makePhoneCall({
  546. phoneNumber: e
  547. })
  548. },
  549. /**
  550. * 打开地图
  551. *
  552. */
  553. showMaoLocation: function(e) {
  554. if (!e.merLatitude || !e.merLongitude) return this.$util.Tips({
  555. title: '缺少经纬度信息无法查看地图!'
  556. });
  557. //#ifdef H5
  558. if (this.$wechat.isWeixin() === true) {
  559. this.$wechat.seeLocation({
  560. latitude: parseFloat(e.merLatitude),
  561. longitude: parseFloat(e.merLongitude),
  562. name: e.merName,
  563. address: e.merAddressDetail,
  564. }).then(res => {
  565. console.log('success');
  566. })
  567. } else {
  568. //#endif
  569. uni.openLocation({
  570. latitude: parseFloat(e.merLatitude),
  571. longitude: parseFloat(e.merLongitude),
  572. scale: 8,
  573. name: e.merName,
  574. address: e.merAddressDetail,
  575. success: function() {
  576. },
  577. });
  578. // #ifdef H5
  579. }
  580. //#endif
  581. },
  582. orderStatusImg() {
  583. let that = this;
  584. let api = that.orderType == 'secondHand' ? secondHandStatusImgApi : orderStatusImgApi;
  585. api().then(res => {
  586. res.data.map(item => {
  587. if (item.title === 'await_pay' && this.orderInfo.status === 0) {
  588. this.statusPic = item.pic
  589. } else if (item.title === 'await_shipped' && this.orderInfo.status === 1) {
  590. this.statusPic = item.pic
  591. } else if (item.title === 'receiving' && this.orderInfo.status === 3) {
  592. this.statusPic = item.pic
  593. } else if (item.title === 'spike' && this.orderInfo.status === 2) {
  594. this.statusPic = item.pic
  595. } else if (item.title === 'complete' && this.orderInfo.status === 4) {
  596. this.statusPic = item.pic
  597. }
  598. })
  599. }).catch(err => {
  600. that.$util.Tips({
  601. title: err
  602. });
  603. });
  604. },
  605. /**
  606. * 获取订单详细信息
  607. *
  608. */
  609. getOrderInfo: function() {
  610. let that = this;
  611. uni.showLoading({
  612. title: "正在加载中"
  613. });
  614. let api = this.orderType == 'secondHand' ? getSecondHandDetail : getOrderDetail;
  615. api(that.orderNo).then(res => {
  616. uni.hideLoading();
  617. let data = res.data;
  618. that.$set(that, 'orderInfo', data);
  619. that.$set(that, 'id', data.id);
  620. that.$set(that, 'type', data.type);
  621. that.$set(that, 'secondType', data.secondType);
  622. that.$set(that, 'orderExtend', data.orderExtend ? JSON.parse(data.orderExtend) : []);
  623. that.orderStatusImg();
  624. that.userAddress = data.merchantOrderList && data.merchantOrderList.filter(item => {
  625. return item.shippingType === 1
  626. })
  627. that.isUserAddress = that.userAddress.length > 0 ? true : false;
  628. if (that.orderType == 'secondHand' && data.merchantOrderList[0].shippingType == 2) {
  629. if (data.sellerId == that.uid) {
  630. that.isUserAddress = true;
  631. }
  632. that.userAddress = data.merchantOrderList;
  633. }
  634. if (data.status !== 0 || data.status !== 9) {
  635. if (data.merchantOrderList[0].shippingType == 2) that.markCode(data.merchantOrderList[
  636. 0].verifyCode);
  637. }
  638. that.$set(that, 'shippingType', data.merchantOrderList[0].shippingType);
  639. that.$set(that, 'cartInfo', data.merchantOrderList[0].orderInfoList);
  640. that.$set(that, 'isSplitDelivery', data.merchantOrderList[0].isSplitDelivery);
  641. that.$set(that, 'deliveryType', data.merchantOrderList[0].deliveryType);
  642. if (that.orderInfo.refundStatus > 0) {
  643. uni.setNavigationBarColor({
  644. frontColor: '#fff',
  645. backgroundColor: '#666666'
  646. })
  647. }
  648. // if (data.combinationId > 0 || data.bargainId > 0 || data.seckillId > 0) {
  649. // this.againStatus = 1;
  650. // }
  651. }).catch(err => {
  652. that.$util.Tips({
  653. title: err
  654. }, {
  655. tab: 4,
  656. url: '/pages/user/index'
  657. });
  658. });
  659. },
  660. /**
  661. *
  662. * 生成二维码
  663. */
  664. markCode(text) {
  665. strToBase64Api({
  666. height: '145',
  667. text: text,
  668. width: '145'
  669. }).then(res => {
  670. this.codeImg = res.data.code
  671. });
  672. },
  673. /**
  674. *
  675. * 剪切订单号
  676. */
  677. // #ifndef H5
  678. handleCopy: function(num) {
  679. uni.setClipboardData({
  680. data: num
  681. });
  682. },
  683. // #endif
  684. /**
  685. * 打电话
  686. */
  687. goTel: function() {
  688. uni.makePhoneCall({
  689. phoneNumber: this.orderInfo.deliveryId
  690. })
  691. },
  692. /**
  693. * 去拼团详情
  694. *
  695. */
  696. goJoinPink: function() {
  697. uni.navigateTo({
  698. url: '/pages/activity/goods_combination_status/index?id=' + this.orderInfo.pinkId,
  699. });
  700. },
  701. /**
  702. * 再此购买
  703. *
  704. */
  705. goOrderConfirm: Debounce(function() {
  706. uni.showLoading({
  707. title: '加载中...'
  708. });
  709. let cartListRequest = []
  710. let that = this;
  711. this.cartInfo.map(item => {
  712. cartListRequest.push({
  713. productId: parseFloat(item.productId),
  714. productAttrUnique: item.attrValueId,
  715. cartNum: parseFloat(item.payNum)
  716. })
  717. })
  718. cartBatchAddApi(cartListRequest).then(function(res) {
  719. uni.navigateTo({
  720. url: '/pages/order_addcart/order_addcart'
  721. })
  722. }).catch(res => {
  723. return this.$util.Tips({
  724. title: res
  725. });
  726. });
  727. }),
  728. //确认收货
  729. confirmOrder: Debounce(function() {
  730. let that = this;
  731. let applyRefundNum = 0;
  732. that.orderInfo.merchantOrderList.map((item) => {
  733. item.orderInfoList.map((i) => {
  734. applyRefundNum = Number(i.applyRefundNum) + Number(i.refundNum);
  735. });
  736. });
  737. // 如果有售后中的,提示
  738. if (applyRefundNum > 0) return uni.showModal({
  739. title: '提示',
  740. content: '请先撤销售后,再进行收货操作',
  741. confirmText: '我知道了',
  742. success(res) {
  743. if (res.confirm) {
  744. return
  745. }
  746. }
  747. });
  748. uni.showModal({
  749. title: '确认收货',
  750. content: '为保障权益,请收到货确认无误后,再确认收货',
  751. success: function(res) {
  752. if (res.confirm) {
  753. let api = that.orderType == 'secondHand' ? secondHandTake : orderTake;
  754. api(that.orderNo).then(res => {
  755. return that.$util.Tips({
  756. title: '操作成功',
  757. icon: 'success'
  758. }, function() {
  759. that.getOrderInfo();
  760. });
  761. }).catch(err => {
  762. return that.$util.Tips({
  763. title: err
  764. });
  765. })
  766. }
  767. }
  768. })
  769. }),
  770. // 确认退款
  771. refundFHOrder() {
  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. confirmFHOrder: Debounce(function() {
  802. let that = this;
  803. this.$refs.deliveryRef.open('top')
  804. }),
  805. onSure() {
  806. let that = this;
  807. this.$refs.deliveryRef.close()
  808. if (!this.companyName) return that.$util.Tips({
  809. itle: '请填写快递公司'
  810. });
  811. if (!this.companyOdd) return that.$util.Tips({
  812. itle: '请填写快递编号'
  813. });
  814. uni.showModal({
  815. title: '确认发货',
  816. content: '为保障权益,请确认快递信息填写无误后,再确认收货',
  817. success: function(res) {
  818. if (res.confirm) {
  819. const data = {
  820. orderNo: that.orderNo,
  821. deliveryType: 'express',
  822. expressCompy: that.companyName,
  823. expressNumber: that.companyOdd,
  824. deliveryMark: that.deliveryMark || ''
  825. }
  826. secondHandSend(data).then(res => {
  827. return that.$util.Tips({
  828. title: '操作成功',
  829. icon: 'success'
  830. }, function() {
  831. that.getOrderInfo();
  832. });
  833. }).catch(err => {
  834. return that.$util.Tips({
  835. title: err
  836. });
  837. })
  838. }
  839. }
  840. })
  841. },
  842. /**
  843. *
  844. * 删除订单
  845. */
  846. delOrder: Debounce(function() {
  847. uni.showModal({
  848. content: '确定删除该订单',
  849. cancelText: "取消",
  850. confirmText: "确定",
  851. showCancel: true,
  852. confirmColor: '#f55850',
  853. success: (res) => {
  854. if (res.confirm) {
  855. let that = this;
  856. let api = that.orderType == 'secondHand' ? secondHandDel : orderDel;
  857. api(this.orderNo).then(res => {
  858. return that.$util.Tips({
  859. title: '删除成功',
  860. icon: 'success'
  861. }, {
  862. tab: 4,
  863. url: '/pages/user/index'
  864. });
  865. }).catch(err => {
  866. return that.$util.Tips({
  867. title: err
  868. });
  869. });
  870. } else {
  871. }
  872. }
  873. })
  874. }),
  875. cancelOrder: Debounce(function() {
  876. let self = this
  877. uni.showModal({
  878. title: '提示',
  879. content: '确认取消该订单?',
  880. success: function(res) {
  881. if (res.confirm) {
  882. let api = self.orderType == 'secondHand' ? secondHandCancel : orderCancel;
  883. api(self.orderNo)
  884. .then((data) => {
  885. self.$util.Tips({
  886. title: '取消成功'
  887. }, {
  888. tab: 4,
  889. url: '/pages/user/index'
  890. })
  891. }).catch((err) => {
  892. self.$util.Tips({
  893. title: err
  894. })
  895. self.getDetail();
  896. });
  897. } else if (res.cancel) {
  898. console.log('用户点击取消');
  899. }
  900. }
  901. });
  902. })
  903. }
  904. }
  905. </script>
  906. <style scoped lang="scss">
  907. @import '../static/css/order_details.scss';
  908. .orderStatusPng {
  909. width: 128rpx;
  910. height: 128rpx;
  911. }
  912. .picTxt {
  913. justify-content: space-between;
  914. }
  915. .search {
  916. height: 60rpx;
  917. padding: 0 32rpx;
  918. border-radius: 36rpx;
  919. background: #F5F5F5;
  920. }
  921. .sub {
  922. background-color: $bg-color-primary;
  923. width: 308rpx;
  924. height: 77rpx;
  925. font-weight: 500;
  926. font-size: 31rpx;
  927. color: #FFFFFF;
  928. margin: 58rpx 0 96rpx 0;
  929. }
  930. </style>