球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.0 KiB

3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <view>
  3. <u-cell-group :border="false">
  4. <u-cell title="头像" :isLink="false" :border="false" @click="previewImage">
  5. <u-avatar size="40" slot="value" :src="userInfo.avatar"></u-avatar>
  6. </u-cell>
  7. <u-cell title="昵称" :isLink="false" :border="false" :value="userInfo.nick_name"></u-cell>
  8. <u-cell title="收货地址" :isLink="true" :border="false" url="/packages/address/address"></u-cell>
  9. <u-cell title="系统消息" :isLink="true" :border="false" url="/packages/notify/notify">
  10. <u-badge class="badge" slot="value" numberType="overflow" max="99" :value="sysDots"></u-badge>
  11. </u-cell>
  12. <u-cell title="我的分销优惠码" :isLink="true" :border="false" url="/packages/agent/agent" v-if="isAgent()"></u-cell>
  13. <u-cell title="退出登录" :isLink="true" :border="false" @click="logout"></u-cell>
  14. </u-cell-group>
  15. <view class="fixed-tips">{{ version ? 'v'+ version : '' }}</view>
  16. </view>
  17. </template>
  18. <script>
  19. import { my } from '@/service/index.js';
  20. export default {
  21. data() {
  22. return {
  23. src:"https://cdn.uviewui.com/uview/album/1.jpg",
  24. userInfo: {},
  25. version: '',
  26. sysDots:0,
  27. }
  28. },
  29. onLoad(){
  30. this.userInfo = uni.getStorageSync('userInfo') || {};
  31. let miniProgram = wx.getAccountInfoSync().miniProgram;
  32. if(miniProgram.version){
  33. this.version = miniProgram.version;
  34. }
  35. },
  36. onShow(){
  37. this.getUserCenterDetail()
  38. },
  39. methods: {
  40. async getUserCenterDetail(){
  41. let res = await my();
  42. this.sysDots = res.data.datas.dots.system
  43. },
  44. logout(){
  45. uni.removeStorage({key:'userInfo'});
  46. uni.removeStorage({key:'qxk_sysinfo'});
  47. uni.reLaunch({
  48. url: 'pages/login/login'
  49. });
  50. },
  51. previewImage(){
  52. uni.previewImage({
  53. urls: [this.userInfo.avatar]
  54. })
  55. },
  56. isAgent(){
  57. return this.userInfo.is_agent
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .fixed-tips{
  64. position: fixed;
  65. bottom: 8vh;
  66. width: 750rpx;
  67. left: 0;
  68. text-align: center;
  69. font-size: 26rpx;
  70. color: #bdc3c7;
  71. }
  72. </style>