lilei 10 months ago
parent
commit
dedbe47dfd

+ 30 - 23
components/uni-number-box/uni-number-box.vue

@@ -1,14 +1,17 @@
 <template>
 	<view class="uni-numbox">
-		<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}">
-			<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }"
-				:style="{color}">-</text>
+		<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns">
+			<!-- <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }"
+				:style="{color}">-</text> -->
+			<uni-icons type="minus-filled" class="uni-numbox--text" size="24" :color="(inputValue <= min || disabled)?'#c0c0c0':btnBg"></uni-icons>
 		</view>
-		<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value"
+		<input v-if="!hideInput" :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value"
 			:type="step<1?'digit':'number'" v-model="inputValue" :style="{background, color, width:widthWithPx}" />
-		<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}">
-			<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }"
-				:style="{color}">+</text>
+		<view class="uni-numbox-read__value" v-else>{{inputValue}}</view>
+		<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns">
+			<!-- <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }"
+				:style="{color}">+</text> -->
+			<uni-icons type="plus-filled" class="uni-numbox--text" size="24" :color="(inputValue >= max || disabled)?'#c0c0c0':btnBg"></uni-icons>
 		</view>
 	</view>
 </template>
@@ -69,6 +72,14 @@
 			width: {
 				type: Number,
 				default: 40,
+			},
+			hideInput:{
+				type:Boolean,
+				default:false
+			},
+			btnBg:{
+				type: String,
+				default: '#066cff'
 			}
 		},
 		data() {
@@ -186,8 +197,9 @@
 		flex-direction: row;
 		align-items: center;
 		justify-content: center;
-		padding: 0 8px;
-		background-color: $bg;
+		width: $box-height;
+		height: $box-height;
+		line-height: $box-height;
 		/* #ifdef H5 */
 		cursor: pointer;
 		/* #endif */
@@ -203,24 +215,19 @@
 		border-width: 0;
 		color: $color;
 	}
