Browse Source

商品详情 服务详情 接口对接完成 完善商家详情路由跳转

zxl 1 year ago
parent
commit
346139d5e3

+ 15 - 3
src/api/business.js

@@ -13,13 +13,25 @@ export function getSellerList(params){
       'Content-Type': 'application/x-www-form-urlencoded'
     }
   })
-}
+}
+
+// 获取商家详情信息
+export function getSellsDetail(id,data){
+  return request({
+    url:`/maintain/merchant/${id}`,
+    method: 'GET',
+    data: data,
+    header:{
+      'Content-Type': 'application/x-www-form-urlencoded'
+    }
+  })
+}
 
 /**
- * 获取商家详细信息
+ * 商品详情
  * @returns
  */
-export function getSellerDetails(id){
+export function getGoodsDetail(id){
   return request({
     url:`/maintain/goods/${id}`,
     method: 'GET',

+ 13 - 0
src/api/login.js

@@ -79,3 +79,16 @@ export function refreshToken(data) {
     },
   });
 }
+
+
+// 短信接口 - 发送验证码短信
+export function maintainSmsCaptcha(data) {
+  return request({
+    url: '/maintain/sms/captcha',
+    method: 'post',
+    data: data,
+    header: {
+      'Content-Type': 'application/json',
+    },
+  });
+}

+ 80 - 71
src/manifest.json

@@ -1,77 +1,86 @@
 {
-  "name": "",
-  "appid": "",
-  "description": "",
-  "versionName": "1.0.0",
-  "versionCode": "100",
-  "transformPx": false,
-  "app-plus": {
-    "usingComponents": true,
-    "splashscreen": {
-      "alwaysShowBeforeRender": true,
-      "waiting": true,
-      "autoclose": true,
-      "delay": 0
+    "name" : "",
+    "appid" : "",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
+    "app-plus" : {
+        "usingComponents" : true,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
+        },
+        "modules" : {
+            "Share" : {}
+        },
+        "distribute" : {
+            "android" : {
+                "permissions" : [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            "ios" : {},
+            "sdkConfigs" : {
+                "share" : {
+                    "weixin" : {
+                        "appid" : "wx593877b3c990b15c",
+                        "UniversalLinks" : ""
+                    }
+                }
+            }
+        }
     },
-    "modules": {},
-    "distribute": {
-      "android": {
-        "permissions": [
-          "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-          "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-          "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
-          "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-          "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-          "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-          "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-          "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
-          "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-          "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-          "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
-          "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-          "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
-          "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-          "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-          "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-          "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
-          "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-          "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
-          "<uses-feature android:name=\"android.hardware.camera\"/>",
-          "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
-          "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-        ]
-      },
-      "ios": {},
-      "sdkConfigs": {}
-    }
-  },
-  "quickapp": {},
-  "mp-weixin": {
-    "appid": "wx593877b3c990b15c",
-    "setting": {
-      "urlCheck": false
+    "quickapp" : {},
+    "mp-weixin" : {
+        "appid" : "wx593877b3c990b15c",
+        "setting" : {
+            "urlCheck" : false
+        },
+        "optimization" : {
+            "subPackages" : true
+        },
+        "usingComponents" : true,
+        "permission" : {
+            "scope.userLocation" : {
+                "desc" : "使用定位功能"
+            }
+        },
+        "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ]
+    },
+    "mp-alipay" : {
+        "usingComponents" : true
     },
-    "optimization": {
-      "subPackages": true
+    "mp-baidu" : {
+        "usingComponents" : true
     },
-    "usingComponents": true,
-    "permission": {
-      "scope.userLocation": {
-        "desc": "使用定位功能"
-      }
+    "mp-toutiao" : {
+        "usingComponents" : true
     },
-    "requiredPrivateInfos": ["getLocation", "chooseLocation"]
-  },
-  "mp-alipay": {
-    "usingComponents": true
-  },
-  "mp-baidu": {
-    "usingComponents": true
-  },
-  "mp-toutiao": {
-    "usingComponents": true
-  },
-  "mp-qq": {
-    "usingComponents": true
-  }
+    "mp-qq" : {
+        "usingComponents" : true
+    }
 }

+ 18 - 14
src/pages.json

@@ -2,7 +2,22 @@
   "easycom": {
     "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
   },
-  "pages": [
+  "pages": [
+    {
+      "path": "pages/tabbar/home/index",
+      "style": {
+        "navigationBarTitleText": "首页",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/login/index",
+      "style": {
+        "navigationBarTitleText": "登录"
+      }
+    },
+
+
     {
       "path": "pages/index",
       "style": {
@@ -10,13 +25,7 @@
         "navigationStyle": "custom"
       }
     },
-    {
-      "path": "pages/tabbar/home/index",
-      "style": {
-        "navigationBarTitleText": "首页",
-        "navigationStyle": "custom"
-      }
-    },
+
     {
       "path": "pages/tabbar/community/index",
       "style": {
@@ -70,12 +79,7 @@
         "navigationBarTitleText": "搜索"
       }
     },
-    {
-      "path": "pages/login/index",
-      "style": {
-        "navigationBarTitleText": "登录"
-      }
-    },
+
     {
       "path": "pages/login/phoneLogin",
       "style": {

+ 339 - 195
src/pages/business/detail.vue

@@ -1,207 +1,351 @@
 <template>
-	<view class="detail">
-		<!-- 轮播图 -->
-		<view class="carousel-map">
-			<u-swiper :list="list3" previousMargin="0" nextMargin="100" circular :autoplay="false" bgColor="#ffffff" />
-			<view class="carousel-item">
-				<view class="mark">
-					<view class="mark-item">{{merchant.score}}分</view>
-					<u-rate :count="count" v-model="value" active-color="#fff" inactive-color="#fff" :size="12" />
-				</view>
-				<view class="good-item">近期有6266个购买者给了给好评</view>
-			</view>
-		</view>
-
-		<!-- 商家信息 -->
-		<view class="merchant-info">
-			<view class="info-title">
-				<view>{{merchant.name}}</view>
-				<text class="info-mark">{{merchant.sale/10000}}w+单</text>
-			</view>
-			<view class="info-tag">商家信息</view>
-			<view class="info-item">
-				<view class="info-text">
-					<view>营业时间:{{merchant.opening}}</view>
-					<view>电话号码:{{merchant.mobile}}</view>
-					<view>{{merchant.address}}</view>
-					<view class="distance">{{(merchant.distance/1000).toFixed(2)}}km</view>
-				</view>
-				<view class="info-icon">
-					<view class="info-map">
-						<u-icon name="map" size="25"></u-icon>
-						<view>导航</view>
-					</view>
-					<view class="info-map">
-						<u-icon name="phone" size="25"></u-icon>
-						<view>电话</view>
-					</view>
-				</view>
-			</view>
-		</view>
-
-		<service></service>
-	</view>
+  <view class="detail">
+    <!-- 轮播图 -->
+    <view class="carousel-map">
+      <u-swiper :list="list3" previousMargin="0" nextMargin="100" circular :autoplay="false" bgColor="#ffffff" />
+      <view class="carousel-item">
+        <view class="mark">
+          <view class="mark-item">{{merchant.score}}分</view>
+          <u-rate :count="count" v-model="value" active-color="#fff" inactive-color="#fff" :size="12" />
+        </view>
+        <view class="good-item">近期有6266个购买者给了给好评</view>
+      </view>
+    </view>
+
+    <!-- 商家信息 -->
+    <view class="merchant-info">
+      <view class="info-title">
+        <view>{{merchant.name}}</view>
+        <text class="info-mark">{{merchant.sale/10000}}w+单</text>
+      </view>
+      <view class="info-tag">商家信息</view>
+      <view class="info-item">
+        <view class="info-text">
+          <view>营业时间:{{merchant.opening}}</view>
+          <view>电话号码:{{merchant.mobile}}</view>
+          <view>{{merchant.address}}</view>
+          <view class="distance">{{(merchant.distance/1000).toFixed(2)}}km</view>
+        </view>
+        <view class="info-icon">
+          <view class="info-map">
+            <u-icon name="map" size="25"></u-icon>
+            <view>导航</view>
+          </view>
+          <view class="info-map" @click="handlerMakeCall">
+            <u-icon name="phone" size="25"></u-icon>
+            <view>电话</view>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <view class="list" v-for="(item,index) of goods" @click="handlerSkipGoodsDetail(item,index)">
+      <!-- <image class="img" :src="
+		      error || !loaded
+		        ? 'https://cdn.uviewui.com/uview/album/10.jpg'
+		        : goods.logo
+		    " mode="scaleToFill" @click="$Router.push(`/pages/business/detail?id=${item.id}`)"></image> -->
+      <image class="img" src="../../static/logo.png"></image>
+      <view>
+        <view class="item-text">{{ item.name }}</view>
+        <view class="item-flex">
+          <view class="star">
+            <u-rate :count="item.score" :size="14" />
+            <text class="line">|</text>
+            <text class="points">{{ item.score }}分</text>
+          </view>
+          <view>{{ item.score }}单</view>
+        </view>
+        <view class="list-item">
+          <view class="list-price">
+            <view class="item-l">券后价 <span>¥{{ (item.originalPrice).toFixed(2) }}</span> </view>
+            <view class="item-r">门市价 <span>¥{{ (item.specialPrice).toFixed(2) }}</span></view>
+          </view>
+          <view class="btn-box">
+            <button class='btn btn1' @click.stop="handlerService(item,index)">预约</button>
+            <button class='btn btn2' @click.stop="handlerSkipBuy(item,index)">购买</button>
+          </view>
+        </view>
+      </view>
+    </view>
+    <u-empty v-if="goods.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" > </u-empty>
+  </view>
 </template>
 
 <script>
-	import service from '@/components/service'
-	import { getSellerDetails } from '@/api/business.js'
-  import { getCurrentLocation } from '@/api/home';
-	export default {
-		data() {
-			return {
-				merchant: {},
-				goods: [],
-				count: 5,
-				value: 3,
-				list3: [],
-
-        queryParams:{  //请求参数
-          id:null,//商家ID
-          region:null,//地区编码
-          longitude:null,//经度
-          latitude:null,//纬度
+  import {
+    getSellsDetail
+  } from '@/api/business.js'
+  import {
+    getCurrentLocation
+  } from '@/api/home';
+  export default {
+    data() {
+      return {
+        merchant: {},
+        goods: [],
+        count: 5,
+        value: 3,
+        list3: [],
+
+        queryParams: { //请求参数
+          id: null, //商家ID
+          region: null, //地区编码
+          longitude: null, //经度
+          latitude: null, //纬度
         }
-			};
-		},
-    components: {
-    	service,
-    },
-    onLoad(option) {
-      this.queryParams.id = option.id
-    	this.handlerInitLocation()
-    },
-    methods:{
-      // 获取当前经纬度
-      handlerInitLocation(){
-        uni.getLocation({
-        	type: 'gcj02',
-        	success: res => {
-        		this.queryParams.longitude = res.longitude;
-        		this.queryParams.latitude = res.latitude;
-            let point = {
-              latitude: res.latitude,
-              longitude: res.longitude
-            }
-            getCurrentLocation(point).then(rc=>{
-              this.queryParams.region = rc.data.id
-              this.handlerInitList()
-            })
-        	},
-        	fail: (rs) => {
-            uni.showToast({
-              title:rs,
-              icon:'none'
-            })
-        	}
-        });
+      };
+    },
+    onLoad(option) {
+      this.queryParams.id = option.id
+      this.handlerInitLocation()
+    },
+    methods: {
+      // 获取当前经纬度
+      handlerInitLocation() {
+        uni.getLocation({
+          type: 'gcj02',
+          success: res => {
+            this.queryParams.longitude = res.longitude;
+            this.queryParams.latitude = res.latitude;
+            let point = {
+              latitude: res.latitude,
+              longitude: res.longitude
+            }
+            getCurrentLocation(point).then(rc => {
+              this.queryParams.region = rc.data.id
+              this.handlerInitList()
+            })
+          },
+          fail: (rs) => {
+            uni.showToast({
+              title: rs,
+              icon: 'none'
+            })
+          }
+        });
+      },
+      // 初始化列表
+      handlerInitList() {
+        getSellsDetail(this.queryParams.id, this.queryParams).then(res => {
+          this.merchant = res.data.merchant
+          this.goods = res.data.goods,
+          this.list3 = res.data.merchant.banners.map(h => h.url)
+        })
       },
-      // 初始化列表
-      handlerInitList(){
-        getSellerDetails(this.queryParams.id).then(res => {
-          console.log('res',res);
-        	// this.merchant = res.data.merchant
-        	// this.goods = res.data.goods,
-        	// this.list3 = res.data.merchant.banners.map(h => h.url)
+      // 点击拨打电话
+      handlerMakeCall(){
+        uni.makePhoneCall({
+          phoneNumber:this.merchant.mobile
         })
-      }
+      },
+      // 点击跳转到商品详情
+      handlerSkipGoodsDetail(item,index){
+        uni.navigateTo({
+          url:`/pages/business/service/detail?id=${item.id}`
+        })
+      },
+      // 预约
+      handlerService(item,index){
+        console.log('点击预约');
+      },
+      // 购买
+      handlerSkipBuy(item,index){
+        uni.navigateTo({
+          url:'/pages/order/order'
+        })
+      }
     }
-	};
+  };
 </script>
 
 <style lang="scss" scoped>
-	.detail {
-		min-height: 100vh;
-		background-color: #efefef;
-	}
-
-	// 轮播图
-	.carousel-map {
-		background-color: #fff;
-		padding: 0 20rpx;
-
-		.carousel-item {
-			height: 90rpx;
-			display: flex;
-			background-color: #fff7e0;
-			border-radius: 0 0 10rpx 10rpx;
-
-			.mark {
-				background-color: #ff4b04;
-				color: #fff;
-				padding: 20rpx;
-				border-radius: 0 0 0 10rpx;
-				box-sizing: border-box;
-
-				.mark-item {
-					text-align: center;
-				}
-			}
-
-			.good-item {
-				font-size: 24rpx;
-				color: #a39c85;
-				line-height: 90rpx;
-				margin-left: 40rpx;
-			}
-		}
-	}
-
-	// 商家信息
-	.merchant-info {
-		padding: 20rpx;
-		background-color: #fff;
-		margin-bottom: 20rpx;
-
-		.info-title {
-			display: flex;
-			justify-content: center;
-			font-size: 40rpx;
-			font-weight: bold;
-
-			.info-mark {
-				font-size: 12px;
-				font-weight: normal;
-				color: #999;
-				margin: 20rpx 0 20rpx 30rpx;
-			}
-		}
-
-		.info-tag {
-			width: 160rpx;
-			padding: 10rpx;
-			text-align: center;
-			border: 1px solid #5992bb;
-			color: #5992bb;
-			margin-bottom: 10rpx;
-		}
-
-		.info-item {
-			display: flex;
-			justify-content: space-between;
-
-			.info-text {
-				font-size: 30rpx;
-				line-height: 58rpx;
-				color: #212020;
-				font-weight: 600;
-
-				.distance {
-					font-size: 26rpx;
-					color: #555252;
-					font-weight: normal;
-				}
-			}
-
-			.info-icon {
-				display: flex;
-			}
-
-			.info-map {
-				padding: 10rpx;
-				font-size: 28rpx;
-				margin-top: 120rpx;
-			}
-		}
-	}
+  .detail {
+    min-height: 100vh;
+    background-color: #efefef;
+  }
+
+  // 轮播图
+  .carousel-map {
+    background-color: #fff;
+    padding: 0 20rpx;
+
+    .carousel-item {
+      height: 90rpx;
+      display: flex;
+      background-color: #fff7e0;
+      border-radius: 0 0 10rpx 10rpx;
+
+      .mark {
+        background-color: #ff4b04;
+        color: #fff;
+        padding: 20rpx;
+        border-radius: 0 0 0 10rpx;
+        box-sizing: border-box;
+
+        .mark-item {
+          text-align: center;
+        }
+      }
+
+      .good-item {
+        font-size: 24rpx;
+        color: #a39c85;
+        line-height: 90rpx;
+        margin-left: 40rpx;
+      }
+    }
+  }
+
+  // 商家信息
+  .merchant-info {
+    padding: 20rpx;
+    background-color: #fff;
+    margin-bottom: 20rpx;
+
+    .info-title {
+      display: flex;
+      justify-content: center;
+      font-size: 40rpx;
+      font-weight: bold;
+
+      .info-mark {
+        font-size: 12px;
+        font-weight: normal;
+        color: #999;
+        margin: 20rpx 0 20rpx 30rpx;
+      }
+    }
+
+    .info-tag {
+      width: 160rpx;
+      padding: 10rpx;
+      text-align: center;
+      border: 1px solid #5992bb;
+      color: #5992bb;
+      margin-bottom: 10rpx;
+    }
+
+    .info-item {
+      display: flex;
+      justify-content: space-between;
+
+      .info-text {
+        font-size: 30rpx;
+        line-height: 58rpx;
+        color: #212020;
+        font-weight: 600;
+
+        .distance {
+          font-size: 26rpx;
+          color: #555252;
+          font-weight: normal;
+        }
+      }
+
+      .info-icon {
+        display: flex;
+      }
+
+      .info-map {
+        padding: 10rpx;
+        font-size: 28rpx;
+        margin-top: 120rpx;
+      }
+    }
+  }
+
+  .list {
+    height: 250rpx;
+    background-color: #fff;
+    padding: 20rpx;
+    margin-bottom: 20rpx;
+    display: flex;
+
+    .img {
+      width: 120px;
+      height: calc(100% - 20rpx);
+      margin: 10rpx 20rpx 10rpx 0;
+    }
+
+    .item-text {
+      font-weight: bold;
+      margin: 10rpx 0 10rpx;
+      color: #333;
+    }
+
+    .item-flex {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      font-size: 28rpx;
+      margin: 0 20rpx 10rpx 0;
+      color: #0d0d0d66;
+
+      .star {
+        display: flex;
+
+        .line {
+          margin-left: 16rpx;
+          margin-top: 5rpx;
+          font-size: 22rpx;
+        }
+
+        .points {
+          color: #ff4b04;
+          font-size: 22rpx;
+          margin-top: 6rpx;
+          margin-left: 10rpx;
+        }
+      }
+    }
+
+    .list-item {
+      margin-top: 40rpx;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      .list-price {
+        .item-l {
+          color: #E35240;
+          font-weight: bold;
+          font-size: 32rpx;
+
+          span {
+            font-size: 40rpx;
+          }
+        }
+
+        .item-r {
+          color: #A8A8A8;
+          margin-top: 10rpx;
+
+          span {
+            text-decoration: line-through;
+          }
+        }
+      }
+
+      .btn-box {
+        display: flex;
+        margin-left: 30rpx;
+        .btn{
+          font-size: 28rpx;
+          height: 70rpx;
+        }
+        .btn1{
+          border-radius: 40rpx 0 0 40rpx;
+          border: 2rpx solid #EC5729;
+          color: #EC5729;
+          background-color: #fff;
+        }
+        .btn2{
+          color: #fff;
+          background-color: #EC5729;
+          border-radius: 0 40rpx 40rpx 0;
+        }
+      }
+
+    }
+  }
 </style>

+ 51 - 80
src/pages/business/service/detail.vue

@@ -2,8 +2,8 @@
 	<view class="service">
 		<view class="service-top">
 			<view class="item-flex">
-				<view class="title">【养车】标题标题标标题标题标题标题标题标题标题标题……</view>
-				<u-icon name="share-square" size="24" />
+				<view class="title">{{ goods.name }}</view>
+				<u-icon name="share-square" size="24" @click="handlerShare" />
 			</view>
 			<Image src="https://cdn.uviewui.com/uview/album/1.jpg"></Image>
 		</view>
@@ -11,9 +11,9 @@
 			<view class="price">
 				<view>
 					<view class="price-item">
-						<text class="price-text">¥</text>199
+						<text class="price-text">¥</text>{{ goods.originalPrice }}
 					</view>
-					<view class="bottom-text">门市价 ¥489</view>
+					<view class="bottom-text">门市价 ¥{{ goods.specialPrice }}</view>
 				</view>
 				<view>
 					<view class="favorable">优惠推荐</view>
@@ -21,19 +21,19 @@
 				</view>
 			</view>
 			<!-- 优惠券 -->
-			<view class="coupon flex" v-for="(item,index) in couponList" :key="index">
+			<view class="coupon flex" v-for="(item,index) in coupons" :key="index">
 				<view class="coupon-left flex">
 					<span class="coupon-left-mark">¥</span>
 					<span class="coupon-left-price">5</span>
 				</view>
 				<view class="coupon-middle flex">
-					<view class="coupon-middle-user over-hide">养车/用车品类新用户专享</view>
-					<view class="coupon-middle-type over-hide">养车用车服务通用</view>
+					<view class="coupon-middle-user over-hide">{{ item.name }}</view>
+					<view class="coupon-middle-type over-hide">{{ item.description }}</view>
 				</view>
 				<view class="coupon-right flex">
 					<view v-if="false" class="coupon-right-time flex">
 						<view class="tip">有效期仅剩</view>
-						<view class="time">{{resetTime}}</view>
+						<view class="time">{{item.expiration}}</view>
 					</view>
 					<view v-else class="coupon-right-get" @click="handlerGetCoupon(item,index)">可领取</view>
 				</view>
@@ -44,27 +44,30 @@
 		<view class="detail">
 			<view class="detail-text">服务详情</view>
 			<view class="detail-des">
-				为您提供汽车基本保养服务,包括机油更换、滤芯 更换、轮胎气压检查等.
+				{{ goods.description }}
 			</view>
 		</view>
 
 		<!-- 评价内容 -->
 		<view class="Evaluate-content">
-			<view v-for="(item,index) in userCommentList" :key="index">
+			<view v-for="(item,index) in comments" :key="index">
 				<view class="commnet-user flex">
-					<image :src="item.user.pic" style="width: 40px; height: 40px; border-radius: 50%" />
+					<image :src="item.user.avatar" style="width: 40px; height: 40px; border-radius: 50%" />
 					<view class="commnet-user-middle flex">
-						<view class="name flex">{{item.user.userName}}</view>
-						<u-rate class="rate" :value="item.user.rate" readonly :size="12" gutter="1"
+						<view class="name flex">{{item.user.nickname}}</view>
+						<u-rate class="rate" :value="item.score" readonly :size="12" gutter="1"
 							active-color="#ffa500" />
 					</view>
-					<view class="time">{{item.user.time}}</view>
+					<view class="time">{{item.createTime}}</view>
 				</view>
-				<view class="commnet-text">{{item.comment}}</view>
+				<view class="commnet-text">{{item.content}}</view>
 				<view class="commnet-img">
-					<image class="img" v-for="(img,index) in item.imgList" :key="index" :src="img" mode="widthFix" />
+					<image class="img" v-for="(img,index) in item.attachments" :key="index" :src="url" mode="widthFix" />
 				</view>
-			</view>
+			</view>
+
+      <u-empty v-if="comments.length == 0" mode="message" icon="http://cdn.uviewui.com/uview/empty/message.png"></u-empty>
+
 		</view>
 
 		<!-- 底部 -->
@@ -79,25 +82,11 @@
 	</view>
 </template>
 
-<script>
+<script>
+  import { getGoodsDetail } from "@/api/business.js"
 	export default {
 		data() {
 			return {
-				albumWidth: 0,
-				urls2: [
-					'https://cdn.uviewui.com/uview/album/1.jpg',
-					'https://cdn.uviewui.com/uview/album/2.jpg',
-					'https://cdn.uviewui.com/uview/album/3.jpg',
-					'https://cdn.uviewui.com/uview/album/4.jpg',
-					'https://cdn.uviewui.com/uview/album/5.jpg',
-					'https://cdn.uviewui.com/uview/album/6.jpg',
-					'https://cdn.uviewui.com/uview/album/7.jpg',
-					'https://cdn.uviewui.com/uview/album/8.jpg',
-					'https://cdn.uviewui.com/uview/album/9.jpg',
-					'https://cdn.uviewui.com/uview/album/10.jpg',
-				],
-				couponList: [{}, {}],
-				resetTime: '23:59:59',
 				userOperate: [{
 						name: '店铺',
 						icon: "file-text"
@@ -113,53 +102,36 @@
 					}
 				],
 				hascollect: false, // 当前店铺是否被收藏
-				userCommentList: [{
-						user: {
-							userName: '李****阳',
-							pic: 'https://cdn.uviewui.com/uview/album/1.jpg',
-							rate: 3.8,
-							time: '2023.06.18'
-						},
-						comment: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容',
-						imgList: [
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-						],
-					},
-					{
-						user: {
-							userName: '李****阳',
-							pic: 'https://cdn.uviewui.com/uview/album/1.jpg',
-							rate: 3.8,
-							time: '2023.06.18'
-						},
-						comment: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容',
-						imgList: [
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-						],
-					},
-					{
-						user: {
-							userName: '李****阳',
-							pic: 'https://cdn.uviewui.com/uview/album/1.jpg',
-							rate: 3.8,
-							time: '2023.06.18'
-						},
-						comment: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容',
-						imgList: [
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-							'https://cdn.uviewui.com/uview/album/1.jpg',
-						],
-					},
-				]
+
+        goods:[],//商品详情
+        coupons:[],//优惠券
+        comments:[],// 评论
 			};
-		},
+		},
+    onLoad(option){
+      // 获取商品详情接口
+      getGoodsDetail(option.id).then(res=>{
+        this.goods = res.data.goods
+        this.coupons = res.data.coupons
+        this.comments = res.data.comments
+      })
+    },
 		methods: {
+      // 点击分享
+      handlerShare(){
+        uni.share({
+        	provider: "weixin",
+        	scene: "WXSceneSession",
+        	type: 1,
+        	summary: "我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!",
+        	success: function (res) {
+        		console.log("success:" + JSON.stringify(res));
+        	},
+        	fail: function (err) {
+        		console.log("fail:" + JSON.stringify(err));
+        	}
+        });
+      },
       // 选择底部tab 店铺 收藏 咨询
 			collect(index) {
 				if (index === 2) {
@@ -190,10 +162,9 @@
 
 	.service-top {
 		margin: 20rpx;
-
 		.item-flex {
 			display: flex;
-
+      justify-content: space-between;
 			.title {
 				font-size: 18px;
 				font-weight: bold;

+ 2 - 1
src/pages/login/index.vue

@@ -56,7 +56,8 @@ export default {
       },
     };
   },
-
+  onShow(){
+  },
   methods: {
     //点击微信用户一键登录
     async login() {

+ 176 - 187
src/pages/login/phoneLogin.vue

@@ -2,61 +2,28 @@
   <view class="container">
     <u-image src="@/static/logo.png"></u-image>
     <view class="login-form-wrap">
-      <u--form
-        labelPosition="left"
-        :model="loginForm"
-        :rules="rules"
-        ref="loginForm"
-      >
+      <u--form labelPosition="left" :model="loginForm" :rules="rules" ref="loginForm">
         <u-form-item prop="mobile" borderBottom label="账号">
-          <u-input
-            v-model="loginForm.mobile"
-            maxlength="11"
-            border="none"
-            focus
-            placeholder="请输入账号/手机号"
-          >
+          <u-input v-model="loginForm.mobile" maxlength="11" border="none" focus placeholder="请输入账号/手机号">
           </u-input>
         </u-form-item>
         <u-form-item prop="captcha" label="密码" borderBottom>
-          <u-input
-            v-model="loginForm.password"
-            maxlength="6"
-            border="none"
-            placeholder="请输入密码"
-          >
+          <u-input v-model="loginForm.password" maxlength="6" border="none" placeholder="请输入密码">
           </u-input>
         </u-form-item>
-        <u-checkbox
-          shape="circle"
-          @change="checkboxChange"
-          :checked="isChecked"
-        ></u-checkbox>
+        <u-checkbox shape="circle" @change="checkboxChange" :checked="isChecked"></u-checkbox>
         <view @click="forgetPassword">记住密码</view>
         <view class="phone-question" @click="forgetPassword">忘记密码?</view>
         <u-form-item>
-          <u-button
-            type="primary"
-            :disabled="isDisabled"
-            :loading="loading"
-            shape="circle"
-            @click="login"
-            >登录</u-button
-          >
+          <u-button type="primary" :disabled="isDisabled" :loading="loading" shape="circle" @click="login">登录</u-button>
         </u-form-item>
         <u-form-item>
-          <u-button :loading="loading" shape="circle" @click="register"
-            >注册</u-button
-          >
+          <u-button :loading="loading" shape="circle" @click="register">注册</u-button>
         </u-form-item>
       </u--form>
       <view class="user-agreement">
         <u-checkbox-group>
-          <u-checkbox
-            shape="circle"
-            @change="checkboxChange"
-            :checked="isChecked"
-          ></u-checkbox>
+          <u-checkbox shape="circle" @change="checkboxChange" :checked="isChecked"></u-checkbox>
         </u-checkbox-group>
         <text class="user-agreement-text">
           我已阅读并同意
@@ -69,193 +36,215 @@
 
     <view>
       <u-popup :show="show" @close="close" mode="center">
-        <view
-          style="
+        <view style="
             height: 100rpx;
             width: 700rpx;
             align-items: center;
             display: flex;
             justify-content: center;
-          "
-        >
+          ">
           <text style="color: gray; font-size: 14px">我已阅读并同意</text>
           <text style="font-weight: bold">《用户协议》</text>
           <text style="font-weight: bold">《隐私政策》</text>
         </view>
-        <u-button @click="confirmShow" type="primary" :loading="loading"
-          >确认</u-button
-        >
+        <u-button @click="confirmShow" type="primary" :loading="loading">确认</u-button>
       </u-popup>
     </view>
   </view>
 </template>
 
 <script>
-import { getSmsCodeByPhone, loginByPhoneAndSmsCode } from '@/api/login';
-export default {
-  data() {
-    return {
-      loginForm: {
-        client_id: 'chelvc_client',
-        client_secret: 'qWBe6jD%GCuPPTkP',
-        grant_type: 'sms',
-        token: '',
-        mobile: '', //手机号
-        captcha: '363636', //验证码
-        password: '', //密码
-      },
-      rules: {
-        mobile: [
-          {
-            required: true,
-            trigger: ['change', 'blur'],
-            message: '请输入您的手机号',
-          },
-          {
-            validator: (rule, value, cb) => {
-              return uni.$u.test.mobile(value);
+  import {
+    getSmsCodeByPhone,
+    loginByPhoneAndSmsCode,
+
+    maintainSmsCaptcha
+  } from '@/api/login';
+  export default {
+    data() {
+      return {
+        loginForm: {
+          client_id: 'chelvc_client',
+          client_secret: 'qWBe6jD%GCuPPTkP',
+          grant_type: 'sms',
+          token: '',
+          mobile: '18380313545', //手机号
+          captcha: '363636', //验证码
+          password: '1', //密码
+        },
+        rules: {
+          mobile: [{
+              required: true,
+              trigger: ['change', 'blur'],
+              message: '请输入您的手机号',
             },
-            message: '手机号码格式不正确',
-            trigger: ['change', 'blur'],
-          },
-        ],
-        captcha: [
-          {
+            {
+              validator: (rule, value, cb) => {
+                return uni.$u.test.mobile(value);
+              },
+              message: '手机号码格式不正确',
+              trigger: ['change', 'blur'],
+            },
+          ],
+          captcha: [{
             required: true,
             trigger: ['change', 'blur'],
             message: '请输入六位数验证码',
-          },
-        ],
-      },
-      seconds: 120,
-      tips: '',
-      isChecked: true,
-      show: false,
-      loading: false,
-    };
-  },
+          }, ],
+        },
+        seconds: 120,
+        tips: '',
+        isChecked: true,
+        show: false,
+        loading: false,
+      };
+    },
 
-  onReady() {
-    this.$refs.loginForm.setRules(this.rules);
-  },
+    onReady() {
+      this.$refs.loginForm.setRules(this.rules);
+    },
 
-  computed: {
-    isDisabled() {
-      return !(this.loginForm.mobile && this.loginForm.captcha.length === 6);
+    computed: {
+      isDisabled() {
+        return !(this.loginForm.mobile && this.loginForm.captcha.length === 6);
+      },
     },
-  },
 
-  methods: {
-    getCode() {
-      if (!this.loginForm.mobile) return uni.$u.toast('请输入您的手机号!');
-      if (!uni.$u.test.mobile(this.loginForm.mobile))
-        return uni.$u.toast('手机号码格式不正确!');
-      // TODO: 处理验证码倒计时
-      if (this.$refs.uCode.canGetCode) {
-        getSmsCodeByPhone(this.loginForm.mobile)
-          .then(res => {
-            if (res.code === 200) {
-              uni.$u.toast('验证码已发送');
-              this.loginForm.token = res.data.token;
+    methods: {
+      getCode() {
+        if (!this.loginForm.mobile) return uni.$u.toast('请输入您的手机号!');
+        if (!uni.$u.test.mobile(this.loginForm.mobile))
+          return uni.$u.toast('手机号码格式不正确!');
+        // TODO: 处理验证码倒计时
+        if (this.$refs.uCode.canGetCode) {
+          getSmsCodeByPhone(this.loginForm.mobile)
+            .then(res => {
+              if (res.code === 200) {
+                uni.$u.toast('验证码已发送');
+                this.loginForm.token = res.data.token;
+                this.$refs.uCode.start();
+              }
+            })
+            .catch(err => {
+              uni.$u.toast('无法发送验证码');
               this.$refs.uCode.start();
+            });
+        }
+      },
+
+      //点击登录
+      async login() {
+        if (!this.isChecked) {
+          this.show = true;
+          return;
+        }
+        this.loading = true;
+        let mobile = '18380313545'
+        maintainSmsCaptcha({
+            mobile: mobile
+          }).then(res => {
+            console.log('res', res);
+            //   this.loading = false;
+            //   if (res.access_token) {
+            //     uni.$u.toast('登录成功');
+            //     this.$store.commit('SET_ACCESS_TOKEN', res.access_token);
+            //     this.$store.commit('SET_REFRESH_TOKEN', res.refresh_token);
+            //     setTimeout(() => {
+            //       this.$Router.pushTab('/pages/tabbar/home/index');
+            //     }, 1500);
+            //   }
+            // })
+            // .catch(err => {
+            //   this.loading = false;
+            //   uni.$u.toast('登录失败-' + err.data.error_description);
+            //   this.loading = false;
+
+            // 下方登陆代码调通 token不知道放哪 不知道为什么要存两个token  上方代码没动 loginByPhoneAndSmsCode 这个是之前的接口
+            if (res.code == 200) {
+              uni.$u.toast('登录成功');
+              // this.$store.commit('SET_ACCESS_TOKEN', res.data.token);
+              // this.$store.commit('SET_REFRESH_TOKEN', res.data.token);
+              setTimeout(() => {
+                this.$Router.pushTab('/pages/tabbar/home/index');
+              }, 1500);
             }
           })
           .catch(err => {
-            uni.$u.toast('无法发送验证码');
-            this.$refs.uCode.start();
+            this.loading = false;
+            uni.$u.toast('登录失败-' + err.data.error_description);
           });
-      }
-    },
-
-    //点击登录
-    async login() {
-      if (!this.isChecked) {
-        this.show = true;
-        return;
-      }
-      this.loading = true;
-      loginByPhoneAndSmsCode(this.loginForm)
-        .then(res => {
-          this.loading = false;
-          if (res.access_token) {
-            uni.$u.toast('登录成功');
-            this.$store.commit('SET_ACCESS_TOKEN', res.access_token);
-            this.$store.commit('SET_REFRESH_TOKEN', res.refresh_token);
-            setTimeout(() => {
-              this.$Router.pushTab('/pages/tabbar/home/index');
-            }, 1500);
-          }
-        })
-        .catch(err => {
-          this.loading = false;
-          uni.$u.toast('登录失败-' + err.data.error_description);
-        });
-    },
+      },
 
-    //点击注册
-    register() {
-      this.$Router.pushTab('/pages/login/register');
-    },
+      //点击注册
+      register() {
+        this.$Router.pushTab('/pages/login/register');
+      },
 
-    //点击我已阅读
-    checkboxChange(v) {
-      this.isChecked = v;
-    },
+      //点击我已阅读
+      checkboxChange(v) {
+        this.isChecked = v;
+      },
 
-    //点击手机号无法使用?
-    noPhone() {
-      this.$message('要跳转到解决方案哦 还没写');
-    },
+      //点击手机号无法使用?
+      noPhone() {
+        this.$message('要跳转到解决方案哦 还没写');
+      },
 
-    //点击弹框确认
-    confirmShow() {
-      this.isChecked = true;
-      this.show = false;
-      setTimeout(() => {
-        this.login();
-      }, 250);
-    },
+      //点击弹框确认
+      confirmShow() {
+        this.isChecked = true;
+        this.show = false;
+        setTimeout(() => {
+          this.login();
+        }, 250);
+      },
 
-    //关闭弹框f
-    close() {
-      this.show = false;
+      //关闭弹框f
+      close() {
+        this.show = false;
+      },
     },
-  },
-};
+  };
 </script>
 
 <style scoped lang="scss">
-.container {
-  padding: 0 40rpx;
-  margin: 0 auto;
-}
-.login-form-wrap {
-  margin-top: 200rpx;
-  .phone-prefix {
-    display: flex;
-    align-items: center;
-    padding-right: 20rpx;
-    border-right: 2rpx solid $uni-text-color-grey;
-    margin-right: 20rpx;
+  .container {
+    padding: 0 40rpx;
+    margin: 0 auto;
   }
-  .phone-question {
-    text-align: right;
-    font-size: 24rpx;
-    padding: 20rpx 0 20rpx 0;
-  }
-  .user-agreement {
-    display: flex;
-    padding: 0 10rpx;
-    .user-agreement-text {
+
+  .login-form-wrap {
+    margin-top: 200rpx;
+
+    .phone-prefix {
+      display: flex;
+      align-items: center;
+      padding-right: 20rpx;
+      border-right: 2rpx solid $uni-text-color-grey;
+      margin-right: 20rpx;
+    }
+
+    .phone-question {
+      text-align: right;
       font-size: 24rpx;
-      color: $uni-text-color-grey;
-      margin-top: 20rpx;
-      margin-left: 20rpx;
-      .terms {
-        color: $uni-text-color;
-        font-weight: 400;
+      padding: 20rpx 0 20rpx 0;
+    }
+
+    .user-agreement {
+      display: flex;
+      padding: 0 10rpx;
+
+      .user-agreement-text {
+        font-size: 24rpx;
+        color: $uni-text-color-grey;
+        margin-top: 20rpx;
+        margin-left: 20rpx;
+
+        .terms {
+          color: $uni-text-color;
+          font-weight: 400;
+        }
       }
     }
   }
-}
 </style>

+ 0 - 11
src/pages/user/appoint/index.vue

@@ -27,10 +27,6 @@
   export default {
     data() {
       return {
-        show: false,
-        title: '取消预约',
-        content: '你确定要取消当前预约吗?',
-
         queryParams:{
           size:10
         },
@@ -55,13 +51,6 @@
           icon:'none'
         })
       },
-      confirm() {
-        console.log(1111111111);
-        this.show = false;
-      },
-      cancel() {
-        this.show = false;
-      }
     },
   };
 </script>