Selaa lähdekoodia

商品详情页面调试

lzy 1 vuosi sitten
vanhempi
commit
163479e33b
3 muutettua tiedostoa jossa 26 lisäystä ja 36 poistoa
  1. 1 1
      src/api/business.js
  2. 15 30
      src/pages/business/detail.vue
  3. 10 5
      src/pages/business/list.vue

+ 1 - 1
src/api/business.js

@@ -21,7 +21,7 @@ export function getSellerList(params){
  */
 export function getSellerDetails(id){
   return request({
-    url:`/maintain/merchants/${id}`,
+    url:`/maintain/merchant/${id}`,
     method: 'GET',
     header:{
       'Content-Type': 'application/x-www-form-urlencoded'

+ 15 - 30
src/pages/business/detail.vue

@@ -5,7 +5,7 @@
       <u-swiper :list="list3" previousMargin="0" nextMargin="100" circular :autoplay="false" bgColor="#ffffff" />
       <view class="carousel-item">
         <view class="mark">
-          <view class="mark-item">5.00分</view>
+          <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>
@@ -15,16 +15,16 @@
     <!-- 商家信息 -->
     <view class="merchant-info">
       <view class="info-title">
-        <view>养车工场店(襄阳五中店)</view>
-        <text class="info-mark">1.5w+单</text>
+        <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>营业时间:9:00 ~ 24:00</view>
-          <view>电话号码:18285564342</view>
-          <view>贵州省贵阳市榕江县栽麻乡小利村三组</view>
-          <view class="distance">距离您1.84km</view>
+          <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">
@@ -39,10 +39,7 @@
       </view>
     </view>
 
-    <service />
-    <service />
-    <service />
-    <service />
+    <service ></service>
   </view>
 </template>
 
@@ -53,37 +50,25 @@ import { getSellerDetails } from '@/api/business.js'
 export default {
   onLoad(option) {
 	getSellerDetails(option.id).then(res => {
-		console.log(res)
+		this.merchant = res.data.merchant
+		this.goods = res.data.goods,
+		this.list3 = res.data.merchant.banners.map(h => h.url)
 	})
   },
   components: {
     service,
   },
   data() {
-    return {
+    return {
+	  merchant:{},
+	  goods:[],
       count: 5,
       value: 3,
-      list3: [
-        'https://cdn.uviewui.com/uview/swiper/swiper3.png',
-        'https://cdn.uviewui.com/uview/swiper/swiper2.png',
-        'https://cdn.uviewui.com/uview/swiper/swiper1.png',
-      ],
-      list1: [
-        { name: '全部' },
-        { name: '养车' },
-        { name: '维修' },
-        { name: '改装' },
-        { name: '补胎' },
-        { name: '补胎' },
-        { name: '其他' },
-      ],
+      list3: [],
     };
   },
   
   methods: {
-    click(item) {
-      console.log('item', item);
-    },
   },
 };
 </script>

+ 10 - 5
src/pages/business/list.vue

@@ -48,7 +48,7 @@
 						<view class="" @tap="sellerListFillter(1)">离我最近</view>
 						<view class="" @tap="sellerListFillter(2)">好评优先</view>
 						<view class=""@tap="sellerListFillter(3)">销量优先</view>
-					</view>
+					</view>s
 				</view>
 			</view>
 		</view>
@@ -61,7 +61,7 @@
 				<view class="item-right">
 					<view class="">
 						<view class="item-title">
-							<view class="tag">常去 </view>
+							<view class="tag">常去</view>
 							<view class="title">{{`${item.name}(${item.address})`}}</view>
 						</view>
 						<view class="str-box">
@@ -76,7 +76,7 @@
 
 					<view class="bottom-textbox">
 						<view class="bottom-left">宝安中心区美容洗车</view>
-						<view class="bottom-right">{{(item.distance/1000).toFixed(1)}}KM</view>
+						<view class="bottom-right">{{(item.distance/1000).toFixed(2)}}KM</view>
 					</view>
 				</view>
 			</view>
@@ -363,7 +363,7 @@
 						.tag {
 							width: 80rpx;
 							height: 46rpx;
-							// line-height: 50rpx;
+							line-height: 35rpx;
 							padding: 4rpx;
 							font-size: 22rpx;
 							box-sizing: border-box;
@@ -376,10 +376,15 @@
 						}
 
 						.title {
+							width: 85%;
 							font-size: 30rpx;
 							color: #000;
 							font-weight: bold;
-							flex-wrap: wrap;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							display: -webkit-box;
+							-webkit-line-clamp: 2;
+							-webkit-box-orient: vertical;
 						}
 					}