pingjia.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view>
  3. <view class="flex margin-lr padding-tb-sm u-border-bottom" v-if="shopDet.shopScore">
  4. <view class="flex padding-right">
  5. <view class="text-sl" style="color: #FD6416;">{{shopDet.shopScore}}</view>
  6. <view class="flex flex-direction justify-around margin-left-sm">
  7. <view>商家评分</view>
  8. <view class="flex">
  9. <u-icon v-for="ite in shopDet.shopScore1" :key='ite' color="#FCD202" name="star-fill"></u-icon>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="flex-sub flex justify-around u-border-left padding-left">
  14. <view class="flex flex-direction justify-around text-center">
  15. <view>好评</view>
  16. <view>{{EvaluateData.goodReputation}}</view>
  17. </view>
  18. <view class="flex flex-direction justify-around text-center">
  19. <view>中评</view>
  20. <view>{{EvaluateData.mediumReview}}</view>
  21. </view>
  22. <view class="flex flex-direction justify-around text-center">
  23. <view>差评</view>
  24. <view>{{EvaluateData.negativeComment}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="padding-tb-sm margin-lr">
  29. <u-button hover-class='none' @click="sel(0)" type="primary" shape="circle" size="mini" :plain="false"
  30. :custom-style="count==0?customStyle:customStyle1">全部评论</u-button>
  31. <u-button hover-class='none' @click="sel(1)" type="primary" shape="circle" size="mini" :plain="false"
  32. :custom-style="count==1?customStyle:customStyle1">
  33. 好评({{EvaluateData.goodReputation}})</u-button>
  34. <u-button hover-class='none' @click="sel(2)" type="primary" shape="circle" size="mini" :plain="false"
  35. :custom-style="count==2?customStyle:customStyle1">
  36. 中评({{EvaluateData.mediumReview}})</u-button>
  37. <u-button hover-class='none' @click="sel(3)" type="primary" shape="circle" size="mini" :plain="false"
  38. :custom-style="count==3?customStyle:customStyle1">
  39. 差评({{EvaluateData.negativeComment}})</u-button>
  40. </view>
  41. <view class="padding-tb-sm margin-lr u-border-bottom" v-for="(item, index) in EvaluateList" :key='index'>
  42. <view class="flex justify-between align-center">
  43. <view class="flex align-center">
  44. <u-avatar :src="item.avatar" size="65"></u-avatar>
  45. <view class=" margin-left-sm" style="line-height: 46upx;">{{item.userName?item.userName:'匿名'}}
  46. </view>
  47. <view class="flex margin-left-sm">
  48. <u-icon v-for="ite in item.score" :key='ite' color="#FCD202" name="star-fill">
  49. </u-icon>
  50. </view>
  51. </view>
  52. <view>{{item.createTime}}</view>
  53. </view>
  54. <view style="display: flex;">
  55. <view class="margin-top-sm" :style="!item.shopReplyMessage ? 'width: 90%;' : ''">{{item.evaluateMessage}}</view>
  56. <view class="flex padding-top-sm margin-right" @tap="goShow(index)" v-if="!item.shopReplyMessage">
  57. <image src="../../static/images/order/pinglun.png" style="width: 20px;height: 20px;"></image>
  58. </view>
  59. </view>
  60. <view class="margin-top-sm" v-if="item.shopReplyMessage">
  61. <view class="flex align-center">
  62. <view class=" flex align-center text-df" style="color: #999999;">
  63. <view class="text-df">商家回复:</view>{{item.shopReplyMessage}}
  64. </view>
  65. </view>
  66. <!-- <view class="text-lg padding-left margin-left-xl">{{dataDet.shopReplyMessage}}</view> -->
  67. </view>
  68. <view class="flex" style="width: 100%;margin-top: 20rpx;flex-wrap: wrap;" v-if="item.pictures">
  69. <image @click="lookImgs(ind,item.pictures)" :src="ite" v-for="(ite,ind) in item.pictures" :key="ind" style="width: 200rpx;height: 200rpx;margin-right: 10rpx;margin-bottom: 10rpx;" mode=""></image>
  70. </view>
  71. </view>
  72. <empty v-if="EvaluateList.length<=0"></empty>
  73. <!-- 评论弹框 -->
  74. <u-popup v-model="show" mode="bottom" border-radius="14" :closeable="closeable">
  75. <view>
  76. <view class="margin padding-tb">
  77. <u-input v-model="pinglun" type="textarea" height="200" placeholder="请填写回复的内容" maxlengt="200"
  78. :clearable="false" style="background:#F5F5F5;" />
  79. </view>
  80. <view class="btn" @click="bindEvaluate()">提交</view>
  81. </view>
  82. </u-popup>
  83. </view>
  84. </template>
  85. <script>
  86. import empty from '../../components/empty.vue'
  87. export default {
  88. components:{
  89. empty
  90. },
  91. data() {
  92. return {
  93. pinglun: '',
  94. count: 0,
  95. show: false,
  96. customStyle: {
  97. color: '#333333',
  98. background: '#FCD202',
  99. marginRight: '20rpx',
  100. border: 0
  101. },
  102. customStyle1: {
  103. color: '#333333',
  104. background: '#F2F2F2',
  105. marginRight: '20rpx',
  106. border: 0
  107. },
  108. cashDeposit: [],
  109. EvaluateData: {},
  110. EvaluateList: [],
  111. grade: '',
  112. page: 1,
  113. size: 10,
  114. isShow: false,
  115. oneData: [],
  116. titleData: [],
  117. shopDet: {}
  118. }
  119. },
  120. onShow() {
  121. this.getshanghuinfo();
  122. this.getList()
  123. },
  124. onReachBottom: function() {
  125. this.page = this.page + 1;
  126. this.getList()
  127. },
  128. methods: {
  129. //预览图片
  130. lookImgs(index,imgs){
  131. uni.previewImage({
  132. current:index,
  133. urls:imgs
  134. })
  135. },
  136. goShow(index){
  137. this.orderNumber = this.EvaluateList[index].orderNumber;
  138. this.show = true;
  139. },
  140. getshanghuinfo() {
  141. let data = {
  142. shopId: uni.getStorageSync('shopId')
  143. }
  144. this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
  145. if (res.code == 0) {
  146. this.shopDet = res.data;
  147. this.shopDet.shopScore = parseFloat(this.shopDet.shopScore).toFixed(1)
  148. this.shopDet.shopScore1 = Math.floor(this.shopDet.shopScore)
  149. }
  150. });
  151. },
  152. //评论
  153. bindEvaluate() {
  154. let data = {
  155. shopReplyMessage: this.pinglun,
  156. orderNumber: this.orderNumber
  157. }
  158. this.$Request.postT("/admin/order/shopReplyEvaluate", data).then(res => {
  159. uni.hideLoading()
  160. if (res.code == 0) {
  161. this.show = false
  162. this.page = 1
  163. this.getList()
  164. }
  165. });
  166. },
  167. sel(e) {
  168. this.grade = e
  169. this.count = e
  170. this.page = 1
  171. this.getList()
  172. },
  173. open(data) {
  174. console.log(data);
  175. this.oneData = data;
  176. this.titleData = data.goods
  177. this.isShow = true;
  178. },
  179. close() {
  180. this.isShow = false;
  181. },
  182. // 获取评价列表
  183. getList() {
  184. let data = {
  185. shopId: uni.getStorageSync('shopId'),
  186. page: this.page,
  187. limit: this.size,
  188. grade: this.grade
  189. }
  190. this.$Request.get("/app/goods/selectEvaluateByShopId", data).then(res => {
  191. if (res.code == 0 && res.data) {
  192. this.EvaluateData = res.data
  193. res.data.pageUtils.list.map(item=>{
  194. if(item.pictures){
  195. item.pictures = item.pictures.split(',')
  196. }else{
  197. item.pictures = []
  198. }
  199. })
  200. if (this.page == 1) {
  201. this.EvaluateList = res.data.pageUtils.list
  202. } else {
  203. this.EvaluateList = [...this.EvaluateList, ...res.data.pageUtils.list]
  204. }
  205. }
  206. });
  207. }
  208. }
  209. }
  210. </script>
  211. <style lang="scss">
  212. page {
  213. background-color: #FFFFFF;
  214. }
  215. .box1 {
  216. position: absolute;
  217. background: #000000;
  218. width: 750rpx;
  219. height: 100vh;
  220. opacity: 0.4;
  221. }
  222. .moudes {
  223. width: 650rpx;
  224. position: absolute;
  225. background: #FFFFFF;
  226. top: 0;
  227. left: 0;
  228. right: 0;
  229. bottom: 0;
  230. margin: auto;
  231. height: 700rpx;
  232. border-radius: 10rpx;
  233. .bt {
  234. font-size: 30rpx;
  235. font-weight: bold;
  236. }
  237. .pjImg {
  238. width: 200rpx;
  239. height: 200rpx;
  240. }
  241. .navBox {
  242. .avtiter {
  243. width: 80rpx;
  244. height: 80rpx;
  245. border-radius: 40rpx;
  246. margin-right: 15rpx
  247. }
  248. padding-left: 30rpx;
  249. padding-top: 30rpx;
  250. display: flex;
  251. align-items: center;
  252. .userName {
  253. font-size: 28rpx;
  254. font-weight: bold;
  255. }
  256. }
  257. }
  258. .nrTxt {
  259. display: inline-block;
  260. width: 500rpx;
  261. }
  262. .navList {
  263. text-align: center;
  264. margin-top: 30rpx;
  265. padding-left: 30rpx;
  266. padding-right: 30rpx;
  267. display: flex;
  268. justify-content: center;
  269. .xq {
  270. font-size: 30rpx;
  271. font-weight: bolder;
  272. text-align: center;
  273. }
  274. }
  275. .contentTxt {
  276. view {
  277. margin-bottom: 30rpx;
  278. display: flex;
  279. align-items: center;
  280. }
  281. .title {
  282. font-size: 30rpx;
  283. font-weight: bold;
  284. color: #000000;
  285. margin-right: 15rpx;
  286. }
  287. .imgRsc {
  288. width: 100rpx;
  289. height: 100rpx;
  290. border-radius: 10rpx;
  291. }
  292. }
  293. .list_1 {
  294. position: absolute;
  295. }
  296. .btn {
  297. width: 690upx;
  298. height: 88upx;
  299. margin: 30upx auto;
  300. background: #FCD202;
  301. box-shadow: 0px 10upx 20upx 0upx #FFD9B3;
  302. border-radius: 16upx;
  303. display: flex;
  304. align-items: center;
  305. justify-content: center;
  306. color: #000000;
  307. }
  308. .one {
  309. background: #FFFFFF;
  310. margin-top: 20rpx;
  311. display: flex;
  312. justify-content: space-between;
  313. padding: 20rpx;
  314. .imgSrc {
  315. width: 100rpx;
  316. height: 100rpx;
  317. vertical-align: middle;
  318. margin-right: 20rpx;
  319. border-radius: 10rpx;
  320. }
  321. .name {
  322. margin-top: 10rpx;
  323. margin-bottom: 20rpx;
  324. font-size: 24rpx;
  325. color: #000000;
  326. }
  327. .timer {
  328. font-size: 20rpx;
  329. color: #b3b3c4;
  330. }
  331. .contentTxt {
  332. font-size: 24rpx;
  333. color: #000000;
  334. }
  335. }
  336. </style>