lilei 10 månader sedan
förälder
incheckning
a5b9b75a47
2 ändrade filer med 58 tillägg och 25 borttagningar
  1. 46 25
      pagesB/promoDetail.vue
  2. 12 0
      store/index.js

+ 46 - 25
pagesB/promoDetail.vue

@@ -18,7 +18,8 @@
 							</view>
 							</view>
 							<view>
 							<view>
 								<view class="product-name">{{item.productName}}</view>
 								<view class="product-name">{{item.productName}}</view>
-								<view class="product-guige">{{item.productOrigCode}}</view>
+								<view class="product-code">{{item.productCode}}</view>
+								<view class="product-guige ellipsis-two">{{item.productOrigCode}}</view>
 								<view class="product-button">
 								<view class="product-button">
 									<view class="price-txt">¥<text>{{item.cost}}</text></view>
 									<view class="price-txt">¥<text>{{item.cost}}</text></view>
 									<view>
 									<view>
@@ -59,7 +60,7 @@
 			:zIndex="100" 
 			:zIndex="100" 
 			mode="bottom" 
 			mode="bottom" 
 			border-radius="14" 
 			border-radius="14" 
-			height="100%" 
+			height="80%" 
 			@scrolltolower="onreachPopuBottom"
 			@scrolltolower="onreachPopuBottom"
 			@open="openRender"
 			@open="openRender"
 			@close="closePopu">
 			@close="closePopu">
@@ -67,7 +68,7 @@
 					<view class="choose-title">
 					<view class="choose-title">
 						<view>已选<text class="p-nums">{{chooseLength}}</text>款产品 </view>
 						<view>已选<text class="p-nums">{{chooseLength}}</text>款产品 </view>
 						<u-button @click="claerChoose" size="mini" type="error" plain style="margin: 0 20upx;">清空列表</u-button>
 						<u-button @click="claerChoose" size="mini" type="error" plain style="margin: 0 20upx;">清空列表</u-button>
-						<text class="choose-inf">左滑或数量0时删除产品</text>
+						<text class="choose-inf">左滑删除产品</text>
 					</view>
 					</view>
 					<view class="choose-product-list" v-if="showSwipeAction">
 					<view class="choose-product-list" v-if="showSwipeAction">
 						<u-swipe-action 
 						<u-swipe-action 
@@ -87,11 +88,12 @@
 									 </view>
 									 </view>
 									 <view class="choose-product-item-info">
 									 <view class="choose-product-item-info">
 										<view class="choose-product-item-left-info-name">{{item.productName}}</view>
 										<view class="choose-product-item-left-info-name">{{item.productName}}</view>
-										<view class="choose-product-item-left-info-guige">{{item.productOrigCode}}</view>
+										<view class="choose-product-item-left-info-code">{{item.productCode}}</view>
+										<view class="choose-product-item-left-info-guige ellipsis-two">{{item.productOrigCode}}</view>
 										<view class="choose-product-item-left-info-price">
 										<view class="choose-product-item-left-info-price">
 											<view class="price-txt">¥<text>{{item.cost}}</text></view>
 											<view class="price-txt">¥<text>{{item.cost}}</text></view>
 											<view>
 											<view>
-												<u-number-box v-model="item.qty" :index="item.id" :input-width="60" :input-height="60" size="mini" :min="0" @change="changeQty"></u-number-box>
+												<u-number-box v-model="item.qty" :index="item.id" :input-width="60" :input-height="60" size="mini" :min="1" @change="changeQty"></u-number-box>
 											</view>
 											</view>
 										</view>
 										</view>
 									 </view>
 									 </view>
@@ -121,12 +123,11 @@
 				queryWord: '',// 关键词查询列表
 				queryWord: '',// 关键词查询列表
 				// 查询条件
 				// 查询条件
 				pageNo: 1, // 当前页
 				pageNo: 1, // 当前页
-				pageSize: 10,//每页条数
+				pageSize: 8,//每页条数
 				list: [], // 产品列表
 				list: [], // 产品列表
 				total: 0, // 总记录
 				total: 0, // 总记录
 				showChoosePopu: false,//已选列表弹框
 				showChoosePopu: false,//已选列表弹框
 				chooseList:[], // 已选数据
 				chooseList:[], // 已选数据
