Commit 19b16ff1c566c194da2ee4a545a35fffca855910

Authored by vking
1 parent 543d12d5

taocan-share-pinglun

@@ -12,16 +12,22 @@ Page({ @@ -12,16 +12,22 @@ Page({
12 12
13 /** 13 /**
14 * 生命周期函数--监听页面加载 14 * 生命周期函数--监听页面加载
  15 + * act=seller&sid=80
15 */ 16 */
16 onLoad: function (options) { 17 onLoad: function (options) {
17 - App.Customer.GetSellerComments({  
18 - scene:2  
19 - }).then(res=>{  
20 - this.setData({  
21 - posts:res.data,  
22 - loading:1,  
23 - }) 18 + this.options=options
  19 + this.setData({
  20 + title:options.act=='seller'?'所有评价':'我的评价'
24 }) 21 })
  22 + if(options.act=='seller'){
  23 + App.Customer.GetCountCommentLabel({sid:options.sid}).then(res=>{
  24 + this.setData({
  25 + commentLabel:[{name:'全部'}].concat(res.data),
  26 + commentLabelActive:'全部',
  27 + })
  28 + })
  29 + }
  30 + this.getList()
25 }, 31 },
26 32
27 /** 33 /**
@@ -65,11 +71,32 @@ Page({ @@ -65,11 +71,32 @@ Page({
65 onReachBottom: function () { 71 onReachBottom: function () {
66 72
67 }, 73 },
68 -  
69 - /**  
70 - * 用户点击右上角分享  
71 - */  
72 - onShareAppMessage: function () {  
73 -  
74 - } 74 + commentLabelActive:'',
  75 + getList(){
  76 + let params={//我的
  77 + scene:2
  78 + }
  79 + if(this.options.act=='seller'){
  80 + params={
  81 + sid:this.options.sid,
  82 + scene:1,
  83 + status:1,
  84 + }
  85 + if(this.commentLabelActive!='全部'){
  86 + params.label=this.commentLabelActive
  87 + }
  88 + }
  89 + App.Customer.GetSellerComments(params).then(res=>{
  90 + this.setData({
  91 + posts:res.data,
  92 + loading:1,
  93 + })
  94 + })
  95 + },
  96 + commentLabelTap(e){
  97 + console.log(e)
  98 + this.commentLabelActive=util.attr(e,'val')
  99 + this.setData({commentLabelActive:this.commentLabelActive})
  100 + this.getList()
  101 + },
75 }) 102 })
1 <!--pages/pinglun/mylist.wxml--> 1 <!--pages/pinglun/mylist.wxml-->
2 -<nav>我的评价</nav> 2 +<nav>{{title}}</nav>
3 <page loading="{{loading}}"> 3 <page loading="{{loading}}">
4 <block wx:if="{{posts.length>0}}"> 4 <block wx:if="{{posts.length>0}}">
  5 + <view class="view flex flex-wrap margin-lr-lg margin-top-lg" wx:if="{{commentLabel.length>0}}">
  6 + <block wx:for="{{commentLabel}}" wx:key="commentLabel">
  7 + <view bindtap="commentLabelTap" data-val="{{item.name}}"
  8 + class="view commentLabel padding-lr-sm margin-bottom-sm {{commentLabelActive==item.name?'active':''}}">{{item.name}}</view>
  9 + </block>
  10 + </view>
5 <view class="view" wx:for="{{posts}}" wx:key="posts"> 11 <view class="view" wx:for="{{posts}}" wx:key="posts">
6 <view class="view margin-lg solid-bottom padding-bottom-lg"> 12 <view class="view margin-lg solid-bottom padding-bottom-lg">
7 <plcard post="{{item}}" hasSeller hasStatus></plcard> 13 <plcard post="{{item}}" hasSeller hasStatus></plcard>
8 </view> 14 </view>
9 </view> 15 </view>
10 </block> 16 </block>
  17 + <view class="view flex flex-direction align-center" style="padding-top: 172rpx;">
  18 + <image src="http://nosqn.colorcun.com/pinglun/p%20%2819%29.png" style="width: 520rpx;height: 384rpx;"></image>
  19 + <view class="txt-28-h margin-top-lg">暂时没有评价哦</view>
  20 + </view>
11 </page> 21 </page>
1 /* pages/pinglun/mylist.wxss */ 1 /* pages/pinglun/mylist.wxss */
2 -@import "../../colorui/main.wxss";  
  2 +@import "../../colorui/main.wxss";
  3 +.commentLabel{
  4 + height: 52rpx;
  5 + background: #F1F1F1;
  6 + border-radius: 26rpx;
  7 +
  8 + font-size: 26rpx;
  9 + font-family: PingFangSC-Regular, PingFang SC;
  10 + font-weight: 400;
  11 + color: #666666;
  12 + line-height: 52rpx;
  13 + text-align: center;
  14 +}
  15 +.commentLabel.active{
  16 + background: #E6F3FF;
  17 + color:#42A5FF;
  18 +}
@@ -195,7 +195,7 @@ @@ -195,7 +195,7 @@
195 </block> 195 </block>
196 <block wx:if="{{seller.comment_info}}"> 196 <block wx:if="{{seller.comment_info}}">
197 <view class="black20line"></view> 197 <view class="black20line"></view>
198 - <navigator url="/pack-cookbook/pages/index?rid=18599&oid=273&identity=1&seeAll={{seller.sellername}}&sid={{seller.id}}" hover-class="navigator-hover"> 198 + <navigator url="/pages/pinglun/mylist?act=seller&sid={{seller.id}}" hover-class="navigator-hover">
199 <view class="view padding-tb-lg"> 199 <view class="view padding-tb-lg">
200 <view class="view flex justify-between align-center"> 200 <view class="view flex justify-between align-center">
201 <view class="view txt-40-h text-bold">用户评价</view> 201 <view class="view txt-40-h text-bold">用户评价</view>
@@ -208,8 +208,9 @@ @@ -208,8 +208,9 @@
208 </navigator> 208 </navigator>
209 <view class="view padding-bottom-xl"> 209 <view class="view padding-bottom-xl">
210 <view class="view flex flex-wrap" wx:if="{{commentLabel.length>0}}"> 210 <view class="view flex flex-wrap" wx:if="{{commentLabel.length>0}}">
211 - <block wx:for="{{commentLabel}}" wx:key="commentLabel"></block>  
212 - <view class="view commentLabel padding-lr-sm margin-bottom-sm">{{item.name}}</view> 211 + <block wx:for="{{commentLabel}}" wx:key="commentLabel">
  212 + <view class="view commentLabel padding-lr-sm margin-bottom-sm">{{item.name}}</view>
  213 + </block>
213 </view> 214 </view>
214 <view class="margin-top-lg"> 215 <view class="margin-top-lg">
215 <plcard post="{{seller.comment_info}}"></plcard> 216 <plcard post="{{seller.comment_info}}"></plcard>
@@ -748,7 +748,7 @@ @@ -748,7 +748,7 @@
748 { 748 {
749 "name": "pages/pinglun/mylist", 749 "name": "pages/pinglun/mylist",
750 "pathName": "pages/pinglun/mylist", 750 "pathName": "pages/pinglun/mylist",
751 - "query": "", 751 + "query": "act=seller&sid=80",
752 "scene": null 752 "scene": null
753 } 753 }
754 ] 754 ]