mine.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <view class="mine-container" :style="{height: `${windowHeight}px`}">
  3. <!--顶部个人信息栏-->
  4. <view class="header-section">
  5. <view class="flex padding justify-between">
  6. <view class="flex align-center">
  7. <view v-if="!avatar" class="cu-avatar xl round bg-white">
  8. <view class="iconfont icon-people text-gray icon"></view>
  9. </view>
  10. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round"
  11. mode="widthFix">
  12. </image>
  13. <view v-if="!name" @click="handleToLogin" class="login-tip">
  14. 点击登录
  15. </view>
  16. <view v-if="name" @click="handleToInfo" class="user-info">
  17. <view class="u_title">
  18. 用户名:{{ name }}
  19. </view>
  20. </view>
  21. </view>
  22. <view @click="handleToInfo" class="flex align-center">
  23. <image :src="imagePath" mode="aspectFit" style="width: 50rpx;height: 50rpx;"></image>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="content-section">
  28. <view class="Wrapper-grid">
  29. <up-grid :border="false" col="4" @click="handleGridClick">
  30. <up-grid-item v-for="(item, index) in serviceList" :key="index"
  31. :custom-style="{ padding: '20rpx' }">
  32. <!-- 图标 -->
  33. <image :src="item.icon" class="service-img" mode="aspectFit" />
  34. <!-- 文本 -->
  35. <text class="grid-text">{{ item.name }}</text>
  36. </up-grid-item>
  37. </up-grid>
  38. <up-toast ref="uToastRef" />
  39. </view>
  40. <!--
  41. <view class="menu-list">
  42. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  43. <view class="menu-item-box">
  44. <view class="iconfont icon-user menu-icon"></view>
  45. <view>编辑资料</view>
  46. </view>
  47. </view>
  48. <view class="list-cell list-cell-arrow" @click="handleHelp">
  49. <view class="menu-item-box">
  50. <view class="iconfont icon-help menu-icon"></view>
  51. <view>常见问题</view>
  52. </view>
  53. </view>
  54. <view class="list-cell list-cell-arrow" @click="handleAbout">
  55. <view class="menu-item-box">
  56. <view class="iconfont icon-aixin menu-icon"></view>
  57. <view>关于我们</view>
  58. </view>
  59. </view>
  60. <view class="list-cell list-cell-arrow" @click="handleToSetting">
  61. <view class="menu-item-box">
  62. <view class="iconfont icon-setting menu-icon"></view>
  63. <view>应用设置</view>
  64. </view>
  65. </view>
  66. </view> -->
  67. </view>
  68. </view>
  69. <!-- <view>
  70. <uni-popup ref="popup" type="dialog">
  71. <uni-popup-dialog type="info" cancelText="关闭" confirmText="退出"
  72. title="通知" content="确定注销并退出系统吗"
  73. @confirm="dialogConfirm"
  74. @close="dialogClose">
  75. </uni-popup-dialog>
  76. </uni-popup>
  77. </view> -->
  78. </template>
  79. <script setup>
  80. import storage from '@/utils/storage'
  81. import store from '@/store'
  82. import {
  83. ref
  84. } from "vue";
  85. import config from '@/config.js'
  86. const name = store.state.user.name;
  87. const version = config.appInfo.version;
  88. const avatar = ref(store.state.user.avatar);
  89. const windowHeight = ref(uni.getSystemInfoSync().windowHeight - 50);
  90. const popup = ref(null);
  91. const imagePath = '/static/设置.png';
  92. uni.$on('refresh', () => {
  93. avatar.value = store.state.user.avatar;
  94. })
  95. const serviceList = ref([{
  96. icon: '/static/my/待付款.png',
  97. name: '待付款'
  98. },
  99. {
  100. icon: '/static/my/待服务.png',
  101. name: '待服务'
  102. },
  103. {
  104. icon: '/static/my/已完成.png',
  105. name: '已完成'
  106. },
  107. {
  108. icon: '/static/my/评论.png',
  109. name: '评论'
  110. },
  111. {
  112. icon: '/static/my/钱包.png',
  113. name: '钱包'
  114. },
  115. {
  116. icon: '/static/my/浏览记录.png',
  117. name: '浏览记录'
  118. },
  119. {
  120. icon: '/static/my/收藏.png',
  121. name: '收藏'
  122. },
  123. {
  124. icon: '/static/my/客服.png',
  125. name: '帮助与客服'
  126. },
  127. ]);
  128. function handleToInfo() {
  129. uni.navigateTo({
  130. url: '/pages_mine/pages/info/index'
  131. });
  132. };
  133. function handleToAvatar() {
  134. uni.navigateTo({
  135. url: '/pages_mine/pages/avatar/index'
  136. });
  137. };
  138. function handleLogout() {
  139. popup.value.open();
  140. };
  141. function dialogConfirm() {
  142. //console.log('----------------点击确认------------')
  143. store.dispatch('LogOut').then(() => {
  144. uni.reLaunch({
  145. url: '/pages/login'
  146. });
  147. })
  148. };
  149. function dialogClose() {
  150. //console.log('点击关闭')
  151. };
  152. function handleHelp() {
  153. uni.navigateTo({
  154. url: '/pages_mine/pages/help/index'
  155. });
  156. };
  157. function handleAbout() {
  158. uni.navigateTo({
  159. url: '/pages_mine/pages/about/index'
  160. });
  161. };
  162. function handleJiaoLiuQun() {
  163. uni.showToast({
  164. title: 'QQ群:133713780',
  165. mask: false,
  166. icon: "none",
  167. duration: 1000
  168. });
  169. };
  170. function handleBuilding() {
  171. uni.showToast({
  172. title: '模块建设中~',
  173. mask: false,
  174. icon: "none",
  175. duration: 1000
  176. });
  177. }
  178. </script>
  179. <style lang="scss">
  180. page {
  181. background-color: #f5f6f7;
  182. }
  183. .mine-container {
  184. width: 100%;
  185. height: 100%;
  186. .header-section {
  187. padding: 15px 15px 45px 15px;
  188. background-color: #3c96f3;
  189. color: white;
  190. .login-tip {
  191. font-size: 18px;
  192. margin-left: 10px;
  193. }
  194. .cu-avatar {
  195. border: 2px solid #eaeaea;
  196. .icon {
  197. font-size: 40px;
  198. }
  199. }
  200. .user-info {
  201. margin-left: 15px;
  202. .u_title {
  203. font-size: 18px;
  204. line-height: 30px;
  205. }
  206. }
  207. }
  208. .content-section {
  209. position: relative;
  210. top: -50px;
  211. .mine-actions {
  212. margin: 15px 15px;
  213. padding: 20px 0px;
  214. border-radius: 8px;
  215. background-color: white;
  216. .action-item {
  217. .icon {
  218. font-size: 28px;
  219. }
  220. .text {
  221. display: block;
  222. font-size: 13px;
  223. margin: 8px 0px;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. .Wrapper-grid {
  230. margin-top: 120rpx;
  231. }
  232. /* 图标样式 */
  233. .service-img {
  234. width: 60rpx;
  235. height: 60rpx;
  236. margin-bottom: 10rpx;
  237. }
  238. /* 文本样式 */
  239. .grid-text {
  240. font-size: 24rpx;
  241. color: #333;
  242. text-align: center;
  243. margin-top: 10rpx;
  244. }
  245. </style>