lilei преди 11 месеца
родител
ревизия
b203deb4a4
променени са 8 файла, в които са добавени 116 реда и са изтрити 41 реда
  1. 0 23
      package-lock.json
  2. 11 1
      pages.json
  3. 4 0
      pages/index/index.vue
  4. 7 0
      pages/morePage/morePage.vue
  5. 10 0
      pages/promo/index.vue
  6. 7 0
      pages/videos/index.vue
  7. 47 17
      pagesB/promoDetail.vue
  8. 30 0
      pagesB/promoProduct.vue

+ 0 - 23
package-lock.json

@@ -1,23 +0,0 @@
-{
-  "name": "digitalshelf-mini-html",
-  "version": "1.0.0",
-  "lockfileVersion": 1,
-  "requires": true,
-  "dependencies": {
-    "async-validator": {
-      "version": "3.5.2",
-      "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-3.5.2.tgz",
-      "integrity": "sha512-8eLCg00W9pIRZSB781UUX/H6Oskmm8xloZfr09lz5bikRpBVDlJ3hRVuxxP1SxcwsEYfJ4IU8Q19Y8/893r3rQ=="
-    },
-    "moment": {
-      "version": "2.29.3",
-      "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
-      "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
-    },
-    "uview-ui": {
-      "version": "1.8.8",
-      "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-1.8.8.tgz",
-      "integrity": "sha512-Osal3yzXiHor0In9OPTZuXTaqTbDglMZ9RGK/MPYDoQQs+y0hrBCUD0Xp5T70C8i2lLu2X6Z11zJhmsQWMR7Jg=="
-    }
-  }
-}

+ 11 - 1
pages.json

@@ -429,6 +429,17 @@
 				"bounce":"none"
 			}
 		},
+		{
+			"path" : "promoProduct",
+			"style" : 
+			{
+				"navigationBarTitleText" : "促销产品列表",
+				"enablePullDownRefresh": false,
+				"titleView":false,
+				// 将回弹属性关掉
+				"bounce":"none"
+			}
+		},
 		{
 			"path" : "coupon",
 			"style" : 
@@ -450,7 +461,6 @@
 				"navigationBarTitleText" : "采购订单"
 			}
 		}
-			
 		]
 	}
 	],

+ 4 - 0
pages/index/index.vue

@@ -221,6 +221,7 @@
 		// 页面卸载
 		onUnload() {
 			uni.$off('refashHome')
+			uni.$off('refashProm')
 		},
 		// 下拉刷新
 		onPullDownRefresh(){
@@ -253,6 +254,9 @@
 			// 扫描vin
 			beforeSwitch(index){
 				const row = this.$store.state.vuex_tabBarList[index]
+				if(row.text == '促销'){
+					uni.$emit('refashProm')
+				}
 				if(row.text == '扫描VIN'){
 					this.openCamera()
 				}else{

+ 7 - 0
pages/morePage/morePage.vue

@@ -155,9 +155,16 @@
 					this.getPriceCofig()
 				}
 			},
+		// 页面卸载
+		onUnload() {
+			uni.$off('refashProm')
+		},
 		methods: {
 			beforeSwitch(index){
 				const row = this.$store.state.vuex_tabBarList[index]
+				if(row.text == '促销'){
+					uni.$emit('refashProm')
+				}
 				if(row.text == '扫描VIN'){
 					this.openCamera()
 				}else{

+ 10 - 0
pages/promo/index.vue

@@ -54,6 +54,13 @@
 		},
 		onLoad() {
 			this.pageInit()
+			uni.$on("refashProm",()=>{
+				this.pageInit()
+			})
+		},
+		// 页面卸载
+		onUnload() {
+			uni.$off('refashProm')
 		},
 		methods: {
 			pageInit(){
@@ -110,6 +117,9 @@
 			// 扫描vin
 			beforeSwitch(index){
 				const row = this.$store.state.vuex_tabBarList[index]
+				if(row.text == '促销'){
+					uni.$emit('refashProm')
+				}
 				if(row.text == '扫描VIN'){
 					this.openCamera()
 				}else{

+ 7 - 0
pages/videos/index.vue

@@ -74,6 +74,10 @@
 		onLoad() {
 			this.pageInit()
 		},
+		// 页面卸载
+		onUnload() {
+			uni.$off('refashProm')
+		},
 		onHide() {
 			this.list.map(item => {
 				item.showVideo = false
@@ -174,6 +178,9 @@
 			// 扫描vin
 			beforeSwitch(index){
 				const row = this.$store.state.vuex_tabBarList[index]
+				if(row.text == '促销'){
+					uni.$emit('refashProm')
+				}
 				if(row.text == '扫描VIN'){
 					this.openCamera()
 				}else{

+ 47 - 17
pagesB/promoDetail.vue

@@ -14,7 +14,7 @@
 						<view class="video-item">
 							<view>
 								<u-image :src="item.productImage+'?x-oss-process=image/resize,p_50'" height="140px" width="100%"></u-image>
-								<view class="back-price">返<text>{{item.promoRuleValue}}</text></view>
+								<view class="back-price">返<text>{{item.promoRuleValue}}</text></view>
 								<view class="product-code">{{item.productCode}}</view>
 							</view>
 							<view>
@@ -22,9 +22,13 @@
 								<view class="product-guige ellipsis-two">{{item.productOrigCode}}</view>
 								<view class="product-button">
 									<view class="price-txt">¥<text>{{item.cost}}</text></view>
-									<view>
-										<u-button v-if="!item.checked" :throttle-time="50" @click="chooseProduct(item)" size="mini" type="primary" shape="circle"><u-icon name="plus"></u-icon></u-button>
-										<u-button v-else :throttle-time="50" @click="chooseProduct(item)" size="mini" type="success" shape="circle"><u-icon name="plus"></u-icon>{{item.qty}}</u-button>
+									<view @click="chooseProduct(item)">
+										<view class="cart-add" :class="!item.checked?'colr-add':'colr-checks'">
+											<u-icon v-if="!item.checked" color="#fff" name="plus"></u-icon>
+											<view v-else>
+												<u-icon name="plus" color="#fff"></u-icon>{{item.qty}}
+											</view>
+										</view>
 									</view>
 								</view>
 							</view>
@@ -85,7 +89,7 @@
 							 <view>
 								 <view class="choose-product-item-img">
 									<u-image :src="item.productImage+'?x-oss-process=image/resize,p_50'" height="200rpx" width="100%"></u-image>
-									<view class="back-price">返<text>{{item.promoRuleValue}}</text></view>
+									<view class="back-price">返<text>{{item.promoRuleValue}}</text></view>
 									<view class="choose-product-item-left-info-code">{{item.productCode}}</view>
 								 </view>
 								 <view class="choose-product-item-info">
@@ -142,6 +146,7 @@
 				choosePageSize: 4, // 已选产品每页数
 				chooseTotal: 0 ,// 已选产品总记录数
 				promoActiveSn: null, // 活动sn
+				submitOk: false
 			}
 		},
 		computed: {
@@ -183,6 +188,9 @@
 			// 查询产品列表
 			this.pageInit()
 		},
+		onShow() {
+			this.showChoosePopu=false
+		},
 		onUnload() {
 			// 存储已选列表值
 			const hasCache = this.$store.state.vuex_cartList.find(k => k.sn == this.promoActiveSn)
@@ -243,9 +251,15 @@
 			closePopu(){
 				this.chooseProductList = []
 				this.showChoosePopu=false
+				if(this.submitOk){
+					uni.navigateTo({
+						url: '/pagesB/procureOrder'
+					})
+				}
 			},
 			// 打开已选产品列表
 			openChoose(){
+				this.submitOk = false
 				if(this.chooseLength){
 					this.showChoosePopu = !this.showChoosePopu
 					if(this.showChoosePopu){
@@ -391,6 +405,7 @@
 						  checked: hasChecked,
 						  qty: hasChecked ? hasChecked.qty : 0,
 						  productCode: k.productCode,
+						  productSn: k.productSn,
 						  productImage: k.productImage,
 						  productName: k.productName,
 						  productOrigCode: k.productOrigCode,
@@ -436,11 +451,9 @@
 						detailList: detailList
 					}).then(res => {
 						if(res.status == 200){
-							this.clearChooseData()
 							this.$store.state.vuex_tempData = res.data
-							uni.navigateTo({
-								url: '/pagesB/procureOrder?id='+res.id
-							})
+							this.clearChooseData()
+							this.submitOk = true
 						}
 						uni.hideLoading()
 					})
@@ -493,7 +506,7 @@
 							overflow: hidden;
 							border-bottom: 1px solid #eee;
 							.product-code{
-								color: #2196F3;
+								color: #666;
 								position: absolute;
 								width: 100%;
 								left:0;
@@ -511,7 +524,7 @@
 							}
 							.product-guige{
 								margin: 10rpx 0 20rpx 0;
-								color: #888;
+								color: #2196F3;
 								text{
 									margin-right: 10rpx;
 								}
@@ -527,6 +540,23 @@
 							width: 100%;
 							padding: 0 20rpx;
 						}
+						.cart-add{
+							padding: 6rpx 15rpx;
+							border-radius: 30rpx;
+							background: #2196F3;
+							color: #fff;
+							display: flex;
+							align-items: center;
+							justify-content: center;
+							font-size: 24rpx;
+						}
+						.colr-add{
+							background: #2196F3;
+							padding: 10rpx 20rpx;
+						}
+						.colr-checks{
+							background: #00aa00;
+						}
 					}
 				}
 			}
@@ -631,7 +661,7 @@
 						zoom: calc(0.8);
 					}
 					.choose-product-item-left-info-code{
-						color: #2196F3;
+						color: #666;
 						position: absolute;
 						width: 100%;
 						left:0;
@@ -659,7 +689,7 @@
 						font-size: 28rpx;
 					}
 					.choose-product-item-left-info-guige{
-						color: #666;
+						color: #2196F3;
 						margin: 10rpx 0;
 						text{
 							margin-right: 10rpx;
@@ -670,15 +700,15 @@
 		}
 		.back-price{
 			padding: 6rpx 55rpx;
-			background: rgba(255 ,87 ,34 , 0.6);
+			background: rgba(255 ,87 ,34 , 1);
 			position: absolute;
-			top: 16rpx;
-			left: -50rpx;
+			top: 10rpx;
+			right: -40rpx;
 			color: #fff;
 			z-index: 2;
 			font-size: 20rpx;
 			text-align: center;
-			transform: rotate(-40deg);
+			transform: rotate(40deg);
 			display: flex;
 			align-items: center;
 			text{

+ 30 - 0
pagesB/promoProduct.vue

@@ -0,0 +1,30 @@
+<template>
+	  
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				items:[]
+			}
+		},
+		onLoad() {
+			let items = []
+			let count = 1000
+			for (let i = 0; i < count; i++) {
+				items.push({ id: i, value: i })
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+.pages{
+	width: 100%;
+	height: 100%;
+}
+</style>