From e3898caa56109a29f94e4dabc7db421a5bd4b730 Mon Sep 17 00:00:00 2001 From: xuxy <1059738716@qq.com> Date: 星期一, 15 七月 2024 00:14:27 +0800 Subject: [PATCH] update fix bug --- sub_pages/supplier/order-records/order-records.vue | 2 pages/login/supplier-login.vue | 14 ++++-- sub_pages/supplier/supplier-info/supplier-info.vue | 3 + environments/index.js | 4 +- sub_pages/supplier/flower-manage/flower-add.vue | 2 sub_pages/supplier/supplier-reg/supplier-reg.vue | 12 ++++-- pages/home/supplier-home.vue | 2 sub_pages/supplier/flower-manage/flower-manage.vue | 21 +++++++--- plugins/http.js | 15 ++++--- store/index.js | 14 ++++--- 10 files changed, 54 insertions(+), 35 deletions(-) diff --git a/environments/index.js b/environments/index.js index 4d26ee2..def5df2 100644 --- a/environments/index.js +++ b/environments/index.js @@ -1,7 +1,7 @@ export default { - // httpBaseUri: 'https://www.hmyxianhua.com/flower', - httpBaseUri: 'http://47.99.58.211/flower', + httpBaseUri: 'https://www.hmyxianhua.com/flower', + // httpBaseUri: 'http://47.99.58.211/flower', clientId: '', secret: '', diff --git a/pages/home/supplier-home.vue b/pages/home/supplier-home.vue index f19e19a..beeab9b 100644 --- a/pages/home/supplier-home.vue +++ b/pages/home/supplier-home.vue @@ -114,7 +114,7 @@ </view> <view class="m-t-12" @click="getNoticeMore"> <uni-notice-bar class="notice-bar" color="#333" background-color="#fff" show-get-more show-icon - :scrollable="scrollable" :text="currentNotice.title||'暂无公共'" :key="currentNotice.id" /> + :scrollable="scrollable" :text="currentNotice.title||'暂无公告'" :key="currentNotice.id" /> <span v-if="!currentNotice||!currentNotice.id"> </span> </view> <view class="item-container"> diff --git a/pages/login/supplier-login.vue b/pages/login/supplier-login.vue index 51b358a..c6b3b1a 100644 --- a/pages/login/supplier-login.vue +++ b/pages/login/supplier-login.vue @@ -135,6 +135,10 @@ icon: "none" }); this.setTimer(); //调用定时器方法 + }else{ + this.getCodeText = "获取验证码" //发送验证码 + this.getCodeisWaiting = false; + this.getCodeBtnColor = "#20613D"; } // setTimeout(() => { // uni.showToast({ @@ -198,7 +202,7 @@ } } if (this.loginType == 'code') { - if (!that.tel) { + if (!that.phoneNumber) { uni.showToast({ title: '请输入手机号', icon: 'none' @@ -242,10 +246,10 @@ // }, 1000); } else { - uni.showToast({ - title: '登录失败!', - icon: 'none' - }); + // uni.showToast({ + // title: '登录失败!', + // icon: 'none' + // }); return; } diff --git a/plugins/http.js b/plugins/http.js index bbbf997..db3b571 100644 --- a/plugins/http.js +++ b/plugins/http.js @@ -64,29 +64,30 @@ msg: '' }) } else { + console.log('res',res.data) if (res.data.code == ('0')) { resolve({ data: res.data.data, code: 0, msg: '' }) - } else if (res.data.code === '3000'||res.data.code === '30000') { + } else if (res.data.code === '3000'||res.data&&res.data.code&&res.data.code.startsWith('3000')) { if (Array.isArray(res.data.data)) { if (res.data.data.length > 0 && res.data.data[0] - .errorMessage) { - message.showToast(res.data.data[0].errorMessage) + .msg) { + message.showToast(res.data.data[0].msg) } - } else if (res.data.data && res.data.data.errorMessage) { - message.showToast(res.data.data.errorMessage) + } else if (res.data && res.data.msg) { + message.showToast(res.data.msg) } else if (res.data.data && typeof res.data.data === 'string') { message.showToast(res.data.data) } reject({ data: null, code: parseInt(res.data.code), - msg: res.data.data + msg: res.data.data || res.data.msg }) - } else if (res.data.code === '4000'||res.data.code === '40000') { + } else if (res.data.code === '4000'||res.data&&res.data.code&&res.data.code.startsWith('4000')) { message.showToast('系统异常') } else { if (res.data.data && typeof res.data.data === 'string') { diff --git a/store/index.js b/store/index.js index edf7a1b..118a8d7 100644 --- a/store/index.js +++ b/store/index.js @@ -35,6 +35,8 @@ // remoteip:'',//服务器ip sign: { 'enterprise': 0, + 'info':0, + 'flower':0, }, defaultaddress: {} }, @@ -279,8 +281,8 @@ state }, data) { { - const resp = await http.request('post', '/api/login/partner' + (data - .phoneNumber ? '/phone' : ''), { + const resp = await http.request('post', '/api/login/partner' + ((data + .phoneNumber||data.tel) ? '/phone' : ''), { data: { username: data.username, password: data.password, @@ -339,10 +341,10 @@ state }, data) { { - const resp = await http.request('post', '/api/login/supplier' + (data - .phoneNumber ? '/phone' : ''), { + const resp = await http.request('post', '/api/login/supplier' + ((data + .phoneNumber ||data.tel) ? '/phone' : ''), { data: { - username: data.username, + username: (data.phoneNumber ||data.tel)?(data.phoneNumber || data.tel): data.username, password: data.password, tel: data.phoneNumber || data.tel, smsCode: data.smsCode || '' @@ -403,7 +405,7 @@ const resp = await http.request('post', '/api/login/customer' + (data .phoneNumber ? '/phone' : ''), { data: { - username: data.username, + username: (data.phoneNumber ||data.tel)?(data.phoneNumber || data.tel): data.username, password: data.password, tel: data.phoneNumber || data.tel, smsCode: data.smsCode || '' diff --git a/sub_pages/supplier/flower-manage/flower-add.vue b/sub_pages/supplier/flower-manage/flower-add.vue index a0d59fa..e9dee4a 100644 --- a/sub_pages/supplier/flower-manage/flower-add.vue +++ b/sub_pages/supplier/flower-manage/flower-add.vue @@ -529,7 +529,7 @@ if (re.code == 2000 || re.code == 0) { this.$message.showToast('操作成功') //需要标记加一下 - // this.$store.dispatch('sign_add', 'application'); + this.$store.dispatch('sign_add', 'flower'); this.backpage() } diff --git a/sub_pages/supplier/flower-manage/flower-manage.vue b/sub_pages/supplier/flower-manage/flower-manage.vue index e6f8311..2138502 100644 --- a/sub_pages/supplier/flower-manage/flower-manage.vue +++ b/sub_pages/supplier/flower-manage/flower-manage.vue @@ -61,10 +61,10 @@ <view class="buttons"> <view class="button" @click.stop="toDetail(item)">编辑</view> - <view class="button" @click.stop="buttonStatus(item,'OFF')" - v-if="item.status=='UP'">下架</view> - <view class="button" @click.stop="buttonStatus(item,'UP')" - v-if="item.status=='OFF'||item.status=='FORCE_OFF'">上架</view> + <view class="button" @click.stop="buttonStatus(item,'off')" + v-if="item.status=='UP'||item.status=='up'">下架</view> + <view class="button" @click.stop="buttonStatus(item,'up')" + v-if="item.status=='OFF'||item.status=='off'||item.status=='FORCE_OFF'">上架</view> <view class="button" @click.stop="openValue(item,'price')">价格</view> <view class="button" @click.stop="openValue(item,'stock')">库存</view> <view class="button" @click.stop="toDetailAdd(item)">复制</view> @@ -127,7 +127,13 @@ inputplaceholder: '', } }, - onLoad(options) { + onShow(){ + if (this.sign['flower']) { + this.$store.dispatch('sign_clear', 'flower'); + this.refreshList() + } + }, + async onLoad(options) { this.type = options.type || 'all' var title = '' //todo 根据type切换查询条件 @@ -160,6 +166,7 @@ title: title }) } + await this.$store.dispatch('sign_clear', 'flower'); this.getList() }, onReachBottom() { @@ -221,7 +228,7 @@ }) }, async buttonStatus(item, status) { - await this.$message.confirm(`确定${status==='OFF'?'下降':'上架'}此商品吗`) + await this.$message.confirm(`确定${status==='off'?'下降':'上架'}此商品吗`) this.$message.showLoading() this.$http.request('get', '/api/supplier/flower/list/' + status, { params: { @@ -231,7 +238,7 @@ if (res.code == 0) { this.$message.showToast('操作成功') item.status = status - item.statusStr = (status == 'OFF' ? '下架' : '上架') + item.statusStr = (status == 'off' ? '下架' : '上架') } }).finally(() => { this.$message.hideLoading() diff --git a/sub_pages/supplier/order-records/order-records.vue b/sub_pages/supplier/order-records/order-records.vue index 0e084ec..9e8b847 100644 --- a/sub_pages/supplier/order-records/order-records.vue +++ b/sub_pages/supplier/order-records/order-records.vue @@ -3,7 +3,7 @@ <view class="tj-container-p"> <view class="tj-container flex"> <view class="tj-each flex1"> - <view class="value">9</view> + <view class="value">0</view> <view class="label">买家</view> </view> <view class="tj-each flex1"> diff --git a/sub_pages/supplier/supplier-info/supplier-info.vue b/sub_pages/supplier/supplier-info/supplier-info.vue index 72cb1c1..5199068 100644 --- a/sub_pages/supplier/supplier-info/supplier-info.vue +++ b/sub_pages/supplier/supplier-info/supplier-info.vue @@ -420,7 +420,7 @@ if (re.code == 2000 || re.code == 0) { this.$message.showToast('操作成功') //需要标记加一下 - this.$store.dispatch('sign_add', 'application'); + this.$store.dispatch('sign_add', 'info'); this.$store.dispatch('getCurrentInfo') this.backpage() @@ -435,6 +435,7 @@ } else { this.dto[key] = '' } + this.$forceUpdate() }, uploadIcon(key) { const that = this diff --git a/sub_pages/supplier/supplier-reg/supplier-reg.vue b/sub_pages/supplier/supplier-reg/supplier-reg.vue index 4773dd7..d327bb7 100644 --- a/sub_pages/supplier/supplier-reg/supplier-reg.vue +++ b/sub_pages/supplier/supplier-reg/supplier-reg.vue @@ -130,6 +130,10 @@ icon: "none" }); this.setTimer(); //调用定时器方法 + }else{ + this.getCodeText = "获取验证码" //发送验证码 + this.getCodeisWaiting = false; + this.getCodeBtnColor = "#20613D"; } // setTimeout(() => { // //弹出提示框 @@ -223,10 +227,10 @@ }, 1000); } else { - uni.showToast({ - title: '登录失败!', - icon: 'none' - }); + // uni.showToast({ + // title: '登录失败!', + // icon: 'none' + // }); return; } -- Gitblit v1.9.3