order-detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <view class="order-detail">
  3. <!-- 时间轴组件 -->
  4. <order-timeline :logVoList="orderInfo.logVoList" :trackingVoList="orderInfo.trackingVoList"></order-timeline>
  5. <!-- -->
  6. <return-notice :orderInfo="orderInfo" v-if="orderInfo.restTime" @close="handleReturn"></return-notice>
  7. <!-- 书籍列表组件 -->
  8. <book-list :books="bookList" :totalNum="orderInfo.totalNum"></book-list>
  9. <!-- 收入信息区块 -->
  10. <view class="info-block">
  11. <view class="flex-a flex-j-b">
  12. <text class="common-title font-32">卖书收入:</text>
  13. <text class="common-text" style="color: #ff0000" v-if="orderInfo.finalMoney">¥{{ orderInfo.finalMoney
  14. }}</text>
  15. <text class="common-text" style="color: #ff0000" v-else>待审核</text>
  16. </view>
  17. <view class="desc-bg">
  18. <view class="flex-a flex-j-b">
  19. <text class="common-text-2 font-26">书籍数量:</text>
  20. <text class="common-text font-26">{{ orderInfo.totalNum }}</text>
  21. </view>
  22. <view class="flex-a flex-j-b" v-if="orderInfo.upsellFinalMoney || orderInfo.upsellExpectMoney">
  23. <text class="common-text-2 font-26">限时加价:</text>
  24. <text class="common-text-2 font-26">¥{{ orderInfo.upsellFinalMoney || orderInfo.upsellExpectMoney
  25. }}</text>
  26. </view>
  27. <view class="flex-a flex-j-b">
  28. <view class="common-text-2 font-26">
  29. 预估书款:
  30. <u-icon name="question-circle-fill" color="#333333" size="36" @click="showRules"></u-icon>
  31. </view>
  32. <text class="common-text-2 font-26">¥{{ orderInfo.expectMoney }}</text>
  33. </view>
  34. <view class="flex-a flex-j-b" v-if="orderInfo.verifyPeriodDays === 15 && orderInfo.verifyUpMoney" style="margin-top: 10rpx;">
  35. <text class="common-text-2 font-26">15天安心验货上浮2%:</text>
  36. <text class="common-text-2 font-26">¥{{ orderInfo.verifyUpMoney }}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 订单信息区块 -->
  41. <view class="info-block">
  42. <view class="flex-a flex-j-b">
  43. <text class="common-title font-32">卖书编号:</text>
  44. <view class="common-text-2 font-26 flex-a">
  45. {{ orderInfo.orderId }}
  46. <image src="../static/copy.png" style="width: 42rpx; height: 42rpx; margin-left: 20rpx"
  47. @click="copyOrderNo"></image>
  48. </view>
  49. </view>
  50. <view class="desc-bg">
  51. <view class="flex-a flex-j-b">
  52. <view class="common-text-2 font-26">快递备注:</view>
  53. <text class="common-text font-26">{{ orderInfo.expressDelivery || '-' }}</text>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 地址信息区块 -->
  58. <view class="info-block">
  59. <view class="flex-a flex-j-b">
  60. <text class="common-title font-32" style="width: 220rpx">发货地址:</text>
  61. <view class="flex-d flex-j-e flex-1">
  62. <view class="common-text-2 font-26 mb-12">
  63. <text>{{ orderInfo.sendName }}</text>
  64. <text class="ml-40">{{ orderInfo.sendMobile }}</text>
  65. </view>
  66. <text class="common-text" style="line-height: 42rpx">
  67. {{ orderInfo.sendAddress }}
  68. </text>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 结算时效信息 -->
  73. <view class="info-block" v-if="orderInfo.verifyPeriodDays">
  74. <view class="flex-d">
  75. <text class="common-title font-32">已选择结算时效</text>
  76. <text class="common-text font-26 mt-12">{{ verifyPeriodText }}</text>
  77. </view>
  78. </view>
  79. <!-- 底部操作栏 -->
  80. <view class="bottom-fixed-con detail-bottom flex-d">
  81. <service-info :firstOrder="orderInfo.firstOrder"></service-info>
  82. <view class="flex-a"
  83. style="width: 100%; padding: 0 30rpx;justify-content: flex-end;align-items: center;min-height: 42px;">
  84. <u-button size="small" type="warning" @click="handleOpenOverTime"
  85. v-if="orderInfo.confirmCompensationMoney" style="margin-right: 10px">验货超时补偿</u-button>
  86. <u-button size="small" type="warning" @click="handleOpenSellLoss"
  87. v-if="orderInfo.priceCompensationMoney" style="margin-right: 10px">卖亏必赔</u-button>
  88. <order-actions style="width:fit-content" :order="orderInfo" :status="orderInfo.status"
  89. @action="handleAction" @success="getOrderInfo"></order-actions>
  90. </view>
  91. </view>
  92. <u-action-sheet v-model="showReportSheet" :list="actionList" @close="showReportSheet = false"
  93. @click="handleReportSelect" cancelText="取消" :mask-close-able="false" :safe-area-inset-bottom="true" />
  94. <CommonDialog ref="returnDialog" title="退回不通过书籍" :showFooter="false" @confirm="handleRecycleConfirm"
  95. width="88%">
  96. <view class="flex-a flex-j-b">
  97. <button class="confirm-btn plain" @click="handleApplyBack">我要取回</button>
  98. <button class="confirm-btn plain" @click="handleRecycleWare">仓库循环处理</button>
  99. </view>
  100. <view class="button-bottom" @click="handleRecycle">
  101. <text style="font-size: 32rpx; font-weight: bold">按纸价回收</text>
  102. <text style="margin-top: 2px">补贴 ¥{{ orderInfo.basicRecycleMoney || 0 }} 到余额</text>
  103. </view>
  104. </CommonDialog>
  105. <CommonDialog ref="recycleDialog" title="是否按纸价回收" @confirm="handleRecycleConfirm">补贴 ¥{{
  106. orderInfo.basicRecycleMoney || 0 }} 到余额</CommonDialog>
  107. <CommonDialog ref="recycleWare" title="是否仓库循环处理" @confirm="handleRecycleWareConfirm">感谢您对环保事业的支持,仓库将循环处理
  108. </CommonDialog>
  109. <CommonDialog ref="overTimeDialog" title="验货超时补偿" @confirm="handleOverTimeConfirm" :showFooter="false">
  110. <view class="flex-a flex-j-b" style="padding: 40rpx 0">
  111. <u-button class="confirm-btn" type="success" @click="handleOverTimeConfirm">补贴 ¥{{
  112. orderInfo.confirmCompensationMoney || 0 }} 到余额</u-button>
  113. <u-button class="confirm-btn" type="warning" @click="handleCloseOverTime">原谅你了</u-button>
  114. </view>
  115. </CommonDialog>
  116. <CommonDialog ref="sellLossDialog" title="卖亏必赔" @confirm="handleSellLossConfirm" :showFooter="false">
  117. <view class="flex-a flex-j-b" style="padding: 40rpx 0">
  118. <u-button class="confirm-btn" type="success" @click="handleSellLossConfirm">补贴 ¥{{
  119. orderInfo.priceCompensationMoney || 0 }} 到余额</u-button>
  120. <u-button class="confirm-btn" type="warning" @click="handleCloseSellLoss">原谅你了</u-button>
  121. </view>
  122. </CommonDialog>
  123. <common-dialog ref="reviewDialog" title="温馨提示" @confirm="onApplyReturn">
  124. <text>该订单正在排队复审,申请退回复审将退出!</text>
  125. </common-dialog>
  126. </view>
  127. </template>
  128. <script>
  129. import OrderTimeline from '../components/order-timeline.vue';
  130. import BookList from '../components/book-list.vue';
  131. import ReturnNotice from '../components/return-notice.vue';
  132. import ServiceInfo from '@/pages/home/components/ServiceInfo.vue';
  133. import btnAction from '../mixin/btnAction';
  134. import OrderActions from '../components/order-actions.vue';
  135. import CommonDialog from '@/components/common-dialog.vue';
  136. export default {
  137. mixins: [btnAction],
  138. components: {
  139. OrderTimeline,
  140. BookList,
  141. ReturnNotice,
  142. ServiceInfo,
  143. OrderActions,
  144. CommonDialog
  145. },
  146. data() {
  147. return {
  148. bookList: [],
  149. // 订单信息
  150. orderInfo: {},
  151. orderId: ''
  152. };
  153. },
  154. onLoad(options) {
  155. if (options.orderId) {
  156. this.orderId = options.orderId;
  157. }
  158. },
  159. computed: {
  160. verifyPeriodText() {
  161. if (this.orderInfo.verifyPeriodDays === 7) return '7天普通验货';
  162. if (this.orderInfo.verifyPeriodDays === 15) return '15天安心验货';
  163. return '';
  164. }
  165. },
  166. onShow() {
  167. if (this.orderId) {
  168. this.getOrderInfo(this.orderId);
  169. }
  170. },
  171. methods: {
  172. copyOrderNo() {
  173. uni.setClipboardData({
  174. data: this.orderInfo.orderId.toString(),
  175. success: () => {
  176. uni.$u.toast('复制成功');
  177. },
  178. fail: (error) => {
  179. console.log(error, 'error');
  180. uni.$u.toast('复制失败');
  181. }
  182. });
  183. },
  184. successFeedback() {
  185. this.getOrderInfo();
  186. },
  187. showRules() {
  188. uni.navigateTo({
  189. url: '/pages-mine/pages/rules-for-sellbooks'
  190. });
  191. },
  192. //获取订单信息
  193. getOrderInfo() {
  194. uni.$u.http.get('/token/order/getOrderDetail?orderId=' + this.orderId).then((res) => {
  195. if (res.code === 200) {
  196. this.orderInfo = res.data;
  197. this.bookList = res.data.detailVoList;
  198. }
  199. });
  200. },
  201. handleReturn() {
  202. if (this.orderInfo.restStop === 1) {
  203. this.$refs.reviewDialog?.openPopup();
  204. } else {
  205. this.$refs.returnDialog?.openPopup();
  206. }
  207. },
  208. onApplyReturn() {
  209. this.$refs.returnDialog?.openPopup();
  210. },
  211. //仓库循环处理
  212. handleRecycleWare() {
  213. this.closeDialog();
  214. this.$refs.recycleWare?.openPopup();
  215. },
  216. //仓库循环处理确认
  217. handleRecycleWareConfirm() {
  218. console.log('仓库循环处理确认');
  219. uni.$u.http
  220. .post('/token/order/notNeed', {
  221. orderId: this.orderInfo.orderId
  222. })
  223. .then((res) => {
  224. if (res.code === 200) {
  225. this.$refs.recycleDialog?.closePopup();
  226. uni.$u.toast(`已补贴 ${this.orderInfo.basicRecycleMoney || 0} 到余额`);
  227. this.getOrderInfo(this.orderInfo.orderId);
  228. }
  229. });
  230. },
  231. //纸价回收
  232. handleRecycle() {
  233. this.closeDialog();
  234. this.$refs.recycleDialog?.openPopup();
  235. },
  236. //纸价回收确认
  237. handleRecycleConfirm() {
  238. uni.$u.http
  239. .post('/token/order/basicRecycle', {
  240. orderId: this.orderInfo.orderId
  241. })
  242. .then((res) => {
  243. if (res.code === 200) {
  244. this.$refs.recycleDialog?.closePopup();
  245. uni.$u.toast('纸价回收成功');
  246. this.getOrderInfo(this.orderInfo.orderId);
  247. }
  248. });
  249. },
  250. closeDialog() {
  251. this.$refs.returnDialog?.closePopup();
  252. },
  253. //我要取回
  254. handleApplyBack() {
  255. console.log(this.orderInfo, 'xxxxx');
  256. uni.navigateTo({
  257. url: `/pages-mine/pages/apply?orderId=${this.orderInfo.orderId}`
  258. });
  259. this.closeDialog();
  260. },
  261. //验货超时补偿
  262. handleOpenOverTime() {
  263. this.$refs.overTimeDialog?.openPopup();
  264. },
  265. //卖亏必赔
  266. handleOpenSellLoss() {
  267. this.$refs.sellLossDialog?.openPopup();
  268. },
  269. //验货超时补偿确认
  270. handleOverTimeConfirm() {
  271. uni.$u.http
  272. .post('/token/order/confirmCompensation/submit', {
  273. orderId: this.orderInfo.orderId
  274. })
  275. .then((res) => {
  276. if (res.code === 200) {
  277. this.$refs.overTimeDialog?.closePopup();
  278. uni.$u.toast('验货超时补偿申请成功');
  279. this.getOrderInfo(this.orderInfo.orderId);
  280. }
  281. });
  282. },
  283. //验货超时补偿取消
  284. handleCloseOverTime() {
  285. uni.$u.http
  286. .post('/token/order/confirmCompensation/abandon', {
  287. orderId: this.orderInfo.orderId
  288. })
  289. .then((res) => {
  290. if (res.code === 200) {
  291. this.$refs.overTimeDialog?.closePopup();
  292. uni.$u.toast('操作成功');
  293. this.getOrderInfo(this.orderInfo.orderId);
  294. }
  295. });
  296. },
  297. //卖亏必赔确认
  298. handleSellLossConfirm() {
  299. uni.$u.http
  300. .post('/token/order/priceCompensation/submit', {
  301. orderId: this.orderInfo.orderId
  302. })
  303. .then((res) => {
  304. if (res.code === 200) {
  305. this.$refs.sellLossDialog?.closePopup();
  306. uni.$u.toast('卖亏必赔申请成功');
  307. this.getOrderInfo(this.orderInfo.orderId);
  308. }
  309. });
  310. },
  311. //卖亏必赔取消
  312. handleCloseSellLoss() {
  313. uni.$u.http
  314. .post('/token/order/priceCompensation/abandon', {
  315. orderId: this.orderInfo.orderId
  316. })
  317. .then((res) => {
  318. if (res.code === 200) {
  319. this.$refs.sellLossDialog?.closePopup();
  320. uni.$u.toast('操作成功');
  321. this.getOrderInfo(this.orderInfo.orderId);
  322. }
  323. });
  324. }
  325. }
  326. };
  327. </script>
  328. <style lang="scss" scoped>
  329. .order-detail {
  330. min-height: 100vh;
  331. background: #f8f8f8;
  332. padding-bottom: 230rpx;
  333. .desc-bg {
  334. background: #fafafa;
  335. padding: 20rpx 30rpx;
  336. border-radius: 10rpx;
  337. margin-top: 20rpx;
  338. }
  339. .mt-12 {
  340. margin-top: 12rpx;
  341. }
  342. .info-block {
  343. background: #ffffff;
  344. padding: 30rpx;
  345. margin: 30rpx;
  346. border-radius: 10rpx;
  347. }
  348. .detail-bottom {
  349. flex-direction: column;
  350. padding-left: 0;
  351. padding-right: 0;
  352. padding-top: 0;
  353. }
  354. }
  355. .button-bottom {
  356. display: flex;
  357. flex-direction: column;
  358. justify-content: center;
  359. align-items: center;
  360. margin: 30rpx 0;
  361. background-color: #38c148;
  362. color: #ffffff;
  363. font-size: 24rpx;
  364. line-height: 32rpx;
  365. padding: 16rpx 0;
  366. border-radius: 10rpx;
  367. }
  368. :deep(.btn-bottom) {
  369. height: 60rpx !important;
  370. line-height: 60rpx !important;
  371. }
  372. </style>