mine.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view>
  3. <view class="container">
  4. <view class="flex justify-between align-center" style="padding: 40rpx 30rpx;" v-if="isLogin">
  5. <view class="padding-left">
  6. <view class="text-black text-bold text-xl padding-bottom-20">
  7. 薯条汉堡
  8. </view>
  9. <view class="flex align-center padding-top-sm">
  10. <view>
  11. <view class="text-black text-bold">400</view>
  12. <view class="text-gray text-sm margin-top-10">热力</view>
  13. </view>
  14. <view style="height: 60upx;border: #D2D2D2 1px solid; margin: 0 30upx;"></view>
  15. <view>
  16. <view class="text-black text-bold">236</view>
  17. <view class="text-gray text-sm margin-top-10">积分</view>
  18. </view>
  19. <view class="padding-left">
  20. <button class="cu-btn sm line-black round">
  21. <text class="cuIcon-post " style="font-size: 26rpx;margin-right: 4rpx;"></text>
  22. <text v-if="true">修改资料</text>
  23. <text v-else>完善个人信息</text>
  24. </button>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="flex align-center">
  29. <view class="padding-right">
  30. <u-avatar src="/static/test/avatar.png" size="120"></u-avatar>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="text-center padding-sm" v-else>
  35. <view class="margin-bottom">
  36. <u-avatar size="120"></u-avatar>
  37. </view>
  38. <u-button class="custom-style" shape="circle">授权登录</u-button>
  39. </view>
  40. <view class="flex justify-around align-center" style="padding: 10rpx 40rpx 30rpx;">
  41. <view class="flex">
  42. <image src="../../static/mine/points.png" style="width: 80upx;height: 80upx;"></image>
  43. <view class="padding-left-sm">
  44. <view class="text-bold text-lg">积分明细</view>
  45. <view class="text-gray text-sm" style="font-weight: 400;">消费赚积分</view>
  46. </view>
  47. </view>
  48. <view class="flex">
  49. <image src="../../static/mine/hot-value.png" style="width: 80upx;height: 80upx;"></image>
  50. <view class="padding-left-sm">
  51. <view class="text-bold text-lg">热力明细</view>
  52. <view class="text-gray text-sm" style="font-weight: 400;">助力奖赏</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="container">
  58. <block v-for="(item, index) in iconList" :key="index">
  59. <block v-if="item.name == '分割线'">
  60. <view class="padding-20">
  61. <u-line color="#F5F5F5"></u-line>
  62. </view>
  63. </block>
  64. <block v-else>
  65. <view class="flex justify-between align-center" style="padding: 38rpx;">
  66. <view class="flex align-center">
  67. <view class="flex align-center">
  68. <image :src="item.icon" style="width: 38rpx;height: 38rpx;"></image>
  69. </view>
  70. <view class="text-black text-bold padding-left-20" style="font-size: 30rpx;">{{item.name}}
  71. </view>
  72. </view>
  73. <view class="">
  74. <text v-if="item.name!='更换主题'" class="cuIcon-right" style="color: #C4C4C4;"></text>
  75. <u-switch @change="themeChange" v-else v-model="themeChecked" size="40"
  76. active-color="#e72226" inactive-color="#6b4ff2"></u-switch>
  77. </view>
  78. </view>
  79. </block>
  80. </block>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import config from '../../assets/http/config.js'
  86. export default {
  87. data() {
  88. return {
  89. userId: '',
  90. userData: {},
  91. isLogin: true,
  92. isAgency: false,
  93. //更换主题
  94. themeChecked: true,
  95. iconList: [{
  96. name: '我的兑换',
  97. icon: '/static/mine/duihuan.png',
  98. url: '',
  99. show: true
  100. },
  101. {
  102. name: '我的助力',
  103. icon: '/static/mine/zhuli.png',
  104. url: '',
  105. },
  106. {
  107. name: '我的作品',
  108. icon: '/static/mine/zhuli.png',
  109. url: '',
  110. },
  111. {
  112. name: '分割线',
  113. icon: '',
  114. url: ''
  115. },
  116. {
  117. name: '花积分',
  118. icon: '/static/mine/huajifen.png',
  119. url: '',
  120. },
  121. {
  122. name: '更多活动',
  123. icon: '/static/mine/huodong.png',
  124. url: '',
  125. },
  126. {
  127. name: '活动规则',
  128. icon: '/static/mine/guize.png',
  129. url: '',
  130. },
  131. {
  132. name: '更换主题',
  133. icon: '/static/mine/theme.png',
  134. url: '',
  135. },
  136. ],
  137. }
  138. },
  139. methods: {
  140. themeChange() {
  141. if (!this.themeChecked) {
  142. this.$u.vuex('vuex_skin', config.themeBlue.skin)
  143. this.$u.vuex('vuex_theme', config.themeBlue.theme)
  144. } else {
  145. this.$u.vuex('vuex_skin', config.themeRed.skin)
  146. this.$u.vuex('vuex_theme', config.themeRed.theme)
  147. }
  148. }
  149. }
  150. }
  151. </script>
  152. <style>
  153. .container {
  154. margin: 26upx;
  155. background-color: #ffffff;
  156. border-radius: 20upx;
  157. }
  158. .custom-style {
  159. background-color: #5b3ee7;
  160. width: 200upx;
  161. height: 60upx;
  162. color: #ffffff;
  163. }
  164. </style>