laundry-info.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <view class="flex-common-css">
  3. <Nav title=" " leftIconColor="#333" titleColor="#333" bgckgroundBox='transparent'></Nav>
  4. <image class="bg-img" src="@/static/img/order/bg.png" mode=""></image>
  5. <view class="p-24-24-0 box-border-box">
  6. <view class="mb-24" v-show="infoData.order_status == 1">
  7. <view class="fs-40 fc-3 mb-8">
  8. {{infoData.order_status_str}},剩余{{time}}
  9. </view>
  10. <view class="fs-24 fc-FB3D03">
  11. 10分钟内未支付,订单将自动取消
  12. </view>
  13. </view>
  14. <view class="mb-24">
  15. <view class="fs-48 fc-3 fw-600">
  16. {{infoData.order_status_str}}
  17. </view>
  18. </view>
  19. <view class="bgc-f b-rad-20 p-24 box-border-box">
  20. <view class="p-b-20 mb-24 b-b-F9F9F9 fs-32 fc-3" v-show="infoData.order_status == 1">
  21. 请尽快支付
  22. </view>
  23. <view class="p-b-20 mb-24 b-b-F9F9F9 fs-32 fc-3" v-show="infoData.order_status == 4">
  24. 感谢你对君子校园的信任,期待你再次光临
  25. </view>
  26. <view class="align-items-center flex-wrap-wrap">
  27. <view class="w-33 flex-direction align-items-center" v-show="infoData.order_status == 1">
  28. <image class="mb-4 icon" src="@/static/img/order/qzf.png" mode=""></image>
  29. <view class="fs-24 fc-41ABF5">
  30. 去支付
  31. </view>
  32. </view>
  33. <view class="w-33 flex-direction align-items-center" v-show="infoData.order_status == 1 || infoData.order_status == 2">
  34. <image class="mb-4 icon" src="@/static/img/order/xgdd.png" mode=""></image>
  35. <view class="fs-24 fc-3">
  36. 修改订单信息
  37. </view>
  38. </view>
  39. <view class="w-33 flex-direction align-items-center" v-show="infoData.order_status == 4 || infoData.order_status == 6">
  40. <image class="mb-4 icon" src="@/static/img/order/zlyd.png" mode=""></image>
  41. <view class="fs-24 fc-41ABF5">
  42. 再来一单
  43. </view>
  44. </view>
  45. <view class="w-33 flex-direction align-items-center">
  46. <image class="mb-4 icon" src="@/static/img/order/lxkf.png" mode=""></image>
  47. <view class="fs-24 fc-3">
  48. 联系客服
  49. </view>
  50. </view>
  51. <view class="w-33 flex-direction align-items-center" v-show="infoData.order_status == 2" @click="cancelOrder">
  52. <image class="mb-4 icon" src="@/static/img/order/qxdd.png" mode=""></image>
  53. <view class="fs-24 fc-3">
  54. 取消订单
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <scroll-view :scroll-y="true" class="scroll-view-css p-24 box-border-box" @scrolltolower="scrolltolower">
  61. <view class="bgc-f b-rad-20 p-24 box-border-box mb-20">
  62. <view class="w-420 fc-3 fs-32 fw-600 text-overflow-ellipsis-one mb-24">
  63. {{infoData.site_name}}
  64. </view>
  65. <view class="goods-box" :class="infoData.item.length >= 4 && goodsShow?'goodsShowOne':'goodsShowTwo'">
  66. <view class="align-items-center flex-justify-space mb-20" v-for="(item,index) in infoData.item">
  67. <image class="goods-img mr-16" :src="item.goods_img" mode=""></image>
  68. <view class="">
  69. <view class="align-items-center flex-justify-space mb-2">
  70. <view class="fs-28 fc-3 w-376 text-overflow-ellipsis-one mr-36">
  71. {{item.goods_name}}
  72. </view>
  73. <view class="fs-32 fc-3 fw-600">
  74. ¥{{item.goods_money}}
  75. </view>
  76. </view>
  77. <!-- <view class="mb-2 fs-24 fc-9">
  78. {{item.goods_name}}
  79. </view> -->
  80. <view class="fs-24 fc-9">
  81. x{{item.goods_num}}
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="align-items-center flex-justify-center p-24 b-b-F9F9F9 mb-32" @click="openGoods"
  87. v-if="infoData.item.length > 4">
  88. <view class="fs-24 fc-9 mr-4">
  89. {{goodsShow?'展开':'收起'}}{{infoData.item.length - 4}}件商品
  90. </view>
  91. <image v-if="goodsShow" class="icon-right" src="@/static/img/order/top.png" mode=""></image>
  92. <image v-else class="icon-right" src="@/static/img/order/bottom.png" mode=""></image>
  93. </view>
  94. <!-- <view class="align-items-center flex-justify-space mb-24">
  95. <view class="fs-28 fc-3">
  96. 打包费
  97. </view>
  98. <view class="fs-32 fc-3">
  99. 打包费
  100. </view>
  101. </view>
  102. <view class="align-items-center flex-justify-space mb-24">
  103. <view class="fs-28 fc-3">
  104. 配送费
  105. </view>
  106. <view class="fs-32 fc-3">
  107. 打包费
  108. </view>
  109. </view> -->
  110. <!-- <view class="align-items-center flex-justify-space pb-36 b-b-F9F9F9 mb-22">
  111. <view class="align-items-center">
  112. <image class="mr-6 icon-right" src="@/static/img/order/yhq.png" mode=""></image>
  113. <view class="fs-28 fc-3">
  114. 优惠券
  115. </view>
  116. </view>
  117. <view class="fs-32 fc-FB3D03">
  118. -¥{{infoData.coupon_money}}
  119. </view>
  120. </view> -->
  121. <view class="align-items-center flex-justify-end">
  122. <view class="fs-28 fc-9">
  123. 共{{infoData.goods_number}}件,
  124. </view>
  125. <view class="fs-28 fc-3">
  126. 金额
  127. </view>
  128. <view class="fs-24 fw-600 fc-3">
  129. ¥
  130. </view>
  131. <view class="fs-36 fw-600 fc-3">
  132. {{infoData.pay_money}}
  133. </view>
  134. </view>
  135. </view>
  136. <view class="bgc-f b-rad-20 p-24 box-border-box mb-20">
  137. <!-- <view class="display-flex flex-justify-space mb-26">
  138. <view class="fs-28 fc-9">
  139. 配送地址
  140. </view>
  141. <view class="fs-28 fc-3 w-480 text-align-right">
  142. {{infoData.school_name}}{{infoData.dorm_name}}{{infoData.address}}{{infoData.consignee}}{{infoData.consignee_tel}}
  143. </view>
  144. </view> -->
  145. <!-- <view class="display-flex flex-justify-space mb-26">
  146. <view class="fs-28 fc-9">
  147. 配送时间
  148. </view>
  149. <view class="fs-28 fc-3 w-480 text-align-right">
  150. 预约配送
  151. </view>
  152. </view> -->
  153. <!-- <view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26" v-show="infoData.order_status == 3">
  154. <view class="fs-28 fc-9">
  155. 骑手信息
  156. </view>
  157. <view class="fs-28 fc-3 w-480 text-align-right">
  158. {{infoData.rider.rider_name}}{{infoData.rider.phone}}
  159. </view>
  160. </view> -->
  161. <view class="display-flex flex-justify-space mb-26">
  162. <view class="fs-28 fc-9">
  163. 订单编号
  164. </view>
  165. <view class="align-items-center flex-justify-end">
  166. <view class="fs-28 fc-3 w-480 mr-8 text-align-right">
  167. {{infoData.order_sn}}
  168. </view>
  169. <image class="icon-fz" src="@/static/img/order/fz.png" mode=""></image>
  170. </view>
  171. </view>
  172. <view class="display-flex flex-justify-space mb-26">
  173. <view class="fs-28 fc-9">
  174. 下单时间
  175. </view>
  176. <view class="fs-28 fc-3 w-480 text-align-right">
  177. {{infoData.created_at}}
  178. </view>
  179. </view>
  180. <view class="display-flex flex-justify-space mb-26">
  181. <view class="fs-28 fc-9">
  182. 支付方式
  183. </view>
  184. <view class="fs-28 fc-3 w-480 text-align-right">
  185. {{infoData.pay_type_str}}
  186. </view>
  187. </view>
  188. <view class="display-flex flex-justify-space mb-26">
  189. <view class="fs-28 fc-9">
  190. 备注
  191. </view>
  192. <view class="fs-28 fc-3 w-480 text-align-right">
  193. {{infoData.note?infoData.note:'无'}}
  194. </view>
  195. </view>
  196. </view>
  197. </scroll-view>
  198. </view>
  199. </template>
  200. <script>
  201. import {
  202. laundryOrderInfo,
  203. laundryOrderCancel
  204. } from "@/api/laundryOrder.js"
  205. export default {
  206. components: {},
  207. data() {
  208. return {
  209. goodsData: [{
  210. name: '1'
  211. }, {
  212. name: '2'
  213. }],
  214. goodsShow: true,
  215. infoData: {},
  216. time: ''
  217. };
  218. },
  219. onLoad(data) {
  220. if (data) {
  221. console.log(data);
  222. this.laundryOrderInfo(data.orderId)
  223. }
  224. },
  225. mounted() {},
  226. methods: {
  227. cancelOrder() {
  228. // 代取取消订单
  229. laundryOrderCancel({order_id: infoData.id}).then((res) => {
  230. if(res.code == 1) {
  231. tools.success(res.msg)
  232. this.laundryOrderInfo(infoData.id)
  233. }else {
  234. tools.error(res.msg)
  235. }
  236. })
  237. },
  238. openGoods() {
  239. this.goodsShow = !this.goodsShow
  240. },
  241. scrolltolower() {
  242. // console.log('触底');
  243. },
  244. laundryOrderInfo(id) {
  245. laundryOrderInfo({
  246. order_id: id
  247. }).then((res) => {
  248. if (res.code == 1) {
  249. this.infoData = res.data
  250. if (this.infoData.order_status == 1) {
  251. setInterval(() => {
  252. let currentDate = new Date(); //获取当前时间
  253. let createDate = new Date(res.data.created_at); //格式化订单创建时候的时间
  254. createDate.setMinutes(createDate.getMinutes() + 10)
  255. let disDate = (currentDate - createDate) / 1000; //计算相隔分钟
  256. let m = parseInt(disDate / 60 % 60)
  257. m = m < 10 ? "0" + m : m
  258. let s = parseInt(disDate % 60)
  259. s = s < 10 ? "0" + s : s
  260. this.time = m + ":" + s
  261. }, 1000)
  262. }
  263. }
  264. })
  265. }
  266. },
  267. }
  268. </script>
  269. <style lang="scss" scoped>
  270. .bg-img {
  271. position: fixed;
  272. left: 0;
  273. top: 0;
  274. z-index: -1;
  275. width: 100%;
  276. height: 320rpx;
  277. }
  278. .w-33 {
  279. width: 33%;
  280. }
  281. .p-24-24-0 {
  282. padding: 24rpx 24rpx 0;
  283. }
  284. .icon {
  285. width: 48rpx;
  286. height: 48rpx;
  287. }
  288. .w-420 {
  289. width: 420rpx;
  290. }
  291. .goods-img {
  292. width: 108rpx;
  293. height: 108rpx;
  294. border-radius: 8rpx;
  295. }
  296. .w-376 {
  297. width: 376rpx;
  298. }
  299. .icon-right {
  300. width: 32rpx;
  301. height: 32rpx;
  302. }
  303. .w-480 {
  304. width: 480rpx;
  305. }
  306. .icon-fz {
  307. width: 24rpx;
  308. height: 24rpx;
  309. }
  310. .goods-box {
  311. overflow: hidden;
  312. }
  313. .goodsShowOne {
  314. max-height: 508rpx;
  315. transition: all .5s linear;
  316. }
  317. .goodsShowTwo {
  318. height: auto;
  319. transition: all .5s linear;
  320. }
  321. </style>