酒店桌布为微信小程序
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.

454 lines
9.5 KiB

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