benefits.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <template>
  2. <view class="page">
  3. <view class="header dis a-end j-s mb-2">
  4. <view class="dis a-c ">
  5. <image :src="backLogo" mode=""></image>
  6. <view class="dis f-c title ml-3">
  7. <text>{{gradeText}}</text>
  8. <text>我的佣金比例</text>
  9. </view>
  10. </view>
  11. <view class="ratio dis a-end " @click="ratiodetail">
  12. <text class="mr-1">{{info.totalRate}}%</text>
  13. <u-icon name="arrow-right" color="#999" size="28"></u-icon>
  14. </view>
  15. </view>
  16. <view class="wrap ">
  17. <view class="tabs dis a-end">
  18. <view v-for="(item, index) in tabList" :key="index" class="tab dis a-c j-c" :class="{
  19. active: activeTab === index,
  20. tab1: activeTab !== index,
  21. left: activeTab === 0,
  22. right: activeTab === 1
  23. }" @click="handleTab(index)">
  24. <view class="tabtitle">
  25. <image v-if="activeTab==index" src="/static/image/Vector 22.png" mode=""></image>
  26. <view class="">
  27. {{ item.label }}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="content-container">
  33. <view class="content-wrap contentwrap1 dis f-c a-c" v-show="activeTab === 0">
  34. <text class="title">- 成为{{gradeText}}已解锁的权益 -</text>
  35. <template v-if="this.userInfo.sysUser.grade==1">
  36. <view class="benefits dis f-c ">
  37. <text>发展管理人</text>
  38. <text>邀请管理人加入,获得管理人车险订单0.1%的收益</text>
  39. </view>
  40. <view class="benefits dis f-c ">
  41. <text>成为管理人</text>
  42. <text>邀请合伙人,获得合伙人0.1-0.5的收益</text>
  43. </view>
  44. <view class="benefits dis f-c ">
  45. <text>成为合伙人</text>
  46. <text>邀请工作室,获得下辖团队出单业务的0.1-0.5的收益</text>
  47. </view>
  48. <view class="benefits dis f-c ">
  49. <text>成为工作室</text>
  50. <text>邀请团队,获得下辖团队出单业务的0.1-0.5的收益</text>
  51. </view>
  52. </template>
  53. <template v-if="this.userInfo.sysUser.grade==2">
  54. <view class="benefits dis f-c ">
  55. <text>发展合伙人</text>
  56. <text>邀请合伙人加入,获得合伙人车险订单0.1-0.5%%的收益</text>
  57. </view>
  58. <view class="benefits dis f-c ">
  59. <text>成为合伙人</text>
  60. <text>邀请工作室,获得下辖团队出单业务的0.1-0.5的收益</text>
  61. </view>
  62. <view class="benefits dis f-c ">
  63. <text>成为工作室</text>
  64. <text>邀请团队,获得下辖团队出单业务的0.1-0.5的收益</text>
  65. </view>
  66. <view class="benefits dis f-c ">
  67. <text>升级成为创始人</text>
  68. <text>邀请团队,获得下辖团队出单业务的0.1-0.5的收益</text>
  69. </view>
  70. </template>
  71. <template v-if="this.userInfo.sysUser.grade==3">
  72. <view class="benefits dis f-c ">
  73. <text>发展工作室</text>
  74. <text>邀请工作室加入,获得合伙人车险订单0.1-0.5%%的收益</text>
  75. </view>
  76. <view class="benefits dis f-c ">
  77. <text>成为工作室</text>
  78. <text>邀请团队,获得下辖团队出单业务的0.1-0.5的收益</text>
  79. </view>
  80. <view class="benefits dis f-c ">
  81. <text>升级成为管理人</text>
  82. <text>邀请团队,获得下辖团队出单业务的0.1-0.5的收益</text>
  83. </view>
  84. </template>
  85. <template v-if="this.userInfo.sysUser.grade==4">
  86. <view class="benefits dis f-c ">
  87. <text>发展出单团队</text>
  88. <text>邀请出单团队加入,获得出单员车险订单0.1-0.5%%的收益</text>
  89. </view>
  90. <view class="benefits dis f-c ">
  91. <text>成为出单团队</text>
  92. <text>成为出单团队,获取车险订单的三级分销佣金</text>
  93. </view>
  94. <view class="benefits dis f-c ">
  95. <text>升级成为合伙人</text>
  96. <text>满足考核条件升级成为管理人,解锁更多权益</text>
  97. </view>
  98. </template>
  99. </view>
  100. <view class="content-wrap contentwrap2 dis f-c a-c" v-show="activeTab === 1">
  101. <text class="title">- 各类身份的佣金权益 -</text>
  102. <view class="ratio-benefits dis f-c ">
  103. <view class=" dis a-c j-s mb-5">
  104. <view class="item dis f-c a-c" v-for="(item,index) in ratioList"
  105. :class="{active:index==ratioindex}" :key="index" @click="itemclick(item,index)">
  106. <image :src="index==ratioindex?item.activeImg:item.img" mode=""></image>
  107. <text>{{item.title}}</text>
  108. </view>
  109. </view>
  110. <text class="content">{{content}}</text>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. <u-popup v-model="ratiodetailshow" mode="bottom" border-radius="20" :closeable="true">
  116. <view class=" dis a-c j-c " style="border-bottom: 1rpx solid #eee;padding: 24rpx;box-sizing: border-box;">
  117. <text class="font-weight" style="font-size: 36rpx;color: #333;">我的佣金比例</text>
  118. </view>
  119. <view class="p-3">
  120. <view class="ratioitem dis a-c j-s" v-for="(item,index) in info.data" :key="index">
  121. <text>{{item.gradeName}}</text>
  122. <text>{{item.commissionRate}}%</text>
  123. </view>
  124. </view>
  125. </u-popup>
  126. </view>
  127. </template>
  128. <script>
  129. import {
  130. mapState,
  131. mapMutations
  132. } from "vuex"
  133. export default {
  134. data() {
  135. return {
  136. info: {},
  137. ratiodetailshow: false, //佣金比例弹窗
  138. ratioindex: 0, //佣金权益选中下标
  139. content: "创始人身份可享受邀请的所有管理人发展的团队成员车险订单的0.1% \n例如:创始人邀请了管理人A,管理人A邀请了合伙人B,合伙人B邀请了工作室C,工作室C邀请了团队D,团队D内的成员出单保费1000元(除车船税),管理人即可获得1000*0.1% = 1元",
  140. activeTab: 0,
  141. backLogo: '', //等级标志
  142. tabList: [{
  143. label: "身份权益"
  144. },
  145. {
  146. label: "佣金权益"
  147. }
  148. ],
  149. ratioList: [{
  150. title: "创始人",
  151. img: "/static/image/my/benefits/1.png",
  152. activeImg: "/static/image/my/benefits/active1.png",
  153. Text: "创始人身份可享受邀请的所有管理人发展的团队成员车险订单的0.1% \n例如:创始人邀请了管理人A,管理人A邀请了合伙人B,合伙人B邀请了工作室C,工作室C邀请了团队D,团队D内的成员出单保费1000元(除车船税),管理人即可获得1000*0.1% = 1元"
  154. },
  155. {
  156. title: "管理人",
  157. img: "/static/image/my/benefits/2.png",
  158. activeImg: "/static/image/my/benefits/active2.png",
  159. Text: "管理人身份可享受邀请的所有合伙人发展的团队成员车险订单的0.15-0.5%;\n 邀请合伙人1-3人,为0.1%,\n 邀请合伙人4-6人,为0.3,\n 邀请合伙人7人以上,为0.5\n 例如:管理人邀请了合伙人A,B,C,达成了0.1%的奖励;合伙人A邀请了工作室B,工作室B邀请了团队C,团队C内的成员出单保费1000元(除车船税),管理人即可获得1000*0.1% = 1元"
  160. },
  161. {
  162. title: "合伙人",
  163. img: "/static/image/my/benefits/3.png",
  164. activeImg: "/static/image/my/benefits/active3.png",
  165. Text: "合伙人身份可享受邀请的所有工作室发展的团队成员车险订单的0.15-0.5%;\n 邀请工作室1-3人,为0.1%,\n 邀请工作室4-6人,为0.3,\n 邀请工作室7人以上,为0.5 \n例如:合伙人邀请了工作室A,B,C,达成了0.1%的奖励;合伙人A邀请了工作室B,工作室B邀请了团队C,团队C内的成员出单保费1000元(除车船税),管理人即可获得1000*0.1% = 1元"
  166. }, {
  167. title: "工作室",
  168. img: "/static/image/my/benefits/4.png",
  169. activeImg: "/static/image/my/benefits/active4.png",
  170. Text: "工作室身份可享受邀请的所有发展的团队成员 车险订单的0.15-0.5%;\n 邀请团队1-3人,为0.1%,\n 邀请团队4-6人,为0.3,\n 邀请团队7人以上,为0.5 \n例如:工作室请了团队A,B,C,达成了0.1%的奖励;工作室邀请了团队A,团队A内的成员出单保费1000元(除车船税),管理人即可获得1000*0.1% = 1元"
  171. }
  172. ],
  173. //角色权益等级匹配列表
  174. backLogoList: [{
  175. grade: 1,
  176. url: "/static/image/my/benefits/active1.png"
  177. },
  178. {
  179. grade: 2,
  180. url: "/static/image/my/benefits/active2.png"
  181. },
  182. {
  183. grade: 3,
  184. url: "/static/image/my/benefits/active3.png"
  185. },
  186. {
  187. grade: 4,
  188. url: "/static/image/my/benefits/active4.png"
  189. }
  190. ],
  191. }
  192. },
  193. computed: {
  194. ...mapState(['userInfo', "userCheckInfo"]),
  195. //匹配等级title
  196. gradeText() {
  197. const gradeMap = {
  198. 1: '创始人',
  199. 2: '管理人',
  200. 3: '合伙人',
  201. 4: '工作室'
  202. }
  203. return gradeMap[this.userInfo.sysUser.grade] || ''
  204. }
  205. },
  206. async onShow() {
  207. this.backLogo = this.backLogoList.find(val => val.grade == this.userInfo.sysUser.grade).url; //获取对等身份logo标志
  208. this.ratioindex = this.userInfo.sysUser.grade - 1; //默认高亮显示对应等级
  209. let res = await this.$http.get('/partner/myCommissionRate');
  210. if (res.code == '200') {
  211. this.info = res.data;
  212. }
  213. },
  214. onLoad() {
  215. },
  216. methods: {
  217. //切换事件
  218. itemclick(item, index) {
  219. this.ratioindex = index;
  220. this.content = item.Text;
  221. },
  222. handleTab(index) {
  223. this.activeTab = index
  224. },
  225. //比例弹窗
  226. ratiodetail() {
  227. this.ratiodetailshow = true;
  228. },
  229. }
  230. }
  231. </script>
  232. <style lang="scss" scoped>
  233. .page {
  234. background-color: #F7F7F7;
  235. padding: 20rpx 30rpx;
  236. box-sizing: border-box;
  237. }
  238. .header {
  239. height: 170rpx;
  240. background: #fff;
  241. border-radius: 10rpx 10rpx 10rpx 10rpx;
  242. padding: 30rpx 40rpx;
  243. box-sizing: border-box;
  244. background-image: url('/static/image/my/benefits/benefits-back1.png');
  245. background-size: 100% 100%;
  246. image {
  247. width: 96rpx;
  248. height: 110rpx;
  249. }
  250. .title {
  251. text:first-child {
  252. font-size: 36rpx;
  253. color: #333;
  254. font-weight: bold;
  255. }
  256. text:last-child {
  257. font-size: 28rpx;
  258. color: #666;
  259. }
  260. }
  261. .ratio {
  262. text {
  263. font-size: 50rpx;
  264. color: #333;
  265. font-weight: bold;
  266. line-height: 0.8;
  267. }
  268. }
  269. }
  270. .wrap {
  271. position: relative;
  272. width: 100%;
  273. margin: 0 auto;
  274. box-sizing: border-box;
  275. border-radius: 0px 10rpx 10rpx 10rpx;
  276. }
  277. .tabs {
  278. display: flex;
  279. position: relative;
  280. overflow: hidden;
  281. border-radius: 10rpx 10rpx 0 0;
  282. }
  283. .tab {
  284. flex: 1;
  285. height: 90rpx;
  286. color: #999;
  287. font-size: 30rpx;
  288. position: relative;
  289. border-top-right-radius: 10rpx;
  290. border-top-left-radius: 10rpx;
  291. &.active {
  292. background: #fff;
  293. color: #333;
  294. font-size: 30rpx;
  295. font-weight: bold;
  296. border-top-right-radius: 10rpx;
  297. border-top-left-radius: 10rpx;
  298. }
  299. &.left.active {
  300. border-top-right-radius: 0;
  301. &::after {
  302. content: "";
  303. position: absolute;
  304. top: 0;
  305. right: -50px;
  306. height: 100%;
  307. width: 50px;
  308. z-index: 2;
  309. background-color: #fff;
  310. clip-path: path("M0 0 C12.5 0 13.5 25 25 45 L0 50 Z");
  311. }
  312. }
  313. // 右侧标签的曲线
  314. &.right.active {
  315. border-top-left-radius: 0;
  316. &::before {
  317. content: "";
  318. position: absolute;
  319. top: 0;
  320. left: -49px;
  321. height: 100%;
  322. width: 50px;
  323. z-index: 2;
  324. background-color: #fff;
  325. clip-path: path("M50 0 C37.5 0 37.5 25 25 45 L50 50 Z");
  326. }
  327. }
  328. }
  329. .tab1 {
  330. flex: 1;
  331. height: 90rpx;
  332. position: relative;
  333. border-top-right-radius: 10rpx;
  334. border-top-left-radius: 10rpx;
  335. background-color: #FAFAFA;
  336. }
  337. .tabtext {
  338. margin-left: 50rpx;
  339. }
  340. .tabtext1 {
  341. margin-right: 50rpx;
  342. }
  343. .content-container {
  344. position: relative;
  345. height: auto;
  346. background: #fff;
  347. ;
  348. border-radius: 10rpx 10rpx 10rpx 10rpx;
  349. }
  350. .content-wrap {
  351. height: 100%;
  352. box-sizing: border-box;
  353. border: 4rpx solid #FFFFFF;
  354. border-top: none;
  355. .title {
  356. font-size: 26rpx;
  357. color: #333;
  358. margin-bottom: 30rpx;
  359. }
  360. .benefits {
  361. width: 100%;
  362. padding: 30rpx;
  363. box-sizing: border-box;
  364. border-radius: 10rpx;
  365. background-image: url('/static/image/my/benefits/benefits-back2.png');
  366. background-size: 100% 100%;
  367. margin-bottom: 30rpx;
  368. text:first-child {
  369. font-size: 30rpx;
  370. color: #333;
  371. }
  372. text:last-child {
  373. font-size: 22rpx;
  374. color: #666;
  375. }
  376. }
  377. .ratio-benefits {
  378. width: 100%;
  379. .item {
  380. font-size: 30rpx;
  381. color: #999;
  382. image {
  383. width: 72rpx;
  384. height: 82rpx;
  385. }
  386. }
  387. .active {
  388. font-size: 30rpx;
  389. color: #333;
  390. font-weight: bold;
  391. }
  392. }
  393. }
  394. .contentwrap1 {
  395. border-radius: 10rpx 10rpx 10rpx 10rpx;
  396. padding: 30rpx 35rpx;
  397. box-sizing: border-box;
  398. }
  399. .contentwrap2 {
  400. border-radius: 10rpx 10rpx 10rpx 10rpx;
  401. padding: 30rpx 35rpx;
  402. box-sizing: border-box;
  403. }
  404. .tabtitle {
  405. position: relative;
  406. z-index: 1; // 父级降低层级
  407. // 文字部分
  408. &__text {
  409. position: relative; // 必须定位元素才能生效z-index
  410. z-index: 3; // 高于装饰图片
  411. display: inline-block;
  412. }
  413. // 装饰图片
  414. image {
  415. position: absolute;
  416. bottom: -14rpx; // 根据实际图片高度调整
  417. left: 50%;
  418. transform: translateX(-50%);
  419. z-index: 2; // 介于父级和文字之间
  420. width: 100%;
  421. height: 20rpx;
  422. }
  423. }
  424. .ratioitem {
  425. font-size: 30rpx;
  426. color: #333;
  427. margin-bottom: 52rpx;
  428. }
  429. </style>