Browse Source

isVip

devlop
邓雄飞 4 years ago
parent
commit
cec1afde7f
3 changed files with 13 additions and 3 deletions
  1. 11
      apis/commonApi.js
  2. 2
      pages/mine/index.vue
  3. 3
      store/index.js

11
apis/commonApi.js

@ -28,11 +28,20 @@ let baseInfo = null
function syncStore(res) {
if (res.enterpriseList && res.enterpriseList.length > 0) {
let supplierInfo = res.enterpriseList[0]
let vipExpireTime = supplierInfo.supplier.vipExpireTime
let isVip = false
if (vipExpireTime) {
let now = new Date().getTime()
if (now < new Date(vipExpireTime).getTime()) {
isVip = true
}
}
store.commit('setSupplierInfo', {
id: supplierInfo.id,
name: supplierInfo.name,
fddEnterpriseStatus: supplierInfo.fddEnterpriseStatus,
supplierId: supplierInfo.supplier.id
supplierId: supplierInfo.supplier.id,
isVip
})
store.commit('setUserInfo', { name: supplierInfo.employeeName, userId: res.userId, mobile: res.mobile, avatar: null })
}

2
pages/mine/index.vue

@ -275,7 +275,7 @@ export default {
onShow() {
getBaseInfo({}, true).then((res) => {
if (res) {
this.companyNum = res.enterpriseList.length
this.companyNum = res.enterpriseList?.length || 1
}
})
},

3
store/index.js

@ -15,11 +15,12 @@ let qnToken = null,
* @value supplierId 供应商id
* @value name 企业名称
* @value fddEnterpriseStatus 法大大认证状态 1未认证2认证进行中3认证成功4认证失败
* @value isVip 是否是vip企业
*/
supplierInfo = null,
uecToken = null,
searchHistory = null
const supplierInfoParams = ['id', 'name', 'fddEnterpriseStatus', 'supplierId']
const supplierInfoParams = ['id', 'name', 'fddEnterpriseStatus', 'supplierId', 'isVip']
const userInfoParams = ['name', 'userId', 'mobile', 'avatar']
try {
uecToken = uni.getStorageSync('uecToken')

Loading…
Cancel
Save