mine.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <oa-scroll
  3. customClass="mine-container scroll-height"
  4. :customStyle="{ height: `calc(100vh - (50px + ${proxy.$settingStore.tabBarHeight}))`, position: 'relative' }"
  5. :isSticky="false"
  6. :refresherLoad="false"
  7. :refresherEnabled="false"
  8. :refresherEnabledTitle="false"
  9. :refresherDefaultStyle="'none'"
  10. :refresherThreshold="44"
  11. :refresherBackground="'#f5f6f7'"
  12. >
  13. <template #default>
  14. <!--顶部个人信息栏-->
  15. <view class="top-area" :class="'bg-' + themeColor.name" :style="{ paddingTop: proxy.$settingStore.StatusBar ? proxy.$settingStore.StatusBar + 20 + 'px' : '55px' }">
  16. <view class="flex justify-between p15">
  17. <view class="flex align-center">
  18. <view class="cu-avatar xl round border bg-white" v-if="!avatar" @click="!state.nickName ? proxy.$settingStore.handleToLogin() : proxy.$settingStore.handleToAvatar(1)">
  19. <view class="iconfont oaIcon-people text-gray"></view>
  20. </view>
  21. <image class="cu-avatar xl round border bg-white" v-if="avatar" :src="avatar" @click="proxy.$settingStore.handleToAvatar(2)"> </image>
  22. <view class="login-tip" v-if="!state.nickName" @click="proxy.$settingStore.handleToLogin()"> 点击登录 </view>
  23. <view class="user-info" v-if="state.nickName">
  24. <view class="u_title"> {{ state.nickName }} </view>
  25. <view class="u_title"> {{ state.phone ? state.phone.substr(0, 3) + "******" + state.phone.substr(9) : "" }} </view>
  26. </view>
  27. </view>
  28. <view class="flex align-center"> </view>
  29. </view>
  30. <view class="vip-card-box"> </view>
  31. </view>
  32. <oa-transForm>
  33. <template #content>
  34. <view class="menu-list">
  35. <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToEditInfo()">
  36. <view class="menu-item">
  37. <view class="iconfont oaIcon-user menu-item-icon"></view>
  38. <view>我的信息</view>
  39. </view>
  40. </view>
  41. <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToSecure()">
  42. <view class="menu-item">
  43. <view class="iconfont oaIcon-yanzheng menu-item-icon"></view>
  44. <view>账号与安全</view>
  45. </view>
  46. </view>
  47. <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToMessage()">
  48. <view class="menu-item">
  49. <view class="iconfont oaIcon-tongzhi menu-item-icon"></view>
  50. <view>新消息通知</view>
  51. </view>
  52. </view>
  53. <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleAbout()">
  54. <view class="menu-item">
  55. <view class="iconfont oaIcon-aixin menu-item-icon"></view>
  56. <view>关于我们</view>
  57. </view>
  58. </view>
  59. <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleHelp()">
  60. <view class="menu-item">
  61. <view class="iconfont oaIcon-Help menu-item-icon"></view>
  62. <view>常见问题</view>
  63. </view>
  64. </view>
  65. <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleCleanTmp()">
  66. <view class="menu-item">
  67. <view class="iconfont oaIcon-qinglihuancun menu-item-icon"></view>
  68. <view>清理缓存</view>
  69. <view class="mr15 ml-auto text-right">{{ proxy.$settingStore.currentSize }}</view>
  70. </view>
  71. </view>
  72. <view class="list-cell list-cell-arrow" @click="handleToUpgrade" v-if="proxy.$common.isVisible()">
  73. <view class="menu-item">
  74. <view class="iconfont oaIcon-jianchagengxin menu-item-icon"></view>
  75. <view>检查更新</view>
  76. </view>
  77. </view>
  78. <!-- <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleSetting()">
  79. <view class="menu-item">
  80. <view class="iconfont oaIcon-shezhi menu-item-icon"></view>
  81. <view>设置</view>
  82. </view>
  83. </view> -->
  84. </view>
  85. <!-- <view class="menu-list">
  86. <view class="list-cell list-cell-arrow" @click="goMessagePush()">
  87. <view class="menu-item">
  88. <view class="iconfont oaIcon-aixin menu-item-icon"></view>
  89. <view>推送设置</view>
  90. </view>
  91. </view>
  92. <view class="list-cell list-cell-arrow" @click="goBuilding()">
  93. <view class="menu-item">
  94. <view class="iconfont oaIcon-aixin menu-item-icon"></view>
  95. <view>建筑管理</view>
  96. </view>
  97. </view>
  98. <view class="list-cell list-cell-arrow" @click="goFunReport()">
  99. <view class="menu-item">
  100. <view class="iconfont oaIcon-aixin menu-item-icon"></view>
  101. <view>功能报备</view>
  102. </view>
  103. </view>
  104. </view> -->
  105. <view class="cu-list menu">
  106. <view class="cu-item mt0">
  107. <view class="content flex align-center">
  108. <text class="iconfont oaIcon-colorlens" :class="'text-' + themeColor.name"></text>
  109. <view class="padding solid radius shadow-blur ml10" :class="'bg-' + themeColor.name"></view>
  110. <view class="title ml10">
  111. 主题色:<text :class="'text-' + themeColor.name">{{ themeColor.title }}</text>
  112. </view>
  113. </view>
  114. <view class="action">
  115. <button class="cu-btn round shadow" @click="colorModal = true" :class="'bg-' + themeColor.name">
  116. <text class="iconfont oaIcon-colorlens"></text>
  117. 选择主题
  118. </button>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="menu-list" @click="proxy.$settingStore.handleLogout">
  123. <view class="list-cell">
  124. <view class="menu-item">
  125. <view class="button">退 出 登 录</view>
  126. </view>
  127. </view>
  128. </view>
  129. <!-- <view class="menu-list">
  130. <view class="list-cell list-cell-arrow" @tap="goSiteManage" v-if="permissionLabel == 1">
  131. <view class="menu-item">
  132. <image class="menu-item-image" src="@/static/images/setting/setting-icon2.png" style="width: 15px; height: 15px"></image>
  133. <view>站点管理</view>
  134. </view>
  135. </view>
  136. <view class="list-cell list-cell-arrow" @tap="goAuthManage" v-if="permissionLabel == 1">
  137. <view class="menu-item">
  138. <image class="menu-item-image" src="@/static/images/setting/setting-icon4.png" style="width: 15px; height: 15px"></image>
  139. <view>权限管理</view>
  140. </view>
  141. </view>
  142. </view> -->
  143. </template>
  144. </oa-transForm>
  145. </template>
  146. </oa-scroll>
  147. <!-- 选择颜色模态框 -->
  148. <view class="cu-modal" :class="{ show: colorModal }">
  149. <view class="cu-dialog">
  150. <view class="cu-bar justify-end solid-bottom">
  151. <view class="content">选择颜色</view>
  152. <view class="action" @tap="colorModal = false">
  153. <u-icon name="close" size="14"></u-icon>
  154. <text class="cuIcon-close text-red"></text>
  155. </view>
  156. </view>
  157. <view class="grid col-5 padding">
  158. <view class="padding-xs" v-for="(item, index) in themeList" :key="index" @tap="SetColor(item)" :data-color="item.name">
  159. <view class="padding-tb radius" :class="'bg-' + item.name">
  160. {{ item.title }}
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. </view>
  166. <oa-upgrade ref="oaUpgradeRef" :themesColor="proxy.$settingStore.themeColor.color" />
  167. <oa-tabbar :tabbarValue="2" :tabbarList="proxy.$constData.homeTabbar"></oa-tabbar>
  168. </template>
  169. <script setup>
  170. /*----------------------------------依赖引入-----------------------------------*/
  171. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  172. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  173. /*----------------------------------接口引入-----------------------------------*/
  174. /*----------------------------------组件引入-----------------------------------*/
  175. /*----------------------------------store引入-----------------------------------*/
  176. import { useStores, commonStores } from "@/store/modules/index";
  177. /*----------------------------------公共方法引入-----------------------------------*/
  178. import config from "@/config";
  179. /*----------------------------------公共变量-----------------------------------*/
  180. const { proxy } = getCurrentInstance();
  181. const useStore = useStores();
  182. const commonStore = commonStores();
  183. /*----------------------------------变量声明-----------------------------------*/
  184. const state = reactive({
  185. avatar: computed(() => {
  186. return useStore.avatar;
  187. }),
  188. themeColor: computed(() => {
  189. return proxy.$settingStore.themeColor;
  190. }),
  191. nickName: useStore.nickName,
  192. phone: useStore.phonenumber,
  193. version: config.appInfo.version,
  194. colorModal: false,
  195. themeList: proxy.$constData.themeList,
  196. });
  197. const { avatar, themeColor, colorModal, themeList } = toRefs(state);
  198. /**
  199. * @检查更新
  200. */
  201. function handleToUpgrade() {
  202. proxy.$settingStore.handleToUpgrade({
  203. success: (res) => {
  204. proxy.$refs["oaUpgradeRef"].openUpgrade({
  205. modalArray: res.data,
  206. });
  207. },
  208. });
  209. }
  210. /**
  211. * @推送设置
  212. */
  213. function goMessagePush() {
  214. proxy.$tab.navigateTo("/pages/business/zhxf/messagePush/index");
  215. }
  216. /**
  217. * @建筑管理
  218. */
  219. function goBuilding() {
  220. proxy.$tab.navigateTo("/pages/business/zhxf/building/index");
  221. }
  222. /**
  223. * @功能报备
  224. */
  225. function goFunReport() {
  226. proxy.$tab.navigateTo("/pages/business/zhxf/funReport/index");
  227. }
  228. /**
  229. * @主题颜色选择
  230. */
  231. function SetColor(item) {
  232. colorModal.value = false;
  233. proxy.$settingStore.initThemeColor(item);
  234. proxy.$settingStore.systemThemeColor([1, 2]);
  235. }
  236. onShow(() => {});
  237. onReady(() => {});
  238. onLoad((options) => {
  239. uni.hideTabBar(); //隐藏自带tabbar
  240. });
  241. // 自定义导航事件
  242. onNavigationBarButtonTap((e) => {
  243. if (e.float == "right") {
  244. proxy.$tab.navigateTo("/pages/mine/setting/index");
  245. }
  246. });
  247. </script>
  248. <style lang="scss" scoped>
  249. .mine-container {
  250. width: 100%;
  251. height: calc(100vh - (50px + constant(safe-area-inset-bottom)));
  252. height: calc(100vh - (50px + env(safe-area-inset-bottom)));
  253. .top-area {
  254. padding: 55px 0.625rem 0 0.625rem;
  255. .login-tip {
  256. font-size: 18px;
  257. margin-left: 10px;
  258. }
  259. .user-info {
  260. margin-left: 15px;
  261. .u_title {
  262. font-size: 18px;
  263. line-height: 30px;
  264. }
  265. }
  266. .vip-card-box {
  267. display: flex;
  268. flex-direction: column;
  269. color: #f7d680;
  270. height: 132px;
  271. background: url("@/static/images/mine/vip-card.png");
  272. background-size: 100% 100%;
  273. border-radius: 8px 8px 0 0;
  274. overflow: hidden;
  275. position: relative;
  276. padding: 11px 13px;
  277. }
  278. }
  279. .scrollView {
  280. height: calc(100vh - (50px + constant(safe-area-inset-bottom) + 55px + 0.9375rem + 0.9375rem + 4rem + 47px));
  281. height: calc(100vh - (50px + env(safe-area-inset-bottom) + 55px + 0.9375rem + 0.9375rem + 4rem + 47px));
  282. }
  283. }
  284. </style>