Ver código fonte

维沙小程序bug修复

yuwenjun 4 anos atrás
pai
commit
6829d86d8b

+ 2 - 2
App.vue

@@ -14,8 +14,8 @@ export default {
 				let modelmes = e.model
 				self.$store.commit('setWindowHeight', e.windowHeight)
 				if (
-					modelmes.search('iPhone 11') ||
-					modelmes.search('iPhone 11 Pro Max') ||
+					modelmes.search('iPhone 11') != -1 ||
+					modelmes.search('iPhone 11 Pro Max') != -1 ||
 					modelmes.search('iPhone X') != -1
 				) {
 					//XS,XR,XS MAX均可以适配

+ 35 - 26
components/cm-module/listTemplate/productList.vue

@@ -40,37 +40,40 @@
 				<view class="list-details-info">
 					<!-- 商品名称 -->
 					<text class="list-details-title">{{ item.productName }}</text>
-					<text class="list-details-specs">规格:{{ item.unit != null ? item.unit : '' }}</text>
+					
 					<!-- <text class="list-details-specs">商品编码:{{ item.productCode != null ? item.productCode : '' }}</text> -->
-					<text class="list-details-miniQuantity">起订量:{{ item.ladderPriceFlag == '1' ? item.maxBuyNumber : item.minBuyNumber}}</text>
+					<!-- <text class="list-details-miniQuantity">起订量:{{ item.ladderPriceFlag == '1' ? item.maxBuyNumber : item.minBuyNumber}}</text> -->
 					<!-- 价格 -->
-					<view class="list-details-price prom">
-						<view class="floor-item-act" v-if="item.actStatus == 1">
-							<view class="floor-tags" v-if="PromotionsFormat(item.promotion)">
-								{{ item.promotion.name}}
-								<text>:¥{{ item.retailPrice | NumFormat }}</text>
+					<view class="price-box">
+						<view class="list-details-price prom">
+							<view class="floor-item-act" v-if="item.actStatus == 1">
+								<view class="floor-tags" v-if="PromotionsFormat(item.promotion)">
+									{{ item.promotion.name}}
+									<text>:¥{{ item.retailPrice | NumFormat }}</text>
+								</view>
+								<view class="floor-tags" v-else>{{ item.promotion.name }}</view>
 							</view>
-							<view class="floor-tags" v-else>{{ item.promotion.name }}</view>
-						</view>
-						<view class="floor-item-act" v-if="item.actStatus == 0 && item.ladderPriceFlag == 1">
-							<view class="floor-tags">阶梯价格</view>
-						</view>
-					</view>
-					<view class="list-details-price">
-						<view class="list-shop">
-							<view class="list-price-none" v-if="item.repurchasePriceState">
-								<text class="price-none">¥{{ item.discountPrice }}</text>
-								<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
+							<view class="floor-item-act" v-if="item.actStatus == 0 && item.ladderPriceFlag == 1">
+								<view class="floor-tags">阶梯价格</view>
 							</view>
-							<view class="list-price" v-else>
-								<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
-									¥{{(PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
-								</text>
+						</view>
+						<text class="list-details-specs">规格:{{ item.unit != null ? item.unit : '' }}</text>
+						<view class="list-details-price">
+							<view class="list-shop">
+								<view class="list-price-none" v-if="item.repurchasePriceState">
+									<text class="price-none">¥{{ item.discountPrice }}</text>
+									<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
+								</view>
+								<view class="list-price" v-else>
+									<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
+										¥{{(PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
+									</text>
+								</view>
 							</view>
+							<button class="add-cart-btn" @click.stop="operationHanld(item)">
+								购买
+							</button>
 						</view>
-						<button class="add-cart-btn" @click.stop="operationHanld(item)">
-							购买
-						</button>
 					</view>
 				</view>
 			</view>
@@ -341,6 +344,7 @@ export default {
 	}
 	.list-details-specs {
 		width: 100%;
+		font-size: 20rpx;
 		display: inline-block;
 		margin-top: 14rpx;
 		color: #999999;
@@ -351,14 +355,19 @@ export default {
 		margin-top: 7rpx;
 	}
 }
+.price-box{
+		position: absolute;
+		bottom: 0;
+	}
 .list-details-price {
 	width: 100%;
 	// line-height: 54rpx;
 	// margin-top: 10rpx;
 	// height: 54rpx;
+	
 	float: left;
 	&.prom{
-		height: auto;
+		min-height: 40rpx;
 		margin-top: 20rpx;
 	}
 	.floor-item-act{

+ 9 - 8
pages/goods/product.vue

@@ -49,7 +49,7 @@
 			</view>
 			<view class="container-product tui-skeleton" v-else>
 				<!-- 锚点 1 -->
-				<view class="container-product-main">
+				<view class="container-product-main product-details0">
 					<view class="product-top">
 						<!-- 轮播图 -->
 						<view class="banner-section">
@@ -164,7 +164,7 @@
 							</view>
 						</view>
 					</view>
-					<view class="product-details product-details0">
+					<view class="product-details ">
 						<view class="product-item-none" v-if="goodsData.isNoneDisabled">
 							<image class="none-image" :src="productNoneImage" mode=""></image>
 							<view class="none-text"
@@ -184,7 +184,8 @@
 					</view>
 				</view>
 				<!-- 锚点 2 -->
-				<view class="product-details product-details1">
+				<view class="product-details1"> </view>
+				<view class="product-details">
 					<!-- 商品详情 -->
 					<view class="title"> <view class="title-tab">商品详情</view> </view>
 					<view class="content tui-banner product-rich-text tui-skeleton-rect">
@@ -504,11 +505,11 @@ export default {
 				})
 				.catch(error => {
 					this.$util.msg(error.msg, 2000)
-					setTimeout(()=>{
+					setTimeout(() => {
 						uni.navigateBack({
-							delta:1
+							delta: 1
 						})
-					},1000)
+					}, 1000)
 				})
 		},
 		swiperChange(e) {
@@ -532,7 +533,7 @@ export default {
 			this.tabCurrentIndex = index
 			let classIndex = '.product-details' + index
 			uni.createSelectorQuery()
-				.select('.container-product-main')
+				.select('.container-product')
 				.boundingClientRect(data => {
 					//最外层盒子节点
 					uni.createSelectorQuery()
@@ -541,7 +542,7 @@ export default {
 							//最外层盒子节点
 							uni.pageScrollTo({
 								duration: 300, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
-								scrollTop: res.top - data.top - 150 //滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
+								scrollTop: res.top - data.top - 40 //滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
 							})
 							setTimeout(() => {
 								this.tabSelectFlag = false

+ 9 - 11
pages/index/index.vue

@@ -171,6 +171,12 @@ export default {
 			return value > 99 ? '99+' : value
 		}
 	},
+	onPullDownRefresh() {
+		//下拉刷新
+		if (this.hasLogin) {
+			this.GetWxAuthorize()
+		}
+	},
 	methods: {
 		...mapMutations(['login', 'logout']),
 		// 授权登录验证
@@ -187,6 +193,7 @@ export default {
 					this.getUserInfoPersonal(this.organizeId)
 					this.refresh = true
 					this.isRequest = true
+					uni.stopPullDownRefresh()
 				})
 				.catch(err => {
 					// 缓存游客openid
@@ -194,6 +201,7 @@ export default {
 					this.logout()
 					this.refresh = true
 					this.isRequest = true
+					uni.stopPullDownRefresh()
 				})
 		},
 		//初始化个人中心数据
@@ -251,17 +259,7 @@ export default {
 			// 	}
 			// })
 		},
-		//下拉刷新
-		onPullDownRefresh() {
-			if (this.hasLogin) {
-				this.GetWxAuthorize()
-				if (this.refresh) {
-					uni.stopPullDownRefresh()
-				}
-			} else {
-				uni.stopPullDownRefresh()
-			}
-		},
+		
 		onShareAppMessage(res) {
 			//分享转发
 			this.isShareModal = false

+ 26 - 17
pages/user/club/club-list.vue

@@ -41,10 +41,14 @@
 					class="club-scroll"
 					scroll-y="true"
 					@scrolltolower="getOnReachBottomData"
-					:style="{height: scrollHeight}"
+					:style="{ height: scrollHeight ,'padding-bottom':isIphoneX ? '44px' :''}"
 				>
 					<!-- 机构数据 -->
-					<view class="list" v-for="item in clubList" :key="item.userId">
+					<view
+						class="list"
+						v-for="item in clubList"
+						:key="item.userId"
+					>
 						<view class="list-left">
 							<view class="list-head"
 								><image
@@ -116,10 +120,12 @@ export default {
 			scrollHeight: '', //scoll-view高度
 			clubList: [],
 			showSearchModal: false, //模糊搜索框是否显示
-			organizeId: ''
+			organizeId: '',
+			isIphoneX: false
 		}
 	},
 	onLoad(data) {
+		this.isIphoneX = this.$store.state.isIphoneX
 		this.setScrollHeight()
 		// 获取传过来的organizeId
 		this.organizeId = data.id
@@ -138,14 +144,17 @@ export default {
 		},
 		// 设置scroll高度
 		setScrollHeight() {
-			console.log(this.$store.state.isIphoneX);
-			// 如果是苹果手机
-			if(this.$store.state.isIphoneX){
-				this.scrollHeight = this.$store.state.windowHeight - 100 - 44 + 'px'
-			}else{
-				this.scrollHeight = this.$store.state.windowHeight - 100 + 'px'
-			}
-			console.log(this.scrollHeight)
+			// 窗口高度 - 底部距离
+			const _that = this
+			uni.getSystemInfo({
+				success(res) {
+					if (_that.isIphoneX) {
+						_that.scrollHeight = res.windowHeight - 60  + 'px'
+					} else {
+						_that.scrollHeight = res.windowHeight - 60 + 'px'
+					}
+				}
+			})
 		},
 		async searchClubList() {
 			// 如果搜索框为空
@@ -156,12 +165,12 @@ export default {
 			this.searchKeyWords()
 		},
 		async searchKeyWords() {
-			console.log(this.searchInputVal);
+			console.log(this.searchInputVal)
 			this.pageNum = 1
 			this.clubList = await this.getClubList()
 			if (this.clubList.length <= 0) {
 				this.isEmpty = true
-			}else{
+			} else {
 				this.isEmpty = false
 			}
 		},
@@ -325,10 +334,10 @@ page,
 		background: #ffffff;
 	}
 }
-.empty-container{
+.empty-container {
 	background: #f7f7f7;
 	justify-content: flex-start;
-	.club-empty-image{
+	.club-empty-image {
 		margin-top: 400rpx;
 		margin-bottom: 36rpx;
 	}
@@ -431,8 +440,8 @@ page,
 					&.border-btn {
 						color: #333;
 					}
-					&:last-child{
-						background: rgb(25,25,25);
+					&:last-child {
+						background: rgb(25, 25, 25);
 						color: #fff;
 					}
 				}