my.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="container-view">
  3. <view class="user-switch-row">
  4. <view class="name-wrap" @tap="handleToUserDtl">{{ userInfo.name }}</view>
  5. <image class="message" :src="QINIU_URL + 'FghCVNMWDBKJpqbIrqoxT-de9Has'" />
  6. </view>
  7. <view class="user-info-wrap">
  8. <image class="head-img" :src="userInfo.headImg" />
  9. <view class="user-name">{{ userInfo.userName }}</view>
  10. <view class="e-mail">{{ userInfo.eMail }}</view>
  11. </view>
  12. <view class="common-tabs">
  13. <view class="item" v-for="(item, index) in commonTabs" :key="index" @click="routerLink(item.url)">
  14. <image :src="QINIU_URL + item.icon" class="icon" />
  15. <view class="name">{{ item.name }}</view>
  16. </view>
  17. </view>
  18. <view class="tabs-wrap">
  19. <view class="tab-item" v-for="(item, index) in baseTabs" :key="index" @click="routerLink(item.url)">
  20. <image :src="QINIU_URL + item.icon" class="icon" />
  21. <view class="name">{{ item.name }}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { QINIU_URL } from '@/common/constant'
  28. export default {
  29. data() {
  30. return {
  31. QINIU_URL,
  32. userInfo: {
  33. name: 'Real name',
  34. userName: 'Kabuda-4',
  35. eMail: '1007929522@Mail.com',
  36. headImg: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.lmGw9aECIAIIvJK_U92f_gAAAA?w=169&h=180&c=7&r=0&o=5&pid=1.7'
  37. }
  38. }
  39. },
  40. computed: {
  41. commonTabs() {
  42. return [
  43. { name: `${this.$t('我的车辆')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  44. { name: `${this.$t('用车人')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  45. { name: `${this.$t('换电套餐')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  46. ]
  47. },
  48. baseTabs() {
  49. const lang = t => this.$t(t)
  50. return [
  51. { name: `${lang('我的订单')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  52. { name: `${lang('换电记录')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  53. { name: `${lang('关于我们')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  54. { name: `${lang('客服中心')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  55. { name: `${lang('设置')}`, url: '', icon: 'Fp6G-Kzb-YUGkP2WR-kjTlIbbTj1' },
  56. ]
  57. }
  58. },
  59. methods: {
  60. handleToUserDtl() {
  61. },
  62. routerLink(url) {
  63. uni.navigateTo({ url })
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. @import './my.scss';
  70. </style>