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="openKf">
  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. line-height: 1;
  301. flex-direction:row;
  302. justify-content: space-between;
  303. align-items: center;
  304. .itemLeftBox{
  305. flex: 1;
  306. }
  307. .rightImageIcon {
  308. width: 66rpx;
  309. height: 66rpx;
  310. }
  311. .count {
  312. margin-top: 20rpx;
  313. font-size: 25rpx;
  314. color: rgba(255, 76, 76, 1);
  315. }
  316. .name {
  317. font-weight: bold;
  318. font-size: 28rpx;
  319. color: rgba(35, 35, 38, 1);
  320. }
  321. }
  322. .line {
  323. width: 1px;
  324. height: 70rpx;
  325. background-color: rgba(245, 245, 247, 1);
  326. }
  327. }
  328. }
  329. }
  330. .gz {
  331. padding: 0px 30rpx;
  332. margin-top: 20rpx;
  333. .bg {
  334. width: 690rpx;
  335. height: 77rpx;
  336. }
  337. .inner {
  338. position: absolute;
  339. width: 670rpx;
  340. height: 74rpx;
  341. left: 40rpx;
  342. top: 0;
  343. flex-direction: row;
  344. align-items: center;
  345. .icon {
  346. width: 40rpx;
  347. height: 36rpx;
  348. }
  349. .name {
  350. margin-left: 15rpx;
  351. font-size: 30rpx;
  352. color: #6A4714;
  353. flex: 1;
  354. }
  355. .sbtn {
  356. border-radius: 25rpx;
  357. padding: 10rpx 25rpx;
  358. background-color: #6A4714;
  359. .sbtnText{
  360. font-size: 26rpx;
  361. color: #F0E1C9;
  362. }
  363. }
  364. }
  365. }
  366. .body {
  367. padding: 20rpx 30rpx;
  368. position: relative;
  369. line-height: 1;
  370. .pannel {
  371. background: #fff;
  372. border-radius: 20rpx;
  373. .mySh{
  374. flex-direction: row;
  375. justify-content: space-between;
  376. align-items: center;
  377. }
  378. .pannelTopImgBox{
  379. padding:30rpx 25rpx 0;
  380. .pannelTopImg{
  381. width: 140rpx;
  382. height: 26rpx !important;
  383. }
  384. }
  385. .order-items {
  386. padding: 40rpx 10rpx;
  387. flex-direction: row;
  388. flex-wrap: wrap;
  389. justify-content: space-between;
  390. .item {
  391. width: 134rpx;
  392. align-items: center;
  393. .shareImage {
  394. width: 90rpx;
  395. height: 88rpx;
  396. }
  397. .name {
  398. font-size: 24rpx;
  399. color: #0C1732;
  400. margin-top: 10rpx;
  401. }
  402. }
  403. }
  404. &.mt20 {
  405. margin-top: 20rpx;
  406. }
  407. .items-title {
  408. font-weight: bold;
  409. font-size: 28rpx;
  410. color: #333333;
  411. padding-left: 40rpx;
  412. padding-top: 30rpx;
  413. }
  414. .shop-name {
  415. font-size: 24rpx;
  416. color: #333333;
  417. padding-right: 10px;
  418. padding-top: 17px;
  419. }
  420. .items {
  421. padding-bottom: 40rpx;
  422. flex-direction: row;
  423. flex-wrap: wrap;
  424. .item {
  425. width: 170rpx;
  426. margin-top: 50rpx;
  427. align-items: center;
  428. .itemsImage {
  429. height: 40rpx;
  430. }
  431. .name {
  432. font-size: 24rpx;
  433. color: #333;
  434. margin-top: 32rpx;
  435. }
  436. }
  437. }
  438. }
  439. }
  440. /**弹出框 **/
  441. .popwin {
  442. position: fixed;
  443. width: 100%;
  444. height: 100%;
  445. top: 0;
  446. left: 0;
  447. z-index: 88;
  448. }
  449. .popwin .bg {
  450. background: rgba(0, 0, 0, 0.5);
  451. height: 100%;
  452. width: 100%;
  453. position: absolute;
  454. left: 0;
  455. top: 0;
  456. }
  457. .popwin .body {
  458. position: relative;
  459. border-radius: 8px;
  460. width: 100%;
  461. width: 80vw;
  462. right: -7vw;
  463. padding: 0;
  464. }
  465. .popwin .body .bgimg {
  466. width: 80vw;
  467. height: 83vw;
  468. position: absolute;
  469. top: 0;
  470. }
  471. .popwin .body .pop-body {
  472. width: 66vw;
  473. position: relative;
  474. }
  475. .popwin .body .inner {
  476. position: relative;
  477. z-index: 99;
  478. width: 670rpx;
  479. padding: 0px 40rpx;
  480. }
  481. .popwin .body .inner-top {
  482. height: 68rpx;
  483. line-height: 68rpx;
  484. text-align: center;
  485. font-weight: 500;
  486. font-size: 34rpx;
  487. color: #FEF9F0;
  488. }
  489. .popwin .body .inner-tip {
  490. margin-top: 60rpx;
  491. height: 53rpx;
  492. text-align: center;
  493. line-height: 53rpx;
  494. font-weight: bold;
  495. font-size: 26rpx;
  496. color: #F9FAFA;
  497. }
  498. .max-he {
  499. height: 31vw;
  500. }
  501. .max-he .c {
  502. font-size: 150rpx;
  503. color: #201F1F;
  504. font-weight: bold;
  505. }
  506. .max-he .t {
  507. position: relative;
  508. top: -40rpx;
  509. }
  510. .foot {
  511. height: 22vw;
  512. margin-top: 6vw;
  513. }
  514. .popwin .btn {
  515. background-image: linear-gradient(0deg, #FAC37B, #FFF5B0);
  516. box-shadow: 2px 7px 7px 0px rgba(161, 23, 36, 0.4);
  517. border-radius: 15rpx;
  518. height: 66rpx;
  519. width: 40vw;
  520. font-size: 38rpx;
  521. color: #97000E;
  522. text-align: center;
  523. line-height: 66rpx
  524. }
  525. .popwin .m-close {
  526. margin-top: 10px;
  527. width: 675rpx;
  528. }
  529. .popwin .m-close .icon {
  530. width: 120rpx;
  531. height: 120rpx;
  532. }
  533. </style>
  534. <script>
  535. import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
  536. import customerWiget from '@/components/ui-public/customer-wiget.nvue';
  537. import {
  538. mapState,
  539. mapMutations
  540. } from 'vuex';
  541. import utils from '@/library/utils/Comm.js'
  542. export default {
  543. components: {
  544. maoScroll,
  545. customerWiget
  546. },
  547. computed: mapState(['user', 'sysData']),
  548. data() {
  549. return {
  550. statusBarHeight: 20,
  551. isGg: false,
  552. isNewShow: false,
  553. timeValues: '',
  554. }
  555. },
  556. onLoad() {
  557. this.initView();
  558. },
  559. onShow(options) {
  560. this.checkUserLogin({
  561. page: this,
  562. isLogion: false,
  563. fn: this.init
  564. });
  565. },
  566. methods: {
  567. ...mapMutations(['setSys', 'checkUserLogin']),
  568. openKf(){
  569. this.$refs.customer.open()
  570. },
  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>