lilei 9 ماه پیش
والد
کامیت
ac60bf5654

+ 79 - 81
pages/index/index.vue

@@ -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()
+					}
 				})
 			},
 			// 红包奖励信息

+ 0 - 1
pages/vinInput/confirmVin.vue

@@ -139,7 +139,6 @@
 					year: data?data.year:'',
 					identifyType: this.userInfo.identifyType
 				}).then(res => {
-					console.log(res)
 					uni.$emit("refashHome")
 				})
 			},

+ 5 - 2
pagesB/components/chooseProductItemSkline.vue

@@ -21,8 +21,10 @@
 					<view class="choose-product-item-left-info-price">
 						<view class="price-txt">¥<text>{{isView ? item.price : item.cost}}</text></view>
 						<view v-if="!isView">
-							<uni-number-box v-if="!edit" v-model="item.qty" :min="1" :max="999999" @change="v=>{changeQty(v,item.id)}"></uni-number-box>
-							<view v-else class="edit-qty">
+							<view :style="{opacity:!edit?1:0,width:!edit?'auto':0}">
+								<uni-number-box v-model="item.qty" :min="1" :max="999999" @change="v=>{changeQty(v,item.id)}"></uni-number-box>
+							</view>
+							<view v-if="edit" class="edit-qty">
 								X <text>{{item.qty}}</text>
 								<image src="../static/del.png" style="width: 30px;height: 30px;" mode="aspectFit" @click="remove(item.id)"></image>
 							</view>
@@ -146,6 +148,7 @@
 			.fantext{
 				background: rgba(255 ,87 ,34 , 1);
 				color: #fff;
+				font-size: 8px;
 			}
 			.choose-product-item-left-info-code{
 				color: #666;

+ 2 - 2
pagesB/components/productItemSkline.vue

@@ -19,10 +19,10 @@
 					<view class="price-txt">¥<text>{{item.cost}}</text></view>
 					<view>
 						<button v-if="!item.checked" @click="addToCat(item)" size="mini" type="default" class="bg-0">
-							<image style="width: 12px; height: 12px;" mode="aspectFit" src="../static/add.png"></image>
+							<image style="width: 10px; height: 10px;" mode="aspectFit" src="../static/add.png"></image>
 						</button>
 						<button v-else @click="addToCat(item)" size="mini" type="primary" class="bg-1">
-							<image style="width: 12px; height: 12px;" mode="aspectFit" src="../static/add.png"></image>
+							<image style="width: 10px; height: 10px;" mode="aspectFit" src="../static/add.png"></image>
 							{{item.qty}}
 						</button>
 					</view>

+ 14 - 4
pagesB/promoProduct.vue

@@ -81,11 +81,17 @@
 							<view class="choose-title">
 								<view class="choose-left">
 									<view>已选<text class="p-nums">{{chooseLength}}</text>款产品</view>
-									<button @click="claerChoose" size="mini" type="warn" plain>清空列表</button>
-									<button class="editBtn" @click="handleEditChoose" size="mini" type="primary" plain>{{editChoose?'完成':'编辑'}}</button>
+									<!-- <button @click="claerChoose" size="mini" type="warn" plain>清空列表</button> -->
+									<!-- <button class="editBtn" @click="handleEditChoose" size="mini" type="primary" plain>{{editChoose?'完成':'编辑'}}</button> -->
+									<view class="clearBtn" @click="claerChoose">
+										<text>清空列表</text>
+									</view>
+									<view class="editBtn" @click="handleEditChoose">
+										<text>{{editChoose?'完成':'编辑'}}</text>
+									</view>
 								</view>
 								<view class="choose-close" @click="showChoosePopu=false">
-									<icon type="clear" size="24"></icon>
+									<uni-icons type="closeempty" size="28"></uni-icons>
 								</view>
 							</view>
 						</sticky-header>
@@ -680,7 +686,11 @@
 			}
 			.editBtn{
 				color: #2196F3;
-				border-color: #2196F3;
+				justify-content: center;
+			}
+			.clearBtn{
+				color: #ff0000;
+				justify-content: center;
 			}
 		}
 		.p-nums{

+ 10 - 4
pagesB/shopiing/productDetail.vue

@@ -192,7 +192,8 @@
 				uni.showLoading({
 					title: '加载中'
 				})
-				const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_storeShelf.dealerSn : ''
+				const storeShelf = this.$store.state.vuex_storeShelf
+				const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1'&&storeShelf ? storeShelf.dealerSn : ''
 				// 获取产品详情
 				getShopDetail({
 					shopProductSn: this.shopProductSn,
@@ -251,9 +252,14 @@
 			// 打开购物车
 			toCart(){
 				if(this.hasLogin){
-					uni.navigateTo({
-						url: '/pagesB/cart/index'
-					})
+					// 游客未认证
+					if(this.userInfo.sysUserFlag == '0'){
+						this.showPopup = true
+					}else{
+						uni.navigateTo({
+							url: '/pagesB/cart/index'
+						})
+					}
 				}else{
 					uni.navigateTo({
 						url: '/pages/login/login'

+ 2 - 1
store/index.js

@@ -249,6 +249,7 @@ const store = new Vuex.Store({
 				console.log(res,'out')
 				if(res.status == 200){
 					context.commit('logout')
+					uni.$emit("refashHome")
 				}
 			})
 		},
@@ -258,10 +259,10 @@ const store = new Vuex.Store({
 			checkLogin().then(res => {
 				if(res.status == '200'){
 					context.commit('setHasLogin',true)
-					callback&&callback()
 				}else{
 					context.commit('logout')
 				}
+				callback&&callback(res.status == '200')
 			})
 		},
 		// 检测是否开启定位