lilei 8 months ago
parent
commit
57d0ccd2ae

+ 32 - 7
components/icon-items-list/icon-items-list.vue

@@ -1,12 +1,12 @@
 <template>
 	<div class="icon-items-list" :class="'icon-items-list-'+type">
-		<div class="icon-items-icons" :style="{width:itemWidth}" v-for="(item,index) in list" :key="item.id" @click="toPage(item,index)">
-			<div class="icon-items-imgse" >
+		<div class="icon-items-icons" :style="{width:itemWidth,marginBottom:circle?'5px':'0px'}" v-for="(item,index) in list" :key="item.id" @click="toPage(item,index)">
+			<div class="icon-items-imgse" :class="circle?'icon-items-imgse-circle':''" >
 				<image class="imgs" v-if="type=='img'" :class="item.auth?'':'uni-img-gray'" :fade-show='true' :src="item.icon||'/static/def_imgs.png'"></image>
 				<u-icon class="icons" v-if="type=='icon'" :color="item.color" :size="iconSize" :name="item.icon" custom-prefix="custom-icon"></u-icon>
 				<u-badge class="tag" :absolute="false" type="error"  v-if="item.nums" :count="item.nums"></u-badge>
 			</div>
-			<div class="icon-items-text">{{item.name}}</div>
+			<div class="icon-items-text" :class="circle?'icon-items-text-circle':''">{{item.name}}</div>
 		</div>
 		<div class="nodata" v-if="list.length==0">
 			<u-empty :text="noDataText" mode="list"></u-empty>
