myEarnings.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  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. current: 0,
  133. dialogContent: '',
  134. ShowalertDialog: false,
  135. relativeLeavl: null,
  136. ShowModal: false,
  137. ShowModalCode: false,
  138. ShowModalCode1: false,
  139. ShowModalCodebusiness: false,
  140. chineseNumbers: ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'],
  141. teamTabIndex: 0,
  142. source: 0,
  143. totalPages: 0,
  144. totalSize: 0,
  145. pageRequest: { //查询的默认条件
  146. pageNum: 1,
  147. pageSize: 20,
  148. userName: ''
  149. },
  150. partnerImg: '',
  151. workImg: '',
  152. directLsitOne: {},
  153. directLsitTwo: {},
  154. directLsitThree: {},
  155. directLsitFour: {},
  156. userLevel: "",
  157. deptSource: 1,
  158. pageQuery: {
  159. grade: "",
  160. startTime: "",
  161. endTime: "",
  162. appStatus: "",
  163. pageNum: 1,
  164. pageSize: 10,
  165. },
  166. teamOverviewInfo: {},
  167. }
  168. },
  169. onReachBottom() {
  170. if (this.pageQuery.pageNum >= this.totalPages) return;
  171. this.status = 'loading';
  172. this.pageQuery.pageNum = ++this.pageQuery.pageNum;
  173. setTimeout(async () => {
  174. let res = await this.$http.post('/newAppPartner/myPerformance', this.pageQuery);
  175. if (res.code == '200') {
  176. this.incomeList = [...this.incomeList, ...res.data.data.records];
  177. }
  178. if (this.pageQuery.pageNum >= this.totalPages) this.status = 'nomore';
  179. else this.status = 'loading';
  180. }, 1000)
  181. },
  182. async onLoad(params) {
  183. if (params) {
  184. let info = JSON.parse(params.info)
  185. console.log(info);
  186. if (info.appStatus) {
  187. this.pageQuery.appStatus = info.appStatus;
  188. }
  189. this.pageQuery.grade = info.grade
  190. this.teamOverviewInfo = info;
  191. await this.queryData()
  192. await this.GradeListMap();
  193. const index = this.tablist.findIndex(item => item.grade == info.grade);
  194. this.current = index; //获取对应身份的数据下标
  195. }
  196. },
  197. methods: {
  198. statusFilterConfirm(item) {
  199. this.pageQuery.appStatus = item.value;
  200. this.queryData();
  201. this.statusFilterShow = false;
  202. },
  203. async requestUnlock() {
  204. console.log(1);
  205. if (this.teamOverviewInfo.parentStatus == '2') {
  206. switch (this.teamOverviewInfo.upgradeStatus) {
  207. case 0:
  208. let params = {
  209. grade: Number(this.teamOverviewInfo.grade),
  210. lockingState: this.teamOverviewInfo.parentStatus,
  211. lockCommission: this.teamOverviewInfo.lockCommission,
  212. zeroDays: this.teamOverviewInfo.zeroDays,
  213. fallAmount: this.teamOverviewInfo.fallAmount,
  214. }
  215. uni.navigateTo({
  216. url: "/pages/my/upgradeTask?info=" + JSON.stringify(params),
  217. })
  218. break;
  219. case 1:
  220. let res = await this.$http.post('/partner/submitLiftingRecord', {
  221. grade: this.teamOverviewInfo.grade,
  222. upgradeType: '1'
  223. });
  224. if (res.code == '200') {
  225. uni.showToast({
  226. title: res.msg,
  227. icon: 'none',
  228. });
  229. this.queryData()
  230. } else {
  231. uni.showToast({
  232. title: res.msg,
  233. icon: 'none',
  234. });
  235. }
  236. break;
  237. case 2:
  238. uni.showToast({
  239. title: '申请中',
  240. icon: 'none',
  241. });
  242. break;
  243. default:
  244. }
  245. }
  246. },
  247. //下拉筛选
  248. timeDropdownFilter() {
  249. this.$refs.datePicker.open()
  250. },
  251. //日期选择事件
  252. confirmPickDate(startdate, enddate) {
  253. this.pageQuery.startTime = startdate;
  254. this.pageQuery.endTime = enddate;
  255. this.queryData();
  256. },
  257. change(index) {
  258. this.current = index;
  259. this.pageQuery.grade = this.tablist[index].grade;
  260. this.queryData();
  261. this.pageQuery.pageNum = 1;
  262. this.pageQuery.pageSize = 10;
  263. },
  264. dialogClose() {
  265. this.$refs.alertDialog.close()
  266. },
  267. styleChange(e) {
  268. this.deptSource = e.detail.value
  269. },
  270. dialogConfirm() {
  271. this.ShowModalCode = true
  272. this.$refs.alertDialog.close()
  273. this.partnerImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applypartner?level=" + this
  274. .level + '&userId=' + this.userInfo.sysUser.userId, {
  275. size: parseInt(200) //二维码大小
  276. })
  277. },
  278. ShowModalCodeFun(level, relativeLeavl) {
  279. // 绝对等级:level 相对等级:relativeLeavl
  280. this.level = level
  281. this.relativeLeavl = relativeLeavl
  282. // this.ShowalertDialog=true
  283. this.dialogContent = `是否招募${this.chineseNumbers[relativeLeavl]}级合伙人?`
  284. this.$refs.alertDialog.open()
  285. },
  286. ShowModalCodeSumbit() {
  287. this.ShowModalCode1 = true
  288. this.workImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applystudio?deptSource=" + this
  289. .deptSource + '&userId=' + this.userInfo.sysUser.userId, {
  290. size: parseInt(200) //二维码大小
  291. })
  292. },
  293. ShowModalCodeworkFun() {
  294. this.ShowModalCodebusiness = true
  295. this.deptSource = 1
  296. },
  297. // partnersAndStudios(level){
  298. // this.level=level
  299. // this.ShowModal = true
  300. // },
  301. // recruitment(level) {
  302. // this.level = level
  303. // this.ShowModalCodeFun(level)
  304. // },
  305. back() {
  306. uni.navigateBack({
  307. delta: 1, // 返回的页面数,如果是1表示返回上一页
  308. success: function() {}
  309. });
  310. },
  311. backHome() {
  312. uni.switchTab({
  313. url: "/pages/index/index"
  314. })
  315. },
  316. earningsDetail(ordersNo) {
  317. uni.navigateTo({
  318. url: "/pages/my/commissionDetail?ordersNo=" + ordersNo,
  319. })
  320. },
  321. closeInstitution(item, level) {
  322. if (item.leaderIds.length > 0) {
  323. item.level = level
  324. uni.navigateTo({
  325. url: "/pages/institutional/institutionalTeam?key=" + encodeURIComponent(JSON.stringify(
  326. item))
  327. })
  328. }
  329. },
  330. // onReachBottom() {
  331. // if (this.pageRequest.pageNum >= this.totalPages) return;
  332. // this.status = 'loading';
  333. // this.pageRequest.pageNum = ++this.pageRequest.pageNum;
  334. // setTimeout(async () => {
  335. // let res = await this.$http.post('/sysPartner/querySysPartnerAPPPage', {
  336. // ...this.pageRequest,
  337. // source:this.source
  338. // });
  339. // if (res.code == '200') {
  340. // this.totalSize = res.data.totalSize;
  341. // this.directLsit = [...this.directLsit, ...res.data.content];
  342. // }
  343. // if (this.pageRequest.pageNum >= this.totalPages) this.status = 'nomore';
  344. // else this.status = 'loading';
  345. // }, 1000)
  346. // },
  347. async queryData(data) {
  348. let res = await this.$http.post('/newAppPartner/myPerformance', this.pageQuery);
  349. if (res.code == '200') {
  350. this.totalCount = res.data.total; //个人收益统计
  351. this.incomeList = res.data.data.records; //收益列表
  352. this.parentStatus = res.data.parentStatus;
  353. this.totalPages = res.data.data.totalPages;
  354. }
  355. },
  356. //等级列表
  357. async GradeListMap() {
  358. let res = await this.$http.get('/partner/getUserGradeListMap');
  359. if (res.code == 200) {
  360. this.tablist = res.data;
  361. this.tablist.map(val => {
  362. val.gradeName = "我是" + val.gradeName;
  363. return val;
  364. })
  365. }
  366. }
  367. }
  368. }
  369. </script>
  370. <style lang="scss" scoped>
  371. .headers {
  372. position: fixed;
  373. top: 0;
  374. left: 0;
  375. height: auto;
  376. width: 100%;
  377. z-index: 999;
  378. .roleIdentity {
  379. width: 100%;
  380. height: 176rpx;
  381. padding: 108rpx 30rpx 20rpx;
  382. box-sizing: border-box;
  383. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  384. border-bottom: 1rpx solid #f2f2f2;
  385. .headers-activeTab {
  386. width: 80%;
  387. height: 50rpx;
  388. }
  389. .right {
  390. image {
  391. width: 28rpx;
  392. height: 28rpx;
  393. margin-right: 4rpx;
  394. }
  395. text {
  396. font-size: 24rpx;
  397. color: #333;
  398. }
  399. }
  400. }
  401. }
  402. //头部背景
  403. .homeBackground {
  404. position: fixed;
  405. top: 0;
  406. left: 0;
  407. z-index: 999;
  408. width: 100%;
  409. height: 176rpx;
  410. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  411. border-bottom: 1rpx solid #f2f2f2;
  412. }
  413. //时间筛选
  414. .filterTime {
  415. position: fixed;
  416. top: 176rpx;
  417. left: 0;
  418. width: 100%;
  419. z-index: 999;
  420. background: #fff;
  421. border-radius: 0rpx 0rpx 0rpx 0rpx;
  422. padding: 20rpx 30rpx;
  423. box-sizing: border-box;
  424. text:first-child {
  425. font-size: 26 rpx;
  426. color: #333;
  427. }
  428. text:last-child {
  429. font-size: 19rpx;
  430. color: #666;
  431. margin-left: 4rpx;
  432. }
  433. }
  434. //业绩
  435. .performance {
  436. position: fixed;
  437. top: 266rpx;
  438. left: 0;
  439. z-index: 999;
  440. width: 100%;
  441. height: 60rpx;
  442. background: #EBF4FF;
  443. border-radius: 0rpx 0rpx 0rpx 0rpx;
  444. font-size: 30rpx;
  445. color: #2B67EF;
  446. }
  447. .partner-head {
  448. background: #FFFFFF;
  449. color: #333333;
  450. font-size: 14px;
  451. i {
  452. margin-left: 2px;
  453. display: inline-block;
  454. width: 0;
  455. height: 0;
  456. border: 4px solid;
  457. border-color: #666666;
  458. border-bottom: 4px solid transparent;
  459. border-right: 4px solid transparent;
  460. border-left: 4px solid transparent;
  461. }
  462. }
  463. .sum-insurance {
  464. padding: 10px 0;
  465. view {
  466. text-align: center;
  467. width: 33.33%;
  468. border-right: 1px solid #EEEEEE;
  469. text {
  470. display: block;
  471. }
  472. text:first-child {
  473. font-weight: 600;
  474. font-size: 18px;
  475. color: #333333;
  476. }
  477. text:last-child {
  478. font-size: 10px;
  479. color: #999999;
  480. }
  481. }
  482. }
  483. //列表数据
  484. .card {
  485. position: relative;
  486. background: #FFFFFF;
  487. border-radius: 10rpx;
  488. background-image: url("/static/card.png");
  489. background-size: 100% 100%;
  490. border-top: 1px solid;
  491. border-image: linear-gradient(270deg, rgba(45, 109, 255, 0), rgba(45, 109, 255, 1), rgba(45, 109, 255, 0)) 1 1;
  492. padding: 20rpx 30rpx 30rpx;
  493. .card-title {
  494. .status {
  495. padding: 2rpx 12rpx;
  496. box-sizing: border-box;
  497. border-radius: 2rpx 2rpx 2rpx 2rpx;
  498. font-size: 20rpx;
  499. font-weight: bold;
  500. }
  501. .blue {
  502. background: #EAF0FF;
  503. color: #2D6DFF;
  504. }
  505. .red {
  506. background: #FFECEC;
  507. color: #F74141;
  508. }
  509. >text {
  510. font-size: 24rpx;
  511. color: #666;
  512. }
  513. .name {
  514. font-size: 30rpx;
  515. color: #333;
  516. font-weight: bold;
  517. }
  518. }
  519. .card-data {
  520. .view {
  521. width: 33.33%;
  522. text:first-child {
  523. font-size: 30rpx;
  524. color: #333;
  525. font-weight: bold;
  526. }
  527. text:last-child {
  528. font-size: 24rpx;
  529. color: #999;
  530. }
  531. }
  532. .view:nth-child(2) {
  533. border-left: 1rpx solid #eee;
  534. border-right: 1rpx solid #eee;
  535. }
  536. }
  537. }
  538. .popup-code {
  539. text {
  540. display: block;
  541. border-bottom: 1px solid #EEEEEE;
  542. height: 50px;
  543. line-height: 50px;
  544. text-align: center;
  545. font-size: 16px;
  546. color: #666666;
  547. }
  548. }
  549. .ShowModalCode-style {
  550. text:first-of-type {
  551. display: block;
  552. font-weight: 600;
  553. font-size: 16px;
  554. color: #333333;
  555. border: 1px solid #EEEEEE;
  556. padding: 15px;
  557. text-align: center;
  558. }
  559. }
  560. .popup-code {
  561. text {
  562. display: block;
  563. border-bottom: 1px solid #EEEEEE;
  564. height: 50px;
  565. line-height: 50px;
  566. text-align: center;
  567. font-size: 16px;
  568. color: #666666;
  569. }
  570. }
  571. .ShowModalCode-con {
  572. padding: 30px;
  573. text-align: center;
  574. image {
  575. margin: 0 auto;
  576. margin-top: 15px;
  577. }
  578. }
  579. </style>