Mine.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. <template>
  2. <van-pull-refresh
  3. success-text="加载成功"
  4. success-duration="500"
  5. class="mine"
  6. v-model="isLoading"
  7. @refresh="onRefresh"
  8. >
  9. <div class="userInfo" v-if="isLogin">
  10. <!-- <van-image
  11. width="100%"
  12. height="52vw"
  13. :src="userInfo.bg ? userInfo.bg + '?r=' + refreshFlag : require('@assets/creatorBg.png')"
  14. loading-icon=""
  15. fit="cover"
  16. class="top-img"
  17. /> -->
  18. <!-- <template v-if="publishShow">
  19. <div class="yinsi" v-if="userInfo.isPublicShow" @click="changeShow(false)">
  20. <img src="@assets/icon-kaiqiyinsi.png" alt="" />
  21. <span>开启隐私</span>
  22. </div>
  23. <div class="yinsi not" v-else @click="changeShow(true)">
  24. <img src="@assets/icon-guanbiyinsi.png" alt="" />
  25. <span>关闭隐私</span>
  26. </div>
  27. </template> -->
  28. <!-- <div class="edit-btn" @click="$router.push('/setting')">
  29. <img src="../assets/icon-bianji1.png" alt="" />
  30. <span>编辑</span>
  31. </div> -->
  32. <div class="userInfo-content">
  33. <div class="userInfo-top" @click="$router.push('/' + $route.params.companyId + '/setting')">
  34. <van-image
  35. radius="100"
  36. width="84"
  37. height="84"
  38. :src="
  39. userInfo.avatar
  40. ? userInfo.avatar + '?r=' + refreshFlag
  41. : require('@assets/img_default_photo.png')
  42. "
  43. fit="cover"
  44. :class="{ activeAvatar: isLogin && userInfo.useCollectionPic }"
  45. />
  46. <div class="text">
  47. <div class="text1">
  48. <span class="van-ellipsis" style="max-width: 120px">{{ userInfo.nickname }}</span>
  49. </div>
  50. <div class="text2">
  51. <span> 用户ID:{{ userInfo.id }} </span>
  52. <img @click.stop="copy" src="@assets/svgs/copy_icon.svg" alt="" />
  53. </div>
  54. <div class="icons" @click.stop="goAuth">
  55. <div class="auth-imgs" v-if="authStatus !== '已认证'">
  56. <img src="../assets/renzheng_icon.png" alt="" />
  57. <span>未实名认证</span>
  58. </div>
  59. <div class="auth-imgs authed" @click="goAuth" v-else>
  60. <img src="../assets/yirenzhng-geren-icon.png" alt="" />
  61. <span>个人已认证</span>
  62. </div>
  63. <level ref="level" @showOverlay="showOverlay"></level>
  64. </div>
  65. </div>
  66. <img class="inter" src="@assets/icon_inter.png" alt="" />
  67. </div>
  68. <!-- <div class="sub" :class="{ 'van-multi-ellipsis--l2': !showMore }">
  69. {{ userInfo.intro }}
  70. </div>
  71. <div class="sub-right" v-if="userInfo && userInfo.intro && userInfo.intro.length > 50">
  72. <img
  73. @click="showMore = !showMore"
  74. :class="{ subAll: showMore }"
  75. src="../assets/icon-xialajiantou.png"
  76. alt=""
  77. />
  78. </div> -->
  79. <div class="btns">
  80. <div class="collect" @click="$router.push('/' + $route.params.companyId + '/store')">
  81. <div class="text1">{{ assetNum }}</div>
  82. <div class="text2">藏品:</div>
  83. </div>
  84. <div class="collect" @click="$router.push('/' + $route.params.companyId + '/mineFollowers')">
  85. <div class="text1">{{ userInfo.followers }}</div>
  86. <div class="text2">粉丝:</div>
  87. </div>
  88. <div class="collect" @click="$router.push('/' + $route.params.companyId + '/mineFollows')">
  89. <div class="text1">{{ userInfo.follows }}</div>
  90. <div class="text2">关注:</div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="userInfo" v-else>
  96. <div class="userInfo-content">
  97. <div class="userInfo-top" @click="$router.push('/' + $route.params.companyId + '/login')">
  98. <van-image
  99. round
  100. width="84"
  101. height="84"
  102. :src="require('@assets/img_default_photo.png')"
  103. fit="cover"
  104. />
  105. <div class="text">
  106. <div class="text1">点击登录</div>
  107. <div class="text2" style="padding-bottom: 16px">立即登录获取精彩服务</div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="orderList">
  113. <div class="order-info" @click="$router.push('/' + $route.params.companyId + '/orders?type=DEFAULT')">
  114. <img src="@assets/info_icon_yishuping.png" alt="" />
  115. <span>我的订单</span>
  116. </div>
  117. <div class="order-info" @click="$router.push('/' + $route.params.companyId + '/mineWallet')">
  118. <img src="@assets/icon_qianbao.png" alt="" />
  119. <span>我的钱包</span>
  120. </div>
  121. <div class="order-info" @click="wait">
  122. <img src="@assets/icon-jifen.png" alt="" />
  123. <span>我的积分</span>
  124. </div>
  125. </div>
  126. <van-cell-group class="menus" :border="false">
  127. <van-cell title="我喜欢的" :to="{ path: '/' + $route.params.companyId + '/mineLikes' }" is-link>
  128. <template #icon>
  129. <van-icon :name="require('@assets/icon-woxihuande.png')" class="search-icon" />
  130. </template>
  131. </van-cell>
  132. <van-cell
  133. title="交易历史"
  134. :to="{ path: '/' + $route.params.companyId + '/mineExchange' }"
  135. v-if="!$store.state.review"
  136. is-link
  137. >
  138. <template #icon>
  139. <van-icon :name="require('@assets/info_icon_jiaoyijilu.png')" class="search-icon" />
  140. </template>
  141. </van-cell>
  142. <!-- <van-cell
  143. title="客服留言"
  144. :to="{ path: '/' + $route.params.companyId + '/message' }"
  145. v-if="!$store.state.review"
  146. is-link
  147. >
  148. <template #icon>
  149. <van-icon :name="require('@assets/icon_kefuliuyan.png')" class="search-icon" />
  150. </template>
  151. </van-cell> -->
  152. <van-cell title="账号与安全" :to="{ path: '/' + $route.params.companyId + '/security' }" is-link>
  153. <template #icon>
  154. <van-icon :name="require('@assets/icon-anquan.png')" class="search-icon" />
  155. </template>
  156. </van-cell>
  157. <van-cell title="关于我们" :border="false" :to="{ path: '/' + $route.params.companyId + '/about' }" is-link>
  158. <template #icon>
  159. <van-icon :name="require('@assets/icon-guanyuwomen.png')" class="search-icon" />
  160. </template>
  161. </van-cell>
  162. </van-cell-group>
  163. <div class="tabbar-placeholder"></div>
  164. <level-overly ref="overly"></level-overly>
  165. </van-pull-refresh>
  166. </template>
  167. <script>
  168. import { mapState } from 'vuex';
  169. import Level from '../components/level/Level.vue';
  170. import LevelOverly from '../components/level/LevelOverly.vue';
  171. export default {
  172. data() {
  173. return {
  174. org: false,
  175. showMore: false,
  176. assetNum: 0,
  177. shareProduct: {
  178. openQuota: false
  179. },
  180. shareMoney: 0,
  181. refreshFlag: Number(localStorage.getItem('refreshFlag') || '0'),
  182. enableWallet: false,
  183. faceAuth: false,
  184. publishShow: false
  185. };
  186. },
  187. components: { Level, LevelOverly },
  188. computed: {
  189. ...mapState(['userInfo', 'companyId'])
  190. },
  191. created() {
  192. this.getInit();
  193. },
  194. methods: {
  195. showOverlay(show) {
  196. this.$refs.overly.show = show;
  197. },
  198. getInit(refresh) {
  199. if (this.isLogin) {
  200. this.$http
  201. .post(
  202. '/asset/all',
  203. {
  204. query: {
  205. page: 0,
  206. size: 1,
  207. userId: this.$store.state.userInfo.id,
  208. status: 'NORMAL,TRADING,GIFTING,MINTING',
  209. companyId: this.companyId
  210. }
  211. },
  212. { body: 'json' }
  213. )
  214. .then(res => {
  215. this.assetNum = Number(res.totalElements);
  216. });
  217. }
  218. if (window.cordova && StatusBar && StatusBar.isVisible) {
  219. StatusBar.styleLightContent();
  220. }
  221. return this.$store.dispatch('getUserInfo', refresh);
  222. },
  223. copy() {
  224. this.$copyText(this.userInfo.id).then(
  225. e => {
  226. this.$toast.success('复制成功');
  227. console.log(e);
  228. },
  229. e => {
  230. this.$toast('复制失败');
  231. console.log(e);
  232. }
  233. );
  234. },
  235. goAuth() {
  236. if (this.authStatus === '认证中' || this.authStatus === '认证失败') {
  237. this.$router.push('/' + this.$route.params.companyId + '/waiting');
  238. } else if (this.authStatus === '未认证') {
  239. this.$router.push('/' + this.$route.params.companyId + '/faceAuth');
  240. // if (this.faceAuth) {
  241. // this.$router.push('/' + this.$route.params.companyId + '/faceAuth');
  242. // } else {
  243. // this.$router.push('/' + this.$route.params.companyId + '/verified');
  244. // }
  245. }
  246. },
  247. getProduct() {
  248. return this.$http
  249. .get('/sysConfig/get/share_collection_id')
  250. .then(res => {
  251. if (res.value) {
  252. return this.$http.get('collection/get/' + res.value);
  253. } else {
  254. return Promise.reject('活动未开始');
  255. }
  256. })
  257. .catch(e => {
  258. return Promise.reject('活动未开始');
  259. })
  260. .then(res => {
  261. this.shareProduct = res;
  262. return Promise.resolve();
  263. });
  264. },
  265. onRefresh() {
  266. this.refreshFlag++;
  267. localStorage.setItem('refreshFlag', this.refreshFlag);
  268. return this.getInit(true)
  269. .then(() => {
  270. this.isLoading = false;
  271. })
  272. .catch(() => {
  273. this.isLoading = false;
  274. });
  275. },
  276. changeShow(isPublicShow) {
  277. this.$dialog
  278. .confirm({
  279. title: isPublicShow ? '关闭隐私' : '开启隐私',
  280. message: isPublicShow ? '关闭后,他人将看到你的主页信息' : '开启后,他人将无法查看你的主页信息'
  281. })
  282. .then(() => {
  283. this.updateUser({ isPublicShow: isPublicShow });
  284. });
  285. }
  286. }
  287. };
  288. </script>
  289. <style lang="less" scoped>
  290. .mine {
  291. background-color: #272b2e;
  292. padding-top: 0 !important;
  293. position: relative;
  294. min-height: var(--app-height);
  295. }
  296. .top {
  297. display: flex;
  298. align-items: center;
  299. padding: 36px 16px 30px;
  300. border-bottom: 1px solid @bg2;
  301. position: relative;
  302. .van-image {
  303. border: 5px solid @bg;
  304. }
  305. .text {
  306. margin-left: 12px;
  307. position: relative;
  308. z-index: 2;
  309. .text1 {
  310. font-size: @font3;
  311. font-weight: bold;
  312. color: @text0;
  313. line-height: 24px;
  314. img {
  315. width: 18px;
  316. height: 18px;
  317. display: inline-block;
  318. margin-left: 6px;
  319. }
  320. }
  321. .text2 {
  322. font-size: @font2;
  323. color: #949699;
  324. line-height: 24px;
  325. }
  326. }
  327. .top-bg {
  328. position: absolute;
  329. top: -83px;
  330. left: 0;
  331. right: 0;
  332. width: 100%;
  333. display: block;
  334. height: auto;
  335. z-index: 0;
  336. }
  337. }
  338. /deep/ .title {
  339. padding: 12px 12px 6px;
  340. border-bottom: 1px solid @bg3;
  341. .van-cell__title {
  342. span {
  343. font-size: @font3;
  344. line-height: 28px;
  345. color: @text0;
  346. font-weight: bold;
  347. }
  348. }
  349. .van-cell__value {
  350. span {
  351. font-size: @font1;
  352. line-height: 28px;
  353. }
  354. }
  355. .van-icon {
  356. line-height: 28px;
  357. }
  358. }
  359. .orderList {
  360. .flex();
  361. background: rgba(255, 255, 255, 0.03);
  362. border-radius: 8px;
  363. margin: 0 16px;
  364. // padding: 0 12px;
  365. .order-info {
  366. padding: 16px 0;
  367. position: relative;
  368. width: 33%;
  369. box-sizing: border-box;
  370. .flex-col();
  371. align-items: center;
  372. justify-content: center;
  373. .order-info-box {
  374. .flex();
  375. width: 132px;
  376. }
  377. img {
  378. width: 32px;
  379. height: 32px;
  380. // margin-right: 8px;
  381. }
  382. span {
  383. font-size: 14px;
  384. font-weight: bold;
  385. color: #939599;
  386. line-height: 24px;
  387. margin-top: 2px;
  388. }
  389. }
  390. .order-info + .order-info {
  391. // margin-left: 20px;
  392. &::before {
  393. content: '';
  394. width: 1px;
  395. background-color: #373b3e;
  396. position: absolute;
  397. left: -0.5px;
  398. top: 0;
  399. bottom: 0;
  400. }
  401. }
  402. // /deep/.van-badge__wrapper {
  403. // width: 50%;
  404. // .order-info {
  405. // width: 100%;
  406. // }
  407. // }
  408. &.prim {
  409. span {
  410. font-weight: normal;
  411. color: #43ce00;
  412. font-family: 'ZhenyanGB';
  413. }
  414. }
  415. }
  416. .orderList {
  417. .flex();
  418. // padding: 0 12px;
  419. .menu-info {
  420. padding: 16px 0;
  421. position: relative;
  422. width: 50%;
  423. box-sizing: border-box;
  424. .flex();
  425. justify-content: center;
  426. .menu-info-box {
  427. .flex();
  428. width: 132px;
  429. }
  430. img {
  431. width: 28px;
  432. height: 28px;
  433. margin-right: 8px;
  434. }
  435. span {
  436. font-size: 14px;
  437. font-weight: bold;
  438. color: #ffffff;
  439. line-height: 24px;
  440. }
  441. }
  442. .menu-info + .menu-info {
  443. // margin-left: 20px;
  444. &::before {
  445. content: '';
  446. width: 1px;
  447. background-color: #373b3e;
  448. position: absolute;
  449. left: -0.5px;
  450. top: 0;
  451. bottom: 0;
  452. }
  453. }
  454. // /deep/.van-badge__wrapper {
  455. // width: 50%;
  456. // .order-info {
  457. // width: 100%;
  458. // }
  459. // }
  460. &.prim {
  461. span {
  462. font-weight: normal;
  463. color: #43ce00;
  464. font-family: 'ZhenyanGB';
  465. }
  466. }
  467. }
  468. .grid-img {
  469. display: block;
  470. }
  471. .driver {
  472. background-color: #373b3e;
  473. }
  474. /deep/ .van-grid-item {
  475. .van-grid-item__text {
  476. font-size: @font1;
  477. color: @text0;
  478. line-height: 18px;
  479. margin-top: 4px;
  480. white-space: nowrap;
  481. }
  482. .van-grid-item__content {
  483. padding: 4.2vw 2.1vw;
  484. }
  485. }
  486. /deep/.menu {
  487. .van-cell {
  488. padding: 22px 20px 24px;
  489. &::after {
  490. left: 52px;
  491. right: 16px;
  492. }
  493. }
  494. .van-cell__title {
  495. span {
  496. font-weight: bold;
  497. }
  498. }
  499. }
  500. .search-icon {
  501. width: 28px;
  502. height: 28px;
  503. margin-right: 13px;
  504. display: block;
  505. /deep/.van-icon__image {
  506. width: 28px;
  507. height: 28px;
  508. display: block;
  509. }
  510. }
  511. .userInfo {
  512. // padding-top: 52vw;
  513. // border-bottom: 1px solid @bg2;
  514. position: relative;
  515. // margin-bottom: -103px;
  516. .top-img {
  517. position: absolute;
  518. top: 0;
  519. left: 0;
  520. z-index: 1;
  521. &::after {
  522. content: '';
  523. position: absolute;
  524. left: 0;
  525. bottom: 0;
  526. height: 90px;
  527. right: 0;
  528. z-index: 1;
  529. background: linear-gradient(180deg, rgba(39, 43, 46, 0) 0%, #272b2e 100%);
  530. }
  531. }
  532. }
  533. .userInfo-content {
  534. padding: 0 16px;
  535. z-index: 2;
  536. position: relative;
  537. .sub {
  538. font-size: 12px;
  539. color: @text3;
  540. line-height: 17px;
  541. padding: 2px 0 0;
  542. text-align: center;
  543. }
  544. .sub-right {
  545. .flex();
  546. margin-top: 4px;
  547. justify-content: center;
  548. img {
  549. width: 18px;
  550. height: 18px;
  551. display: block;
  552. transition: transform ease-in-out 0.3s;
  553. &.subAll {
  554. transform: rotate(180deg);
  555. }
  556. }
  557. }
  558. .sub-right > div {
  559. font-size: 12px;
  560. color: @text0;
  561. line-height: 17px;
  562. text-decoration: underline;
  563. }
  564. .btns {
  565. display: flex;
  566. // padding-bottom: 16px;
  567. align-items: center;
  568. border-top: 1px solid rgba(255, 255, 255, 0.06);
  569. .collect {
  570. width: 33%;
  571. .flex();
  572. flex-direction: row-reverse;
  573. justify-content: center;
  574. padding: 12px 0;
  575. .text1 {
  576. font-size: 14px;
  577. color: #939599;
  578. line-height: 24px;
  579. }
  580. .text2 {
  581. font-size: 14px;
  582. color: #939599;
  583. line-height: 24px;
  584. }
  585. }
  586. }
  587. }
  588. .userInfo-top {
  589. display: flex;
  590. align-items: center;
  591. transform: translateX(-5px);
  592. position: relative;
  593. padding: 20px 0 16px;
  594. .van-image {
  595. // border: 5px solid @bg;
  596. flex-shrink: 0;
  597. border-radius: 100px;
  598. }
  599. .text {
  600. margin: 0 10px 0 12px;
  601. overflow: hidden;
  602. display: flex;
  603. flex-direction: column;
  604. align-items: flex-start;
  605. flex-grow: 1;
  606. .text1 {
  607. font-size: 24px;
  608. font-weight: bold;
  609. color: @bg;
  610. line-height: 24px;
  611. margin-top: 15px;
  612. .flex();
  613. // img {
  614. // width: 18px;
  615. // height: 18px;
  616. // display: inline-block;
  617. // // margin-left: 5px;
  618. // vertical-align: middle;
  619. // }
  620. }
  621. .text2 {
  622. font-size: 12px;
  623. color: #949699;
  624. line-height: 24px;
  625. display: flex;
  626. align-items: center;
  627. margin-top: 3px;
  628. img {
  629. display: block;
  630. margin-left: 6px;
  631. }
  632. }
  633. .icons {
  634. .flex();
  635. transform: translateX(-16px);
  636. .auth-imgs {
  637. .flex();
  638. transform: translateX(15px);
  639. img {
  640. width: 28px;
  641. height: 28px;
  642. position: relative;
  643. z-index: 1;
  644. }
  645. span {
  646. font-size: 12px;
  647. color: @text3;
  648. line-height: 18px;
  649. background: #373b3e;
  650. border-radius: 2px;
  651. padding: 0 4px 0 10px;
  652. transform: scale(0.8) translateX(-24px);
  653. position: relative;
  654. z-index: 0;
  655. }
  656. &.authed {
  657. span {
  658. color: #ff8f3e;
  659. background-color: #ffefe8;
  660. position: relative;
  661. }
  662. }
  663. }
  664. }
  665. }
  666. .inter {
  667. width: 24px;
  668. height: 24px;
  669. }
  670. .renzhen-img {
  671. position: absolute;
  672. left: 60px;
  673. bottom: 5px;
  674. width: 20px;
  675. height: 20px;
  676. }
  677. }
  678. .menus {
  679. margin: 16px;
  680. background: rgba(255, 255, 255, 0.03);
  681. border-radius: 8px;
  682. /deep/ .van-cell {
  683. padding: 14px 16px;
  684. .van-cell__title {
  685. font-size: 14px;
  686. color: #ffffff;
  687. line-height: 28px;
  688. }
  689. &::after {
  690. border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  691. left: 16px;
  692. right: 16px;
  693. }
  694. .van-cell__right-icon {
  695. line-height: 28px;
  696. }
  697. }
  698. }
  699. /deep/.auth {
  700. color: @text3!important;
  701. padding: 0 10px;
  702. margin-left: 6px;
  703. .van-button__content {
  704. .flex();
  705. .van-icon__image {
  706. display: block;
  707. }
  708. font-weight: normal;
  709. }
  710. height: 24px;
  711. }
  712. .edit {
  713. color: @text3;
  714. }
  715. .card {
  716. box-shadow: 0px 2px 6px 0px rgba(200, 201, 204, 0.3);
  717. border-radius: 12px;
  718. margin: 16px;
  719. }
  720. .edit-btn {
  721. position: absolute;
  722. right: 16px;
  723. top: 16px;
  724. top: calc(var(--safe-top) + 16px);
  725. .flex();
  726. z-index: 20;
  727. img {
  728. width: 18px;
  729. height: 18px;
  730. }
  731. span {
  732. font-size: 12px;
  733. color: #ffffff;
  734. line-height: 12px;
  735. margin-left: 4px;
  736. }
  737. width: 72px;
  738. height: 24px;
  739. background: #272b2e;
  740. border-radius: 4px;
  741. justify-content: center;
  742. }
  743. .yinsi {
  744. position: absolute;
  745. background: #3ab200;
  746. border-radius: 4px;
  747. top: calc(var(--safe-top) + 16px);
  748. left: 16px;
  749. z-index: 3;
  750. padding: 0 11px;
  751. height: 24px;
  752. .flex();
  753. img {
  754. width: 18px;
  755. height: 18px;
  756. }
  757. span {
  758. font-size: 12px;
  759. color: #ffffff;
  760. line-height: 24px;
  761. margin-left: 3px;
  762. }
  763. &.not {
  764. background: #ff4f50;
  765. }
  766. }
  767. </style>