Browse Source

fix & del

voice
刘嘉炜 4 years ago
parent
commit
4fbae9b409
  1. 24
      src/subpackage/device/pages/coffee_manage/coffee_manage.vue
  2. 4
      src/subpackage/device/pages/device_manage/device_manage.vue
  3. 1
      src/subpackage/device/pages/index/index.vue
  4. 16
      src/subpackage/device/pages/switch_manage/switch_manage.vue

24
src/subpackage/device/pages/coffee_manage/coffee_manage.vue

@ -8,7 +8,12 @@
<view class="cc-name">{{e.name || '-'}}</view>
<view class="cc-num">
<view hover-class="hover-active" @click="reduceStock(i)">-</view>
<input :class="[e.stock<=e.limit?'active':'']" :value="e.stock" disabled />
<input
@change="stockInputChange($event,i)"
:class="[e.stock<=e.limit?'active':'']"
:value="e.stock"
type="number"
/>
<view hover-class="hover-active" class="active" @click="addStock(i)">+</view>
</view>
<view class="cc-price"><text>¥</text>{{e.price || 0}}</view>
@ -17,11 +22,12 @@
</view>
<view class="cm-tip">Tips:一包标准粉如若大概能冲40杯左右建议一包填38杯库存</view>
<view class="cm-fixed-bar">
<view class="cfb-select-all" @click="isFillAll = !isFillAll">
<!-- PM: 删掉, 没有上限-->
<!-- <view class="cfb-select-all" @click="isFillAll = !isFillAll">
<image v-if="isFillAll" class="active" mode="aspectFit" src="/subpackage/device/static/images/selected_987.png"></image>
<image v-else></image>
<text>全部饮品补满</text>
</view>
</view> -->
<view class="cfb-confirm" hover-class="hover-active" @click="confirmSave">确认补粉</view>
</view>
</view>
@ -50,8 +56,14 @@ export default {
this.coffeeList(_query.id);
},
methods:{
stockInputChange(e,i){
let _typeList = this.typeList.slice();
_typeList[i].stock = e.detail.value;
this.typeList = _typeList;
},
confirmSave: util.debounce(function(){
let { typeList, isFillAll } = this;
if(!typeList.length)return;
util.showModal({
title: '是否确认补粉?',
content: isFillAll?'请确认全部补满':'',
@ -59,7 +71,7 @@ export default {
success: res=>{
if(res.confirm){
this.confirmReq(
typeList.map(e=>({id: e.id, stock: isFillAll? e.depth || 38 : e.stock}))
typeList.map(e=>({id: e.id, stock: isFillAll? e.depth : e.stock}))
);
}
}
@ -92,7 +104,7 @@ export default {
},
addStock(index){
let _typeList = this.typeList.slice();
_typeList[index].stock++;
_typeList[index].stock++
this.typeList = _typeList;
},
coffeeList(hardware_id){
@ -205,7 +217,7 @@ export default {
padding-bottom: calc( 10upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
padding-top: 10upx;
background-color: #fff;
@include centerFlex(space-between);
@include centerFlex(flex-end);
.cfb-select-all{
font-size: 28upx;
line-height: 40upx;

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

@ -162,12 +162,12 @@ export default {
}
}else if(util.changeLowerCase(hardware_type) === 'vendingmachine'){
//
_query = [{
_query = {
"name": "yunyin-mac",
"value": {
"tcp": hardware_net_addr + '',
}
}]
}
}else{
util.showNone(`config error -> type:${hardware_type || '-'} / connect method:${hardware_connect_method || '-'}`)
return 'configError';

1
src/subpackage/device/pages/index/index.vue

@ -69,6 +69,7 @@ export default {
e.id == 3 || //
e.id == 4 || //
e.id == 5 ||  //
// e.id == 6 ||  //
e.id == 8 ||  //
e.id == 9 ||  //
e.id == 10 ||  //

16
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -272,7 +272,7 @@ export default {
const _query = {
name: this.getQueryName(switchInfo),
name: this.getStatusQueryName(switchInfo),
value: { id: hardware_id + '', } // value String
};
@ -354,7 +354,19 @@ export default {
return [ 'off', 'on' ][status] || ''
},
// name
// name
getStatusQueryName(switchInfo){
let { hardware_connect_method } = switchInfo;
let _obj = {
'Gpio': 'get-rpio', //
'SerialPort485': 'zzio404d-gpio-status',
'Tcp': 'zzio404d-gpio-status-tcp',
};
return _obj[hardware_connect_method] || ''
},
// name
getQueryName(switchInfo){
let { hardware_connect_method } = switchInfo;
let _obj = {

Loading…
Cancel
Save