order-detail.vue 11 KB

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