| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437 |
- <template>
- <!-- <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%;'">
- <view style="position: fixed;right: 10px;z-index: 999999;top:30px" @click="changeLocale">
- {{ $t('login.language') }}:{{localeConfig[locale]}}<uni-icons type="gear" size="15"></uni-icons>
- </view> -->
- <view class="mine-container">
- <view style="height: 0vh;place-items: center;display: grid;background-color: #141414;">
- <image style="height: 3vh;width: 15vh;margin-top: 1vh;top: 3vh;"
- src="../../static/images/new/starts/login/backImg2.png"></image>
- <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>
- <!-- <view >
- <u-popup :show="show" mode="right" customStyle="top:14vh;" :overlayOpacity="0" :closeOnClickOverlay="true" :zIndex="1" ref="showRight" :overlay="false" >
-
- </u-popup>
- </view> -->
- </view>
- <view style=";margin-top: 10vh;" v-if="show">
- <view style="width: 100vw;">
- <scroll-view style="background: linear-gradient(#000000, #000000);font-size: 20px;" scroll-y="true">
- <view class="prop-item" @click="handleLogout()">
- <!-- <view class="prop-item-image">
- <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
- </view> -->
- <view class="prop-item-right">{{i18('退出登录')}}</view>
- <view class="prop-item-left">
- <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
- </view>
- </view>
- <u-divider />
- <view class="prop-item" @click="skipPage(3)">
- <!-- <view class="prop-item-image">
- <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
- </view> -->
- <view class="prop-item-right">{{i18('关于我们')}}</view>
- <view class="prop-item-left">
- <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
- </view>
- </view>
- <u-divider />
- <view class="prop-item" @click="skipPage(4)">
- <!-- <view class="prop-item-image">
- <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
- </view> -->
- <view class="prop-item-right">{{i18('帮助')}}</view>
- <view class="prop-item-left">
- <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
- </view>
- </view>
- <u-divider />
- </scroll-view>
- </view>
- </view>
- <!-- <u-divider style="margin-top: 15vh;border-width: 5px;"></u-divider> -->
- <view style=";margin-top: 10vh;" v-else>
- <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;">
- <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix" style="margin-top: 5vh;">
- <!-- <image v-if="avatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
- </image>
- <view >
- <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
- <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
- <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
- <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start_light.png"></image>
- <image style="width: 40rpx;height: 40rpx;" src="../../static/images/new/starts/mine/start.png"></image>
- </view> -->
- <view style="color: #d0d0d0;">
- {{ name }}
- </view>
- </view>
- <view class="menu-list" style="width: 100vw;line-height: 40px;">
- <u-divider style=";width: 100vw;"/>
- <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
- <view class="menu-item-box" >
- <image :src="this.imgUrl+'/mine/symbol.png'" style="width: 18px;height: 18px;"></image>
- <view class="menu-text"> {{ i18('账户设置')}}</view>
- </view>
- </view>
- <view class="list-cell list-cell-arrow" @click="handleAbout">
- <view class="menu-item-box">
- <image :src="this.imgUrl+'/mine/record.png'" style="width: 18px;height: 18px;"></image>
- <view class="menu-text">{{ i18('充电记录')}}</view>
- </view>
- </view>
- <view class="list-cell list-cell-arrow" @click="handleToSetting">
- <view class="menu-item-box">
- <image :src="this.imgUrl+'/mine/symbol (1).png'" style="width: 18px;height: 18px;"></image>
- <view class="menu-text">{{ i18('预约记录')}}</view>
- </view>
- </view>
- </view>
- </view>
- <view style="position:fixed;bottom:10px;display: flex;align-items: center;justify-content: center;text-align: center;left:0px;right:0px;">
- <image style="height: 3vh;width: 30vw;position: absolute;bottom: 13vh;left: 35vw;" src="../../static/images/new/starts/login/backImg2.png"></image>
- <view @click="skipPage(0)" style="margin:0px 10px;">
- <image src="@/static/images/new/starts/tabbar/one_off.png"
- style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
- </view>
- <view @click="skipPage(1)" style="margin:0px 10px;">
- <image src="@/static/images/new/starts/tabbar/two_off.png"
- style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
- </view>
- <view @click="skipPage(2)" style="margin:0px 10px;">
- <image src="@/static/images/new/starts/tabbar/three_on.png"
- style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
- </view>
- </view>
- <!--顶部个人信息栏-->
- <!-- <view class="header-section">
- <view class="flex padding justify-between">
- <view class="flex align-center">
- <view v-if="!avatar" class="cu-avatar xl round bg-white">
- <view class="iconfont icon-people text-gray icon"></view>
- </view>
- <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
- </image>
- <view v-if="!name" @click="handleToLogin" class="login-tip">
- {{ i18('点击登录')}}
- </view>
- <view v-if="name" @click="handleToInfo" class="user-info">
- <view class="u_title" style="color: #8E8E8E">
- {{ i18('你好')}}!
- </view>
- <view class="u_title">
- {{ name }}
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="menu-list">
- <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
- <view class="menu-item-box">
- <image :src="this.imgUrl+'/index/settingicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
- <view class="menu-text"> {{ i18('账户设置')}}</view>
- </view>
- </view>
- <view class="list-cell list-cell-arrow" @click="handleAbout">
- <view class="menu-item-box">
- <image :src="this.imgUrl+'/index/chargeicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
- <view class="menu-text">{{ i18('充电记录')}}</view>
- </view>
- </view>
- <view class="list-cell list-cell-arrow" @click="handleToSetting">
- <view class="menu-item-box">
- <image :src="this.imgUrl+'/index/planicon.png'" style="width: 18px;height: 18px;margin-right:5px"></image>
- <view class="menu-text">{{ i18('预约记录')}}</view>
- </view>
- </view>
- </view> -->
- <u-picker @cancel="cancelLocale" :confirmText="i18('确认')" :cancelText="i18('取消')" :show="showLocale"
- keyName="label" :columns="localeList" @confirm="changeLanguage"></u-picker>
- </view>
- </template>
- <script>
- import storage from '@/utils/storage'
- import i18 from '@/utils/i18.js'
- export default {
- data() {
- return {
- showLocale: false,
- locale: "",
- localeList: [
- [{
- "label": "简体中文",
- "id": "zh-Hans"
- }, {
- "label": "英文",
- "id": "en"
- }]
- ],
- localeConfig: {
- "zh-Hans": "简体中文",
- "en": "英文"
- },
- name: this.$store.state.user.name,
- version: getApp().globalData.config.appInfo.version,
- imgUrl: getApp().globalData.config.imgUrl,
- clickRightTag: 0,
- show:false,
- }
- },
- computed: {
- avatar() {
- console.log(JSON.stringify(this.$store.state.user))
-
- if(this.$store.state.user.avatar==null||this.$store.state.user.avatar==''){
- return getApp().globalData.config.imgUrl + "/index/user.png"
- }else{
- return this.$store.state.user.avatar
- }
-
-
- },
- windowHeight() {
- return uni.getSystemInfoSync().windowHeight - 50
- }
- },
- onLoad() {
- this.setLocale();
- },
- onShow() {
- uni.setNavigationBarTitle({
- title: this.$t('page.mine')
- })
- },
- methods: {
- skipPage(type){
- if(type==0){
- uni.reLaunch({
- url:'/pages/index'
- })
- }else if(type==1){
- uni.reLaunch({
- url:'/pages/weitiandi/deviceList'
- })
- }else if(type==2){
- uni.reLaunch({
- url:'/pages/mine/index'
- })
- }
- },
- skip(){
- this.$modal.showToast("功能开发中..");
- },
- handleLogout() {
- this.$modal.confirm('确定注销并退出系统吗?').then(() => {
- this.$store.dispatch('LogOut').then(() => {
- uni.setStorageSync("loginInfo",'');
- this.$tab.reLaunch('/pages/index')
- })
- })
- },
- changeDrawer(event) {
- if (event) {
- // 抽屉打开时的逻辑
-
- this.clickRightTag = 1
- } else {
- // 抽屉关闭时的逻辑
- this.clickRightTag = 0
- }
- },
- //自定义头右操作函数
- clickRight() {
- //打开抽屉
- this.show=!this.show
- // if (this.clickRightTag == 0) {
- // this.$refs.showRight.open();
- // this.clickRightTag = 1
- // } else {
- // this.$refs.showRight.close()
- // this.clickRightTag = 0
- // }
- },
- cancelLocale() {
- this.showLocale = false;
- },
- changeLanguage(e) {
- this.showLocale = false;
- console.log(e.value[0].id)
- uni.setLocale(e.value[0].id);
- },
- changeLocale() {
- this.showLocale = true;
- },
- setLocale() {
- this.locale = uni.getLocale()
- if (this.locale == "en") {
- this.localeList = [
- [{
- "label": "Chinese",
- "id": "zh-Hans"
- }, {
- "label": "English",
- "id": "en"
- }]
- ];
- this.localeConfig = {
- "zh-Hans": "Chinese",
- "en": "English"
- };
- } else if (this.locale == "zh-Hans") {
- this.localeList = [
- [{
- "label": "简体中文",
- "id": "zh-Hans"
- }, {
- "label": "英文",
- "id": "en"
- }]
- ];
- this.localeConfig = {
- "zh-Hans": "简体中文",
- "en": "英文"
- };
- }
- },
- i18(text) {
- return i18(text)
- },
- handleToEditInfo() {
- this.$tab.navigateTo('/pages/mine/pwd/index')
- },
- handleToSetting() {
- this.$tab.navigateTo('/pages/weitiandi/device/planrecord')
- },
- handleToLogin() {
- this.$tab.reLaunch('/pages/login')
- },
- handleAbout() {
- this.$tab.navigateTo('/pages/weitiandi/device/chargerecord')
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- // background-color: #000000;
- background-image: url('../../static/images/new/starts/bg2.jpg');
- background-size: cover;
- background-repeat: no-repeat;
- }
- .mine-container {
- // width: 100%;
- // height: 102vh;
-
- .header-section {
- padding: 15px 15px 45px 15px;
- color: white;
- .login-tip {
- font-size: 18px;
- margin-left: 10px;
- }
- .cu-avatar {
- border: 2px solid #eaeaea;
- .icon {
- font-size: 40px;
- }
- }
- .user-info {
- margin-left: 15px;
- .u_title {
- font-size: 18px;
- line-height: 30px;
- color: #000000;
- }
- }
- }
- .content-section {
- position: relative;
- top: -50px;
- .mine-actions {
- margin: 15px 15px;
- padding: 20px 0px;
- border-radius: 8px;
- .action-item {
- .icon {
- font-size: 28px;
- }
- .text {
- display: block;
- font-size: 13px;
- margin: 8px 0px;
- }
- }
- }
- }
- }
- .menu-list {
- box-shadow: 0px 2px 24px 0px rgba(0, 0, 0, 0.1);
- border-radius: 20px;
- margin: 0 0 0 0 ;
- }
- .list-cell {
- // padding: 17px 15px;
- background-color: #000000;
- }
- .menu-text {
- color: #ffffff
- }
- .header {
- position: relative;
- padding-top: 4vh;
- }
- .prop-item {
- position: relative;
- display: flex;
- flex-direction: row;
- height: 40px;
- line-height: 40px;
- margin: 10px 20rpx;
- }
- .prop-item-left {
- color: #BCBCBF;
- ;
- width: 30%;
- font-size: 14px;
- //margin-left: 36px;
- }
- .prop-item-image {
- width: 15px;
- height: 15px;
- position: absolute;
- left: 2vw;
- top: 0.5vh;
- }
- .prop-item-right {
- position: absolute;
- right: 10rpx;
- top: 5rpx;
- color: #BCBCBF;
- }
- </style>
|