Commit c3c8b2e8fb69e27132995443cfc0a093f8fc1b0b

Authored by wangfan
1 parent 22097221

c端预定

@@ -10,6 +10,10 @@ Component({ @@ -10,6 +10,10 @@ Component({
10 seller:{ 10 seller:{
11 type:Object, 11 type:Object,
12 value:{}, 12 value:{},
  13 + },
  14 + hasStat:{
  15 + type:Boolean,
  16 + value:false,
13 } 17 }
14 }, 18 },
15 19
1 { 1 {
2 "component": true, 2 "component": true,
3 "usingComponents": { 3 "usingComponents": {
4 - "formids":"/components/formids/formids" 4 + "formids":"/components/formids/formids",
  5 + "stat":"/components/stat/stat"
5 } 6 }
6 } 7 }
@@ -6,7 +6,10 @@ @@ -6,7 +6,10 @@
6 </view> 6 </view>
7 <view class="info flex-tb"> 7 <view class="info flex-tb">
8 <view class="name Semibold">{{seller.sellername}}</view> 8 <view class="name Semibold">{{seller.sellername}}</view>
9 - <view class="text">{{seller.cate[0].name?seller.cate[0].name+' |':''}}距当前位置{{seller.distance}}</view> 9 + <view wx:if="{{hasStat}}" class="stat">
  10 + <stat stat="3.0"></stat>
  11 + </view>
  12 + <view class="text">{{seller.cate[0].name?seller.cate[0].name+' | ':''}}距当前位置{{seller.distance}}</view>
10 <view class="price flex-lr"> 13 <view class="price flex-lr">
11 <view class="number Semibold"> 14 <view class="number Semibold">
12 <block wx:if="{{seller.average>0}}">¥{{seller.average}}元/人</block> 15 <block wx:if="{{seller.average>0}}">¥{{seller.average}}元/人</block>
@@ -66,4 +66,11 @@ @@ -66,4 +66,11 @@
66 height: 26rpx; 66 height: 26rpx;
67 margin-right: 8rpx; 67 margin-right: 8rpx;
68 margin-left: 24rpx; 68 margin-left: 24rpx;
  69 +}
  70 +
  71 +.stat{
  72 + font-size: 24rpx;
  73 + color:#999999;
  74 + height: 24rpx;
  75 + line-height: 24rpx;
69 } 76 }
@@ -5,12 +5,16 @@ Component({ @@ -5,12 +5,16 @@ Component({
5 */ 5 */
6 properties: { 6 properties: {
7 stat: { 7 stat: {
8 - type: Number,  
9 - value:4, 8 + type: String,
  9 + value:"4.0",
10 }, 10 },
11 color:{ 11 color:{
12 type:String, 12 type:String,
13 value:'', 13 value:'',
  14 + },
  15 + hasShowText:{
  16 + type:Boolean,
  17 + value:true,
14 } 18 }
15 } 19 }
16 , 20 ,
1 <!--components/stat/stat.wxml--> 1 <!--components/stat/stat.wxml-->
2 -<view class="stat">  
3 - <view class="bg" style="background-color: {{$color}};width: {{(stat/5)*100}}%"></view>  
4 - <image src="http://qn.colorcun.com/custom/lite-online/image/%E9%95%82%E7%A9%BA%E6%98%9F%E6%98%9F.png"></image> 2 +<view class="flex-ll">
  3 + <view class="stat">
  4 + <view class="bg" style="background-color: {{$color}};width: {{(stat/5)*100}}%"></view>
  5 + <image src="http://qn.colorcun.com/custom/lite-online/image/%E9%95%82%E7%A9%BA%E6%98%9F%E6%98%9F.png"></image>
  6 + </view>
  7 + <view class="stat-text" wx:if="{{hasShowText}}">{{stat}} 分</view>
5 </view> 8 </view>
1 /* components/stat/stat.wxss */ 1 /* components/stat/stat.wxss */
  2 +@import "../../app.wxss";
2 .stat{ 3 .stat{
3 width: 168rpx; 4 width: 168rpx;
4 height: 30rpx; 5 height: 30rpx;
@@ -23,3 +24,6 @@ @@ -23,3 +24,6 @@
23 top:0; 24 top:0;
24 z-index: 2; 25 z-index: 2;
25 } 26 }
  27 +.stat-text{
  28 + margin-left: 10rpx;
  29 +}
@@ -6,6 +6,6 @@ @@ -6,6 +6,6 @@
6 <view>您还没有收藏任何餐厅哦</view> 6 <view>您还没有收藏任何餐厅哦</view>
7 </view> 7 </view>
8 <view class="follow"> 8 <view class="follow">
9 - <sb-tr seller="{{}}"></sb-tr> 9 + <sb-tr seller="{{}}" hasStat="{{true}}"></sb-tr>
10 </view> 10 </view>
11 </view> 11 </view>
@@ -19,8 +19,7 @@ @@ -19,8 +19,7 @@
19 <view class="name">{{seller.seller_name}}</view> 19 <view class="name">{{seller.seller_name}}</view>
20 <view class="ping flex-cc"> 20 <view class="ping flex-cc">
21 <view class="item flex-lr fen"> 21 <view class="item flex-lr fen">
22 - <stat stat="2"></stat>  
23 - <view class="text">4.0分</view> 22 + <stat stat="2.0"></stat>
24 </view> 23 </view>
25 <view class="item">西北菜</view> 24 <view class="item">西北菜</view>
26 <view class="item">人均60元</view> 25 <view class="item">人均60元</view>