Commit d2d7bf90 by 黄冷

update: dist

parent 71fb80a2
import clipboard from './clipboard';
import upload from './upload';
import imglibupload from './img-lib.js';
import loadmore from './loadMore';
export default {
clipboard,
upload,
imglibupload
imglibupload,
loadmore
};
/**
* v-loadmore el-select加载更多
*/
// import Vue from 'vue';
export default {
bind(el, binding, vnode, oldVnode) {
const SELECTDOWN_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
SELECTDOWN_DOM.addEventListener('scroll', function() {
const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight;
console.log(this.scrollHeight, this.scrollTop, this.clientHeight);
if (CONDITION) {
binding.value();
}
});
}
};
......@@ -151,6 +151,11 @@ export default {
gicCouponType: '', // gic定义的卡券类型(0:普通卡券, 1:e待洗, 2:好办卡券, 3:微盟外部券, 4:通用外部券
creatorId: '',
uuid: '',
currentPage: 1,
pageSize: 50,
wmPid: '',
idx: '',
totalPage: 0,
canEdit: false,
loading: false,
submitLoading: false,
......@@ -269,6 +274,19 @@ export default {
statusText: ''
};
},
// directives: {
// loadmore: {
// inserted(el, binding) {
// const SELECTDOWN_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
// SELECTDOWN_DOM.addEventListener('scroll', function() {
// const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight;
// if (CONDITION) {
// binding.value();
// }
// });
// }
// }
// },
watch: {
'form.giveFlag'(val) {
if (val) {
......@@ -1332,18 +1350,48 @@ export default {
handleShopChange(wmPid, idx) {
this.weimobDemoCodeList[idx].cardList = [];
this.weimobDemoCodeList[idx].card = '';
this.weimobDemoCodeList[idx].loading = true;
listEntepriseWeimobCoupon({ wmPid })
.then(res => {
this.weimobDemoCodeList[idx].cardList = res.result || [];
this.weimobDemoCodeList[idx].loading = false;
if (this.weimobDemoCodeList[idx].cardList.length === 0) {
this.$message({ message: '该店铺没有对应微盟券号', type: 'warning' });
}
})
.catch(() => {
this.weimobDemoCodeList[idx].loading = false;
});
this.wmPid=wmPid;
this.idx=idx;
this.weimobDemoCodeList[this.idx].loading = true;
this.listEntepriseWeimobCoupon();
},
listEntepriseWeimobCoupon(search){
listEntepriseWeimobCoupon({ search,wmPid:this.wmPid,pageSize:this.pageSize, currentPage:this.currentPage})
.then(res => {
console.log(res.result)
const {result,totalPage,currentPage} = res.result;
this.totalPage=totalPage;
this.currentPage=currentPage;
this.weimobDemoCodeList[this.idx].cardList =this.weimobDemoCodeList[this.idx].cardList.concat(result || []) ;
this.weimobDemoCodeList[this.idx].loading = false;
if (this.weimobDemoCodeList[this.idx].cardList.length === 0) {
this.$message({ message: '该店铺没有对应微盟券号', type: 'warning' });
}
})
.finally(() => {
this.weimobDemoCodeList[this.idx].loading = false;
});
},
remoteMethod(val){
console.log(val);
this.currentPage=1;
this.weimobDemoCodeList[this.idx].cardList = [];
this.weimobDemoCodeList[this.idx].loading = true;
this.listEntepriseWeimobCoupon(val);
},
handleClear(){
this.currentPage=1;
this.weimobDemoCodeList[this.idx].cardList = [];
this.weimobDemoCodeList[this.idx].loading = true;
this.listEntepriseWeimobCoupon();
},
getMore(){
if(this.currentPage<this.totalPage){
this.currentPage++
this.listEntepriseWeimobCoupon();
}
},
// ---------微盟店铺结束--------
// ------微盟适用商品开始-------
......
......@@ -55,7 +55,7 @@
<el-select class="w200" :disabled="saveItem.save || isEdit || isInfo" v-model="saveItem.pid" filterable placeholder="请选择店铺" clearable @change="handleShopChange($event, idx)">
<el-option :disabled="wmShopIds.includes(item.wmPid)" v-for="item in weimobShopList" :key="item.wmPid" :label="item.wmPidName" :value="item.wmPid"></el-option>
</el-select>
<el-select :disabled="!saveItem.pid || saveItem.save || isEdit || isInfo" :loading="saveItem.loading" class="w200" v-model="saveItem.card" filterable placeholder="请选择微盟卡券" clearable>
<el-select v-loadmore="getMore" :disabled="!saveItem.pid || saveItem.save || isEdit || isInfo" :loading="saveItem.loading" class="w200" v-model="saveItem.card" remote filterable placeholder="请选择微盟卡券" :remote-method="remoteMethod" @clear="handleClear" clearable>
<el-option v-for="item in saveItem.cardList" :key="item.cardTemplateId" :label="item.name" :value="item.cardTemplateId"></el-option>
</el-select>
<template v-if="isAdd || isCopy">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment