order-detail.vue 13 KB

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