recommendHistory.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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 class="list-item" v-for="(item, index) in list" :key="index">
  11. <view class="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.channelTypeText||''}}</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. 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. })
  68. },
  69. scrolltolower(){
  70. if(this.isOver) return
  71. this.getList();
  72. },
  73. initList(){
  74. this.queryParams.page = 1;
  75. this.isOver = false;
  76. this.list = [];
  77. },
  78. getList(){
  79. this.$api.get('/core/register/record/page',this.queryParams).then(({data:res})=>{
  80. if(res.code!==0) return this.$showToast(res.msg)
  81. this.list = [...this.list,...res.data.list];
  82. this.list.forEach(l=>{
  83. l.channelTypeText = this.typeData.find(t=>t.id===l.channelType).name||'';
  84. })
  85. this.queryParams.page++;
  86. if(res.data.list.length===0) this.isOver = true;
  87. })
  88. },
  89. confirm(e){
  90. this.typeText = e.value[0].name;
  91. this.queryParams.channelType = e.value[0].id;
  92. this.show = false;
  93. this.initList();
  94. this.getList();
  95. }
  96. }
  97. }
  98. </script>
  99. <style scoped lang="scss">
  100. .default_page{
  101. background: #F7F7F7;
  102. padding: 0 24rpx 40rpx;
  103. box-sizing: border-box;
  104. .top{
  105. position: fixed;
  106. left: 0;
  107. right: 0;
  108. height: 90rpx;
  109. background: #FFFFFF;
  110. padding-left: 38rpx;
  111. text{
  112. font-family: PingFang-SC, PingFang-SC;
  113. font-weight: bold;
  114. font-size: 28rpx;
  115. color: #002846;
  116. line-height: 30rpx;
  117. }
  118. image{
  119. width: 24rpx;
  120. height: 24rpx;
  121. margin-left: 16rpx;
  122. }
  123. }
  124. .list{
  125. padding-top: 110rpx;
  126. &-item{
  127. background: #FFFFFF;
  128. border-radius: 24rpx;
  129. margin-top: 20rpx;
  130. padding: 32rpx 24rpx;
  131. &:first-child{
  132. margin-top: 0;
  133. }
  134. &-left{
  135. image{
  136. width: 88rpx;
  137. height: 88rpx;
  138. }
  139. .name{
  140. margin-left: 20rpx;
  141. p{
  142. font-family: PingFang-SC, PingFang-SC;
  143. font-weight: bold;
  144. font-size: 32rpx;
  145. color: #002846;
  146. line-height: 32rpx;
  147. }
  148. text{
  149. font-family: PingFangSC, PingFang SC;
  150. font-weight: 400;
  151. font-size: 24rpx;
  152. color: #667E90;
  153. line-height: 24rpx;
  154. margin-top: 24rpx;
  155. }
  156. }
  157. }
  158. &-right{
  159. font-family: PingFangSC, PingFang SC;
  160. font-weight: 400;
  161. font-size: 24rpx;
  162. color: #95A5B1;
  163. line-height: 24rpx;
  164. }
  165. }
  166. }
  167. }
  168. </style>