@@ -49,6 +49,10 @@
 			sysUserFlag: {
 				type: String,
 				default: '1'
+			},
+			circle: {
+				type: Boolean,
+				default: false
 			}
 		},
 		data() {
@@ -106,18 +110,28 @@
 	.icon-items-list-img{
 		.icon-items-icons{
 			margin-bottom: 5px;
+			.icon-items-text{
+				font-size: 24upx;
+				color: #333;
+			}
+			.icon-items-text-circle{
+				font-size: 28upx;
+				color: #333;
+			}
 		}
 		.icon-items-imgse{
 			position: relative;
-			width: 100upx;
-			height: 100upx;
+			width: 60upx;
+			height: 60upx;
 			margin-bottom: 6upx;
 			display:flex;
 			align-items: center;
 			justify-content: center;
+			border-radius:10upx;
+			overflow: hidden;
 			.imgs{
-				width: 90upx;
-				height: 90upx;
+				width: 100%;
+				height: 100%;
 			}
 			.tag{
 				position: absolute;
@@ -125,6 +139,17 @@
 				right: -5upx;
 			}
 		}
+		.icon-items-imgse-circle{
+			border-radius:100rpx;
+			overflow: hidden;
+			width: 100upx;
+			height: 100upx;
+			background: linear-gradient(#fff,#eee);
+			.imgs{
+				width: 80%;
+				height: 80%;
+			}
+		}
 	}
 	.icon-items-list-icon{
 		.icon-items-imgse{

+ 9 - 9
pages/index/index.vue

@@ -95,13 +95,13 @@
 					</view>
 					<!-- 快捷导航 -->
 					<view class="quick-nav pa-box" v-if="hasShopiing&&navList.length">
-						<iconItemsList :list="navList" :isLogin="true" :sysUserFlag="userInfo.sysUserFlag" :iconSize="45" @callback="onNavFun"></iconItemsList>
+						<iconItemsList :list="navList" type="img" :isLogin="true" :sysUserFlag="userInfo.sysUserFlag" :iconSize="45" @callback="onNavFun"></iconItemsList>
 					</view>
 					<!-- 产品分类 -->
 					<view class="ptype-nav pa-box" v-if="hasShopiing&&productTypeList.length">
 						<swiper class="swiper" :style="{height:navHeight==44?'160px':'160px'}" @change="e=>{currentPtypeDot=e.detail.current}">
 							<swiper-item v-for="(item, idx) in productTypeList" :index="idx" :key="item.id">
-								<iconItemsList :isLogin="hasLogin" :sysUserFlag="userInfo.sysUserFlag" :list="item.list" type="img"></iconItemsList>
+								<iconItemsList :isLogin="hasLogin" circle :sysUserFlag="userInfo.sysUserFlag" :list="item.list" type="img"></iconItemsList>
 							</swiper-item>
 						</swiper>
 						<view class="indicator-dots" v-if="productTypeList.length>1">
@@ -267,7 +267,7 @@
 						id:'n0',
 						auth: this.hasLogin,
 						ignoreAuth: false,
-						icon:'bianmachaxun',
+						icon:'/static/nav_icon1.jpg',
 						name: '产品编码取货',
 						color:'#056cd9',
 						url: 'openTakeGood1',
@@ -277,7 +277,7 @@
 						id:'n1',
 						auth: this.hasLogin,
 						ignoreAuth: false,
-						icon:'saoma',
+						icon:'/static/nav_icon2.jpg',
 						name: '二维/条码取货',
 						color:'#f44336',
 						url:'openTakeGood0',
@@ -287,7 +287,7 @@
 						id:'n3',
 						auth: true,
 						ignoreAuth: true,
-						icon:'shipin1',
+						icon:'/static/nav_icon3.jpg',
 						name: '视频教程',
 						color:'#03a9f4',
 						url:'/pagesB/videos/index',
@@ -297,7 +297,7 @@
 						id:'n2',
 						auth: this.hasLogin,
 						ignoreAuth: true,
-						icon:'chaxunjilu',
+						icon:'/static/nav_icon4.jpg',
 						name: 'VIN查询历史',
 						color:'#ff9800',
 						url:'/pagesA/vinRecord/vinRecord',
@@ -439,9 +439,9 @@
 								this.getShelfBWPayRecord()
 								// 获取订单信息
 								this.shelfGetTotalWaitQty()
+								// 获取价格权限配置
+								this.getPriceCofig()
 							}
-							// 获取价格权限配置
-							this.getPriceCofig()
 						}else{
 							// 没有数字货架,隐藏促销模块
 							this.hidePromoTab()
@@ -1048,7 +1048,7 @@
 				border-radius: 6px;
 				margin: 10px 0;
 				padding: 10px 0;
-				border: 1px solid #eee;
+				box-shadow: 1px 1px 2px #eee;
 			}
 			.product-box{
 				margin: 10px 0;

+ 1 - 1
pages/promo/index.vue

@@ -133,7 +133,7 @@
 		display: flex;
 		flex-direction: column;
 		.tab-body{
-			height: 100vh;
+			height: calc(100vh - 86px);
 			.check-order-list{
 				background: #ffffff;
 				margin: 25upx;

+ 0 - 1
pagesA/digitalShelf/choosePart.vue

@@ -168,7 +168,6 @@
 												<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+20+'px'}"><input type="number" @blur="e=>updateCartNums(Number(e.detail.value),'cart_'+item.productSn,item.currentInven||999,0)" :value="item.qty"/></view>
 												<view class="qty-btn" @click="updateCartNums(item.qty+1,'cart_'+item.productSn,item.currentInven||999,1)" :class="(item.qty >= (item.currentInven||999))?'qty-disabled':''">+</view>
 											</view>
-											<!-- <uni-number-box @change="e=>updateCartNums({value:e,index:'cart_'+item.productSn})" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999"></uni-number-box> -->
 										</view>
 									</view>
 								</view>

+ 0 - 2
pagesA/digitalShelf/components/otherPartItem.vue

@@ -47,7 +47,6 @@
 									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+8+'px'}"><input type="number" @blur="e=>changeQty(null,Number(e.detail.value),item,0)" v-model="item.qty"/></view>
 									<view class="qty-btn" @click="e=>{changeQty(e,item.qty+1,item,1)}" :class="(item.qty >= item.currentInven)?'qty-disabled':''">+</view>
 								</view>
-								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateNums(e,item.productSn)" v-model="item.qty" :min="0" :max="item.currentInven"></uni-number-box> -->
 							</view>
 							<view class="item-detail-text flex align_center" v-else>
 								<text @click="e=>{addPart(e,item)}" v-if="!item.checked" class="phtxt">我要急送</text>
@@ -56,7 +55,6 @@
 									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+8+'px'}"><input type="number" @blur="e=>changeQty(null,Number(e.detail.value),item,0)" v-model="item.qty"/></view>
 									<view class="qty-btn" @click="e=>{changeQty(e,item.qty+1,item,1)}" :class="(item.qty >= 999)?'qty-disabled':''">+</view>
 								</view>
-								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateNums(e,item.productSn)" v-model="item.qty" :min="0"></uni-number-box> -->
 							</view>
 						</view>
 					</view>

+ 0 - 2
pagesA/digitalShelf/components/vinPartItem.vue

@@ -51,7 +51,6 @@
 									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+8+'px'}"><input type="number" @blur="e=>changeQty(null,Number(e.detail.value),item,0)" :value="item.qty"/></view>
 									<view class="qty-btn" @click="e=>{changeQty(e,item.qty+1,item,1)}" :class="(item.qty >= item.currentInven)?'qty-disabled':''">+</view>
 								</view>
-								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0" :max="item.currentInven"></uni-number-box> -->
 							</view>
 							<view class="item-detail-text" v-if="item.affiliation=='NON_SHELF'||!item.currentInven">
 								<text v-if="!item.checked" @click="e=>{addPart(e,item)}" class="phtxt">我要急送</text>
@@ -60,7 +59,6 @@
 									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+8+'px'}"><input type="number" @blur="e=>changeQty(null,Number(e.detail.value),item,0)" :value="item.qty"/></view>
 									<view class="qty-btn" @click="e=>{changeQty(e,item.qty+1,item,1)}" :class="(item.qty >= 999)?'qty-disabled':''">+</view>
 								</view>
