| | |
| | | <view class="label">发布</view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="value">{{ '*'}}</view> |
| | | <view class="value">{{ '0'}}</view> |
| | | <view class="label">获赞</view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="value">{{dto.fans || '*'}}</view> |
| | | <view class="value">{{dto.fans || '0'}}</view> |
| | | <view class="label">粉丝</view> |
| | | </view> |
| | | <!-- <view class="form-item"> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- <view v-show="flg==='1'" class="brand-info-1"> |
| | | <trade :hidefooter="true" :supplierId="id" :catgoryTree="catgoryTree" v-if="catgoryTree" ref="trade"> |
| | | </trade> |
| | | <view v-show="flg==='2'" class="brand-info-1"> |
| | | <!-- <trade :hidefooter="true" :supplierId="id" :catgoryTree="catgoryTree" v-if="catgoryTree" ref="trade"> |
| | | </trade> --> |
| | | |
| | | <view class="m-t-12" style="text-align: center;"> |
| | | |
| | | <span style="">综合评分<span style="color: #F8353A; margin-left: 5px;">{{comment.avg}}</span> </span> |
| | | |
| | | </view> |
| | | <view class="m-t-12"> |
| | | |
| | | <view v-for="(item,index) of commentList" > |
| | | <u-row justify="space-between" > |
| | | <u-col span="1"> |
| | | <u--image v-if="item.anonymityFalg==1 " :showLoading="true" |
| | | src="https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png" width="30px" height="30px" shape="circle"></u--image> |
| | | <u--image v-else :showLoading="true" :src="item.customerCover" width="30px" height="30px" shape="circle"></u--image> |
| | | |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <view v-if="item.anonymityFalg==1 " >匿名用户</view> |
| | | <view v-else>{{item.customerName}}</view> |
| | | </u-col> |
| | | <u-col span="2"> |
| | | <u-rate count="5" v-model="item.commentGrade" readonly></u-rate> |
| | | </u-col> |
| | | <u-col span="4"> |
| | | <view style="font-size: 12px;">{{item.updateTime}}</view> |
| | | </u-col> |
| | | </u-row> |
| | | <u-row justify="space-between" > |
| | | <u-col span="2"></u-col> |
| | | <u-col span="10"> |
| | | <view> |
| | | <span style="color:#3E9FFB;border: 1px solid #3E9FFB; padding:2px 2px ;font-size: 12px;"> |
| | | {{item.flowerName}}({{item.flowerColor}}){{item.flowerLevel}} |
| | | </span> |
| | | {{item.comment}} |
| | | <view class="flex" > |
| | | <u--image v-for="(commentImg,index2) of item.commentImagesList" :key="index2" style="margin:10px;" |
| | | :showLoading="true" :src="commentImg"></u--image> |
| | | </view> |
| | | |
| | | </view> |
| | | <!-- 平台回复 --> |
| | | <view class="comment-replay" v-if="item.replayContent"> |
| | | 平台回复:{{item.replayContent}} |
| | | </view> |
| | | </u-col> |
| | | </u-row> |
| | | |
| | | </view> |
| | | |
| | | |
| | | |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | --> |
| | | <view v-if="flg==='2'" class="brand-info-3"> |
| | | |
| | | <view v-if="flg==='3'" class="brand-info-3"> |
| | | <view class="title"> |
| | | 基础信息 |
| | | </view> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | comment:{ |
| | | avg:0, |
| | | commentAmount:0, |
| | | }, |
| | | commentList:[], |
| | | commentPage:{ |
| | | size: 10, |
| | | current: 1, |
| | | total: 0, |
| | | }, |
| | | // search_flow: '', |
| | | flg: '0', |
| | | tabs: [{ |
| | |
| | | { |
| | | name: '分类' |
| | | }, |
| | | // { |
| | | // name: '评价' |
| | | // }, |
| | | { |
| | | name: '评价' |
| | | }, |
| | | { |
| | | name: '商家' |
| | | }, |
| | |
| | | level: '', |
| | | name: '', |
| | | categoryRoot: '', |
| | | |
| | | }, |
| | | level_show: false, |
| | | level_columns: [ |
| | |
| | | order_show: false, |
| | | order_columns: [ |
| | | [] |
| | | ] |
| | | ], |
| | | |
| | | } |
| | | }, |
| | | onShow() { |
| | |
| | | } |
| | | await this.refreshList('post') |
| | | uni.stopPullDownRefresh() |
| | | |
| | | |
| | | if(this.flg=="2"){ |
| | | // 评论相关下拉刷新 |
| | | this.getCommentsStatis() |
| | | |
| | | this.commentList=[] |
| | | this.commentPage.current=1 |
| | | this.getComments() |
| | | } |
| | | |
| | | }, |
| | | onLoad(options) { |
| | | |
| | | this.id = options.id || '' |
| | | this.page.size = 300 |
| | | if (this.id) { |
| | |
| | | value: '' |
| | | }) |
| | | }) |
| | | |
| | | |
| | | this.getCommentsStatis() |
| | | |
| | | |
| | | }, |
| | | // #ifdef PUB_CUSTOMER |
| | | onShareAppMessage() { |
| | |
| | | }, |
| | | // #endif |
| | | onReachBottom() { |
| | | console.log("下拉") |
| | | // if (this.flg === '0') { |
| | | // this.getMore('post') |
| | | // } |
| | | if (this.flg ==2) { |
| | | // debugger; |
| | | // this.listApi="/api/v2/flower-comment/page" |
| | | // this.query={ |
| | | // supplierId:this.id |
| | | // } |
| | | // this.getMore() |
| | | this.commentPage.current++ |
| | | this.getComments() |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | async getCommentsStatis() { |
| | | { |
| | | this.$message.showLoading() |
| | | |
| | | const { |
| | | code, |
| | | data |
| | | } = await this.$http.request('get', `/api/v2/flower-comment/statis/${this.id}`, { |
| | | params: {} |
| | | }) |
| | | if (code === 0) { |
| | | this.comment=data |
| | | this.tabs[2].name=`评价(${this.comment.commentAmount})` |
| | | } |
| | | |
| | | this.$message.hideLoading() |
| | | } |
| | | |
| | | }, |
| | | |
| | | async getComments() { |
| | | |
| | | { |
| | | this.$message.showLoading() |
| | | const params={ |
| | | l:0, |
| | | supplierId:this.id , |
| | | ...this.commentPage, |
| | | } |
| | | const { |
| | | code, |
| | | data |
| | | } = await this.$http.request('get', `/api/v2/flower-comment/page`, { |
| | | params: params |
| | | }) |
| | | if (code === 0) { |
| | | // this.commentList=data.records |
| | | this.commentPage.current=data.current |
| | | this.commentPage.pages=data.pages |
| | | this.commentPage.size=data.size |
| | | this.commentPage.total=data.total |
| | | // this.commentList = data.records.map(item => { |
| | | // return { |
| | | // ...item, |
| | | // commentImagesList: item.commentImages ? JSON.parse(item.commentImages) : [] // 将字符串转换成数组 |
| | | // }; |
| | | // }); |
| | | data.records.forEach(item => { |
| | | const commentImagesList = item.commentImages ? JSON.parse(item.commentImages) : []; |
| | | const existingCommentIndex = this.commentList.findIndex(comment => comment.id === item.id); |
| | | |
| | | if (existingCommentIndex !== -1) { |
| | | // 更新已存在的评论 |
| | | this.commentList[existingCommentIndex] = { |
| | | ...this.commentList[existingCommentIndex], |
| | | ...item, |
| | | commentImagesList |
| | | }; |
| | | } else { |
| | | // 新增评论 |
| | | this.commentList.push({ |
| | | ...item, |
| | | commentImagesList |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | this.$message.hideLoading() |
| | | } |
| | | |
| | | }, |
| | | |
| | | getList_after() { |
| | | if (this.list) { |
| | | for (var item of this.list) { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | if(flg=="2"){ |
| | | this.getCommentsStatis() |
| | | this.getComments() |
| | | } |
| | | |
| | | this.flg = '' + flg |
| | | //如果没有加载数据,需要加载一下 |
| | | |
| | |
| | | .input { |
| | | |
| | | background-color: #fff !important; |
| | | |
| | | |
| | | border-radius: 8rpx; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | .comment-replay{ |
| | | background-color: #F6F6F6; |
| | | color: #6582B6; |
| | | margin-top:10rpx; |
| | | padding: 10rpx; |
| | | } |
| | | } |
| | | </style> |