Browse Source

车辆的

twt 2 years ago
parent
commit
deb6b38788

+ 2 - 2
components/timeSelect/timeSelect.vue

@@ -82,9 +82,9 @@ export default {
 			uni.showLoading({
 				title: '加载中'
 			});
-			var userInfo = uni.getStorageSync("userInfo");
+			var yyshopInfo = uni.getStorageSync("yyshopInfo");
 			this.$http('opendetail/getOrderTimes', {
-				shopId:userInfo.shopId,
+				shopId:yyshopInfo.id,
 			}, 'GET').then(res => {
 				uni.hideLoading();
 				this.timeList = res.data || []

+ 76 - 2
pages/activity/activity.vue

@@ -1,6 +1,18 @@
 <template>
 <view class="box">
 	<view>集客活动</view>
+	
+	<!-- 手机号授权 -->
+	<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+		<view class="authorizCont" @click.stop="">
+			<view class="authorizName">{{wxOpenData.miniAppName}}</view>
+			<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
+			<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
+		</view>
+		<view style="text-align: center;padding-top: 56rpx;">
+			<image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
+		</view>
+	</view>
 </view>
 </template>
 
@@ -14,11 +26,14 @@
 		data() {
 			return {
 				userInfo:'',
+				authorizShow:false,
+				code:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad() {
-			
-			this.userInfo = uni.getStorageSync("userInfo");
+			this.userInfo=this.$store.state.userInfo;
+			this.wxOpenData=this.$store.state.wxOpenData
 			//this.getOrderTimes()
 		},
 		
@@ -34,5 +49,64 @@
 	background: #F4F5F7;
 	min-height: 100vh;
 }
+.authorizBox{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.5);
+		position: fixed;
+		top: 0;
+		left: 0;
+	}
+	.authorizCont{
+		margin-top: 30vh;
+		width: 564rpx;
+		height: 408rpx;
+		background: #FFFFFF;
+		border-radius: 24rpx;
+		margin-left: 93rpx;
+		position: relative;
+	}
+	.authorizCloseImg{
+		width: 62rpx;
+		height: 62rpx;
+	}
+	.sqLogoBox{
+		width: 180rpx;
+		height: 180rpx;
+		background: #FFFFFF;
+		border-radius: 90rpx;
+		text-align: center;
+		position: absolute;
+		top: -50rpx;
+		left: 192rpx;
+	}
+	.authorizName{
+		color: #333333;
+		line-height: 42rpx;
+		font-size: 30rpx;
+		text-align: center;
+		padding-top: 58rpx;
+	}
+	.authorizMs{
+		color: #999999;
+		line-height: 36rpx;
+		font-size: 26rpx;
+		width: 452rpx;
+		padding-top: 24rpx;
+		text-align: center;
+		margin-left: 56rpx;
+	}
+	.authorizContbutton{
+		width: 422rpx;
+		height: 88rpx;
+		background: #D53533;
+		border-radius: 44rpx;
+		line-height: 88rpx;
+		text-align: center;
+		font-size:30rpx;
+		color: #FFFFFF;
+		margin-top: 62rpx;
+		margin-left:71rpx;
+	}
 
 </style>

+ 24 - 23
pages/index/index.vue

@@ -23,7 +23,7 @@
 		        <view class="carinfoBoxTopCont">
 		          <view class="carinfoBoxTopContTop">
 		            <view class="carInfoplateNumber">{{carInfo.plateNumber}}</view>
-		            <view class="carTnfomilage">{{carInfo.milage?carInfo.milage:0}}km</view>
+		            <view class="carTnfomilage" v-if="carInfo.milage">{{carInfo.milage}}km</view>
 		          </view>
 		          <view class="carInfocarModel" v-if="carInfo.carModel">{{carInfo.carModel}}</view>
 		          <view class="carInfocarModel" v-else>暂无</view>
@@ -61,26 +61,14 @@
 			</view>
 			<img src="../../static/timg/icon_arrow_right.png" alt="" class="adviserJt">
 		</view>
-		<!-- 中间轮播模块 -->
+		<!-- 中间功能应用模块 -->
 		<view class="modular" v-if="homeCardList.application.length>0">
-			<swiper class="swiper" circular  :autoplay="false" :interval="interval"
-							:duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
-				<swiper-item>
 					<view class="swiper-item">
 						<view class="itemLine"  @click="goRoter('onlineBooking')"  v-for="(item,index) in homeCardList.application"> 
 							<view><img :src="item.icon" alt="" class="itemImg"></view>
 							<view class="Menusline">{{item.name}}</view>
-						</view>
-						
-					</view>
-				</swiper-item>
-				<!-- <swiper-item>
-					<view class="swiper-item">
-						
+						</view>	
 					</view>
-				</swiper-item> -->
-				
-			</swiper>
 		</view>
 		
 		<view class="advertisement" v-if="homeCardList.ad1.length>0">
@@ -165,7 +153,7 @@
 		<!-- 手机号授权 -->
 		<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
 			<view class="authorizCont" @click.stop="">
-				<view class="authorizName">这是小程序名称</view>
+				<view class="authorizName">{{wxOpenData.miniAppName}}</view>
 				<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
 				<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
 			</view>
@@ -192,6 +180,7 @@
 				carInfo:'',
 				homeCardList:'',
 				authorizShow:false,
+				miniAppName:'',
 			}
 		},
 		onLoad() {
@@ -222,19 +211,26 @@
 			}
 			
 		},
