actDetail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="hb column">
  3. <view class="topBgline plr20">
  4. <view class="justify-between p30 bgcolf radius12 align-center">
  5. <view class="ml16">
  6. <view class="bold fs28 justify-start align-center">
  7. <text>{{detailUser.nickname}}</text>
  8. <image class="list-item-copy ml8" :src="imgPath+'/app/images/copy_icon.png'" mode="aspectFill"
  9. @click="copyId(detailUser.nickname)">
  10. </image>
  11. </view>
  12. <view class="fs24 base-color-6 mt8" >跟进人:林新新</view>
  13. <view class="fs24 base-color-6">注册时间:{{detailUser.createTime}}</view>
  14. </view>
  15. <u-avatar :src='detailUser.avatar' shape="square" size='50'></u-avatar>
  16. </view>
  17. </view>
  18. <view class="p20">
  19. <view class="justify-between bgf p40 radius12">
  20. <view>
  21. <view>客户标签</view>
  22. <view class="base-color-6 fs24">{{detailUser.tag?detailUser.tag:'暂无'}}</view>
  23. </view>
  24. <view class="justify-start align-center base-color-6 fs24">
  25. <!-- <view>共{{detailUser.tag.length?detailUser.tag.length:'0'}}个</view> -->
  26. <view>{{detailUser.tag.length?detailUser.tag.split(",").length:'0'}}</view>
  27. <image :src="imgPath+'/app/images/right_arrow.png'" class="w12 h20 ml12"></image>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="w100 bgf align-center justify-center">
  32. <u-tabs :list="list1" @click="clicktab" lineWidth='30' activeStyle="{color:'#333';font}"></u-tabs>
  33. </view>
  34. <view class="bgf flex-1 hidden h100">
  35. <scroll-view scroll-y="true" class="hb" :refresher-enabled="isEnabled" :refresher-triggered="triggered"
  36. refresher-background="rgba(0,0,0,0)" @refresherrefresh="pullDownRefresh"
  37. @refresherrestore="triggered = false" :upper-threshold="100" :lower-threshold="100"
  38. @refresherabort="triggered = false" @scrolltolower="reachBottom">
  39. <view v-for="(item,index) in userlist" :key="index" class="p20">
  40. <view class="justify-between align-center">
  41. <view>{{item.operationType}}</view>
  42. <view class="base-color-6 fs24">{{item.createTime}}</view>
  43. </view>
  44. <view v-html="item.text"></view>
  45. </view>
  46. <u-loadmore :status="status" />
  47. <view class="h80 w100"></view>
  48. </scroll-view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import {
  54. getuserTrajectory
  55. } from "@/api/courseManage.js";
  56. export default {
  57. data() {
  58. return {
  59. detailUser:{},
  60. list1: [{
  61. name: '行为轨迹',
  62. value:1
  63. }],
  64. pageNum:1,
  65. pageSize:6,
  66. id:'',
  67. userlist:[],
  68. isEnabled:true,
  69. triggered: false,
  70. status:'loadmore'
  71. }
  72. },
  73. computed: {
  74. imgPath() {
  75. return this.$store.state.imgpath
  76. },
  77. imgname() {
  78. return this.$store.state.logoname
  79. }
  80. },
  81. onShow() {
  82. this.detailUser =uni.getStorageSync('detailUser')
  83. this.getuserlist()
  84. },
  85. onLoad(option) {
  86. this.id=option.id
  87. },
  88. methods: {
  89. pullDownRefresh() {
  90. // 下拉
  91. this.triggered = true; //下拉了状态为true
  92. setTimeout(() => {
  93. this.triggered = false;
  94. uni.stopPullDownRefresh()
  95. this.pageNum = 1;
  96. this.getuserlist('refresh') //触底 不穿执行else
  97. }, 1000)
  98. },
  99. reachBottom() {
  100. //上拉
  101. // status这个是加载状态
  102. if (this.status === 'loadmore') {
  103. this.status = 'loading'
  104. uni.showNavigationBarLoading()
  105. setTimeout(() => {
  106. this.pageNum++
  107. this.getuserlist() //触底 不穿执行else
  108. uni.hideNavigationBarLoading()
  109. }, 1000);
  110. }
  111. },
  112. getuserlist(type){
  113. const data={
  114. userId:this.id,
  115. pageNum:this.pageNum,
  116. pageSize:this.pageSize
  117. }
  118. getuserTrajectory(data).then(res=>{
  119. if(res.code==200){
  120. if (type == 'refresh') {
  121. this.userlist = res.data.list
  122. } else {
  123. // 加载更多 当前页和下一页合并
  124. this.userlist = [...this.userlist, ...res.data.list]
  125. }
  126. if (this.pageNum >= res.data.pages) {
  127. this.status = 'nomore'
  128. } else {
  129. this.status = 'loadmore'
  130. }
  131. console.log(res)
  132. }else{
  133. uni.showToast({
  134. title: res.msg,
  135. icon: 'none',
  136. duration: 2000
  137. });
  138. }
  139. })
  140. },
  141. clicktab(item) {
  142. console.log('item', item);
  143. },
  144. copyId(id) {
  145. setTimeout(()=>{
  146. uni.setClipboardData({
  147. data: String(id),
  148. success: () => {
  149. uni.showToast({
  150. title: '复制成功',
  151. icon: 'none',
  152. duration: 2000
  153. });
  154. },
  155. })
  156. },200)
  157. },
  158. }
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .topBgline {
  163. background: linear-gradient(to right, rgba(225, 238, 255, 1), rgba(223, 224, 254, 1));
  164. padding-top: 40rpx;
  165. }
  166. .bgcolf {
  167. background: rgba(255, 255, 255, 0.4);
  168. }
  169. .list-item-copy {
  170. width: 20px;
  171. height: 20px;
  172. }
  173. </style>