index.vue 33 KB

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