From e9a6377e2641b9ec951182c1f8a19e604213a1b4 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Wed, 22 May 2024 23:13:57 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0s=5Ftoken?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/gather/gather.vue | 6 ++---
pages/index/index.vue | 5 ++---
pages/order_addcart/order_addcart.vue | 20 +++++++++--------
pages/quote/bindAccout.vue | 32 +++++++++++++--------------
pages/quote/financialyDeatil.vue | 5 +++++
pages/quote/supplierFinancialy.vue | 9 +++++---
pages/user/index.vue | 6 ++---
pages/whole_sale/index.vue | 5 ++---
store/modules/app.js | 3 +++
9 files changed, 48 insertions(+), 43 deletions(-)
diff --git a/pages/gather/gather.vue b/pages/gather/gather.vue
index 6006d5e..154737d 100644
--- a/pages/gather/gather.vue
+++ b/pages/gather/gather.vue
@@ -396,12 +396,10 @@
/*供应商tabbar,token,引导页相关*/
isSupplierFn() {
if (!this.isLogin || uni.getStorageSync('LOGIN_STATUS_STOKEN')) return;
- getSTokenApi({
- jg_register_id: uni.getStorageSync('jg_id') || ''
- }).then(res => {
+ getSTokenApi().then(res => {
if (res.data?.token) {
uni.setStorageSync('LOGIN_STATUS_STOKEN', (res.data?.token || ''))
- console.log("获取了token")
+ this.$store.commit('SET_STOKEN', res.data?.token);
}
}).catch(err => {
console.log("获取报错", err)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 52af8c7..8db1a6c 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -701,11 +701,10 @@
/*供应商tabbar,token,引导页相关*/
isSupplierFn() {
if (!this.isLogin || uni.getStorageSync('LOGIN_STATUS_STOKEN')) return;
- getSTokenApi({
- jg_register_id: uni.getStorageSync('jg_id') || ''
- }).then(res => {
+ getSTokenApi().then(res => {
if (res.data?.token) {
uni.setStorageSync('LOGIN_STATUS_STOKEN', (res.data?.token || ''))
+ this.$store.commit('SET_STOKEN', res.data?.token);
}
}).catch(err => {
console.log("获取报错", err)
diff --git a/pages/order_addcart/order_addcart.vue b/pages/order_addcart/order_addcart.vue
index aa55ffa..9e57c79 100644
--- a/pages/order_addcart/order_addcart.vue
+++ b/pages/order_addcart/order_addcart.vue
@@ -365,12 +365,10 @@
/*供应商tabbar,token,引导页相关*/
isSupplierFn() {
if (!this.isLogin || uni.getStorageSync('LOGIN_STATUS_STOKEN')) return;
- getSTokenApi({
- jg_register_id: uni.getStorageSync('jg_id') || ''
- }).then(res => {
+ getSTokenApi().then(res => {
if (res.data?.token) {
uni.setStorageSync('LOGIN_STATUS_STOKEN', (res.data?.token || ''))
- console.log("获取了token")
+ this.$store.commit('SET_STOKEN', res.data?.token);
}
}).catch(err => {
console.log("获取报错", err)
@@ -403,7 +401,8 @@
let that = this;
getUserInfo().then(res => {
that.userInfo = res.data;
- if (res.data.mer_info.mer_settlement_agree_status && this.tabsArr.length == 1) this.tabsArr
+ if (res.data.mer_info.mer_settlement_agree_status && this.tabsArr.length == 1) this
+ .tabsArr
.push({
name: '商户购物车',
val: 2
@@ -531,7 +530,8 @@
if (res.data.attr.length == 0) return Toast('此商品为单规格商品');
const sku = {};
res.data.attrValue.forEach((itemn) => {
- if (this.tabsCurr == 2) itemn.price = itemn.wholesale_price; //把价格设置为批发价
+ if (this.tabsCurr == 2) itemn.price = itemn
+ .wholesale_price; //把价格设置为批发价
sku[itemn.sku] = itemn;
})
goods.attr = res.data.attr;
@@ -661,8 +661,9 @@
}
},
attrVal(val) {
- this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val
- .indexn]);
+ this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw]
+ .attr_values[val
+ .indexn]);
},
/**
* 属性变动赋值
@@ -885,7 +886,8 @@
// 总金额 //总数
el.list.forEach(e => {
if (e.check) {
- totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e.productAttr
+ totalMoney = this.$util.$h.Add(totalMoney, this.$util.$h.Mul(e
+ .productAttr
.price, e.cart_num))
totalNum += e.cart_num
}
diff --git a/pages/quote/bindAccout.vue b/pages/quote/bindAccout.vue
index 9a0dade..aa70000 100644
--- a/pages/quote/bindAccout.vue
+++ b/pages/quote/bindAccout.vue
@@ -5,7 +5,7 @@
提现至
- {{form.is_own?'对公账户':'个人账户'}}
+ {{form.is_own?'对公账户':'个人账户'}} {{form.is_own}}
账户类型
@@ -93,22 +93,10 @@
"is_own": 0,
phone: '',
"id_card": "",
- // "mer_id": userStore?.userInfo?.merchant?.mer_id,
- // supplier_id: userStore?.userInfo?.supplier?.id,
user_type: '2'
},
- // form: {
- // "is_own": 0,
- // "bank_name": "中国银行",
- // "bank_id": 1,
- // "name": "赵明军",
- // "bank_code": "6213362109985515778",
- // "bank_branch": "牛马谈支行",
- // "id_card": "513701200012105613",
- // "phone": "19130550023",
- // user_type: '2'
- // },
+
showPop: false,
bankList: [],
hasBindAccount: [],
@@ -127,10 +115,15 @@
this.form = res.data.bank_list[0] || {}
},
getFormData(form, target) {
+ console.log(target)
if (!target) {
- form.value = {}
+ for (let key in form) {
+ form[key] = ''
+ }
+ console.log('return', form)
return
}
+ console.log('除了来了')
form.name = target.name || ''
form.bank_id = target.bank_id || ''
form.bank_name = target.bank_name || ''
@@ -141,7 +134,8 @@
form.is_own = target.is_own
},
choseAccount(type) {
- this.getFormData(this.form, this.hasBindAccount[type])
+ let index = this.hasBindAccount.findIndex(item => item.is_own == type)
+ this.form = this.hasBindAccount[index] || {}
this.form.is_own = type
this.showPop1 = false
},
@@ -158,7 +152,7 @@
},
async submit() {
await Modal('温馨提示', "确定信息无误,提交绑定")
- this.form.is_own = this.form.is_own || 1
+ this.form.is_own === 1 ? '' : this.form.is_own = 0
await bindCradApi({
...this.form
})
@@ -173,6 +167,10 @@
uni.showTabBar()
this.getHasBindBankList()
this.getBankList()
+ },
+ onPullDownRefresh() {
+ this.getHasBindBankList()
+ uni.stopPullDownRefresh()
}
}
diff --git a/pages/quote/financialyDeatil.vue b/pages/quote/financialyDeatil.vue
index ffcb98a..61c80d3 100644
--- a/pages/quote/financialyDeatil.vue
+++ b/pages/quote/financialyDeatil.vue
@@ -320,6 +320,11 @@
uni.showTabBar()
this.getList()
this.getAmount()
+ },
+ onPullDownRefresh() {
+ this.getList()
+ this.getAmount()
+ uni.stopPullDownRefresh()
}
}
diff --git a/pages/quote/supplierFinancialy.vue b/pages/quote/supplierFinancialy.vue
index 8198ab1..5b6c1f9 100644
--- a/pages/quote/supplierFinancialy.vue
+++ b/pages/quote/supplierFinancialy.vue
@@ -99,13 +99,12 @@
})
},
choseAccount(type) {
- this.target_bank = this.hasBindAccount[type] || {}
+ let index = this.hasBindAccount.findIndex(item => item.is_own == type)
+ this.target_bank = this.hasBindAccount[index] || {}
this.target_bank.is_own = type
this.showPop1 = false
},
async getHasBindBankList() {
- // this.target_bank = this.hasBindAccount[0]
- // return
let res = await amountAccountApi({})
this.balance = res.data.balance
this.hasBindAccount = res.data.bank_list
@@ -133,6 +132,10 @@
uni.showTabBar()
this.getHasBindBankList()
+ },
+ onPullDownRefresh() {
+ this.getHasBindBankList()
+ uni.stopPullDownRefresh()
}
}
diff --git a/pages/user/index.vue b/pages/user/index.vue
index dd2a05d..f69dac7 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -533,12 +533,10 @@
/*供应商tabbar,token,引导页相关*/
isSupplierFn() {
if (!this.isLogin || uni.getStorageSync('LOGIN_STATUS_STOKEN')) return;
- getSTokenApi({
- jg_register_id: uni.getStorageSync('jg_id') || ''
- }).then(res => {
+ getSTokenApi().then(res => {
if (res.data?.token) {
uni.setStorageSync('LOGIN_STATUS_STOKEN', (res.data?.token || ''))
- console.log("获取了token")
+ this.$store.commit('SET_STOKEN', res.data?.token);
}
}).catch(err => {
console.log("获取报错", err)
diff --git a/pages/whole_sale/index.vue b/pages/whole_sale/index.vue
index a1a50c1..98400ae 100644
--- a/pages/whole_sale/index.vue
+++ b/pages/whole_sale/index.vue
@@ -389,11 +389,10 @@
/*供应商tabbar,token,引导页相关*/
isSupplierFn() {
if (!this.isLogin || uni.getStorageSync('LOGIN_STATUS_STOKEN')) return;
- getSTokenApi({
- jg_register_id: uni.getStorageSync('jg_id') || ''
- }).then(res => {
+ getSTokenApi().then(res => {
if (res.data?.token) {
uni.setStorageSync('LOGIN_STATUS_STOKEN', (res.data?.token || ''))
+ this.$store.commit('SET_STOKEN', res.data?.token);
}
}).catch(err => {
console.log("获取报错", err)
diff --git a/store/modules/app.js b/store/modules/app.js
index fdfe7c2..0fe86fd 100644
--- a/store/modules/app.js
+++ b/store/modules/app.js
@@ -54,6 +54,9 @@ const mutations = {
Cache.set(LOGIN_STATUS, opt.token, opt.time);
uni.removeStorageSync('auth_token');
},
+ SET_STOKEN(state, s_token) {
+ state.s_token = s_token
+ },
SET_USERINFO(state, opt) {
state.userInfo = opt;
Cache.set(USER_INFO, opt);