Index.vue 19 KB

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