index.vue 33 KB

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