|
@@ -204,6 +204,7 @@
|
|
|
hotProductPageNo: 1 ,// 热门产品页码
|
|
|
totalhotPage: 0, // 热门产品总页数
|
|
|
showFixed: false, // 是否显示浮动头部
|
|
|
+ isCheckLogin:false, // 是否正在检查登录
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -309,7 +310,9 @@
|
|
|
// 视频类型
|
|
|
this.getLookUpList('CONTENT_CATEGORY', 'vuex_videoTypeList');
|
|
|
// 检测是否登录
|
|
|
- this.$store.dispatch('checkLogin',()=>{
|
|
|
+ this.isCheckLogin = true
|
|
|
+ this.$store.dispatch('checkLogin',(isLogin)=>{
|
|
|
+ this.isCheckLogin = false
|
|
|
// 获取数据字典
|
|
|
this.getListLookUp();
|
|
|
// 获取支付,收款方式
|
|
@@ -333,7 +336,9 @@
|
|
|
// 用户头像
|
|
|
this.avatarUrl = uni.getStorageSync('userPhoto');
|
|
|
// 重新刷新
|
|
|
- this.pageInit(true)
|
|
|
+ if(!this.isCheckLogin){
|
|
|
+ this.pageInit(true)
|
|
|
+ }
|
|
|
},
|
|
|
// 下拉刷新
|
|
|
onPullDownRefresh(){
|
|
@@ -360,7 +365,7 @@
|
|
|
this.carouselList = []
|
|
|
// 已登录
|
|
|
if(this.hasLogin){
|
|
|
- // 非游客
|
|
|
+ // 已认证用户
|
|
|
if(this.userInfo.sysUserFlag == '1'){
|
|
|
// 查询是否有数字货架
|
|
|
this.getStoreShelf(flag)
|
|
@@ -375,19 +380,78 @@
|
|
|
this.getVinLog()
|
|
|
// 商品分类
|
|
|
this.getGoodType()
|
|
|
+ // 获取推荐产品
|
|
|
+ this.getHotProductList()
|
|
|
}
|
|
|
}else{
|
|
|
+ // 未登录
|
|
|
this.hasShopiing = true
|
|
|
// 隐藏促销模块
|
|
|
this.hidePromoTab()
|
|
|
- if(flag){
|
|
|
- // 获取推荐产品
|
|
|
- this.productList = []
|
|
|
- this.hotProductPageNo = 1
|
|
|
- this.getProductList()
|
|
|
+ if(!flag){
|
|
|
+ // 商品分类
|
|
|
+ this.getGoodType()
|
|
|
}
|
|
|
+ // 获取推荐产品
|
|
|
+ this.getHotProductList()
|
|
|
}
|
|
|
},
|
|
|
+ // 查询是否支持数字货架, flag: true 再次刷新,false 首次加载,只加载一次
|
|
|
+ getStoreShelf(flag){
|
|
|
+ findStoreShelf().then(res => {
|
|
|
+ this.$store.state.vuex_storeShelf = res.data;
|
|
|
+ // 有数字货架
|
|
|
+ if(res.data){
|
|
|
+ // 查询是否有商城
|
|
|
+ this.getHasShopping(flag)
|
|
|
+ // 只需加载一次
|
|
|
+ if(!flag){
|
|
|
+ // 更新用户信息
|
|
|
+ this.getCurrUserInfo()
|
|
|
+ // 显示促销模块
|
|
|
+ this.showPromoTab()
|
|
|
+ // 保证金查询
|
|
|
+ this.getShelfBWPayRecord()
|
|
|
+ // 获取订单信息
|
|
|
+ this.shelfGetTotalWaitQty()
|
|
|
+ }
|
|
|
+ // 获取价格权限配置
|
|
|
+ this.getPriceCofig()
|
|
|
+ // 获取轮播数据,包括促销活动
|
|
|
+ this.getCarousel()
|
|
|
+ }else{
|
|
|
+ // 没有数字货架,隐藏促销模块
|
|
|
+ this.hidePromoTab()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 商城信息, flag: true 再次刷新,false 只加载一次
|
|
|
+ getHasShopping(flag){
|
|
|
+ getShopStatus().then(res => {
|
|
|
+ this.hasShopiing = res.data && res.data.paramValue == 1
|
|
|
+ // 有商城
|
|
|
+ if(this.hasShopiing){
|
|
|
+ if(!flag){
|
|
|
+ // 隐藏tab 视频,显示tab购物车
|
|
|
+ this.showCatTab()
|
|
|
+ // 商品分类
|
|
|
+ this.getGoodType()
|
|
|
+ }
|
|
|
+ // 获取推荐产品
|
|
|
+ this.getHotProductList()
|
|
|
+ }else{
|
|
|
+ // 没有商城
|
|
|
+ // 隐藏tab 购物车,显示tab视频
|
|
|
+ this.showVideoTab()
|
|
|
+ // 滚动扫描记录
|
|
|
+ this.getScrollLog()
|
|
|
+ // 获取扫描记录
|
|
|
+ this.getVinLog()
|
|
|
+ }
|
|
|
+ // 查询红包活动
|
|
|
+ this.getRedPacketRule()
|
|
|
+ })
|
|
|
+ },
|
|
|
// 扫描vin
|
|
|
beforeSwitch(index){
|
|
|
const row = this.$store.state.vuex_tabBarList[index]
|
|
@@ -599,12 +663,13 @@
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- // 获取推荐产品
|
|
|
+ },
|
|
|
+ // 商品列表查询
|
|
|
+ getHotProductList(){
|
|
|
this.productList = []
|
|
|
this.hotProductPageNo = 1
|
|
|
this.getProductList()
|
|
|
},
|
|
|
- // 商品列表查询
|
|
|
getProductList(){
|
|
|
this.status = "loading"
|
|
|
const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_storeShelf.dealerSn : ''
|
|
@@ -625,45 +690,6 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 商城信息, flag: true 再次刷新,false 首次加载
|
|
|
- getHasShopping(flag){
|
|
|
- if(!flag){
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
- })
|
|
|
- getShopStatus().then(res => {
|
|
|
- this.hasShopiing = res.data && res.data.paramValue == 1
|
|
|
- // 有商城
|
|
|
- if(this.hasShopiing){
|
|
|
- // 隐藏tab 视频,显示购物车tab
|
|
|
- this.showCatTab()
|
|
|
- // 商品分类
|
|
|
- this.getGoodType()
|
|
|
- }else{ // 没有商城
|
|
|
- // 隐藏tab 购物车,显示视频
|
|
|
- this.showVideoTab()
|
|
|
- // 滚动扫描记录
|
|
|
- this.getScrollLog()
|
|
|
- // 获取扫描记录
|
|
|
- this.getVinLog()
|
|
|
- }
|
|
|
- uni.hideLoading()
|
|
|
- })
|
|
|
- }else{
|
|
|
- // 没有商城
|
|
|
- if(!this.hasShopiing){
|
|
|
- // 滚动扫描记录
|
|
|
- this.getScrollLog()
|
|
|
- // 获取扫描记录
|
|
|
- this.getVinLog()
|
|
|
- }else{
|
|
|
- // 获取推荐产品
|
|
|
- this.productList = []
|
|
|
- this.hotProductPageNo = 1
|
|
|
- this.getProductList()
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
// 显示购物车tab
|
|
|
showCatTab(){
|
|
|
const videoIndex = this.$store.state.vuex_tabBarList.findIndex(item => item.text == '视频')
|
|
@@ -694,37 +720,6 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- // 查询是否支持数字货架, flag: true 再次刷新,false 首次加载,只加载一次
|
|
|
- getStoreShelf(flag){
|
|
|
- findStoreShelf().then(res => {
|
|
|
- this.$store.state.vuex_storeShelf = res.data;
|
|
|
- if(res.data){
|
|
|
- // 查询是否有商城
|
|
|
- this.getHasShopping(flag)
|
|
|
-
|
|
|
- // false 不需要每次加载
|
|
|
- if(!flag){
|
|
|
- // 更新用户信息
|
|
|
- this.getCurrUserInfo()
|
|
|
- // 显示促销模块
|
|
|
- this.showPromoTab()
|
|
|
- // 保证金查询
|
|
|
- this.getShelfBWPayRecord()
|
|
|
- // 获取订单信息
|
|
|
- this.shelfGetTotalWaitQty()
|
|
|
- }
|
|
|
- // 查询红包活动
|
|
|
- this.getRedPacketRule()
|
|
|
- // 获取价格权限配置
|
|
|
- this.getPriceCofig()
|
|
|
- // 获取轮播数据,包括促销活动
|
|
|
- this.getCarousel()
|
|
|
- }else{
|
|
|
- // 没有数字货架,隐藏促销模块
|
|
|
- this.hidePromoTab()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 显示促销模块
|
|
|
showPromoTab(){
|
|
|
// 添加促销模块
|
|
@@ -763,7 +758,10 @@
|
|
|
getRedPacketRule(){
|
|
|
findCurrentRewardRule().then(res => {
|
|
|
this.$store.state.vuex_rewardRule = res.data;
|
|
|
- this.getRedScroll()
|
|
|
+ // 商城未开通时调用
|
|
|
+ if(res.data && !this.hasShopiing){
|
|
|
+ this.getRedScroll()
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 红包奖励信息
|