user.vue 9.3 KB

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