index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <page-theme :theme="theme">
  3. <template>
  4. <view class="p-30">
  5. <view class="flex-dir-row flex-y-center m-b-20">
  6. <u-avatar :src="face" size="60" />
  7. <view class="m-l-30">
  8. <view class="f-34 t-bold m-b-10">{{nickName}}</view>
  9. <u-icon name="arrow-right" size="15" :color="$u.color['info']" @click="toProfile" label="更新个人信息"
  10. labelPos="left" labelSize="15" :labelColor="$u.color['info']" />
  11. </view>
  12. </view>
  13. <view v-for="(item,i) in allCells" :key="i" class="m-t-20">
  14. <bt-cell :cells="item" />
  15. </view>
  16. <!-- <view class="flex-dir-row flex-x-between m-t-20 f-28">
  17. <view class="flex-dir-row flex-x-center flex-y-center p-b-t-20 border-round-10 c-g-white width-100"
  18. @click="toLogout">
  19. <u--image src="/static/images/logout.png" width="20px" height="20px" />
  20. <view class="m-l-10 col-info">退出登录</view>
  21. </view>
  22. </view> -->
  23. <view class="f-24 col-info-m t-c width-100 m-t-40" @click.stop="clickVersion">当前版本:{{version}}</view>
  24. </view>
  25. </template>
  26. </page-theme>
  27. </template>
  28. <script>
  29. import btCell from '@/pages/components/btcell.vue'
  30. import {
  31. version
  32. } from '@/common/setting'
  33. import {
  34. clickEvent
  35. } from '@/utils/util.js'
  36. import themeMixins from '../mixins/themeMixins.js';
  37. export default {
  38. mixins: [themeMixins],
  39. components: {
  40. btCell
  41. },
  42. data() {
  43. return {
  44. face: '',
  45. nickName: '',
  46. version: version,
  47. allCells: [
  48. [{
  49. icon: '',
  50. text: '名菜收藏',
  51. url: '/pages/yuecai/collection/index?type=dish',
  52. }, {
  53. icon: '',
  54. text: '名点收藏',
  55. url: '/pages/yuecai/collection/index?type=location',
  56. }, {
  57. icon: '',
  58. text: '名店收藏',
  59. url: '/pages/yuecai/collection/index?type=restaurant',
  60. }],
  61. [{
  62. icon: '',
  63. text: '用户协议',
  64. url: '/pages/yuecai/usercenter/protocol/index',
  65. }, {
  66. icon: '',
  67. text: '了解隐私保护政策',
  68. url: '/pages/yuecai/usercenter/privacy/index',
  69. }, {
  70. icon: '',
  71. text: '关于我们',
  72. url: './aboutus',
  73. }],
  74. ],
  75. }
  76. },
  77. methods: {
  78. toProfile() { //个人信息
  79. uni.navigateTo({
  80. url: './profile/index',
  81. })
  82. },
  83. toQuestion() {
  84. },
  85. toService() {
  86. },
  87. toLogout() {
  88. this.$u.func.logout()
  89. },
  90. clickVersion(e) { //点击版本号
  91. if (this.userInfo.nick_name == '嘉曦') { //满足条件就支持双击
  92. clickEvent(e, null, this.showMeTheMoney)
  93. }
  94. },
  95. showMeTheMoney() { //作弊
  96. if (!this.userInfo.isVIP) { //不是VIP,就作弊
  97. this.$u.vuex('userInfo.isVIP', true) //给予VIP
  98. uni.reLaunch({ //跳回登录页,但是不登出,让tab页重新加载
  99. url: '../../index',
  100. })
  101. }
  102. },
  103. refresh(face, nickName) {
  104. this.face = face
  105. this.nickName = nickName
  106. },
  107. },
  108. onShow() {
  109. this.face = this.userInfo.avatar || '/static/images/face.png'
  110. this.nickName = this.userInfo.nick_name || '小机灵鬼'
  111. },
  112. onUnload() {
  113. },
  114. }
  115. </script>
  116. <style scoped lang="scss">
  117. .k-pink {
  118. background-color: #FDEAD2;
  119. }
  120. </style>