recommendHistory.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="default_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='推荐记录'></cus-header>
  4. <view class="top adfac" @click="show=true">
  5. <text>{{typeText}}</text>
  6. <image :src="imgBase+'icon_down.png'"></image>
  7. </view>
  8. <view class="list" v-if="list.length">
  9. <up-list @scrolltolower="scrolltolower" style="height: 100%">
  10. <up-list-item v-for="(item, index) in list" :key="index">
  11. <view class="list-item adfacjb">
  12. <view class="list-item-left adfac">
  13. <image :src="imgCfg[item.channelType]||defaultImg"></image>
  14. <view class="name adffc">
  15. <p>{{item.realName}}</p>
  16. <text>来源:{{item.channelName||''}}</text>
  17. </view>
  18. </view>
  19. <view class="list-item-right">{{item.createDate||''}}</view>
  20. </view>
  21. </up-list-item>
  22. </up-list>
  23. </view>
  24. <view style="height: 100%;" v-else>
  25. <page-empty text="暂无推荐记录"></page-empty>
  26. </view>
  27. <u-picker :itemHeight="88" :immediateChange="true" :show="show" :columns="typeData" title="渠道类型"
  28. @cancel="show=false" @confirm="confirm" keyName="name"></u-picker>
  29. </view>
  30. </template>
  31. <script>
  32. import PageEmpty from '@/components/pageEmpty/index.vue'
  33. export default {
  34. components:{ PageEmpty },
  35. data(){
  36. return {
  37. show:false,
  38. typeText:'全部渠道',
  39. typeData:[],
  40. defaultImg:this.$imgBase+'recommend_zf.png',
  41. imgCfg:{
  42. 'Questionnaire':this.$imgBase+'recommend_wj.png',
  43. 'Forward':this.$imgBase+'recommend_zf.png',
  44. 'scan':this.$imgBase+'recommend_yy1.png',
  45. 'common':this.$imgBase+'recommend_yy2.png'
  46. },
  47. queryParams:{
  48. page:1,
  49. limit:10,
  50. channelType:'',
  51. referrerId:''
  52. },
  53. isOver:false,
  54. list:[]
  55. }
  56. },
  57. async onLoad() {
  58. this.queryParams.referrerId = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo')).id||'';
  59. this.getChannelData();
  60. this.getList();
  61. },
  62. methods:{
  63. getChannelData(){
  64. this.$api.get('/getListByType/channel_type').then(({data:res})=>{
  65. if(res.code!==0) return this.$showToast(res.msg)
  66. this.typeData = [res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))];
  67. resolve()
  68. })
  69. },
  70. scrolltolower(){
  71. if(this.isOver) return
  72. this.getList();
  73. },
  74. initList(){
  75. this.queryParams.page = 1;
  76. this.isOver = false;
  77. this.list = [];
  78. },
  79. getList(){
  80. this.$api.get('/core/register/record/page',this.queryParams).then(({data:res})=>{
  81. if(res.code!==0) return this.$showToast(res.msg)
  82. this.list = [...this.list,...res.data.list];
  83. this.queryParams.page++;
  84. if(res.data.list.length===0) this.isOver = true;
  85. })
  86. },
  87. confirm(e){
  88. this.typeText = e.value[0].name;
  89. this.queryParams.channelType = e.value[0].id;
  90. this.show = false;
  91. this.initList();
  92. this.getList();
  93. }
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .default_page{
  99. background: #F7F7F7;
  100. padding: 0 24rpx 40rpx;
  101. box-sizing: border-box;
  102. .top{
  103. position: fixed;
  104. left: 0;
  105. right: 0;
  106. height: 90rpx;
  107. background: #FFFFFF;
  108. padding-left: 38rpx;
  109. text{
  110. font-family: PingFang-SC, PingFang-SC;
  111. font-weight: bold;
  112. font-size: 28rpx;
  113. color: #002846;
  114. line-height: 30rpx;
  115. }
  116. image{
  117. width: 24rpx;
  118. height: 24rpx;
  119. margin-left: 16rpx;
  120. }
  121. }
  122. .list{
  123. padding-top: 110rpx;
  124. &-item{
  125. background: #FFFFFF;
  126. border-radius: 24rpx;
  127. margin-top: 20rpx;
  128. padding: 32rpx 24rpx;
  129. &:first-child{
  130. margin-top: 0;
  131. }
  132. &-left{
  133. image{
  134. width: 88rpx;
  135. height: 88rpx;
  136. }
  137. .name{
  138. margin-left: 20rpx;
  139. p{
  140. font-family: PingFang-SC, PingFang-SC;
  141. font-weight: bold;
  142. font-size: 32rpx;
  143. color: #002846;
  144. line-height: 32rpx;
  145. }
  146. text{
  147. font-family: PingFangSC, PingFang SC;
  148. font-weight: 400;
  149. font-size: 24rpx;
  150. color: #667E90;
  151. line-height: 24rpx;
  152. margin-top: 24rpx;
  153. }
  154. }
  155. }
  156. &-right{
  157. font-family: PingFangSC, PingFang SC;
  158. font-weight: 400;
  159. font-size: 24rpx;
  160. color: #95A5B1;
  161. line-height: 24rpx;
  162. }
  163. }
  164. }
  165. }
  166. </style>