index.nvue 18 KB

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