orderFormDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. <template>
  2. <view class="page" @click="closeShow">
  3. <!-- 订单状态 -->
  4. <view class="title">
  5. <view class="payment">{{ orderDetail.status_name }}</view>
  6. <text class="timer" v-if="orderDetail.simplify_status == 'unpaid'"
  7. >剩22小时52分自动关闭</text
  8. >
  9. <text
  10. v-else-if="orderDetail.simplify_status == 'undifference'"
  11. class="timer"
  12. >商品已打包称重,等待用户补邮费</text
  13. >
  14. </view>
  15. <!-- <view class="title">
  16. <view v-if="orderDetail.simplify_status == 'unpaid'">
  17. <view class="payment"> 等待付款 </view>
  18. <text class="timer">剩22小时52分自动关闭</text>
  19. </view>
  20. <view class="payment" v-else-if="orderDetail.status == 'closed'">
  21. 超时未付款,订单已取消
  22. </view>
  23. <view class="payment" v-else-if="status == 3"> 未发货,退款成功 </view>
  24. <view class="payment" v-else-if="status == 4"> 未发货,退款中 </view>
  25. <view
  26. class="payment"
  27. v-else-if="orderDetail.simplify_status == 'unreview'"
  28. >
  29. 拼团中
  30. </view>
  31. <view
  32. class="payment"
  33. v-else-if="
  34. orderDetail.simplify_status == 'paid' ||
  35. orderDetail.simplify_status == 'undelivered'
  36. "
  37. >
  38. 已付款,等待发货
  39. </view>
  40. <view
  41. class="payment"
  42. v-else-if="orderDetail.simplify_status == 'delivered'"
  43. >
  44. 已发货,等待收货
  45. </view>
  46. <view
  47. class="payment"
  48. v-else-if="orderDetail.simplify_status == 'finished'"
  49. >
  50. 订单已完成,交易成功
  51. </view>
  52. <view v-else-if="orderDetail.simplify_status == 'undifference'">
  53. <view class="payment">待补邮费</view>
  54. <text class="timer">商品已打包称重,等待用户补邮费</text>
  55. </view>
  56. </view> -->
  57. <!-- 订单状态 -->
  58. <!-- 地址信息 -->
  59. <view class="address">
  60. <view class="name-phone">
  61. <u-icon name="map" size="22"></u-icon>
  62. <view style="margin: 0 20rpx; font-size: 32rpx">{{
  63. orderDetail.address_name
  64. }}</view>
  65. <text class="phone">{{ orderDetail.address_mobile }}</text>
  66. </view>
  67. <view class="address-detail">
  68. {{ orderDetail.full_address }}
  69. </view>
  70. </view>
  71. <view class="photo" v-if="orderDetail.simplify_status == 'undifference'">
  72. <view class="_weight">
  73. <text>称重重量</text>
  74. <text>{{ orderDetail.call_weight }}kg</text>
  75. </view>
  76. <view class="_weight">
  77. <text>称重图片</text>
  78. <!-- <view class="_image"> </view> -->
  79. <image
  80. :src="orderDetail.call_image"
  81. mode="scaleToFill"
  82. class="_image"
  83. />
  84. </view>
  85. <view class="photo-bottom">
  86. <text class="_text-1">需补邮费</text>
  87. <view class="price">
  88. <text style="font-size: 20rpx">¥</text>
  89. <text>{{ orderDetail.fill_price.split(".")[0] }}</text
  90. >.
  91. <text style="font-size: 20rpx">{{
  92. orderDetail.fill_price.split(".")[1]
  93. }}</text>
  94. </view>
  95. </view>
  96. </view>
  97. <commodityDetailVue :status="status" :orderDetail="orderDetail" />
  98. <view class="order">
  99. <view class="order-number">
  100. <text> 订单编号 </text>
  101. <view>
  102. {{ orderDetail.order_no }} |
  103. <text decode @click="cope(orderDetail.order_no)">{{
  104. "&nbsp;" + "复制"
  105. }}</text>
  106. </view>
  107. </view>
  108. <view
  109. class="order-number"
  110. v-if="
  111. orderDetail.simplify_status == 'unreview' ||
  112. orderDetail.status == 'paid' ||
  113. orderDetail.status == 'merdelivered' ||
  114. orderDetail.simplify_status == 'finished' ||
  115. orderDetail.simplify_status == 'delivered' ||
  116. orderDetail.simplify_status == 'undelivered' ||
  117. orderDetail.simplify_status == 'undifference'
  118. "
  119. >
  120. <text> 支付方式 </text>
  121. <view> {{ orderDetail.pay_type_name }} </view>
  122. </view>
  123. <view
  124. class="order-number"
  125. v-if="
  126. orderDetail.simplify_status == 'unreview' ||
  127. orderDetail.status == 'paid' ||
  128. orderDetail.simplify_status == 'finished' ||
  129. orderDetail.simplify_status == 'undelivered' ||
  130. orderDetail.simplify_status == 'delivered' ||
  131. orderDetail.simplify_status == 'undifference'
  132. "
  133. >
  134. <text> 支付时间 </text>
  135. <view> {{ orderDetail.paid_at }} </view>
  136. </view>
  137. <view class="order-number">
  138. <text> 下单时间 </text>
  139. <view>{{ orderDetail.created_at }} </view>
  140. </view>
  141. </view>
  142. <view
  143. class="contact"
  144. v-if="
  145. orderDetail.status == 'unpaid' ||
  146. orderDetail.status == 'paid' ||
  147. orderDetail.status != 'merdelivered' ||
  148. orderDetail.simplify_status == 'undelivered'
  149. "
  150. >
  151. 联系团长
  152. </view>
  153. <view
  154. class="footer"
  155. v-if="
  156. orderDetail.status != 'paid' &&
  157. orderDetail.status != 'merdelivered' &&
  158. orderDetail.status != 'unreview' &&
  159. orderDetail.status != 'undelivered'
  160. "
  161. >
  162. <button
  163. class="status-1"
  164. v-if="
  165. orderDetail.status == 'unpaid' ||
  166. orderDetail.simplify_status == 'unreview'
  167. "
  168. @click="cancelOrder"
  169. >
  170. 取消订单
  171. </button>
  172. <button class="status-2" v-if="orderDetail.status == 'unpaid'">
  173. 继续付款
  174. </button>
  175. <button
  176. class="status-1"
  177. v-if="orderDetail.status == 'closed' || status == 3 || status == 4"
  178. >
  179. 删除订单
  180. </button>
  181. <button
  182. class="status-2"
  183. v-if="orderDetail.status == 'closed' || status == 3 || status == 4"
  184. >
  185. 再次购买
  186. </button>
  187. <button
  188. class="status-1"
  189. v-if="orderDetail.simplify_status == 'delivered'"
  190. >
  191. 查看物流
  192. </button>
  193. <button
  194. class="status-2"
  195. v-if="orderDetail.simplify_status == 'delivered'"
  196. @click="confirmReceipt"
  197. >
  198. 确认收货
  199. </button>
  200. <view
  201. style="margin-right: 40rpx; color: #777; font-size: 28rpx"
  202. v-if="orderDetail.simplify_status == 'finished'"
  203. @click="more"
  204. >更多</view
  205. >
  206. <button class="status-1" v-if="orderDetail.simplify_status == 'finished'">
  207. 查看物流
  208. </button>
  209. <button class="status-1" v-if="orderDetail.simplify_status == 'finished'">
  210. 再来一单
  211. </button>
  212. <button
  213. class="status-2"
  214. v-if="orderDetail.simplify_status == 'finished'"
  215. @click.stop="toEvaluate"
  216. >
  217. 评价
  218. </button>
  219. <button
  220. class="status-2"
  221. v-if="orderDetail.simplify_status == 'undifference'"
  222. @click.stop="toPay"
  223. >
  224. 立即付款
  225. </button>
  226. </view>
  227. <u-transition :show="show">
  228. <view class="transition">删除订单</view>
  229. </u-transition>
  230. <agreePopup title="是否确认收货" :agreeShow="agreeShow" @close="close" />
  231. </view>
  232. </template>
  233. <script>
  234. import commodityDetailVue from "./component/commodityDetail.vue";
  235. import agreePopup from "../mineComponent/agreePopup.vue";
  236. export default {
  237. components: {
  238. commodityDetailVue,
  239. agreePopup,
  240. },
  241. data() {
  242. return {
  243. status: 6,
  244. show: false,
  245. orderDetail: {},
  246. agreeShow: false,
  247. };
  248. },
  249. methods: {
  250. //复制
  251. cope(e) {
  252. uni.setClipboardData({
  253. data: e,
  254. success() {
  255. uni.showToast({
  256. title: "复制成功",
  257. icon: "none",
  258. });
  259. },
  260. });
  261. },
  262. //跳转评价
  263. toEvaluate() {
  264. uni.navigateTo({
  265. url: `/pageD/evaluate/evaluate?orderId=${this.orderDetail.id}`,
  266. });
  267. },
  268. more() {
  269. this.show = true;
  270. },
  271. //确认收货
  272. confirmReceipt() {
  273. this.agreeShow = true;
  274. // uni.$u.http
  275. // .post(`/api/order/receive/${this.orderDetail.id}`)
  276. // .then((res) => {});
  277. },
  278. //value为true时,确认收货
  279. //跳转支付
  280. toPay() {
  281. uni.navigateTo({
  282. url: `/pageA/payorder?sum=${this.orderDetail.fill_price}&orderid=${this.orderDetail.id}&orderType=difference`,
  283. });
  284. },
  285. close(value) {
  286. if (value) {
  287. uni.$u.http
  288. .post(`/api/order/receive/${this.orderDetail.id}`)
  289. .then((res) => {
  290. this.agreeShow = false;
  291. this.getDetail();
  292. uni.showToast({
  293. title: "订单已确认收货",
  294. icon: "none",
  295. });
  296. });
  297. } else {
  298. this.agreeShow = false;
  299. }
  300. },
  301. closeShow(e) {
  302. if (
  303. e._relatedInfo.anchorTargetText != "更多" &&
  304. e._relatedInfo.anchorTargetText != "删除订单"
  305. ) {
  306. this.show = false;
  307. }
  308. },
  309. //取消订单
  310. cancelOrder() {
  311. uni.$u.http
  312. .post(`/api/order/cancel/${this.orderDetail.id}`)
  313. .then((res) => {
  314. this.getDetail();
  315. uni.showToast({
  316. title: "已取消",
  317. icon: "none",
  318. });
  319. });
  320. },
  321. getDetail() {
  322. uni.$u.http.get(`/api/order/read?id=${this.status}`).then((res) => {
  323. this.orderDetail = res;
  324. });
  325. },
  326. },
  327. onShow() {
  328. this.getDetail();
  329. },
  330. created() {},
  331. mounted() {
  332. // this.getDetail();
  333. },
  334. onLoad(option) {
  335. this.status = option.orderId;
  336. },
  337. };
  338. </script>
  339. <style scoped lang="scss">
  340. .page {
  341. padding: 20rpx 24rpx 180rpx;
  342. .title {
  343. .payment {
  344. font-size: 44rpx;
  345. font-weight: 600;
  346. margin-bottom: 20rpx;
  347. }
  348. .timer {
  349. font-size: 28rpx;
  350. color: #666;
  351. }
  352. }
  353. .address {
  354. background-color: #fff;
  355. border-radius: 16rpx;
  356. padding: 34rpx 24rpx 28rpx;
  357. margin-top: 24rpx;
  358. .name-phone {
  359. display: flex;
  360. align-items: center;
  361. align-items: flex-end;
  362. .phone {
  363. font-size: 26rpx;
  364. color: #666;
  365. }
  366. }
  367. .address-detail {
  368. margin-top: 20rpx;
  369. font-size: 24rpx;
  370. color: #444;
  371. margin-left: 60rpx;
  372. }
  373. }
  374. .photo {
  375. background-color: #fff;
  376. border-radius: 16rpx;
  377. padding: 20rpx 20rpx;
  378. margin-top: 20rpx;
  379. ._weight {
  380. display: flex;
  381. justify-content: space-between;
  382. font-size: 26rpx;
  383. color: rgba(34, 34, 34, 0.8);
  384. margin-bottom: 32rpx;
  385. ._image {
  386. width: 160rpx;
  387. height: 90rpx;
  388. // background-color: #d8d8d8;
  389. border-radius: 4rpx;
  390. }
  391. }
  392. .photo-bottom {
  393. display: flex;
  394. justify-content: flex-end;
  395. align-items: center;
  396. border-top: 2rpx solid rgba(151, 151, 151, 0.1);
  397. padding-top: 24rpx;
  398. .price {
  399. color: #f83224;
  400. font-weight: 600;
  401. }
  402. ._text-1 {
  403. font-size: 26rpx;
  404. }
  405. }
  406. }
  407. .order {
  408. background-color: #fff;
  409. border-radius: 16rpx;
  410. color: rgba(54, 54, 54, 0.7);
  411. font-size: 28rpx;
  412. margin-top: 20rpx;
  413. padding: 20rpx 20rpx;
  414. .order-number {
  415. display: flex;
  416. justify-content: space-between;
  417. margin-bottom: 32rpx;
  418. }
  419. }
  420. .contact {
  421. padding: 20rpx 0;
  422. background-color: #fff;
  423. display: flex;
  424. justify-content: center;
  425. align-items: center;
  426. border-radius: 16rpx;
  427. margin-top: 20rpx;
  428. margin-bottom: 160rpx;
  429. }
  430. .footer {
  431. position: fixed;
  432. bottom: 0;
  433. left: 0;
  434. background-color: #fff;
  435. display: flex;
  436. justify-content: flex-end;
  437. align-items: center;
  438. padding-top: 20rpx;
  439. padding-bottom: 80rpx;
  440. height: 66rpx;
  441. width: 100%;
  442. .status-1 {
  443. background-color: #fff;
  444. border-radius: 34rpx;
  445. margin: 0;
  446. padding: 0;
  447. font-size: 28rpx;
  448. color: #222;
  449. width: 168rpx;
  450. height: 68rpx;
  451. margin-right: 20rpx;
  452. border: 2rpx solid #979797;
  453. }
  454. .status-2 {
  455. background-color: #ffffff;
  456. border-radius: 34rpx;
  457. margin: 0;
  458. padding: 0;
  459. font-size: 28rpx;
  460. color: #f83224;
  461. width: 168rpx;
  462. height: 68rpx;
  463. border: 2rpx solid #f83224;
  464. margin-right: 24rpx;
  465. }
  466. }
  467. .transition {
  468. width: 164rpx;
  469. height: 88rpx;
  470. background: #ffffff;
  471. box-shadow: 0rpx 0rpx 20rpx -6rpx rgba(0, 0, 0, 0.3);
  472. position: fixed;
  473. bottom: 160rpx;
  474. text-align: center;
  475. line-height: 88rpx;
  476. font-size: 26rpx;
  477. color: #222;
  478. }
  479. }
  480. </style>