myEarnings.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <template>
  2. <view class="">
  3. <!-- 全局 loding -->
  4. <public-module></public-module>
  5. <!-- 头部 -->
  6. <view class="headers dis a-c j-start">
  7. <view class="roleIdentity dis a-c j-s">
  8. <u-icon name="arrow-left" color="#333" size="38" @click="back"></u-icon>
  9. <view class="headers-activeTab">
  10. <u-tabs :list="tablist" :is-scroll="true" active-color="#333" inactive-color="#999"
  11. :current="current" :show-bar="false" @change="change" name="gradeName" height="50"
  12. :active-item-style="{fontSize:'36rpx'}" style="background: transparent;"></u-tabs>
  13. </view>
  14. <view class="right dis a-c"></view>
  15. </view>
  16. </view>
  17. <!-- 业绩 -->
  18. <view class="filterTime dis j-s a-c ">
  19. <view class=" dis a-c " @click="timeDropdownFilter">
  20. <text>{{pageQuery.startTime && pageQuery.endTime ? pageQuery.startTime + '-' + pageQuery.endTime : '时间筛选' }}</text>
  21. <text>▼</text>
  22. </view>
  23. <view class=" dis a-c " @click="statusFilterShow=true">
  24. <text>{{appStatus}}</text>
  25. <text>▼</text>
  26. </view>
  27. </view>
  28. <view class="performance dis a-c j-c ">
  29. 共有 {{totalCount.numberOrders}}笔订单,保费{{totalCount.totalPremium}}元,佣金{{totalCount.commission}}元
  30. </view>
  31. <view class="body p-2" style="padding-top: 340rpx;">
  32. <view class="card mb-2" v-for="(item,index) in incomeList" :key="index">
  33. <!-- 权限锁定组件 -->
  34. <uni-permission-view position="fixed" :backimage="true"
  35. v-if="index==incomeList.length-1 && pageQuery.grade!='1' && parentStatus=='2'" direction="row"
  36. :sum="teamOverviewInfo.lockCommission" :days="teamOverviewInfo.zeroDays"
  37. :genericText="`完成任务,解锁“${gradeText}”,查看我的全部业绩`" cornerRadius="8rpx"
  38. :genericTextStyle="{fontSize:'26rpx'}" @requestUnlock="requestUnlock">
  39. </uni-permission-view>
  40. <!-- 权限锁定组件 -->
  41. <view class="card-title dis a-c j-s mb-2">
  42. <view class="dis a-c ">
  43. <view class="status " :class="item.appStatus==1?'blue':'red'" v-if="item.appStatus!=0">
  44. {{item.appStatus==1?'已冻结':'已失效'}}
  45. </view>
  46. <text class="name ml-1">{{item.carId}}</text>
  47. </view>
  48. <text>{{item.issuanceTime}}出单</text>
  49. </view>
  50. <view class="card-data dis a-c j-s " @click="earningsDetail(item.ordersNo)">
  51. <view class="view dis f-c a-c ">
  52. <text>{{item.agent}}</text>
  53. <text>代理人</text>
  54. </view>
  55. <view class="view dis f-c a-c ">
  56. <text>{{item.premium}}</text>
  57. <text>保费</text>
  58. </view>
  59. <view class="view dis f-c a-c ">
  60. <text>{{item.commission}}</text>
  61. <text>我的佣金</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 筛选组件 -->
  67. <uni-Popup :show="statusFilterShow" @close='statusFilterShow=false' headerTitle="筛选状态"
  68. :statusList="quickOptions" contentType="status" @statusConfirm="statusFilterConfirm">
  69. </uni-Popup>
  70. <u-loadmore v-if="incomeList.length!=0" :status="status" />
  71. <my-date-picker ref="datePicker" @confirmPickDate="confirmPickDate" />
  72. </view>
  73. </template>
  74. <script>
  75. import myDatePicker from '../components/date-picker.vue';
  76. import seach from '../components/seach.vue';
  77. import QR from "@/common/wxqrcode.js"
  78. import {
  79. mapState,
  80. mapMutations
  81. } from "vuex"
  82. export default {
  83. components: {
  84. myDatePicker,
  85. seach
  86. },
  87. computed: {
  88. ...mapState(['userInfo', "userCheckInfo", ]),
  89. gradeText() {
  90. const gradeMap = {
  91. 1: '创始人',
  92. 2: '管理人',
  93. 3: '合伙人',
  94. 4: '工作室'
  95. }
  96. return gradeMap[this.pageQuery.grade] || ''
  97. },
  98. appStatus() {
  99. const gradeMap = {
  100. 0: '正常',
  101. 1: '已冻结',
  102. 2: '已失效',
  103. }
  104. return gradeMap[this.pageQuery.appStatus] || '全部'
  105. }
  106. },
  107. data() {
  108. return {
  109. statusFilterShow: false, //筛选组件
  110. quickOptions: [{
  111. label: "全部",
  112. value: null,
  113. },
  114. {
  115. label: "正常",
  116. value: "0",
  117. },
  118. {
  119. label: "已冻结",
  120. value: "1",
  121. },
  122. {
  123. label: "已失效",
  124. value: "2",
  125. }
  126. ], //快捷选项
  127. tablist: [],
  128. status: 'loadmore', //下拉状态
  129. parentStatus: "", //是否锁定
  130. totalCount: {}, //统计
  131. incomeList: [], //列表
  132. //tab选项
  133. list: [{
  134. name: '我是创始人'
  135. }, {
  136. name: '我是管理人'
  137. },
  138. {
  139. name: '我是合伙人'
  140. },
  141. {
  142. name: '我是工作室'
  143. }
  144. ],
  145. current: 0,
  146. dialogContent: '',
  147. ShowalertDialog: false,
  148. relativeLeavl: null,
  149. ShowModal: false,
  150. ShowModalCode: false,
  151. ShowModalCode1: false,
  152. ShowModalCodebusiness: false,
  153. chineseNumbers: ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'],
  154. teamTabIndex: 0,
  155. source: 0,
  156. totalPages: 0,
  157. totalSize: 0,
  158. pageRequest: { //查询的默认条件
  159. pageNum: 1,
  160. pageSize: 20,
  161. userName: ''
  162. },
  163. partnerImg: '',
  164. workImg: '',
  165. directLsitOne: {},
  166. directLsitTwo: {},
  167. directLsitThree: {},
  168. directLsitFour: {},
  169. userLevel: "",
  170. deptSource: 1,
  171. pageQuery: {
  172. grade: "",
  173. startTime: "",
  174. endTime: "",
  175. appStatus: "",
  176. pageNum: 1,
  177. pageSize: 10,
  178. },
  179. teamOverviewInfo: {},
  180. }
  181. },
  182. onReachBottom() {
  183. if (this.pageQuery.pageNum >= this.totalPages) return;
  184. this.status = 'loading';
  185. this.pageQuery.pageNum = ++this.pageQuery.pageNum;
  186. setTimeout(async () => {
  187. let res = await this.$http.post('/newAppPartner/myPerformance', this.pageQuery);
  188. if (res.code == '200') {
  189. this.incomeList = [...this.incomeList, ...res.data.data.records];
  190. }
  191. if (this.pageQuery.pageNum >= this.totalPages) this.status = 'nomore';
  192. else this.status = 'loading';
  193. }, 1000)
  194. },
  195. async onLoad(params) {
  196. if (params) {
  197. let info = JSON.parse(params.info)
  198. console.log(info);
  199. this.pageQuery.grade = info.grade
  200. this.teamOverviewInfo = info;
  201. await this.queryData()
  202. await this.GradeListMap();
  203. const index = this.tablist.findIndex(item => item.grade == info.grade);
  204. this.current = index; //获取对应身份的数据下标
  205. }
  206. },
  207. methods: {
  208. statusFilterConfirm(item) {
  209. this.pageQuery.appStatus = item.value;
  210. this.queryData();
  211. this.statusFilterShow = false;
  212. },
  213. async requestUnlock() {
  214. console.log(1);
  215. if (this.teamOverviewInfo.parentStatus == '2') {
  216. switch (this.teamOverviewInfo.upgradeStatus) {
  217. case 0:
  218. let params = {
  219. grade: Number(this.teamOverviewInfo.grade),
  220. lockingState: this.teamOverviewInfo.parentStatus,
  221. lockCommission: this.teamOverviewInfo.lockCommission,
  222. zeroDays: this.teamOverviewInfo.zeroDays,
  223. fallAmount: this.teamOverviewInfo.fallAmount,
  224. }
  225. uni.navigateTo({
  226. url: "/pages/my/upgradeTask?info=" + JSON.stringify(params),
  227. })
  228. break;
  229. case 1:
  230. let res = await this.$http.post('/partner/submitLiftingRecord', {
  231. grade: this.teamOverviewInfo.grade,
  232. upgradeType: '1'
  233. });
  234. if (res.code == '200') {
  235. uni.showToast({
  236. title: res.msg,
  237. icon: 'none',
  238. });
  239. this.queryData()
  240. } else {
  241. uni.showToast({
  242. title: res.msg,
  243. icon: 'none',
  244. });
  245. }
  246. break;
  247. case 2:
  248. uni.showToast({
  249. title: '申请中',
  250. icon: 'none',
  251. });
  252. break;
  253. default:
  254. }
  255. }
  256. },
  257. //下拉筛选
  258. timeDropdownFilter() {
  259. this.$refs.datePicker.open()
  260. },
  261. //日期选择事件
  262. confirmPickDate(startdate, enddate) {
  263. this.pageQuery.startTime = startdate;
  264. this.pageQuery.endTime = enddate;
  265. this.queryData();
  266. },
  267. change(index) {
  268. this.current = index;
  269. },
  270. dialogClose() {
  271. this.$refs.alertDialog.close()
  272. },
  273. styleChange(e) {
  274. this.deptSource = e.detail.value
  275. },
  276. dialogConfirm() {
  277. this.ShowModalCode = true
  278. this.$refs.alertDialog.close()
  279. this.partnerImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applypartner?level=" + this
  280. .level + '&userId=' + this.userInfo.sysUser.userId, {
  281. size: parseInt(200) //二维码大小
  282. })
  283. },
  284. ShowModalCodeFun(level, relativeLeavl) {
  285. // 绝对等级:level 相对等级:relativeLeavl
  286. this.level = level
  287. this.relativeLeavl = relativeLeavl
  288. // this.ShowalertDialog=true
  289. this.dialogContent = `是否招募${this.chineseNumbers[relativeLeavl]}级合伙人?`
  290. this.$refs.alertDialog.open()
  291. },
  292. ShowModalCodeSumbit() {
  293. this.ShowModalCode1 = true
  294. this.workImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applystudio?deptSource=" + this
  295. .deptSource + '&userId=' + this.userInfo.sysUser.userId, {
  296. size: parseInt(200) //二维码大小
  297. })
  298. },
  299. ShowModalCodeworkFun() {
  300. this.ShowModalCodebusiness = true
  301. this.deptSource = 1
  302. },
  303. // partnersAndStudios(level){
  304. // this.level=level
  305. // this.ShowModal = true
  306. // },
  307. // recruitment(level) {
  308. // this.level = level
  309. // this.ShowModalCodeFun(level)
  310. // },
  311. back() {
  312. uni.navigateBack({
  313. delta: 1, // 返回的页面数,如果是1表示返回上一页
  314. success: function() {}
  315. });
  316. },
  317. backHome() {
  318. uni.switchTab({
  319. url: "/pages/index/index"
  320. })
  321. },
  322. earningsDetail(ordersNo) {
  323. uni.navigateTo({
  324. url: "/pages/my/commissionDetail?ordersNo=" + ordersNo,
  325. })
  326. },
  327. closeInstitution(item, level) {
  328. if (item.leaderIds.length > 0) {
  329. item.level = level
  330. uni.navigateTo({
  331. url: "/pages/institutional/institutionalTeam?key=" + encodeURIComponent(JSON.stringify(
  332. item))
  333. })
  334. }
  335. },
  336. // onReachBottom() {
  337. // if (this.pageRequest.pageNum >= this.totalPages) return;
  338. // this.status = 'loading';
  339. // this.pageRequest.pageNum = ++this.pageRequest.pageNum;
  340. // setTimeout(async () => {
  341. // let res = await this.$http.post('/sysPartner/querySysPartnerAPPPage', {
  342. // ...this.pageRequest,
  343. // source:this.source
  344. // });
  345. // if (res.code == '200') {
  346. // this.totalSize = res.data.totalSize;
  347. // this.directLsit = [...this.directLsit, ...res.data.content];
  348. // }
  349. // if (this.pageRequest.pageNum >= this.totalPages) this.status = 'nomore';
  350. // else this.status = 'loading';
  351. // }, 1000)
  352. // },
  353. async queryData(data) {
  354. let res = await this.$http.post('/newAppPartner/myPerformance', this.pageQuery);
  355. if (res.code == '200') {
  356. this.totalCount = res.data.total; //个人收益统计
  357. this.incomeList = res.data.data.records; //收益列表
  358. this.parentStatus = res.data.parentStatus;
  359. this.totalPages = res.data.data.totalPages;
  360. }
  361. },
  362. //等级列表
  363. async GradeListMap() {
  364. let res = await this.$http.get('/partner/getUserGradeListMap');
  365. if (res.code == 200) {
  366. this.tablist = res.data;
  367. this.tablist.map(val => {
  368. val.gradeName = "我是" + val.gradeName;
  369. return val;
  370. })
  371. }
  372. }
  373. }
  374. }
  375. </script>
  376. <style lang="scss" scoped>
  377. .headers {
  378. position: fixed;
  379. top: 0;
  380. left: 0;
  381. height: auto;
  382. width: 100%;
  383. z-index: 999;
  384. .roleIdentity {
  385. width: 100%;
  386. height: 176rpx;
  387. padding: 108rpx 30rpx 20rpx;
  388. box-sizing: border-box;
  389. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  390. border-bottom: 1rpx solid #f2f2f2;
  391. .headers-activeTab {
  392. width: 80%;
  393. height: 50rpx;
  394. }
  395. .right {
  396. image {
  397. width: 28rpx;
  398. height: 28rpx;
  399. margin-right: 4rpx;
  400. }
  401. text {
  402. font-size: 24rpx;
  403. color: #333;
  404. }
  405. }
  406. }
  407. }
  408. //头部背景
  409. .homeBackground {
  410. position: fixed;
  411. top: 0;
  412. left: 0;
  413. z-index: 999;
  414. width: 100%;
  415. height: 176rpx;
  416. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  417. border-bottom: 1rpx solid #f2f2f2;
  418. }
  419. //时间筛选
  420. .filterTime {
  421. position: fixed;
  422. top: 176rpx;
  423. left: 0;
  424. width: 100%;
  425. z-index: 999;
  426. background: #fff;
  427. border-radius: 0rpx 0rpx 0rpx 0rpx;
  428. padding: 20rpx 30rpx;
  429. box-sizing: border-box;
  430. text:first-child {
  431. font-size: 26 rpx;
  432. color: #333;
  433. }
  434. text:last-child {
  435. font-size: 19rpx;
  436. color: #666;
  437. margin-left: 4rpx;
  438. }
  439. }
  440. //业绩
  441. .performance {
  442. position: fixed;
  443. top: 266rpx;
  444. left: 0;
  445. z-index: 999;
  446. width: 100%;
  447. height: 60rpx;
  448. background: #EBF4FF;
  449. border-radius: 0rpx 0rpx 0rpx 0rpx;
  450. font-size: 30rpx;
  451. color: #2B67EF;
  452. }
  453. .partner-head {
  454. background: #FFFFFF;
  455. color: #333333;
  456. font-size: 14px;
  457. i {
  458. margin-left: 2px;
  459. display: inline-block;
  460. width: 0;
  461. height: 0;
  462. border: 4px solid;
  463. border-color: #666666;
  464. border-bottom: 4px solid transparent;
  465. border-right: 4px solid transparent;
  466. border-left: 4px solid transparent;
  467. }
  468. }
  469. .sum-insurance {
  470. padding: 10px 0;
  471. view {
  472. text-align: center;
  473. width: 33.33%;
  474. border-right: 1px solid #EEEEEE;
  475. text {
  476. display: block;
  477. }
  478. text:first-child {
  479. font-weight: 600;
  480. font-size: 18px;
  481. color: #333333;
  482. }
  483. text:last-child {
  484. font-size: 10px;
  485. color: #999999;
  486. }
  487. }
  488. }
  489. //列表数据
  490. .card {
  491. position: relative;
  492. background: #FFFFFF;
  493. border-radius: 10rpx;
  494. background-image: url("/static/card.png");
  495. background-size: 100% 100%;
  496. border-top: 1px solid;
  497. border-image: linear-gradient(270deg, rgba(45, 109, 255, 0), rgba(45, 109, 255, 1), rgba(45, 109, 255, 0)) 1 1;
  498. padding: 20rpx 30rpx 30rpx;
  499. .card-title {
  500. .status {
  501. padding: 2rpx 12rpx;
  502. box-sizing: border-box;
  503. border-radius: 2rpx 2rpx 2rpx 2rpx;
  504. font-size: 20rpx;
  505. font-weight: bold;
  506. }
  507. .blue {
  508. background: #EAF0FF;
  509. color: #2D6DFF;
  510. }
  511. .red {
  512. background: #FFECEC;
  513. color: #F74141;
  514. }
  515. >text {
  516. font-size: 24rpx;
  517. color: #666;
  518. }
  519. .name {
  520. font-size: 30rpx;
  521. color: #333;
  522. font-weight: bold;
  523. }
  524. }
  525. .card-data {
  526. .view {
  527. width: 33.33%;
  528. text:first-child {
  529. font-size: 30rpx;
  530. color: #333;
  531. font-weight: bold;
  532. }
  533. text:last-child {
  534. font-size: 24rpx;
  535. color: #999;
  536. }
  537. }
  538. .view:nth-child(2) {
  539. border-left: 1rpx solid #eee;
  540. border-right: 1rpx solid #eee;
  541. }
  542. }
  543. }
  544. .popup-code {
  545. text {
  546. display: block;
  547. border-bottom: 1px solid #EEEEEE;
  548. height: 50px;
  549. line-height: 50px;
  550. text-align: center;
  551. font-size: 16px;
  552. color: #666666;
  553. }
  554. }
  555. .ShowModalCode-style {
  556. text:first-of-type {
  557. display: block;
  558. font-weight: 600;
  559. font-size: 16px;
  560. color: #333333;
  561. border: 1px solid #EEEEEE;
  562. padding: 15px;
  563. text-align: center;
  564. }
  565. }
  566. .popup-code {
  567. text {
  568. display: block;
  569. border-bottom: 1px solid #EEEEEE;
  570. height: 50px;
  571. line-height: 50px;
  572. text-align: center;
  573. font-size: 16px;
  574. color: #666666;
  575. }
  576. }
  577. .ShowModalCode-con {
  578. padding: 30px;
  579. text-align: center;
  580. image {
  581. margin: 0 auto;
  582. margin-top: 15px;
  583. }
  584. }
  585. </style>