evaluateManagement.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view class="container">
  3. <!-- <view class="top-box">
  4. <view class="top-l">
  5. <view class="l-l"> {{ value.toFixed(1) }} </view>
  6. <view class="l-r">
  7. <u-rate :count="count" v-model="value"></u-rate>
  8. <p>根据近90天评价计其所得</p>
  9. </view>
  10. </view>
  11. <view class="top-r">
  12. <span>更多</span>
  13. <u-icon name="arrow-right" color="#9B9B9B" size="18"></u-icon>
  14. </view>
  15. </view> -->
  16. <view class="content-box">
  17. <view class="top-box">
  18. <u-tabs :current="list1Current" :list="list1" lineWidth="30" lineColor="$uni-bg-color-primary"
  19. :activeStyle="{
  20. color: '#000',
  21. fontSize: '28rpx',
  22. transform: 'scale(1.05)',
  23. marginBottom: '15rpx',
  24. }" :inactiveStyle="{
  25. color: '#333',
  26. fontSize: '30rpx',
  27. transform: 'scale(1)',
  28. marginBottom: '15rpx',
  29. }" @click="handlerSelectItem1"></u-tabs>
  30. </view>
  31. <view class="item-box">
  32. <view class="item" :class="current == index ? 'act-item' : ''" v-for="(item, index) of contentList"
  33. :key="index" @click="handlerSelectItem(item, index)">{{ item.name }}{{ item.numb }}</view>
  34. </view>
  35. <!-- <view class="item-radio-box">
  36. <u-radio-group v-model="radiovalue1" placement="row">
  37. <u-radio
  38. :customStyle="{ margin: '8px' }"
  39. v-for="(item, index) in radiolist1"
  40. :key="index"
  41. :label="item.name"
  42. :name="item.name"
  43. >
  44. </u-radio>
  45. </u-radio-group>
  46. </view> -->
  47. </view>
  48. <evaluateItem :dataList="dataList"></evaluateItem>
  49. </view>
  50. </template>
  51. <script>
  52. import evaluateItem from './components/evaluateItem.vue';
  53. import {
  54. getEvaluateListApi,
  55. getMerchantQueryApi
  56. } from '@/api/merchant/evaluate';
  57. import {
  58. mapGetters
  59. } from 'vuex';
  60. export default {
  61. data() {
  62. return {
  63. merchantId: "",
  64. list1Current: 0,
  65. current: 0,
  66. count: 5,
  67. value: 2,
  68. score:"0",
  69. list1: [{
  70. name: '未回复的评价',
  71. },
  72. {
  73. name: '全部评价',
  74. },
  75. ],
  76. contentList: [{
  77. name: '全部',
  78. numb: 360,
  79. },
  80. {
  81. name: '五星',
  82. numb: 21,
  83. value: 5,
  84. },
  85. {
  86. name: '四星',
  87. numb: 50,
  88. value: 4,
  89. },
  90. {
  91. name: '三星',
  92. numb: 88,
  93. value: 3,
  94. },
  95. {
  96. name: '二星',
  97. numb: 72,
  98. value: 2,
  99. },
  100. {
  101. name: '一星',
  102. numb: 218,
  103. value: 1,
  104. },
  105. ],
  106. radiolist1: [{
  107. name: '有内容的评价',
  108. disabled: false,
  109. },
  110. {
  111. name: '有图片的评价',
  112. disabled: false,
  113. },
  114. ],
  115. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  116. radiovalue1: '有内容的评价',
  117. dataList: [],
  118. };
  119. },
  120. components: {
  121. evaluateItem,
  122. },
  123. created() {
  124. // 获取商家id
  125. let merchantInfo = this.$store.state.data.merchantInfo;
  126. this.merchantId = merchantInfo.merchant.id;
  127. this.getEvaluateList(this.merchantId, this.list1Current, this.current);
  128. },
  129. methods: {
  130. handlerSelectItem1(item) {
  131. this.list1Current = item.index
  132. this.getEvaluateList(this.merchantId, item.index,this.score);
  133. },
  134. handlerSelectItem(item, index) {
  135. console.log(item, index)
  136. this.current = index
  137. this.score = item.value
  138. this.contentList = [...this.contentList]
  139. this.getEvaluateList(this.merchantId, this.list1Current, item.value);
  140. },
  141. async getEvaluateList(merchantId, isRecover, score) {
  142. let res = await getMerchantQueryApi({
  143. merchantId,
  144. isRecover,
  145. score
  146. });
  147. if (res.code == "OK") {
  148. this.dataList = res.data
  149. console.log("dasd")
  150. }
  151. },
  152. },
  153. };
  154. </script>
  155. <style lang="scss" scoped>
  156. .container {
  157. background-color: #f5f5f5 !important;
  158. min-height: calc(100vh - 20rpx);
  159. padding-bottom: 20rpx;
  160. .top-box {
  161. background-color: #fff;
  162. padding: 20rpx 40rpx;
  163. display: flex;
  164. justify-content: space-between;
  165. .top-l {
  166. display: flex;
  167. align-items: center;
  168. .l-l {
  169. margin-right: 20rpx;
  170. font-size: 42rpx;
  171. color: #d32625;
  172. font-weight: bold;
  173. }
  174. .l-r {
  175. p {
  176. margin-top: 20rpx;
  177. font-size: 24rpx;
  178. color: #afafaf;
  179. }
  180. }
  181. }
  182. .top-r {
  183. display: flex;
  184. align-items: center;
  185. color: #afafaf;
  186. font-size: 26rpx;
  187. }
  188. }
  189. .content-box {
  190. padding: 0 20rpx 20rpx;
  191. background-color: #fff;
  192. margin: 10rpx 0;
  193. .item-box {
  194. display: grid;
  195. grid-template-columns: 32% 32% 32%;
  196. justify-content: space-between;
  197. .item,
  198. .act-item {
  199. border: 2rpx solid #e0e0e0;
  200. padding: 10rpx 30rpx;
  201. text-align: center;
  202. margin: 20rpx;
  203. font-size: 26rpx;
  204. color: #999999;
  205. }
  206. .act-item {
  207. border: 2rpx solid #87afcc !important;
  208. color: #87afcc !important;
  209. }
  210. }
  211. .item-radio-box {}
  212. }
  213. }
  214. </style>