Переглянути джерело

Merge branch 'master' of http://47.98.226.240:3000/twt/wxThird

* 'master' of http://47.98.226.240:3000/twt/wxThird:
  积分bug
  积分

# Conflicts:
#	pages/integral/exchangeRecord.vue
guo 2 роки тому
батько
коміт
4ccfaaa4cb

+ 9 - 3
pages.json

@@ -376,9 +376,15 @@
             {
                 "navigationStyle": "custom",
                 "enablePullDownRefresh": true
-            }
-            
-        }
+            }
+        },
+		{
+			"path": "pages/integral/rule",
+			"style": {
+				"navigationBarTitleText": "积分规则",
+				 "enablePullDownRefresh": false
+			}
+		}
     ],
 	"tabBar": {
 		"color": "#8a8a8a",

+ 4 - 3
pages/activity/jkDetail.vue

@@ -286,7 +286,7 @@
 				this.collectingID=opt.id;
 				//this.getInfo();
 				this.queryActivityInfo();
-				
+				this.queryGoodsLook()
 			}
 		   	
 		   }else{
@@ -300,10 +300,10 @@
 		   			this.collectingID=opt.id;
 		   			//this.getInfo();
 		   			this.queryActivityInfo();
-		   			
+		   			this.queryGoodsLook()
 		   		}
 		   		//this.queryActivityInfo();
-				this.queryGoodsLook()
+				
 		   	})
 		   }
 		  
@@ -335,6 +335,7 @@
 					 this.collectingID=res.data.goodsID;
 					 this.shareId=res.data.operatorID
 					 this.queryActivityInfo();
