普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
4.9 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar :title="title" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
  4. <view class="main">
  5. <view class="tabs">
  6. <uv-tabs
  7. :list="tabs"
  8. :scrollable="false"
  9. lineColor="#7451DE"
  10. lineWidth="48rpx"
  11. lineHeight="4rpx"
  12. :activeStyle="{
  13. 'font-family': 'PingFang SC',
  14. 'font-weight': 500,
  15. 'font-size': '32rpx',
  16. 'line-height': 1.4,
  17. 'color': '#7451DE',
  18. }"
  19. :inactiveStyle="{
  20. 'font-family': 'PingFang SC',
  21. 'font-weight': 400,
  22. 'font-size': '32rpx',
  23. 'line-height': 1.4,
  24. 'color': '#181818',
  25. }"
  26. @click="clickTabs"
  27. ></uv-tabs>
  28. </view>
  29. <view class="comment">
  30. <view class="comment-item" v-for="item in list" :key="item.id">
  31. <commentCard :data="item"></commentCard>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import mixinsList from '@/mixins/list.js'
  39. import commentCard from '@/pages_order/comment/commentCard.vue'
  40. export default {
  41. mixins: [mixinsList],
  42. components: {
  43. commentCard,
  44. },
  45. data() {
  46. return {
  47. title: '用户评价',
  48. tabs: [
  49. { name: '全部' },
  50. { name: '有图/视频' },
  51. { name: '最新' },
  52. ],
  53. id: null,
  54. creator: null,
  55. mixinsListApi: '',
  56. }
  57. },
  58. onShow() {
  59. console.log('onShow')
  60. },
  61. onLoad(arg) {
  62. console.log('onLoad')
  63. const { title, id, creator } = arg
  64. title && (this.title = title)
  65. this.id = id
  66. this.creator = creator
  67. // todo set queryParams
  68. this.getData()
  69. },
  70. methods: {
  71. //点击tab栏
  72. clickTabs({ index }) {
  73. if (index == 0) {
  74. delete this.queryParams.status
  75. } else {
  76. this.queryParams.status = index - 1
  77. }
  78. this.getData()
  79. },
  80. // todo: delete
  81. getData() {
  82. this.list = [
  83. {
  84. id: '001',
  85. userName: '战斗世界',
  86. avatar: '/pages_order/static/report/avatar.png',
  87. countDesc: '三月装',
  88. createTime: '2023-04-18',
  89. content: '包装很精致,性价比非常高,终于收到啦,期待效果,每日一包,超级方便,真的能坚持服用',
  90. images: [
  91. '/pages_order/static/index/medicine-1.png',
  92. '/pages_order/static/index/medicine-2.png',
  93. '/pages_order/static/index/medicine-3.png',
  94. ],
  95. productServeScore: 5,
  96. questionExperienceScore: 4,
  97. deliverySpeedScore: 4.5,
  98. },
  99. {
  100. id: '002',
  101. userName: '战斗世界',
  102. avatar: '/pages_order/static/report/avatar.png',
  103. countDesc: '三月装',
  104. createTime: '2023-04-18',
  105. content: '包装很精致,性价比非常高,终于收到啦,期待效果,每日一包,超级方便,真的能坚持服用',
  106. images: [
  107. '/pages_order/static/index/medicine-1.png',
  108. '/pages_order/static/index/medicine-2.png',
  109. '/pages_order/static/index/medicine-3.png',
  110. ],
  111. productServeScore: 5,
  112. questionExperienceScore: 4,
  113. deliverySpeedScore: 4.5,
  114. },
  115. {
  116. id: '003',
  117. userName: '战斗世界',
  118. avatar: '/pages_order/static/report/avatar.png',
  119. countDesc: '三月装',
  120. createTime: '2023-04-18',
  121. content: '包装很精致,性价比非常高,终于收到啦,期待效果,每日一包,超级方便,真的能坚持服用',
  122. images: [
  123. '/pages_order/static/index/medicine-1.png',
  124. '/pages_order/static/index/medicine-2.png',
  125. '/pages_order/static/index/medicine-3.png',
  126. ],
  127. productServeScore: 5,
  128. questionExperienceScore: 4,
  129. deliverySpeedScore: 4.5,
  130. },
  131. ]
  132. this.total = this.list.length
  133. },
  134. },
  135. }
  136. </script>
  137. <style scoped lang="scss">
  138. .page__view {
  139. width: 100vw;
  140. min-height: 100vh;
  141. background-color: $uni-bg-color;
  142. position: relative;
  143. /deep/ .nav-bar__view {
  144. position: fixed;
  145. top: 0;
  146. left: 0;
  147. }
  148. }
  149. .main {
  150. width: 100vw;
  151. padding-top: calc(var(--status-bar-height) + 204rpx);
  152. box-sizing: border-box;
  153. .tabs {
  154. position: fixed;
  155. top: calc(var(--status-bar-height) + 120rpx);
  156. left: 0;
  157. width: 100%;
  158. height: 84rpx;
  159. background: #FFFFFF;
  160. /deep/ .uv-tabs__wrapper__nav__line {
  161. border-radius: 2rpx;
  162. bottom: 0;
  163. }
  164. }
  165. }
  166. .comment {
  167. padding: 40rpx 32rpx;
  168. &-item {
  169. & + & {
  170. margin-top: 40rpx;
  171. }
  172. }
  173. }
  174. </style>