Browse Source

add people change

organize
刘嘉炜 3 years ago
parent
commit
03d33c89be
  1. 1
      src/js/api.js
  2. 45
      src/pages/write_off/number_of_people/number_of_people.vue

1
src/js/api.js

@ -108,6 +108,7 @@ API['writeOff'] = {
shop2WriteoffGet: `${ORIGIN}/admin/assistant/shop2/writeoffGet`, // 商城订单核销 - 获取订单信息
shop2WriteoffSet: `${ORIGIN}/admin/assistant/shop2/writeoffSet`, // 商城订单核销 - 确认核销
timingNumber: `${ORIGIN}/stadium/person/timing/number`, // 现场人数
setStadiumPresentNumber: `${ORIGIN}/admin/stadium/setStadiumPresentNumber`, // 商家助手散客人数校正
}

45
src/pages/write_off/number_of_people/number_of_people.vue

@ -25,15 +25,15 @@
<image class="nmm-close" @click="isChangeNum = false" src="/static/images/icon/x_close.png"></image>
<view class="nmm-tit">修改现场散客人数</view>
<view class="nmm-info">
<view class="ni-num">当前现场散客人数为69</view>
<view class="ni-num">当前现场散客人数为{{peopleInfo.present_person_number || 0}}</view>
<view class="ni-ipt">
<input placeholder="请输入散客人数" type="number" />
<input placeholder="请输入散客人数" v-model="changeNum" type="number" />
</view>
<view class="ni-tip">修改现场人数可能会影响现场灯光开关请谨慎操作</view>
</view>
<view class="nmm-btns">
<view @click="isChangeNum = false">取消</view>
<view>确认</view>
<view @click="confirmChange">确认</view>
</view>
</view>
</view>
@ -58,7 +58,8 @@ export default {
name: ''
},
peopleInfo: {},
dateStr: '-'
dateStr: '-',
changeNum: '',
}
},
onLoad(options){
@ -70,6 +71,41 @@ export default {
this.clearTime();
},
methods: {
confirmChange: util.debounce(function(){
let { changeNum } = this;
if(isNaN(changeNum))return util.showNone('请输入正确人数!');
this.isChangeNum = false;
this.setStadiumPresentNumber(changeNum);
}, 200, true),
setStadiumPresentNumber(num){
let { curStadium } = this;
util.showLoad();
servers.get({
url: API.writeOff.setStadiumPresentNumber,
data: {
brand_id: curStadium.curStadium,
stadium_id: curStadium.id,
number: +num,
},
isDefaultGet: false,
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setTimeout(_=>{
this.getUserNum({
stadium_id: curStadium.id,
brand_id: curStadium.brand_id
})
this.initInertval();
}, 1200)
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
},
initInertval(){
this.clearTime();
let { curStadium } = this;
@ -86,6 +122,7 @@ export default {
clearInterval(timer);
timer = null;
},
stadiumChange(e){
let { stadiumList } = this;
let _curStadium = stadiumList[e.detail.value] || {};

Loading…
Cancel
Save