vermicelli.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <view>
  3. <view class="app-bg">
  4. <image src="/static/img/tream_bg.png"></image>
  5. </view>
  6. <view class="app-h">
  7. <uni-nav-bar color="#fff" :border="false" statusBar backgroundColor="transparent" left-icon="left" @clickLeft="utils.navigateBack()" fixed title="我的推荐"></uni-nav-bar>
  8. </view>
  9. <view class="app-body">
  10. <view id="app-top">
  11. <view class="app-pannel">
  12. <view class="frinfo fx-r fx-bc fx-ac">
  13. <view class="item fx-h fx-bc fx-ac">
  14. <view class="count">{{data.oneTotal || 0}}</view>
  15. <view class="label">推荐人数</view>
  16. </view>
  17. <view class="line"></view>
  18. <view class="item fx-h fx-bc fx-ac">
  19. <view class="count">{{ data.teamCount || 0 }}</view>
  20. <view class="label">总人</view>
  21. </view>
  22. </view>
  23. <view class="panel-inner" hidden>
  24. <view class="li"></view>
  25. <view class="info fx-r" @tap="tapAwardLog">
  26. <image class="icon" src="/static/img/new_person_ award.png"></image>
  27. <view class="text">新人奖申请记录</view>
  28. <view class="fx-g1"></view>
  29. <view class="more fx-r fx-bc">
  30. <view class="tag">查看详细</view>
  31. <image class="pev" src="/static/img/ic_next.png"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <!--关键词搜索-->
  37. <view class="sreach fx-r fx-bc fx-ac">
  38. <image class="icon" src="/static/img/tb-seach.png"></image>
  39. <input type="text" v-model="keyword" placeholder="请输入用户昵称/用户ID" placeholder-style="color: #B3B3B3;" />
  40. <view class="fx-g1"></view>
  41. <view class="search-btn" @tap="tapSerach">搜索</view>
  42. </view>
  43. </view>
  44. <scroll-view scroll-y class="scroll" style="position: absolute;width: calc(100% - 48rpx);" :style="'height: calc(100vh - 45vw + 180rpx - 30px - ' + topViewHeight + 'px);'" @scrolltolower="onBottom">
  45. <view class="sc-body">
  46. <view class="item" v-for="item in listAr">
  47. <view class="info fx-r">
  48. <image class="avatar" mode="aspectFill" :src="item.avatar || '/static/img/user-avatar1.png' "></image>
  49. <view class="ir">
  50. <view class="fx-r fx-bc">
  51. <view class="title">{{ item.nickname }}</view>
  52. <view class="fx-g1"></view>
  53. <view class="ir-r">是否预约:<text v-if="item.booking_count > 0">已预约</text> <text v-else style="color: #000;">未预约</text></view>
  54. </view>
  55. <view class="ifoot fx-r">
  56. <view class="iid">ID:{{ item.uid }}</view>
  57. <view class="fx-g1"></view>
  58. <view class="time" v-if="item.lastSubscribetime != ''">最近预约:{{ item.lastSubscribetime }}</view>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="info-foot fx-r fx-bc">
  63. <view class="label">累计收益:</view>
  64. <view class="money">¥{{ item.totalEarnings || '0.00' }}</view>
  65. <view class="fx-g1"></view>
  66. <view class="sbtn" v-if="item.newAward == 9" @tap="tapSq(item)">申请新人奖</view>
  67. <view class="show-sbtn" v-if="item.newAward == 2">审核中</view>
  68. <view class="show-sbtn" v-if="item.newAward == 3">已申请新人奖</view>
  69. </view>
  70. </view>
  71. <view v-if="listAr.length > 0">
  72. <view class="loading fx-r fx-ac fx-bc" v-if="page.isFrite && !page.isFoot">
  73. <image src="/static/img/xloading.png"></image>
  74. <text>正在载入更多...</text>
  75. </view>
  76. <view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
  77. </view>
  78. <view v-if="listAr.length == 0 && isFrite">
  79. <u-empty
  80. mode="data"
  81. icon="/static/img/no-empty.png"
  82. ></u-empty>
  83. </view>
  84. </view>
  85. </scroll-view>
  86. </view>
  87. </view>
  88. </template>
  89. <style lang="scss">
  90. .app-bg{
  91. position: absolute;
  92. image{width: 100vw;height: 45vw;}
  93. }
  94. .app-h{
  95. height: 45vw;
  96. }
  97. .app-body{
  98. padding: 0px 24rpx;
  99. position: relative;
  100. top: -180rpx;
  101. .app-pannel{
  102. background: #fff;
  103. border-radius: 20rpx;
  104. .frinfo{
  105. padding-top: 60rpx;
  106. padding-bottom: 46rpx;
  107. width: 100%;
  108. .item{
  109. width: calc(50% - 1px);
  110. .count{
  111. font-weight: bold;
  112. font-size: 40rpx;
  113. color: #0C1732;
  114. }
  115. .label{
  116. font-size:28rpx;
  117. color: #666666;
  118. margin-top: 10rpx;
  119. }
  120. }
  121. .line{
  122. width: 2rpx;
  123. height: 86rpx;
  124. background: #DCDCDC;
  125. }
  126. }
  127. .panel-inner{
  128. padding: 0px 36rpx;
  129. .li{
  130. border: 1px dashed #f1f1f1;
  131. }
  132. .info{
  133. padding: 16rpx 0;
  134. .icon{
  135. width: 36rpx;
  136. height: 38rpx;
  137. }
  138. .text{
  139. font-size: 26rpx;
  140. color: #333333;
  141. margin-left: 10rpx;
  142. }
  143. .more{
  144. .tag{
  145. font-size: 24rpx;
  146. color: #999999;
  147. }
  148. .pev{width: 15px;height: 15px;}
  149. }
  150. }
  151. }
  152. }
  153. .sreach{
  154. background: #fff;
  155. margin:20rpx 0;
  156. border-radius: 32rpx;
  157. padding: 16rpx 32rpx;
  158. .icon{
  159. width: 46rpx;
  160. height: 46rpx;
  161. }
  162. input{
  163. width: calc(100% - 46rpx - 16rpx - 50px);
  164. font-size: 16px;
  165. }
  166. .search-btn{
  167. font-size: 14px;
  168. color: #FF4C4C;
  169. }
  170. }
  171. .sc-body{
  172. .item{
  173. background: #FFFFFF;
  174. border-radius: 16rpx;
  175. margin-bottom: 20rpx;
  176. padding: 16rpx 40rpx;
  177. .info{
  178. .avatar{width: 85rpx;height: 85rpx;border-radius: 50%;}
  179. padding-bottom: 26rpx;
  180. border-bottom: 1px solid #f1f1f1;
  181. .ir{
  182. width: calc(100% - 105rpx);
  183. margin-left: 20rpx;
  184. .title{
  185. font-weight: bold;
  186. font-size: 32rpx;
  187. color: #303133;
  188. }
  189. .ifoot{
  190. .iid{
  191. font-size: 26rpx;
  192. color: #666666;
  193. }
  194. .time{
  195. font-size: 26rpx;
  196. color: #666666;
  197. }
  198. }
  199. }
  200. .ir-r{
  201. font-weight: 500;
  202. font-size: 24rpx;
  203. color: #666666;
  204. text{color: #FF4C4C;}
  205. }
  206. }
  207. .info-foot{
  208. height: 80rpx;
  209. .label{font-size: 28rpx;color: #303133;}
  210. .money{font-size: 28rpx;color: #FF4C4C;font-weight: bold;}
  211. .sbtn{
  212. border-radius: 28rpx;
  213. border: 1px solid #EE2F72;
  214. font-size: 24rpx;
  215. color: #FF4C4C;
  216. padding: 10rpx 16rpx;
  217. }
  218. .show-sbtn{
  219. color: #666666;
  220. font-size: 24rpx;
  221. }
  222. }
  223. }
  224. }
  225. }
  226. .level{
  227. background: linear-gradient(to right, #f9ecc5 0%, #d6ba63 100%);
  228. border-radius: 20rpx;
  229. height: 30rpx;
  230. margin-left: 10rpx;
  231. padding: 0 10rpx;
  232. image{width: 20rpx;height: 20rpx;margin-right: 4rpx;}
  233. .name{
  234. font-size: 20rpx;
  235. color: #93794B;
  236. margin-right: 2px;
  237. &:last-child{
  238. margin-right:0;
  239. }
  240. }
  241. }
  242. </style>
  243. <script>
  244. import {mapState,mapMutations } from 'vuex';
  245. export default {
  246. computed: mapState(['user']),
  247. data() {
  248. return {
  249. topViewHeight : 20,
  250. keyword : "",
  251. data : {},
  252. listAr : [],
  253. page:{
  254. page:1,
  255. isLoad:false,
  256. isFoot:false
  257. },
  258. isFrite:false
  259. }
  260. },
  261. onLoad(options) {
  262. this.initView();
  263. },
  264. methods: {
  265. ...mapMutations(['checkUserLogin']),
  266. /**
  267. * 加载基础配置
  268. */
  269. initView:function(){
  270. //提示
  271. this.$nextTick(()=>{
  272. uni.createSelectorQuery().in(this)
  273. .select("#app-top").boundingClientRect(res=>{
  274. this.topViewHeight = res.height;
  275. console.log(this.topViewHeight);
  276. }).exec();
  277. });
  278. this
  279. .request
  280. .post("userTeamTotal")
  281. .then(res=>{
  282. if(res.code == 200) {
  283. this.data = res.data;
  284. this.getData();
  285. }
  286. });
  287. },
  288. /**
  289. * 分页
  290. */
  291. onBottom() {
  292. if(this.page.isFoot || this.page.isLoad) {
  293. return;
  294. }
  295. this.page.page ++;
  296. this.getData();
  297. },
  298. tapSerach:function(){
  299. this.getData(true);
  300. },
  301. /**
  302. * 申请新人奖
  303. */
  304. tapSq:function(item){
  305. uni.navigateTo({
  306. url:"awardSq?uid=" + item.uid
  307. })
  308. },
  309. /**
  310. * 查看申请新人奖记录
  311. */
  312. tapAwardLog:function(){
  313. uni.navigateTo({ url:"awarLog" });
  314. },
  315. /**
  316. * 获取数据
  317. */
  318. getData:function(isPull = false){
  319. if(this.page.isLoad) return;
  320. if(isPull) {
  321. this.page.isFoot = false;
  322. this.page.page = 1;
  323. }
  324. this.page.isLoad = true;
  325. uni.showLoading({ title: '获取数据中..' });
  326. var post = {};
  327. post.page = this.page.page;
  328. post.keyword = this.keyword;
  329. this
  330. .request
  331. .post("userTeam",post)
  332. .then(res => {
  333. this.isFrite = true;
  334. uni.hideLoading();
  335. if(isPull) {
  336. this.listAr = res.data.list;
  337. this.page.isLoad = false;
  338. this.page.isFoot = false;
  339. } else {
  340. this.listAr = this.listAr.concat(res.data.list);
  341. this.page.isLoad = false;
  342. }
  343. //是否到底
  344. if(res.data.list.length != res.data.pageSize) {
  345. this.page.isFoot = true;
  346. }
  347. })
  348. .catch(res=>{
  349. console.log(res);
  350. uni.hideLoading();
  351. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  352. });
  353. }
  354. },
  355. }
  356. </script>