order-detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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. this.getOrderInfo(options.orderId);
  147. }
  148. },
  149. methods: {
  150. copyOrderNo() {
  151. uni.setClipboardData({
  152. data: this.orderInfo.orderId.toString(),
  153. success: () => {
  154. uni.$u.toast('复制成功');
  155. },
  156. fail: (error) => {
  157. console.log(error, 'error');
  158. uni.$u.toast('复制失败');
  159. }
  160. });
  161. },
  162. successFeedback() {
  163. this.getOrderInfo();
  164. },
  165. showRules() {
  166. uni.navigateTo({
  167. url: '/pages-mine/pages/rules-for-sellbooks'
  168. });
  169. },
  170. //获取订单信息
  171. getOrderInfo() {
  172. uni.$u.http.get('/token/order/getOrderDetail?orderId=' + this.orderId).then((res) => {
  173. if (res.code === 200) {
  174. this.orderInfo = res.data;
  175. this.bookList = res.data.detailVoList;
  176. }
  177. });
  178. },
  179. handleReturn() {
  180. if (this.orderInfo.restStop === 1) {
  181. this.$refs.reviewDialog?.openPopup();
  182. } else {
  183. this.$refs.returnDialog?.openPopup();
  184. }
  185. },
  186. onApplyReturn() {
  187. this.$refs.returnDialog?.openPopup();
  188. },
  189. //仓库循环处理
  190. handleRecycleWare() {
  191. this.closeDialog();
  192. this.$refs.recycleWare?.openPopup();
  193. },
  194. //仓库循环处理确认
  195. handleRecycleWareConfirm() {
  196. console.log('仓库循环处理确认');
  197. uni.$u.http
  198. .post('/token/order/notNeed', {
  199. orderId: this.orderInfo.orderId
  200. })
  201. .then((res) => {
  202. if (res.code === 200) {
  203. this.$refs.recycleDialog?.closePopup();
  204. uni.$u.toast(`已补贴 ${this.orderInfo.basicRecycleMoney || 0} 到余额`);
  205. this.getOrderInfo(this.orderInfo.orderId);
  206. }
  207. });
  208. },
  209. //纸价回收
  210. handleRecycle() {
  211. this.closeDialog();
  212. this.$refs.recycleDialog?.openPopup();
  213. },
  214. //纸价回收确认
  215. handleRecycleConfirm() {
  216. uni.$u.http
  217. .post('/token/order/basicRecycle', {
  218. orderId: this.orderInfo.orderId
  219. })
  220. .then((res) => {
  221. if (res.code === 200) {
  222. this.$refs.recycleDialog?.closePopup();
  223. uni.$u.toast('纸价回收成功');
  224. this.getOrderInfo(this.orderInfo.orderId);
  225. }
  226. });
  227. },
  228. closeDialog() {
  229. this.$refs.returnDialog?.closePopup();
  230. },
  231. //我要取回
  232. handleApplyBack() {
  233. console.log(this.orderInfo, 'xxxxx');
  234. uni.navigateTo({
  235. url: `/pages-mine/pages/apply?orderId=${this.orderInfo.orderId}`
  236. });
  237. this.closeDialog();
  238. },
  239. //验货超时补偿
  240. handleOpenOverTime() {
  241. this.$refs.overTimeDialog?.openPopup();
  242. },
  243. //卖亏必赔
  244. handleOpenSellLoss() {
  245. this.$refs.sellLossDialog?.openPopup();
  246. },
  247. //验货超时补偿确认
  248. handleOverTimeConfirm() {
  249. uni.$u.http
  250. .post('/token/order/confirmCompensation/submit', {
  251. orderId: this.orderInfo.orderId
  252. })
  253. .then((res) => {
  254. if (res.code === 200) {
  255. this.$refs.overTimeDialog?.closePopup();
  256. uni.$u.toast('验货超时补偿申请成功');
  257. this.getOrderInfo(this.orderInfo.orderId);
  258. }
  259. });
  260. },
  261. //验货超时补偿取消
  262. handleCloseOverTime() {
  263. uni.$u.http
  264. .post('/token/order/confirmCompensation/abandon', {
  265. orderId: this.orderInfo.orderId
  266. })
  267. .then((res) => {
  268. if (res.code === 200) {
  269. this.$refs.overTimeDialog?.closePopup();
  270. uni.$u.toast('操作成功');
  271. this.getOrderInfo(this.orderInfo.orderId);
  272. }
  273. });
  274. },
  275. //卖亏必赔确认
  276. handleSellLossConfirm() {
  277. uni.$u.http
  278. .post('/token/order/priceCompensation/submit', {
  279. orderId: this.orderInfo.orderId
  280. })
  281. .then((res) => {
  282. if (res.code === 200) {
  283. this.$refs.sellLossDialog?.closePopup();
  284. uni.$u.toast('卖亏必赔申请成功');
  285. this.getOrderInfo(this.orderInfo.orderId);
  286. }
  287. });
  288. },
  289. //卖亏必赔取消
  290. handleCloseSellLoss() {
  291. uni.$u.http
  292. .post('/token/order/priceCompensation/abandon', {
  293. orderId: this.orderInfo.orderId
  294. })
  295. .then((res) => {
  296. if (res.code === 200) {
  297. this.$refs.sellLossDialog?.closePopup();
  298. uni.$u.toast('操作成功');
  299. this.getOrderInfo(this.orderInfo.orderId);
  300. }
  301. });
  302. }
  303. }
  304. };
  305. </script>
  306. <style lang="scss" scoped>
  307. .order-detail {
  308. min-height: 100vh;
  309. background: #f8f8f8;
  310. padding-bottom: 230rpx;
  311. .desc-bg {
  312. background: #fafafa;
  313. padding: 20rpx 30rpx;
  314. border-radius: 10rpx;
  315. margin-top: 20rpx;
  316. }
  317. .info-block {
  318. background: #ffffff;
  319. padding: 30rpx;
  320. margin: 30rpx;
  321. border-radius: 10rpx;
  322. }
  323. .detail-bottom {
  324. flex-direction: column;
  325. padding-left: 0;
  326. padding-right: 0;
  327. padding-top: 0;
  328. }
  329. }
  330. .button-bottom {
  331. display: flex;
  332. flex-direction: column;
  333. justify-content: center;
  334. align-items: center;
  335. margin: 30rpx 0;
  336. background-color: #38c148;
  337. color: #ffffff;
  338. font-size: 24rpx;
  339. line-height: 32rpx;
  340. padding: 16rpx 0;
  341. border-radius: 10rpx;
  342. }
  343. :deep(.btn-bottom) {
  344. height: 60rpx !important;
  345. line-height: 60rpx !important;
  346. }
  347. </style>