123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- <template>
- <view class="comment">
- <view class="comment_tabs">
- <view class="box" v-for="(item,index) in list" :key="index" @click="change(index)" :class="{btna:count == index}">{{item}}</view>
- </view>
- <view class="tab_box" :class="{dis:btnnum == 0}">
- <view class="content">
- <view class="content_box" v-for="(item,index) in head" :key="item.id">
- <view class="comment_head">
- <view class="head_left">
- <view class="img">
- <image :src="item.avatar?item.avatar:'../../../static/logo.png'"></image>
- </view>
- <view class="comment_name">{{item.nickName?item.nickName:'匿名'}}</view>
- </view>
- <view class="head_right" v-if="item.satisfactionFlag=='0'">
- <view class="image">
- <image src="../static/zan.png"></image>
- </view>
- <view class="comment_tit">满意</view>
- </view>
- </view>
- <view class="comment_title">{{item.evaluateMessage}}</view>
- </view>
- </view>
- <empty v-if="head.length == 0" ></empty>
- </view>
- <view class="tab_box" :class="{dis:btnnum == 1}">
- <view class="content">
- <view class="content_box" v-for="(item,index) in head" :key="item.id">
- <view class="comment_head">
- <view class="head_left">
- <view class="img">
- <image :src="item.avatar?item.avatar:'../../../static/logo.png'"></image>
- </view>
- <view class="comment_name">{{item.nickName?item.nickName:'匿名'}}</view>
- </view>
- <view class="head_right" v-if="item.satisfactionFlag=='1'">
- <view class="image">
- <image src="../static/zz.png"></image>
- </view>
- <view class="comment_tit comment_tit1">不满意</view>
- </view>
- </view>
- <view class="comment_title">{{item.evaluateMessage}}</view>
- </view>
- </view>
- <empty v-if="head.length == 0" ></empty>
- </view>
- </view>
- </template>
- <script>
- import empty from '@/components/empty'
- export default {
- components: {
- empty
- },
- data() {
- return {
- list: ["满意", "不满意"],
- btnnum: 0,
- count: "",
- head: [],
- page:1,
- limit:10,
- totalCount:0,
- satisfactionFlag:0
- }
- },
- mounted() {
- this.bindorder()
- },
- methods: {
- change(e) {
- // console.log(e)
- this.head = []
- this.page = 1
- this.count = e
- this.btnnum = e
- this.satisfactionFlag = e
- this.bindorder()
- },
- // 获取数据
- bindorder() {
- this.$Request.getT('/app/userinfo/findEvaluate',
- {
- page:this.page,
- limit:this.limit,
- satisfactionFlag:this.satisfactionFlag
- }).then(res => {
- if(res.code==0){
- // this.head = res.data
- if (this.page == 1) {
- this.head = res.data.list
- } else {
- this.head = this.head.concat(res.data.list)
- }
- this.totalCount = res.data.totalCount
- }else{
- console.log('失败:',res.data)
- }
- uni.stopPullDownRefresh();
- });
- },
- },
- // 上拉加载
- onReachBottom: function() {
- if(this.page<this.totalCount){
- this.page = this.page + 1;
- this.bindorder();
- }else{
- uni.showToast({
- title:'已经最后一页啦',
- icon:'none'
- })
- }
-
- },
- // 下拉刷新
- onPullDownRefresh: function() {
- this.page = 1;
- this.bindorder();
- },
- }
- </script>
- <style>
- body {
- background: #F5F5F5;
- }
- .comment {
- width: 100%;
- }
- .comment_tabs {
- width: 100%;
- display: flex;
- background: #FFFFFF;
- height: 90rpx;
- }
- .box {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .btna {
- background-color: #E6E6E6;
- }
- .tab_box {
- display: none;
- }
- .dis {
- display: block;
- }
- /* 满意 */
- .content {
- width: 90%;
- margin: 0 auto;
- background: #ffffff;
- border-radius: 16rpx;
- margin-top: 30rpx;
- }
- .content_box {
- height: 145rpx;
- }
- .img image {
- width: 50rpx;
- height: 50rpx;
- border-radius: 50%;
- }
- .comment_head {
- width: 90%;
- margin: 0 auto;
- display: flex;
- }
- .comment_name {
- color: #333333;
- font-size: 22rpx;
- margin-left: 10rpx;
- }
- .head_left {
- flex: 1;
- display: flex;
- justify-content: left;
- align-items: center;
- height: 65rpx;
- margin-top: 20rpx;
- }
- .head_right {
- flex: 1;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- color: #3390FF;
- font-size: 20rpx;
- }
- .image {
- margin-right: 11rpx;
- margin-top: 8rpx;
- }
- .image image {
- width: 22rpx;
- height: 22rpx;
- }
- .comment_title {
- width: 90%;
- margin: 0 auto;
- color: #333333;
- font-size: 25rpx;
- }
- /* 不满意 */
- .comment_tit1 {
- color: #cccccc;
- }
- </style>
|