vermicelli.vue 9.1 KB

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