order-detail.vue 11 KB

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