forked from angelo/web-retail-h5
Compare commits
No commits in common. "a3be6a17f9d54f253d6f6c9e9fac966b4867bf3e" and "97da0dd93ea0ed2db7fe9d7172ed326ab97ca31e" have entirely different histories.
a3be6a17f9
...
97da0dd93e
|
|
@ -103,17 +103,14 @@ export default {
|
||||||
...mapGetters(['isZeroLevel']),
|
...mapGetters(['isZeroLevel']),
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const userInfo = Object.keys(this.userInfo).length
|
const userInfo = uni.getStorageSync('userInfo') || this.userInfo
|
||||||
? this.userInfo
|
|
||||||
: uni.getStorageSync('userInfo')
|
|
||||||
if (userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL) {
|
if (userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL) {
|
||||||
this.upgrade.name = '会员专区'
|
this.upgrade.name = '会员专区'
|
||||||
} else {
|
|
||||||
this.getAreaListById(REISSUE_AREA.id, this.rescissionList)
|
|
||||||
this.getAreaListById(REGIEST_AREA.id, this.registList)
|
|
||||||
this.getAreaListById(REPURCHASE_AREA.id, this.repurchaseList)
|
|
||||||
}
|
}
|
||||||
this.getAreaListById(UPGRADE_AREA.id, this.upgradeList)
|
this.getAreaListById(UPGRADE_AREA.id, this.upgradeList)
|
||||||
|
this.getAreaListById(REISSUE_AREA.id, this.rescissionList)
|
||||||
|
this.getAreaListById(REGIEST_AREA.id, this.registList)
|
||||||
|
this.getAreaListById(REPURCHASE_AREA.id, this.repurchaseList)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAreaListById(areaId, list) {
|
getAreaListById(areaId, list) {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@ module.exports = vm => {
|
||||||
// duration: 1500,
|
// duration: 1500,
|
||||||
// })
|
// })
|
||||||
removeToken()
|
removeToken()
|
||||||
uni.removeStorageSync('User')
|
|
||||||
// 跳转到登录
|
// 跳转到登录
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="specialAreaVisble" style="padding-bottom: 140rpx">
|
<view style="padding-bottom: 140rpx">
|
||||||
<special-area-wrapper :userInfo="userInfo" size="small" />
|
<special-area-wrapper :userInfo="userInfo" size="small" />
|
||||||
</view>
|
</view>
|
||||||
<cl-tabbar :current="0"></cl-tabbar>
|
<cl-tabbar :current="0"></cl-tabbar>
|
||||||
|
|
@ -77,6 +77,7 @@
|
||||||
import * as api from '@/config/login.js'
|
import * as api from '@/config/login.js'
|
||||||
import * as apis from '@/config/index.js'
|
import * as apis from '@/config/index.js'
|
||||||
import * as ban from '@/config/balance.js'
|
import * as ban from '@/config/balance.js'
|
||||||
|
import { getAreaGoods } from '@/config/special-area'
|
||||||
import clTabbar from '@/components/cl-tabbar.vue'
|
import clTabbar from '@/components/cl-tabbar.vue'
|
||||||
import noticePopup from '@/components/noticePopup.vue'
|
import noticePopup from '@/components/noticePopup.vue'
|
||||||
import znNewsPopup from '@/components/znNewsPopup.vue'
|
import znNewsPopup from '@/components/znNewsPopup.vue'
|
||||||
|
|
@ -127,9 +128,6 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['priceSymbol', 'priceSymbolVisible', 'isZeroLevel']),
|
...mapGetters(['priceSymbol', 'priceSymbolVisible', 'isZeroLevel']),
|
||||||
specialAreaVisble() {
|
|
||||||
return this.userInfo && Object.keys(this.userInfo).length
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// this.getLanguage();
|
// this.getLanguage();
|
||||||
|
|
@ -138,7 +136,24 @@ export default {
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$store.dispatch('getCarLength')
|
this.$store.dispatch('getCarLength')
|
||||||
this.getBanners()
|
this.getBanners()
|
||||||
|
if (
|
||||||
|
uni.getStorageSync('showInfo') == undefined ||
|
||||||
|
uni.getStorageSync('showInfo') == 0
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
this.getAreaGoods(
|
||||||
|
this.userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL
|
||||||
|
? REPURCHASE_AREA.id
|
||||||
|
: REGIEST_AREA.id
|
||||||
|
)
|
||||||
},
|
},
|
||||||
|
// onPullDownRefresh() {
|
||||||
|
// let that = this
|
||||||
|
// setTimeout(() => {
|
||||||
|
// that.getGoodsInfo()
|
||||||
|
// uni.stopPullDownRefresh() //停止刷新
|
||||||
|
// }, 1000)
|
||||||
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
formatCurrency,
|
formatCurrency,
|
||||||
formatSales(value) {
|
formatSales(value) {
|
||||||
|
|
@ -179,6 +194,17 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getAreaGoods(areaId) {
|
||||||
|
getAreaGoods({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 3,
|
||||||
|
specialArea: areaId,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.goodsList = res.data || []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
confirmHandle() {
|
confirmHandle() {
|
||||||
this.promptFlag = false
|
this.promptFlag = false
|
||||||
if (this.jumpPage == 1) {
|
if (this.jumpPage == 1) {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<special-area-wrapper v-if="specialAreaVisble" :userInfo="userInfo" />
|
<special-area-wrapper :userInfo="userInfo" />
|
||||||
|
|
||||||
<cl-tabbar :current="1"></cl-tabbar>
|
<cl-tabbar :current="1"></cl-tabbar>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -23,19 +23,11 @@ export default {
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userInfo: null,
|
userInfo: uni.getStorageSync('User'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {},
|
||||||
this.$store.dispatch('GetInfo').then(user => {
|
|
||||||
this.userInfo = user || null
|
|
||||||
})
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
specialAreaVisble() {
|
|
||||||
return this.userInfo && Object.keys(this.userInfo).length
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {},
|
methods: {},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -28,17 +28,12 @@ const actions = {
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
GetInfo({ commit, state }) {
|
GetInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const storageUser = uni.getStorageSync('User')
|
|
||||||
if (state.user && storageUser) {
|
|
||||||
resolve(state.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
getInfo()
|
getInfo()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
commit('SET_USER', res.data)
|
commit('SET_USER', res.data)
|
||||||
uni.setStorageSync('User', res.data)
|
uni.setStorageSync('User', res.data)
|
||||||
resolve(res.data)
|
resolve(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
@ -53,8 +48,6 @@ const actions = {
|
||||||
logout(state.token)
|
logout(state.token)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
removeToken()
|
removeToken()
|
||||||
commit('SET_USER', null)
|
|
||||||
uni.removeStorageSync('User')
|
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue