소스 검색

首页 商城

twt 2 년 전
부모
커밋
65c9d260aa
8개의 변경된 파일242개의 추가작업 그리고 46개의 파일을 삭제
  1. 46 3
      pages/index/confirmYuyue.vue
  2. 25 37
      pages/index/index.vue
  3. 160 2
      pages/shop/shop.vue
  4. BIN
      static/timg/btn_top@2x.png
  5. BIN
      static/timg/icon_arrow_pre@2x.png
  6. BIN
      static/timg/icon_arrow_up_pre@2x.png
  7. BIN
      static/timg/icon_search@2x.png
  8. 11 4
      store/index.js

+ 46 - 3
pages/index/confirmYuyue.vue

@@ -16,7 +16,7 @@
 				<span class="stars">*</span> <span>预约车辆</span>
 			  </view>
 			  <view class="kklineRight">
-				  <span>请选择</span>
+				  <span>{{carInfo.plateNumber?carInfo.plateNumber:'请选择'}}</span>
 				  <img src="../../static/timg/icon_arrow_right.png" alt="" class="rightJt">
 			  </view>
 		  </view>
@@ -78,18 +78,61 @@
 				timedata:'',
 				billDate:'',
 				yuyueData:'',
+				carInfo:'',
 			}
 		},
 		onLoad() {
 			console.log(this.$store.state.yuyueData)
-			this.yuyueData=this.$store.state.yuyueData
+			this.yuyueData=this.$store.state.yuyueData;
+			this.carInfo=this.$store.state.carInfo
 			this.userInfo = uni.getStorageSync("userInfo");
 			//this.getOrderTimes()
 		},
 		
 		methods: {
 			yuyue(){
-				
+				if(!this.billDate){
+					uni.showToast({
+						title: '请选择预约时间',
+						icon: 'none',
+						duration: 3000
+					});
+					return false;
+				}
+				this.$http('openreservation/saveOrderSheet', {
+				  billDate: this.billDate,
+				  comment: this.comment,
+				  carID: this.carInfo.id,
+				  orderItem: this.yuyueData.map(item => item.ID).join(),
+				  shopId: this.userInfo.shopId,
+				  unionId: this.userInfo.unionId
+				 },'POST').then(res => {
+						if(res.code==0){
+							uni.showModal({
+							    title: '提示',
+							    content: '预约成功',
+								confirmText:'返回首页',
+								cancelText:'查看订单',
+							    success: function (res) {
+							        if (res.confirm) {
+							           // console.log('用户点击确定');
+									   uni.switchTab({
+									   	url:'index'
+									   })
+							        } else if (res.cancel) {
+							           // console.log('用户点击取消');
+							        }
+							    }
+							});
+
+						}else{
+							uni.showToast({
+								title: res.msg,
+								icon: 'none',
+								duration: 3000
+							});
+						}		
+				 })
 			},
 			changeTime(data){
 				console.log(data)

+ 25 - 37
pages/index/index.vue

@@ -53,65 +53,45 @@
 		</view>
 		
 		<!-- 服务顾问 -->
-		<view class="adviser">
+		<view class="adviser" v-if="homeCardList.openMUsers">
 			<view class="adviserLeft">
 				<img src="../../static/timg/pic_def_ava@2x.png" alt="" class="advisertx">
-				<view class="adviserNema">张三</view>
+				<view class="adviserNema">{{homeCardList.openMUsers.operatorName}}</view>
 				<view class="adviserms">服务顾问</view>
 			</view>
 			<img src="../../static/timg/icon_arrow_right.png" alt="" class="adviserJt">
 		</view>
 		<!-- 中间轮播模块 -->
-		<view class="modular">
+		<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">
-							<view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
-							<view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
-						</view>
-						<view class="itemLine">
-							<view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
-							<view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
-						</view>
-						<view class="itemLine">
-							<view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
-							<view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
-						</view>
-						<view class="itemLine">
-							<view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
-							<view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
-						</view>
-						<view class="itemLine">
-							<view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
-							<view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
+						<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>
+				<!-- <swiper-item>
 					<view class="swiper-item">
 						
 					</view>
-				</swiper-item>
+				</swiper-item> -->
 				
 			</swiper>
 		</view>
 		
-		<view class="advertisement">
+		<view class="advertisement" v-if="homeCardList.ad1.length>0">
 			<swiper class="swiper2" circular  :autoplay="false" :interval="interval"
 							:duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
-				<swiper-item>
+				<swiper-item v-for="(item,index) in homeCardList.ad1">
 					<view class="swiper-item2">
-						<image class="swiper-item2Img" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" mode=""></image>
+						<image class="swiper-item2Img" :src="item.icon" mode=""></image>
 					</view>	
 				</swiper-item>
-				<swiper-item>
-					<view class="swiper-item2">
-						<image class="swiper-item2Img" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" mode=""></image>
-					</view>
-				</swiper-item>
+				
 				
 			</swiper>
 		</view>
@@ -197,8 +177,8 @@
 				url:'',
 				wxOpenData:'',
 				code:'',
-				carInfo:{
-				}
+				carInfo:{},
+				homeCardList:'',
 			}
 		},
 		onLoad() {
@@ -220,7 +200,8 @@
 			// }); 
 			this.userInfo = uni.getStorageSync("userInfo");
 			if(this.userInfo){
-				this.getCarList()
+				this.getCarList();
+				this.queryHomeCardList()
 			}else{
 				this.uniLogin()
 			}
@@ -321,7 +302,7 @@
 							data: data.loginInfo.openUser,
 							 success: function () {
 							     that.getCarList()
-							 
+							     that.queryHomeCardList()
 							 }
 						}); 
 					}
@@ -333,7 +314,14 @@
 				   
 				  },'GET').then(res => {
 				 	this.carInfo=res.data[0]
-				 					
+				 	 this.$store.commit('mutationscarInfo', this.carInfo)				
+				  })
+			 },
+			 queryHomeCardList(){
+				 this.$http('openHome/queryHomeCardList', {
+				   
+				  },'GET').then(res => {
+				 		this.homeCardList=res.data
 				  })
 			 }
 			 

+ 160 - 2
pages/shop/shop.vue

@@ -1,6 +1,51 @@
 <template>
 <view class="box">
-	<view>商城</view>
+	<view class="topbox">
+		<view class="sstop">
+			<image src="../../static/timg/icon_search@2x.png" mode="" class="sstopimg"></image>
+			<input type="text" placeholder="请输入商品名称" class="sstopInput">
+		</view>
+		<scroll-view scroll-x="true" class="scroll-Y" >
+			<view class="classificationBox">
+				<view  class="classification" v-for="(item,index) in 8">
+					<view class="classificationName">分类名称一</view>
+					<view class="classificationHx"></view>
+				</view>
+			</view>
+	   </scroll-view>
+	   <view class="paixuBox">
+			<view class="paixuLine">
+				默认排序
+			</view>
+			<view class="paixuLine">
+				销量
+			</view>
+			<view class="paixuLine">
+				价格
+			</view>
+	   </view>
+	   <scroll-view scroll-Y="true" class="scroll-Y goodsSw" >
+	   		<view class="goodsBox">
+	   			<view class="hotGoodsLine" v-for="(item,index) in 5">
+	   				<view>
+	   					<image src="../../static/timg/nocar.png" mode="" class="hotGoodsLineImg"></image>
+	   				</view>
+	   				<view class="hotGoodsLineRIght">
+	   					<view class="goodsName">德国马牌 Continental 全新升级6代 TechContct德国马牌 Continental 全新升级6代 TechContct</view>
+	   				    <view class="Sold">已售 999</view>
+	   					<view class="goodsPrice">
+	   						<view class="goodsPrice1">店庆价</view>
+	   						<view class="goodsPrice2">¥</view>
+	   						<view class="goodsPrice3">999</view>
+	   						<view class="goodsPrice3">¥893</view>
+	   					</view>
+	   				</view>
+	   			</view>
+	   		</view>
+	   </scroll-view>
+		
+	</view>
+	
 </view>
 </template>
 
@@ -34,5 +79,118 @@
 	background: #F4F5F7;
 	min-height: 100vh;
 }
-
+.sstopInput{
+	width: 626rpx;
+	height: 72rpx;
+	background: #F4F5F7;
+	border-radius: 36rpx;
+	line-height: 72rpx;
+	font-size: 28rpx;
+	padding-left: 76rpx;
+}
+.sstop{
+	position: relative;
+	padding-top: 24rpx;
+	padding-left: 24rpx;
+	background: #ffffff;
+}
+.sstopimg{
+	width: 40rpx;
+	height: 40rpx;
+	position: absolute;
+	left: 44rpx;
+	top: 40rpx;
+}
+.scroll-Y{
+	background: #ffffff;
+	width: 750rpx;
+}
+.classificationBox{
+	display: flex;
+	padding-bottom: 12rpx;
+}
+.classificationName{
+	white-space: nowrap;
+	font-size: 28rpx;
+	color: #3C3C3C;
+	line-height: 40rpx;
+	padding:24rpx 24rpx 8rpx 24rpx;
+}
+.classificationHx{
+	width: 40rpx;
+	height: 4rpx;
+	background: #F03B3B;
+	margin: 0 auto;
+}
+.paixuBox{
+	width: 750rpx;
+	height: 72rpx;
+	background: #FFFFFF;
+	margin-top: 20rpx;
+	display: flex;
+	justify-content: space-around;
+	}
+	.paixuLine{
+		line-height: 37rpx;font-size: 26rpx;color: #666666;padding-top: 18rpx;
+	}
+	.hotGoodsLine{
+		margin-top: 20rpx;
+		padding: 20rpx;
+		background: #FFFFFF;
+		border-radius: 16rpx;
+		display: flex;
+	}
+	.hotGoodsLineImg{
+		width: 208rpx;
+		height: 194rpx;
+		border-radius: 16rpx;
+		border: 1px solid #EEEEEE;
+	}
+	.goodsName{
+		font-size: 28rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #333333;
+		line-height: 40rpx;
+		text-overflow: -o-ellipsis-lastline;
+		overflow: hidden;				
+		text-overflow: ellipsis;		
+		display: -webkit-box;			
+		-webkit-line-clamp: 2;		
+		line-clamp: 2;					
+		-webkit-box-orient: vertical;
+	}
+	.hotGoodsLineRIght{
+		padding-left: 24rpx;
+	}
+	.goodsPrice{
+		display: flex;
+		padding-top: 10rpx;
+	}
+	.goodsPrice1{
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #F03B3B;
+	}
+	.goodsPrice2{
+		font-size: 22rpx;
+		font-weight: 400;
+		color: #F03B3B;
+	}
+	.goodsPrice3{
+		font-size: 32rpx;
+		font-weight: 400;
+		color: #F03B3B;
+	}
+	.goodsPrice3{
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #999999;
+	}
+	.Sold{
+		font-weight: 400;
+		color: #999999;
+		font-size: 24rpx;
+		padding-top: 8rpx;
+	}
 </style>

BIN
static/timg/btn_top@2x.png


BIN
static/timg/icon_arrow_pre@2x.png


BIN
static/timg/icon_arrow_up_pre@2x.png


BIN
static/timg/icon_search@2x.png


+ 11 - 4
store/index.js

@@ -5,24 +5,31 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
     state: {
 		yuyueData:'',
+		carInfo:'',
 	},
 	getters:{
 		getyuyueData(state){
 			return state.yuyueData
-	   },
-	   
+	    },
+	    getcarInfo(state){
+	    	return state.carInfo
+	    },
     },
     mutations: {
 		mutationsyuyueData(state,data){
 			state.yuyueData=data
 		},
-		
+		mutationscarInfo(state,data){
+			state.carInfo=data
+		},
 	},
     actions: {
 		actionsyuyueData(context,playload){
 			context.commit('mutationsyuyueData',playload)
 		},
-		
+		actionscarInfo(context,playload){
+			context.commit('mutationscarInfo',playload)
+		},
 	}
 })
 export default store