Index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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 , mapMutations} 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. this.memberUpdate({info:response.result.member_info})
  278. }
  279. },
  280. error => {}
  281. )
  282. }
  283. },
  284. computed:{
  285. fontSize(){
  286. return getFontSize()
  287. },
  288. ...mapState({
  289. isOnline: state => state.member.isOnline,
  290. config: state => state.config.config
  291. }),
  292. nickname () {
  293. let title = '登录/注册'
  294. if (this.isOnline) {
  295. if (
  296. this.user &&
  297. typeof this.user !== 'undefined' &&
  298. JSON.stringify(this.user) !== '{}'
  299. ) {
  300. title = this.user.member_nickname
  301. }
  302. }
  303. return title
  304. },
  305. getScore () {
  306. let score = '0'
  307. if (this.isOnline && this.user.member_points) {
  308. score = this.user.member_points
  309. }
  310. return score
  311. },
  312. // 预存款可用金额 通过store 进行获取
  313. getAvailablePredeposit () {
  314. let availablePredeposit = '0.00'
  315. if (this.isOnline && this.user.available_predeposit) {
  316. availablePredeposit = this.user.available_predeposit
  317. }
  318. return availablePredeposit
  319. },
  320. getlevelname () {
  321. let levelname = ''
  322. if (this.isOnline && this.user.level_name) {
  323. levelname = this.user.level_name
  324. }
  325. return levelname
  326. }
  327. },
  328. methods:{
  329. ...mapMutations({
  330. memberUpdate: 'memberUpdate',
  331. }),
  332. goNavigate(path,query=false){
  333. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  334. },
  335. ...mapActions({
  336. fetchConfig: 'fetchConfig'
  337. }),
  338. showLogin () {
  339. uni.navigateTo({ url: '/pages/home/memberlogin/Login' })
  340. },
  341. goScoreList () {
  342. if (this.isOnline) {
  343. uni.navigateTo({ url: '/pages/member/point/PointList'+'?'+urlencode( { index: 0 } )})
  344. } else {
  345. this.showLogin()
  346. }
  347. },
  348. goOrder () {
  349. if (this.isOnline) {
  350. uni.navigateTo({ url: '/pages/member/order/OrderList'
  351. })
  352. } else {
  353. this.showLogin()
  354. }
  355. },
  356. goProfileInfo () {
  357. if (this.isOnline) {
  358. uni.navigateTo({ url: '/pages/member/profile/ProfileSet' })
  359. } else {
  360. this.showLogin()
  361. }
  362. },
  363. goSetting () {
  364. uni.navigateTo({ url: '/pages/member/setting/AccountSet' })
  365. },
  366. // 消息通知
  367. goNews () {
  368. if (this.isOnline) {
  369. uni.navigateTo({ url: '/pages/member/notice/NoticeList' })
  370. } else {
  371. this.showLogin()
  372. }
  373. },
  374. // 我的关注
  375. goFavourite () {
  376. if (this.isOnline) {
  377. uni.navigateTo({ url: '/pages/member/favorite/Favorite' })
  378. } else {
  379. this.showLogin()
  380. }
  381. },
  382. // 我的地址
  383. goAddress () {
  384. if (this.isOnline) {
  385. uni.navigateTo({ url: '/pages/member/address/AddressList' })
  386. } else {
  387. this.showLogin()
  388. }
  389. },
  390. // 我的退款
  391. goReturn () {
  392. if (this.isOnline) {
  393. uni.navigateTo({ url: '/pages/member/orderreturn/Orderreturn' })
  394. } else {
  395. this.showLogin()
  396. }
  397. },
  398. goAccount () {
  399. if (this.isOnline) {
  400. uni.navigateTo({ url: '/pages/member/account/Account' })
  401. } else {
  402. this.showLogin()
  403. }
  404. },
  405. goPredeposit () {
  406. if (this.isOnline) {
  407. uni.navigateTo({ url: '/pages/member/predeposit/PredepositList' })
  408. } else {
  409. this.showLogin()
  410. }
  411. },
  412. // 我的好友列表
  413. goFriendList () {
  414. if (this.isOnline) {
  415. uni.navigateTo({ url: '/pages/member/friend/FriendList' })
  416. } else {
  417. this.showLogin()
  418. }
  419. },
  420. // 商家入驻
  421. goSellerJoinin () {
  422. if (this.isOnline) {
  423. uni.navigateTo({ url: '/pages/member/sellerjoinin/Step1' })
  424. } else {
  425. this.showLogin()
  426. }
  427. },
  428. // 聊天列表
  429. goMemberChatList () {
  430. if (this.isOnline) {
  431. uni.navigateTo({ url: '/pages/member/chat/ChatList' })
  432. } else {
  433. this.showLogin()
  434. }
  435. },
  436. // 我的订单评价
  437. goEvaluateList () {
  438. if (this.isOnline) {
  439. uni.navigateTo({ url: '/pages/member/evaluate/EvaluateList' })
  440. } else {
  441. this.showLogin()
  442. }
  443. },
  444. // 发票管理
  445. goInvoice () {
  446. if (this.isOnline) {
  447. uni.navigateTo({ url: '/pages/member/invoice/InvoiceList' })
  448. } else {
  449. this.showLogin()
  450. }
  451. },
  452. // 跳转卖家管理中心
  453. goSellerInfo () {
  454. if (this.isOnline) {
  455. uni.navigateTo({ url: 'SellerIndex' })
  456. } else {
  457. this.showLogin()
  458. }
  459. },
  460. // 分销管理中心
  461. goMemberInviterManage () {
  462. if (this.isOnline) {
  463. checkInviter().then(res => {
  464. uni.navigateTo({ url: '/pages/member/inviter/InviterManage' })
  465. }).catch(function (error) {
  466. uni.showToast({icon:'none',title: error.message})
  467. })
  468. } else {
  469. this.showLogin()
  470. }
  471. },
  472. // 意见反馈
  473. goMemberFeedback () {
  474. if (this.isOnline) {
  475. uni.navigateTo({ url: '/pages/member/feedback/Feedback' })
  476. } else {
  477. this.showLogin()
  478. }
  479. },
  480. // 虚拟订单
  481. goVrOrder () {
  482. if (this.isOnline) {
  483. uni.navigateTo({ url: '/pages/member/vrorder/OrderList' })
  484. } else {
  485. this.showLogin()
  486. }
  487. },
  488. // 活动记录
  489. goMarketmanagelog () {
  490. if (this.isOnline) {
  491. uni.navigateTo({ url: '/pages/member/marketmanagelog/Marketmanagelog' })
  492. } else {
  493. this.showLogin()
  494. }
  495. },
  496. // 砍价活动
  497. gBargain () {
  498. if (this.isOnline) {
  499. uni.navigateTo({ url: '/pages/member/bargain/Bargainlist' })
  500. } else {
  501. this.showLogin()
  502. }
  503. },
  504. // 到货通知
  505. goArrivalnotice () {
  506. if (this.isOnline) {
  507. uni.navigateTo({ url: '/pages/member/arrivalnotice/Arrivalnotice' })
  508. } else {
  509. this.showLogin()
  510. }
  511. },
  512. // 浏览历史
  513. goBrowse () {
  514. if (this.isOnline) {
  515. uni.navigateTo({ url: '/pages/member/browse/BrowseList' })
  516. } else {
  517. this.showLogin()
  518. }
  519. }
  520. }
  521. }
  522. </script>
  523. <style scoped lang="scss">
  524. .container {
  525. display: flex;
  526. flex-direction: column;
  527. justify-content: flex-start;
  528. align-items: stretch;
  529. background-color: #f0f2f5;
  530. .top-wrapper {
  531. position:relative;
  532. height: 11.5rem;
  533. .nav-bg{
  534. width: 100%;
  535. height: 11.5rem;
  536. position: absolute;
  537. overflow: hidden;
  538. .nav-bg-img{
  539. width: 100%;
  540. height: 14.3rem;
  541. }
  542. }
  543. .top-info-wrapper {
  544. flex: 1;
  545. width: 100%;
  546. text-align: center;
  547. }
  548. }
  549. .nav-item {
  550. position: absolute;
  551. display: flex;
  552. justify-content: center;
  553. align-items: center;
  554. top:0.5rem;
  555. .span {
  556. width: 0.4rem;
  557. height: 0.4rem;
  558. background-color: #f0f2f5;
  559. border-radius: 50%;
  560. position: absolute;
  561. top: 0.5rem;
  562. right: 0.5rem;
  563. }
  564. }
  565. .left-nav-item {
  566. left: 0.5rem;
  567. }
  568. .right-nav-item {
  569. right: 0.5rem;
  570. }
  571. .nav-icon {
  572. width: 1.3rem;
  573. height: 1.3rem;
  574. text-align: center;
  575. color: #fff;
  576. }
  577. .avatar-wrapper {
  578. position:relative;
  579. width: 4.4rem;
  580. height: 4.4rem;
  581. border-radius: 50%;
  582. background-color: #fff;
  583. margin:0 auto;
  584. margin-top: 1rem;
  585. .avatar {
  586. width: 4rem;
  587. height: 4rem;
  588. border-radius: 50%;
  589. position:absolute;
  590. top:.2rem;
  591. left:.2rem;
  592. }
  593. }
  594. .nickname {
  595. width: 100%;
  596. margin-top: 0.75rem;
  597. font-size: $subFontSize;
  598. color: rgba(255, 255, 255, 1);
  599. text-align: center;
  600. margin-left: 0;
  601. margin-right: 0;
  602. }
  603. .level_name_wrapper{
  604. font-size: .6rem;
  605. color: rgba(255, 255, 255, 1);
  606. text-align: center;
  607. margin-left: 0;
  608. margin-right: 0;
  609. border-radius: .2rem;
  610. border: 1px solid #fff;
  611. display: inline-block;
  612. padding: 0.1rem .2rem;
  613. }
  614. .level_name{
  615. display: flex;
  616. align-items: center;
  617. }
  618. .levelname-icon{
  619. width: 1rem;
  620. height: .6rem;
  621. padding-right: .2rem;
  622. }
  623. .info-wrapper {
  624. position: absolute;
  625. bottom:-2rem;
  626. left:1.5rem;
  627. right:1.5rem;
  628. display: inline-flex;
  629. flex-direction: row;
  630. justify-content: flex-start;
  631. align-content: stretch;
  632. background-color: #fff;
  633. border-radius: .4rem;
  634. box-shadow: 0px 4px 4px #f7f7f7;
  635. z-index: 2;
  636. }
  637. .info-item {
  638. flex: 1;
  639. text-align: center;
  640. font-size: $h2;
  641. color:$formInputColor;
  642. position: relative;
  643. &:first-child::after{content:'';position: absolute;top:.5rem;bottom:.5rem;right:0;border-right: 1px dashed #eee;}
  644. .item{padding-top:.5rem;}
  645. .price{color:$primaryColor;padding-bottom:.5rem;font-size: 1.1rem;}
  646. }
  647. .order-header {
  648. background-color: #fff;
  649. padding:0 $pageSpace;
  650. margin-top:$modelSpace;
  651. }
  652. .item-title {
  653. font-size: $subFontSize;
  654. color: $formInputColor;
  655. font-weight:700;
  656. }
  657. .order-subtitle {
  658. font-size: $fontSize;
  659. color: $descTextColor;
  660. }
  661. .order-wrapper {
  662. height: 4rem;
  663. display: flex;
  664. flex-direction: row;
  665. justify-content: space-between;
  666. align-items: stretch;
  667. background-color: #fff;
  668. }
  669. .order-item {
  670. flex: 1;
  671. }
  672. .block-wrapper{
  673. margin-top:$modelSpace;
  674. }
  675. .bottom-wrapper {
  676. display: flex;
  677. flex-direction: column;
  678. justify-content: flex-start;
  679. align-items: stretch;
  680. margin-top:$modelSpace;
  681. background: #fff;
  682. padding:0 $pageSpace;
  683. .item-icon{
  684. width:1.2rem;
  685. height:1.2rem;
  686. margin-right: .4rem;
  687. }
  688. }
  689. .manage-wrapper {
  690. background: #fff;
  691. }
  692. }
  693. </style>