user.vue 9.1 KB

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