forked from angelo/web-retail-h5
feat(specialArea): 会员专区列表根据会员身份请求接口
This commit is contained in:
parent
97da0dd93e
commit
11cf1a041d
|
|
@ -103,14 +103,17 @@ export default {
|
||||||
...mapGetters(['isZeroLevel']),
|
...mapGetters(['isZeroLevel']),
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const userInfo = uni.getStorageSync('userInfo') || this.userInfo
|
const userInfo = Object.keys(this.userInfo).length
|
||||||
|
? 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) {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding-bottom: 140rpx">
|
<view v-if="specialAreaVisble" 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,7 +77,6 @@
|
||||||
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'
|
||||||
|
|
@ -128,6 +127,9 @@ 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();
|
||||||
|
|
@ -136,24 +138,7 @@ 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) {
|
||||||
|
|
@ -194,17 +179,6 @@ 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 :userInfo="userInfo" />
|
<special-area-wrapper v-if="specialAreaVisble" :userInfo="userInfo" />
|
||||||
|
|
||||||
<cl-tabbar :current="1"></cl-tabbar>
|
<cl-tabbar :current="1"></cl-tabbar>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -23,11 +23,19 @@ export default {
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userInfo: uni.getStorageSync('User'),
|
userInfo: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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,12 +28,16 @@ const actions = {
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
GetInfo({ commit, state }) {
|
GetInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
if (state.user) {
|
||||||
|
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)
|
resolve(res.data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue