瀏覽代碼

年中活动

zhengjinyi 4 年之前
父節點
當前提交
febfcba804
共有 5 個文件被更改,包括 26 次插入41 次删除
  1. 2 2
      common/config/config.js
  2. 20 35
      h5/pages/activity/activity_mid.vue
  3. 1 1
      pages/goods/cart.vue
  4. 1 1
      pages/tabBar/cart/cart.vue
  5. 2 2
      services/ajax.env.js

+ 2 - 2
common/config/config.js

@@ -4,8 +4,8 @@ if(process.env.NODE_ENV === 'development'){
 	// URL_CONFIG = 'http://192.168.1.33:8008'	 //俊俊联调地址
 	// URL_CONFIG = 'http://192.168.1.40:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.20:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
-	// URL_CONFIG = 'https://spi.caimei365.com'
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+	URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境
     URL_CONFIG = 'https://spi.caimei365.com'

+ 20 - 35
h5/pages/activity/activity_mid.vue

@@ -27,7 +27,7 @@
 					<view class="name">{{item.classificationName}}</view>
 				</view>
 				<view class="section-main">
-					<view class="product-list" v-for="(pros, prosIndex) in item.productList" :key="prosIndex"  @click.stop="detailPage(pros.productID)">
+					<view class="product-list" v-for="(pros, prosIndex) in item.productList" :key="prosIndex"  @click.stop="detailPage(pros)">
 						<view class="list-rebate">{{pros.activityDiscount}}<text class="small">折</text></view>
 						<view class="list-image">
 							<image :src="pros.mainImage" mode=""></image>
@@ -96,7 +96,10 @@
 			  }, 
 			  dataList:[],
 			  scrollTopArray:[],
-			  scrollTopIndex:0
+			  scrollTopIndex:0,
+			  hanldeProductID:0,
+			  hanldeProductName:'',
+			  hanldeProductPrice:'',
 	        }
 	    },
 		onLoad() {
@@ -120,7 +123,6 @@
 						let productList = item.productList
 						let newProductList = []
 						this.scrollTopArray.push(index);
-						console.log(this.scrollTopArray)
 						// 处理商品价格
 						productList.forEach(el=>{
 							let value = el.retailPrice
@@ -155,14 +157,17 @@
 				uni.createSelectorQuery().select('.topBanner').boundingClientRect((data)=>{//最外层盒子节点
 				  uni.createSelectorQuery().select(classIndex).boundingClientRect((res)=>{//最外层盒子节点
 				    uni.pageScrollTo({
-				      duration:200,//过渡时间必须为0,uniapp bug,否则运行到手机会报错
-				      scrollTop:res.top - data.top - 60,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
+				      duration:300,//过渡时间必须为0,uniapp bug,否则运行到手机会报错
+				      scrollTop:res.top - data.top - 50,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
 				    })
 				  }).exec()
 				}).exec()
 			},
-			detailPage(id) {//跳转商品详情页
-				this.$api.navigateTo(`/pages/goods/product?id=${id}&path=activity`)
+			detailPage(item) {//跳转商品详情页
+				this.hanldeProductID = item.productID
+				this.hanldeProductName= item.name
+				this.hanldeProductPrice= item.retailPrice
+				this.$api.navigateTo(`/pages/goods/product?id=${item.productID}&path=activity`)
 			},
 			navigator(){
 				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
@@ -192,40 +197,21 @@
 				    duration: 600
 				});
 			},
-			createSelectorQuery(e){
+			createSelectorQuery(event){
 				let self = this
 				let indexLength = this.scrollTopArray.length
-				let index = this.scrollTopArray[0]
-				let index1 = this.scrollTopArray[1]
-				let index2 = this.scrollTopArray[2]
-				let index3 = this.scrollTopArray[3]
-				let index4 = this.scrollTopArray[4]
-				let index5 = this.scrollTopArray[5]
+				let index = this.scrollTopArray[2]
 				let classIndex  = '.activity-section-'+index;
-				let classIndex1  = '.activity-section-'+index1;
-				let classIndex2  = '.activity-section-'+index2;
-				let classIndex3  = '.activity-section-'+index3;
-				let classIndex4  = '.activity-section-'+index4;
-				let classIndex5  = '.activity-section-'+index5;
-				// this.scrollTopArray.forEach(el=>{
-					
-				// })
-				// console.log('滚动条=======>',classIndex)
-				this.onCreateSelectorQuery(index,classIndex)
-				this.onCreateSelectorQuery(index1,classIndex1)
-				this.onCreateSelectorQuery(index2,classIndex2)
-				this.onCreateSelectorQuery(index3,classIndex3)
-				this.onCreateSelectorQuery(index4,classIndex4)
-				this.onCreateSelectorQuery(index5,classIndex5)
+				this.onCreateSelectorQuery(event,index,classIndex)
 			},
-			onCreateSelectorQuery(index,classIndex){
+			onCreateSelectorQuery(event,index,classIndex){
 				let self = this
 				uni.createSelectorQuery().select(classIndex).boundingClientRect((res)=>{//最外层盒子节点4
-					console.log(res)
+					console.log('滚动条的高度==========>',event.scrollTop)
+					console.log('元素节点距离顶部的高度==========>', res.top)
 					if(res.dataset.index == index){
-						if( res.top ){
+						if( event.scrollTop == res.top ){
 							self.headTab.TabCur = index;
-							console.log('选项卡索引',self.headTab.TabCur)
 							self.headTab.scrollLeft = (index - 1) * 60;
 						}
 					}
@@ -255,8 +241,7 @@
 				this.showTop = false
 			}	
 			//锚点切换
-			// this.scrollTopIndex++
-			this.createSelectorQuery(e)
+			// this.createSelectorQuery(e)
 		},
 		onPullDownRefresh() {//下拉刷新
 			uni.stopPullDownRefresh()

+ 1 - 1
pages/goods/cart.vue

@@ -100,7 +100,7 @@
 						<view class="sum">总价:<text class="money-sign">¥</text><text class="money">{{allPrice.toFixed(2)}}</text></view>
 					</view>
 					<view v-if="!isshowDelbtn" class="footer-ri" >
-						<view class="btn" @tap="toConfirmation">去结算({{allCount}})</view>
+						<view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
 					</view>
 					<view v-else class="footer-del">
 						<view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>

+ 1 - 1
pages/tabBar/cart/cart.vue

@@ -99,7 +99,7 @@
 						<view class="sum">总价:<text class="money-sign">¥</text><text class="money">{{allPrice.toFixed(2)}}</text></view>
 					</view>
 					<view v-if="!isshowDelbtn" class="footer-ri" >
-						<view class="btn" @tap="toConfirmation">去结算({{allCount}})</view>
+						<view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
 					</view>
 					<view v-else class="footer-del">
 						<view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>

+ 2 - 2
services/ajax.env.js

@@ -4,8 +4,8 @@ if(process.env.NODE_ENV === 'development'){
 	// URL_CONFIG = 'http://192.168.1.33:8008'	 //俊俊联调地址
 	// URL_CONFIG = 'http://192.168.1.40:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.20:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
-	// URL_CONFIG = 'https://spi.caimei365.com'
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+	URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境
     URL_CONFIG = 'https://spi.caimei365.com'