Index.vue 19 KB

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