index.vue 13 KB

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