-				chooseAllList:[], // 已选原始所有数据
 				chooseProductList:[], // 已选弹框中当前数据
 				chooseProductList:[], // 已选弹框中当前数据
 				chooseOptions:[
 				chooseOptions:[
 					{
 					{
@@ -139,7 +140,7 @@
 				screenWidth: 750, // 屏幕宽度
 				screenWidth: 750, // 屏幕宽度
 				showSwipeAction: false, // 已选弹框是否一打开
 				showSwipeAction: false, // 已选弹框是否一打开
 				choosePageNo: 1, // 已选产品当前页
 				choosePageNo: 1, // 已选产品当前页
-				choosePageSize: 8, // 已选产品每页数
+				choosePageSize: 4, // 已选产品每页数
 				chooseTotal: 0 ,// 已选产品总记录数
 				chooseTotal: 0 ,// 已选产品总记录数
 				promoActiveSn: null, // 活动sn
 				promoActiveSn: null, // 活动sn
 			}
 			}
@@ -228,7 +229,6 @@
 			},
 			},
 			// 关闭已选列表弹框
 			// 关闭已选列表弹框
 			closePopu(){
 			closePopu(){
-				this.chooseAllList = []
 				this.chooseProductList = []
 				this.chooseProductList = []
 				this.showChoosePopu=false
 				this.showChoosePopu=false
 			},
 			},
@@ -237,11 +237,11 @@
 				if(this.chooseLength){
 				if(this.chooseLength){
 					this.showChoosePopu = !this.showChoosePopu
 					this.showChoosePopu = !this.showChoosePopu
 					if(this.showChoosePopu){
 					if(this.showChoosePopu){
-						this.chooseAllList = JSON.parse(JSON.stringify(this.chooseList))
+						console.log(this.chooseList)
 						// 默认加载第一页数据
 						// 默认加载第一页数据
 						this.choosePageNo = 1
 						this.choosePageNo = 1
-						this.chooseTotal = this.chooseAllList.length
-						this.chooseProductList = this.chooseTotal > this.choosePageSize ? this.chooseAllList.slice(0,this.choosePageSize) : this.chooseAllList
+						this.chooseTotal = this.chooseList.length
+						this.chooseProductList = this.chooseTotal > this.choosePageSize ? this.chooseList.slice(0,this.choosePageSize) : this.chooseList
 					}
 					}
 				}else{
 				}else{
 					this.$u.toast(`请选择产品`);
 					this.$u.toast(`请选择产品`);
@@ -256,7 +256,7 @@
 				this.choosePageNo = this.choosePageNo + 1
 				this.choosePageNo = this.choosePageNo + 1
 				const start = (this.choosePageNo-1)*this.choosePageSize
 				const start = (this.choosePageNo-1)*this.choosePageSize
 				const end = this.choosePageNo*this.choosePageSize
 				const end = this.choosePageNo*this.choosePageSize
-				const list = this.chooseAllList.slice(start,end>this.chooseTotal?this.chooseTotal:end)
+				const list = this.chooseList.slice(start,end>this.chooseTotal?this.chooseTotal:end)
 				this.chooseProductList = this.chooseProductList.concat(list)
 				this.chooseProductList = this.chooseProductList.concat(list)
 				this.chooseProductList.splice()
 				this.chooseProductList.splice()
 			},
 			},
@@ -280,7 +280,7 @@
 					}
 					}
 				}else{
 				}else{
 					// 数量为0时,删除
 					// 数量为0时,删除
-					this.chooseClick(e.index,0)
+					// this.chooseClick(e.index,0)
 				}
 				}
 			},
 			},
 			//已选产品删除
 			//已选产品删除
