Browse Source

fix all vtest1.0.4

voice
刘嘉炜 4 years ago
parent
commit
af2a3f0be2
  1. 2
      src/pages/index/index.vue
  2. 4
      src/pages/site/confirm/confirm.vue
  3. 95
      src/pages/site/manage/manage.vue
  4. 105
      src/pages/site/order_list/order_list.vue
  5. BIN
      src/static/images/icon/occupy_filter.png
  6. 2
      src/store/index.js
  7. 4
      src/subpackage/device/pages/coffee_test/coffee_test.vue
  8. 2
      src/subpackage/device/pages/locker_manage/locker_manage.vue

2
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

4
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)

95
src/pages/site/manage/manage.vue

@ -17,7 +17,10 @@
<view class="st-tip">{{curTypeInfo.rule_text || '-'}}</view>
</view>
<picker mode="date" @change="timeSlotChange">
<view class="sh-time" v-if="dateList.length>1">{{dateList[0].ZhDateStr || '-'}}{{dateList[dateList.length-1].ZhDateStr || '-'}}</view>
<view class="sh-time" v-if="dateList.length>1">
<text>{{dateList[0].ZhDateStr || '-'}} {{dateList[dateList.length-1].ZhDateStr || '-'}}</text>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
</view>
<scroll-view class="sm-times" scroll-x>
@ -38,7 +41,7 @@
<view class="sti-item"></view>
<view class="sti-item" v-for="(e,i) in venueList[0].items" :key="i">{{e.duration || '-'}}</view>
</view>
<scroll-view class="sti-venue-list" enable-flex scroll-x>
<scroll-view class="sti-venue-list" enable-flex scroll-x :style="venueAreaSize">
<view class="svl-list" v-for="(e, i) in venueList" :key="i">
<view class="sl-item">{{e.name || '-'}}</view>
<view class="sl-item" v-for="(k,j) in e.items" :key="j" @click="venueSelect(i,j)">
@ -87,6 +90,9 @@
</view>
</view>
</view>
<view class="sm-fixed-tip" v-if="occupyTip!==''">
<text>{{occupyTip || '-'}}</text>
</view>
</view>
</template>
@ -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;`
})
},
}
}
</script>
@ -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;
}
}
</style>

105
src/pages/site/order_list/order_list.vue

@ -1,14 +1,28 @@
<template>
<view class="site-order-list">
<!-- <view class="sol-bar">
<picker>
<view class="sol-bar">
<picker
@change="storeChange"
mode="selector"
range-key="name"
:range="storeList"
>
<view class="sb-picker">
<input placeholder="请选择门店" disabled />
<image></image>
<input placeholder="请选择门店" :value="curStore.name" disabled />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
<view class="sb-icon"></view>
</view> -->
<view class="sb-icon">
<picker
@change="statusChange"
mode="selector"
range-key="na"
:range="statusList"
>
<image mode="aspectFit" src="/static/images/icon/occupy_filter.png"></image>
</picker>
</view>
</view>
<view class="sol-list">
<view class="sl-item" v-for="(e, i) in occupyList" :key="i">
<view class="si-bar">
@ -28,7 +42,7 @@
<view class="sd-line">
<view>占用编号:</view>
<view>
<view>{{e.time_arrow_id || '-'}}</view>
<view>{{e.extension.take_up_details.number || '-'}}</view>
</view>
</view>
<view class="sd-line">
@ -65,6 +79,7 @@
<view class="sol-fixed-bar">
<view hover-class="hover-active" @click="toSiteManage">新增占用</view>
</view>
</view>
</template>
@ -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='', // // 012 -> ,使,使
}){
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;
}
}
}
</style>

BIN
src/static/images/icon/occupy_filter.png

After

Width: 56  |  Height: 48  |  Size: 419 B

2
src/store/index.js

@ -10,7 +10,7 @@ export default new Vuex.Store({
device
},
state: {
// #ifdef MP-WEIXIN
// #ifdef H5
APPID: uni.getAccountInfoSync().miniProgram.appId,
// #endif
brandInfo: {

4
src/subpackage/device/pages/coffee_test/coffee_test.vue

@ -84,7 +84,7 @@ export default {
let { curTestInfo, temperatureType, curStoreInfo } = this;
util.showLoad();
let deviceInfo = await deviceServer.get({
url: deviceApi.hardwareInfo + curTestInfo.outlet,
url: deviceApi.hardwareInfo + curTestInfo.stadium_hardware_id,
data: {},
failMsg: '获取设备信息失败!'
})
@ -105,7 +105,7 @@ export default {
data: {
"name": "coffeebox-tcp",
"value": {
"id": deviceInfo.hardware_id + '',
"id": curTestInfo.outlet + '',
"tcp": deviceInfo.hardware_net_addr + '',
"t": temperatureType + '',
}

2
src/subpackage/device/pages/locker_manage/locker_manage.vue

@ -165,7 +165,7 @@ export default {
let _tipStr = '';
_selledList.forEach((ele,idx)=>{
_tipStr += _selledList.length-1>idx?`${ele.id}号柜`:`${ele.id}号柜`;
_tipStr += _selledList.length-1>idx?`${ele.cabinet_name}`:`${ele.cabinet_name}`;
})
_tipStr+= `商品已被售`

Loading…
Cancel
Save