-
-	.uni-numbox__minus {
-		border-top-left-radius: $br;
-		border-bottom-left-radius: $br;
-	}
-
-	.uni-numbox__plus {
-		border-top-right-radius: $br;
-		border-bottom-right-radius: $br;
+	.uni-numbox-read__value{
+		margin: 0 5px;
+		height: $box-height;
+		line-height: $box-height;
+		text-align: center;
+		font-size: 14px;
+		border-width: 0;
+		color: $color;
 	}
 
 	.uni-numbox--text {
 		// fix nvue
-		line-height: 20px;
-		margin-bottom: 2px;
-		font-size: 20px;
-		font-weight: 300;
-		color: $color;
+		color: #2196f3;
 	}
 
 	.uni-numbox .uni-numbox--disabled {

+ 3 - 3
pages/index/index.vue

@@ -58,8 +58,8 @@
 						</view>
 					</view>
 					<!-- 搜索 -->
-					<view class="search-head" v-if="hasShopiing">
-						<uni-search-bar radius="100" placeholder="请输入商品名称/产品编码/原厂编码" clearButton="auto" cancelButton="none" @confirm="toSearch"/>
+					<view class="search-head" v-if="hasShopiing" @click="toSearch">
+						<uni-search-bar readonly radius="100" placeholder="请输入商品名称/产品编码/原厂编码" clearButton="auto" cancelButton="none"/>
 					</view>
 				</view>
 				<view :class="hasShopiing?'body-box1':'body-box'">	
@@ -263,7 +263,7 @@
 						auth: this.hasLogin,
 						icon:'chaxunjilu',
 						name: 'VIN查询历史',
-						color:'#abc4ff',
+						color:'#97d695',
 						url:'/pagesA/vinRecord/vinRecord',
 						target: 'page'
 					}

+ 10 - 8
pagesA/digitalShelf/choosePart.vue

@@ -68,11 +68,11 @@
 					<!-- 其它配件 -->
 					<sticky-section>
 						<sticky-header>
-							<view class="nav-right-title flex align_center justify_between" @click="showOther=!showOther">
-								其它配件 <text>{{showOther?'隐藏':'展开'}}</text>
+							<view class="nav-right-title flex align_center justify_between">
+								其它配件
 							</view>
 						</sticky-header>
-						<list-view v-if="showOther">
+						<list-view>
 							<otherPartItem
 							v-for="(item,index) in partList"
 							:key="index"
@@ -129,7 +129,7 @@
 		@afterleave="closeCart">
 			<div class="cpb_cart-box">
 				<div class="cpb_close flex align_center justify_center" @click="showCart=false">
-					<uni-icons size="26" type="close"></uni-icons>
+					<uni-icons size="26" type="closeempty"></uni-icons>
 				</div>
 				<div class="cpb_cart-tit">
 					已选配件
@@ -137,7 +137,9 @@
 				<scroll-view type="list" scroll-y="true" class="cpb_cart-list">
 					<view class="nav-right-item flex" v-for="(item, index) in partListData" :key="item.productSn">
 						<view class="uni-col-2">
-							<u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_75,w_75,color_ffffff'" border-radius="30" width="150" height="150" bg-color="#EBEBEB" ></u-image>
+							<u-image 
+							:src="item.images ? item.images+'?x-oss-process=image/resize,m_fixed,h_80,w_80,color_ffffff' : '/static/def_imgs.png'" 
+							border-radius="30" width="150" height="150" bg-color="#EBEBEB" ></u-image>
 						</view>
 						<view class="item-info uni-col-10">
 							<view class="item-name">
@@ -173,7 +175,7 @@
 		<!-- 去认证 -->
 		<uni-popup ref="showPopup" type="center" :is-mask-click="false">
 			<view class="popu-modal">
-				<view class="popu-close" @click="$refs.showPopup.close()"><uni-icons type="close" size="26"></uni-icons></view>
+				<view class="popu-close" @click="$refs.showPopup.close()"><uni-icons type="closeempty" size="26"></uni-icons></view>
 				<image width="533" height="415" style="width: 533rpx;height: 415rpx;" src="/static/authimg.jpg"></image>
 				<view style="padding-top:1rem;" class="flex justify_center">
 					<button @click="toAuthStore()" shape="circle" :style="{background:'#066cff',color:'#fff',width:'350rpx'}">开始认证</button>
@@ -183,7 +185,7 @@
 		<!-- 价格查看 -->
 		<uni-popup ref="showPriceModal" type="center">
 			<view class="show-price-modal popu-modal" v-if="tempData">
-				<view class="popu-close" @click="$refs.showPriceModal.close()"><uni-icons type="close" size="26"></uni-icons></view>
+				<view class="popu-close" @click="$refs.showPriceModal.close()"><uni-icons type="closeempty" size="26"></uni-icons></view>
 				<view class="itemlist">
 					<text>产品编码</text>
 					<text>{{tempData.code||'--'}}</text>
@@ -239,7 +241,7 @@
 		},
 		data() {
 			return {
-				showOther: false,
+				showOther: true,
 				showPriceModal: false,
 				theme: '',
 				vinNumber: '',

+ 21 - 11
pagesA/digitalShelf/components/otherPartItem.vue

@@ -2,8 +2,12 @@
 	<block>
 		<view class="nav-right-item flex" v-for="item in list" :key="item.productSn">
 			<view class="uni-col-2">
-				<u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_60,w_60,color_ffffff'"
-					@click="viewImg(item)" border-radius="30" width="100" height="100" bg-color="#EBEBEB"></u-image>
+				<image 
+				:src="item.images ? item.images+'?x-oss-process=image/resize,m_fixed,h_60,w_60,color_ffffff' : '/static/def_imgs.png'" 
+				@click="viewImg(item)" 
+				style="width:100rpx;height:100rpx;border-radius: 30rpx;background-color: #EBEBEB;"
+				>
+				</image>
 			</view>
 			<view class="item-info uni-col-10">
 				<view class="item-name">
@@ -33,18 +37,18 @@
 									v-if="priceShowVal&&showShelfDetial"></uni-icons>
 							</view>
 							<view class="item-detail-text flex align_center" v-if="item.currentInven">
-								<button @click="addPart(item)" v-if="!item.checked"
-									:style="{width:'48rpx',height:'48rpx',background:'#066cff',borderRadius:'50px',padding:0,border:'none'}"
-									type="primary" size="mini">
-									<uni-icons type="plusempty" color="#fff" size="20"></uni-icons>
-								</button>
-								<uni-number-box v-else @change="e=>updateNums(e,item.productSn)" v-model="item.qty"
-									:min="0" :max="item.currentInven"></uni-number-box>
+								<view 
+								class="addbtn flex align_center justify_center"
+								@click="addPart(item)" 
+								v-if="!item.checked"
+								>
+									<uni-icons type="plusempty" color="#fff" size="18"></uni-icons>
+								</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="addPart(item)" v-if="!item.checked" class="phtxt">我要急送</text>
-								<uni-number-box v-else @change="e=>updateNums(e,item.productSn)" v-model="item.qty"
-									:min="0"></uni-number-box>
+								<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>
@@ -165,6 +169,12 @@
 
 						.item-detail-text {
 							color: #999;
+							.addbtn{
+								width:44rpx;
+								height:44rpx;
+								background:#066cff;
+								border-radius:50px;
+							}
 
 							.phtxt {
 								color: #0485F6;

+ 21 - 6
pagesA/digitalShelf/components/vinPartItem.vue

@@ -2,7 +2,12 @@
 	<block>
 		<view class="nav-right-item flex" v-for="item in list" :key="item.productSn">
 			<view class="uni-col-2">
-				<u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_60,w_60,color_ffffff'" @click="viewImg(item)" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
+				<image
+				:src="item.images ? item.images+'?x-oss-process=image/resize,m_fixed,h_60,w_60,color_ffffff' : '/static/def_imgs.png'" 
+				@click="viewImg(item)" 
+				style="width:100rpx;height:100rpx;border-radius: 30rpx;background-color: #EBEBEB;"
+				>
+				</image>
 			</view>
 			<view class="item-info uni-col-10">
 				<view class="item-name">
@@ -36,14 +41,18 @@
 								</view>
 							</view>
 							<view class="item-detail-text" v-if="item.currentInven">
-								<button @click="addPart(item)" v-if="!item.checked" :style="{width:'48rpx',height:'48rpx',background:'#066cff',borderRadius:'50px',padding:0,border:'none'}" type="primary" size="mini">
-									<uni-icons type="plusempty" color="#fff" size="20"></uni-icons>
-								</button>
-								<uni-number-box v-else @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0" :max="item.currentInven"></uni-number-box>
+								<view
+								class="addbtn flex align_center justify_center"
+								@click="addPart(item)" 
+								v-if="!item.checked"
+								>
+									<uni-icons type="plusempty" color="#fff" size="18"></uni-icons>
+								</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="addPart(item)" class="phtxt">我要急送</text>
-								<uni-number-box v-else @change="e=>updateVinNums(e,item.productSn)" v-model="item.qty" :min="0"></uni-number-box>
+								<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>
@@ -158,6 +167,12 @@
 						align-items: center;
 						.item-detail-text{
 							color: #999;
+							.addbtn{
+								width:44rpx;
+								height:44rpx;
+								background:#066cff;
+								border-radius:50px;
+							}
 							.phtxt{
 								color: #0485F6;
 								font-size: 28upx;

+ 1 - 1
pagesB/cart/index.vue

@@ -73,7 +73,7 @@
 							</view>
 							<view class="cart-footer-right-button">
 								<u-button v-if="!editFlag" type="error" shape="circle" @click="settlement">去结算</u-button>
-								<u-button v-else type="error" plain shape="circle" @click="batchRemove">删除</u-button>
+								<u-button v-else type="error" plain style="border:none;" shape="circle" @click="batchRemove">删除</u-button>
 							</view>
 						</view>
 					</view>

+ 10 - 6
pagesB/shopiing/productDetail.vue

@@ -73,7 +73,7 @@
 		@afterleave="closePopu">
 			<view class="popu-content">
 				<view class="popu-close" @click="showPopu=false">
-					<icon type="clear" size="24"></icon>
+					<uni-icons size="26" type="closeempty"></uni-icons>
 				</view>
 				<view class="pupu-box">
 					<view class="popu-content-img">
@@ -83,9 +83,9 @@
 						<view class="popu-content-info-title">【新品】Apple iPhone 13 Pro Max (A2644) 256GB 金色 支持移动联通电信5G 双卡双待手机</view>
 						<view class="popu-content-box">
 							<view class="popu-content-price">¥<text class="price-red">45.8</text></view>
-							<view class="popu-content-num">
-								<text>数量</text>
-								<u-number-box :min="1" :max="99"></u-number-box>
+							<view class="popu-content-num flex align_center">
+								<text style="margin-right: 5px;">数量</text>
+								<uni-number-box :min="1" :max="99"></uni-number-box>
 							</view>
 						</view>
 					</view>
@@ -241,6 +241,10 @@
 							.product-info-nums{
 								font-size: 12px;
 								color: #999999;
+								>view{
+									display: flex;
+									align-items: center;
+								}
 							}
 						}
 					}
@@ -375,7 +379,7 @@
 					margin-top: 10px;
 					.popu-content-price{
 						font-size: 14px;
-						color: #FF0000;
+						color: #eb0000;
 						.price-red{
 							font-size: 24px;
 						}
@@ -395,7 +399,7 @@
 					.popu-content-btn-item{
 						width: 100%;
 						height: 40px;
-						background-color: #FF0000;
+						background-color: #eb0000;
 						color: #FFFFFF;
 						font-size: 14px;
 						display: flex;

+ 35 - 14
pagesB/shopiing/searchProduct.vue

@@ -31,7 +31,7 @@
 					<!-- 搜索,吸顶 -->
 					<sticky-header>
 						<view class="search-head">
-							<uni-search-bar v-model="queryWord" radius="100" placeholder="请输入商品名称/产品编码/原厂编码" bgColor="#fff" textColor="#666" clearButton="auto" cancelButton="none" @confirm="searchList" @clear="searchList" />
+							<uni-search-bar v-model="queryWord" :focus="focus" radius="100" placeholder="请输入商品名称/产品编码/原厂编码" bgColor="#fff" textColor="#666" clearButton="auto" cancelButton="none" @confirm="searchList" @clear="searchList" />
 						</view>
 					</sticky-header>
 					<!-- 产品列表 -->
@@ -52,7 +52,13 @@
 					<view class="search-history" v-if="historyList.length&&queryWord==''&&clzId==''">
 						<view class="search-history-title">
 							<text>搜索记录</text>
-							<image @click="clearHistory" style="width: 30px; height: 30px;" mode="aspectFit" src="../static/del.png"></image>
+							<view class="search-history-right">
+								<view class="search-history-expend" v-if="searchHistoryList.length>10" @click="expend=!expend">
+									{{expend?'收起':'展开'}}
+									<uni-icons :type="expend?'arrowup':'arrowdown'" size="14"></uni-icons>
+								</view>
+								<uni-icons type="trash" size="18" @click="clearHistory" color="#eb0000"></uni-icons>
+							</view>
 						</view>
 						<view class="search-history-body">
 							<view class="item" v-for="item in historyList" :key="item.id" @click="toSearch(item)">
@@ -93,33 +99,38 @@
 				list: [],
 				loading:false,
 				loadEnd: false,
-				searchHistoryList: []
+				searchHistoryList: [],
+				focus: false,
+				expend: false
 			};
 		},
 		computed: {
 			historyList() {
-				return this.searchHistoryList.filter(item=>item.text!='')
+				return this.searchHistoryList.filter(item=>item.text!='').reverse().slice(0,this.expend?20:10)
 			}
 		},
 		onLoad(opts) {
-			this.clzId = opts.clzId
+			// 计算区域高度
+			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
+			this.screenWidth = uni.getSystemInfoSync().windowWidth
+			this.screenHeight = uni.getSystemInfoSync().windowHeight
+			this.safeAreaBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
 			
-			// 搜索历史
-			this.searchHistoryList = uni.getStorageSync('searchHistoryList') || []
+			// 分类id
+			this.clzId = opts.clzId
 			
+			// 搜索商品
 			if(opts.clzId==''){
 				this.title = '商城商品搜索'
-				this.queryWord = opts.queryWord
+				this.focus = true
 			}else{
+				// 分类下产品
 				this.title = opts.clzName
+				this.searchList()
 			}
-			this.searchList()
 			
-			// 计算区域高度
-			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
-			this.screenWidth = uni.getSystemInfoSync().windowWidth
-			this.screenHeight = uni.getSystemInfoSync().windowHeight
-			this.safeAreaBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
+			// 搜索历史
+			this.searchHistoryList = uni.getStorageSync('searchHistoryList') || []
 		},
 		methods: {
 			goBack(){
@@ -315,6 +326,16 @@
 						color: #333333;
 						border-bottom: 1px solid #E6E6E6;
 					}
+					.search-history-right{
+						display: flex;
+						align-items: center;
+					}
+					.search-history-expend{
+						display: flex;
+						align-items: center;
+						font-size: 12px;
+						margin-right: 15px;
+					}
 					.search-history-body{
 						display: flex;
 						flex-wrap: wrap;