index.nvue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. <template>
  2. <view class="userPage">
  3. <view class="top-bg">
  4. <view class="top2-bg">
  5. <view class="top3-bg">
  6. </view>
  7. </view>
  8. </view>
  9. <view class="contentBox">
  10. <view class="top-view">
  11. <view class="top-inner">
  12. <view class="statusBar" :style="'height:' + statusBarHeight + 'px'"></view>
  13. <view class="top-h45"></view>
  14. <view class="user" v-if="user != null">
  15. <view class="avatar">
  16. <image class='avatarImage' :src=" user.avatar || '/static/img/user-avatar2.png'" mode="aspectFill"></image>
  17. </view>
  18. <text class="nickname">{{ user.nickname }}</text>
  19. <view class="iname">
  20. <text class="id-name">ID:{{ user.number_code }}</text>
  21. </view>
  22. <view class="level" v-if="isNewShow">
  23. <text class="name">{{ user.mentor_name }}</text>
  24. </view>
  25. <view class="newPeople" v-if="isNewShow">
  26. <text v-if="user.regtime == 0">到期时间:永久</text>
  27. <view v-if="user.regtime > 0" class="">
  28. <text>到期时间</text>:<u-count-down :time="timeValues" format="DD:HH:mm:ss"></u-count-down>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="user" @tap="tapLogin" v-else>
  33. <view class="avatar">
  34. <image class='avatarImage' src="/static/img/user-avatar2.png" mode="aspectFill"></image>
  35. </view>
  36. <text class="nickname">点击登录</text>
  37. </view>
  38. <!--收益情况-->
  39. <view class="earnings" v-if="sysData.is_audit == 0">
  40. <view class="item">
  41. <view class="itemLeftBox">
  42. <text class="name">我的收益</text>
  43. <text class="count">{{ user != null ? (user.total_earnings||'0.00') : 0 }}</text>
  44. </view>
  45. <image class="rightImageIcon" src="/static/img/userinfo1.png" mode="scaleToFill"></image>
  46. </view>
  47. <view class="line"></view>
  48. <view class="item" @tap="tapOpen" data-url="/pages/user/detail/integral">
  49. <view class="itemLeftBox">
  50. <text class="name">我的趣豆</text>
  51. <text class="count">{{ user != null ? user.integral : 0 }}</text>
  52. </view>
  53. <image class="rightImageIcon" src="/static/img/userinfo2.png" mode="scaleToFill"></image>
  54. </view>
  55. <view class="lineAll"></view>
  56. <view class="item" @tap="tapOpen" data-url="/pages/user/detail/anticipate">
  57. <view class="itemLeftBox">
  58. <text class="name">易趣卷</text>
  59. <text class="count">{{ user != null ? user.anticipate : 0 }}</text>
  60. </view>
  61. <image class="rightImageIcon" src="/static/img/userinfo3.png" mode="scaleToFill"></image>
  62. </view>
  63. <view class="line"></view>
  64. <view class="item" @tap="tapOpen" data-url="/pages/user/detail/detail">
  65. <view class="itemLeftBox">
  66. <text class="name">货款提货积分</text>
  67. <text class="count">{{ user != null ? user.good_integral : 0 }}</text>
  68. </view>
  69. <image class="rightImageIcon" src="/static/img/userinfo4.png" mode="scaleToFill"></image>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!--馆长中心-->
  75. <!-- <view class="gz" v-if="user != null && user.isgz" @tap="tapOpen" data-url="/pages/gz/index"> -->
  76. <view class="gz" @tap="tapOpen" data-url="/pages/gz/index">
  77. <image class="bg" src="/static/img/gz-bg.png"></image>
  78. <view class="inner">
  79. <image class="icon" src="/static/img/gz-zuan.png"></image>
  80. <text class="name">部门总监职能中心</text>
  81. <view class="sbtn">
  82. <text class="sbtnText">点击进入</text>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="body" :class="(user != null && user.isgz) ? 'to-gz' : 'no-gz' ">
  87. <view class="pannel" v-if="sysData.is_audit == 0">
  88. <view class="order-items">
  89. <view class="item" @tap="tapOpen" data-url="/pages/user/qrcode/index"
  90. v-if="sysData.is_audit == 0">
  91. <image class='shareImage' src="/static/img/user-content1.png"></image>
  92. <text class="name">邀请好友</text>
  93. </view>
  94. <view class="item" @tap="tapOpen" data-url="/pages/user/team/vermicelli"
  95. v-if="sysData.is_audit == 0">
  96. <image class='shareImage' src="/static/img/user-content2.png"></image>
  97. <text class="name">我的粉丝</text>
  98. </view>
  99. <view class="item" @tap="tapOpen" data-url="/pages/user/order/index">
  100. <image class='shareImage' src="/static/img/user-content3.png"></image>
  101. <text class="name">提货订单</text>
  102. </view>
  103. <view class="item" @tap="tapOpen" data-url="/pages/guild/order/order"
  104. v-if="sysData.is_audit == 0">
  105. <image class='shareImage' src="/static/img/user-content4.png"></image>
  106. <text class="name">购买订单</text>
  107. </view>
  108. <view class="item" @tap="tapOpen" data-url="/pages/guild/order/myPro">
  109. <image class='shareImage' src="/static/img/user-content5.png"></image>
  110. <text class="name">我的商品</text>
  111. </view>
  112. </view>
  113. </view>
  114. <!--我的商户-->
  115. <view class="pannel mt20" v-if=" user != null && user.m_id > 0">
  116. <view class="mySh">
  117. <text class="items-title">我的商户</text>
  118. <text class="shop-name">{{ user.m_name }}</text>
  119. </view>
  120. <view class="items">
  121. <view class="item" @tap="tapOpen" data-url="/pages/user/detail/brokerage">
  122. <image mode="heightFix" class="itemsImage" src="/static/img/user_earnings.png"></image>
  123. <text class="name">货款记录</text>
  124. </view>
  125. <view class="item" @tap="tapOpen" data-url="/pages/user/address/address">
  126. <image mode="heightFix" class="itemsImage" src="/static/img/user_tx.png"></image>
  127. <text class="name">我要提现</text>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="pannel mt20">
  132. <view class="pannelTopImgBox">
  133. <image class="pannelTopImg" src="/static/img/moreGn.png" mode="scaleToFill"></image>
  134. </view>
  135. <view class="items">
  136. <view class="item" @tap="tapOpen" data-url="/pages/user/bank/bank"
  137. v-if="sysData.is_audit == 0">
  138. <image class="itemsImage" src="/static/img/userico1.png" mode="heightFix"></image>
  139. <text class="name">收款信息</text>
  140. </view>
  141. <view class="item" @tap="tapOpenRz" v-if="sysData.is_audit == 0">
  142. <image class="itemsImage" src="/static/img/userico2.png" mode="heightFix"></image>
  143. <text class="name">实名认证</text>
  144. </view>
  145. <view class="item" @tap="tapOpen" data-url="/pages/user/address/address">
  146. <image class="itemsImage" src="/static/img/userico3.png" mode="heightFix"></image>
  147. <text class="name">收货地址</text>
  148. </view>
  149. <view class="item" @tap="$refs.customer.open()">
  150. <image class="itemsImage" src="/static/img/userico4.png" mode="heightFix"></image>
  151. <text class="name">联系客服</text>
  152. </view>
  153. <view class="item" @tap="tapOpen" data-url="/pages/user/userinfo/index">
  154. <image class="itemsImage" src="/static/img/userico5.png" mode="heightFix"></image>
  155. <text class="name">个人资料</text>
  156. </view>
  157. <view class="item" @tap="tapPayment" v-if="sysData.is_audit == 0">
  158. <image class="itemsImage" src="/static/img/userico6.png" mode="heightFix"></image>
  159. <text class="name">交易密码</text>
  160. </view>
  161. <view class="item" @tap="tapOpen" data-url="/pages/user/userinfo/bindPhone"
  162. v-if="sysData.is_audit == 0">
  163. <image class="itemsImage" src="/static/img/userico7.png" mode="heightFix"></image>
  164. <text class="name">绑定手机</text>
  165. </view>
  166. <view class="item" @tap="tapOpen" data-url="/pages/user/setting/index">
  167. <image class="itemsImage" src="/static/img/userico8.png" mode="heightFix"></image>
  168. <text class="name">设置</text>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <customer-wiget ref="customer"></customer-wiget>
  175. <view class="popwin" v-if="isGg">
  176. <view class="bg"></view>
  177. <view class="body fx-h">
  178. <image src="/static/img/user_vip_bg.png" class="bgimg"></image>
  179. <view class="pop-body">
  180. <text class="inner-top">尊敬的高级合伙人</text>
  181. <text class="inner-tip">您的高级合伙人有效期仅剩</text>
  182. <view class="inner">
  183. <view class="max-he fx-r fx-be fx-ac">
  184. <text class="c">{{ user != null ? user.last_mentor_time : ""}}</text>
  185. <text class="t">天</text>
  186. </view>
  187. <view class="fx-r fx-bc fx-ac foot">
  188. <text class="btn" @tap="isGg = false">我知晓></text>
  189. </view>
  190. </view>
  191. </view>
  192. <view class="m-close fx-h fx-bc">
  193. <image src="/static/img/btn-close.png" @tap="isGg = false" class="icon"></image>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. </template>
  199. <style lang="scss">
  200. .contentBox{
  201. margin-top: -622rpx;
  202. }
  203. .userPage{
  204. width: 750rpx;
  205. // border: 1px solid #000;
  206. background-color: #FEF7F5;
  207. }
  208. .top-bg {
  209. width: 750rpx;
  210. height: 622rpx;
  211. .top2-bg {
  212. width: 750rpx;
  213. height: 622rpx;
  214. background-image: linear-gradient(to right, #FEA9C8, #FFA18E);
  215. .top3-bg {
  216. width: 750rpx;
  217. height: 622rpx;
  218. background-image: linear-gradient(to bottom,rgba(255, 255, 255, 0), #FEF7F5);
  219. }
  220. }
  221. }
  222. .newPeople {
  223. font-size: 12px;
  224. color: #999;
  225. padding-top: 15rpx;
  226. }
  227. .top-view {
  228. width: 750rpx;
  229. .top-inner {
  230. z-index: 1;
  231. .top-h45 {
  232. height: 45rpx;
  233. }
  234. .user {
  235. justify-content: center;
  236. align-items: center;
  237. }
  238. .avatar {
  239. width: 130rpx;
  240. height: 130rpx;
  241. background: #efa69b;
  242. border-radius: 50%;
  243. .avatarImage {
  244. width: 120rpx;
  245. height: 120rpx;
  246. border-radius: 50%;
  247. margin-left: 5rpx;
  248. margin-top: 5rpx;
  249. }
  250. }
  251. .nickname {
  252. margin-top: 20rpx;
  253. color: #000;
  254. font-size: 34rpx;
  255. font-weight: bold;
  256. }
  257. .iname {
  258. margin-top: 12rpx;
  259. .id-name {
  260. font-size: 30rpx;
  261. color: #666666;
  262. }
  263. }
  264. .level {
  265. margin-top: 20rpx;
  266. background-image: linear-gradient(to right, #f9ecc5 0%, #d6ba63 100%);
  267. border-radius: 60rpx;
  268. padding: 0 36rpx;
  269. .name {
  270. font-size: 30rpx;
  271. color: #93794B;
  272. margin-right: 2px;
  273. &:last-child {
  274. margin-right: 0;
  275. }
  276. }
  277. }
  278. .level-ty {
  279. position: absolute;
  280. right: 10px;
  281. bottom: -12px;
  282. font-size: 12px;
  283. color: #fff;
  284. }
  285. .earnings {
  286. margin: 25rpx 30rpx 0;
  287. border-radius: 20rpx;
  288. background-color: #FFF;
  289. flex-direction:row;
  290. flex-wrap: wrap;
  291. align-items: center;
  292. .lineAll {
  293. width: 790rpx;
  294. height: 1px;
  295. background-color: rgba(245, 245, 247, 1);
  296. }
  297. .item {
  298. width: 342rpx;
  299. padding: 30rpx;
  300. box-sizing: border-box;
  301. line-height: 1;
  302. flex-direction:row;
  303. justify-content: space-between;
  304. align-items: center;
  305. .itemLeftBox{
  306. flex-grow: 1;
  307. }
  308. .rightImageIcon {
  309. width: 66rpx;
  310. height: 66rpx;
  311. }
  312. .count {
  313. margin-top: 20rpx;
  314. font-size: 25rpx;
  315. color: rgba(255, 76, 76, 1);
  316. }
  317. .name {
  318. font-weight: bold;
  319. font-size: 28rpx;
  320. color: rgba(35, 35, 38, 1);
  321. }
  322. }
  323. .line {
  324. width: 1px;
  325. height: 70rpx;
  326. background-color: rgba(245, 245, 247, 1);
  327. }
  328. }
  329. }
  330. }
  331. .gz {
  332. padding: 0px 30rpx;
  333. margin-top: 20rpx;
  334. .bg {
  335. width: 690rpx;
  336. height: 77rpx;
  337. }
  338. .inner {
  339. position: absolute;
  340. width: 670rpx;
  341. height: 74rpx;
  342. left: 40rpx;
  343. top: 0;
  344. flex-direction: row;
  345. align-items: center;
  346. .icon {
  347. width: 40rpx;
  348. height: 36rpx;
  349. }
  350. .name {
  351. margin-left: 15rpx;
  352. font-size: 30rpx;
  353. color: #6A4714;
  354. flex: 1;
  355. }
  356. .sbtn {
  357. border-radius: 25rpx;
  358. padding: 10rpx 25rpx;
  359. background-color: #6A4714;
  360. .sbtnText{
  361. font-size: 26rpx;
  362. color: #F0E1C9;
  363. }
  364. }
  365. }
  366. }
  367. .body {
  368. padding: 20rpx 30rpx;
  369. position: relative;
  370. line-height: 1;
  371. .pannel {
  372. background: #fff;
  373. border-radius: 20rpx;
  374. .mySh{
  375. flex-direction: row;
  376. justify-content: space-between;
  377. align-items: center;
  378. }
  379. .pannelTopImgBox{
  380. padding:30rpx 25rpx 0;
  381. .pannelTopImg{
  382. width: 140rpx;
  383. height: 26rpx !important;
  384. }
  385. }
  386. .order-items {
  387. padding: 40rpx 10rpx;
  388. flex-direction: row;
  389. flex-wrap: wrap;
  390. justify-content: space-between;
  391. .item {
  392. width: 134rpx;
  393. align-items: center;
  394. .shareImage {
  395. width: 90rpx;
  396. height: 88rpx;
  397. }
  398. .name {
  399. font-size: 24rpx;
  400. color: #0C1732;
  401. margin-top: 10rpx;
  402. }
  403. }
  404. }
  405. &.mt20 {
  406. margin-top: 20rpx;
  407. }
  408. .items-title {
  409. font-weight: bold;
  410. font-size: 28rpx;
  411. color: #333333;
  412. padding-left: 40rpx;
  413. padding-top: 30rpx;
  414. }
  415. .shop-name {
  416. font-size: 24rpx;
  417. color: #333333;
  418. padding-right: 10px;
  419. padding-top: 17px;
  420. }
  421. .items {
  422. padding-bottom: 40rpx;
  423. flex-direction: row;
  424. flex-wrap: wrap;
  425. .item {
  426. width: 170rpx;
  427. margin-top: 50rpx;
  428. align-items: center;
  429. .itemsImage {
  430. height: 40rpx;
  431. }
  432. .name {
  433. font-size: 24rpx;
  434. color: #333;
  435. margin-top: 32rpx;
  436. }
  437. }
  438. }
  439. }
  440. }
  441. /**弹出框 **/
  442. .popwin {
  443. position: fixed;
  444. width: 100%;
  445. height: 100%;
  446. top: 0;
  447. left: 0;
  448. z-index: 88;
  449. }
  450. .popwin .bg {
  451. background: rgba(0, 0, 0, 0.5);
  452. height: 100%;
  453. width: 100%;
  454. position: absolute;
  455. left: 0;
  456. top: 0;
  457. }
  458. .popwin .body {
  459. position: relative;
  460. border-radius: 8px;
  461. width: 100%;
  462. width: 80vw;
  463. right: -7vw;
  464. padding: 0;
  465. }
  466. .popwin .body .bgimg {
  467. width: 80vw;
  468. height: 83vw;
  469. position: absolute;
  470. top: 0;
  471. }
  472. .popwin .body .pop-body {
  473. width: 66vw;
  474. position: relative;
  475. }
  476. .popwin .body .inner {
  477. position: relative;
  478. z-index: 99;
  479. width: 670rpx;
  480. padding: 0px 40rpx;
  481. }
  482. .popwin .body .inner-top {
  483. height: 9vw;
  484. line-height: 9vw;
  485. text-align: center;
  486. font-weight: 500;
  487. font-size: 34rpx;
  488. color: #FEF9F0;
  489. }
  490. .popwin .body .inner-tip {
  491. margin-top: 8vw;
  492. height: 7vw;
  493. text-align: center;
  494. line-height: 7vw;
  495. font-weight: bold;
  496. font-size: 26rpx;
  497. color: #F9FAFA;
  498. }
  499. .max-he {
  500. height: 31vw;
  501. }
  502. .max-he .c {
  503. font-size: 150rpx;
  504. color: #201F1F;
  505. font-weight: bold;
  506. }
  507. .max-he .t {
  508. position: relative;
  509. top: -40rpx;
  510. }
  511. .foot {
  512. height: 22vw;
  513. margin-top: 6vw;
  514. }
  515. .popwin .btn {
  516. background: linear-gradient(0deg, #FAC37B, #FFF5B0);
  517. box-shadow: 2px 7px 7px 0px rgba(161, 23, 36, 0.4);
  518. border-radius: 15rpx;
  519. height: 66rpx;
  520. width: 40vw;
  521. font-size: 38rpx;
  522. color: #97000E;
  523. text-align: center;
  524. line-height: 66rpx
  525. }
  526. .popwin .m-close {
  527. margin-top: 10px;
  528. width: 675rpx;
  529. }
  530. .popwin .m-close image {
  531. width: 120rpx;
  532. height: 120rpx;
  533. }
  534. </style>
  535. <script>
  536. import uParse from '@/components/gaoyia-parse/parse.vue';
  537. import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
  538. import customerWiget from '@/components/ui-public/customer-wiget.vue';
  539. import {
  540. mapState,
  541. mapMutations
  542. } from 'vuex';
  543. import utils from '@/library/utils/Comm.js'
  544. export default {
  545. components: {
  546. uParse,
  547. maoScroll,
  548. customerWiget
  549. },
  550. computed: mapState(['user', 'sysData']),
  551. data() {
  552. return {
  553. statusBarHeight: 20,
  554. isGg: false,
  555. isNewShow: false,
  556. timeValues: '',
  557. }
  558. },
  559. onLoad() {
  560. this.initView();
  561. },
  562. onShow(options) {
  563. this.checkUserLogin({
  564. page: this,
  565. isLogion: false,
  566. fn: this.init
  567. });
  568. },
  569. methods: {
  570. ...mapMutations(['setSys', 'checkUserLogin']),
  571. initView: function() {
  572. uni.getSystemInfo({
  573. success: (res) => {
  574. this.statusBarHeight = res.statusBarHeight;
  575. }
  576. });
  577. },
  578. /**
  579. *
  580. */
  581. init: function() {
  582. // if (this.user.is_mentor) {
  583. // this.isGg = true;
  584. // }
  585. console.log(this.user.mentor_id)
  586. if ((this.user.mentor_id == 15 || this.user.mentor_id == 6 && this.user.regtime > 0)) {
  587. //获取当前时间的时间戳
  588. let nowTime = Math.round(new Date().getTime()).toString();
  589. console.log(nowTime, '现在时间')
  590. //注册时间 this.user.regtime 两个月后
  591. let date = new Date(this.user.regtime * 1000);
  592. console.log(date, '注册时间')
  593. // 获取日期的月份和年份,用于处理月末变化的情况
  594. let currentMonth = date.getMonth();
  595. let currentYear = date.getFullYear();
  596. date.setMonth(date.getMonth() + 2);
  597. if (date.getMonth() !== (currentMonth + 2) % 12 || date.getFullYear() !== currentYear + Math.floor(
  598. (currentMonth + 2) / 12)) {
  599. date.setDate(0);
  600. }
  601. let dateTimeStr = new Date(date);
  602. // 将Date对象转换为时间戳(以秒为单位)
  603. let timestamp = Math.floor(dateTimeStr.getTime());
  604. console.log(timestamp, '注册两个月后时间')
  605. if (nowTime > timestamp) {
  606. this.isNewShow = false
  607. } else {
  608. this.isNewShow = true
  609. this.timeValues = timestamp - nowTime
  610. console.log(this.timeValues, '到期倒计时')
  611. }
  612. }
  613. if ((this.user.mentor_id == 15 || this.user.mentor_id == 6) && this.user.regtime == 0) {
  614. this.isNewShow = true
  615. }
  616. },
  617. /**
  618. * 授权登录
  619. */
  620. tapLogin: function() {
  621. uni.navigateTo({
  622. url: "/pages/login/index"
  623. })
  624. },
  625. /**
  626. * 打开Open
  627. * @param {Object} ev
  628. */
  629. tapOpen: function(ev) {
  630. let url = ev.currentTarget.dataset.url;
  631. if (!utils.isDefine(this.user)) {
  632. uni.navigateTo({
  633. url: "/pages/login/index"
  634. });
  635. return;
  636. }
  637. utils.navigateTo(url);
  638. },
  639. /**
  640. * 交易密钥
  641. */
  642. tapPayment: function() {
  643. if (!utils.isDefine(this.user)) {
  644. uni.navigateTo({
  645. url: "/pages/login/index"
  646. });
  647. return;
  648. }
  649. if (this.user.is_payment) {
  650. uni.navigateTo({
  651. url: "/pages/user/userinfo/security/mobileFind"
  652. })
  653. } else {
  654. uni.navigateTo({
  655. url: "/pages/user/userinfo/security/newPass"
  656. })
  657. }
  658. },
  659. tapOpenRz: function() {
  660. if (!utils.isDefine(this.user)) {
  661. uni.navigateTo({
  662. url: "/pages/login/index"
  663. });
  664. return;
  665. }
  666. if (this.user.is_auth == 1) {
  667. utils.Tip("已实名认证");
  668. return;
  669. }
  670. uni.navigateTo({
  671. url: "/pages/user/approve"
  672. });
  673. },
  674. }
  675. }
  676. </script>