Commit 19b16ff1c566c194da2ee4a545a35fffca855910

Authored by vking
1 parent 543d12d5

taocan-share-pinglun

... ... @@ -12,16 +12,22 @@ Page({
/**
* 生命周期函数--监听页面加载
* act=seller&sid=80
*/
onLoad: function (options) {
App.Customer.GetSellerComments({
scene:2
}).then(res=>{
this.setData({
posts:res.data,
loading:1,
})
this.options=options
this.setData({
title:options.act=='seller'?'所有评价':'我的评价'
})
if(options.act=='seller'){
App.Customer.GetCountCommentLabel({sid:options.sid}).then(res=>{
this.setData({
commentLabel:[{name:'全部'}].concat(res.data),
commentLabelActive:'全部',
})
})
}
this.getList()
},
/**
... ... @@ -65,11 +71,32 @@ Page({
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
commentLabelActive:'',
getList(){
let params={//我的
scene:2
}
if(this.options.act=='seller'){
params={
sid:this.options.sid,
scene:1,
status:1,
}
if(this.commentLabelActive!='全部'){
params.label=this.commentLabelActive
}
}
App.Customer.GetSellerComments(params).then(res=>{
this.setData({
posts:res.data,
loading:1,
})
})
},
commentLabelTap(e){
console.log(e)
this.commentLabelActive=util.attr(e,'val')
this.setData({commentLabelActive:this.commentLabelActive})
this.getList()
},
})
\ No newline at end of file
... ...
<!--pages/pinglun/mylist.wxml-->
<nav>我的评价</nav>
<nav>{{title}}</nav>
<page loading="{{loading}}">
<block wx:if="{{posts.length>0}}">
<view class="view flex flex-wrap margin-lr-lg margin-top-lg" wx:if="{{commentLabel.length>0}}">
<block wx:for="{{commentLabel}}" wx:key="commentLabel">
<view bindtap="commentLabelTap" data-val="{{item.name}}"
class="view commentLabel padding-lr-sm margin-bottom-sm {{commentLabelActive==item.name?'active':''}}">{{item.name}}</view>
</block>
</view>
<view class="view" wx:for="{{posts}}" wx:key="posts">
<view class="view margin-lg solid-bottom padding-bottom-lg">
<plcard post="{{item}}" hasSeller hasStatus></plcard>
</view>
</view>
</block>
<view class="view flex flex-direction align-center" style="padding-top: 172rpx;">
<image src="http://nosqn.colorcun.com/pinglun/p%20%2819%29.png" style="width: 520rpx;height: 384rpx;"></image>
<view class="txt-28-h margin-top-lg">暂时没有评价哦</view>
</view>
</page>
... ...
/* pages/pinglun/mylist.wxss */
@import "../../colorui/main.wxss";
\ No newline at end of file
@import "../../colorui/main.wxss";
.commentLabel{
height: 52rpx;
background: #F1F1F1;
border-radius: 26rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 52rpx;
text-align: center;
}
.commentLabel.active{
background: #E6F3FF;
color:#42A5FF;
}
\ No newline at end of file
... ...
... ... @@ -195,7 +195,7 @@
</block>
<block wx:if="{{seller.comment_info}}">
<view class="black20line"></view>
<navigator url="/pack-cookbook/pages/index?rid=18599&oid=273&identity=1&seeAll={{seller.sellername}}&sid={{seller.id}}" hover-class="navigator-hover">
<navigator url="/pages/pinglun/mylist?act=seller&sid={{seller.id}}" hover-class="navigator-hover">
<view class="view padding-tb-lg">
<view class="view flex justify-between align-center">
<view class="view txt-40-h text-bold">用户评价</view>
... ... @@ -208,8 +208,9 @@
</navigator>
<view class="view padding-bottom-xl">
<view class="view flex flex-wrap" wx:if="{{commentLabel.length>0}}">
<block wx:for="{{commentLabel}}" wx:key="commentLabel"></block>
<view class="view commentLabel padding-lr-sm margin-bottom-sm">{{item.name}}</view>
<block wx:for="{{commentLabel}}" wx:key="commentLabel">
<view class="view commentLabel padding-lr-sm margin-bottom-sm">{{item.name}}</view>
</block>
</view>
<view class="margin-top-lg">
<plcard post="{{seller.comment_info}}"></plcard>
... ...
... ... @@ -748,7 +748,7 @@
{
"name": "pages/pinglun/mylist",
"pathName": "pages/pinglun/mylist",
"query": "",
"query": "act=seller&sid=80",
"scene": null
}
]
... ...