lilei 10 月之前
父节点
当前提交
64c02b574c

+ 2 - 2
api/shop.js

@@ -12,9 +12,9 @@ export function getShopProductList(params) {
 // 获取商品详情
 export function getShopDetail(params) {
 	return request({
-	  url: `shopProduct/queryBySn/${params.shopProductSn}`,
+	  url: `shopProduct/queryBySn`,
 	  method: 'post',
-	  data: {}
+	  data: params
 	},true)
 }
 

+ 22 - 31
pages/index/index.vue

@@ -210,7 +210,7 @@
 			// 显示开发版本信息
 			showVersion () {
 				const baseUrl = getApp().globalData.baseUrl
-				return baseUrl.indexOf(".test.") >= 0
+				return baseUrl.indexOf(".test.") >= 0 || baseUrl.indexOf('192.168') >=0
 			},
 			// 是否有数字货架
 			hasShelf(){
@@ -331,29 +331,11 @@
 		onShow() {
 			// 用户头像
 			this.avatarUrl = uni.getStorageSync('userPhoto');
-			if(this.hasLogin){
-				// 查询门店认证信息
-				if(this.userInfo.sysUserFlag == '0'){
-					this.findLastApply()
-				}
-				if(this.userInfo.sysUserFlag == '1'){
-					// 查询红包活动
-					this.getRedPacketRule()
-				}
-				// 重新刷新
-				this.pageInit(true)
-			}else{
-				this.hasShopiing = true
-				// 商品分类
-				this.getGoodType()
-				// 隐藏促销模块
-				this.hidePromoTab()
-			}
+			// 重新刷新
+			this.pageInit(true)
 		},
 		// 下拉刷新
 		onPullDownRefresh(){
-			// 商品分类
-			this.getGoodType()
 			this.pageInit(true)
 			setTimeout(function () {
 				uni.stopPullDownRefresh();
@@ -375,11 +357,12 @@
 			// 初始化页面
 			pageInit(flag){
 				this.carouselList = []
+				// 已登录
 				if(this.hasLogin){
 					// 非游客
 					if(this.userInfo.sysUserFlag == '1'){
-						// 查询是否有商城
-						this.getHasShopping(flag)
+						// 查询是否有数字货架
+						this.getStoreShelf(flag)
 					}else{// 游客
 						// 获取扫描次数
 						this.$store.dispatch("getScanNums")
@@ -393,7 +376,11 @@
 						this.getGoodType()
 					}
 				}else{
-					uni.removeStorageSync('token')
+					this.hasShopiing = true
+					// 隐藏促销模块
+					this.hidePromoTab()
+					// 商品分类
+					this.getGoodType()
 				}
 			},
 			// 扫描vin
@@ -609,7 +596,9 @@
 			// 商品列表查询
 			getProductList(){
 				this.status = "loading"
-				 getShopProductList({pageNo:this.hotProductPageNo,pageSize:10,hotFlag:1, status: 1}).then(res => {
+				const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_storeShelf.dealerSn : ''
+				// 获取推荐产品	
+				 getShopProductList({pageNo:this.hotProductPageNo,pageSize:10,hotFlag:1, status: 1, dealerSn: dealerSn}).then(res => {
 					 if(res.status == 200){
 						 const list = res.data ? res.data.list : []
 						 this.productList.push(list)
@@ -647,19 +636,16 @@
 							// 获取扫描记录
 							this.getVinLog()
 						}
-						// 查询是否有数字货架
-						this.getStoreShelf(flag)
 						uni.hideLoading()
 					})
 				}else{
+					// 没有商城
 					if(!this.hasShopiing){
 						// 滚动扫描记录
 						this.getScrollLog()
 						// 获取扫描记录
 						this.getVinLog()
 					}
-					// 查询是否有数字货架
-					this.getStoreShelf(flag)
 				}
 			},
 			// 显示购物车tab
@@ -692,11 +678,15 @@
 					})
 				}
 			},
-			// 查询是否支持数字货架, flag: true 再次刷新,false 首次加载
+			// 查询是否支持数字货架, 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()
@@ -707,7 +697,8 @@
 								// 获取订单信息
 								this.shelfGetTotalWaitQty()
 							}
-							
+							// 查询红包活动
+							this.getRedPacketRule()
 							// 获取价格权限配置
 							this.getPriceCofig()
 							// 获取轮播数据,包括促销活动

+ 2 - 2
pages/index/productItem.vue

@@ -14,7 +14,7 @@
 			</view>
 			<view>
 				<view class="product-name ellipsis-two">{{item.productName}}</view>
-				<view class="product-guige" v-if="item.productOrigCode"><text class="ellipsis-two" max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text></view>
+				<view class="product-guige" v-if="!!item.productOrigCode"><text class="ellipsis-two" max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text></view>
 				<view class="product-button">
 					<view class="price-txt flex align_center">¥<text>{{isLogin ? item.price : '***'}}</text></view>
 					<view>
@@ -168,7 +168,7 @@
 	}
 	.back-price{
 		padding: 6rpx 65rpx;
-		background: rgba(197, 197, 198, 1.0);
+		background: #ececec;
 		position: absolute;
 		top: 18rpx;
 		right: -45rpx;

+ 40 - 13
pagesB/cart/index.vue

@@ -52,9 +52,8 @@
 						<view class="cart-footer-left">
 								<view class="cart-footer-left-all" @click="chooseAll">
 									<view class="cart-footer-left-all-icon">
-										<uni-icons v-if="allDisabled" type="circle-filled" size="24" color="#999"></uni-icons>
+										<uni-icons v-if="allDisabled&&!editFlag" type="circle-filled" size="24" color="#ccc"></uni-icons>
 										<uni-icons v-else :type="allChecked?'checkbox-filled':'circle'" size="24" :color="allChecked?'#dd0000':'#666'"></uni-icons>
-										<!-- <image style="width: 24px;height: 24px;" mode="aspectFill" :src="'../static/'+(allChecked?'round_check_fill':'round')+'.png'"></image> -->
 									</view>
 									<view class="cart-footer-left-all-text">
 										<text>全选</text>
@@ -110,7 +109,7 @@
 			return {
 				loading: false,
 				status: 'loading',
-				noDataText: '暂无活动',
+				noDataText: '暂无产品',
 				empty: {
 					tip: '暂无产品',
 					imgUrl: '/static/nodata.png'
@@ -136,7 +135,13 @@
 				return this.$store.state.vuex_userInfo
 			},
 			allDisabled(){
-				return this.list.every(item => item.status==0||item.dealerScopeFlag==0)
+				let ret = false
+				if(!this.editFlag){
+					this.list.forEach(key => {
+						ret = key.every(item => item.status==0||item.dealerScopeFlag==0)
+					})
+				}
+				return ret
 			}
 		},
 		methods: {
@@ -183,12 +188,14 @@
 				  })
 				  _this.list.push(ret)
 				  _this.total = res.data.count || 0