@@ -336,7 +336,6 @@
 			// 清空已选数据
 			// 清空已选数据
 			clearChooseData(){
 			clearChooseData(){
 				this.chooseList = []
 				this.chooseList = []
-				this.chooseAllList = []
 				this.chooseProductList = []
 				this.chooseProductList = []
 				this.showChoosePopu = false
 				this.showChoosePopu = false
 				// 重置已选状态
 				// 重置已选状态
@@ -367,18 +366,29 @@
 			  queryPromoProductByPage(params).then(res => {
 			  queryPromoProductByPage(params).then(res => {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
 				  const list = res.data.list||[]
 				  const list = res.data.list||[]
-				  
+				  const ret = []
 				  // 更新已选状态
 				  // 更新已选状态
 				  list.map(k => {
 				  list.map(k => {
-					  // 如果筛选或分页后,重新更新页面列表产品数量
+					  // 如果筛选或分页后,更新页面列表产品数量
 					  const hasChecked = this.chooseList.find(s=>s.id == k.id)
 					  const hasChecked = this.chooseList.find(s=>s.id == k.id)
-					  k.checked = hasChecked
-					  if(hasChecked){
-						  k.qty = hasChecked.qty
-					  }
+					  ret.push({
+						  id: k.id,
+						  cost: k.cost,
+						  checked: hasChecked,
+						  qty: hasChecked ? hasChecked.qty : 0,
+						  productCode: k.productCode,
+						  productImage: k.productImage,
+						  productName: k.productName,
+						  productOrigCode: k.productOrigCode,
+						  promoActiveSn: k.promoActiveSn,
+						  promoRuleSn: k.promoRuleSn,
+						  promoRuleValue: k.promoRuleValue,
+						  promoRuleType: k.promoRuleType,
+						  show: false
+					  })
 				  })
 				  })
 				  
 				  
-				  _this.list = _this.list.concat(list)
+				  _this.list = _this.list.concat(ret)
 				  _this.total = res.data.count || 0
 				  _this.total = res.data.count || 0
 				} else {
 				} else {
 				  _this.list = []
 				  _this.list = []
@@ -507,17 +517,22 @@
 						&:first-child{
 						&:first-child{
 							position: relative;
 							position: relative;
 							overflow: hidden;
 							overflow: hidden;
+							border-bottom: 1px solid #eee;
 						}
 						}
 						&:last-child{
 						&:last-child{
-							padding: 20rpx 20rpx 60rpx 20rpx;
+							padding: 20rpx 20rpx 70rpx 20rpx;
 							position: relative;
 							position: relative;
 							flex-grow: 1;
 							flex-grow: 1;
 							.product-name{
 							.product-name{
 								font-size: 28rpx;
 								font-size: 28rpx;
 							}
 							}
+							.product-code{
+								margin: 10rpx 0 0;
+								color: #2196F3;
+							}
 							.product-guige{
 							.product-guige{
 								margin: 10rpx 0 20rpx 0;
 								margin: 10rpx 0 20rpx 0;
-								color: #666;
+								color: #888;
 								text{
 								text{
 									margin-right: 10rpx;
 									margin-right: 10rpx;
 								}
 								}
@@ -577,10 +592,12 @@
 					 width: 100%;
 					 width: 100%;
 				}
 				}
 				.choose-product-item-img{
 				.choose-product-item-img{
-					margin-right: 10rpx;
+					margin-right: 20rpx;
 					width: 35%;
 					width: 35%;
 					position: relative;
 					position: relative;
 					overflow: hidden;
 					overflow: hidden;
+					border: 1px solid #eee;
+					padding: 10rpx;
 					.back-price{
 					.back-price{
 						zoom: calc(0.8);
 						zoom: calc(0.8);
 					}
 					}
@@ -603,6 +620,10 @@
 					.choose-product-item-left-info-name{
 					.choose-product-item-left-info-name{
 						font-size: 28rpx;
 						font-size: 28rpx;
 					}
 					}
+					.choose-product-item-left-info-code{
+						color: #2196F3;
+						margin: 10rpx 0;
+					}
 					.choose-product-item-left-info-guige{
 					.choose-product-item-left-info-guige{
 						color: #666;
 						color: #666;
 						margin: 10rpx 0;
 						margin: 10rpx 0;

+ 12 - 0
store/index.js

@@ -118,6 +118,18 @@ const store = new Vuex.Store({
 			const permCodes = data.sysUserFlag == '0' ? null : data.auth_user.permCodes.filter(item => item.indexOf("_mini")>=0);
 			const permCodes = data.sysUserFlag == '0' ? null : data.auth_user.permCodes.filter(item => item.indexOf("_mini")>=0);
 			state.vuex_permCodes = permCodes;
 			state.vuex_permCodes = permCodes;
 			uni.setStorageSync('permCodes', permCodes);
 			uni.setStorageSync('permCodes', permCodes);
+		 
+			// 删除促销模块
+			const promoIndex = state.vuex_tabBarList.findIndex(item => item.text == '促销')
+			if(promoIndex > -1){
+				state.vuex_tabBarList.splice(promoIndex,1)
+			}
+			// 扫描按钮不局中
+			const scanTab = state.vuex_tabBarList.find(item => item.text == '扫描VIN')
+			if(scanTab){
+				scanTab.iconPath = "/static/tab/tab_scan_normal.png"
+				scanTab.midButton = false
+			}
         },
         },
         logout(state) {
         logout(state) {
 			console.log(state,'----logout------')
 			console.log(state,'----logout------')