index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <!-- <view class="mine-container" :style="'background: url('+this.imgUrl+'/index/mingbg.png) no-repeat 100% 100%;height:'+windowHeight+'px;background-position: 0 0;background-size: 100% 100%;'">
  3. <view style="position: fixed;right: 10px;z-index: 999999;top:30px" @click="changeLocale">
  4. {{ $t('login.language') }}:{{localeConfig[locale]}}<uni-icons type="gear" size="15"></uni-icons>
  5. </view> -->
  6. <view class="mine-container">
  7. <view style="height: 0vh;place-items: center;display: grid;background-color: #141414;">
  8. <image style="height: 3vh;width: 15vh;margin-top: 1vh;top: 3vh;"
  9. src="../../static/images/new/starts/login/backImg2.png"></image>
  10. <text @click="clickRight()" style="font-size: 15px;margin: -5px 0 0 31vh;font-weight: bold;z-index: 9999;"><uni-icons v-show="!show" style="color: #ffffff;" size="30" type="more-filled"></uni-icons><uni-icons size="30" v-show="show" style="color: #57B03D;" type="more-filled"></uni-icons></text>
  11. <!-- <view >
  12. <u-popup :show="show" mode="right" customStyle="top:14vh;" :overlayOpacity="0" :closeOnClickOverlay="true" :zIndex="1" ref="showRight" :overlay="false" >
  13. </u-popup>
  14. </view> -->
  15. </view>
  16. <view style=";margin-top: 10vh;" v-if="show">
  17. <view style="width: 100vw;">
  18. <scroll-view style="background: linear-gradient(#000000, #000000);font-size: 20px;" scroll-y="true">
  19. <view class="prop-item" @click="handleLogout()">
  20. <!-- <view class="prop-item-image">
  21. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  22. </view> -->
  23. <view class="prop-item-right">{{i18('退出登录')}}</view>
  24. <view class="prop-item-left">
  25. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  26. </view>
  27. </view>
  28. <u-divider />
  29. <view class="prop-item" @click="skipPage(3)">
  30. <!-- <view class="prop-item-image">
  31. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  32. </view> -->
  33. <view class="prop-item-right">{{i18('关于我们')}}</view>
  34. <view class="prop-item-left">
  35. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  36. </view>
  37. </view>
  38. <u-divider />
  39. <view class="prop-item" @click="skipPage(4)">
  40. <!-- <view class="prop-item-image">
  41. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  42. </view> -->
  43. <view class="prop-item-right">{{i18('帮助')}}</view>
  44. <view class="prop-item-left">
  45. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  46. </view>
  47. </view>
  48. <u-divider />
  49. </scroll-view>
  50. </view>
  51. </view>
  52. <!-- <u-divider style="margin-top: 15vh;border-width: 5px;"></u-divider> -->
  53. <view style=";margin-top: 10vh;" v-else>
  54. <view style=";margin-top: 10vh;justify-content: center;align-items: center;justify-content: center;display: grid;align-content: center;justify-items: center;line-height: 50px;">
  55. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix" style="margin-top: 5vh;">
  56. <!-- <image v-if="avatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
  57. </image>
  58. <view >
  59. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  60. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  61. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  62. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
  63. <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start.png"></image>
  64. </view> -->
  65. <view style="color: #d0d0d0;">
  66. {{ name }}
  67. </view>
  68. </view>
  69. <view class="menu-list" style="width: 100vw;line-height: 40px;">
  70. <u-divider style=";width: 100vw;"/>
  71. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  72. <view class="menu-item-box" >
  73. <image :src="this.imgUrl+'/mine/symbol.png'" style="width: 18px;height: 18px;"></image>
  74. <view class="menu-text"> {{ i18('账户设置')}}</view>
  75. </view>
  76. </view>
  77. <view class="list-cell list-cell-arrow" @click="handleAbout">
  78. <view class="menu-item-box">
  79. <image :src="this.imgUrl+'/mine/record.png'" style="width: 18px;height: 18px;"></image>
  80. <view class="menu-text">{{ i18('充电记录')}}</view>
  81. </view>
  82. </view>
  83. <view class="list-cell list-cell-arrow" @click="handleToSetting">
  84. <view class="menu-item-box">
  85. <image :src="this.imgUrl+'/mine/symbol (1).png'" style="width: 18px;height: 18px;"></image>
  86. <view class="menu-text">{{ i18('预约记录')}}</view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view style="position:fixed;bottom:10px;display: flex;align-items: center;justify-content: center;text-align: center;left:0px;right:0px;">
  92. <image style="height: 3vh;width: 30vw;position: absolute;bottom: 13vh;left: 35vw;" src="../../static/images/new/starts/login/backImg2.png"></image>
  93. <view @click="skipPage(0)" style="margin:0px 10px;">
  94. <image src="@/static/images/new/starts/tabbar/one_off.png"
  95. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  96. </view>
  97. <view @click="skipPage(1)" style="margin:0px 10px;">
  98. <image src="@/static/images/new/starts/tabbar/two_off.png"
  99. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  100. </view>
  101. <view @click="skipPage(2)" style="margin:0px 10px;">
  102. <image src="@/static/images/new/starts/tabbar/three_on.png"
  103. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  104. </view>
  105. </view>
  106. <!--顶部个人信息栏-->
  107. <!-- <view class="header-section">
  108. <view class="flex padding justify-between">
  109. <view class="flex align-center">
  110. <view v-if="!avatar" class="cu-avatar xl round bg-white">
  111. <view class="iconfont icon-people text-gray icon"></view>
  112. </view>
  113. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
  114. </image>
  115. <view v-if="!name" @click="handleToLogin" class="login-tip">
  116. {{ i18('点击登录')}}
  117. </view>
  118. <view v-if="name" @click="handleToInfo" class="user-info">
  119. <view class="u_title" style="color: #8E8E8E">
  120. {{ i18('你好')}}!
  121. </view>
  122. <view class="u_title">
  123. {{ name }}
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="menu-list">
  130. <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
  131. <view class="menu-item-box">
  132. <image :src="this.imgUrl+'/index/settingicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  133. <view class="menu-text"> {{ i18('账户设置')}}</view>
  134. </view>
  135. </view>
  136. <view class="list-cell list-cell-arrow" @click="handleAbout">
  137. <view class="menu-item-box">
  138. <image :src="this.imgUrl+'/index/chargeicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  139. <view class="menu-text">{{ i18('充电记录')}}</view>
  140. </view>
  141. </view>
  142. <view class="list-cell list-cell-arrow" @click="handleToSetting">
  143. <view class="menu-item-box">
  144. <image :src="this.imgUrl+'/index/planicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
  145. <view class="menu-text">{{ i18('预约记录')}}</view>
  146. </view>
  147. </view>
  148. </view> -->
  149. <u-picker @cancel="cancelLocale" :confirmText="i18('确认')" :cancelText="i18('取消')" :show="showLocale"
  150. keyName="label" :columns="localeList" @confirm="changeLanguage"></u-picker>
  151. </view>
  152. </template>
  153. <script>
  154. import storage from '@/utils/storage'
  155. import i18 from '@/utils/i18.js'
  156. export default {
  157. data() {
  158. return {
  159. showLocale: false,
  160. locale: "",
  161. localeList: [
  162. [{
  163. "label": "简体中文",
  164. "id": "zh-Hans"
  165. }, {
  166. "label": "英文",
  167. "id": "en"
  168. }]
  169. ],
  170. localeConfig: {
  171. "zh-Hans": "简体中文",
  172. "en": "英文"
  173. },
  174. name: this.$store.state.user.name,
  175. version: getApp().globalData.config.appInfo.version,
  176. imgUrl: getApp().globalData.config.imgUrl,
  177. clickRightTag: 0,
  178. show:false,
  179. }
  180. },
  181. computed: {
  182. avatar() {
  183. console.log(JSON.stringify(this.$store.state.user))
  184. if(this.$store.state.user.avatar==null||this.$store.state.user.avatar==''){
  185. return getApp().globalData.config.imgUrl + "/index/user.png"
  186. }else{
  187. return this.$store.state.user.avatar
  188. }
  189. },
  190. windowHeight() {
  191. return uni.getSystemInfoSync().windowHeight - 50
  192. }
  193. },
  194. onLoad() {
  195. this.setLocale();
  196. },
  197. onShow() {
  198. uni.setNavigationBarTitle({
  199. title: this.$t('page.mine')
  200. })
  201. },
  202. methods: {
  203. skipPage(type){
  204. if(type==0){
  205. uni.reLaunch({
  206. url:'/pages/index'
  207. })
  208. }else if(type==1){
  209. uni.reLaunch({
  210. url:'/pages/weitiandi/deviceList'
  211. })
  212. }else if(type==2){
  213. uni.reLaunch({
  214. url:'/pages/mine/index'
  215. })
  216. }
  217. },
  218. skip(){
  219. this.$modal.showToast("功能开发中..");
  220. },
  221. handleLogout() {
  222. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  223. this.$store.dispatch('LogOut').then(() => {
  224. uni.setStorageSync("loginInfo",'');
  225. this.$tab.reLaunch('/pages/index')
  226. })
  227. })
  228. },
  229. changeDrawer(event) {
  230. if (event) {
  231. // 抽屉打开时的逻辑
  232. this.clickRightTag = 1
  233. } else {
  234. // 抽屉关闭时的逻辑
  235. this.clickRightTag = 0
  236. }
  237. },
  238. //自定义头右操作函数
  239. clickRight() {
  240. //打开抽屉
  241. this.show=!this.show
  242. // if (this.clickRightTag == 0) {
  243. // this.$refs.showRight.open();
  244. // this.clickRightTag = 1
  245. // } else {
  246. // this.$refs.showRight.close()
  247. // this.clickRightTag = 0
  248. // }
  249. },
  250. cancelLocale() {
  251. this.showLocale = false;
  252. },
  253. changeLanguage(e) {
  254. this.showLocale = false;
  255. console.log(e.value[0].id)
  256. uni.setLocale(e.value[0].id);
  257. },
  258. changeLocale() {
  259. this.showLocale = true;
  260. },
  261. setLocale() {
  262. this.locale = uni.getLocale()
  263. if (this.locale == "en") {
  264. this.localeList = [
  265. [{
  266. "label": "Chinese",
  267. "id": "zh-Hans"
  268. }, {
  269. "label": "English",
  270. "id": "en"
  271. }]
  272. ];
  273. this.localeConfig = {
  274. "zh-Hans": "Chinese",
  275. "en": "English"
  276. };
  277. } else if (this.locale == "zh-Hans") {
  278. this.localeList = [
  279. [{
  280. "label": "简体中文",
  281. "id": "zh-Hans"
  282. }, {
  283. "label": "英文",
  284. "id": "en"
  285. }]
  286. ];
  287. this.localeConfig = {
  288. "zh-Hans": "简体中文",
  289. "en": "英文"
  290. };
  291. }
  292. },
  293. i18(text) {
  294. return i18(text)
  295. },
  296. handleToEditInfo() {
  297. this.$tab.navigateTo('/pages/mine/pwd/index')
  298. },
  299. handleToSetting() {
  300. this.$tab.navigateTo('/pages/weitiandi/device/planrecord')
  301. },
  302. handleToLogin() {
  303. this.$tab.reLaunch('/pages/login')
  304. },
  305. handleAbout() {
  306. this.$tab.navigateTo('/pages/weitiandi/device/chargerecord')
  307. },
  308. }
  309. }
  310. </script>
  311. <style lang="scss">
  312. page {
  313. // background-color: #000000;
  314. background-image: url('../../static/images/new/starts/bg2.jpg');
  315. background-size: cover;
  316. background-repeat: no-repeat;
  317. }
  318. .mine-container {
  319. // width: 100%;
  320. // height: 102vh;
  321. .header-section {
  322. padding: 15px 15px 45px 15px;
  323. color: white;
  324. .login-tip {
  325. font-size: 18px;
  326. margin-left: 10px;
  327. }
  328. .cu-avatar {
  329. border: 2px solid #eaeaea;
  330. .icon {
  331. font-size: 40px;
  332. }
  333. }
  334. .user-info {
  335. margin-left: 15px;
  336. .u_title {
  337. font-size: 18px;
  338. line-height: 30px;
  339. color: #000000;
  340. }
  341. }
  342. }
  343. .content-section {
  344. position: relative;
  345. top: -50px;
  346. .mine-actions {
  347. margin: 15px 15px;
  348. padding: 20px 0px;
  349. border-radius: 8px;
  350. .action-item {
  351. .icon {
  352. font-size: 28px;
  353. }
  354. .text {
  355. display: block;
  356. font-size: 13px;
  357. margin: 8px 0px;
  358. }
  359. }
  360. }
  361. }
  362. }
  363. .menu-list {
  364. box-shadow: 0px 2px 24px 0px rgba(0, 0, 0, 0.1);
  365. border-radius: 20px;
  366. margin: 0 0 0 0 ;
  367. }
  368. .list-cell {
  369. // padding: 17px 15px;
  370. background-color: #000000;
  371. }
  372. .menu-text {
  373. color: #ffffff
  374. }
  375. .header {
  376. position: relative;
  377. padding-top: 4vh;
  378. }
  379. .prop-item {
  380. position: relative;
  381. display: flex;
  382. flex-direction: row;
  383. height: 40px;
  384. line-height: 40px;
  385. margin: 10px 20rpx;
  386. }
  387. .prop-item-left {
  388. color: #BCBCBF;
  389. ;
  390. width: 30%;
  391. font-size: 14px;
  392. //margin-left: 36px;
  393. }
  394. .prop-item-image {
  395. width: 15px;
  396. height: 15px;
  397. position: absolute;
  398. left: 2vw;
  399. top: 0.5vh;
  400. }
  401. .prop-item-right {
  402. position: absolute;
  403. right: 10rpx;
  404. top: 5rpx;
  405. color: #BCBCBF;
  406. }
  407. </style>