Index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <seller-base :show="false">
  3. <view class="div container">
  4. <view class="div common-header-wrap">
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="设置" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="div main-content">
  14. <view class="div" @click="goSettingInfo">
  15. <flex-line :is-link="true" :show-border="true"><text class="span line-name">店铺管理</text></flex-line>
  16. </view>
  17. <view class="div pt-10 pb-10">
  18. <view class="div common-btn ds-button-large" @click="logout">退出登录</view>
  19. </view>
  20. </view>
  21. </view>
  22. </seller-base>
  23. </template>
  24. <script>
  25. import {getFontSize} from '@/util/common'
  26. import TitleHeader from '../../TitleHeader'
  27. import SellerBase from '../SellerBase'
  28. import { mapState, mapMutations } from 'vuex'
  29. import { logout } from '../../../api/seller'
  30. import flexLine from '../../flexLine'
  31. export default {
  32. name: 'Index',
  33. data(){
  34. return {
  35. navHeight:0
  36. }
  37. },
  38. computed:{
  39. fontSize(){
  40. return getFontSize()
  41. },
  42. ...mapState({
  43. seller: state => state.seller.info
  44. })
  45. },
  46. components:{ TitleHeader, SellerBase, flexLine },
  47. mounted(){
  48. // #ifdef MP-WEIXIN
  49. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  50. // #endif
  51. },
  52. methods:{
  53. goBack(){uni.navigateBack({delta:1})},
  54. ...mapMutations({
  55. sellerLogout: 'sellerLogout'
  56. }),
  57. logout () {
  58. logout(this.seller.seller_name).then(res => {
  59. this.sellerLogout()
  60. uni.navigateTo({url:'/pages/home/sellerlogin/Login'})
  61. }).catch(function (error) {
  62. uni.showToast({icon:'none',title: error.message})
  63. })
  64. },
  65. goSettingInfo () {
  66. uni.navigateTo({url:'/pages/seller/setting/Info'})
  67. }
  68. }
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .main-content{background: #fff;padding:0 $pageSpace}
  73. </style>