index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <template>
  2. <view>
  3. <public-module></public-module>
  4. <view class="headers dis a-c j-c" :style="headerStyle">
  5. <text>掌柜合伙人</text>
  6. <view class="right dis a-c">
  7. <image src="/static/home/customerService.png" mode=""></image>
  8. <text>客服</text>
  9. </view>
  10. </view>
  11. <view class="homeBackground"></view>
  12. <view class="" style="padding: 0 30rpx;">
  13. <view class="dailyData-block">
  14. <view class="title ">
  15. <text>今日状况</text>
  16. <image src="/static/home/icon1.png" class="image1" mode=""></image>
  17. <image src="/static/home/icon3.png" class="image3" mode=""></image>
  18. </view>
  19. <image src="/static/home/icon2.png" class="image2" mode=""></image>
  20. <view class="data dis f-wrap j-s">
  21. <view class="dis f-c a-start view">
  22. <text>{{numberFormat(todayOverview.addPerNumber || 0) }}</text>
  23. <text>订单(笔)</text>
  24. </view>
  25. <view class="dis f-c a-start view">
  26. <text>{{numberFormat(todayOverview.commission || 0) }}</text>
  27. <text>新增人员</text>
  28. </view>
  29. <view class="dis f-c a-start view">
  30. <text>{{numberFormat(todayOverview.numberOrders || 0)}}</text>
  31. <text>保费(元)</text>
  32. </view>
  33. <view class="dis f-c a-start view">
  34. <text>{{numberFormat(todayOverview.premium || 0 ) }}</text>
  35. <text>佣金(元)</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="statistics">
  40. <u-tabs :list="teamOverview" :is-scroll="true" name="gradeName" active-color="#333"
  41. inactive-color="#999" :current="current" @change="change"
  42. style="background: transparent;border-bottom: 1rpx solid #EEEEEE;"></u-tabs>
  43. <view class="count">
  44. <template v-if="teamOverviewInfo.grade==1">
  45. <image src="/static/home/icon4.png" class="mb-2" mode=""
  46. @click="invitationCode(teamOverviewInfo.grade)">
  47. </image>
  48. <view class="data dis f-wrap j-s mb-3">
  49. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  50. @click="closePartner">
  51. <text>{{teamOverviewInfo.vo1.v1}}</text>
  52. <text>我的管理人</text>
  53. </view>
  54. <view class="dis f-c a-c view">
  55. <text>{{teamOverviewInfo.vo1.v2}}</text>
  56. <text>管理人的合伙人</text>
  57. </view>
  58. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  59. @click="todayclosePartner">
  60. <text>{{teamOverviewInfo.vo1.v3}}</text>
  61. <text>我今日新增管理人</text>
  62. </view>
  63. <view class="dis f-c a-c view">
  64. <text>{{teamOverviewInfo.vo1.v4}}</text>
  65. <text>今日管理人邀请的合伙人</text>
  66. </view>
  67. </view>
  68. </template>
  69. <template v-if="teamOverviewInfo.grade==2 ">
  70. <image src="/static/home/icon5.png" class="mb-2" mode=""
  71. @click="invitationCode(teamOverviewInfo.grade)">
  72. </image>
  73. <view class="data dis f-wrap j-s mb-3">
  74. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  75. @click="closePartner">
  76. <text>{{teamOverviewInfo.vo2.v1}}</text>
  77. <text>我的合伙人</text>
  78. </view>
  79. <view class="dis f-c a-c view">
  80. <text>{{teamOverviewInfo.vo2.v2}}</text>
  81. <text>合伙人的工作室</text>
  82. </view>
  83. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  84. @click="todayclosePartner">
  85. <text>{{teamOverviewInfo.vo2.v3}}</text>
  86. <text>我今日新增合伙人</text>
  87. </view>
  88. <view class="dis f-c a-c view">
  89. <text>{{teamOverviewInfo.vo2.v4}}</text>
  90. <text>今日合伙人邀请的工作室</text>
  91. </view>
  92. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;">
  93. <text>{{teamOverviewInfo.vo2.v5}}</text>
  94. <text>今日保费</text>
  95. </view>
  96. <view class="dis f-c a-c view">
  97. <text>{{teamOverviewInfo.vo2.v6}}</text>
  98. <text>今日佣金</text>
  99. </view>
  100. </view>
  101. </template>
  102. <template v-if="teamOverviewInfo.grade==3 ">
  103. <image src="/static/home/icon6.png" class="mb-2" mode=""
  104. @click="invitationCode(teamOverviewInfo.grade)">
  105. </image>
  106. <view class="data dis f-wrap j-s mb-3">
  107. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  108. @click="closePartner">
  109. <text>{{teamOverviewInfo.vo3.v1}}</text>
  110. <text>我的工作室</text>
  111. </view>
  112. <view class="dis f-c a-c view">
  113. <text>{{teamOverviewInfo.vo3.v2}}</text>
  114. <text>工作室下的业务团队</text>
  115. </view>
  116. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  117. @click="todayclosePartner">
  118. <text>{{teamOverviewInfo.vo3.v3}}</text>
  119. <text>我今日新增工作室</text>
  120. </view>
  121. <view class="dis f-c a-c view">
  122. <text>{{teamOverviewInfo.vo3.v4}}</text>
  123. <text>今日工作室邀请的团队</text>
  124. </view>
  125. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;">
  126. <text>{{teamOverviewInfo.vo3.v5}}</text>
  127. <text>今日保费</text>
  128. </view>
  129. <view class="dis f-c a-c view">
  130. <text>{{teamOverviewInfo.vo3.v6}}</text>
  131. <text>今日佣金</text>
  132. </view>
  133. </view>
  134. </template>
  135. <template v-if="teamOverviewInfo.grade==4 ">
  136. <image src="/static/home/icon7.png" class="mb-2" mode=""
  137. @click="invitationCode(teamOverviewInfo.grade)">
  138. </image>
  139. <view class="data dis f-wrap j-s mb-3">
  140. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  141. @click="closePartner">
  142. <text>{{teamOverviewInfo.vo4.v1}}</text>
  143. <text>我的团队</text>
  144. </view>
  145. <view class="dis f-c a-c view">
  146. <text>{{teamOverviewInfo.vo4.v2}}</text>
  147. <text>代理人人数</text>
  148. </view>
  149. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;"
  150. @click="todayclosePartner">
  151. <text>{{teamOverviewInfo.vo4.v3}}</text>
  152. <text>我今日新增团队</text>
  153. </view>
  154. <view class="dis f-c a-c view">
  155. <text>{{teamOverviewInfo.vo4.v4}}</text>
  156. <text>今日新增代理人</text>
  157. </view>
  158. <view class="dis f-c a-c view" style="border-right: 1rpx solid #EEEEEE;">
  159. <text>{{teamOverviewInfo.vo4.v5}}</text>
  160. <text>今日保费</text>
  161. </view>
  162. <view class="dis f-c a-c view">
  163. <text>{{teamOverviewInfo.vo4.v6}}</text>
  164. <text>今日佣金</text>
  165. </view>
  166. </view>
  167. </template>
  168. <view class="earnings dis a-c j-s " @click="myEarnings">
  169. <view class="dis a-c ">
  170. <image src="/static/home/wallet.png" mode=""></image>
  171. <text>我的收益</text>
  172. </view>
  173. <u-icon name="arrow-right" size="30" color="rgba(35,40,50,0.5)"></u-icon>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. </template>
  180. <script>
  181. import myDatePicker from '../components/todaydate-picker.vue';
  182. import QR from "@/common/wxqrcode.js"
  183. import {
  184. mapState,
  185. mapMutations
  186. } from "vuex"
  187. import {
  188. vShow
  189. } from "vue"
  190. export default {
  191. computed: {
  192. ...mapState(['userInfo', "userCheckInfo"]),
  193. },
  194. components: {
  195. myDatePicker
  196. },
  197. data() {
  198. return {
  199. teamOverviewInfo: {}, //页面展示数据
  200. todayOverview: {}, //今日数据
  201. teamOverview: [{
  202. name: '我是创始人'
  203. }, {
  204. name: '我是管理人'
  205. },
  206. {
  207. name: '我是合伙人'
  208. },
  209. {
  210. name: '我是工作室'
  211. }
  212. ],
  213. current: 0,
  214. showData: '全部数据',
  215. ShowModalCode: false,
  216. ShowModalCode1: false,
  217. ShowModalCodebusiness: false,
  218. teamImg: '',
  219. workImg: '',
  220. totalList: {},
  221. type: uni.getStorageSync('type'),
  222. headerStyle: {
  223. backgroundColor: 'transparent',
  224. backgroundImage: '',
  225. backgroundSize: '',
  226. backgroundPosition: '',
  227. boxShadow: ''
  228. // 其他样式属性...
  229. },
  230. styles: [{
  231. value: '1',
  232. text: '渠道',
  233. notestext: '团队长加出单员模式,无分销模式,结费都在团队长处。',
  234. checked: true
  235. },
  236. {
  237. value: '2',
  238. notestext: '团队长加代理人模式,三级分销模式,结费方式为个人,有佣金。',
  239. text: '个代'
  240. }
  241. ],
  242. deptSource: 1
  243. // type:JSON.parse(localStorage.getItem('type')).data
  244. }
  245. },
  246. async onShow(e) {
  247. this.type = uni.getStorageSync('type')
  248. this.showData = '全部数据',
  249. this.getList()
  250. // let res = await this.$http.post('/APPPartner/getHomePage', {
  251. // type: uni.getStorageSync('type'),
  252. // });
  253. // if (res.code == '200') {
  254. // this.totalList = res.data
  255. // }
  256. },
  257. methods: {
  258. //数据格式化
  259. numberFormat(value) {
  260. return (value).toLocaleString('en-US');
  261. },
  262. change(index) {
  263. const info = this.teamOverview[index];
  264. console.log(info);
  265. this.teamOverviewInfo = info;
  266. this.current = index;
  267. },
  268. async getList(beginTime, endTime) {
  269. let params = {
  270. type: this.type,
  271. "endTime": endTime || '',
  272. "beginTime": beginTime || '',
  273. }
  274. let res = await this.$http.post('/newAppPartner/getHomePage', params); //统计数据
  275. if (res.code == '200') {
  276. this.todayOverview = res.data.todayOverview; //今日数据
  277. this.teamOverview = res.data.teamOverview; //选项卡
  278. this.teamOverview.map(val => {
  279. val.gradeName = "我是" + val.gradeName;
  280. return val;
  281. })
  282. this.teamOverviewInfo = res.data.teamOverview[0]; //页面赋值第一条数据
  283. }
  284. },
  285. searchPopup() {
  286. this.$refs.datePicker.open()
  287. },
  288. confirmPickDate(dateStr, dateStr1, val) {
  289. if (dateStr) {
  290. dateStr += ' 00:00:01'
  291. }
  292. if (dateStr1) {
  293. dateStr1 += ' 23:59:59'
  294. }
  295. this.showData = val
  296. this.getList(dateStr, dateStr1)
  297. },
  298. recruitmentCode() {
  299. this.ShowModalCode = true
  300. this.teamImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applyteam?userId=" +
  301. this.userInfo
  302. .sysUser.userId, {
  303. size: parseInt(200) //二维码大小
  304. })
  305. },
  306. ShowModalCodeSumbit() {
  307. this.workImg = QR.createQrCodeImg(this.$base.h5BaseUrl +
  308. "/#/pages/index/applystudio?deptSource=" + this
  309. .deptSource + '&userId=' + this.userInfo.sysUser.userId, {
  310. size: parseInt(200) //二维码大小
  311. })
  312. },
  313. //人员列表
  314. closePartner() {
  315. uni.navigateTo({
  316. url: "/pages/institutional/partner?grade=" + this.teamOverviewInfo.grade,
  317. })
  318. },
  319. //今日人员
  320. todayclosePartner() {
  321. let dotayDate = new Date().toISOString().split('T')[0] //今日日期
  322. uni.navigateTo({
  323. url: "/pages/institutional/partner?grade=" + this.teamOverviewInfo.grade + '&startTime=' +
  324. dotayDate + '&endTime=' + dotayDate,
  325. })
  326. },
  327. //我的收益
  328. myEarnings() {
  329. uni.navigateTo({
  330. url: "/pages/institutional/myEarnings"
  331. })
  332. },
  333. //邀请码
  334. invitationCode(value) {
  335. // uni.navigateTo({
  336. // url: "/pages/institutional/invitationCode?grade=" + value,
  337. // })
  338. uni.navigateTo({
  339. url: "/pages/index/applypartner?grade=" + value,
  340. })
  341. },
  342. }
  343. }
  344. </script>
  345. <style lang="scss" scoped>
  346. page {
  347. background-color: #F7F7F7;
  348. }
  349. .headers {
  350. position: fixed;
  351. top: 0;
  352. left: 0;
  353. height: auto;
  354. width: 100%;
  355. z-index: 999999;
  356. padding: 30rpx;
  357. padding-top: 50px;
  358. text {
  359. font-size: 36rpx;
  360. font-weight: bold;
  361. color: #fff;
  362. }
  363. .right {
  364. position: absolute;
  365. right: 30rpx;
  366. image {
  367. width: 28rpx;
  368. height: 28rpx;
  369. margin-right: 4rpx;
  370. }
  371. text {
  372. font-weight: 400;
  373. color: #fff;
  374. font-size: 24rpx;
  375. }
  376. }
  377. }
  378. .homeBackground {
  379. height: 177px;
  380. width: 100%;
  381. background-image: url("/static/home/back.png");
  382. background-size: 100% 100%;
  383. }
  384. .dailyData-block {
  385. width: 100%;
  386. margin-top: -136rpx;
  387. background-image: url("/static/home/aaa.png");
  388. background-size: 100% 100%;
  389. backdrop-filter: blur(2rpx);
  390. padding: 20rpx 40rpx;
  391. // background: rgba(255, 255, 255, 0.2);
  392. // border-radius: 16px;
  393. // box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  394. // backdrop-filter: blur(30px);
  395. // border: 1px solid rgba(255, 255, 255, 1);
  396. .title {
  397. position: relative;
  398. display: inline-block;
  399. text {
  400. color: #fff;
  401. font-weight: bold;
  402. font-size: 36rpx;
  403. margin-left: 10rpx;
  404. }
  405. .image1 {
  406. width: 16rpx;
  407. height: 16rpx;
  408. position: absolute;
  409. top: 0;
  410. right: -20rpx;
  411. }
  412. .image3 {
  413. width: 166rpx;
  414. height: 20rpx;
  415. position: absolute;
  416. bottom: 0;
  417. left: 0;
  418. }
  419. }
  420. .image2 {
  421. width: 138rpx;
  422. height: 138rpx;
  423. position: absolute;
  424. top: -50rpx;
  425. right: 22rpx;
  426. }
  427. .data {
  428. .view {
  429. width: 50%;
  430. text:first-child {
  431. font-size: 46rpx;
  432. color: #333;
  433. font-weight: bold;
  434. }
  435. text:last-child {
  436. font-size: 24rpx;
  437. color: #666;
  438. }
  439. }
  440. }
  441. }
  442. .statistics {
  443. background: #FFFFFF;
  444. border-radius: 20rpx 20rpx 20rpx 20rpx;
  445. margin-top: 15rpx;
  446. .count {
  447. padding: 34rpx 30rpx;
  448. box-sizing: border-box;
  449. image {
  450. width: 100%;
  451. height: 120rpx;
  452. }
  453. }
  454. .data {
  455. padding: 30rpx;
  456. box-sizing: border-box;
  457. background-color: #FBFBFB;
  458. border-radius: 8rpx;
  459. .view {
  460. width: 49%;
  461. text:first-child {
  462. font-size: 36rpx;
  463. color: #333;
  464. font-weight: bold;
  465. margin-bottom: 4rpx;
  466. }
  467. text:last-child {
  468. font-size: 22rpx;
  469. color: #999;
  470. }
  471. }
  472. }
  473. .earnings {
  474. image {
  475. width: 40rpx;
  476. height: 40rpx;
  477. }
  478. text {
  479. font-size: 30rpx;
  480. color: #333;
  481. margin-left: 14rpx;
  482. }
  483. }
  484. }
  485. ::v-deep {
  486. .u-tab-bar {
  487. background: linear-gradient(90deg, #2DD9FF 0%, #2D6DFF 100%) !important;
  488. border-radius: 6rpx;
  489. }
  490. }
  491. </style>