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

479 lines
10 KiB

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