index.vue 17 KB

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