国外MOSE官网
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.

336 lines
7.8 KiB

6 days ago
  1. <template>
  2. <view class="my-page">
  3. <!-- 顶部渐变背景区域 -->
  4. <view class="header-section">
  5. <!-- 右上角图标 -->
  6. <view class="header-icons">
  7. <uv-icon name="more-dot-fill" size="20" color="white"></uv-icon>
  8. <uv-icon name="setting" size="20" color="white"></uv-icon>
  9. </view>
  10. <!-- 用户信息区域 -->
  11. <view class="user-info">
  12. <view class="avatar-container">
  13. <image class="avatar" src="/static/默认头像.png" mode="aspectFill"></image>
  14. </view>
  15. <text class="username">小精灵</text>
  16. </view>
  17. </view>
  18. <!-- 积分信息区域 -->
  19. <view class="points-section">
  20. <view class="points-item yellow" @click="navigateTo('favoritesActivity')">
  21. <view class="points-content">
  22. <text class="points-number ">5</text>
  23. <text class="points-label yellow">我的收藏</text>
  24. </view>
  25. <view class="points-icon">
  26. <uv-icon name="star-fill" size="28" color="#FFD700"></uv-icon>
  27. </view>
  28. </view>
  29. <view class="points-item blue">
  30. <view class="points-content">
  31. <text class="points-number">41</text>
  32. <text class="points-label blue">可用积分</text>
  33. </view>
  34. <view class="points-icon">
  35. <uv-icon name="integral" size="28" color="#4A90E2"></uv-icon>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 常用功能区域 -->
  40. <view class="functions-container">
  41. <text class="section-title">常用功能</text>
  42. <view class="functions-grid">
  43. <!-- 第一行 -->
  44. <view class="function-item" @click="navigateTo('profile')">
  45. <image class="function-icon" src="/static/我的_我的资料.png" mode="aspectFit"></image>
  46. <text class="function-text">我的资料</text>
  47. </view>
  48. <view class="function-item" @click="navigateTo('reports')">
  49. <image class="function-icon" src="/static/我的_我的报名.png" mode="aspectFit"></image>
  50. <text class="function-text">我的报名</text>
  51. </view>
  52. <view class="function-item" @click="navigateTo('records')">
  53. <image class="function-icon" src="/static/我的_兑换记录.png" mode="aspectFit"></image>
  54. <text class="function-text">兑换记录</text>
  55. </view>
  56. <view class="function-item" @click="navigateTo('favorites')">
  57. <image class="function-icon" src="/static/我的_商品收藏.png" mode="aspectFit"></image>
  58. <text class="function-text">商品收藏</text>
  59. </view>
  60. <!-- 第二行 -->
  61. <view class="function-item" @click="logout">
  62. <image class="function-icon" src="/static/我的_退出登录.png" mode="aspectFit"></image>
  63. <text class="function-text">退出登录</text>
  64. </view>
  65. <view class="function-item" @click="navigateTo('about')">
  66. <image class="function-icon" src="/static/我的_关于我们.png" mode="aspectFit"></image>
  67. <text class="function-text">关于我们</text>
  68. </view>
  69. <view class="function-item" @click="navigateTo('checkin')">
  70. <view class="function-icon-wrapper">
  71. <uv-icon name="file-text-fill" size="32" color="#218cdd"></uv-icon>
  72. </view>
  73. <text class="function-text">活动签到</text>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. name: 'MyPage',
  82. data() {
  83. return {
  84. userInfo: {
  85. name: '小精灵',
  86. avatar: '/static/默认头像.png',
  87. favorites: 5,
  88. points: 41
  89. }
  90. }
  91. },
  92. methods: {
  93. navigateTo(page) {
  94. console.log('导航到:', page)
  95. // 根据不同页面进行导航
  96. switch(page) {
  97. case 'profile':
  98. uni.navigateTo({
  99. url: '/subPages/my/myProfile'
  100. })
  101. break
  102. case 'reports':
  103. uni.navigateTo({
  104. url: '/subPages/my/myRegistrations'
  105. })
  106. break
  107. case 'records':
  108. uni.navigateTo({
  109. url: '/subPages/my/exchangeRecord'
  110. })
  111. break
  112. case 'favorites':
  113. uni.navigateTo({
  114. url: '/subPages/my/productFavorites'
  115. })
  116. break
  117. case 'favoritesActivity':
  118. uni.navigateTo({
  119. url: '/subPages/my/activityFavorites'
  120. })
  121. break
  122. case 'about':
  123. // 关于我们页面
  124. break
  125. case 'checkin':
  126. uni.navigateTo({
  127. url: '/subPages/my/activityCheckin'
  128. })
  129. break
  130. default:
  131. break
  132. }
  133. },
  134. logout() {
  135. uni.showModal({
  136. title: '提示',
  137. content: '确定要退出登录吗?',
  138. success: (res) => {
  139. if (res.confirm) {
  140. // 清除用户信息
  141. uni.removeStorageSync('userInfo')
  142. uni.showToast({
  143. title: '已退出登录',
  144. icon: 'success'
  145. })
  146. // 跳转到登录页面
  147. setTimeout(() => {
  148. uni.reLaunch({
  149. url: '/subPages/login/login'
  150. })
  151. }, 1500)
  152. }
  153. }
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .my-page {
  161. min-height: 100vh;
  162. background-color: #FFFFFF;
  163. }
  164. // 顶部渐变背景区域
  165. .header-section {
  166. background: linear-gradient(180deg, #1488db, #98b5f1);
  167. padding: 60rpx 40rpx 80rpx;
  168. position: relative;
  169. }
  170. .header-icons {
  171. display: flex;
  172. justify-content: flex-end;
  173. gap: 32rpx;
  174. margin-bottom: 40rpx;
  175. }
  176. // 用户信息区域
  177. .user-info {
  178. display: flex;
  179. flex-direction: column;
  180. align-items: center;
  181. margin-bottom: 60rpx;
  182. }
  183. .avatar-container {
  184. width: 120rpx;
  185. height: 120rpx;
  186. border-radius: 50%;
  187. overflow: hidden;
  188. margin-bottom: 20rpx;
  189. border: 4rpx solid rgba(255, 255, 255, 0.3);
  190. }
  191. .avatar {
  192. width: 100%;
  193. height: 100%;
  194. }
  195. .username {
  196. font-size: 30rpx;
  197. color: #000000;
  198. // font-weight: bold;
  199. }
  200. // 积分信息区域
  201. .points-section {
  202. display: flex;
  203. justify-content: space-between;
  204. margin: 30rpx 30rpx;
  205. gap: 24rpx;
  206. }
  207. .points-item {
  208. border-radius: 12rpx;
  209. padding: 32rpx 24rpx;
  210. flex: 1;
  211. display: flex;
  212. align-items: center;
  213. justify-content: space-between;
  214. position: relative;
  215. box-shadow: 0px 1.5px 3px 0px rgba(0,0,0,0.16);
  216. &.yellow {
  217. background: #FEF4D1;
  218. }
  219. &.blue {
  220. background: #C7E6FF;
  221. }
  222. }
  223. .points-content {
  224. display: flex;
  225. flex-direction: column;
  226. align-items: flex-start;
  227. }
  228. .points-number {
  229. font-size: 48rpx;
  230. color: #000000;
  231. font-weight: bold;
  232. line-height: 1;
  233. }
  234. .points-label {
  235. font-size: 24rpx;
  236. color: #000000;
  237. font-size: 24rpx;
  238. // color: white;
  239. margin-top: 8rpx;
  240. &.yellow{
  241. color: #DEB31B;
  242. }
  243. &.blue{
  244. color: #1488db;
  245. }
  246. }
  247. .points-icon {
  248. display: flex;
  249. align-items: center;
  250. justify-content: center;
  251. }
  252. // 常用功能区域
  253. .functions-container {
  254. height: 319px;
  255. background: #ffffff;
  256. border-radius: 8px;
  257. box-shadow: 0px 1.5px 3px 0px rgba(0,0,0,0.16);
  258. margin: 20rpx 30rpx;
  259. padding: 40rpx;
  260. }
  261. .section-title {
  262. font-size: 32rpx;
  263. color: #333;
  264. font-weight: bold;
  265. margin-bottom: 40rpx;
  266. display: block;
  267. }
  268. .functions-grid {
  269. display: grid;
  270. grid-template-columns: repeat(4, 1fr);
  271. gap: 40rpx 10rpx;
  272. }
  273. .function-item {
  274. display: flex;
  275. flex-direction: column;
  276. align-items: center;
  277. gap: 16rpx;
  278. padding: 20rpx;
  279. border-radius: 12rpx;
  280. transition: all 0.3s ease;
  281. &:active {
  282. background-color: #F0F8FF;
  283. transform: scale(0.95);
  284. }
  285. }
  286. .function-icon {
  287. width: 48rpx;
  288. height: 48rpx;
  289. }
  290. .function-icon-wrapper {
  291. width: 48rpx;
  292. height: 48rpx;
  293. display: flex;
  294. align-items: center;
  295. justify-content: center;
  296. }
  297. .function-text {
  298. font-size: 24rpx;
  299. color: #000000;
  300. text-align: center;
  301. }
  302. </style>