EvaluateList.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container">
  3. <view class="div common-header-wrap">
  4. <view class="status-holder"></view>
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="我的评价" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="scroll-view div" style="position:relative">
  14. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
  15. <view class="div" v-if="evaluateList && evaluateList.length">
  16. <view class="div item-wrapper mt-5" v-for="evaluate in evaluateList" :key="evaluate.ob_no" @click="goDetail(evaluate.geval_goodsid)">
  17. <view class="div item">
  18. <view class="div p-img">
  19. <image mode="aspectFit" class="img" :src="evaluate.geval_goodsimage"/>
  20. </view>
  21. <view class="div p-info">
  22. <view class="div p-name">{{evaluate.geval_goodsname}}</view>
  23. <uni-rate :size="18" :readonly="true" :value="evaluate.geval_scores"/>
  24. </view>
  25. </view>
  26. <view class="div p-content">评价:{{evaluate.geval_content}}</view>
  27. <view class="div p-time">{{$moment.unix(evaluate.geval_addtime).format('YYYY年MM月DD日')}}</view>
  28. </view>
  29. </view>
  30. <empty-record v-if="evaluateList && !evaluateList.length"></empty-record>
  31. </scroll-view>
  32. </view>
  33. </view></member-base>
  34. </template>
  35. <script>
  36. import {getFontSize} from '@/util/common'
  37. import TitleHeader from '../../TitleHeader'
  38. import MemberBase from '../MemberBase'
  39. import EmptyRecord from '../../EmptyRecord'
  40. import { urlencode } from '@/util/common'
  41. import { getMemberevaluateList } from '../../../api/memberEvaluate'
  42. export default {
  43. name: 'EvaluateList',
  44. components:{
  45. TitleHeader,
  46. MemberBase,
  47. EmptyRecord
  48. },
  49. mounted(){
  50. // #ifdef MP-WEIXIN
  51. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  52. // #endif
  53. },
  54. computed:{
  55. fontSize(){
  56. return getFontSize()
  57. },
  58. },
  59. data(){
  60. return {
  61. navHeight: 0,
  62. params: { 'page': 0, 'per_page': 10 },
  63. loading: false, // 是否加载更多
  64. isMore: true, // 是否有更多
  65. evaluateList: false // 商品列表
  66. }
  67. },
  68. created () {
  69. this.loadMore()
  70. },
  71. methods:{
  72. goBack(){uni.navigateBack({delta:1})},
  73. getEvaluateList (ispush) {
  74. uni.showLoading({ title: '加载中' })
  75. let params = this.params
  76. getMemberevaluateList(params).then(res => {
  77. uni.hideLoading()
  78. if (ispush && this.evaluateList) {
  79. this.evaluateList = this.evaluateList.concat(res.result.goodsevallist)
  80. } else {
  81. this.evaluateList = res.result.goodsevallist
  82. }
  83. if (res.result.hasmore) {
  84. this.isMore = true
  85. } else {
  86. this.isMore = false
  87. }
  88. })
  89. },
  90. loadMore () {
  91. this.loading = true
  92. this.params.page = ++this.params.page
  93. if (this.isMore) {
  94. this.loading = false
  95. this.getEvaluateList(true)
  96. }
  97. },
  98. goDetail (goods_id) {
  99. uni.navigateTo({url:'/pages/home/goodsdetail/Goodsdetail'+'?'+urlencode({ 'goods_id': goods_id } )})
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .scroll-view-wrapper{display: flex;flex-direction: column;}
  106. .scroll-view{flex:1}
  107. .item{display: flex;display:-webkit-flex;}
  108. .item-wrapper{background:#fff;padding:.5rem;}
  109. .item .p-img{}
  110. .item .p-img .img{width:3rem;border-radius:.2rem;}
  111. .item .p-info{margin-left:.4rem;}
  112. .item .p-info .p-name{
  113. height:2rem;
  114. line-height:1rem;
  115. display:-moz-box;
  116. display:-webkit-box;
  117. -webkit-line-clamp: 2;
  118. -moz-line-clamp: 2;
  119. -moz-box-orient:vertical;
  120. -webkit-box-orient:vertical;
  121. box-orient:vertical;
  122. overflow: hidden;
  123. font-size:$subFontSize;}
  124. .item .p-info .p-score{}
  125. .p-content{font-size:$subFontSize;line-height:.8rem;color:#666666;margin-top:.5rem}
  126. .p-time{text-align: right;font-size:$fontSize;color:$descTextColor}
  127. </style>