+		onShow() {
+			this.carInfo=this.$store.state.carInfo
+		},
 		methods: {
 			addCar(){
 				if(!this.userInfo){
 					this.authorizShow=true;
 				}else{
-					
+					uni.navigateTo({
+						url:'../user/addCar/addCar'
+					})
 				}
 			},
 			information(){
 				
 			},
 			changeCar(){
-				
+				uni.navigateTo({
+					url:'../user/addCar/cailist'
+				})
 			},
 			goRoter(url){
 				if(!this.userInfo){
@@ -286,7 +282,9 @@
 			 },
 			 getWxOpenID(e){
 				 var that=this;
-				// this.code=e.code;
+				 uni.showLoading({
+					title: '加载中'
+				 })
 				 this.$http('miniApp2/sys/getWxOpenID', {
 				   code:e.code,
 				   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243'
@@ -332,7 +330,8 @@
 				 	var data = res.data;
 					if(data.loginInfo){
 						this.userInfo=data.loginInfo.openUser;
-						this.$store.commit('mutationsuserInfo', this.userInfo)
+						this.$store.commit('mutationsuserInfo', this.userInfo);
+						this.$store.commit('mutationswxOpenData', data.loginInfo)
 						uni.setStorage({
 							key: 'userInfo',
 							data: data.loginInfo.openUser,
@@ -363,6 +362,7 @@
 				 this.$http('openHome/queryHomeCardList', {
 				   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243'
 				  },'GET').then(res => {
+					    uni.hideLoading();
 				 		this.homeCardList=res.data
 				  })
 			 }
@@ -562,7 +562,7 @@
 		margin-top: -200rpx;
 	}
 	.shoptopbox2{
-		margin-top: -160rpx;
+		margin-top: -170rpx;
 	}
 	.adviser{
 		width: 662rpx;
@@ -603,11 +603,12 @@
 	}
 	.modular{
 		width: 702rpx;
-		height: 313rpx;
+		/* height: 313rpx; */
 		background: #FFFFFF;
 		border-radius: 10px;
 		margin-top: 20rpx;
 		margin-left: 24rpx;
+		padding-bottom: 40rpx;
 	}
 	.swiper-item{
 		display: flex;
@@ -622,7 +623,7 @@
         color: #333333;
 	}
 	.itemLine{
-		width: 25%;
+		width: 20%;
 		text-align: center;
 		padding-top: 40rpx;
 	}

+ 9 - 1
pages/index/onlineBooking.vue

@@ -169,12 +169,20 @@
 				uni.showLoading({
 					title: '加载中'
 				})
+				var that=this;
 				this.$http('openreservation/getInfo', {
 					lat: this.location.lat ? this.location.lat : '',
 					lng: this.location.lng ? this.location.lng : '',
 					
 				}, 'GET').then(res => {
-					this.shopInfo = res.data.shopInfo
+					this.shopInfo = res.data.shopInfo;
+					uni.setStorage({
+						key: 'yyshopInfo',
+						data:that.shopInfo,
+						 success: function () {
+						    
+						 }
+					}); 
 				    this.listBigTags()
 				})
 			},

+ 115 - 7
pages/shop/shop.vue

@@ -65,6 +65,19 @@
 	   </scroll-view>
 	</view>
 	
+	<!-- 手机号授权 -->
+	<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+		<view class="authorizCont" @click.stop="">
+			<view class="authorizName">{{wxOpenData.miniAppName}}</view>
+			<view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
+			<button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
+		</view>
+		<view style="text-align: center;padding-top: 56rpx;">
+			<image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
+		</view>
+	</view>
+	
+	
 </view>
 </template>
 
@@ -95,14 +108,18 @@
 				list:[],
 				defaultImg: require("../../static/timg/noimg.png"),
 				defaultpxActive:true,
+				authorizShow:false,
+				code:'',
+				wxOpenData:'',
 			}
 		},
 		onLoad() {	 
-			this.userInfo = uni.getStorageSync("userInfo");
-			//this.getOrderTimes()
+			//this.userInfo = uni.getStorageSync("userInfo");
+			this.userInfo=this.$store.state.userInfo;
+			this.wxOpenData=this.$store.state.wxOpenData
 			this.getcategoryList();
 			this.getlistOpenGoodsPage();
-			uni.getLocation({
+			/* uni.getLocation({
 				type: 'gcj02',
 				success: function(res) {
 					console.log(res)
@@ -111,10 +128,37 @@
 				fail(err) {
 			     console.log(err)
 				}
-			});
+			}); */
 		},
 		
 		methods: {
+			decryptPhoneNumber: function(e) {
+			  console.log(e);
+			  this.code=e.detail.code
+			  this.wxPhoneLogin()
+			  this.authorizShow=false;
+			},
+			wxPhoneLogin(){
+					 var that=this;
+					 this.$http('miniApp2/sys/wxPhoneLogin', {
+					   appId:'wx33053a645546ec31',
+					   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243',
+					   code:this.code,
+					   openId:this.wxOpenData.openid
+					  },'POST').then(res => {
+						var data = res.data;
+						if(data.loginInfo){
+							this.userInfo=data.loginInfo.openUser;
+							this.wxOpenData=data.loginInfo;
+							this.$store.commit('mutationswxOpenData', data.loginInfo)
+							this.$store.commit('mutationsuserInfo', this.userInfo)
+						    this.topIndex=1;
+						    this.list=[];
+						    this.page=1;
+						    this.getlistOpenGoodsPage()
+						}	
+					  })
+			},
 			xlPx(num){
 				this.salessort=true;
 				this.defaultpxActive=false;
@@ -191,9 +235,14 @@
 				this.getlistOpenGoodsPage()
 			},
 			goDetail(item){
-				uni.navigateTo({
-					url:'goodsDetail?id='+item.id
-				})
+				if(!this.userInfo){
+					this.authorizShow=true;
+				}else{
+					uni.navigateTo({
+						url:'goodsDetail?id='+item.id
+					})
+				}
+				
 			},
 			getcategoryList(){
 				this.$http('openMall/categoryList', {
@@ -376,4 +425,63 @@
 		font-size: 24rpx;
 		padding-top: 8rpx;
 	}
+	.authorizBox{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.5);
+		position: fixed;
+		top: 0;
+		left: 0;
+	}
+	.authorizCont{
+		margin-top: 30vh;
+		width: 564rpx;
+		height: 408rpx;
+		background: #FFFFFF;
+		border-radius: 24rpx;
+		margin-left: 93rpx;
+		position: relative;
+	}
+	.authorizCloseImg{
+		width: 62rpx;
+		height: 62rpx;
+	}
+	.sqLogoBox{
+		width: 180rpx;
+		height: 180rpx;
+		background: #FFFFFF;
+		border-radius: 90rpx;
+		text-align: center;
+		position: absolute;
+		top: -50rpx;
+		left: 192rpx;
+	}
+	.authorizName{
+		color: #333333;
+		line-height: 42rpx;
+		font-size: 30rpx;
+		text-align: center;
+		padding-top: 58rpx;
+	}
+	.authorizMs{
+		color: #999999;
+		line-height: 36rpx;
+		font-size: 26rpx;
+		width: 452rpx;
+		padding-top: 24rpx;
+		text-align: center;
+		margin-left: 56rpx;
+	}
+	.authorizContbutton{
+		width: 422rpx;
+		height: 88rpx;
+		background: #D53533;
+		border-radius: 44rpx;
+		line-height: 88rpx;
+		text-align: center;
+		font-size:30rpx;
+		color: #FFFFFF;
+		margin-top: 62rpx;
+		margin-left:71rpx;
+	}
 </style>

+ 30 - 69
pages/user/addCar/cailist.vue

@@ -15,10 +15,10 @@
 					</view>
 				</view>
 				<view class="lineBottom">
-					<view class="lineDel" @click.stop="delCar(item.id)">删除</view>
-					<view class="lineDel" @click.stop="editCar(item.id)">编辑</view>
-					<view class="Default" v-show="item.isDefault!=1" @click.stop="defaultCar(item)">设为默认</view>
-					<view class="DefaultYES" v-show="item.isDefault==1">已设为默认</view>
+					<view class="lineDel" @click.stop="maintain(item.id)">编辑</view>
+					<view class="lineDel" @click.stop="delCar(item.id)">保养信息</view>
+					<!-- <view class="Default" v-show="item.isDefault!=1" @click.stop="defaultCar(item)">设为默认</view>
+					<view class="DefaultYES" v-show="item.isDefault==1">已设为默认</view> -->
 				</view>
 				<view class="DefaultIcon" v-show="item.isDefault==1">默认</view>
 			</view>
@@ -65,6 +65,9 @@
 			this.carId = uni.getStorageSync("maintainCarData").id
 		},
 		methods: {
+			maintain(){
+				
+			},
 			getqueryMyBMemberCar() {
 				uni.showLoading({
 					title: '加载中'
@@ -104,72 +107,28 @@
 					url: 'addCar?id=' + id + '&isEditCar=true'
 				})
 			},
-			delCar(id) {
-				var that = this;
-				uni.showModal({
-					title: '提示',
-					content: '确定要删除车辆吗',
-					success: function(res) {
-						if (res.confirm) {
-							uni.showLoading({});
-							that.$http('worldKeepCar/worldHome/deleteTMemberCar', {
-								id: id
-							}, 'POST').then(res => {
-								uni.hideLoading();
-								if (res.code == 0) {
-									if (that.carId == id) {
-										uni.removeStorageSync('maintainCarData');
-									}
-								}
-								that.getqueryMyBMemberCar()
-							})
-						} else if (res.cancel) {
-
-						}
-					}
-				});
-			},
-			defaultCar(item) {
-				var that = this;
-				uni.showLoading({
-					title: '保存中'
-				})
-				that.$http('worldKeepCar/worldHome/updateTCarIsdefault', {
-					id: item.id
-				}, 'POST').then(res => {
-					uni.hideLoading();
-					if (res.code == 0) {
-						uni.showToast({
-							title: '操作成功',
-							icon: 'none',
-							duration: 3000
-						});
-
-					} else {
-						uni.showToast({
-							title: res.msg,
-							icon: 'none',
-							duration: 3000
-						});
-					}
-					that.getqueryMyBMemberCar()
+			itemClick(item){
+				this.$store.commit('mutationscarInfo', item)
+				uni.navigateBack({
+				 	delta: 1
 				})
 			},
-			itemClick(item) {
-				if (this.fromMe == 'true') {
-					return
-				}
-				uni.setStorage({
-					key: 'maintainCarData',
-					data: item,
-					success: function() {
-						uni.navigateBack({
-							delta: 1
-						})
-
-					}
-				});
-			}
+			
+			// itemClick(item) {
+			// 	if (this.fromMe == 'true') {
+			// 		return
+			// 	}
+			// 	uni.setStorage({
+			// 		key: 'maintainCarData',
+			// 		data: item,
+			// 		success: function() {
+			// 			uni.navigateBack({
+			// 				delta: 1
+			// 			})
+
+			// 		}
+			// 	});
+			// }
 		}
 	}
 </script>
@@ -232,6 +191,7 @@
 
 	.brandLogo {
 		width: 63rpx;
+		height: 63rpx;
 	}
 
 	.line {
@@ -278,7 +238,7 @@
 	}
 
 	.lineDel {
-		width: 94rpx;
+		/* width: 94rpx; */
 		height: 50rpx;
 		border-radius: 25rpx;
 		border: 1px solid #DDDDDD;
@@ -287,6 +247,7 @@
 		font-size: 26rpx;
 		color: #3C3C3C;
 		margin-right: 29rpx;
+		padding: 0 20rpx;
 	}
 
 	.Default {

+ 2 - 1
pages/user/user.vue

@@ -211,7 +211,8 @@
 				}
 			});
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
-			const wxOpenData = uni.getStorageSync("wxOpenData");
+			//const wxOpenData = uni.getStorageSync("wxOpenData");
+			const wxOpenData = this.$store.state.wxOpenData;
 			if (wxOpenData) {
 				this.headImg = wxOpenData.loginInfo.customerInfo.headImgurl;
 				this.uid = wxOpenData.loginInfo.uid;