order-detail.vue 12 KB

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