twt 2 år sedan
förälder
incheckning
e3d0754752

+ 2 - 1
ext.json

@@ -4,6 +4,7 @@
 	"directCommit": false,
 	"ext": {
 		"shopId": "E37BB296-5A08-4534-859D-B351BA611AF9",
-        "url":"http://api.dms.66km.com.cn"
+        "url":"http://api.dms.66km.com.cn",
+		"unionId":"EEADACCD-8A19-499D-8AD7-6975D2C93243"
 	}
 }

+ 9 - 1
pages.json

@@ -121,7 +121,15 @@
 				
             }
             
-        }
+        },
+		{
+		    "path" : "pages/shop/goodsDetail",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "商品详情"
+
+		    }
+		}
     ],
 	"tabBar": {
 		"color": "#8a8a8a",

+ 105 - 10
pages/index/index.vue

@@ -53,7 +53,7 @@
 		</view>
 		
 		<!-- 服务顾问 -->
-		<view class="adviser" v-if="homeCardList.openMUsers">
+		<view class="adviser" v-if="homeCardList.openMUsers" @click="goRoter">
 			<view class="adviserLeft">
 				<img src="../../static/timg/pic_def_ava@2x.png" alt="" class="advisertx">
 				<view class="adviserNema">{{homeCardList.openMUsers.operatorName}}</view>
@@ -162,10 +162,25 @@
 		
 		
 		<view style="height: 60rpx;"></view>
+		<!-- 手机号授权 -->
+		<view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
+			<view class="authorizCont" @click.stop="">
+				<view class="sqLogoBox">
+					logo
+				</view>
+				<view class="authorizName">这是小程序名称</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 @getphonenumber="decryptPhoneNumber" >shopId:{{shopId}}</view>
 		
-		<button type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">获取手机号</button> -->
+		 -->
 	</view>
 </template>
 
@@ -177,8 +192,9 @@
 				url:'',
 				wxOpenData:'',
 				code:'',
-				carInfo:{},
+				carInfo:'',
 				homeCardList:'',
+				authorizShow:false,
 			}
 		},
 		onLoad() {
@@ -208,6 +224,13 @@
 			
 		},
 		methods: {
+			addCar(){
+				if(!this.userInfo){
+					this.authorizShow=true;
+				}else{
+					
+				}
+			},
 			information(){
 				
 			},
@@ -215,9 +238,14 @@
 				
 			},
 			goRoter(url){
-				uni.navigateTo({
-					url:url
-				})
+				if(!this.userInfo){
+					this.authorizShow=true;
+				}else{
+					uni.navigateTo({
+						url:url
+					})
+				}
+				
 			},
 			decryptPhoneNumber: function(e) {
 			  console.log(e);
@@ -261,9 +289,11 @@
 				// this.code=e.code;
 				 this.$http('miniApp2/sys/getWxOpenID', {
 				   code:e.code,
-				   shopId:'E37BB296-5A08-4534-859D-B351BA611AF9'
+				   unionId:'EEADACCD-8A19-499D-8AD7-6975D2C93243'
 				  },'GET').then(res => {
 				 	this.wxOpenData=res.data;
+					
+					that.queryHomeCardList()
 					//that.wxPhoneLogin()
 					uni.setStorage({
 						key: 'wxOpenData',
@@ -278,8 +308,7 @@
 							key: 'userInfo',
 							data: that.wxOpenData.loginInfo.openUser,
 							 success: function () {
-							    // that.uniLogin()
-							 
+							   that.getCarList()
 							 }
 						}); 
 					}
@@ -291,12 +320,13 @@
 				 var that=this;
 				 this.$http('miniApp2/sys/wxPhoneLogin', {
 				   appId:'wx33053a645546ec31',
-				   shopId:'E37BB296-5A08-4534-859D-B351BA611AF9',
+				   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
 						uni.setStorage({
 							key: 'userInfo',
 							data: data.loginInfo.openUser,
@@ -330,6 +360,65 @@
 </script>
 
 <style scoped>
+	.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: 484rpx;
+		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: 140rpx;
+	}
+	.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;
+	}
 	.content{
 		min-height: 100vh;
 		background: #F4F5F7;
@@ -362,6 +451,9 @@
 		margin-left: 24rpx;
 		overflow: hidden;
 		
+	}
+	.carinfoBox2{
+		
 	}
 	.carinfoBox .carLogo{
 		width: 72rpx;height: 72rpx;
@@ -457,6 +549,9 @@
 	.shoptopbox{
 		margin-top: -200rpx;
 	}
+	.shoptopbox2{
+		margin-top: -160rpx;
+	}
 	.adviser{
 		width: 662rpx;
 		margin-left: 24rpx;

+ 174 - 0
pages/shop/goodsDetail.vue

@@ -0,0 +1,174 @@
+<template>
+<view class="box">
+	<view class="spwBox">
+		<swiper class="swiper" circular  :autoplay="false" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
+			<swiper-item>
+				<view class="swiper-item">
+					<img mode="aspectFit" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" alt="" class="swiper-itemImg">
+				</view>
+			</swiper-item>
+			<swiper-item>
+				<view class="swiper-item">
+					<img mode="aspectFit" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" alt="" class="swiper-itemImg">
+				</view>
+			</swiper-item>
+		</swiper>
+	</view>
+	<view class="shopCont">
+		<view class="shopCtop">
+			<view class="goodsPrice">
+				<view class="goodsPrice1">店庆价</view>
+				<view class="goodsPrice2">¥</view>
+				<view class="goodsPrice3">999</view>
+				<view class="goodsPrice4">¥893</view>
+			</view>
+			<view class="Sold">已售 999</view>
+		</view>
+		<view class="goodsName">德国马牌 Continental 全新升级6 TechContct 过长长长长长长长长换行</view>
+		<view class="goodsMd">这里展示商品卖点,如果后台没填则不展示</view>
+	</view>
+	
+	<view class="modeBox">
+		<view class="modeline">
+			<view class="modelineLeft">配送方式</view>
+			<view class="modeLineRight">到店取货</view>
+		</view>
+		<view class="modeline">
+			<view class="modelineLeft">限购数量</view>
+			<view class="modeLineRight">到店取货</view>
+		</view>
+		<view class="modeline">
+			<view class="modelineLeft">售后服务</view>
+			<view class="modeLineRight">到店取货</view>
+		</view>
+	</view>
+	
+</view>
+</template>
+
+<script>
+	export default {
+		components: {
+			
+		},
+		data() {
+			return {
+				userInfo:'',
+				
+			}
+		},
+		onLoad() {
+			
+			this.userInfo = uni.getStorageSync("userInfo");
+			//this.getOrderTimes()
+		},
+		
+		methods: {
+			
+			
+		}
+	}
+</script>
+
+<style scoped lang="less">
+
+.box{
+	background: #F4F5F7;
+	min-height: 100vh;
+}
+.swiper{
+	width: 750rpx;
+	height: 700rpx;
+	background: #FFFFFF;
+	border-bottom: 1px solid #EEEEEE;
+}
+.swiper-item{
+	width: 750rpx;
+	height: 700rpx;
+}
+.swiper-itemImg{
+	width: 750rpx;
+	height: 700rpx;
+}
+.shopCtop{
+	display: flex;
+	padding: 20rpx 24rpx;
+	justify-content: space-between;
+	background: #FFFFFF;
+}
+.goodsPrice{
+		display: flex;
+}
+.goodsPrice1{
+	font-size: 24rpx;
+	font-weight: 400;
+	color: #F03B3B;
+	padding-top: 14rpx;
+}
+.goodsPrice2{
+	font-size: 28rpx;
+	font-weight: 400;
+	color: #F03B3B;
+	padding-top: 10rpx;
+	padding-left: 14rpx;
+}
+.goodsPrice3{
+	font-size:28rpx;
+	font-weight: 400;
+	color: #F03B3B;
+	
+	padding-right: 10rpx;
+}
+.goodsPrice3{
+	font-size: 40rpx;
+	font-weight: 400;
+	color: #F03B3B;
+}
+.goodsPrice4{
+	font-size: 24rpx;
+	font-weight: 400;
+	color: #999999;
+	padding-top: 14rpx;
+}
+.Sold{
+		font-weight: 400;
+		color: #999999;
+		font-size: 24rpx;
+		padding-top: 10rpx;
+}
+.goodsName{
+	font-size: 30rpx;
+	line-height: 42rpx;
+	font-weight: 500;
+	color: #333333;
+	padding: 20rpx 24rpx;
+}
+.goodsMd{
+	font-weight: 400;
+	color: #999999;
+	font-size: 26rpx;
+	padding: 0 24rpx;
+	padding-bottom: 20rpx;
+}
+.shopCont{
+	background: #FFFFFF;
+}
+.modeBox{
+	margin-top:20rpx ;
+	padding: 5rpx 0;
+	background: #FFFFFF;
+}
+.modeline{
+	display: flex;
+	padding: 15rpx 24rpx;
+}
+.modelineLeft{
+	color: #999999;
+	font-size: 26rpx;
+	width: 200rpx;
+}
+.modeLineRight{
+	color: #333333;
+	font-size: 26rpx;
+}
+</style>

+ 58 - 6
pages/shop/shop.vue

@@ -7,9 +7,9 @@
 		</view>
 		<scroll-view scroll-x="true" class="scroll-Y" >
 			<view class="classificationBox">
-				<view  class="classification" v-for="(item,index) in 8">
+				<view  class="classification" v-for="(item,index) in 8" @click="topClick(index)">
 					<view class="classificationName">分类名称一</view>
-					<view class="classificationHx"></view>
+					<view class="classificationHx" v-if="topIndex==index"></view>
 				</view>
 			</view>
 	   </scroll-view>
@@ -18,15 +18,35 @@
 				默认排序
 			</view>
 			<view class="paixuLine">
-				销量
+				<view>销量</view>
+				<view class="paixuLineTbBox">
+					<view class="paixuLineTbtop">
+						<image v-if="!salessorts" src="../../static/timg/icon_arrow_up_pre@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIcons"></image>
+						<image v-else src="../../static/timg/icon_arrow_up_def@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIcons"></image>
+					</view>
+					<view class="paixuLineTbtop">
+						<image v-if="!salessortx" src="../../static/timg/icon_arrow_pre@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIconx"></image>
+						<image v-else src="../../static/timg/icon_arrow_def@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIconx"></image>
+					</view>
+				</view>
 			</view>
 			<view class="paixuLine">
-				价格
+				<view>价格</view>
+				<view class="paixuLineTbBox">
+					<view class="paixuLineTbtop">
+						<image v-if="!pricesorts" src="../../static/timg/icon_arrow_up_pre@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIcons"></image>
+						<image v-else src="../../static/timg/icon_arrow_up_def@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIcons"></image>
+					</view>
+					<view class="paixuLineTbtop">
+						<image v-if="!pricesortx" src="../../static/timg/icon_arrow_pre@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIconx"></image>
+						<image v-else src="../../static/timg/icon_arrow_def@2x.png" mode="" class="paixuLineTbtopIcon paixuLineTbtopIconx"></image>
+					</view>
+				</view>
 			</view>
 	   </view>
 	   <scroll-view scroll-Y="true" class="scroll-Y goodsSw" >
 	   		<view class="goodsBox">
-	   			<view class="hotGoodsLine" v-for="(item,index) in 5">
+	   			<view class="hotGoodsLine" v-for="(item,index) in 5" @click="goDetail(item)">
 	   				<view>
 	   					<image src="../../static/timg/nocar.png" mode="" class="hotGoodsLineImg"></image>
 	   				</view>
@@ -59,6 +79,13 @@
 		data() {
 			return {
 				userInfo:'',
+				salessort:false,
+				salessorts:false,
+				salessortx:false,
+				pricesort:false,
+				pricesorts:false,
+				pricesortx:false,
+				topIndex:0,
 			}
 		},
 		onLoad() {
@@ -68,13 +95,37 @@
 		},
 		
 		methods: {
-			
+			topClick(index){
+				this.topIndex=index
+			},
+			goDetail(){
+				uni.navigateTo({
+					url:'goodsDetail'
+				})
+			}
 			
 		}
 	}
 </script>
 
 <style scoped lang="less">
+.paixuLineTbtopIcon{
+	width: 16rpx;
+	height: 8rpx;
+	display: block;
+	padding-left: 10rpx;
+}
+.paixuLineTbtopIconx{
+	padding-bottom:20rpx;
+}
+.paixuLineTbtopIcons{
+	padding-top: 6rpx;
+}
+.paixuLineTbBox{
+	display: flex;
+	flex-direction: column;
+	justify-content: space-between;
+}
 .box{
 	background: #F4F5F7;
 	min-height: 100vh;
@@ -132,6 +183,7 @@
 	}
 	.paixuLine{
 		line-height: 37rpx;font-size: 26rpx;color: #666666;padding-top: 18rpx;
+		display: flex;
 	}
 	.hotGoodsLine{
 		margin-top: 20rpx;

BIN
static/timg/icon_arrow_def@2x.png


BIN
static/timg/icon_arrow_up_def@2x.png


BIN
static/timg/icon_guanbi@2x.png


+ 1 - 1
utils/request.js

@@ -10,7 +10,7 @@ const http = (url = '', date = {}, type = 'POST', header = {
     return new Promise((resolve, reject) => {
 		header={};
 		const wxOpenData = uni.getStorageSync("wxOpenData");
-		if(wxOpenData){
+		if(wxOpenData.loginInfo){
 			header['token']=wxOpenData.loginInfo.token;
 			header['uid']=wxOpenData.loginInfo.uid; 
 		}