user.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <template>
  2. <view>
  3. <view class="app-bg">
  4. <image src="/static/img/detail_bg.png?timestamp=1742528623"></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="flex" style="padding-bottom: 15rpx;">
  40. <view class="ck-select fx-r fx-bc" @tap="tapCkSelect">
  41. <image class="select" v-if="!ckSelect" src="/static/img/rcheck.png" mode="widthFix"></image>
  42. <image class="select" v-else src="/static/img/rcheck-btn.png" mode="widthFix"></image>
  43. 1个月持单
  44. </view>
  45. <view class="selectBox">
  46. <view class="" @click="openPicker">{{gsValue?gsValue:'请选择是否挂售'}}</view>
  47. <uv-picker ref="picker" :columns="columns" @confirm="confirm" keyName="label"></uv-picker>
  48. </view>
  49. </view>
  50. <scroll-view scroll-y class="scroll" style="position: absolute;width: calc(100% - 48rpx);"
  51. :style="'height: calc(100vh - 45vw + 180rpx - 60px - ' + topViewHeight + 'px);'"
  52. @scrolltolower="onBottom">
  53. <view class="sc-body">
  54. <view class="item" v-for="item in listAr">
  55. <view class="info fx-r fx-bc">
  56. <image class="avatar" mode="aspectFill"
  57. :src="item.avatar || '/static/img/user-avatar1.png' "></image>
  58. <view class="ir">
  59. <view class="fx-r fx-bc">
  60. <view class="title">{{ item.nickname }}</view>
  61. <view class="level fx-r fx-bc" v-if="item.levelid == 1">
  62. <image src="/static/img/level-1.png"></image>
  63. <view class="name">会员</view>
  64. </view>
  65. <view class="level fx-r fx-bc" v-if="item.levelid > 1">
  66. <image src="/static/img/level-1.png"></image>
  67. <view class="name">vip会员</view>
  68. </view>
  69. </view>
  70. <view class="ifoot fx-r" style="padding-top: 15rpx;">
  71. <view class="iid">ID:{{ item.uid }} <image @click="tapSend(item.mobile)" v-if="is_gs == 0" src="/static/image/img24.png" style="width: 35rpx;height: 35rpx;padding-left: 25rpx;top:10rpx;position: relative;"></image></view>
  72. </view>
  73. </view>
  74. <view class="fx-g2"></view>
  75. <view class="ir-r fx-h">
  76. <view class="l1" style="margin-bottom: 16rpx;">今日预约:<text
  77. v-if="item.booking_count > 0">已预约</text> <text v-else
  78. style="color: #000;">无</text></view>
  79. <view class="l1">持 单 量:<text>{{ item.pro_count }}</text>单</view>
  80. </view>
  81. </view>
  82. <view class="info-foot fx-r fx-bc">
  83. <view class="label">直推人数:</view>
  84. <view class="money">{{ item.user_count || '0' }}</view>
  85. <view class="label">人</view>
  86. <view class="fx-g1"></view>
  87. <view class="label">累计收益:</view>
  88. <view class="money">¥{{ item.totalEarnings || '0.00' }}</view>
  89. </view>
  90. <view class="setorder" @click="orderClick(item.uid,item.is_fresh)">
  91. <view class="btns">{{item.is_fresh==0?'设置小单':'设置大单'}}</view>
  92. </view>
  93. </view>
  94. <view v-if="listAr.length > 0">
  95. <view class="loading fx-r fx-ac fx-bc" v-if="page.isFrite && !page.isFoot">
  96. <image src="/static/img/xloading.png"></image>
  97. <text>正在载入更多...</text>
  98. </view>
  99. <view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
  100. </view>
  101. <view v-if="listAr.length == 0 && isFrite">
  102. <uv-empty mode="data" icon="/static/img/no-empty.png"></uv-empty>
  103. </view>
  104. </view>
  105. </scroll-view>
  106. </view>
  107. </view>
  108. </template>
  109. <style lang="scss">
  110. .selectBox{
  111. border: 1rpx solid #999999;
  112. border-radius: 10rpx;
  113. padding: 15rpx 0rpx;
  114. width: 200rpx;
  115. padding-left: 25rpx;
  116. font-size: 24rpx;
  117. }
  118. .flex {
  119. display: flex;
  120. align-items: center;
  121. justify-content: space-between;
  122. }
  123. .flex_item {
  124. display: flex;
  125. align-items: center;
  126. }
  127. .app-bg {
  128. position: absolute;
  129. image {
  130. width: 100vw;
  131. height: 45vw;
  132. }
  133. }
  134. .app-h {
  135. height: 45vw;
  136. }
  137. .app-body {
  138. padding: 0px 24rpx;
  139. position: relative;
  140. top: -180rpx;
  141. .app-pannel {
  142. background: #fff;
  143. border-radius: 20rpx;
  144. .frinfo {
  145. padding-top: 60rpx;
  146. padding-bottom: 46rpx;
  147. width: 100%;
  148. .item {
  149. width: calc(33% - 1px);
  150. .count {
  151. font-weight: bold;
  152. font-size: 40rpx;
  153. color: #0C1732;
  154. }
  155. .label {
  156. font-size: 28rpx;
  157. color: #666666;
  158. margin-top: 10rpx;
  159. }
  160. }
  161. .line {
  162. width: 2rpx;
  163. height: 86rpx;
  164. background: #DCDCDC;
  165. }
  166. }
  167. .panel-inner {
  168. padding: 0px 36rpx;
  169. .li {
  170. border: 1px dashed #f1f1f1;
  171. }
  172. .info {
  173. padding: 16rpx 0;
  174. .icon {
  175. width: 36rpx;
  176. height: 38rpx;
  177. }
  178. .text {
  179. font-size: 26rpx;
  180. color: #333333;
  181. margin-left: 10rpx;
  182. }
  183. .more {
  184. .tag {
  185. font-size: 24rpx;
  186. color: #999999;
  187. }
  188. .pev {
  189. width: 15px;
  190. height: 15px;
  191. }
  192. }
  193. }
  194. }
  195. }
  196. .sreach {
  197. background: #fff;
  198. margin: 20rpx 0;
  199. border-radius: 32rpx;
  200. padding: 16rpx 32rpx;
  201. .icon {
  202. width: 46rpx;
  203. height: 46rpx;
  204. }
  205. input {
  206. width: calc(100% - 46rpx - 16rpx - 50px);
  207. font-size: 16px;
  208. }
  209. .search-btn {
  210. font-size: 14px;
  211. color: #FF4C4C;
  212. }
  213. }
  214. .setorder{
  215. text-align: right;
  216. .btns{
  217. display: inline-block;
  218. background: #FF4C4C;
  219. color: #fff;
  220. border-radius: 25rpx;
  221. padding: 10rpx 25rpx;
  222. font-size: 24rpx;
  223. margin: 15rpx 0;
  224. }
  225. }
  226. .sc-body {
  227. .item {
  228. background: #FFFFFF;
  229. border-radius: 16rpx;
  230. margin-bottom: 20rpx;
  231. padding: 16rpx 40rpx;
  232. .info {
  233. .avatar {
  234. width: 85rpx;
  235. height: 85rpx;
  236. border-radius: 50%;
  237. }
  238. padding-bottom: 26rpx;
  239. border-bottom: 1px solid #f1f1f1;
  240. .ir {
  241. margin-left: 20rpx;
  242. .title {
  243. font-weight: bold;
  244. font-size: 32rpx;
  245. color: #303133;
  246. }
  247. .ifoot {
  248. .iid {
  249. font-size: 26rpx;
  250. color: #666666;
  251. }
  252. .time {
  253. font-size: 26rpx;
  254. color: #666666;
  255. }
  256. }
  257. }
  258. .ir-r {
  259. font-weight: 500;
  260. font-size: 24rpx;
  261. color: #666666;
  262. text {
  263. color: #FF4C4C;
  264. }
  265. }
  266. }
  267. .info-foot {
  268. height: 80rpx;
  269. .label {
  270. font-size: 28rpx;
  271. color: #303133;
  272. }
  273. .money {
  274. font-size: 28rpx;
  275. color: #FF4C4C;
  276. font-weight: bold;
  277. }
  278. .sbtn {
  279. border-radius: 28rpx;
  280. border: 1px solid #EE2F72;
  281. font-size: 24rpx;
  282. color: #FF4C4C;
  283. padding: 10rpx 16rpx;
  284. }
  285. .show-sbtn {
  286. color: #666666;
  287. font-size: 24rpx;
  288. }
  289. }
  290. }
  291. }
  292. }
  293. .level {
  294. background: linear-gradient(to right, #f9ecc5 0%, #d6ba63 100%);
  295. border-radius: 20rpx;
  296. height: 30rpx;
  297. margin-left: 10rpx;
  298. padding: 0 10rpx;
  299. image {
  300. width: 20rpx;
  301. height: 20rpx;
  302. margin-right: 4rpx;
  303. }
  304. .name {
  305. font-size: 20rpx;
  306. color: #93794B;
  307. margin-right: 2px;
  308. &:last-child {
  309. margin-right: 0;
  310. }
  311. }
  312. }
  313. .ck-select {
  314. font-size: 14px;
  315. height: 30px;
  316. image {
  317. width: 18px;
  318. height: 18px;
  319. margin-right: 10rpx;
  320. }
  321. }
  322. </style>
  323. <script>
  324. import {
  325. mapState,
  326. mapMutations
  327. } from 'vuex';
  328. export default {
  329. computed: mapState(['user']),
  330. data() {
  331. return {
  332. topViewHeight: 20,
  333. keyword: "",
  334. data: {},
  335. listAr: [],
  336. page: {
  337. page: 1,
  338. isLoad: false,
  339. isFoot: false
  340. },
  341. isFrite: false,
  342. ckSelect: true,
  343. columns: [
  344. [{
  345. label: '已挂售',
  346. id: 1
  347. }, {
  348. label: '未挂售',
  349. id: 0
  350. }]
  351. ],
  352. is_gs:'',
  353. gsValue:'',
  354. }
  355. },
  356. onLoad(options) {
  357. this.initView();
  358. },
  359. methods: {
  360. ...mapMutations(['checkUserLogin']),
  361. /**
  362. * 加载基础配置
  363. */
  364. orderClick(uid,is_fresh){
  365. let that = this
  366. let content = ''
  367. if(is_fresh == 0){
  368. content="你确定要将该成员设置成小单吗?"
  369. }else{
  370. content="你确定要将该成员设置成大单吗?"
  371. }
  372. uni.showModal({
  373. title: '提示',
  374. content: content,
  375. success: function (res) {
  376. if (res.confirm) {
  377. that.request.post("setMentor",{
  378. uid:uid
  379. }).then(res => {
  380. if (res.code == 200) {
  381. uni.showModal({
  382. title: '系统提示',
  383. content:res.msg,
  384. showCancel: false
  385. });
  386. that.getData(true);
  387. }else{
  388. uni.showModal({
  389. title: '系统提示',
  390. content:res.msg,
  391. showCancel: false
  392. });
  393. }
  394. });
  395. } else if (res.cancel) {
  396. console.log('用户点击取消');
  397. }
  398. }
  399. });
  400. },
  401. tapSend:function(phoneNumber){
  402. if(phoneNumber){
  403. uni.makePhoneCall({
  404. phoneNumber: phoneNumber, // 电话号码
  405. success: () => {
  406. console.log("拨打电话成功");
  407. },
  408. fail: (err) => {
  409. console.log("拨打电话失败", err);
  410. }
  411. });
  412. }else{
  413. uni.showModal({
  414. title: '系统提示',
  415. content: '用户没有绑定手机号',
  416. showCancel: false
  417. });
  418. }
  419. },
  420. confirm(e){
  421. this.is_gs = e.value[0].id
  422. this.gsValue = e.value[0].label
  423. this.getData(true);
  424. },
  425. openPicker() {
  426. this.$refs.picker.open();
  427. },
  428. initView: function() {
  429. //提示
  430. this.$nextTick(() => {
  431. uni.createSelectorQuery().in(this)
  432. .select("#app-top").boundingClientRect(res => {
  433. this.topViewHeight = res.height;
  434. console.log(this.topViewHeight);
  435. }).exec();
  436. });
  437. this.request.post("gzUserInit").then(res => {
  438. if (res.code == 200) {
  439. this.data = res.data;
  440. this.getData();
  441. }
  442. });
  443. },
  444. /**
  445. * 分页
  446. */
  447. onBottom() {
  448. if (this.page.isFoot || this.page.isLoad) {
  449. return;
  450. }
  451. this.page.page++;
  452. this.getData();
  453. },
  454. tapSerach: function() {
  455. this.getData(true);
  456. },
  457. tapCkSelect: function() {
  458. this.ckSelect = !this.ckSelect;
  459. this.getData(true);
  460. },
  461. /**
  462. * 获取数据
  463. */
  464. getData: function(isPull = false) {
  465. if (this.page.isLoad) return;
  466. if (isPull) {
  467. this.page.isFoot = false;
  468. this.page.page = 1;
  469. }
  470. this.page.isLoad = true;
  471. uni.showLoading({
  472. title: '获取数据中..'
  473. });
  474. var post = {};
  475. post.page = this.page.page;
  476. post.keyword = this.keyword;
  477. post.isCkOrder = this.ckSelect ? 1 : 0;
  478. post.is_gs = this.is_gs
  479. this.request.post("gzUserList", post).then(res => {
  480. this.isFrite = true;
  481. uni.hideLoading();
  482. if (isPull) {
  483. this.listAr = res.data.list;
  484. this.page.isLoad = false;
  485. this.page.isFoot = false;
  486. } else {
  487. this.listAr = this.listAr.concat(res.data.list);
  488. this.page.isLoad = false;
  489. }
  490. //是否到底
  491. if (res.data.list.length != res.data.pageSize) {
  492. this.page.isFoot = true;
  493. }
  494. })
  495. .catch(res => {
  496. console.log(res);
  497. uni.hideLoading();
  498. uni.showModal({
  499. title: '系统提示',
  500. content: '加载失败,返回在尝试',
  501. showCancel: false
  502. });
  503. });
  504. }
  505. },
  506. }
  507. </script>