my.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <template>
  2. <view class="page">
  3. <view class="header dis f-c ">
  4. <view class="person dis a-start j-s " @click="checkInfo">
  5. <view class="dis ">
  6. <view class="avatar">
  7. <image
  8. :src=" userInfo.sysUser && userInfo.sysUser.headSculpture ? userInfo.sysUser.headSculpture : '/static/image/avatar.png'"
  9. mode="">
  10. </image>
  11. </view>
  12. <view class="relatedInfo dis f-c " v-if="userInfo.sysUser">
  13. <view class="title dis a-c mb-1">
  14. <text>{{ this.userInfo.sysUser.name }}</text>
  15. <image src="/static/image/my/tag1.png" mode=""></image>
  16. <image src="/static/image/my/tag2.png" mode=""></image>
  17. </view>
  18. <text>{{ this.userInfo.sysUser.deptName || '暂无机构' }}</text>
  19. </view>
  20. </view>
  21. <image class="edit mt-1 mr-1" src="/static/icon/my/icon9.png" mode=""></image>
  22. </view>
  23. <view class="walletContent mt-2" @click="walletBalance">
  24. <view class="title">
  25. <text>我的钱包</text>
  26. </view>
  27. <view class="balance dis j-s a-c" v-if="walletInfo">
  28. <view class="item dis f-c a-c">
  29. <text>余额(元)</text>
  30. <text>{{ walletInfo.walletBalanceRemoveWithdraw || 0 }}</text>
  31. </view>
  32. <u-line length="35" color="#EEEEEE" direction="col" :hairline="false"></u-line>
  33. <view class="item dis f-c a-c">
  34. <text>提现中(元)</text>
  35. <text>{{ walletInfo.withdrawingBalance || 0 }}</text>
  36. </view>
  37. <u-line length="35" color="#EEEEEE" direction="col" :hairline="false"></u-line>
  38. <view class="item dis f-c a-c">
  39. <text>积分</text>
  40. <text>{{ walletInfo.integral || 0 }}</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 占位 -->
  46. <view class="placeholder"></view>
  47. <view class="p-3" style="padding-bottom: 50px;">
  48. <!-- 业绩 -->
  49. <view class="myPerformance dis f-c a-c">
  50. <text class="title">我的业绩</text>
  51. <view class="totalPremium dis f-c a-c j-end">
  52. <text>签单保费(元)</text>
  53. <text>{{ walletInfo.signPremium || 0 }}</text>
  54. <view class="tag"></view>
  55. <view class="tag2"></view>
  56. </view>
  57. <view class="Details dis a-c j-s">
  58. <view class="item">
  59. <text>{{ walletInfo.orderCount || 0 }}</text>
  60. <text>车险订单(笔)</text>
  61. </view>
  62. <view class="item">
  63. <text>{{ walletInfo.totalIncome || 0 }}</text>
  64. <text>累计收入(元)</text>
  65. </view>
  66. <view class="item">
  67. <text>{{ walletInfo.totalInviteCount || 0 }}</text>
  68. <text>累计邀请(人)</text>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- 工具 -->
  73. <view class="myTools mt-2">
  74. <view class="toolsItem dis f-c a-c j-c" v-for="(item, index) in ToolsList" :key="index"
  75. @click="toolClick(item)">
  76. <image :src="item.icon" mode=""></image>
  77. <text>{{ item.text }}</text>
  78. </view>
  79. </view>
  80. <view class=" mt-2 ">
  81. <uni-Cell :celllist="celllist" round="20rpx">
  82. <template #customContent="{ item }">
  83. <view v-if="item.title == '新版本'" class="dis a-c customContent">
  84. <template v-if="hasUpdate">
  85. <view class="newtag dis a-c j-c">
  86. New
  87. </view>
  88. <text style="font-size: 28rpx;color: #666;">{{ latestVersion || '1.0.0' }}</text>
  89. </template>
  90. </view>
  91. </template>
  92. </uni-Cell>
  93. </view>
  94. </view>
  95. <!-- app版本更新组件-->
  96. <app-update ref="app_update" @status="updateStatus"></app-update>
  97. </view>
  98. </template>
  99. <script>
  100. import appUpdate from "@/components/yzhua006-update/app-update.vue"; //app更新组件
  101. import {
  102. mapState,
  103. mapMutations
  104. } from "vuex"
  105. import store from '@/store';
  106. export default {
  107. components: {
  108. appUpdate,
  109. },
  110. data() {
  111. return {
  112. dateShow: false,
  113. hasUpdate: false, //有无更新
  114. ToolsList: [{
  115. text: "邀请码",
  116. url: "/pages/tool/invitationCode",
  117. icon: "/static/icon/my/icon1.png",
  118. },
  119. {
  120. text: "分销中心",
  121. url: "/pages/tool/distributionCenter",
  122. icon: "/static/icon/my/icon2.png",
  123. },
  124. {
  125. text: "订单管理",
  126. url: "",
  127. icon: "/static/icon/my/icon3.png",
  128. },
  129. {
  130. text: "保单查询",
  131. url: "",
  132. icon: "/static/icon/my/icon4.png",
  133. },
  134. {
  135. text: "自主报案",
  136. url: "/pages/tool/selfReport",
  137. icon: "/static/icon/my/icon5.png",
  138. },
  139. {
  140. text: "海报管理",
  141. url: "/pages/tool/poster",
  142. icon: "/static/icon/my/icon6.png",
  143. },
  144. {
  145. text: "佣金测算",
  146. url: "",
  147. icon: "/static/icon/my/icon7.png",
  148. },
  149. {
  150. text: "帮助与客服",
  151. url: "/pages/tool/helpAndSupport",
  152. icon: "/static/icon/my/icon8.png",
  153. },
  154. ],
  155. celllist: [{
  156. title: "设置",
  157. icon: "/static/icon/my/icon10.png",
  158. useSlot: false, //是否插槽,
  159. url: "/pages/set/set",
  160. clickType: 'navigate',
  161. },
  162. {
  163. title: "新版本",
  164. icon: "/static/icon/my/icon11.png",
  165. useSlot: true,
  166. url: "/pages/quote/quoteInfo",
  167. clickType: 'checkVersion',
  168. }, {
  169. title: "关于我们",
  170. icon: "/static/icon/my/icon12.png",
  171. useSlot: false,
  172. url: "/pages/set/aboutSet",
  173. clickType: 'navigate',
  174. }
  175. ],
  176. walletInfo: {},
  177. }
  178. },
  179. async onLoad() {
  180. // #ifdef APP-PLUS
  181. setTimeout(() => {
  182. this.$refs.app_update.update(); //调用子组件检查更新方法
  183. }, 500)
  184. // #endif
  185. },
  186. onShow() {
  187. this.getUserInfo();
  188. this.userPerformance();
  189. },
  190. computed: {
  191. ...mapState(['userInfo']),
  192. },
  193. methods: {
  194. // 检查结果回调:item = { hasUpdate, latestVersion }
  195. updateStatus(item) {
  196. this.hasUpdate = item.hasUpdate;
  197. this.latestVersion = item.latestVersion;
  198. },
  199. //我的业绩
  200. async userPerformance() {
  201. let res = await this.$http.get('/userAccount/userWallet'); //获取钱包信息
  202. if (res.code == '200') {
  203. this.walletInfo = res.data;
  204. }
  205. },
  206. async getUserInfo() {
  207. let res = await this.$http.get('/appUser/userInfoGet'); //获取人员信息
  208. if (res.code == '200') {
  209. store.commit('setUserModules', { //用户信息
  210. title: 'userInfo',
  211. data: {
  212. sysUser: {
  213. ...res.data
  214. }
  215. }
  216. })
  217. }
  218. },
  219. //个人信息
  220. checkInfo() {
  221. uni.navigateTo({
  222. url: '/pages/my/userInfo'
  223. })
  224. },
  225. //工具跳转
  226. toolClick(item) {
  227. uni.navigateTo({
  228. url: item.url,
  229. })
  230. },
  231. //跳转钱包
  232. walletBalance() {
  233. uni.navigateTo({
  234. url: '/pages/wallet/myWallet?info=' + JSON.stringify(this.walletInfo)
  235. })
  236. }
  237. }
  238. }
  239. </script>
  240. <style lang="scss" scoped>
  241. .page {
  242. background-color: #F8F8F8;
  243. height: 100%;
  244. }
  245. .header {
  246. width: 100%;
  247. height: 420rpx;
  248. background: white;
  249. background-image: url('../../static/image/my/bg1.png');
  250. background-size: 100% 100%;
  251. aspect-ratio: 25 / 14;
  252. padding: 176rpx 30rpx 0;
  253. box-sizing: border-box;
  254. position: fixed;
  255. top: 0;
  256. left: 0;
  257. z-index: 999;
  258. //头部信息
  259. .person {
  260. .avatar {
  261. width: 80rpx;
  262. height: 80rpx;
  263. border-radius: 50%;
  264. border: 4rpx solid #fff;
  265. margin-left: 7rpx;
  266. image {
  267. width: 100%;
  268. height: 100%;
  269. border-radius: 50%;
  270. }
  271. }
  272. .relatedInfo {
  273. color: #1F1F1F;
  274. margin-left: 25rpx;
  275. .title {
  276. font-size: 36rpx;
  277. font-weight: bold;
  278. image:nth-child(2) {
  279. width: 95rpx;
  280. height: 40rpx;
  281. margin: 0 10rpx;
  282. }
  283. image:nth-child(3) {
  284. width: 62rpx;
  285. height: 26rpx;
  286. }
  287. }
  288. >text {
  289. font-size: 22rpx;
  290. }
  291. }
  292. .edit {
  293. width: 30rpx;
  294. height: 30rpx;
  295. }
  296. }
  297. //钱包
  298. .walletContent {
  299. width: 100%;
  300. height: 207rpx;
  301. position: relative;
  302. .title {
  303. width: 180rpx;
  304. height: 105rpx;
  305. padding: 13rpx 24rpx;
  306. box-sizing: border-box;
  307. color: #333;
  308. font-size: 32rpx;
  309. position: relative;
  310. border-top-left-radius: 20rpx;
  311. border-bottom-left-radius: 20rpx;
  312. background: #FDE935;
  313. border-top: 2rpx solid #fff;
  314. border-left: 2rpx solid #fff;
  315. &::after {
  316. content: "";
  317. position: absolute;
  318. top: 1px;
  319. right: -48px;
  320. height: 100%;
  321. width: 50px;
  322. z-index: 2;
  323. background-color: #FDE935;
  324. clip-path: path("M0 0 C12.5 0 10.5 25 25 50 L0 50 Z");
  325. // clip-path: path("M0 0 C17.5 0 13.5 25 25 50 L0 50 Z");
  326. }
  327. }
  328. .balance {
  329. position: absolute;
  330. top: 66rpx;
  331. width: 100%;
  332. padding: 30rpx;
  333. box-sizing: border-box;
  334. z-index: 2;
  335. background: linear-gradient(to left,
  336. #fff 60%,
  337. rgba(255, 255, 255, 0.7) 70%);
  338. border-radius: 20rpx;
  339. border: 2rpx solid #FFFFFF;
  340. backdrop-filter: blur(30rpx);
  341. /* 背景模糊 */
  342. .item {
  343. width: 32%;
  344. text:first-child {
  345. font-size: 24rpx;
  346. color: #666;
  347. margin-bottom: 10rpx;
  348. }
  349. text:last-child {
  350. color: #333;
  351. font-size: 36rpx;
  352. font-weight: bold;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. .placeholder {
  359. width: 100%;
  360. height: 420rpx;
  361. }
  362. //我的业绩
  363. .myPerformance {
  364. width: 100%;
  365. margin-top: 72rpx;
  366. background: linear-gradient(180deg, rgba(253, 233, 53, 0.05) 0%, rgba(253, 233, 53, 0) 100%), #FFFFFF;
  367. border-radius: 20rpx;
  368. padding: 72rpx 30rpx 20rpx;
  369. box-sizing: border-box;
  370. position: relative;
  371. .title {
  372. position: absolute;
  373. top: 27rpx;
  374. left: 20rpx;
  375. font-size: 32rpx;
  376. color: #333;
  377. }
  378. .totalPremium {
  379. position: relative;
  380. width: 390rpx;
  381. height: 180rpx;
  382. background: transparent;
  383. padding: 0 62rpx;
  384. box-sizing: border-box;
  385. >text:nth-child(1) {
  386. font-size: 28rpx;
  387. color: #666;
  388. margin-bottom: 8rpx;
  389. }
  390. >text:nth-child(2) {
  391. font-size: 50rpx;
  392. color: #333;
  393. font-weight: bold;
  394. margin-bottom: 8rpx;
  395. }
  396. .tag {
  397. content: "";
  398. position: absolute;
  399. bottom: -7rpx;
  400. left: 0;
  401. width: 14rpx;
  402. height: 14rpx;
  403. border-radius: 50%;
  404. background: rgba(253, 233, 53, 0.4);
  405. }
  406. .tag2 {
  407. content: "";
  408. position: absolute;
  409. bottom: -7rpx;
  410. right: 0;
  411. width: 14rpx;
  412. height: 14rpx;
  413. border-radius: 50%;
  414. background-color: rgba(253, 233, 53, 0.4);
  415. }
  416. }
  417. .totalPremium::before {
  418. content: "";
  419. position: absolute;
  420. top: 0;
  421. left: 0;
  422. width: 100%;
  423. height: 100%;
  424. border: 7px solid rgba(253, 233, 53, 0.5);
  425. border-radius: 195rpx 195rpx 0 0;
  426. box-sizing: border-box;
  427. border-bottom: transparent;
  428. }
  429. .Details {
  430. width: 100%;
  431. height: 152rpx;
  432. background-image: url('../../static/image/my/bg2.png');
  433. background-size: 100% 100%;
  434. padding: 48rpx 30rpx 20rpx;
  435. box-sizing: border-box;
  436. .item {
  437. width: 33%;
  438. display: flex;
  439. flex-direction: column;
  440. align-items: center;
  441. justify-content: center;
  442. text:first-child {
  443. font-size: 36rpx;
  444. color: #333;
  445. font-weight: bold;
  446. margin-bottom: 6rpx;
  447. }
  448. text:last-child {
  449. font-size: 24rpx;
  450. color: #666;
  451. }
  452. }
  453. }
  454. }
  455. //工具
  456. .myTools {
  457. padding: 35rpx 30rpx;
  458. box-sizing: border-box;
  459. background: #fff;
  460. border-radius: 20rpx;
  461. display: grid;
  462. /* 启用网格布局 */
  463. grid-template-columns: repeat(4, 1fr);
  464. /* 3 列,每列等宽 */
  465. grid-template-rows: auto;
  466. /* 行高自适应 */
  467. row-gap: 40rpx;
  468. /* 只设置行间距(上下) */
  469. column-gap: 10px;
  470. /* 列间距设为 0(可选) */
  471. /* 网格间距 */
  472. .toolsItem {
  473. image {
  474. width: 58rpx;
  475. height: 58rpx;
  476. margin-bottom: 6rpx;
  477. }
  478. text {
  479. font-size: 28rpx;
  480. color: #333;
  481. }
  482. }
  483. }
  484. .customContent {
  485. .newtag {
  486. width: auto;
  487. height: 100%;
  488. padding: 5rpx 12rpx;
  489. box-sizing: border-box;
  490. background: #FF4545;
  491. border-radius: 20rpx 20rpx 20rpx 20rpx;
  492. font-size: 18rpx;
  493. color: #fff;
  494. margin-right: 18rpx;
  495. }
  496. }
  497. </style>