myEarnings.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <view class="">
  3. <!-- 全局 loding -->
  4. <public-module></public-module>
  5. <!-- 头部 -->
  6. <view class="headers dis a-c j-start">
  7. <u-icon name="arrow-left" color="#333" size="38" @tap="back"></u-icon>
  8. <text style="margin: auto;">我的收益</text>
  9. </view>
  10. <view class="homeBackground"></view>
  11. <!-- 业绩 -->
  12. <view class="filterTime dis j-end a-c ">
  13. <view class=" dis a-c " @click="timeDropdownFilter">
  14. <text>时间筛选</text>
  15. <text>▼</text>
  16. </view>
  17. </view>
  18. <view class="performance dis a-c j-c ">
  19. 共有 {{totalCount.numberOrders}}笔订单,保费{{totalCount.totalPremium}}元,佣金{{totalCount.commission}}元
  20. </view>
  21. <view class="body p-2" style="padding-top: 340rpx;">
  22. <view class="card mb-2" v-for="(item,index) in incomeList" :key="index"
  23. @click="earningsDetail(item.ordersNo)">
  24. <view class="card-title dis a-c j-s mb-2">
  25. <view class="dis a-c ">
  26. <view class="avatar">
  27. <image src="/static/image/my/wuxingb.png" mode=""></image>
  28. </view>
  29. <text class="name ml-1">{{item.carId}}</text>
  30. </view>
  31. <text>{{item.issuanceTime}} 出单</text>
  32. </view>
  33. <view class="card-data dis a-c j-s ">
  34. <view class="view dis f-c a-c ">
  35. <text>{{item.agent}}</text>
  36. <text>代理人</text>
  37. </view>
  38. <view class="view dis f-c a-c ">
  39. <text>{{item.premium}}</text>
  40. <text>保费</text>
  41. </view>
  42. <view class="view dis f-c a-c ">
  43. <text>{{item.commission}}</text>
  44. <text>我的佣金</text>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <u-popup v-model="ShowModal" mode="bottom" border-radius="15">
  50. <view class="popup-code">
  51. <text @click="ShowModalCodeFun(level)">合伙人</text>
  52. <text @click="ShowModalCodeworkFun">工作室</text>
  53. </view>
  54. </u-popup>
  55. <u-popup v-model="ShowModalCode" mode="bottom" border-radius="15">
  56. <view class="ShowModalCode-style ">
  57. <text>{{chineseNumbers[relativeLeavl]}}级合伙人招募码</text>
  58. <view class=" ShowModalCode-con">
  59. <view>扫码加入</view>
  60. <image :src="partnerImg" mode="widthFix" lazy-load style="width: 150px;"></image>
  61. </view>
  62. </view>
  63. </u-popup>
  64. <u-popup mode="center" ref="alertDialog" type="dialog">
  65. <uni-popup-dialog type="warn" cancelText="取消" confirmText="确定" title=" " :content="dialogContent"
  66. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  67. </u-popup>
  68. <my-date-picker ref="datePicker" @confirmPickDate="confirmPickDate" />
  69. </view>
  70. </template>
  71. <script>
  72. import myDatePicker from '../components/date-picker.vue';
  73. import seach from '../components/seach.vue';
  74. import QR from "@/common/wxqrcode.js"
  75. import {
  76. mapState,
  77. mapMutations
  78. } from "vuex"
  79. export default {
  80. components: {
  81. myDatePicker,
  82. seach
  83. },
  84. computed: {
  85. ...mapState(['userInfo', "userCheckInfo", ]),
  86. },
  87. data() {
  88. return {
  89. totalCount: {}, //统计
  90. incomeList: [], //列表
  91. //tab选项
  92. list: [{
  93. name: '我是创始人'
  94. }, {
  95. name: '我是管理人'
  96. },
  97. {
  98. name: '我是合伙人'
  99. },
  100. {
  101. name: '我是工作室'
  102. }
  103. ],
  104. current: 0,
  105. dialogContent: '',
  106. ShowalertDialog: false,
  107. relativeLeavl: null,
  108. ShowModal: false,
  109. ShowModalCode: false,
  110. ShowModalCode1: false,
  111. ShowModalCodebusiness: false,
  112. chineseNumbers: ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'],
  113. teamTabIndex: 0,
  114. directLsit: [{
  115. partnerNumber: 1
  116. },
  117. {
  118. partnerNumber: 2
  119. }
  120. ],
  121. source: 0,
  122. totalPages: 0,
  123. totalSize: 0,
  124. status: 'loadmore',
  125. pageRequest: { //查询的默认条件
  126. pageNum: 1,
  127. pageSize: 20,
  128. userName: ''
  129. },
  130. partnerImg: '',
  131. workImg: '',
  132. directLsitOne: {},
  133. directLsitTwo: {},
  134. directLsitThree: {},
  135. directLsitFour: {},
  136. userLevel: "",
  137. deptSource: 1,
  138. startTime: "", //时间筛选 开始
  139. endTime: "", //时间筛选 结束
  140. }
  141. },
  142. async onLoad(params) {
  143. this.queryData()
  144. this.userLevel = this.userInfo.sysUser.level
  145. },
  146. methods: {
  147. //下拉筛选
  148. timeDropdownFilter() {
  149. this.$refs.datePicker.open()
  150. },
  151. //日期选择事件
  152. confirmPickDate(startdate, enddate) {
  153. this.startTime = startdate;
  154. this.endTime = enddate;
  155. this.queryData();
  156. },
  157. change(index) {
  158. this.current = index;
  159. },
  160. dialogClose() {
  161. this.$refs.alertDialog.close()
  162. },
  163. styleChange(e) {
  164. this.deptSource = e.detail.value
  165. },
  166. dialogConfirm() {
  167. this.ShowModalCode = true
  168. this.$refs.alertDialog.close()
  169. this.partnerImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applypartner?level=" + this
  170. .level + '&userId=' + this.userInfo.sysUser.userId, {
  171. size: parseInt(200) //二维码大小
  172. })
  173. },
  174. ShowModalCodeFun(level, relativeLeavl) {
  175. // 绝对等级:level 相对等级:relativeLeavl
  176. this.level = level
  177. this.relativeLeavl = relativeLeavl
  178. // this.ShowalertDialog=true
  179. this.dialogContent = `是否招募${this.chineseNumbers[relativeLeavl]}级合伙人?`
  180. this.$refs.alertDialog.open()
  181. },
  182. ShowModalCodeSumbit() {
  183. this.ShowModalCode1 = true
  184. this.workImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applystudio?deptSource=" + this
  185. .deptSource + '&userId=' + this.userInfo.sysUser.userId, {
  186. size: parseInt(200) //二维码大小
  187. })
  188. },
  189. ShowModalCodeworkFun() {
  190. this.ShowModalCodebusiness = true
  191. this.deptSource = 1
  192. },
  193. // partnersAndStudios(level){
  194. // this.level=level
  195. // this.ShowModal = true
  196. // },
  197. // recruitment(level) {
  198. // this.level = level
  199. // this.ShowModalCodeFun(level)
  200. // },
  201. back() {
  202. uni.navigateBack({
  203. delta: 1, // 返回的页面数,如果是1表示返回上一页
  204. success: function() {}
  205. });
  206. },
  207. backHome() {
  208. uni.switchTab({
  209. url: "/pages/index/index"
  210. })
  211. },
  212. earningsDetail(ordersNo) {
  213. uni.navigateTo({
  214. url: "/pages/my/commissionDetail?ordersNo=" + ordersNo,
  215. })
  216. },
  217. closeInstitution(item, level) {
  218. if (item.leaderIds.length > 0) {
  219. item.level = level
  220. uni.navigateTo({
  221. url: "/pages/institutional/institutionalTeam?key=" + encodeURIComponent(JSON.stringify(
  222. item))
  223. })
  224. }
  225. },
  226. // onReachBottom() {
  227. // if (this.pageRequest.pageNum >= this.totalPages) return;
  228. // this.status = 'loading';
  229. // this.pageRequest.pageNum = ++this.pageRequest.pageNum;
  230. // setTimeout(async () => {
  231. // let res = await this.$http.post('/sysPartner/querySysPartnerAPPPage', {
  232. // ...this.pageRequest,
  233. // source:this.source
  234. // });
  235. // if (res.code == '200') {
  236. // this.totalSize = res.data.totalSize;
  237. // this.directLsit = [...this.directLsit, ...res.data.content];
  238. // }
  239. // if (this.pageRequest.pageNum >= this.totalPages) this.status = 'nomore';
  240. // else this.status = 'loading';
  241. // }, 1000)
  242. // },
  243. async queryData(data) {
  244. let res = await this.$http.get('/newAppPartner/myPerformance?grade=' + this.userInfo.sysUser.grade +
  245. '&startTime=' + this.startTime + '&endTime=' + this.endTime);
  246. if (res.code == '200') {
  247. this.totalCount = res.data.total; //个人收益统计
  248. this.incomeList = res.data.data; //收益列表
  249. }
  250. },
  251. }
  252. }
  253. </script>
  254. <style lang="scss" scoped>
  255. .headers {
  256. position: fixed;
  257. top: 0;
  258. left: 0;
  259. height: auto;
  260. width: 100%;
  261. z-index: 999999;
  262. padding: 30rpx;
  263. padding-top: 50px;
  264. text {
  265. font-size: 36rpx;
  266. font-weight: bold;
  267. color: #000;
  268. }
  269. .headers-activeTab {
  270. width: 80%;
  271. }
  272. .right {
  273. position: absolute;
  274. right: 30rpx;
  275. image {
  276. width: 28rpx;
  277. height: 28rpx;
  278. margin-right: 4rpx;
  279. }
  280. text {
  281. font-weight: 400;
  282. color: #000;
  283. font-size: 24rpx;
  284. }
  285. }
  286. }
  287. //头部背景
  288. .homeBackground {
  289. position: fixed;
  290. top: 0;
  291. left: 0;
  292. z-index: 999;
  293. width: 100%;
  294. height: 176rpx;
  295. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  296. border-bottom: 1rpx solid #f2f2f2;
  297. }
  298. //时间筛选
  299. .filterTime {
  300. position: fixed;
  301. top: 176rpx;
  302. left: 0;
  303. width: 100%;
  304. z-index: 999;
  305. background: #fff;
  306. border-radius: 0rpx 0rpx 0rpx 0rpx;
  307. padding: 20rpx 30rpx;
  308. box-sizing: border-box;
  309. text:first-child {
  310. font-size: 26 rpx;
  311. color: #333;
  312. }
  313. text:last-child {
  314. font-size: 19rpx;
  315. color: #666;
  316. margin-left: 4rpx;
  317. }
  318. }
  319. //业绩
  320. .performance {
  321. position: fixed;
  322. top: 266rpx;
  323. left: 0;
  324. z-index: 999;
  325. width: 100%;
  326. height: 60rpx;
  327. background: #EBF4FF;
  328. border-radius: 0rpx 0rpx 0rpx 0rpx;
  329. font-size: 30rpx;
  330. color: #2B67EF;
  331. }
  332. .partner-head {
  333. background: #FFFFFF;
  334. color: #333333;
  335. font-size: 14px;
  336. i {
  337. margin-left: 2px;
  338. display: inline-block;
  339. width: 0;
  340. height: 0;
  341. border: 4px solid;
  342. border-color: #666666;
  343. border-bottom: 4px solid transparent;
  344. border-right: 4px solid transparent;
  345. border-left: 4px solid transparent;
  346. }
  347. }
  348. .sum-insurance {
  349. padding: 10px 0;
  350. view {
  351. text-align: center;
  352. width: 33.33%;
  353. border-right: 1px solid #EEEEEE;
  354. text {
  355. display: block;
  356. }
  357. text:first-child {
  358. font-weight: 600;
  359. font-size: 18px;
  360. color: #333333;
  361. }
  362. text:last-child {
  363. font-size: 10px;
  364. color: #999999;
  365. }
  366. }
  367. }
  368. //列表数据
  369. .card {
  370. background: #FFFFFF;
  371. border-radius: 10rpx;
  372. background-image: url("/static/card.png");
  373. background-size: 100% 100%;
  374. border-top: 1px solid;
  375. border-image: linear-gradient(270deg, rgba(45, 109, 255, 0), rgba(45, 109, 255, 1), rgba(45, 109, 255, 0)) 1 1;
  376. padding: 20rpx 30rpx 30rpx;
  377. .card-title {
  378. .avatar {
  379. width: 40rpx;
  380. height: 40rpx;
  381. border-radius: 50%;
  382. image {
  383. width: 100%;
  384. height: 100%;
  385. }
  386. }
  387. >text {
  388. font-size: 24rpx;
  389. color: #666;
  390. }
  391. .name {
  392. font-size: 30rpx;
  393. color: #333;
  394. font-weight: bold;
  395. }
  396. }
  397. .card-data {
  398. .view {
  399. width: 33.33%;
  400. text:first-child {
  401. font-size: 30rpx;
  402. color: #333;
  403. font-weight: bold;
  404. }
  405. text:last-child {
  406. font-size: 24rpx;
  407. color: #999;
  408. }
  409. }
  410. .view:nth-child(2) {
  411. border-left: 1rpx solid #eee;
  412. border-right: 1rpx solid #eee;
  413. }
  414. }
  415. }
  416. .popup-code {
  417. text {
  418. display: block;
  419. border-bottom: 1px solid #EEEEEE;
  420. height: 50px;
  421. line-height: 50px;
  422. text-align: center;
  423. font-size: 16px;
  424. color: #666666;
  425. }
  426. }
  427. .ShowModalCode-style {
  428. text:first-of-type {
  429. display: block;
  430. font-weight: 600;
  431. font-size: 16px;
  432. color: #333333;
  433. border: 1px solid #EEEEEE;
  434. padding: 15px;
  435. text-align: center;
  436. }
  437. }
  438. .popup-code {
  439. text {
  440. display: block;
  441. border-bottom: 1px solid #EEEEEE;
  442. height: 50px;
  443. line-height: 50px;
  444. text-align: center;
  445. font-size: 16px;
  446. color: #666666;
  447. }
  448. }
  449. .ShowModalCode-con {
  450. padding: 30px;
  451. text-align: center;
  452. image {
  453. margin: 0 auto;
  454. margin-top: 15px;
  455. }
  456. }
  457. </style>