123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- <template>
- <view class="page-fill">
- <view class="headimg"></view>
- <view class="header">
- <view v-if="weixinUp" class="face3">
- <image :src="avatarUrl" class="face2"></image>
- </view>
- <view v-if="weixinDown">
- <image src="../../static/img/userimg.png" class="face"></image>
- </view>
- <view class="info-wapper">
- <view class="nickname">
- {{name}}
- </view>
- </view>
- <view class="tuichu">
- <button @tap="bindLogout" class="settings">
- <p class="p3">{{$t('user.bindLogout')}}</p>
- </button>
- </view>
- </view>
- <view class="">
- <uni-list>
- <!-- <view v-if="ifForeign">
- <view v-if="gid">
- <uni-list-item title="优惠码" @click="open()" />
- </view>
- </view> -->
- <view v-if="showRemote">
- <!-- <view v-if=""> -->
- <uni-list-item title="远程操作" @click="remote()" />
- <!-- </view> -->
- </view>
- <view v-if="show">
- <!-- <view v-if=""> -->
- <uni-list-item title="定时开关炉头" @click="time()" />
- <!-- </view> -->
- </view>
- <view v-if="show">
- <uni-list-item :title="$t('user.equipmentname')" @click="updataName()" />
- </view>
- <view>
- <uni-list-item title="退款" @click="refuse()" />
- </view>
- <view v-if="noticeShow">
- <uni-list-item title="编辑公告" @click="notice()" />
- </view>
- <view>
- <uni-list-item title="审核" @click="examine()" />
- </view>
- </uni-list>
- </view>
- <view class="xiugai2">
- <button type="primary" @click="trant()" class="xiugai2">
- <p class="xiugai3">解除微信绑定</p>
- </button>
- </view>
- </view>
- </template>
- <script>
- import uniList from '@/components/uni-list/uni-list.vue'
- import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
- import {
- mapState,
- mapActions,
- mapMutations
- } from 'vuex'
- export default {
- components: {
- uniList,
- uniListItem,
- },
- data() {
- return {
- name: '',
- show: false,
- noticeShow:false,
- showRemote: true,
- ifForeign: false,
- listName: [],
- value: null,
- id: null,
- gid: false,
- parm: {
- name: null,
- id: null
- },
- showOrNo: null,
- avatarUrl: null,
- weixinUp: false,
- open: '',
- weixinDown: true
- };
- },
- onPullDownRefresh() {
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 800);
- },
- onShow() {
- uni.setNavigationBarTitle({
- title: this.$t('user.title')
- });
- uni.setTabBarItem({
- index: 4,
- text: this.$t('tabs.tab5')
- });
- // uni.startPullDownRefresh();
- var globalUser = uni.getStorageSync("globalUser");
- var gid = globalUser.id;
- var name = globalUser.name;
-
- if (gid != 1) {
- this.gid = true;
- this.show = true;
- }else{
- this.noticeShow = true;
- }
- // if (gid == 236||name == "邱咪") {
- // this.showRemote = false;
- // }
- var ifForeign = globalUser.ifForeign;
- if (ifForeign == 0) {
- this.ifForeign = true;
- }
- var token = uni.getStorageSync("token");
- if (token.length > 1) {
- this.open = globalUser.open;
- var name = uni.getStorageSync("name");
- this.name = name;
- var listName = uni.getStorageSync("listName");
- this.listName = listName;
- } else {
- uni.reLaunch({
- url: '../Login/Login',
- });
- }
- if (listName != '' && listName != null) {
- var adminId = listName[0].adminId;
- if (adminId != '1' && adminId != null) {
- this.show = true;
- }
- }
- var newparm = uni.getStorageSync("newparm");
- if (newparm.toString().length > 1) {
- if (newparm.avatarUrl.length > 1) {
- this.avatarUrl = newparm.avatarUrl;
- this.weixinUp = true;
- this.weixinDown = false;
- }
- }
- },
- onLoad() {
- },
- methods: {
- // open() {
- // uni.navigateTo({
- // url: 'promoCode',
- // });
- // },
- time() {
- uni.navigateTo({
- url: '../../packageA/pages/user/timeRule',
- });
- },
- remote() {
- uni.navigateTo({
- url:'../../packageA/pages/remote/remoteList',
- });
- },
- updataName() {
- uni.navigateTo({
- url: '../../packageA/pages/user/equipmentName',
- });
- },
- refuse(){
- uni.navigateTo({
- url: '../../packageA/pages/user/refuse',
- });
- },
- notice(){
- uni.navigateTo({
- url: '../../packageA/pages/user/editor/editor',
- });
- },
- examine(){
- uni.navigateTo({
- url: '../../packageA/pages/user/examine',
- });
- },
- trant() {
- uni.reLaunch({
- url: '../WeixinSwicth/WeixinSwicth',
- });
- },
- bindLogout() {
- //清楚缓存
- uni.clearStorageSync();
- uni.reLaunch({
- url: '/pages/Login/Login',
- });
- },
- setStyle() {
- this.showOrNo = "block";
- },
- setStyle2() {
- this.showOrNo = "none";
- },
- }
- }
- </script>
- <style>
- .page-fill {
- width: 100%;
- height: 100%;
- background: #FFFFFF;
- padding-bottom: 100upx;
- }
- .headimg {
- height: 120upx;
- background: #206DC3;
- width: 750upx;
- }
- .header {
- height: 160upx;
- width: 690upx;
- background: #FFFFFF;
- margin: auto;
- padding-top: 50upx;
- box-shadow: 0upx -1upx 20upx #D3D3D3;
- border-radius: 15upx;
- transform: translateY(-90upx);
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- }
- .face {
- width: 116upx;
- height: 116upx;
- padding-left: 30upx;
- border-radius: 50%;
- flex-shrink: 0;
- }
- .face2 {
- width: 120upx;
- height: 120upx;
- padding-right: 0upx;
- border-radius: 50%;
- flex-shrink: 0;
- }
- .face3 {
- width: 120upx;
- height: 120upx;
- padding-left: 30upx;
- padding-right: 0upx;
- border-radius: 50%;
- flex-shrink: 0;
- }
- .info-wapper {
- width: 50%;
- margin-left: 30upx;
- display: flex;
- flex-direction: column;
- }
- .nickname {
- color: #363D44;
- font-size: 16px;
- font-weight: 600;
- padding: 30upx 0upx 0upx 0upx;
- font-family: "PingFang-SC-Bold";
- }
- .set-wapper {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- width: 15%;
- }
- .tuichu {
- width: 100upx;
- height: 64upx;
- padding-top: 30upx;
- text-align: center;
- margin: 0 auto;
- }
- .settings {
- width: 100upx;
- height: 64upx;
- border-radius: 10upx;
- background: #D6101F;
- text-align: center;
- margin: 0 auto;
- }
- .p3 {
- /* #ifdef H5 */
- top: -13%;
- /* #endif */
- font-size: 32upx;
- color: #FFFFFF;
- font-weight: bold;
- width: 100upx;
- height: 64upx;
- /* #ifndef H5 */
- padding-top: 3upx;
- /* #endif */
- position: absolute;
- /* 水平居中 */
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- }
- .centerY {
- position: absolute;
- top: 50%;
- -webkit-transform: translateY(-50%);
- transform: translateY(-50%);
- }
- .button2 {
- padding-right: 60upx;
- padding-top: 2upx;
- }
- .button {
- width: 80upx;
- height: 60upx;
- border-radius: 10upx;
- }
- .p {
- /* #ifdef H5 */
- top: -13%;
- /* #endif */
- width: 80upx;
- height: 60upx;
- font-size: 30upx;
- /* #ifndef H5 */
- padding-top: 3upx;
- /* #endif */
- position: absolute;
- /* 水平居中 */
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- }
- .xiugai2 {
- width: 100%;
- height: 80upx;
- font-family: "PingFang-SC-Bold";
- font-weight: bold;
- margin: auto;
- font-size: 50upx;
- color: #363D44;
- position: fixed;
- bottom: 0;
- }
- .xiugai3 {
- height: 80upx;
- font-family: "PingFang-SC-Bold";
- font-weight: bold;
- margin: auto;
- font-size: 40upx;
- color: #363D44;
- }
- .body {
- background-color: #FFFFFF;
- padding: 10upx 10upx 10upx 10upx;
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- }
- </style>
|