+					 this.queryGoodsLook()
 				 })
 			},
 			gowp(){

+ 1 - 1
pages/index/index.vue

@@ -186,7 +186,7 @@
 						<view class="goodsName">{{item.name}}</view>
 					    <view class="Sold">
 							<view v-if="item.showLabel&&item.showLabel.indexOf('3')!=-1">
-								已售 {{item.saleQty}}
+								已售 {{item.saleQty>0?item.saleQty:0}}
 							</view>
 						</view>
 						<view class="goodsPrice">

+ 8 - 7
pages/integral/exchangeRecord.vue

@@ -8,7 +8,7 @@
 
 				<view class="stateBox">
 					<view class="gray" v-if="item.hState==0">已取消</view>
-					<view class="red" v-if="item.hState==1">未兑换</view>
+					<view class="red" v-if="item.hState==1">未兑换</view>
 					<view class="green" v-if="item.hState==2">已兑换</view>
 					<image src="../../static/img/little_rightArrow.png" mode="" style="width: 24rpx;height: 24rpx;">
 					</image>
@@ -30,8 +30,8 @@
 
 			<view class="sum">
 				<span style="font-size: 24rpx; color: #666666; margin-right: 10rpx;">总计</span>
-				<span style="font-size: 32rpx; color: #FF0000; 
-font-weight: 500; margin-right: 5rpx;">{{item.integral}}</span>
+				<span style="font-size: 32rpx; color: #FF0000; font-weight: 500; margin-right: 5rpx;">{{item.integral}}</span>
+
 				<span style=" font-size: 24rpx; color: #FF0000;">积分</span>
 			</view>
 
@@ -172,10 +172,11 @@ font-weight: 500; margin-right: 5rpx;">{{item.integral}}</span>
 	.gray {
 		font-size: 24rpx;
 		color: #999999;
-	}
-	.green {
-		font-size: 24rpx;
-		color: #00A040;
+	}
+
+	.green {
+		font-size: 24rpx;
+		color: #00A040;
 	}
 
 	.red {

+ 35 - 4
pages/integral/integral.vue

@@ -2,7 +2,7 @@
 	<view class="box">
 		<view class="topBox">
 			<view class="topCont">
-				<view class="jfgz">
+				<view class="jfgz" @click="gorule">
 					<view class="jfgzTxt">积分规则</view>
 					<img src="../../static/timg/jthei.png" alt="" class="jfjt">
 				</view>
@@ -34,15 +34,15 @@
 				<img src="../../static/timg/renhuo.png" alt="" class="rehuoimg">
 			</view>
 			<view class="exchangeCont">
-				<scroll-view scroll-x="true" >
-					<view class="exchange">
+				<scroll-view scroll-x="true" class="scroll-viewX">
+					<!-- <view class="exchange"> -->
 						<view class="exchangeLine" v-for="(item,index) in hotlist" @click="goDetail(item.id)">
 							<img class="exchangeLineImg" v-if="item.img" :src="item.img" alt="">
 						    <image v-else src="../../static/timg/noimg.png" mode="" class="exchangeLineImg"></image>
 							<view class="exchangeName">{{item.name}}</view>
 							<view> <span class="jfspan1">{{item.integral}}</span> <span class="jfspan2">积分</span></view>
 						</view>
-					</view>
+					<!-- </view> -->
 					
 				</scroll-view>
 			</view>
@@ -69,6 +69,7 @@
 			<nodata v-if="list.length==0"></nodata>
 			
 		</view>
+		<img src="../../static/timg/btn_top@2x.png" alt="" class="btn_top" @click="btnTop">
 	</view>
 </template>
 
@@ -98,6 +99,17 @@
 			this.getintegralGoodsPage();
 		},
 		methods: {
+			btnTop(){
+			//滚动回到顶部
+			uni.pageScrollTo({
+			    scrollTop: 0, 
+			}); 
+			},
+			gorule(){
+				uni.navigateTo({
+					url:'rule'
+				})
+			},
 			getintegralInfo(){
 				
 				this.$http('openIntegralMall/integralInfo', {
@@ -188,6 +200,13 @@
 </script>
 
 <style scoped>
+	.btn_top{
+		width: 100rpx;
+		height: 100rpx;
+		position: fixed;
+		right: 24rpx;
+		bottom: 60rpx;
+	}
 .scroll-X{
 	width: 750rpx;
 }
@@ -201,6 +220,8 @@
 .exchangeLineImg2{
 	width: 341rpx;
 	height: 318rpx;
+	border-bottom: 1px solid #eee;
+	display: block;
 }
 .exchangeName2{
 	font-weight: 400;
@@ -221,6 +242,7 @@
 	border-radius: 16rpx;
 	border: 1px solid #EEEEEE;
 	overflow: hidden;
+	
 }
 .classificationBox{
 	display: flex;
@@ -296,10 +318,14 @@
 	border-radius: 16rpx;
 	border: 1px solid #EEEEEE;
 	overflow: hidden;
+	width: 272rpx;
+	display: inline-block;
 }
 .exchangeLineImg{
 	width: 270rpx;
 	height: 252rpx;
+	border-bottom: 1px solid #eee;
+	display: block;
 }
 .rehuoimg{
 	width: 26rpx;
@@ -411,4 +437,9 @@
 .topBottomLine{
 	text-align: center;padding-top: 40rpx;
 }
+.scroll-viewX{
+	    white-space: nowrap;
+	    width: 100%;
+		padding-bottom: 20rpx;
+}
 </style>

+ 1 - 1
pages/integral/integralConfirm.vue

@@ -12,7 +12,7 @@
 		     <view class="goodsRight">
 				 <view class="goodsName">{{jfgoodsDetail.name}}</view>
 				 <view class="goodsNumbox">
-					 <view class="Price">¥<span>{{jfgoodsDetail.salePrice}}</span> </view>
+					 <view class="Price" v-if="jfgoodsDetail.salePrice">¥<span>{{jfgoodsDetail.salePrice}}</span> </view>
 					 <view class="goodsNum">x{{goodsnum}}</view>
 				 </view>
 			 </view>

+ 34 - 13
pages/integral/integralgoodsDetail.vue

@@ -20,7 +20,7 @@
 		<view class="goodsName">{{info.name}}</view>
 		<view class="jfNumBox" style="padding-left: 24rpx;padding-bottom: 20rpx;">
 			<span class="jfspan1 jfspan11">{{info.integral}}</span> <span class="jfspan2">积分</span>
-			<span class="marketvalue">市场价 ¥{{info.salePrice}}</span>
+			<span class="marketvalue" v-if="info.salePrice">市场价 ¥{{info.salePrice}}</span>
 		</view>
 	
 		
@@ -57,9 +57,9 @@
 						<view class="goodsPriceTk">
 							<view class="jfNumBox">
 								<span class="jfspan1">{{info.integral}}</span> <span class="jfspan2">积分</span>
-								<span class="marketvalue">市场价 ¥{{info.salePrice}}</span>
+								<span class="marketvalue" v-if="info.salePrice">市场价 ¥{{info.salePrice}}</span>
 							</view>
-							<view class="surplus">剩余{{shopInfo.qty}}个</view>
+							<view class="surplus">剩余{{shopInfo.qty?shopInfo.qty:0}}个</view>
 						</view>
 					</view>
 				</view>
@@ -73,7 +73,7 @@
 					<view class="numJsbox">
 						<view class="numJj" @click="calculation(1)">-</view>
 						<view class="goodsnum">
-						 <input type="number" value="" v-model="goodsnum" class="goodsnumInput"/>
+						 <input type="number" value="" v-model="goodsnum" class="goodsnumInput" @input="goodsnumInput"/>
 						</view>
 						<view class="numJj" @click="calculation(2)">+</view>
 					</view>
@@ -81,17 +81,18 @@
 				<view class="buySHop" @click="ckShop" style="border-bottom: 1px solid #EEEEEE;">
 					<view>服务门店</view>
 					<view class="buyShopRight" >
-						<view v-if="shopInfo.shopId">{{shopInfo.shopName}}</view>
+						<view v-if="shopInfo.shopId">{{shopInfo.ShopName}}</view>
 						<view v-else>请选择</view>
 						<image src="../../static/timg/icon_arrow_right.png" mode="" class="buyShopRightJt"></image>
 					</view>
 				</view>
-				<view class="buySHop">
+				<view class="buySHop" v-if="info.oneCount&&info.dayCount">
 					<view>兑换限制</view>
 					<view class="buyShopRight" >
-						每人限兑{{info.oneCount}}个,每天限兑{{info.dayCount}}个
+						每人限兑{{info.oneCount?info.oneCount:0}}个,每天限兑{{info.dayCount?info.dayCount:0}}个
 					</view>
-				</view>
+				</view>
+				<view  class="buySHop" v-else></view>
 			</view>
 			
 			<view class="buybtnBox">
@@ -117,15 +118,15 @@
 	</view>
 <!-- 	<view :style="{color:colorX}">asdfas</view> -->
    <!-- 门店弹框 -->
-   <view class="baomingBox ckshopBox" v-if="ckshopShow">
-   	<view class="baomingCont">
+   <view class="baomingBox ckshopBox" v-if="ckshopShow" @click="noShowShop">
+   	<view class="baomingCont" @click.stop="">
    		<view class="bmTop">
    			<view class="bmTitle">选择门店</view>
    			<img src="../../static/timg/chahao.png" alt="" class="bmChimg" @click="noShowShop">
    		</view>
    		<view style="padding: 0 24rpx; height: 45vh;overflow-y: scroll;">
    			<view class="ckshopLine" v-for="(item,index) in info.shopList" @click="ckshop2(item)">
-				<view class="shopName"> {{item.shopName}}</view>
+				<view class="shopName"> {{item.ShopName}}</view>
    			    <view class="surplus" style="padding-top: 2rpx;">剩余{{item.qty?item.qty:0}}个</view>
    			</view>
    		</view>
@@ -204,6 +205,18 @@
 		methods: {
 			sharewx(){
 				
+			},
+			goodsnumInput(){
+				console.log(this.goodsnum)
+				var qty=this.shopInfo.qty?this.shopInfo.qty:0
+				if(this.goodsnum>qty){
+					uni.showToast({
+						title: '服务门店库存不足',
+						icon: 'none',
+						duration: 3000
+					});
+					this.goodsnum=qty
+				}
 			},
 			noShowShop(){
 				this.ckshopShow=false;
@@ -230,7 +243,7 @@
 				 },'GET').then(res => {
 						this.info=res.data;
 						if(this.info.details){
-							this.info.details = this.info.details.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
+							this.info.details = this.info.details.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block" ');
 							 this.info.details=this.info.details.replace(/\<p/gi, '<p style="display: inline-block"');
 						}
 						this.shopInfo=res.data.shopList[0];
@@ -256,6 +269,14 @@
 				})
 			},
 			goBuy(){
+				if(!this.shopInfo.qty){
+					uni.showToast({
+						title: '库存不足',
+						icon: 'none',
+						duration: 3000
+					});
+					return false;
+				}
 				if(!this.shopInfo.shopId){
 					uni.showToast({
 						title: '请选择服务门店',
@@ -271,7 +292,7 @@
 				 	data: that.info,
 				 	 success: function () {
 					   uni.navigateTo({
-				 	   	url:'integralConfirm?shopID='+that.shopInfo.shopId+'&shopName='+that.shopInfo.shopName+'&goodsnum='+that.goodsnum+'&avaIntegral='+that.avaIntegral
+				 	   	url:'integralConfirm?shopID='+that.shopInfo.shopId+'&shopName='+that.shopInfo.ShopName+'&goodsnum='+that.goodsnum+'&avaIntegral='+that.avaIntegral
 				 	   })
 				 	 }
 				 }); 

+ 38 - 0
pages/integral/rule.vue

@@ -0,0 +1,38 @@
+<template>
+ <view class="box">
+	<rich-text :nodes="integralRole" style="background: #fff;"></rich-text>
+ </view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				integralRole:'',
+			}
+		},
+		onLoad(opt) {
+			this.getdata()
+		},
+		methods: {
+			
+			getdata(){
+				uni.showLoading({
+					title: '加载中'
+				})
+				this.$http('openIntegralMall/integralInfo', {
+				 },'GET').then(res => {
+						uni.hideLoading();
+						this.integralRole=res.data.integralRole
+				 })
+			}
+		}
+	}
+</script>
+
+<style scoped>
+.box{
+	/* background: #ffffff;
+	min-height: 100vh; */
+}
+</style>

+ 2 - 2
pages/integral/scoreRecord.vue

@@ -25,13 +25,13 @@
 				<view class="plate" v-if="item.bizType==5">消费撤销</view>
 				<view class="plate" v-if="item.bizType==6">抵扣撤销</view>
 				<view class="plate" v-if="item.bizType==7">期初导入</view>
-				<view class="plate" v-if="item.bizType==8">兑换取</view>
+				<view class="plate" v-if="item.bizType==8">兑换取</view>
 				<view class="plate" v-if="item.bizType==9">每日签到</view>
 				<view class="plate" v-if="item.bizType==10">积分过期</view>
 				
 				
 				<view class="mileage" v-if="item.type==1">+{{item.integral}}</view>
-				<view class="jian" v-if="item.type==2">-{{item.integral}}</view>
+				<view class="jian" v-if="item.type==2" style="font-weight: 500;">-{{item.integral}}</view>
 			</view>
 			<view class="time">{{item.createTime}}</view>
 

+ 7 - 6
pages/shop/goodsDetail.vue

@@ -264,6 +264,7 @@
 			this.userInfo=this.$store.state.userInfo;
 			this.ext=this.$common.getExtStoreId();
 			//opt.scene='10003'
+			console.log(opt)
 			if(this.userInfo){
 				this.wxOpenData=this.$store.state.wxOpenData;
 				if(opt.scene&&opt.scene!='undefined'){
@@ -311,12 +312,12 @@
 				 })
 			},
 			gowp(){
-				// uni.scanCode({
-				// 	success: function (res) {
-				// 		console.log('条码类型:' + res.scanType);
-				// 		console.log(res)
-				// 	}
-				// });
+				//  uni.scanCode({
+				//  	success: function (res) {
+				//  		console.log('条码类型:' + res.scanType);
+				//  		console.log(res)
+				//  	}
+				//  });
 				// return false
 				var time=''
 				if(this.info.goodsDownTime){

+ 26 - 5
pages/shop/shop.vue

@@ -47,8 +47,8 @@
 				</view>
 			</view>
 	   </view>
-	   <scroll-view scroll-Y="true" class="scroll-Y goodsSw" >
-	   		<view class="goodsBox">
+	   <scroll-view scroll-y="true" class="scroll-Y goodsSw goodsBox" :scroll-top="scrollTop" @scroll="onscroll" >
+	   		<view><!--  class="goodsBox" -->
 	   			<view class="hotGoodsLine" v-for="(item,index) in list" @click="goDetail(item)">
 	   				<view>
 	   					<image :src="item.url" v-if="item.url" mode="" @error="defImg()" class="hotGoodsLineImg"></image>
@@ -101,7 +101,7 @@
 		</view>
 	</view>
 	
-	
+	<img src="../../static/timg/btn_top@2x.png" alt="" class="btn_top" @click="btnTop">
 </view>
 </template>
 
@@ -138,6 +138,7 @@
 				shopcategoryID:'',
 				inputChShow:false,
 				ext:'',
+				scrollTop:0,
 			}
 		},
 		  watch:{
@@ -192,10 +193,22 @@
 			}
 		},
 		methods: {
+			btnTop(){
+				this.$nextTick(function() {
+						this.scrollTop = 0
+				});
+			},
+			onscroll(e){
+				//console.log(e)
+				this.scrollTop = e.detail.scrollTop
+			},
 			empty(){
 				console.log("情况")
 				this.name='';
 				this.inputChShow=false;
+				this.list=[];
+				this.page=1;
+				this.getlistOpenGoodsPage()
 			},
 			decryptPhoneNumber: function(e) {
 			  console.log(e);
@@ -301,7 +314,7 @@
 				this.getlistOpenGoodsPage()
 			},
 			ssList(){
-				this.topIndex=1;
+				this.topIndex=0;
 				this.list=[];
 				this.page=1;
 				this.getlistOpenGoodsPage()
@@ -444,6 +457,13 @@
 </script>
 
 <style scoped lang="less">
+	.btn_top{
+		width: 100rpx;
+		height: 100rpx;
+		position: fixed;
+		right: 24rpx;
+		bottom: 60rpx;
+	}
 	.timeTbox{
 			
 			height: 60rpx;
@@ -547,7 +567,8 @@ z-index: 11;
 	
 }
 .goodsBox{
-	min-height: calc(100vh - 280rpx);
+	// height: calc(100vh - 280rpx);
+	// padding-bottom: 120rpx;
 }
 .classificationBox{
 	display: flex;