Commit 6d13495c by 陈浩建

分销员PC端二维码

parent d6e8348e
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
<a-tabs name="tab" ref="tabs" @tabClick="handleTabClick"> <a-tabs name="tab" ref="tabs" @tabClick="handleTabClick">
<a-tab-pane :key="item" :name="item" v-for="item in fxyList"> <a-tab-pane :key="item" :name="item" v-for="item in fxyList">
<span slot="tab">{{ modifyFormFXY.name+item }}</span> <span slot="tab">{{ modifyFormFXY.name+item }}</span>
<div id="qrcodeImg"></div> <div :id="qrcode + item" ref="qrcode"></div>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-modal> </a-modal>
...@@ -333,6 +333,7 @@ ...@@ -333,6 +333,7 @@
STable, STable,
treeList, treeList,
treecheck, treecheck,
QRCode,
}, },
data: function () { data: function () {
return { return {
...@@ -399,6 +400,8 @@ ...@@ -399,6 +400,8 @@
fxs:"", fxs:"",
}, },
fxyList:[], fxyList:[],
qrcode:"qrcode",
qrcodeLink:"https://dx.dianyuanjiangli.com/mobile/#/hhr/home?id=",
autoCompleteResult:[], autoCompleteResult:[],
subNameList: [], subNameList: [],
substList: [], substList: [],
...@@ -714,6 +717,33 @@ ...@@ -714,6 +717,33 @@
} }
}) })
}, },
// TODO 生成二维码
qrcodeImg(qWidth, qHeight, qText, id) {
let qrcode = new QRCode(id, {
width: qWidth,
height: qHeight,
text: qText,
});
},
newQrcodeImg(data){
let link = this.qrcodeLink + this.modifyFormFXY.id + "&sell=" + data;
let id = this.qrcode + data;
let that = this;
that.$nextTick(function() {
setTimeout(() => {
that.qrcodeImg(124, 124, link,id);
});
});
},
removeInnerHTML(){
let qrcodeLen = this.$refs.qrcode.length
if(qrcodeLen>0){
let i=0;
for (i=0;i<qrcodeLen;i++){
this.$refs.qrcode[i].innerHTML = "";
}
}
},
// TODO 调整分销员 // TODO 调整分销员
modifyFXY(data) { modifyFXY(data) {
this.titleName = "分销员配置"; this.titleName = "分销员配置";
...@@ -721,18 +751,23 @@ ...@@ -721,18 +751,23 @@
this.modifyFormFXY.name = data.name; this.modifyFormFXY.name = data.name;
this.modifyFormFXY.fxs = data.fxs this.modifyFormFXY.fxs = data.fxs
this.fxyList = data.fxs==""?[]:data.fxs.split(","); this.fxyList = data.fxs==""?[]:data.fxs.split(",");
if(this.fxyList.length != ""){
this.newQrcodeImg(this.fxyList[0]);
}
this.modifyvisibleFXY = true; this.modifyvisibleFXY = true;
}, },
handleTabsAdd(){ handleTabsAdd(){
this.fxyList.length
if(this.fxyList.length>=5){ if(this.fxyList.length>=5){
this.$message.info("分销商不得超过5个",2); this.$message.info("分销商不得超过5个",2);
return; return;
} }
let i=1; let i=1;
for (i=1;i<=5;i++){ for (i=1;i<=5;i++){
if(this.fxyList.indexOf(i) == -1){ let srt = this.fxyList.toString();
if(srt.indexOf(i.toString()) == -1){
this.fxyList.push(i); this.fxyList.push(i);
this.removeInnerHTML();
this.newQrcodeImg(i);
break; break;
} }
} }
...@@ -741,7 +776,10 @@ ...@@ -741,7 +776,10 @@
}, },
handleTabClick(name){ handleTabClick(name){
this.$refs.tabs.activeKey = name; this.$refs.tabs.activeKey = name;
this.removeInnerHTML();
this.newQrcodeImg(name);
}, },
handleTabRemove(){ handleTabRemove(){
let index = this.fxyList.indexOf(this.$refs.tabs.activeKey); let index = this.fxyList.indexOf(this.$refs.tabs.activeKey);
this.fxyList.splice(index,1); this.fxyList.splice(index,1);
...@@ -758,8 +796,10 @@ ...@@ -758,8 +796,10 @@
createFXYOk(){ createFXYOk(){
this.modifyvisibleFXY = false; this.modifyvisibleFXY = false;
this.search(); this.search();
this.removeInnerHTML();
}, },
createCancel(){ createCancel(){
this.removeInnerHTML();
this.addUser=false; this.addUser=false;
this.addFormtable.setFieldsValue({ this.addFormtable.setFieldsValue({
account: '', account: '',
......
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