team.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <view class="content">
  3. <view class="status_bar"><!-- 这里是状态栏 --></view>
  4. <view class="" style="height: 20rpx;">
  5. </view>
  6. <view class="user-top flex">
  7. id: {{userInfo.uid}}<text style="margin-left: 20rpx;" class="clamp">昵称:{{userInfo.nickname}}</text>
  8. </view>
  9. <view class="yeji-wraper flex">
  10. <view class="yeji-item">
  11. <view class="yeji-val">
  12. {{wlgsbList.price || '0'}}
  13. </view>
  14. <view class="yeji-name">
  15. 销售业绩
  16. </view>
  17. </view>
  18. <view class="yeji-item">
  19. <view class="yeji-val">
  20. {{wlgsbList.today_price || '0'}}
  21. </view>
  22. <view class="yeji-name">
  23. 今日业绩
  24. </view>
  25. </view>
  26. <view class="yeji-item">
  27. <view class="yeji-val">
  28. {{wlgsbList.yesterday_price || '0'}}
  29. </view>
  30. <view class="yeji-name">
  31. 昨日业绩
  32. </view>
  33. </view>
  34. </view>
  35. <view class="nav-wraper flex">
  36. <view class="nav-item" v-for="(nitem,nindex) in navList" :class="{'action':nindex == tabCurrentIndex}" @click="navClick(nindex)">
  37. {{nitem.text}}
  38. </view>
  39. </view>
  40. <template v-if="tabCurrentIndex == 0">
  41. <view class="wlg-sb flex" style="margin-top: 40rpx;" @click="navto('/pages/user/teamList?key=direct_push')">
  42. <view class="">
  43. 服务直属消费者
  44. </view>
  45. <view class="">
  46. {{wlgsbList.direct_push_count || '0'}}
  47. </view>
  48. </view>
  49. <view class="wlg-sb flex" @click="navto('/pages/user/teamList?key=between')">
  50. <view class="">
  51. 服务体系消费者
  52. </view>
  53. <view class="">
  54. {{wlgsbList.between_count || '0'}}
  55. </view>
  56. </view>
  57. </template>
  58. <template v-if="tabCurrentIndex == 1">
  59. <view class="wlg-sb flex" style="margin-top: 40rpx;" @click="navto('/pages/user/teamList?key=user_list')">
  60. <view class="">
  61. 服务茶农
  62. </view>
  63. <view class="">
  64. {{wlgsbList.user_count || '0'}}
  65. </view>
  66. </view>
  67. <!-- <view class="wlg-sb flex">
  68. <view class="">
  69. 服务体系茶农
  70. </view>
  71. <view class="">
  72. 0
  73. </view>
  74. </view> -->
  75. </template>
  76. </view>
  77. </template>
  78. <script>
  79. import { myspread, tuiguang } from '@/api/user.js';
  80. import { mapState, mapMutations } from 'vuex';
  81. export default {
  82. data() {
  83. return {
  84. // 头部图高度
  85. maxheight: '',
  86. tabCurrentIndex: 0,
  87. navList: [
  88. {
  89. state: 0,
  90. text: '消费者',
  91. loadingType: 'more',
  92. orderList: [],
  93. page: 1, //当前页数
  94. limit: 10 //每次信息条数
  95. },
  96. {
  97. state: 1,
  98. text: '茶农',
  99. loadingType: 'more',
  100. orderList: [],
  101. page: 1, //当前页数
  102. limit: 10 //每次信息条数
  103. }
  104. ],
  105. all: '',
  106. list: '',
  107. xsyj: '',
  108. jrye: '',
  109. zrye: ''
  110. };
  111. },
  112. computed: {
  113. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  114. ...mapState(['wlgsbList']),
  115. getPhone() {
  116. let reg = /(\d{3})\d{4}(\d{4})/;
  117. this.navList.user_list.forEach(e => {
  118. return e.phone.replace(reg, '$1****$2');
  119. console.log(e.phone.replace(reg, '$1****$2'));
  120. });
  121. }
  122. },
  123. onLoad(options) {},
  124. onShow() {
  125. this.loadData();
  126. },
  127. methods: {
  128. ...mapMutations(['setSbList']),
  129. navClick(index) {
  130. this.tabCurrentIndex = index
  131. },
  132. // 页面跳转
  133. navto(e) {
  134. uni.navigateTo({
  135. url: e
  136. });
  137. },
  138. //获取收入支出信息
  139. async loadData(source) {
  140. let obj = this
  141. tuiguang().then(res => {
  142. console.log(res, 'data');
  143. obj.setSbList(res.data)
  144. });
  145. },
  146. // 点击返回 我的页面
  147. toBack() {
  148. uni.switchTab({
  149. url: '/pages/user/user'
  150. });
  151. }
  152. }
  153. };
  154. </script>
  155. <style lang="scss">
  156. page {
  157. background: #f8f8f8;
  158. height: 100%;
  159. }
  160. // .info-box {
  161. // width: 670rpx;
  162. // height: 186rpx;
  163. // background: #ffffff;
  164. // box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  165. // border-radius: 20rpx;
  166. // margin: -100rpx auto 0;
  167. // position: relative;
  168. // z-index: 2;
  169. // .info-item {
  170. // width: 50%;
  171. // display: flex;
  172. // flex-direction: column;
  173. // align-items: center;
  174. // line-height: 1;
  175. // .info-font {
  176. // font-size: 30rpx;
  177. // font-family: PingFang SC;
  178. // font-weight: bold;
  179. // color: #999999;
  180. // }
  181. // .info-num {
  182. // margin-top: 30rpx;
  183. // font-size: 30rpx;
  184. // font-family: PingFang SC;
  185. // font-weight: bold;
  186. // color: #181818;
  187. // }
  188. // }
  189. // .shu {
  190. // width: 2rpx;
  191. // height: 74rpx;
  192. // background: #dcdfe6;
  193. // }
  194. // }
  195. // .status_bar {
  196. // height: var(--status-bar-height);
  197. // width: 100%;
  198. // background: #5dbc7c;
  199. // }
  200. // .content-money {
  201. // position: relative;
  202. // height: 480rpx;
  203. // .content-bg {
  204. // position: absolute;
  205. // top: 0;
  206. // left: 0;
  207. // right: 0;
  208. // width: 750rpx;
  209. // height: 480rpx;
  210. // image {
  211. // width: 100%;
  212. // height: 100%;
  213. // }
  214. // }
  215. // .body-title {
  216. // height: 80rpx;
  217. // text-align: center;
  218. // font-size: 35rpx;
  219. // position: relative;
  220. // .header {
  221. // position: absolute;
  222. // left: 0;
  223. // top: 0;
  224. // width: 100%;
  225. // font-size: 36rpx;
  226. // font-family: PingFang SC;
  227. // font-weight: bold;
  228. // color: #fffeff;
  229. // height: 80rpx;
  230. // font-size: 36rpx;
  231. // font-weight: 700;
  232. // z-index: 9;
  233. // display: flex;
  234. // justify-content: center;
  235. // align-items: center;
  236. // }
  237. // .goback-box {
  238. // position: absolute;
  239. // left: 18rpx;
  240. // top: 0;
  241. // height: 80rpx;
  242. // display: flex;
  243. // align-items: center;
  244. // }
  245. // .goback {
  246. // z-index: 100;
  247. // width: 34rpx;
  248. // height: 34rpx;
  249. // }
  250. // }
  251. // }
  252. // .money-box {
  253. // position: relative;
  254. // z-index: 2;
  255. // padding-top: 90rpx;
  256. // color: #ffffff;
  257. // text-align: center;
  258. // .money {
  259. // font-size: 72rpx;
  260. // font-family: PingFang SC;
  261. // font-weight: bold;
  262. // color: #ffffff;
  263. // }
  264. // .text {
  265. // font-size: 30rpx;
  266. // }
  267. // }
  268. // .order-item {
  269. // padding: 20rpx 30rpx;
  270. // line-height: 1.5;
  271. // .title-box {
  272. // width: 100%;
  273. // .title-avatar {
  274. // flex-shrink: 0;
  275. // width: 100rpx;
  276. // height: 100rpx;
  277. // margin-right: 25rpx;
  278. // border-radius: 100%;
  279. // image {
  280. // width: 100%;
  281. // height: 100%;
  282. // border-radius: 100%;
  283. // }
  284. // }
  285. // .list_tpl {
  286. // width: 85%;
  287. // .title {
  288. // display: flex;
  289. // justify-content: flex-start;
  290. // font-size: $font-lg;
  291. // color: $font-color-base;
  292. // overflow: hidden; //超出的文本隐藏
  293. // text-overflow: ellipsis; //溢出用省略号显示
  294. // white-space: nowrap;
  295. // line-height: 1;
  296. // text-align: center;
  297. // .title-name {
  298. // max-width: 40%;
  299. // }
  300. // .dl {
  301. // margin-left: 10rpx;
  302. // width: 93rpx;
  303. // height: 32rpx;
  304. // border-radius: 16rpx;
  305. // image {
  306. // width: 93rpx;
  307. // height: 32rpx;
  308. // border-radius: 16rpx;
  309. // }
  310. // }
  311. // .class {
  312. // display: inline-block;
  313. // margin-left: 10rpx;
  314. // padding: 6rpx;
  315. // text-align: center;
  316. // border: 1px solid #2e58ff;
  317. // border-radius: 16rpx;
  318. // font-size: 20rpx;
  319. // font-family: PingFang SC;
  320. // font-weight: 500;
  321. // color: #2e58ff;
  322. // }
  323. // }
  324. // .time {
  325. // font-size: $font-base;
  326. // color: $font-color-light;
  327. // }
  328. // }
  329. // }
  330. // .money {
  331. // width: 50%;
  332. // text-align: right;
  333. // color: #db1935;
  334. // font-size: $font-lg;
  335. // }
  336. // }
  337. // .yeji {
  338. // position: relative;
  339. // margin: -72rpx auto 0;
  340. // width: 690rpx;
  341. // height: 143rpx;
  342. // background: #ffffff;
  343. // box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  344. // border-radius: 10rpx;
  345. // display: flex;
  346. // align-items: center;
  347. // .yeji-a {
  348. // width: 50%;
  349. // display: flex;
  350. // flex-direction: column;
  351. // justify-content: center;
  352. // align-items: center;
  353. // .yeji-top {
  354. // font-size: 28rpx;
  355. // font-family: PingFang SC;
  356. // font-weight: bold;
  357. // color: #333333;
  358. // }
  359. // .yeji-buttom {
  360. // font-size: 42rpx;
  361. // font-family: PingFang SC;
  362. // font-weight: bold;
  363. // color: #333333;
  364. // }
  365. // }
  366. // .border {
  367. // width: 1rpx;
  368. // height: 51rpx;
  369. // background: #dddddd;
  370. // }
  371. // }
  372. // .content-box {
  373. // display: flex;
  374. // justify-content: space-between;
  375. // align-items: center;
  376. // margin: 30rpx;
  377. // .content-box-left {
  378. // display: flex;
  379. // .left-img {
  380. // width: 100rpx;
  381. // height: 100rpx;
  382. // border-radius: 50%;
  383. // overflow: hidden;
  384. // image {
  385. // width: 100%;
  386. // height: 100%;
  387. // }
  388. // }
  389. // .right-title {
  390. // margin-left: 15rpx;
  391. // display: flex;
  392. // flex-direction: column;
  393. // justify-content: space-around;
  394. // .top {
  395. // font-weight: 500;
  396. // font-size: 30rpx;
  397. // }
  398. // .bottom {
  399. // color: #999999;
  400. // }
  401. // }
  402. // }
  403. // .content-box-right {
  404. // display: flex;
  405. // flex-direction: column;
  406. // width: 230rpx;
  407. // color: #999999;
  408. // .state {
  409. // color: red;
  410. // }
  411. // span {
  412. // color: red;
  413. // font-size: 28rpx;
  414. // }
  415. // }
  416. // }
  417. .user-top {
  418. width: 680rpx;
  419. height: 80rpx;
  420. line-height: 80rpx;
  421. box-shadow: 0 0 10rpx rgba(0,0,0,0.2);
  422. margin: 20rpx auto;
  423. border-radius: 8rpx;
  424. padding: 0 30rpx;
  425. font-size: 32rpx;
  426. justify-content: flex-start;
  427. }
  428. .yeji-wraper {
  429. width: 590rpx;
  430. height: 134rpx;
  431. box-shadow: 0 0 10rpx rgba(0,0,0,0.2);
  432. margin:20rpx auto;
  433. border-radius: 10rpx;
  434. text-align: center;
  435. font-size: 28rpx;
  436. .yeji-item {
  437. width: 33%;
  438. .yeji-val {
  439. padding-bottom: 20rpx;
  440. font-weight: bold;
  441. }
  442. }
  443. }
  444. .nav-wraper {
  445. width: 630rpx;
  446. height: 80rpx;
  447. box-shadow: 0 0 10rpx rgba(0,0,0,0.2);
  448. margin: auto;
  449. border-radius: 15rpx;
  450. .nav-item {
  451. width: 50%;
  452. text-align: center;
  453. height: 80rpx;
  454. line-height: 80rpx;
  455. }
  456. .action {
  457. background-color: #2b2d54;
  458. border-radius: 20rpx;
  459. color: #fff;
  460. font-weight: bold;
  461. }
  462. }
  463. .wlg-sb {
  464. width: 590rpx;
  465. height: 140rpx;
  466. box-shadow: 0 0 10rpx rgba(0,0,0,0.2);
  467. margin: 20rpx auto;
  468. border-radius: 10rpx;
  469. padding: 20rpx;
  470. }
  471. </style>