+				  _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
+				  _this.noDataText = _this.total>=_this.list.length ? '没有更多了' : '加载更多'
 				} else {
 				  _this.list = []
 				  _this.total = 0
+				  _this.status = 'loadmore'
 				  _this.noDataText = res.message
 				}
-				_this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
 			  })
 			},
 			// scroll-view到底部加载更多
@@ -230,7 +237,7 @@
 					uni.hideLoading()
 				})
 			},
-			// 选择
+			// 选择
 			chooseItem(cartSn){
 				const crow = this.getItemById(cartSn)
 				if(crow.p>=0&&crow.s>=0){
@@ -238,11 +245,15 @@
 					// 合计
 					this.getChooseHeji()
 					// 判断是否全选
-					if(this.list.every(key => key.every(item => item.checked))){
-						this.allChecked = true
-					}else{
-						this.allChecked = false
-					}
+					this.isAllChecked()
+				}
+			},
+			// 判断是否全选
+			isAllChecked(){
+				if(this.editFlag){
+					this.allChecked = this.list.every(key => key.every(item => item.checked))
+				}else{
+					this.allChecked = this.list.every(key => key.every(item => item.checked && (item.status==1||item.dealerScopeFlag==1)))
 				}
 			},
 			// 编辑
@@ -251,8 +262,15 @@
 				this.list.forEach(key => {
 					key.forEach(item => {
 						item.edit = this.editFlag
+						if(item.status==0||item.dealerScopeFlag==0){
+							item.checked = false
+						}
 					})
 				})
