my.vue 11 KB

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