酒店桌布为微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

445 lines
9.2 KiB

9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="page">
  3. <navbar
  4. :title="uid ? '用户订单信息' : '订单中心'"
  5. :leftClick="uid"
  6. @leftClick="$utils.navigateBack"
  7. />
  8. <uv-tabs :list="tabs"
  9. :activeStyle="{color : '#FD5100', fontWeight : 600}"
  10. lineColor="#FD5100"
  11. lineHeight="8rpx"
  12. lineWidth="50rpx"
  13. @click="clickTabs"></uv-tabs>
  14. <view v-if="orderList.records.length > 0" class="list">
  15. <view class="item"
  16. v-for="(item, index) in orderList.records"
  17. @click="toOrderDetail(item.id)"
  18. :key="index">
  19. <view class="top">
  20. <view class="service">
  21. <text>{{ tabs[item.type + 1].name }}</text>
  22. </view>
  23. <view class="status">
  24. <text> {{item.status_dictText}}</text>
  25. </view>
  26. </view>
  27. <view class="content"
  28. v-for="(p, i) in item.orderDetails"
  29. :key="i">
  30. <view class="left">
  31. <image mode="aspectFill" :src="p.pic"></image>
  32. </view>
  33. <view class="right">
  34. <!-- <view class="text-hidden-1">
  35. 客户姓名{{item.userName}}
  36. </view>
  37. <view class="text-hidden-1">
  38. 产品规格{{item.sku}}
  39. </view>
  40. <view class="text-hidden-1">
  41. 租赁地址{{item.userAddress}}
  42. </view>
  43. <view class="text-hidden-1">
  44. 数量{{ item.num }}
  45. </view> -->
  46. <view class="text-hidden-1">
  47. 产品名称{{p.goodsName}}
  48. </view>
  49. <view class="text-hidden-1">
  50. 产品规格{{p.sku}}
  51. </view>
  52. <view class="text-hidden-1">
  53. 数量{{ p.num }}
  54. </view>
  55. </view>
  56. </view>
  57. <view class="userInfo">
  58. <text>{{ item.userName }}</text>
  59. <text>{{ item.userPhone }}</text>
  60. <text>{{ item.userAddress }}</text>
  61. </view>
  62. <view class="userInfo">
  63. <text>下单时间</text>
  64. <text>{{ item.createTime }}</text>
  65. </view>
  66. <!-- 水洗店按钮 -->
  67. <view class="bottom" v-if="userShop">
  68. <view class="pay">
  69. <view
  70. v-if="item.washPay && item.type == 1">
  71. 水洗费用{{ item.washPay }}
  72. </view>
  73. </view>
  74. <!-- 待接单 -->
  75. <view
  76. v-if="[4, 18, 19].includes(item.status)"
  77. @click.stop="orderConfirmAccept(item)" class="b2">
  78. 确认接单
  79. </view>
  80. <!-- 待收货 -->
  81. <template v-if="item.status == 2">
  82. <view @click.stop="confirmReceiveGoods(item)" class="b2">
  83. 确认收货
  84. </view>
  85. <view @click.stop="" class="b1">
  86. 查看物流
  87. </view>
  88. </template>
  89. <!-- 待检查 -->
  90. <template v-if="item.status == 5">
  91. <view @click.stop="orderConfirmedDamage(item, 1)" class="b2"
  92. >
  93. 确认下一步
  94. </view>
  95. <!-- <view @click.stop="$utils.navigateTo
  96. (`/pages_order/order/damageReport?id=${item.id}`)" class="b1"
  97. >
  98. 破损上报
  99. </view> -->
  100. <view @click.stop="$utils.navigateTo
  101. (`/pages_order/order/damageReport?id=${item.id}`)" class="b1"
  102. >
  103. 破损上报
  104. </view>
  105. </template>
  106. <view
  107. v-if="[8, 12].includes(item.status)"
  108. @click.stop="orderId = item.id;$refs.deliverGoods.open()" class="b2">
  109. 发货填写单号
  110. </view>
  111. <view
  112. v-if="[6].includes(item.status)"
  113. @click.stop="orderFinishedWashing(item)" class="b2">
  114. 水洗完成
  115. </view>
  116. </view>
  117. <!-- 酒店按钮 -->
  118. <view class="bottom"
  119. v-else>
  120. <view class="pay">
  121. <!-- <view
  122. v-if="item.washPay">
  123. 水洗费用{{ item.washPay }}
  124. </view>
  125. <view
  126. v-if="item.rentPay">
  127. 租赁费用{{ item.rentPay }}
  128. </view>
  129. <view
  130. v-if="item.deposit">
  131. 押金{{ item.deposit }}
  132. </view> -->
  133. <view class="price"
  134. v-if="item.orderPay">
  135. 合计<text class="num">{{ item.orderPay }}</text>
  136. </view>
  137. </view>
  138. <!-- 取消订单 -->
  139. <view class="">
  140. <view
  141. @click.stop="orderCancel(item)" class="b1"
  142. v-if="[0, 3].includes(item.status)">
  143. 取消订单
  144. </view>
  145. </view>
  146. <!-- 待支付 -->
  147. <view class="">
  148. <view
  149. @click.stop="payOrder(item.orderLogId,
  150. item.id, item.status == 10)" class="b2"
  151. v-if="[0, 3, 10].includes(item.status)">
  152. {{ item.status == 10 ? '支付费用' : '立即付款' }}
  153. </view>
  154. </view>
  155. <!-- 待收货 -->
  156. <template v-if="item.status == 2">
  157. <view @click.stop="confirmReceiveGoods(item)" class="b2">
  158. 确认收货
  159. </view>
  160. <view @click.stop="" class="b1">
  161. 查看物流
  162. </view>
  163. </template>
  164. </view>
  165. </view>
  166. </view>
  167. <uv-empty
  168. v-else
  169. text="空空如也"
  170. textSize="30rpx"
  171. iconSize="200rpx"
  172. icon="list"></uv-empty>
  173. <deliverGoods
  174. ref="deliverGoods"
  175. :orderId="orderId"
  176. @getData="getData"/>
  177. <tabber select="2" v-if="!uid"/>
  178. </view>
  179. </template>
  180. <script>
  181. // 状态
  182. // 租赁订单:0待支付 1待发货 2待收货
  183. // 水洗订单:3待支付 4水洗店接单 5水洗店检查
  184. // 6开始清洗
  185. // 换货订单:7待回收 8待发货 9平台待收货
  186. // 10平台检查损失待用户支付 18待接单
  187. // 退货订单:11待回收 12待发货 13平台待收货
  188. // 14平台检查损失并且退还定金 19待接单
  189. // 15 已完成
  190. import tabber from '@/components/base/tabbar.vue'
  191. import { mapGetters } from 'vuex'
  192. import mixinOrder from '@/mixins/order.js'
  193. import deliverGoods from '@/components/userShop/deliverGoods.vue'
  194. export default {
  195. components : {
  196. tabber,
  197. deliverGoods,
  198. },
  199. mixins : [mixinOrder],
  200. computed : {
  201. ...mapGetters(['userShop']),
  202. },
  203. data() {
  204. return {
  205. tabs: [{
  206. name: '全部'
  207. },
  208. {
  209. name: '租赁押金'
  210. },
  211. {
  212. name: '水洗租赁'
  213. },
  214. {
  215. name: '破损换货'
  216. },
  217. {
  218. name: '退货退款'
  219. }
  220. ],
  221. queryParams: {
  222. pageNo: 1,
  223. pageSize: 10
  224. },
  225. // orderList: [
  226. // {
  227. // money : 99.99,
  228. // address : '广东省广州市越秀区城南故事C3栋2802',
  229. // name : '李**',
  230. // phone : '150*****091',
  231. // unit : '120*40*75【桌子尺寸】',
  232. // image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  233. // status_dictText : '已完成',
  234. // }
  235. // ], //订单列表数据
  236. orderList : {
  237. records : [],
  238. total : 0,
  239. },
  240. type : -1,
  241. uid : 0,
  242. orderId : 0,
  243. }
  244. },
  245. onLoad(args) {
  246. this.uid = args.uid || 0
  247. },
  248. onShow() {
  249. this.getData()
  250. if(this.userShop){
  251. this.tabs[1].name = '租赁订单'
  252. this.$forceUpdate()
  253. }
  254. },
  255. onPullDownRefresh() {
  256. this.getData()
  257. },
  258. //滚动到屏幕底部
  259. onReachBottom() {
  260. if(this.queryParams.pageSize < this.orderList.total){
  261. this.queryParams.pageSize += 10
  262. this.getData()
  263. }
  264. },
  265. methods: {
  266. getData(){
  267. let queryParams = {
  268. ...this.queryParams,
  269. }
  270. if(this.type != -1){
  271. queryParams.type = this.type
  272. }
  273. // 水洗店查询用户订单
  274. if(this.uid != 0){
  275. queryParams.uid = this.uid
  276. }
  277. this.$api('orderPage', queryParams, res => {
  278. uni.stopPullDownRefresh()
  279. if(res.code == 200){
  280. this.orderList = res.result
  281. }
  282. })
  283. },
  284. //点击tab栏
  285. clickTabs({ index, name }) {
  286. if (index == 0) {
  287. this.type = -1;
  288. } else {
  289. this.type = index - 1;
  290. }
  291. this.queryParams.pageSize = 10
  292. this.getData()
  293. },
  294. //跳转订单详情页面
  295. toOrderDetail(id) {
  296. uni.navigateTo({
  297. url: '/pages_order/order/orderDetail?id=' + id
  298. })
  299. },
  300. }
  301. }
  302. </script>
  303. <style scoped lang="scss">
  304. .page{
  305. }
  306. .list {
  307. .item {
  308. width: calc(100% - 40rpx);
  309. background-color: #fff;
  310. margin: 20rpx;
  311. box-sizing: border-box;
  312. border-radius: 16rpx;
  313. padding: 30rpx;
  314. .top {
  315. display: flex;
  316. justify-content: space-between;
  317. align-items: center;
  318. font-size: 30rpx;
  319. .service {}
  320. .status {
  321. font-size: 26rpx;
  322. font-weight: 600;
  323. }
  324. }
  325. .content {
  326. display: flex;
  327. margin: 10rpx 0;
  328. .left {
  329. width: 130rpx;
  330. height: 130rpx;
  331. border-radius: 10rpx;
  332. image {
  333. width: 130rpx;
  334. height: 130rpx;
  335. border-radius: 10rpx;
  336. }
  337. }
  338. .right {
  339. width: calc(100% - 160rpx);
  340. color: #777;
  341. font-size: 24rpx;
  342. padding-left: 20rpx;
  343. line-height: 40rpx;
  344. background-color: #F8F8F8;
  345. }
  346. }
  347. .userInfo{
  348. font-size: 24rpx;
  349. margin-bottom: 10rpx;
  350. text{
  351. margin-right: 26rpx;
  352. }
  353. }
  354. .bottom {
  355. display: flex;
  356. justify-content: flex-end;
  357. font-size: 25rpx;
  358. .pay{
  359. margin: 12rpx;
  360. margin-right: auto;
  361. }
  362. .price {
  363. font-weight: 900;
  364. text {
  365. color: #ff780099;
  366. font-size: 30rpx;
  367. }
  368. }
  369. .b1 {
  370. border: 1px solid #777;
  371. color: #777;
  372. box-sizing: border-box;
  373. display: flex;
  374. justify-content: center;
  375. align-items: center;
  376. }
  377. .b2 {
  378. background: $uni-color;
  379. color: #fff;
  380. flex-shrink: 0;
  381. display: flex;
  382. justify-content: center;
  383. align-items: center;
  384. }
  385. .b1,.b2 {
  386. margin: 12rpx;
  387. border-radius: 28rpx;
  388. padding: 8rpx 28rpx;
  389. margin-bottom: 0;
  390. }
  391. }
  392. }
  393. }
  394. </style>