+				// 合计
+				this.getChooseHeji()
+				// 判断是否全选
+				this.isAllChecked()
 			},
 			// 清空购物车
 			clearAll(){
@@ -274,10 +292,15 @@
 			},
 			// 全选
 			chooseAll(){
+				if(this.allDisabled){
+					return
+				}
 				this.allChecked = !this.allChecked
 				this.list.forEach(key => {
 					key.forEach(item => {
-						item.checked = this.allChecked
+						if(item.status == 1 || item.dealerScopeFlag == 1){
+							item.checked = this.allChecked
+						}
 					})
 				})
 				// 合计
@@ -293,6 +316,8 @@
 					// 合计
 					if(!isBatch){
 						this.getChooseHeji()
+						// 判断是否全选
+						this.isAllChecked()
 					}
 				}
 			},
@@ -348,6 +373,8 @@
 								 _this.allChecked = false
 							 }
 							 _this.getChooseHeji()
+							 // 判断是否全选
+							 this.isAllChecked()
 						 }
 					 }
 					 uni.hideLoading()
@@ -379,7 +406,7 @@
 							soldOutSn.push(item.productCode)
 						}
 						//售罄产品提示
-						else if(item.sellout == 0){
+						else if(item.dealerScopeFlag == 0){
 							sellOutSn.push(item.productCode)
 						}else{
 							detailList.push({

+ 8 - 7
pagesB/cart/productitem.vue

@@ -4,9 +4,8 @@
 		v-for="(item, dix) in list"
 		:key="item.cartSn" 
 		>
-			<view class="choose-product-item-check" @click="checkItem(item.cartSn)">
-				<!-- <image style="width: 24px;height: 24px;" mode="aspectFill" :src="'../static/'+(item.checked?'round_check_fill':'round')+'.png'"></image> -->
-				<uni-icons v-if="item.status==0||item.dealerScopeFlag==0" type="circle-filled" size="24" color="#999"></uni-icons>
+			<view class="choose-product-item-check" @click="checkItem(item)">
+				<uni-icons v-if="!item.edit && (item.status==0||item.dealerScopeFlag==0)" type="circle-filled" size="24" color="#ccc"></uni-icons>
 				<uni-icons v-else :type="item.checked?'checkbox-filled':'circle'" size="24" :color="item.checked?'#dd0000':'#666'"></uni-icons>
 			</view>
 			 <view>
@@ -26,7 +25,7 @@
 					<view class="choose-product-item-left-info-price">
 						<view class="price-txt">¥<text>{{item.price}}</text></view>
 						<view>
-							<view :style="{opacity:!item.edit?1:0,width:!item.edit?'auto':0}">
+							<view v-if="item.status==1&&item.dealerScopeFlag==1" :style="{opacity:!item.edit?1:0,width:!item.edit?'auto':0}">
 								<view class="flex align_center qty-box">
 									<view class="qty-btn" @click="changeQty(item.qty-1,item.cartSn,1)" :class="(item.qty <= 1)?'qty-disabled':''">-</view>
 									<view class="qty-num"><input type="number" @blur="changeQty(item.qty,item.cartSn,0)" v-model="item.qty"/></view>
@@ -72,8 +71,10 @@
 			remove(cartSn){
 				this.$emit('remove', [cartSn], false)
 			},
-			checkItem(cartSn){
-				this.$emit('check',cartSn)
+			checkItem(item){
+				if(item.edit || (item.status==1||item.dealerScopeFlag==1)){
+					this.$emit('check',item.cartSn)
+				}
 			}
 		}
 	}
@@ -163,7 +164,7 @@
 				}
 			}
 			.xiajia{
-				background: rgba(222, 222, 222, 1.0);
+				background: #ececec;
 				color: #5f5f5f;
 			}
 			.choose-product-item-left-info-code{

+ 11 - 4
pagesB/components/chooseProductItemSkline.vue

@@ -8,7 +8,9 @@
 			 <view style="flex-grow: 1;">
 				 <view class="choose-product-item-img">
 					<image mode="aspectFit" :src="item.productImage+'?x-oss-process=image/resize,p_30'" style="width: 100%;height: 100%;"></image>
-					<view class="back-price" v-if="item.promoRuleValue&&!isView">返<text>{{item.promoRuleValue}}</text>元</view>
+					<view class="back-price fantext" v-if="item.promoRuleValue&&!isView">返<text>{{item.promoRuleValue}}</text>元</view>
+					<view class="back-price xiajia" v-if="isView&&item.status==0">下架</view>
+					<view class="back-price xiajia" v-if="isView&&item.dealerScopeFlag==0">售罄</view>
 					<view class="choose-product-item-left-info-code ellipsis-one">{{item.productCode}}</view>
 				 </view>
 				 <view class="choose-product-item-info">
@@ -123,11 +125,9 @@
 			.back-price{
 				zoom: calc(0.8);
 				padding: 6rpx 65rpx;
-				background: rgba(255 ,87 ,34 , 1);
 				position: absolute;
 				top: 18rpx;
 				right: -45rpx;
-				color: #fff;
 				z-index: 2;
 				font-size: 20rpx;
 				text-align: center;
@@ -139,6 +139,14 @@
 					margin: 0 5rpx;
 				}
 			}
+			.xiajia{
+				background: #ececec;
+				color: #5f5f5f;
+			}
+			.fantext{
+				background: rgba(255 ,87 ,34 , 1);
+				color: #fff;
+			}
 			.choose-product-item-left-info-code{
 				color: #666;
 				position: absolute;
@@ -180,7 +188,6 @@
 			}
 			.choose-product-item-left-info-name{
 				font-size: 28rpx;
-				font-weight: 900;
 				color: #666;
 			}
 			.choose-product-item-left-info-guige{

+ 3 - 3
pagesB/procureOrder.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="orderDetail-digitalShel flex flex_column">
-		<view class="contHead" :style="{background:state!= 'error'&&state!= 'AUDIT_REJECT' ? '#066cff':'#ff5500',color:'#fff'}">
+		<view class="contHead" :style="{background:state!= 'error'&&state!= 'AUDIT_REJECT'&&state!='CANCEL' ? '#066cff':'#ff5500',color:'#fff'}">
 			<view class="statusH">
 				<view class="flex flex_column align_center">
 					<view class="status-row">
@@ -106,7 +106,7 @@
 		  if(option.purchaseSn){
 			  this.state = option.state
 			  this.purchaseSn = option.purchaseSn
-			  const stateText = {'WAIT_AUDIT':'待审核','AUDIT_REJECT':'审核不通过','WAIT_OUT_WAREHOUSE':'待收货','FINISH':'已完结'}
+			  const stateText = {'WAIT_AUDIT':'待审核','AUDIT_REJECT':'审核不通过','WAIT_OUT_WAREHOUSE':'待收货','FINISH':'已完结','CANCEL':'已取消'}
 			  this.statusText = stateText[option.state]
 			  this.statusIcon = option.state == 'FINISH' ? 'checkmark-circle' : 'hourglass'
 			  this.info = this.$store.state.vuex_tempData
@@ -129,7 +129,7 @@
 		  // 更改标题栏背景色
 		  uni.setNavigationBarColor({
 		  	frontColor: '#ffffff',
-		  	backgroundColor: this.state!= 'error'&&this.state!= 'AUDIT_REJECT' ? '#066cff':'#ff5500',
+		  	backgroundColor: this.state!= 'error'&&this.state!= 'AUDIT_REJECT'&&this.state!= 'CANCEL' ? '#066cff':'#ff5500',
 		  })
 	   },
 	   onUnload() {

+ 8 - 0
pagesB/procureOrderList.vue

@@ -70,6 +70,11 @@
 					  	typeId: 3,
 						count: 0
 					  },
+					  {
+					    dispName: '已取消',
+					  	typeId: 4,
+					  	count: 0
+					  },
 				  ],
 				current: 1,
 				swiperCurrent: 1,
@@ -195,6 +200,9 @@
 			  if(this.swiperCurrent == 2){
 				  params.billStatusList = ['FINISH']
 			  }
+			  if(this.swiperCurrent == 3){
+			  	  params.billStatusList = ['CANCEL']
+			  }
 			  this.status = "loading"
 			  purchaseQueryPage(params).then(res => {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {

+ 8 - 2
pagesB/shopiing/productDetail.vue

@@ -148,7 +148,11 @@
 			}
 		},
 		computed: {
-			...mapState(['hasLogin'])
+			...mapState(['hasLogin']),
+			// 登录用户信息
+			userInfo(){
+				return this.$store.state.vuex_userInfo
+			},
 		},
 		methods: {
 			// 返回
@@ -166,9 +170,11 @@
 				uni.showLoading({
 					title: '加载中'
 				})
+				const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_storeShelf.dealerSn : ''
 				// 获取产品详情
 				getShopDetail({
-					shopProductSn: this.shopProductSn
+					shopProductSn: this.shopProductSn,
+					dealerSn: dealerSn
 				}).then(res => {
 					if(res.status == 200){
 						this.detail = res.data

+ 11 - 7
pagesB/shopiing/searchProduct.vue

@@ -190,10 +190,10 @@
 						this.categoryList = res.data && res.data.shopCategoryList ? res.data.shopCategoryList : []
 						// 如果有二级目录
 						if(this.categoryList.length > 0){
-							this.categoryList.unshift({
-								categorySn: this.clzId,
-								categoryName: '全部'
-							})
+							// this.categoryList.unshift({
+							// 	categorySn: this.clzId,
+							// 	categoryName: '全部'
+							// })
 							// 默认显示第一个
 							this.categorySn = this.categoryList[0].categorySn
 							// 目录下商品
@@ -218,7 +218,8 @@
 								  priceType: k.priceType,
 								  shopProductSn: k.shopProductSn,
 								  status: k.status,
-								  statusDictValue: k.statusDictValue
+								  statusDictValue: k.statusDictValue,
+								  dealerScopeFlag: k.dealerScopeFlag
 							  })
 							})
 							// 追加数据
@@ -266,11 +267,13 @@
 			// 列表查询
 			getList(){
 				this.loading = true
+				const dealerSn = this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1' ? this.$store.state.vuex_storeShelf.dealerSn : ''
 				getShopProductList({
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
 					queryWord: this.queryWord,
-					categorySn: this.categorySn
+					categorySn: this.categorySn,
+					dealerSn: dealerSn
 				}).then(res => {
 					this.loading = false
 					if(res.status == 200){
@@ -294,7 +297,8 @@
 								  priceType: k.priceType,
 								  shopProductSn: k.shopProductSn,
 								  status: k.status,
-								  statusDictValue: k.statusDictValue
+								  statusDictValue: k.statusDictValue,
+								  dealerScopeFlag: k.dealerScopeFlag
 							  })
 							})
 							// 追加数据