index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <scroll-view scroll-y class="content">
  3. <div class="user">
  4. <van-cell center :value="userInfo.nickName" @click="showVConsole">
  5. <view slot="title">
  6. <image class="user-headImg" :src="userInfo.headImage"></image>
  7. </view>
  8. </van-cell>
  9. <van-cell-group class="group">
  10. <!-- <van-cell title="我要提现" value="" is-link center @click="goCashOut">
  11. </van-cell> -->
  12. <!-- <van-cell title="我的下级" value="" is-link center @click="goMyBranch">
  13. <template #icon>
  14. <m-icon type="hyyxq" class="cell-icon" />
  15. </template>
  16. </van-cell> -->
  17. <!-- <van-cell
  18. title="我的推广积分"
  19. value=""
  20. is-link
  21. center
  22. @click="goMyIntegral"
  23. >
  24. </van-cell> -->
  25. <van-cell
  26. title="会员有效期"
  27. :value="expireTime ? expireTime : '开通会员'"
  28. is-link
  29. center
  30. url="/otherPages/buyVip/index"
  31. >
  32. </van-cell>
  33. </van-cell-group>
  34. <van-cell-group class="group">
  35. <van-cell
  36. title="反馈帮助"
  37. is-link
  38. center
  39. url="/pages/webview/webview?src=https://support.qq.com/product/359609"
  40. >
  41. <template #icon>
  42. <m-icon type="fkbz" class="cell-icon" />
  43. </template>
  44. </van-cell>
  45. </van-cell-group>
  46. </div>
  47. <!-- <view class="ad-box serviceBox">
  48. <ad unit-id="adunit-d8c1548cc9663765"></ad>
  49. </view> -->
  50. </scroll-view>
  51. </template>
  52. <script>
  53. export default {
  54. computed: {
  55. userInfo() {
  56. return this.$store.state.user.userInfo;
  57. },
  58. expireTime(){
  59. return this.$store.state.user.userInfo.expireTime&&this.$store.getters.isVip?this.$store.state.user.userInfo.expireTime.split(" ")[0]:null
  60. }
  61. },
  62. mounted() {
  63. this.$store.dispatch("GetInfo");
  64. },
  65. methods: {
  66. async getUserProfile(e) {
  67. let userInfo = await wx.getUserProfile({
  68. desc: "业务需要",
  69. });
  70. let updateRes = await this.$api.user.updateUserInfo({
  71. headImage: userInfo.userInfo.avatarUrl,
  72. nickName: userInfo.userInfo.nickName,
  73. });
  74. if (updateRes.code == 200) {
  75. uni.setStorageSync("userInfo", userInfo.userInfo);
  76. this.$store.state.user.userInfo.headImage = userInfo.userInfo.avatarUrl;
  77. this.$store.state.user.userInfo.nickName = userInfo.userInfo.nickName;
  78. }
  79. },
  80. },
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .user {
  85. background-color: #f2f3f5;
  86. /* height: 100vh; */
  87. .group {
  88. margin: 10px 0;
  89. }
  90. .user-avatar {
  91. width: 46px;
  92. height: 46px;
  93. margin-right: 10px;
  94. }
  95. }
  96. .user-headImg{
  97. width: 90rpx;
  98. height: 90rpx;
  99. border-radius: 50%;
  100. }
  101. .cell-icon {
  102. margin-right: 5px;
  103. }
  104. </style>