index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. <template>
  2. <view class="app">
  3. <image class="top-bg" src="/static/img/user-bg.png"></image>
  4. <view class="top-view">
  5. <view class="top-inner">
  6. <view class="statusBar" :style="'height:' + statusBarHeight + 'px'"></view>
  7. <view class="top-h45"></view>
  8. <view class="user fx-h fx-bc" v-if="user != null">
  9. <view class="avatar">
  10. <image :src=" user.avatar || '/static/img/user-avatar2.png'" mode="aspectFill"></image>
  11. </view>
  12. <view class="nickname">{{ user.nickname }}</view>
  13. <view class="iname fx-r fx-bc">
  14. <view class="id-name">ID:{{ user.number_code }}</view>
  15. <image src="/static/img/idcopy.png" class="copy"></image>
  16. </view>
  17. <template v-if="sysData.is_audit == 0">
  18. <view class="level fx-r fx-bc" v-if="user.levelid == 1 && user.mentor_id > 0">
  19. <view class="name">{{ user.mentor_name }}</view>
  20. </view>
  21. <view class="level fx-r fx-bc" v-if="user.levelid > 1 && user.mentor_id > 0">
  22. <image src="/static/img/level-1.png"></image>
  23. <view class="name">{{ user.mentor_name }}</view>
  24. </view>
  25. <view v-if="isNewShow" class="newPeople">新人({{user.fresh_time_text}})</view>
  26. <view class="level-ty" v-if="user.mentor_time != '' && user.mentor_time != null">
  27. 到期:{{ user.mentor_time }}</view>
  28. </template>
  29. </view>
  30. <view class="user fx-h fx-bc fx-ac" @tap="tapLogin" v-else>
  31. <view class="avatar">
  32. <image src="/static/img/user-avatar2.png" mode="aspectFill"></image>
  33. </view>
  34. <view class="nickname">点击登录</view>
  35. </view>
  36. <!--收益情况-->
  37. <view class="earnings fx-r fx-bc" v-if="sysData.is_audit == 0">
  38. <view class="item fx-h fx-bc fx-ac">
  39. <view class="count">{{ user != null ? user.total_earnings : 0 }}</view>
  40. <view class="name">我的收益</view>
  41. </view>
  42. <view class="line"></view>
  43. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen" data-url="/pages/user/detail/integral">
  44. <view class="count">{{ user != null ? user.integral : 0 }}</view>
  45. <view class="name">我的趣豆</view>
  46. </view>
  47. <view class="line"></view>
  48. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen" data-url="/pages/user/detail/anticipate">
  49. <view class="count">{{ user != null ? user.anticipate : 0 }}</view>
  50. <view class="name">易趣卷</view>
  51. </view>
  52. <view class="line"></view>
  53. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen" data-url="/pages/user/detail/detail">
  54. <view class="count">{{ user != null ? user.good_integral : 0 }}</view>
  55. <view class="name">提货积分</view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <!--馆长中心-->
  61. <view class="gz" v-if="user != null && user.isgz" @tap="tapOpen" data-url="/pages/gz/index">
  62. <image class="bg" src="/static/img/gz-bg.png"></image>
  63. <view class="inner fx-r fx-bc">
  64. <image class="icon" src="/static/img/gz-zuan.png"></image>
  65. <view class="name">馆长中心</view>
  66. <view class="fx-g1"></view>
  67. <view class="sbtn">点击进入</view>
  68. </view>
  69. </view>
  70. <view class="body" :class="(user != null && user.isgz) ? 'to-gz' : 'no-gz' ">
  71. <view class="pannel" v-if="sysData.is_audit == 0">
  72. <view class="order-items fx-r fx-bc">
  73. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/qrcode/index"
  74. v-if="sysData.is_audit == 0">
  75. <image src="/static/img/user-invite.png"></image>
  76. <view class="name">邀请好友</view>
  77. </view>
  78. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/team/vermicelli"
  79. v-if="sysData.is_audit == 0">
  80. <image src="/static/img/user-vermicelli.png"></image>
  81. <view class="name">我的粉丝</view>
  82. </view>
  83. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/order/index">
  84. <image src="/static/img/user-order.png"></image>
  85. <view class="name">提货订单</view>
  86. </view>
  87. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/guild/order/order"
  88. v-if="sysData.is_audit == 0">
  89. <image src="/static/img/user-rush.png"></image>
  90. <view class="name">抢购订单</view>
  91. </view>
  92. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/guild/order/myPro">
  93. <image src="/static/img/user-goods.png"></image>
  94. <view class="name">我的商品</view>
  95. </view>
  96. </view>
  97. </view>
  98. <!--我的商户-->
  99. <view class="pannel mt20" v-if=" user != null && user.m_id > 0">
  100. <view class="fx-r fx-bc fx-ac">
  101. <view class="items-title">我的商户</view>
  102. <view class="fx-g1"></view>
  103. <view class="shop-name">{{ user.m_name }}</view>
  104. </view>
  105. <view class="items fx-r">
  106. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/detail/brokerage">
  107. <image src="/static/img/user_earnings.png"></image>
  108. <view class="name">货款记录</view>
  109. </view>
  110. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/address/address">
  111. <image src="/static/img/user_tx.png"></image>
  112. <view class="name">我要提现</view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="pannel mt20">
  117. <view class="items-title">更多功能</view>
  118. <view class="items fx-r">
  119. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/bank/bank"
  120. v-if="sysData.is_audit == 0">
  121. <image src="/static/img/user-bank.png"></image>
  122. <view class="name">收款信息</view>
  123. </view>
  124. <view class="item fx-h fx-bc" @tap="tapOpenRz" v-if="sysData.is_audit == 0">
  125. <image src="/static/img/user-auth.png"></image>
  126. <view class="name">实名认证</view>
  127. </view>
  128. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/address/address">
  129. <image src="/static/img/user-address.png"></image>
  130. <view class="name">收货地址</view>
  131. </view>
  132. <view class="item fx-h fx-bc" @tap="$refs.customer.open()">
  133. <image src="/static/img/user-kfu.png"></image>
  134. <view class="name">联系客服</view>
  135. </view>
  136. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/userinfo/index">
  137. <image src="/static/img/user-msg.png"></image>
  138. <view class="name">个人资料</view>
  139. </view>
  140. <view class="item fx-h fx-bc" @tap="tapPayment" v-if="sysData.is_audit == 0">
  141. <image src="/static/img/user-password.png"></image>
  142. <view class="name">交易密码</view>
  143. </view>
  144. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/userinfo/bindPhone"
  145. v-if="sysData.is_audit == 0">
  146. <image src="/static/img/user-bind.png"></image>
  147. <view class="name">绑定手机</view>
  148. </view>
  149. <view class="item fx-h fx-bc" @tap="tapOpen" data-url="/pages/user/setting/index">
  150. <image src="/static/img/user-seting.png"></image>
  151. <view class="name">设置</view>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <customer-wiget ref="customer"></customer-wiget>
  157. <view class="popwin fx-h fx-bc fx-ac" v-if="isGg">
  158. <view class="bg"></view>
  159. <view class="body fx-h">
  160. <image src="/static/img/user_vip_bg.png" class="bgimg"></image>
  161. <view class="pop-body">
  162. <view class="inner-top">尊敬的高级合伙人</view>
  163. <view class="inner-tip">您的高级合伙人有效期仅剩</view>
  164. <view class="inner">
  165. <view class="max-he fx-r fx-be fx-ac">
  166. <text class="c">{{ user != null ? user.last_mentor_time : ""}}</text>
  167. <text class="t">天</text>
  168. </view>
  169. <view class="fx-r fx-bc fx-ac foot">
  170. <view class="btn" @tap="isGg = false">我知晓></view>
  171. </view>
  172. </view>
  173. </view>
  174. <view class="m-close fx-h fx-bc">
  175. <image src="/static/img/btn-close.png" @tap="isGg = false" class="icon"></image>
  176. </view>
  177. </view>
  178. </view>
  179. </view>
  180. </template>
  181. <style lang="scss">
  182. .top-bg {
  183. width: 100vw;
  184. height: 83vw;
  185. position: fixed;
  186. top: 0;
  187. }
  188. .top-view {
  189. width: 100%;
  190. .top-inner {
  191. position: relative;
  192. z-index: 1;
  193. .top-h45 {
  194. height: 45rpx;
  195. }
  196. .user {
  197. height: 280rpx;
  198. position: relative;
  199. }
  200. .avatar {
  201. width: 130rpx;
  202. height: 130rpx;
  203. background: #efa69b;
  204. border-radius: 50%;
  205. image {
  206. width: 120rpx;
  207. height: 120rpx;
  208. border-radius: 50%;
  209. margin-left: 5rpx;
  210. margin-top: 5rpx;
  211. }
  212. }
  213. .nickname {
  214. margin-top: 20rpx;
  215. color: #FFFFFF;
  216. font-size: 34rpx;
  217. font-weight: bold;
  218. }
  219. .iname {
  220. margin-top: 12rpx;
  221. image {
  222. width: 30rpx;
  223. height: 30rpx;
  224. margin-left: 12rpx;
  225. }
  226. .id-name {
  227. font-size: 30rpx;
  228. color: #FFFFFF;
  229. }
  230. }
  231. .level {
  232. margin-top: 20rpx;
  233. background: linear-gradient(to right, #f9ecc5 0%, #d6ba63 100%);
  234. border-radius: 60rpx;
  235. height: 60rpx;
  236. padding: 0 36rpx;
  237. image {
  238. width: 30rpx;
  239. height: 30rpx;
  240. margin-right: 10rpx;
  241. }
  242. .name {
  243. font-size: 30rpx;
  244. color: #93794B;
  245. margin-right: 2px;
  246. &:last-child {
  247. margin-right: 0;
  248. }
  249. }
  250. }
  251. .level-ty {
  252. position: absolute;
  253. right: 10px;
  254. bottom: -12px;
  255. font-size: 12px;
  256. color: #fff;
  257. }
  258. .newPeople{
  259. position: absolute;
  260. right:10px;
  261. top: 0px;
  262. font-size: 12px;
  263. color: #fff;
  264. }
  265. .earnings {
  266. margin-top: 50rpx;
  267. .item {
  268. width: calc(25% - 1px);
  269. .count {
  270. font-weight: bold;
  271. font-size: 30rpx;
  272. color: #FFFFFF;
  273. }
  274. .name {
  275. font-weight: 500;
  276. font-size: 28rpx;
  277. color: #FFFFFF;
  278. margin-top: 20rpx;
  279. }
  280. }
  281. .line {
  282. width: 1px;
  283. height: 70rpx;
  284. background: #FFFFFF;
  285. }
  286. }
  287. }
  288. }
  289. .gz {
  290. position: relative;
  291. padding: 0px 20rpx;
  292. margin-top: 20rpx;
  293. .bg {
  294. width: calc(100vw - 40rpx);
  295. height: calc(13vw - 5rpx);
  296. }
  297. .inner {
  298. position: absolute;
  299. width: calc(100% - 80rpx);
  300. height: calc(100% - 10rpx);
  301. left: 40rpx;
  302. top: 0;
  303. .icon {
  304. width: 40rpx;
  305. height: 36rpx;
  306. }
  307. .name {
  308. margin-left: 15rpx;
  309. font-size: 30rpx;
  310. color: #6A4714;
  311. }
  312. .sbtn {
  313. background: linear-gradient(-90deg, #8C5F1D 0%, #8C5F1C 77%, #875916 99%);
  314. border-radius: 25rpx;
  315. height: 50rpx;
  316. line-height: 50rpx;
  317. padding: 0px 25rpx;
  318. font-size: 26rpx;
  319. color: #F0E1C9;
  320. }
  321. }
  322. }
  323. .body {
  324. padding: 20rpx;
  325. position: relative;
  326. .pannel {
  327. background: #fff;
  328. border-radius: 20rpx;
  329. .order-items {
  330. padding: 40rpx 0;
  331. .item {
  332. width: 20%;
  333. image {
  334. width: 56rpx;
  335. height: 56rpx;
  336. }
  337. .name {
  338. font-size: 24rpx;
  339. color: #0C1732;
  340. margin-top: 24rpx;
  341. }
  342. }
  343. }
  344. &.mt20 {
  345. margin-top: 20rpx;
  346. }
  347. .items-title {
  348. font-weight: bold;
  349. font-size: 28rpx;
  350. color: #333333;
  351. padding-left: 40rpx;
  352. padding-top: 30rpx;
  353. }
  354. .shop-name {
  355. font-size: 24rpx;
  356. color: #333333;
  357. padding-right: 10px;
  358. padding-top: 17px;
  359. }
  360. .items {
  361. padding-bottom: 40rpx;
  362. .item {
  363. width: 25%;
  364. margin-top: 50rpx;
  365. image {
  366. width: 60rpx;
  367. height: 60rpx;
  368. }
  369. .name {
  370. font-size: 24rpx;
  371. color: #333;
  372. margin-top: 32rpx;
  373. }
  374. }
  375. }
  376. }
  377. }
  378. /**弹出框 **/
  379. .popwin {
  380. position: fixed;
  381. width: 100%;
  382. height: 100%;
  383. top: 0;
  384. left: 0;
  385. z-index: 88;
  386. }
  387. .popwin .bg {
  388. background: rgba(0, 0, 0, 0.5);
  389. height: 100%;
  390. width: 100%;
  391. position: absolute;
  392. left: 0;
  393. top: 0;
  394. }
  395. .popwin .body {
  396. position: relative;
  397. border-radius: 8px;
  398. width: 100%;
  399. width: 80vw;
  400. right: -7vw;
  401. padding: 0;
  402. }
  403. .popwin .body .bgimg {
  404. width: 80vw;
  405. height: 83vw;
  406. position: absolute;
  407. top: 0;
  408. }
  409. .popwin .body .pop-body {
  410. width: 66vw;
  411. position: relative;
  412. }
  413. .popwin .body .inner {
  414. position: relative;
  415. z-index: 99;
  416. width: calc(100% - 80rpx);
  417. padding: 0px 40rpx;
  418. }
  419. .popwin .body .inner-top {
  420. height: 9vw;
  421. line-height: 9vw;
  422. text-align: center;
  423. font-weight: 500;
  424. font-size: 34rpx;
  425. color: #FEF9F0;
  426. }
  427. .popwin .body .inner-tip {
  428. margin-top: 8vw;
  429. height: 7vw;
  430. text-align: center;
  431. line-height: 7vw;
  432. font-weight: bold;
  433. font-size: 26rpx;
  434. color: #F9FAFA;
  435. }
  436. .max-he {
  437. height: 31vw;
  438. }
  439. .max-he .c {
  440. font-size: 150rpx;
  441. color: #201F1F;
  442. font-weight: bold;
  443. }
  444. .max-he .t {
  445. position: relative;
  446. top: -40rpx;
  447. }
  448. .foot {
  449. height: 22vw;
  450. margin-top: 6vw;
  451. }
  452. .popwin .btn {
  453. background: linear-gradient(0deg, #FAC37B, #FFF5B0);
  454. box-shadow: 2px 7px 7px 0px rgba(161, 23, 36, 0.4);
  455. border-radius: 15rpx;
  456. height: 66rpx;
  457. width: 40vw;
  458. font-size: 38rpx;
  459. color: #97000E;
  460. text-align: center;
  461. line-height: 66rpx
  462. }
  463. .popwin .m-close {
  464. margin-top: 10px;
  465. width: calc(100% - 10vw);
  466. }
  467. .popwin .m-close image {
  468. width: 120rpx;
  469. height: 120rpx;
  470. }
  471. </style>
  472. <script>
  473. import uParse from '@/components/gaoyia-parse/parse.vue';
  474. import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
  475. import customerWiget from '@/components/ui-public/customer-wiget.vue';
  476. import {
  477. mapState,
  478. mapMutations
  479. } from 'vuex';
  480. export default {
  481. components: {
  482. uParse,
  483. maoScroll,
  484. customerWiget
  485. },
  486. computed: mapState(['user', 'sysData']),
  487. data() {
  488. return {
  489. statusBarHeight: 20,
  490. isGg: false,
  491. isNewShow:false
  492. }
  493. },
  494. onLoad() {
  495. this.initView();
  496. },
  497. onShow(options) {
  498. this.checkUserLogin({
  499. page: this,
  500. isLogion: false,
  501. fn: this.init
  502. });
  503. },
  504. methods: {
  505. ...mapMutations(['setSys', 'checkUserLogin']),
  506. initView: function() {
  507. uni.getSystemInfo({
  508. success: (res) => {
  509. this.statusBarHeight = res.statusBarHeight;
  510. }
  511. });
  512. },
  513. /**
  514. *
  515. */
  516. init: function() {
  517. if (this.user.is_mentor) {
  518. this.isGg = true;
  519. }
  520. //获取当前时间的时间戳
  521. let time = Math.round(new Date().getTime()/1000).toString();
  522. if(this.user.fresh_time > time){
  523. this.isNewShow = true
  524. }
  525. },
  526. /**
  527. * 授权登录
  528. */
  529. tapLogin: function() {
  530. uni.navigateTo({
  531. url: "/pages/login/index"
  532. })
  533. },
  534. /**
  535. * 打开Open
  536. * @param {Object} ev
  537. */
  538. tapOpen: function(ev) {
  539. let url = ev.currentTarget.dataset.url;
  540. if (!this.utils.isDefine(this.user)) {
  541. uni.navigateTo({
  542. url: "/pages/login/index"
  543. });
  544. return;
  545. }
  546. this.utils.navigateTo(url);
  547. },
  548. /**
  549. * 交易密钥
  550. */
  551. tapPayment: function() {
  552. if (!this.utils.isDefine(this.user)) {
  553. uni.navigateTo({
  554. url: "/pages/login/index"
  555. });
  556. return;
  557. }
  558. if (this.user.is_payment) {
  559. uni.navigateTo({
  560. url: "/pages/user/userinfo/security/mobileFind"
  561. })
  562. } else {
  563. uni.navigateTo({
  564. url: "/pages/user/userinfo/security/newPass"
  565. })
  566. }
  567. },
  568. tapOpenRz: function() {
  569. if (!this.utils.isDefine(this.user)) {
  570. uni.navigateTo({
  571. url: "/pages/login/index"
  572. });
  573. return;
  574. }
  575. if (this.user.is_auth == 1) {
  576. this.utils.Tip("已实名认证");
  577. return;
  578. }
  579. uni.navigateTo({
  580. url: "/pages/user/approve"
  581. });
  582. },
  583. }
  584. }
  585. </script>