Index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="true"><view class="div container">
  3. <title-header />
  4. <view class="div top-wrapper">
  5. <view class="nav-bg">
  6. <image mode="aspectFit" src="../../../static/image/member/bg_wode_com.png" class="img nav-bg-img"></image>
  7. </view>
  8. <view class="div nav-item left-nav-item" @click="goSetting()">
  9. <image mode="aspectFit" src="../../../static/image/member/icon_setting_nor.png" class="img nav-icon">
  10. </view>
  11. <view class="div nav-item right-nav-item" @click="goNews()">
  12. <image mode="aspectFit" src="../../../static/image/member/icon_news_nor.png" class="img nav-icon">
  13. <text class="span" v-if="0"></text>
  14. </view>
  15. <view class="div top-info-wrapper">
  16. <view class="div avatar-wrapper" @click="goProfileInfo">
  17. <image mode="aspectFit"
  18. class="img avatar"
  19. v-bind:src="user.member_avatar+'?'+time"
  20. v-if="isOnline && user && user.member_avatar"
  21. />
  22. </view>
  23. <view
  24. class="p nickname"
  25. @click="goProfileInfo"
  26. >{{ nickname }}</view
  27. >
  28. <view class="p level_name_wrapper" >
  29. <view class='level_name'><image mode="aspectFit" src="../../../static/image/member/usertopicon.png" class="img levelname-icon">{{ getlevelname }}</view>
  30. </view>
  31. </view>
  32. <view class="div info-wrapper">
  33. <view class="div info-item" @click="goPredeposit">
  34. <view class="div item">预存款</view>
  35. <view class="div item price">¥{{ getAvailablePredeposit }}</view>
  36. </view>
  37. <view class="div info-item" @click="goScoreList">
  38. <view class="div item">积分</view>
  39. <view class="div item price">{{ getScore }}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <flex-line class="order-header" :is-link="true" style="padding-top:2.5rem;margin-top:0;" @click.native="goOrder">
  44. <text class="span">我的订单</text>
  45. <text class="span" slot="right">查看全部订单</text>
  46. </flex-line>
  47. <view class="div order-wrapper">
  48. <index-order-item
  49. class="order-item"
  50. testAttr="/pages/member/order/OrderList"
  51. state="state_new"
  52. :src="require('../../../static/image/member/icon_pay_nor.png')"
  53. title="待付款"
  54. :orderNumber="user.order_nopay_count"
  55. >
  56. </index-order-item>
  57. <index-order-item
  58. class="order-item"
  59. testAttr="/pages/member/order/OrderList"
  60. state="state_pay"
  61. :src="require('../../../static/image/member/icon_goods_nor.png')"
  62. title="待发货"
  63. :orderNumber="user.order_noship_count"
  64. >
  65. </index-order-item>
  66. <index-order-item
  67. class="order-item"
  68. testAttr="/pages/member/order/OrderList"
  69. state="state_send"
  70. :src="require('../../../static/image/member/icon_consignee_nor.png')"
  71. title="待收货"
  72. :orderNumber="user.order_noreceipt_count"
  73. >
  74. </index-order-item>
  75. <index-order-item
  76. class="order-item"
  77. testAttr="/pages/member/order/OrderList"
  78. state="state_noeval"
  79. :src="require('../../../static/image/member/icon_prices_nor.png')"
  80. title="待评价"
  81. :orderNumber="user.order_noeval_count"
  82. >
  83. </index-order-item>
  84. </view>
  85. <flex-line class="order-header">
  86. <text class="span">常用工具</text>
  87. </flex-line>
  88. <view class="div manage-wrapper">
  89. <index-manage-item
  90. v-on:onclick="goAccount"
  91. :src="require('../../../static/image/member/icon_purse_pre.png')"
  92. title="我的钱包"
  93. >
  94. </index-manage-item>
  95. <index-manage-item
  96. v-on:onclick="goVrOrder"
  97. :src="require('../../../static/image/member/icon_order_pre.png')"
  98. title="虚拟订单"
  99. >
  100. </index-manage-item>
  101. <index-manage-item
  102. v-on:onclick="goReturn"
  103. :src="require('../../../static/image/member/icon_refund_pre.png')"
  104. title="退款管理"
  105. >
  106. </index-manage-item>
  107. <index-manage-item
  108. v-on:onclick="goFriendList"
  109. :src="require('../../../static/image/member/icon_friend_pre.png')"
  110. title="我的好友"
  111. >
  112. </index-manage-item>
  113. <index-manage-item
  114. v-if="config && config.instant_message_open == '1' && config.instant_message_gateway_url"
  115. v-on:onclick="goMemberChatList"
  116. :src="require('../../../static/image/member/icon_list_pre.png')"
  117. title="聊天列表"
  118. >
  119. </index-manage-item>
  120. <index-manage-item
  121. v-on:onclick="goNavigate('/pages/member/auth/Auth')"
  122. :src="require('../../../static/image/member/icon_testimony_pre.png')"
  123. title="实名认证"
  124. >
  125. </index-manage-item>
  126. <index-manage-item
  127. v-on:onclick="goFavourite()"
  128. :src="require('../../../static/image/member/icon_collect_pre.png')"
  129. title="我的收藏"
  130. >
  131. </index-manage-item>
  132. <index-manage-item
  133. v-on:onclick="goNavigate('/pages/member/consult/ConsultList')"
  134. :src="require('../../../static/image/member/icon_consult_pre.png')"
  135. title="咨询管理"
  136. >
  137. </index-manage-item>
  138. <index-manage-item
  139. v-on:onclick="goNavigate('/pages/member/inform/InformList')"
  140. :src="require('../../../static/image/member/icon_offence_pre.png')"
  141. title="举报管理"
  142. >
  143. </index-manage-item>
  144. <index-manage-item
  145. v-on:onclick="goNavigate('/pages/member/complaint/ComplaintList')"
  146. :src="require('../../../static/image/member/icon_propose_pre.png')"
  147. title="投诉管理"
  148. >
  149. </index-manage-item>
  150. <index-manage-item
  151. v-on:onclick="goInvoice"
  152. :src="require('../../../static/image/member/icon_invoice_pre.png')"
  153. title="发票管理"
  154. >
  155. </index-manage-item>
  156. <index-manage-item
  157. v-on:onclick="goAddress"
  158. :src="require('../../../static/image/member/icon_address_pre.png')"
  159. title="收货地址"
  160. >
  161. </index-manage-item>
  162. <index-manage-item
  163. v-on:onclick="goEvaluateList()"
  164. :src="require('../../../static/image/member/icon_judgea_pre.png')"
  165. title="我的评价"
  166. >
  167. </index-manage-item>
  168. <index-manage-item
  169. v-on:onclick="goArrivalnotice()"
  170. :src="require('../../../static/image/member/icon_notify_pre.png')"
  171. title="到货通知"
  172. >
  173. </index-manage-item>
  174. <index-manage-item
  175. v-on:onclick="goBrowse()"
  176. :src="require('../../../static/image/member/icon_footprint_pre.png')"
  177. title="浏览记录"
  178. >
  179. </index-manage-item>
  180. <index-manage-item
  181. v-on:onclick="goMemberFeedback()"
  182. :src="require('../../../static/image/member/icon_feedback_pre.png')"
  183. title="反馈意见"
  184. >
  185. </index-manage-item>
  186. </view>
  187. <flex-line class="order-header">
  188. <text class="span">我的活动</text>
  189. </flex-line>
  190. <view class="div manage-wrapper">
  191. <index-manage-item
  192. v-on:onclick="goMarketmanagelog()"
  193. :src="require('../../../static/image/member/icon_exercise_pre.png')"
  194. title="活动记录"
  195. >
  196. </index-manage-item>
  197. <index-manage-item
  198. v-on:onclick="gBargain()"
  199. :src="require('../../../static/image/member/icon_bargain_pre.png')"
  200. title="砍价活动"
  201. >
  202. </index-manage-item>
  203. <index-manage-item
  204. v-if="config.points_isuse === '1' && config.points_signin_isuse === '1'"
  205. v-on:onclick="goNavigate('/pages/member/point/PointSignin')"
  206. :src="require('../../../static/image/member/icon_signin_pre.png')"
  207. title="我要签到"
  208. >
  209. </index-manage-item>
  210. <index-manage-item
  211. v-if="config.inviter_open === '1'"
  212. v-on:onclick="goMemberInviterManage()"
  213. :src="require('../../../static/image/member/icon_popularize_pre.png')"
  214. title="推广管理"
  215. >
  216. </index-manage-item>
  217. </view>
  218. <view class="div bottom-wrapper" v-if="!user.store_id && config && config.store_joinin_open!=0">
  219. <flex-line
  220. @click.native="goSellerJoinin"
  221. :is-link="true"
  222. >
  223. <image mode="aspectFit" class="img item-icon" src="../../../static/image/member/icon_shop_seller_nor.png" />
  224. <text class="span">商家入驻</text>
  225. </flex-line>
  226. </view>
  227. <view class="block-wrapper">
  228. <guess-like></guess-like>
  229. </view>
  230. </view></member-base>
  231. </template>
  232. <script>
  233. import {getFontSize} from '@/util/common'
  234. import TitleHeader from '../../TitleHeader'
  235. import { urlencode } from '@/util/common'
  236. import MemberBase from '../MemberBase'
  237. import IndexOrderItem from './IndexOrderItem'
  238. import IndexManageItem from './IndexManageItem'
  239. import flexLine from '../../flexLine'
  240. import GuessLike from '../../GuessLike'
  241. import { mapState, mapActions } from 'vuex'
  242. import { getMemberIndex } from '../../../api/member'
  243. import { checkInviter } from '../../../api/memberInviter'
  244. export default {
  245. name:'MemberIndex',
  246. data () {
  247. return {
  248. user: {},
  249. time: '',
  250. orderCount: {},
  251. isShow: true
  252. }
  253. },
  254. components:{
  255. TitleHeader,
  256. MemberBase,
  257. flexLine,
  258. IndexOrderItem,
  259. IndexManageItem,
  260. GuessLike
  261. },
  262. created: function () {
  263. this.time = new Date().getTime()
  264. this.fetchConfig({}).then(
  265. response => {
  266. },
  267. error => {
  268. uni.showToast({icon:'none',title: error.message})
  269. }
  270. )
  271. if (this.isOnline) {
  272. getMemberIndex().then(
  273. response => {
  274. if (response && response.result.member_info) {
  275. this.user = response.result.member_info
  276. }
  277. },
  278. error => {}
  279. )
  280. }
  281. },
  282. computed:{
  283. fontSize(){
  284. return getFontSize()
  285. },
  286. ...mapState({
  287. isOnline: state => state.member.isOnline,
  288. config: state => state.config.config
  289. }),
  290. nickname () {
  291. let title = '登录/注册'
  292. if (this.isOnline) {
  293. if (
  294. this.user &&
  295. typeof this.user !== 'undefined' &&
  296. JSON.stringify(this.user) !== '{}'
  297. ) {
  298. title = this.user.member_nickname
  299. }
  300. }
  301. return title
  302. },
  303. getScore () {
  304. let score = '0'
  305. if (this.isOnline && this.user.member_points) {
  306. score = this.user.member_points
  307. }
  308. return score
  309. },
  310. // 预存款可用金额 通过store 进行获取
  311. getAvailablePredeposit () {
  312. let availablePredeposit = '0.00'
  313. if (this.isOnline && this.user.available_predeposit) {
  314. availablePredeposit = this.user.available_predeposit
  315. }
  316. return availablePredeposit
  317. },
  318. getlevelname () {
  319. let levelname = ''
  320. if (this.isOnline && this.user.level_name) {
  321. levelname = this.user.level_name
  322. }
  323. return levelname
  324. }
  325. },
  326. methods:{
  327. goNavigate(path,query=false){
  328. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  329. },
  330. ...mapActions({
  331. fetchConfig: 'fetchConfig'
  332. }),
  333. showLogin () {
  334. uni.navigateTo({ url: '/pages/home/memberlogin/Login' })
  335. },
  336. goScoreList () {
  337. if (this.isOnline) {
  338. uni.navigateTo({ url: '/pages/member/point/PointList'+'?'+urlencode( { index: 0 } )})
  339. } else {
  340. this.showLogin()
  341. }
  342. },
  343. goOrder () {
  344. if (this.isOnline) {
  345. uni.navigateTo({ url: '/pages/member/order/OrderList'
  346. })
  347. } else {
  348. this.showLogin()
  349. }
  350. },
  351. goProfileInfo () {
  352. if (this.isOnline) {
  353. uni.navigateTo({ url: '/pages/member/profile/ProfileSet' })
  354. } else {
  355. this.showLogin()
  356. }
  357. },
  358. goSetting () {
  359. uni.navigateTo({ url: '/pages/member/setting/AccountSet' })
  360. },
  361. // 消息通知
  362. goNews () {
  363. if (this.isOnline) {
  364. uni.navigateTo({ url: '/pages/member/notice/NoticeList' })
  365. } else {
  366. this.showLogin()
  367. }
  368. },
  369. // 我的关注
  370. goFavourite () {
  371. if (this.isOnline) {
  372. uni.navigateTo({ url: '/pages/member/favorite/Favorite' })
  373. } else {
  374. this.showLogin()
  375. }
  376. },
  377. // 我的地址
  378. goAddress () {
  379. if (this.isOnline) {
  380. uni.navigateTo({ url: '/pages/member/address/AddressList' })
  381. } else {
  382. this.showLogin()
  383. }
  384. },
  385. // 我的退款
  386. goReturn () {
  387. if (this.isOnline) {
  388. uni.navigateTo({ url: '/pages/member/orderreturn/Orderreturn' })
  389. } else {
  390. this.showLogin()
  391. }
  392. },
  393. goAccount () {
  394. if (this.isOnline) {
  395. uni.navigateTo({ url: '/pages/member/account/Account' })
  396. } else {
  397. this.showLogin()
  398. }
  399. },
  400. goPredeposit () {
  401. if (this.isOnline) {
  402. uni.navigateTo({ url: '/pages/member/predeposit/PredepositList' })
  403. } else {
  404. this.showLogin()
  405. }
  406. },
  407. // 我的好友列表
  408. goFriendList () {
  409. if (this.isOnline) {
  410. uni.navigateTo({ url: '/pages/member/friend/FriendList' })
  411. } else {
  412. this.showLogin()
  413. }
  414. },
  415. // 商家入驻
  416. goSellerJoinin () {
  417. if (this.isOnline) {
  418. uni.navigateTo({ url: '/pages/member/sellerjoinin/Step1' })
  419. } else {
  420. this.showLogin()
  421. }
  422. },
  423. // 聊天列表
  424. goMemberChatList () {
  425. if (this.isOnline) {
  426. uni.navigateTo({ url: '/pages/member/chat/ChatList' })
  427. } else {
  428. this.showLogin()
  429. }
  430. },
  431. // 我的订单评价
  432. goEvaluateList () {
  433. if (this.isOnline) {
  434. uni.navigateTo({ url: '/pages/member/evaluate/EvaluateList' })
  435. } else {
  436. this.showLogin()
  437. }
  438. },
  439. // 发票管理
  440. goInvoice () {
  441. if (this.isOnline) {
  442. uni.navigateTo({ url: '/pages/member/invoice/InvoiceList' })
  443. } else {
  444. this.showLogin()
  445. }
  446. },
  447. // 跳转卖家管理中心
  448. goSellerInfo () {
  449. if (this.isOnline) {
  450. uni.navigateTo({ url: 'SellerIndex' })
  451. } else {
  452. this.showLogin()
  453. }
  454. },
  455. // 分销管理中心
  456. goMemberInviterManage () {
  457. if (this.isOnline) {
  458. checkInviter().then(res => {
  459. uni.navigateTo({ url: '/pages/member/inviter/InviterManage' })
  460. }).catch(function (error) {
  461. uni.showToast({icon:'none',title: error.message})
  462. })
  463. } else {
  464. this.showLogin()
  465. }
  466. },
  467. // 意见反馈
  468. goMemberFeedback () {
  469. if (this.isOnline) {
  470. uni.navigateTo({ url: '/pages/member/feedback/Feedback' })
  471. } else {
  472. this.showLogin()
  473. }
  474. },
  475. // 虚拟订单
  476. goVrOrder () {
  477. if (this.isOnline) {
  478. uni.navigateTo({ url: '/pages/member/vrorder/OrderList' })
  479. } else {
  480. this.showLogin()
  481. }
  482. },
  483. // 活动记录
  484. goMarketmanagelog () {
  485. if (this.isOnline) {
  486. uni.navigateTo({ url: '/pages/member/marketmanagelog/Marketmanagelog' })
  487. } else {
  488. this.showLogin()
  489. }
  490. },
  491. // 砍价活动
  492. gBargain () {
  493. if (this.isOnline) {
  494. uni.navigateTo({ url: '/pages/member/bargain/Bargainlist' })
  495. } else {
  496. this.showLogin()
  497. }
  498. },
  499. // 到货通知
  500. goArrivalnotice () {
  501. if (this.isOnline) {
  502. uni.navigateTo({ url: '/pages/member/arrivalnotice/Arrivalnotice' })
  503. } else {
  504. this.showLogin()
  505. }
  506. },
  507. // 浏览历史
  508. goBrowse () {
  509. if (this.isOnline) {
  510. uni.navigateTo({ url: '/pages/member/browse/BrowseList' })
  511. } else {
  512. this.showLogin()
  513. }
  514. }
  515. }
  516. }
  517. </script>
  518. <style scoped lang="scss">
  519. .container {
  520. display: flex;
  521. flex-direction: column;
  522. justify-content: flex-start;
  523. align-items: stretch;
  524. background-color: #f0f2f5;
  525. .top-wrapper {
  526. position:relative;
  527. height: 11.5rem;
  528. .nav-bg{
  529. width: 100%;
  530. height: 11.5rem;
  531. position: absolute;
  532. overflow: hidden;
  533. .nav-bg-img{
  534. width: 100%;
  535. height: 14.3rem;
  536. }
  537. }
  538. .top-info-wrapper {
  539. flex: 1;
  540. width: 100%;
  541. text-align: center;
  542. }
  543. }
  544. .nav-item {
  545. position: absolute;
  546. display: flex;
  547. justify-content: center;
  548. align-items: center;
  549. top:0.5rem;
  550. .span {
  551. width: 0.4rem;
  552. height: 0.4rem;
  553. background-color: #f0f2f5;
  554. border-radius: 50%;
  555. position: absolute;
  556. top: 0.5rem;
  557. right: 0.5rem;
  558. }
  559. }
  560. .left-nav-item {
  561. left: 0.5rem;
  562. }
  563. .right-nav-item {
  564. right: 0.5rem;
  565. }
  566. .nav-icon {
  567. width: 1.3rem;
  568. height: 1.3rem;
  569. text-align: center;
  570. color: #fff;
  571. }
  572. .avatar-wrapper {
  573. position:relative;
  574. width: 4.4rem;
  575. height: 4.4rem;
  576. border-radius: 50%;
  577. background-color: #fff;
  578. margin:0 auto;
  579. margin-top: 1rem;
  580. .avatar {
  581. width: 4rem;
  582. height: 4rem;
  583. border-radius: 50%;
  584. position:absolute;
  585. top:.2rem;
  586. left:.2rem;
  587. }
  588. }
  589. .nickname {
  590. width: 100%;
  591. margin-top: 0.75rem;
  592. font-size: $subFontSize;
  593. color: rgba(255, 255, 255, 1);
  594. text-align: center;
  595. margin-left: 0;
  596. margin-right: 0;
  597. }
  598. .level_name_wrapper{
  599. font-size: .6rem;
  600. color: rgba(255, 255, 255, 1);
  601. text-align: center;
  602. margin-left: 0;
  603. margin-right: 0;
  604. border-radius: .2rem;
  605. border: 1px solid #fff;
  606. display: inline-block;
  607. padding: 0.1rem .2rem;
  608. }
  609. .level_name{
  610. display: flex;
  611. align-items: center;
  612. }
  613. .levelname-icon{
  614. width: 1rem;
  615. height: .6rem;
  616. padding-right: .2rem;
  617. }
  618. .info-wrapper {
  619. position: absolute;
  620. bottom:-2rem;
  621. left:1.5rem;
  622. right:1.5rem;
  623. display: inline-flex;
  624. flex-direction: row;
  625. justify-content: flex-start;
  626. align-content: stretch;
  627. background-color: #fff;
  628. border-radius: .4rem;
  629. box-shadow: 0px 4px 4px #f7f7f7;
  630. z-index: 2;
  631. }
  632. .info-item {
  633. flex: 1;
  634. text-align: center;
  635. font-size: $h2;
  636. color:$formInputColor;
  637. position: relative;
  638. &:first-child::after{content:'';position: absolute;top:.5rem;bottom:.5rem;right:0;border-right: 1px dashed #eee;}
  639. .item{padding-top:.5rem;}
  640. .price{color:$primaryColor;padding-bottom:.5rem;font-size: 1.1rem;}
  641. }
  642. .order-header {
  643. background-color: #fff;
  644. padding:0 $pageSpace;
  645. margin-top:$modelSpace;
  646. }
  647. .item-title {
  648. font-size: $subFontSize;
  649. color: $formInputColor;
  650. font-weight:700;
  651. }
  652. .order-subtitle {
  653. font-size: $fontSize;
  654. color: $descTextColor;
  655. }
  656. .order-wrapper {
  657. height: 4rem;
  658. display: flex;
  659. flex-direction: row;
  660. justify-content: space-between;
  661. align-items: stretch;
  662. background-color: #fff;
  663. }
  664. .order-item {
  665. flex: 1;
  666. }
  667. .block-wrapper{
  668. margin-top:$modelSpace;
  669. }
  670. .bottom-wrapper {
  671. display: flex;
  672. flex-direction: column;
  673. justify-content: flex-start;
  674. align-items: stretch;
  675. margin-top:$modelSpace;
  676. background: #fff;
  677. padding:0 $pageSpace;
  678. .item-icon{
  679. width:1.2rem;
  680. height:1.2rem;
  681. margin-right: .4rem;
  682. }
  683. }
  684. .manage-wrapper {
  685. background: #fff;
  686. }
  687. }
  688. </style>