index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  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. .top-view {
  221. width: 100%;
  222. .top-inner {
  223. position: relative;
  224. z-index: 1;
  225. .top-h45 {
  226. height: 45rpx;
  227. }
  228. .user {
  229. position: relative;
  230. }
  231. .avatar {
  232. width: 130rpx;
  233. height: 130rpx;
  234. background: #efa69b;
  235. border-radius: 50%;
  236. image {
  237. width: 120rpx;
  238. height: 120rpx;
  239. border-radius: 50%;
  240. margin-left: 5rpx;
  241. margin-top: 5rpx;
  242. }
  243. }
  244. .nickname {
  245. margin-top: 20rpx;
  246. color: #000;
  247. font-size: 34rpx;
  248. font-weight: bold;
  249. }
  250. .iname {
  251. margin-top: 12rpx;
  252. image {
  253. width: 30rpx;
  254. height: 30rpx;
  255. margin-left: 12rpx;
  256. }
  257. .id-name {
  258. font-size: 30rpx;
  259. color: #666666;
  260. }
  261. }
  262. .level {
  263. margin-top: 20rpx;
  264. background: linear-gradient(to right, #f9ecc5 0%, #d6ba63 100%);
  265. border-radius: 60rpx;
  266. padding: 0 36rpx;
  267. image {
  268. width: 30rpx;
  269. height: 30rpx;
  270. margin-right: 10rpx;
  271. }
  272. .name {
  273. font-size: 30rpx;
  274. color: #93794B;
  275. margin-right: 2px;
  276. &:last-child {
  277. margin-right: 0;
  278. }
  279. }
  280. }
  281. .level-ty {
  282. position: absolute;
  283. right: 10px;
  284. bottom: -12px;
  285. font-size: 12px;
  286. color: #fff;
  287. }
  288. .earnings {
  289. margin: 25rpx 30rpx 0;
  290. border-radius: 20rpx;
  291. background-color: #FFF;
  292. .lineAll {
  293. width: 100%;
  294. height: 1px;
  295. background-color: rgba(245, 245, 247, 1);
  296. }
  297. .item {
  298. width: calc(50% - 1px);
  299. padding: 30rpx;
  300. box-sizing: border-box;
  301. line-height: 1;
  302. .itemLeftBox{
  303. flex-grow: 1;
  304. }
  305. .rightImageIcon {
  306. width: 66rpx;
  307. height: 66rpx;
  308. }
  309. .count {
  310. margin-top: 20rpx;
  311. font-size: 25rpx;
  312. color: rgba(255, 76, 76, 1);
  313. }
  314. .name {
  315. font-weight: bold;
  316. font-size: 28rpx;
  317. color: rgba(35, 35, 38, 1);
  318. }
  319. }
  320. .line {
  321. width: 1px;
  322. height: 70rpx;
  323. background-color: rgba(245, 245, 247, 1);
  324. }
  325. }
  326. }
  327. }
  328. .gz {
  329. position: relative;
  330. padding: 0px 20rpx;
  331. margin-top: 20rpx;
  332. .bg {
  333. width: calc(100vw - 40rpx);
  334. height: calc(13vw - 5rpx);
  335. }
  336. .inner {
  337. position: absolute;
  338. width: calc(100% - 80rpx);
  339. height: calc(100% - 10rpx);
  340. left: 40rpx;
  341. top: 0;
  342. .icon {
  343. width: 40rpx;
  344. height: 36rpx;
  345. }
  346. .name {
  347. margin-left: 15rpx;
  348. font-size: 30rpx;
  349. color: #6A4714;
  350. }
  351. .sbtn {
  352. background: linear-gradient(-90deg, #8C5F1D 0%, #8C5F1C 77%, #875916 99%);
  353. border-radius: 25rpx;
  354. height: 50rpx;
  355. line-height: 50rpx;
  356. padding: 0px 25rpx;
  357. font-size: 26rpx;
  358. color: #F0E1C9;
  359. }
  360. }
  361. }
  362. .body {
  363. padding: 20rpx 30rpx;
  364. position: relative;
  365. line-height: 1;
  366. .pannel {
  367. background: #fff;
  368. border-radius: 20rpx;
  369. .pannelTopImgBox{
  370. padding:30rpx 25rpx 0;
  371. .pannelTopImg{
  372. width: 140rpx;
  373. height: 26rpx !important;
  374. }
  375. }
  376. .order-items {
  377. padding: 40rpx 10rpx;
  378. .item {
  379. width: 20%;
  380. image {
  381. width: 90rpx;
  382. height: 88rpx;
  383. }
  384. .name {
  385. font-size: 24rpx;
  386. color: #0C1732;
  387. margin-top: 10rpx;
  388. }
  389. }
  390. }
  391. &.mt20 {
  392. margin-top: 20rpx;
  393. }
  394. .items-title {
  395. font-weight: bold;
  396. font-size: 28rpx;
  397. color: #333333;
  398. padding-left: 40rpx;
  399. padding-top: 30rpx;
  400. }
  401. .shop-name {
  402. font-size: 24rpx;
  403. color: #333333;
  404. padding-right: 10px;
  405. padding-top: 17px;
  406. }
  407. .items {
  408. padding-bottom: 40rpx;
  409. .item {
  410. width: 25%;
  411. margin-top: 50rpx;
  412. image {
  413. height: 40rpx;
  414. }
  415. .name {
  416. font-size: 24rpx;
  417. color: #333;
  418. margin-top: 32rpx;
  419. }
  420. }
  421. }
  422. }
  423. }
  424. /**弹出框 **/
  425. .popwin {
  426. position: fixed;
  427. width: 100%;
  428. height: 100%;
  429. top: 0;
  430. left: 0;
  431. z-index: 88;
  432. }
  433. .popwin .bg {
  434. background: rgba(0, 0, 0, 0.5);
  435. height: 100%;
  436. width: 100%;
  437. position: absolute;
  438. left: 0;
  439. top: 0;
  440. }
  441. .popwin .body {
  442. position: relative;
  443. border-radius: 8px;
  444. width: 100%;
  445. width: 80vw;
  446. right: -7vw;
  447. padding: 0;
  448. }
  449. .popwin .body .bgimg {
  450. width: 80vw;
  451. height: 83vw;
  452. position: absolute;
  453. top: 0;
  454. }
  455. .popwin .body .pop-body {
  456. width: 66vw;
  457. position: relative;
  458. }
  459. .popwin .body .inner {
  460. position: relative;
  461. z-index: 99;
  462. width: calc(100% - 80rpx);
  463. padding: 0px 40rpx;
  464. }
  465. .popwin .body .inner-top {
  466. height: 9vw;
  467. line-height: 9vw;
  468. text-align: center;
  469. font-weight: 500;
  470. font-size: 34rpx;
  471. color: #FEF9F0;
  472. }
  473. .popwin .body .inner-tip {
  474. margin-top: 8vw;
  475. height: 7vw;
  476. text-align: center;
  477. line-height: 7vw;
  478. font-weight: bold;
  479. font-size: 26rpx;
  480. color: #F9FAFA;
  481. }
  482. .max-he {
  483. height: 31vw;
  484. }
  485. .max-he .c {
  486. font-size: 150rpx;
  487. color: #201F1F;
  488. font-weight: bold;
  489. }
  490. .max-he .t {
  491. position: relative;
  492. top: -40rpx;
  493. }
  494. .foot {
  495. height: 22vw;
  496. margin-top: 6vw;
  497. }
  498. .popwin .btn {
  499. background: linear-gradient(0deg, #FAC37B, #FFF5B0);
  500. box-shadow: 2px 7px 7px 0px rgba(161, 23, 36, 0.4);
  501. border-radius: 15rpx;
  502. height: 66rpx;
  503. width: 40vw;
  504. font-size: 38rpx;
  505. color: #97000E;
  506. text-align: center;
  507. line-height: 66rpx
  508. }
  509. .popwin .m-close {
  510. margin-top: 10px;
  511. width: calc(100% - 10vw);
  512. }
  513. .popwin .m-close image {
  514. width: 120rpx;
  515. height: 120rpx;
  516. }
  517. </style>
  518. <script>
  519. import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
  520. import customerWiget from '@/components/ui-public/customer-wiget.vue';
  521. import {
  522. mapState,
  523. mapMutations
  524. } from 'vuex';
  525. export default {
  526. components: {
  527. maoScroll,
  528. customerWiget
  529. },
  530. computed: mapState(['user', 'sysData']),
  531. data() {
  532. return {
  533. statusBarHeight: 20,
  534. isGg: false,
  535. isNewShow: false,
  536. timeValues: '',
  537. }
  538. },
  539. onLoad() {
  540. this.initView();
  541. },
  542. onShow(options) {
  543. this.checkUserLogin({
  544. page: this,
  545. isLogion: false,
  546. fn: this.init
  547. });
  548. },
  549. methods: {
  550. ...mapMutations(['setSys', 'checkUserLogin']),
  551. initView: function() {
  552. uni.getSystemInfo({
  553. success: (res) => {
  554. this.statusBarHeight = res.statusBarHeight;
  555. }
  556. });
  557. },
  558. /**
  559. *
  560. */
  561. init: function() {
  562. // if (this.user.is_mentor) {
  563. // this.isGg = true;
  564. // }
  565. console.log(this.user.mentor_id)
  566. if ((this.user.mentor_id == 15 || this.user.mentor_id == 6 && this.user.regtime > 0)) {
  567. //获取当前时间的时间戳
  568. let nowTime = Math.round(new Date().getTime()).toString();
  569. console.log(nowTime, '现在时间')
  570. //注册时间 this.user.regtime 两个月后
  571. let date = new Date(this.user.regtime * 1000);
  572. console.log(date, '注册时间')
  573. // 获取日期的月份和年份,用于处理月末变化的情况
  574. let currentMonth = date.getMonth();
  575. let currentYear = date.getFullYear();
  576. date.setMonth(date.getMonth() + 2);
  577. if (date.getMonth() !== (currentMonth + 2) % 12 || date.getFullYear() !== currentYear + Math.floor(
  578. (currentMonth + 2) / 12)) {
  579. date.setDate(0);
  580. }
  581. let dateTimeStr = new Date(date);
  582. // 将Date对象转换为时间戳(以秒为单位)
  583. let timestamp = Math.floor(dateTimeStr.getTime());
  584. console.log(timestamp, '注册两个月后时间')
  585. if (nowTime > timestamp) {
  586. this.isNewShow = false
  587. } else {
  588. this.isNewShow = true
  589. this.timeValues = timestamp - nowTime
  590. console.log(this.timeValues, '到期倒计时')
  591. }
  592. }
  593. if ((this.user.mentor_id == 15 || this.user.mentor_id == 6) && this.user.regtime == 0) {
  594. this.isNewShow = true
  595. }
  596. },
  597. /**
  598. * 授权登录
  599. */
  600. tapLogin: function() {
  601. uni.navigateTo({
  602. url: "/pages/login/index"
  603. })
  604. },
  605. /**
  606. * 打开Open
  607. * @param {Object} ev
  608. */
  609. tapOpen: function(ev) {
  610. let url = ev.currentTarget.dataset.url;
  611. if (!this.utils.isDefine(this.user)) {
  612. uni.navigateTo({
  613. url: "/pages/login/index"
  614. });
  615. return;
  616. }
  617. this.utils.navigateTo(url);
  618. },
  619. /**
  620. * 交易密钥
  621. */
  622. tapPayment: function() {
  623. if (!this.utils.isDefine(this.user)) {
  624. uni.navigateTo({
  625. url: "/pages/login/index"
  626. });
  627. return;
  628. }
  629. if (this.user.is_payment) {
  630. uni.navigateTo({
  631. url: "/pages/user/userinfo/security/mobileFind"
  632. })
  633. } else {
  634. uni.navigateTo({
  635. url: "/pages/user/userinfo/security/newPass"
  636. })
  637. }
  638. },
  639. tapOpenRz: function() {
  640. if (!this.utils.isDefine(this.user)) {
  641. uni.navigateTo({
  642. url: "/pages/login/index"
  643. });
  644. return;
  645. }
  646. if (this.user.is_auth == 1) {
  647. this.utils.Tip("已实名认证");
  648. return;
  649. }
  650. uni.navigateTo({
  651. url: "/pages/user/approve"
  652. });
  653. },
  654. }
  655. }
  656. </script>