equityGrade.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. <template>
  2. <!-- 权益等级 -->
  3. <view class="">
  4. <!-- 顶部导航 -->
  5. <view style="background-color: $color-white !important;">
  6. <u-navbar :back-text="i18n('Back')" :back-text-style="backStyle" back-icon-color="#fff" title-color="#fff"
  7. :background="background" title-width="300" :title="i18n('gradeInfo')"></u-navbar>
  8. </view>
  9. <!-- 用户基本信息 -->
  10. <view class="content">
  11. <view class="user-info">
  12. <view class="user-pic">
  13. <image class="ui-pic-detail" :src="websiteUrl+picDetail.userPic" mode=""></image>
  14. <view class="user-grade-now">
  15. {{userInfos.levelName}}
  16. </view>
  17. </view>
  18. <view class="integrate-now">
  19. <view class="user-name">{{userInfos.userName}}</view>
  20. <view class="user-grow">
  21. {{$i18n.locale=='zh'?'成长值:':'Growth Value:'}}{{userInfos.growthValue==null?'0':userInfos.growthValue}}
  22. </view>
  23. <view class="next-grade">{{$i18n.locale=='zh' ? '距下一个等级需':
  24. 'Distance to the next levelrequires'}} {{growNum}} {{$i18n.locale=='zh' ?'成长值':'growth'}}</view>
  25. </view>
  26. <u-button class=" get-integrate" type="custom" shape="circle" @tap="toList"><text
  27. class="get-integrate-info">{{$i18n.locale=='zh'?'去升级':'Upgrade'}}</text>
  28. </u-button>
  29. </view>
  30. <view v-if="$i18n.locale=='zh'" class="user-style1">
  31. <image class="top-pic" src="@/static/user-pic/user-grade.png" style="height: 55px;"></image>
  32. </view>
  33. <view v-if="$i18n.locale!='zh'" class="user-style2">
  34. <image class="top-pic" src="@/static/theLast/english-925.png" style="height: 55px;"></image>
  35. </view>
  36. <view class="user-privilege">
  37. <view class="privilege-now">
  38. <view class="user-now-grade">{{$i18n.locale=='zh'?'当前等级特权':'Current Level Lrivilege'}}</view>
  39. <view class="user-get-grade" @tap="toGetDetails">
  40. <view class="user-get-grade-text">{{$i18n.locale=='zh'?'如何升级':'How To Upgrade'}}</view>
  41. <view class="little-thing">></view>
  42. </view>
  43. </view>
  44. <view class="user-privilege-info" v-if="$i18n.locale=='zh'">
  45. <view class="height-color">
  46. <view>
  47. <image src="@/static/userGrade123/userRights_01.png" class="privilege-pic" />
  48. </view>
  49. </view>
  50. <view class="height-color">
  51. <view>
  52. <image src="@/static/userGrade123/userRights_02.png" class="privilege-pic" />
  53. </view>
  54. </view>
  55. <view class="height-color">
  56. <view>
  57. <image src="@/static/userGrade123/userRights_03.png" class="privilege-pic" />
  58. </view>
  59. </view>
  60. </view>
  61. <view class="user-privilege-info" v-if="$i18n.locale=='zh'">
  62. <view class="privilege-detail" v-show="showMsg">
  63. <view>
  64. <image src="@/static/userGrade123/first2.png" class="privilege-pic" />
  65. </view>
  66. </view>
  67. <view class="height-color" v-show="!showMsg">
  68. <view>
  69. <image src="@/static/userGrade123/userRights_04.png" class="privilege-pic" />
  70. </view>
  71. </view>
  72. <view class="privilege-detail" v-show="showMsg">
  73. <view>
  74. <image src="@/static/userGrade123/first1.png" class="privilege-pic" />
  75. </view>
  76. </view>
  77. <view class="height-color" v-show="!showMsg">
  78. <view>
  79. <image src="@/static/userGrade123/userRights_05.png" class="privilege-pic" />
  80. </view>
  81. </view>
  82. <view class="privilege-detail" v-show="showMsg">
  83. <view>
  84. <image src="@/static/userGrade123/first3.png" class="privilege-pic" />
  85. </view>
  86. </view>
  87. <view class="height-color" v-show="!showMsg">
  88. <view>
  89. <image src="@/static/userGrade123/userRights_06.png" class="privilege-pic" />
  90. </view>
  91. </view>
  92. </view>
  93. <view class="user-privilege-info" v-if="$i18n.locale=='zh'">
  94. <view class="privilege-detail" v-if="seeMsg">
  95. <view>
  96. <image src="@/static/userGrade123/userRights_07_disabled.png" class="privilege-pic" />
  97. </view>
  98. </view>
  99. <view class="height-color" v-if="!seeMsg">
  100. <view>
  101. <image src="@/static/userGrade123/userRights_07.png" class="privilege-pic" />
  102. </view>
  103. </view>
  104. <view class="privilege-detail" v-if="seeMsg">
  105. <view>
  106. <image src="@/static/userGrade123/userRights_08_disabled.png" class="privilege-pic" />
  107. </view>
  108. </view>
  109. <view class="height-color" v-if="!seeMsg">
  110. <view>
  111. <image src="@/static/userGrade123/userRights_08.png" class="privilege-pic" />
  112. </view>
  113. </view>
  114. <view class="privilege-detail" v-if="seeMsg">
  115. <view>
  116. <image src="@/static/userGrade123/userRights_09_disabled.png" class="privilege-pic" />
  117. </view>
  118. </view>
  119. <view class="height-color" v-if="!seeMsg">
  120. <view>
  121. <image src="@/static/userGrade123/userRights_09.png" class="privilege-pic" />
  122. </view>
  123. </view>
  124. </view>
  125. <view class="user-privilege-info" v-if="$i18n.locale=='zh'">
  126. <view class="privilege-detail" v-if="seeMsg">
  127. <view>
  128. <image src="@/static/userGrade123/userRights_10_disabled.png" class="privilege-pic" />
  129. </view>
  130. </view>
  131. <view class="height-color" v-if="!seeMsg">
  132. <view>
  133. <image src="@/static/userGrade123/userRights_10.png" class="privilege-pic" />
  134. </view>
  135. </view>
  136. <view class="privilege-detail big-detail">
  137. <view>
  138. <image src="@/static/picEn456/all321.png" class="privilege-pic" />
  139. </view>
  140. </view>
  141. </view>
  142. <view class="user-privilege-info" v-if="$i18n.locale!='zh'">
  143. <view class="height-color">
  144. <view>
  145. <image src="@/static/picEn456/picEn_07_1.png" class="privilege-pic" />
  146. </view>
  147. </view>
  148. <view class="height-color">
  149. <view>
  150. <image src="@/static/picEn456/picEn_02_1.png" class="privilege-pic" />
  151. </view>
  152. </view>
  153. <view class="height-color">
  154. <view>
  155. <image src="@/static/picEn456/picEn_05_1.png" class="privilege-pic" />
  156. </view>
  157. </view>
  158. </view>
  159. <view class="user-privilege-info" v-if="$i18n.locale!='zh'">
  160. <view class="privilege-detail" v-show="showMsg">
  161. <view>
  162. <image src="@/static/picEn456/picEn_09.png" class="privilege-pic" />
  163. </view>
  164. </view>
  165. <view class="height-color" v-show="!showMsg">
  166. <view>
  167. <image src="@/static/picEn456/picEn_09_1.png" class="privilege-pic" />
  168. </view>
  169. </view>
  170. <view class="privilege-detail" v-show="showMsg">
  171. <view>
  172. <image src="@/static/picEn456/picEn_06.png" class="privilege-pic" />
  173. </view>
  174. </view>
  175. <view class="height-color" v-show="!showMsg">
  176. <view>
  177. <image src="@/static/picEn456/picEn_06_1.png" class="privilege-pic" />
  178. </view>
  179. </view>
  180. <view class="privilege-detail" v-show="showMsg">
  181. <view>
  182. <image src="@/static/picEn456/picEn_10.png" class="privilege-pic" />
  183. </view>
  184. </view>
  185. <view class="height-color" v-show="!showMsg">
  186. <view>
  187. <image src="@/static/picEn456/picEn_10_1.png" class="privilege-pic" />
  188. </view>
  189. </view>
  190. </view>
  191. <view class="user-privilege-info" v-if="$i18n.locale!='zh'">
  192. <view class="privilege-detail" v-if="seeMsg">
  193. <view>
  194. <image src="@/static/picEn456/picEn_01.png" class="privilege-pic" />
  195. </view>
  196. </view>
  197. <view class="height-color" v-if="!seeMsg">
  198. <view>
  199. <image src="@/static/picEn456/picEn_01_1.png" class="privilege-pic" />
  200. </view>
  201. </view>
  202. <view class="privilege-detail" v-if="seeMsg">
  203. <view>
  204. <image src="@/static/picEn456/picEn_08.png" class="privilege-pic" />
  205. </view>
  206. </view>
  207. <view class="height-color" v-if="!seeMsg">
  208. <view>
  209. <image src="@/static/picEn456/picEn_08_1.png" class="privilege-pic" />
  210. </view>
  211. </view>
  212. <view class="privilege-detail" v-if="seeMsg">
  213. <view>
  214. <image src="@/static/picEn456/picEn_04.png" class="privilege-pic" />
  215. </view>
  216. </view>
  217. <view class="height-color" v-if="!seeMsg">
  218. <view>
  219. <image src="@/static/picEn456/picEn_04_1.png" class="privilege-pic" />
  220. </view>
  221. </view>
  222. </view>
  223. <view class="user-privilege-info" v-if="$i18n.locale!='zh'">
  224. <view class="privilege-detail" v-if="seeMsg">
  225. <view>
  226. <image src="@/static/picEn456/picEn_03.png" class="privilege-pic" />
  227. </view>
  228. </view>
  229. <view class="height-color" v-if="!seeMsg">
  230. <view>
  231. <image src="@/static/picEn456/picEn_03_1.png" class="privilege-pic" />
  232. </view>
  233. </view>
  234. <view class="privilege-detail big-detail">
  235. <view>
  236. <image src="@/static/picEn456/picEn_11.png" class="privilege-pic" />
  237. </view>
  238. </view>
  239. </view>
  240. </view>
  241. </view>
  242. </view>
  243. </template>
  244. <script>
  245. export default {
  246. data() {
  247. props: [this.form]
  248. return {
  249. background: {
  250. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  251. },
  252. backStyle: {
  253. color: '#FFFFFF',
  254. },
  255. showMsg: true,
  256. seeMsg: true,
  257. picDetail: {},
  258. userInfos: {},
  259. growNum: Number,
  260. };
  261. },
  262. onShow() {
  263. this.getNum();
  264. },
  265. methods: {
  266. i18n(data) {
  267. return this.$t('common.' + data);
  268. },
  269. // toGetGrow() {
  270. // uni.navigateTo({
  271. // url: 'growList'
  272. // })
  273. // },
  274. toGetDetails() {
  275. uni.navigateTo({
  276. url: './gradeDetails'
  277. })
  278. },
  279. toList() {
  280. uni.navigateTo({
  281. url: './integrateConversion'
  282. })
  283. },
  284. async getNum() {
  285. await this.getUserInfo();
  286. let num = this.userInfos.growthValue;
  287. console.log(num);
  288. if (num >= 6000) {
  289. num = Number(999999);
  290. this.showMsg = false;
  291. this.seeMsg = false;
  292. } else if (num >= 3000) {
  293. num = Number(6000) - Number(num);
  294. this.showMsg = false;
  295. this.seeMsg = false;
  296. } else if (num >= 1000) {
  297. num = Number(3000) - Number(num);
  298. this.showMsg = false;
  299. this.seeMsg = true;
  300. } else if (num > 0) {
  301. num = Number(1000) - Number(num);
  302. this.showMsg = true;
  303. this.seeMsg = true;
  304. } else if (num == null) {
  305. num = 1000;
  306. this.showMsg = true;
  307. this.seeMsg = true;
  308. }
  309. this.growNum = num;
  310. },
  311. async getUserInfo() {
  312. const res = await this.$myRequest({
  313. url: '/uc/userCenter/findBasicInfo',
  314. data: {},
  315. });
  316. this.picDetail = res.data
  317. await this.getUserDetails();
  318. },
  319. // 获取登录用户的信息
  320. async getUserDetails() {
  321. const res = await this.$myRequest({
  322. url: '/uc/umsUserPoints/getUserPoint',
  323. data: {
  324. }
  325. });
  326. // console.log(res);
  327. this.userInfos = res.data.umsUserPoints[0]
  328. if (this.userInfos.levelName == '白银用户') {
  329. if (this.$i18n.locale == 'zh') {
  330. this.userInfos.levelName = '白银用户'
  331. } else {
  332. this.userInfos.levelName = 'Silver User'
  333. }
  334. } else if (this.userInfos.levelName == '黄金用户') {
  335. if (this.$i18n.locale == 'zh') {
  336. this.userInfos.levelName = '黄金用户'
  337. } else {
  338. this.userInfos.levelName = 'Gold User'
  339. }
  340. } else if (this.userInfos.levelName == '铂金用户') {
  341. if (this.$i18n.locale == 'zh') {
  342. this.userInfos.levelName = '铂金用户'
  343. } else {
  344. this.userInfos.levelName = 'Platinum User'
  345. }
  346. } else {
  347. if (this.$i18n.locale == 'zh') {
  348. this.userInfos.levelName = '星钻用户'
  349. } else {
  350. this.userInfos.levelName = 'Star User'
  351. }
  352. }
  353. },
  354. }
  355. }
  356. </script>
  357. <style lang="scss" scoped>
  358. .content {
  359. width: 100%;
  360. height: 100%;
  361. // background-color: #f5f5f5;
  362. .user-info {
  363. display: flex;
  364. justify-content: space-around;
  365. background-image: url('/static/bgc-user.png');
  366. background-size: 100%;
  367. height: 200rpx;
  368. position: relative;
  369. .user-pic {
  370. width: 20%;
  371. height: 73%;
  372. margin-top: 4%;
  373. margin-left: 4%;
  374. border-radius: 50%;
  375. background-color: #e9e9e9;
  376. overflow: hidden;
  377. .ui-pic-detail {
  378. width: 100%;
  379. height: 100%;
  380. }
  381. .user-grade-now {
  382. font-size: 20rpx;
  383. width: 25%;
  384. text-align: center;
  385. transform: translateY(410%);
  386. border-radius: 50rpx;
  387. background-color: #DFAC74FF;
  388. z-index: 999;
  389. position: absolute;
  390. left: 2%;
  391. top: 30rpx;
  392. }
  393. }
  394. .integrate-now {
  395. width: 50%;
  396. margin-left: 2%;
  397. .user-name {
  398. margin-top: 11%;
  399. font-size: 32rpx;
  400. }
  401. .user-grow {
  402. margin-top: 1%;
  403. margin-bottom: 2%;
  404. }
  405. .next-grade {
  406. font-size: 20rpx;
  407. }
  408. }
  409. .get-integrate {
  410. width: 27%;
  411. height: 25%;
  412. line-height: 25%;
  413. transform: translateX(35%) translateY(160%);
  414. background-color: #e8cb50;
  415. border: none;
  416. .get-integrate-info {
  417. font-size: 28rpx;
  418. color: #fff;
  419. transform: translateX(-37%);
  420. }
  421. }
  422. }
  423. .user-style1 {
  424. width: 96%;
  425. background-color: #fff;
  426. height: 80px;
  427. margin-top: 15px;
  428. margin-left: 2%;
  429. border-radius: 8px;
  430. .top-pic {
  431. width: 96%;
  432. height: 70px;
  433. margin-left: 2%;
  434. margin-top: 5px;
  435. }
  436. }
  437. .user-style2 {
  438. width: 96%;
  439. background-color: #fff;
  440. height: 80px;
  441. margin-top: 15px;
  442. margin-left: 2%;
  443. border-radius: 8px;
  444. .top-pic {
  445. width: 96%;
  446. height: 70px;
  447. margin-left: 2%;
  448. margin-top: 5px;
  449. }
  450. }
  451. .user-privilege {
  452. width: 100%;
  453. background-color: #fff;
  454. margin-top: 3%;
  455. .privilege-now {
  456. width: 92%;
  457. margin-left: 4%;
  458. display: flex;
  459. justify-content: space-between;
  460. .user-now-grade {
  461. width: 50%;
  462. height: 80rpx;
  463. line-height: 80rpx;
  464. font-size: 30rpx;
  465. font-weight: 700;
  466. margin-bottom: 6%;
  467. }
  468. .user-get-grade {
  469. width: 50%;
  470. height: 40rpx;
  471. margin-top: 6%;
  472. margin-bottom: 4%;
  473. display: flex;
  474. justify-content: space-evenly;
  475. .user-get-grade-text {
  476. width: 93%;
  477. font-size: 12px;
  478. height: 40rpx;
  479. text-align: right;
  480. line-height: 40rpx;
  481. color: #6bbfe8;
  482. font-weight: 700;
  483. }
  484. .little-thing {
  485. width: 7%;
  486. font-size: 15px;
  487. height: 40rpx;
  488. line-height: 40rpx;
  489. color: #000;
  490. }
  491. }
  492. }
  493. .user-privilege-info {
  494. width: 92%;
  495. margin-left: 4%;
  496. display: flex;
  497. justify-content: space-between;
  498. .privilege-detail {
  499. width: 32%;
  500. height: 160rpx;
  501. margin-bottom: 3%;
  502. border-radius: 20rpx;
  503. border: 1px solid #a8a8a8;
  504. overflow: hidden;
  505. .privilege-pic {
  506. background-color: #e1e1e2;
  507. width: 100%;
  508. height: 160rpx;
  509. }
  510. }
  511. .height-color {
  512. width: 32%;
  513. height: 160rpx;
  514. margin-bottom: 3%;
  515. border-radius: 20rpx;
  516. border: 1px solid #a8a8a8;
  517. overflow: hidden;
  518. .privilege-pic {
  519. background-color: #7fcd39;
  520. width: 100%;
  521. height: 160rpx;
  522. }
  523. }
  524. .big-detail {
  525. width: 66%;
  526. border-radius: 20rpx;
  527. border: 1px solid #a8a8a8;
  528. overflow: hidden;
  529. }
  530. }
  531. }
  532. }
  533. </style>