vermicelli.vue 8.9 KB

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