appraise.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <view class="one_1">
  6. <view class="text1">{{info.name}}{{info.specs}}</view>
  7. <view class="text2">好评率 <text>{{info.rate}}%</text></view>
  8. </view>
  9. <view class="one_2">
  10. <view class="one_2_1" v-for="(item,index) in btnlist" :key="index">
  11. <text>{{item.name}}</text><text>({{item.num||0}})</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="two">
  16. <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
  17. <view class="list-scroll-view">
  18. <view class="list" v-for="(item, index) in list" :key="index">
  19. <image v-if="item.file&&item.file.length>0" class="image"
  20. :src="item.file&&item.file.length>0?item.file[0].url:''" mode="">
  21. </image>
  22. <text v-else class="iconfont icon-top"></text>
  23. <view class="list_1">
  24. <view class="other">
  25. <text>{{item.phone}}</text>
  26. <text>{{item.time}}</text>
  27. </view>
  28. <view class="other1">{{item.content}}</view>
  29. <view class="other1">规格:{{item.specs}}</view>
  30. </view>
  31. </view>
  32. </view>
  33. </scroll-view>
  34. </view>
  35. </view>
  36. </mobile-frame>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. btnlist: [{
  43. name: '全部好评',
  44. num: '1',
  45. code: '0'
  46. },
  47. {
  48. name: '好评',
  49. num: '1',
  50. code: '0'
  51. },
  52. {
  53. name: '中评',
  54. num: '1',
  55. code: '0'
  56. },
  57. {
  58. name: '差评',
  59. num: '1',
  60. code: '0'
  61. }
  62. ],
  63. info: {
  64. name: '高精面粉',
  65. specs: '5g',
  66. rate: '95'
  67. },
  68. list: [{
  69. phone: '150********',
  70. content: '好评!',
  71. specs: '2.5kg',
  72. time: '2022-12-03 16:15:00'
  73. },
  74. {
  75. phone: '150********',
  76. content: '好评!',
  77. specs: '2.5kg',
  78. time: '2022-12-03 16:15:00'
  79. },
  80. {
  81. phone: '150********',
  82. content: '好评!',
  83. specs: '2.5kg',
  84. time: '2022-12-03 16:15:00'
  85. },
  86. {
  87. phone: '150********',
  88. content: '好评!',
  89. specs: '2.5kg',
  90. time: '2022-12-03 16:15:00'
  91. }
  92. ],
  93. total: 0,
  94. skip: 0,
  95. limit: 6,
  96. page: 0
  97. };
  98. },
  99. onLoad: function(e) {
  100. },
  101. methods: {
  102. // 分页
  103. toPage(e) {
  104. const that = this;
  105. let list = that.list;
  106. let limit = that.limit;
  107. if (that.total > list.length) {
  108. uni.showLoading({
  109. title: '加载中',
  110. mask: true
  111. })
  112. let page = that.page + 1;
  113. that.$set(that, `page`, page)
  114. let skip = page * limit;
  115. that.$set(that, `skip`, skip)
  116. that.search();
  117. uni.hideLoading();
  118. } else uni.showToast({
  119. title: '没有更多数据了'
  120. });
  121. },
  122. // 清空列表
  123. clearPage() {
  124. const that = this;
  125. that.$set(that, `list`, [])
  126. that.$set(that, `skip`, 0)
  127. that.$set(that, `limit`, 6)
  128. that.$set(that, `page`, 0)
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss">
  134. .main {
  135. display: flex;
  136. flex-direction: column;
  137. width: 100vw;
  138. height: 100vh;
  139. background-color: var(--f1Color);
  140. .one {
  141. margin: 0 0 2vw 0;
  142. .one_1 {
  143. display: flex;
  144. justify-content: space-around;
  145. background-color: var(--mainColor);
  146. margin: 0 0 0.5vw 0;
  147. padding: 2vw;
  148. .text1 {
  149. font-size: var(--font16Szie);
  150. }
  151. .text2 {
  152. font-size: var(--font16Szie);
  153. color: var(--f85Color);
  154. text {
  155. margin: 0 0 0 1vw;
  156. color: var(--ff0Color);
  157. }
  158. }
  159. }
  160. .one_2 {
  161. display: flex;
  162. justify-content: space-between;
  163. padding: 2vw;
  164. background-color: var(--mainColor);
  165. }
  166. }
  167. .two{
  168. position: relative;
  169. flex-grow: 1;
  170. .list{
  171. display: flex;
  172. justify-content: space-around;
  173. align-items: center;
  174. background-color: var(--mainColor);
  175. margin: 0 0 2vw 0;
  176. padding: 2vw;
  177. .other{
  178. display: flex;
  179. justify-content: space-between;
  180. }
  181. }
  182. }
  183. }
  184. .scroll-view {
  185. position: absolute;
  186. top: 0;
  187. left: 0;
  188. right: 0;
  189. bottom: 0;
  190. .list-scroll-view {
  191. display: flex;
  192. flex-direction: column;
  193. }
  194. }
  195. </style>