-								<!-- <uni-number-box v-else :hideInput="true" @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0"></uni-number-box> -->
 							</view>
 						</view>
 					</view>

+ 1 - 1
pagesB/cart/index.vue

@@ -173,6 +173,7 @@
 				  for(let i=0;i<list.length;i=i+10){
 					  _this.list.push(list.slice(i,(i+10)>list.length?list.length:(i+10)).map(key=>{
 						  const a = key.shopPromoProduct
+						  key.orginPrice = key.price
 						  if(a){
 							  key.promoType = a.promoType
 							  key.resultValue = a.resultValue
@@ -180,7 +181,6 @@
 							  key.discountType = a.discountType
 							  key.promoProductSn = a.promoProductSn
 							  key.promoSn = a.promoSn
-							  key.orginPrice = key.price
 							  // 特价
 							  if(key.promoType=='PROMO_PROD'){
 								  // 直降

+ 6 - 3
pagesB/cart/productitem.vue

@@ -24,8 +24,8 @@
 							<text :max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text>
 						</view>
 						<view class="choose-product-item-left-info-price">
-							<view>
-								<view class="price-txt" v-if="item.status==1">¥<text>{{item.price}}</text></view>
+							<view v-if="item.status==1">
+								<view class="price-txt">¥<text>{{item.price}}</text></view>
 								<view class="flex align_center rebate-tag" v-if="item.promoType=='BUY_PROD_GIVE_VALID'">
 									返<text>{{item.resultValue}}</text>元
 								</view>
@@ -36,11 +36,14 @@
 									特价<text>¥{{item.orginPrice}}</text>
 								</view>
 							</view>
+							<view v-else></view>
 							<view>
 								<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,1)" :class="(item.qty <= 1)?'qty-disabled':''">-</view>
-										<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+10+'px'}"><input type="number" @input="inputQty(item)" @blur="changeQty(item.qty,item,0)" v-model="item.qty"/></view>
+										<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+10+'px'}">
+											<input type="number" @input="inputQty(item)" @blur="changeQty(item.qty,item,0)" v-model="item.qty"/>
+										</view>
 										<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= 999)?'qty-disabled':''">+</view>
 									</view>
 								</view>

+ 3 - 3
pagesB/components/chooseProductItemSkline.vue

@@ -26,13 +26,13 @@
 							¥<text>{{item.priceStr[0]}}</text>.{{item.priceStr[1]}}
 						</view>
 						<view class="price-txt" v-else>¥***</view>
-						<view class="flex align_center rebate-tag" v-if="item.promoType=='BUY_PROD_GIVE_VALID'">
+						<view class="flex align_center rebate-tag" v-if="isLogin&&item.promoType=='BUY_PROD_GIVE_VALID'">
 							返<text>{{item.resultValue}}</text>元
 						</view>
-						<view class="flex align_center rebate-tag" v-if="item.promoType=='BUY_PROD_GIVE_PROD'">
+						<view class="flex align_center rebate-tag" v-if="isLogin&&item.promoType=='BUY_PROD_GIVE_PROD'">
 							买{{item.conditionValue}}赠{{item.resultValue}}
 						</view>
-						<view class="flex align_center tejia-tag" v-if="item.promoType=='PROMO_PROD'">
+						<view class="flex align_center tejia-tag" v-if="isLogin&&item.promoType=='PROMO_PROD'">
 							特价<text>¥{{item.orginPrice}}</text>
 						</view>
 					</view>

+ 1 - 1
pagesB/components/productItemSkline.vue

@@ -10,7 +10,7 @@
 		 @click="toDetail(item)">
 			<view>
 				<image mode="aspectFit" :src="item.productImage+'?x-oss-process=image/resize,p_30'" style="height: 140px;width: 100%;"></image>
-				<view class="back-price xiajia" v-if="item.status==0">下架</view>
+				<view class="back-price xiajia" v-if="item.status==0||!item.status">下架</view>
 				<view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
 				<view class="product-code"><text :max-lines="1" overflow="ellipsis">{{item.productCode}}</text></view>
 			</view>

+ 66 - 56
pagesB/shopiing/productDetail.vue

@@ -96,7 +96,8 @@
 		:show="showPopu" 
 		:round="true"
 		:z-index="100"
-		position="bottom" 
+		position="center" 
+		customStyle="right: 0; left: 0; top: 0; bottom: 0; margin: auto 10%;width: fit-content;height: fit-content;border-radius:15px;"
 		@afterleave="closePopu">
 			<view class="popu-content" v-if="detail">
 				<view class="popu-close" @click="showPopu=false">
@@ -115,19 +116,19 @@
 								¥<text>{{detail.priceStr[0]}}</text>.{{detail.priceStr[1]}}
 							</view>
 							<view class="popu-content-price" v-else>¥***</view>
-							<view class="flex align_center rebate-tag" v-if="detail.promoType=='BUY_PROD_GIVE_VALID'">
+							<view class="flex align_center rebate-tag" v-if="hasLogin&&detail.promoType=='BUY_PROD_GIVE_VALID'">
 								返<text>{{detail.resultValue}}</text>元
 							</view>
-							<view class="flex align_center rebate-tag" v-if="detail.promoType=='BUY_PROD_GIVE_PROD'">
+							<view class="flex align_center rebate-tag" v-if="hasLogin&&detail.promoType=='BUY_PROD_GIVE_PROD'">
 								买{{detail.conditionValue}}赠{{detail.resultValue}}
 							</view>
-							<view class="flex align_center tejia-tag" v-if="detail.promoType=='PROMO_PROD'">
+							<view class="flex align_center tejia-tag" v-if="hasLogin&&detail.promoType=='PROMO_PROD'">
 								特价<text>¥{{detail.orginPrice}}</text>
 							</view>
 						</view>
-						<view class="popu-content-num flex align_center justify_end">
+						<view class="popu-content-num flex align_center justify_between">
 							<text>数量</text>
-							<uni-number-box v-model="qty" :min="1" :max="999999"></uni-number-box>
+							<u-number-box v-model="qty" :input-width="100" :input-height="60" :min="1" :max="999"></u-number-box>
 						</view>
 					</view>
 				</view>
@@ -151,9 +152,9 @@
 					</view>
 				</view>
 				<view class="popu-content-btn">
-					<view class="popu-content-btn-item" @click="toBuy">确定采购</view>
+					<view class="popu-content-btn-item cancelBtn" @click="showPopu=false">取消</view>
+					<view class="popu-content-btn-item okbtn" @click="toBuy">确定采购</view>
 				</view>
-				<view :style="{height:safeAreaBottom+'px'}"></view>
 			</view>
 		</page-container>
 	</view>
@@ -254,10 +255,14 @@
 				}).then(res => {
 					if(res.status == 200){
 						this.detail = res.data
-						if(res.data && res.data.productPicList){
-							res.data.productPicList.forEach(item => {
-								this.imgList.push(item.imageUrl||'/static/def_imgs.png')
-							})
+						if(res.data){
+							if(res.data.productPicList){
+								res.data.productPicList.forEach(item => {
+									this.imgList.push(item.imageUrl||'/static/def_imgs.png')
+								})
+							}else{
+								this.imgList.push(res.data.productMsg||'/static/def_imgs.png')
+							}
 							const a = res.data.shopPromoProduct
 							let bprice = res.data.price
 							if(a){
@@ -281,8 +286,6 @@
 							  }
 							}
 							res.data.priceStr = Number(bprice).toFixed(2).toString().split('.')
-						}else{
-							this.imgList.push(res.data.productMsg||'/static/def_imgs.png')
 						}
 					}
 					uni.hideLoading()
@@ -372,41 +375,41 @@
 							qty: this.qty,
 							price:this.detail.price,
 						}]}).then(res => {
-					uni.hideLoading()
-					if(res.status == 200){
-						const successList = res.data.successList.map(item => {
-							return {
-								productSn:item.productSn,
-								productCode: item.productCode,
-								qty: item.qty,
-								price:item.price
-							}
-						})
-						const removeList = res.data.removeList.map(item => item.productCode)
-						const selloutList = res.data.selloutList.map(item => item.productCode)
-						// 有已下架或已售罄产品提示
-						if(removeList.length || selloutList.length){
-							uni.showModal({
-								title: '提示',
-								content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
-								showCancel: successList.length,
-								confirmText: successList.length?'确定':'知道了',
-								success(ret) {
-									if(ret.confirm && successList.length){
-										_this.submitForm(successList)
+							uni.hideLoading()
+							if(res.status == 200){
+								const successList = res.data.successList.map(item => {
+									return {
+										productSn:item.productSn,
+										productCode: item.productCode,
+										qty: item.qty,
+										price:item.price
 									}
+								})
+								const removeList = res.data.removeList.map(item => item.productCode)
+								const selloutList = res.data.selloutList.map(item => item.productCode)
+								// 有已下架或已售罄产品提示
+								if(removeList.length || selloutList.length){
+									uni.showModal({
+										title: '提示',
+										content: (removeList.length ? `产品${removeList.join(',')}已下架,`:'')+(selloutList.length?`产品${selloutList.join(',')}已售罄,`:'')+`不可采购。`+(successList.length?'是否继续采购其他产品?':''),
+										showCancel: successList.length,
+										confirmText: successList.length?'确定':'知道了',
+										success(ret) {
+											if(ret.confirm && successList.length){
+												_this.submitForm(successList)
+											}
+										}
+									})
+								}else{
+									// 直接提交
+									_this.submitForm(successList)
 								}
-							})
-						}else{
-							// 直接提交
-							_this.submitForm(successList)
-						}
-					}else{
-						uni.showToast({
-							title: res.message,
-							icon: 'none'
-						})
-					}
+							}else{
+								uni.showToast({
+									title: res.message,
+									icon: 'none'
+								})
+							}
 				})
 			},
 			submitForm(detailList){
@@ -677,7 +680,6 @@
 				}
 				.pupu-box{
 					display: flex;
-					align-items: center;
 					justify-content: space-between;
 					margin-top: 35px;
 					width: 100%;
@@ -686,12 +688,14 @@
 					border-radius: 6px;
 					border: 1px solid #eee;
 					overflow: hidden;
+					width: 80px;
+					height: 80px;
 				}
 				.popu-content-info{
 					padding: 0 0 0 10px;
 					flex-grow: 1;
 					overflow: hidden;
-					width: 80%;
+					width: 50%;
 					.popu-content-info-title{
 						font-size: 14px;
 					}
@@ -735,7 +739,7 @@
 				.popu-content-num{
 					font-size: 12px;
 					color: #999999;
-					padding: 0 10px;
+					padding: 10px 0;
 					> text{
 						margin-right: 10px;
 						font-size: 10px;
@@ -745,19 +749,25 @@
 					width: 100%;
 					display: flex;
 					align-items: center;
-					justify-content: center;
-					margin-top: 20px;
+					justify-content: space-around;
+					margin: 20px 0 10px;
 					.popu-content-btn-item{
-						width: 60%;
-						height: 40px;
-						background-color: #f70000;
-						color: #FFFFFF;
+						width: 45%;
+						height: 36px;
 						font-size: 14px;
 						display: flex;
 						align-items: center;
 						justify-content: center;
 						border-radius: 100px;
 					}
+					.cancelBtn{
+						background-color: #f8f8f8;
+						color: #666;
+					}
+					.okbtn{
+						background-color: #f70000;
+						color: #FFFFFF;
+					}
 				}
 		}
 	}

+ 9 - 1
uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

@@ -4,7 +4,7 @@
 			<text class="uni-numbox--text">-</text>
 		</view>
 		<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value"
-			:type="step<1?'digit':'number'" v-model="inputValue" :style="{background, color, width:widthWithPx}" />
+			:type="step<1?'digit':'number'" v-model="inputValue" :style="{background, color, width:widthWithPx,height:heightPx}" />
 		<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }">
 			<text class="uni-numbox--text">+</text>
 		</view>
@@ -67,6 +67,10 @@
 			width: {
 				type: Number,
 				default: 40,
+			},
+			height: {
+				type: Number,
+				default: 22
 			}
 		},
 		data() {
@@ -85,6 +89,9 @@
 		computed: {
 			widthWithPx() {
 				return this.width + 'px';
+			},
+			heightPx(){
+				return this.height + 'px'
 			}
 		},
 		created() {
@@ -174,6 +181,7 @@
 		display: flex;
 		/* #endif */
 		flex-direction: row;
+		align-items: center;
 	}
 
 	.uni-numbox-btns {