diff --git a/components/easy-scancode/easy-scancode.vue b/components/easy-scancode/easy-scancode.vue index 383c4e9..b6a4fe4 100644 --- a/components/easy-scancode/easy-scancode.vue +++ b/components/easy-scancode/easy-scancode.vue @@ -1,6 +1,9 @@ + + 返回 + 请将二维码放入框内 @@ -70,16 +73,19 @@ export default { stop() { this.show = false; let that = this; - this.html5QrCode - .stop() - .then((ignore) => { - // 二维码扫描已停止 - console.log("二维码扫描已停止"); - }) - .catch((err) => { - // 停止失败,处理错误 - console.log("无法停止扫描"); - }); + if(this.html5QrCode){ + this.html5QrCode + .stop() + .then((ignore) => { + // 二维码扫描已停止 + console.log("二维码扫描已停止"); + }) + .catch((err) => { + // 停止失败,处理错误 + console.log("无法停止扫描"); + }); + } + }, getCameras() { let that = this; @@ -155,6 +161,9 @@ export default { }); }, }, + // beforeDestroy() { + // this.stop(); + // } }; diff --git a/components/selCl.vue b/components/selCl.vue index 3b74018..7a8eb23 100644 --- a/components/selCl.vue +++ b/components/selCl.vue @@ -18,16 +18,19 @@ + + {{index+1}} + {{retType(item.departCode,2)}} {{item.workshop}} - + {{item.location}} - + {{item.address}} diff --git a/components/selXP.vue b/components/selXP.vue index 25189ae..8cdd797 100644 --- a/components/selXP.vue +++ b/components/selXP.vue @@ -18,16 +18,19 @@ + + {{index+1}} + {{retType(item.departCode,2)}} {{item.workshop}} - + {{item.location}} - + {{item.address}} @@ -70,10 +73,10 @@ export default { }; }, watch: { - clist(list) { - console.log('监视值的改变1'); - this._initTree(list); - }, + // clist(list) { + // console.log('监视值的改变1'); + // this._initTree(list); + // }, fcur(v) { console.log('监视值的改变2'); this.cur=v; @@ -85,6 +88,7 @@ export default { this.getTypes(); }, methods: { + // tab切换 qhclick(index){ this.cur=index; this.$forceUpdate(); @@ -118,72 +122,63 @@ export default { }); }, _initTree(list){ - this.clistall=list; + if(this.cur==1){ + this.clistall=list; + this.$forceUpdate(); + } + else{ + this.clistall=[]; + this.$forceUpdate(); + var commondata = uni.getStorageSync("commondata"); + var data = JSON.parse(commondata); + if(data){ + if(data.address&&data.address.length>0){ + var user = JSON.parse(uni.getStorageSync("user")); + var bmbm = user.bmbm?user.bmbm:''; // '02' + data.address.forEach(cell=>{ + if(bmbm==cell.departCode){ + this.clistall.push(cell); + this.$forceUpdate(); + } + }); + } + } + else{ + this.clistall=[]; + this.$forceUpdate(); + } + } this.clistnow=[]; this.clistall.forEach((v, i) => { - if(this.cur==2){ - // 全部地址 - var findx = this.clistnow.findIndex(item => item.departCode === v.departCode && item.workshop === v.workshop); - if(findx<0){ - // 新增 - var add={ - id:v.id, - departCode:v.departCode, - workshop:v.workshop - } - if(this.value == v.id){ - add.isChecked = true; - } - else{ - add.isChecked = false; - } - this.clistnow.push(add); - } + // 常用地址 + if(this.value == v.id){ + this.clistall[i].isChecked = true; } else{ - // 常用地址 - if(this.value == v.id){ - this.clistall[i].isChecked = true; - } - else{ - this.clistall[i].isChecked = false; - } - this.clistnow.push(this.clistall[i]); + this.clistall[i].isChecked = false; } + this.clistnow.push(this.clistall[i]); }); - console.log(this.clistnow); this.$forceUpdate(); }, chagne(e){ var rt= null; if(e.detail.value){ - this.clist.forEach(cell=>{ + this.clistnow.forEach(cell=>{ if(cell.id==e.detail.value){ rt=cell; } }); } - if(this.cur==2){ - rt.location=""; - rt.address=""; - } this.$emit("change", rt); this._hide(); }, - _show(id) { + _show() { + console.log("_show"); this.cur=this.fcur; + this.$forceUpdate(); this._initTree(this.clist); this.$refs.share.open(); - this.value=id; - this.clistnow.forEach(cell=>{ - if(this.value == cell.id){ - cell.isChecked=true; - } - else{ - cell.isChecked=false; - } - }); - this.$forceUpdate(); }, _hide() { this.$refs.share.close(); diff --git a/pages.json b/pages.json index b197405..77eb23f 100644 --- a/pages.json +++ b/pages.json @@ -32,7 +32,7 @@ "path": "pages/me/index", "style": { "navigationBarBackgroundColor": "#3690ff", - "navigationBarTitleText": "我的" + "navigationBarTitleText": "我的地址" // "app-plus": { // "titleNView": false // } diff --git a/pages/index/index.vue b/pages/index/index.vue index 1b03d66..031cc53 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -185,10 +185,10 @@ }); this.menus.push({ - name:"我的", + name:"我的地址", key:"my", src:"../../static/image/my.png", - remark:"查看当前用户信息", + remark:"查看常用地址信息", url:"/pages/me/index", opentype:"1", ifshow: true @@ -287,7 +287,7 @@ return false; } - if(item.name=="我的"){ + if(item.name=="我的地址"){ uni.navigateTo({ url: item.url }); diff --git a/pages/me/add.vue b/pages/me/add.vue new file mode 100644 index 0000000..a5af442 --- /dev/null +++ b/pages/me/add.vue @@ -0,0 +1,513 @@ + + + + + 若所在省市无法选择,请在省市区选择其他,在详细地址输入即可 + + + + + + + + + + + + + {{valiFormData.region}} + 选择所在区域 + + + + + + + + + + + + 设置默认地址 + + + + + + + 保存 + + + + + + + + + + + + + diff --git a/pages/me/alist.vue b/pages/me/alist.vue new file mode 100644 index 0000000..aa84eae --- /dev/null +++ b/pages/me/alist.vue @@ -0,0 +1,338 @@ + + + + 收件地址 + + 新增地址 + + + + + + + + + + + {{item.name}} + {{item.phone}} + 默认 + + + {{item.province+item.city+item.district+item.address}} + + + + + + + + + + + + + 添加地址 + + + + + + + + diff --git a/pages/me/index.vue b/pages/me/index.vue index 453d252..d2d6358 100644 --- a/pages/me/index.vue +++ b/pages/me/index.vue @@ -4,87 +4,131 @@ - - - - - + + + {{loginName}}—{{deptName}} {{lxdh?'—'+lxdh:''}} - + + + - {{loginName}} — {{deptName}} - 登录时间:{{actual}} + {{psdz}} - - - - - - 关于 - 版本号 {{VersionIn}} - - - + + + 常用地址 + + 添加地址 + + + + 暂无常用地址,请添加~~ + + + + + + + {{item.userName}}({{item.userCode}}) + {{ item.departCode?retType(item.departCode,1):''}} + + + {{item.workshop+item.location+item.address}} + + + + + + + + + + - - + + + + + + + + + 添加选中地址 + 关闭 + + + + + + + + + + + + {{index+1}} + + + {{retType(item.departCode,1)}} + + + {{item.workshop}} + + + {{item.location}} + + + {{item.address}} + + + + + + + + + + + + - diff --git a/pages/pallet/js.vue b/pages/pallet/js.vue index 628e334..576d2f8 100644 --- a/pages/pallet/js.vue +++ b/pages/pallet/js.vue @@ -11,8 +11,21 @@ - + + + + + *存放地址 + + + {{retType(itemList.departCode,2)}}{{itemList.workshop}}{{itemList.location}}{{itemList.address}} + 请选择 + + + + + 备注 @@ -100,6 +113,9 @@ + + + @@ -108,6 +124,8 @@
{{loginName}}—{{deptName}} {{lxdh?'—'+lxdh:''}}
{{loginName}} — {{deptName}}
登录时间:{{actual}}
{{psdz}}