From af2a3f0be23b06d7d7a24900911aa9c3b7192960 Mon Sep 17 00:00:00 2001 From: "liujw155@outlook.com" Date: Thu, 7 Jan 2021 17:58:40 +0800 Subject: [PATCH] fix all vtest1.0.4 --- src/pages/index/index.vue | 2 +- src/pages/site/confirm/confirm.vue | 4 +- src/pages/site/manage/manage.vue | 95 +++++++++++++++---- src/pages/site/order_list/order_list.vue | 105 ++++++++++++++++----- src/static/images/icon/occupy_filter.png | Bin 0 -> 419 bytes src/store/index.js | 2 +- .../device/pages/coffee_test/coffee_test.vue | 4 +- .../device/pages/locker_manage/locker_manage.vue | 2 +- 8 files changed, 163 insertions(+), 51 deletions(-) create mode 100644 src/static/images/icon/occupy_filter.png diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index f3b9a16..33458dc 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -168,7 +168,7 @@ // #endif }, onShow(){ - // #ifndef MP-WEIXIN + // #ifndef H5 let { indexData } = this; if(JSON.stringify(indexData)!='{}'&&!!app.isLogin())this.getIndexInfo(); // #endif diff --git a/src/pages/site/confirm/confirm.vue b/src/pages/site/confirm/confirm.vue index 0d00080..4578539 100644 --- a/src/pages/site/confirm/confirm.vue +++ b/src/pages/site/confirm/confirm.vue @@ -96,8 +96,8 @@ export default { util.showNone(res.data.message || '操作成功!'); setTimeout(_=>{ util.routeTo(); - util.previousPageFunction({ - fnName: 'refreshVenues', + util.previousPageFunction({ // 刷新占用列表 + fnName: 'refreshList', query: null }) }, 1200) diff --git a/src/pages/site/manage/manage.vue b/src/pages/site/manage/manage.vue index 2fa4b20..c973341 100644 --- a/src/pages/site/manage/manage.vue +++ b/src/pages/site/manage/manage.vue @@ -17,7 +17,10 @@ {{curTypeInfo.rule_text || '-'}} - {{dateList[0].ZhDateStr || '-'}}—{{dateList[dateList.length-1].ZhDateStr || '-'}} + + {{dateList[0].ZhDateStr || '-'}} — {{dateList[dateList.length-1].ZhDateStr || '-'}} + + @@ -38,7 +41,7 @@ {{e.duration || '-'}} - + {{e.name || '-'}} @@ -87,6 +90,9 @@ + + {{occupyTip || '-'}} + @@ -94,6 +100,7 @@ import { API } from '../../../js/api'; import { servers } from '../../../js/server'; import util from '../../../utils/util' +let tipTimer = null; export default { data(){ return { @@ -106,11 +113,18 @@ export default { curDateInfo: {}, // 当前日期 selectedVenueList: [], // 所选场地列表 totalPrice: 0, + occupyTip: '', // 占用提示 + venueAreaSize: '', // 场地滚动区域大小 } }, computed: { }, + onUnload(){ + this.occupyTip = ''; + clearTimeout(tipTimer); + tipTimer = null; + }, async onLoad(){ try { util.showLoad(); @@ -129,14 +143,16 @@ export default { let _dateArr = this.getDateList({}) || []; this.dateList = _dateArr; this.curDateInfo = _dateArr[0] || {}; - let _venueList = await this.getVenueList({ - type_key: _curType.key, - stadium_id: _curStore.id, - date: _dateArr[0].dateStr, - }) - if(!_venueList.length)return util.showNone('没有场地信息!') - this.venueList = _venueList || []; - return util.hideLoad(); + util.hideLoad(); + return this.$nextTick(_=>this.refreshVenues()); + // let _venueList = await this.getVenueList({ + // type_key: _curType.key, + // stadium_id: _curStore.id, + // date: _dateArr[0].dateStr, + // }) + // if(!_venueList.length)return util.showNone('没有场地信息!') + // this.venueList = _venueList || []; + }catch(err){ util.hideLoad(); console.warn('加载失败----->', err) @@ -168,7 +184,11 @@ export default { }) if(!_venueList.length)return util.showNone('没有场地信息!'); this.venueList = _venueList || []; - this.$nextTick(_=>this.getSelectedVenues()); + this.$nextTick(_=>{ + this.getSelectedVenues(); + this.setVenueAreaSize(); + }); + util.hideLoad(); }catch(err){ util.hideLoad(); @@ -180,14 +200,21 @@ export default { this.refreshVenues(); // this.$nextTick(_=>this.getSelectedVenues()); }, + // 占用提示 + showOccupyTip(str, duration = 1200){ + this.occupyTip = str; + clearTimeout(tipTimer); + tipTimer = null; + tipTimer = setTimeout(_=>this.occupyTip = '', duration); + }, // 场地选择 venueSelect(i,j){ let { venueList } = this; let _venueList = venueList.slice(); let _curTarget = { ..._venueList[i].items[j] }; if(_curTarget.is_take_up){ - let _str = `操作人:${_curTarget.operator || '-'},收取金额: ${_curTarget.price || 0}\n原因: ${_curTarget.take_up_reason || '-'}`; - util.showNone(_str) + let _str = `操作人:${_curTarget.operator || '-'}\n收取金额: ${_curTarget.price || 0}\n原因: ${_curTarget.take_up_reason || '-'}`; + this.showOccupyTip(_str) return } if(!_curTarget.is_valid)return; @@ -277,7 +304,7 @@ export default { venueList: selectedVenueList, }) - util.routeTo(`/pages/site/confirm/confirm`, 'nT'); + util.routeTo(`/pages/site/confirm/confirm`, 'rT'); }, // 场馆列表 getVenueList({type_key,stadium_id,date}){ @@ -302,7 +329,15 @@ export default { data: {}, failMsg: '加载店铺失败!' }) - } + }, + // 设置滚动区域大小 + setVenueAreaSize(){ + const sysInfo = uni.getSystemInfoSync(); + util.getNodeMes('.sv-time-interval') + .then(res=>{ + this.venueAreaSize = `width:${sysInfo.screenWidth - res.width}px;height:${res.height}px;` + }) + }, } } @@ -369,6 +404,13 @@ export default { color: #9A9A9D; border-top: 2upx solid #D8D8D8; border-bottom: 2upx solid #D8D8D8; + >image{ + margin-left: 20upx; + width: 24upx; + height: 24upx; + vertical-align: middle; + transform: rotateZ(90deg); + } } } .sm-times{ @@ -418,10 +460,9 @@ export default { } } .sm-venue{ - display: flex; .sv-time-interval{ - flex-shrink: 0; - flex-grow: 0; + vertical-align: top; + display: inline-block; .sti-item{ position: relative; width: 112upx; @@ -454,8 +495,8 @@ export default { } } .sti-venue-list{ - width: 630upx; - flex-grow: 1; + vertical-align: top; + display: inline-block; background-color: #f2f2f7; text-align: left; white-space: nowrap; @@ -647,5 +688,19 @@ export default { } } + .sm-fixed-tip{ + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + max-width: 600upx; + padding: 20upx 30upx; + border-radius: 10upx; + background-color: rgba($color: #000000, $alpha: .5); + word-break: break-all; + font-size: 28upx; + line-height: 44upx; + color: #fff; + } } \ No newline at end of file diff --git a/src/pages/site/order_list/order_list.vue b/src/pages/site/order_list/order_list.vue index 7a91b81..9ab981e 100644 --- a/src/pages/site/order_list/order_list.vue +++ b/src/pages/site/order_list/order_list.vue @@ -1,14 +1,28 @@ @@ -76,15 +91,50 @@ export default { data(){ return { occupyList: [], + curStore: {}, // 当前店铺 + storeList: [{ id: '', name: '全部'}], // 店铺列表 + curStatus: {}, + statusList: [{sta: '', na: '全部'}, {sta: 0, na: '已取消'},{sta: 1, na: '待使用'},{sta: 2, na: '已使用'}], + } }, onLoad(){ - - }, - onShow(){ - this.getTakeUpList(); + this.refreshList(); + this.getStoreList(); }, + methods: { + // 店铺列表 + getStoreList(){ + return servers.get({ + url: API.stadiumList, + data: {}, + failMsg: '加载店铺失败!' + }) + .then(res=>{ + let _list = res.list || []; + this.storeList = [...this.storeList, ..._list]; + }) + }, + storeChange(e){ + let { storeList } = this; + this.curStore = storeList[e.detail.value] || {}; + this.$nextTick(_=>this.refreshList()); + }, + statusChange(e){ + let { statusList } = this; + this.curStatus = statusList[e.detail.value] || {}; + this.$nextTick(_=>this.refreshList()); + }, + // 确认页面提交成功调用 + refreshList(){ + let { curStatus, curStore } = this; + this.occupyList = []; + this.getTakeUpList({ + status: curStatus.sta, + group: curStore.id || '' + }) + }, cancelOccupy: util.debounce(function(e){ util.showLoad(); servers.get({ @@ -99,24 +149,25 @@ export default { util.hideLoad() if(res.data.code == 0){ util.showNone(res.data.message || '操作成功!'); - setTimeout(_=>{ - this.occupyList = []; - this.getTakeUpList(); - }, 1200); + setTimeout(this.refreshList, 1200); }else{ util.showNone(res.data.message || '操作失败!'); } }) .catch(util.hideLoad); }, 300, 300), - getTakeUpList(){ + getTakeUpList({ + group='', // 店铺id + source='商家助手', // 固定值 '商家助手' + status='', // 空为全部 // 0,1,2 -> 已取消,待使用,已使用 + }){ util.showLoad(); servers.get({ url: API.venue.takeUpList, data: { - group: '', - source: '商家助手', - status: '' + group, + source, + status }, failMsg: '加载失败!' }) @@ -160,15 +211,21 @@ export default { flex-shrink: 0; width: 24upx; height: 24upx; - background-color: skyblue; } } .sb-icon{ + flex-grow: 0; flex-shrink: 0; margin-left: 48upx; - width: 60upx; - height: 60upx; - background-color: skyblue; + margin-right: 10upx; + picker{ + width: 56upx; + height: 48upx; + } + image{ + width: 56upx; + height: 48upx; + } } } .sol-list{ @@ -195,7 +252,6 @@ export default { vertical-align: middle; width: 34upx; height: 34upx; - background-color: skyblue; } } .sa-status{ @@ -292,5 +348,6 @@ export default { border-radius: 44upx; } } + } \ No newline at end of file diff --git a/src/static/images/icon/occupy_filter.png b/src/static/images/icon/occupy_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..47e9cc2087b92e1c936bced916e75b098a6182af GIT binary patch literal 419 zcmeAS@N?(olHy`uVBq!ia0vp^7C>yk!3-pexjh|$lv#jJh%1nuHESLW&7V6L&W14N z&YnGg_Uw7HXV0BA3xt4dAo)(hzwzH@6&^irw&3xK=keU_X)^;(eO%8x`DIUq z?2+q7uc)i-3V3pJ(kX@CTz5B|n(g^{*<(GM?0etSZW>>Z4ZEjTeeaXS{Df6|ChEL4 z6nOA+gTXG{^S$k<-%bfVQkIL}e%ZlbLdPV#Y3ocxWu$iqHCcc8{AGp#^IEQ|vm54G z&bjegXq)f^wpUMjIj?Abk6UOqheezo zMX%N7hSqzWY18(}6H)%7eqT3f#r?ogy@!&465;oi!{ - _tipStr += _selledList.length-1>idx?`${ele.id}号柜、`:`${ele.id}号柜`; + _tipStr += _selledList.length-1>idx?`${ele.cabinet_name}、`:`${ele.cabinet_name}`; }) _tipStr+= `商品已被售`