123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- <template>
- <!-- 设置 -->
- <view class="userSet">
- <navigator url="/pages/users/user_info/index" hover-class="none" class="userInfo acea-row row-between-wrapper">
- <view class="picTxt acea-row row-middle">
- <view class="pictrue">
- <image :src="userInfo.avatar"></image>
- </view>
- <view class="text">
- <view class="name line1">{{userInfo.nickname}}</view>
- <view class="info">ID:{{userInfo.uid}}</view>
- </view>
- </view>
- <view class="iconfont icon-xiangyou"></view>
- </navigator>
- <view class="list">
- <!-- #ifdef APP-PLUS -->
- <view class="item acea-row row-between-wrapper" v-if="hj == 'android'">
- <view>切换账号</view>
- <view hover-class="none" class="input grab" @click="getMenList()">
- 点击切换账号<text class="iconfont icon-xiangyou"></text>
- </view>
- </view>
- <!-- #endif -->
- <view class="item acea-row row-between-wrapper" v-if="userInfo.link_uid">
- <view>节点</view>
- <view hover-class="none" class="input grab">
- {{userInfo.link_uid}}
- </view>
- </view>
- <view class="item acea-row row-between-wrapper" v-if="!userInfo.link_uid">
- <view>节点</view>
- <navigator url="/pages/users/user_point/index" hover-class="none" class="input grab">
- 点击设置节点<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view>
- <view class="item acea-row row-between-wrapper">
- <view>支付密码</view>
- <navigator url="/pages/users/user_bus_edit/index" hover-class="none" class="input grab">
- 点击设置支付密码<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view>
- <!-- #ifdef H5 -->
- <view class="item acea-row row-between-wrapper" v-if="userInfo.phone && !this.$wechat.isWeixin()">
- <view>密码</view>
- <navigator url="/pages/users/user_pwd_edit/index" hover-class="none" class="input grab">
- 点击修改密码<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view>
- <!-- #endif -->
- <!-- #ifdef APP-PLUS -->
- <view class="item acea-row row-between-wrapper" v-if="userInfo.phone">
- <view>密码</view>
- <navigator url="/pages/users/user_pwd_edit/index" hover-class="none" class="grab">
- 点击修改密码<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view>
- <!-- #endif -->
- <!-- <view class="item acea-row row-between-wrapper" v-if="userInfo.phone">
- <view>更换手机号码</view>
- <navigator url="/pages/users/user_phone/index?type=1" hover-class="none" class="grab">
- 点击更换手机号码<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view> -->
- </view>
- <view class="list">
- <view class="item acea-row row-between-wrapper">
- <view>地址管理</view>
- <navigator url="/pages/users/user_address_list/index" hover-class="none" class="grab">
- 点击前往<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view>
- <view class="item acea-row row-between-wrapper">
- <view>发票管理</view>
- <navigator url="/pages/users/user_invoice_list/index" hover-class="none" class="grab">
- 点击前往<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view>
- </view>
- <view class="list">
- <!-- #ifdef MP -->
- <view class='item acea-row row-between-wrapper'>
- <view>权限设置</view>
- <view class="input grab" @click="Setting">
- 点击管理<text class="iconfont icon-xiangyou"></text>
- </view>
- </view>
- <!-- #endif -->
- <view class="item acea-row row-between-wrapper">
- <view>账号注销</view>
- <navigator url="/pages/users/user_cancellation/index" hover-class="none" class="input grab">
- 注销后无法恢复<text class="iconfont icon-xiangyou"></text>
- </navigator>
- </view>
- </view>
- <!-- #ifdef MP -->
- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
- <!-- #endif -->
- </view>
- </template>
- <style lang="scss">
- .userSet {
- .userInfo {
- margin-top: 20rpx;
- background-color: #fff;
- padding: 0 30rpx;
- height: 144rpx;
- .iconfont {
- font-size: 30rpx;
- color: #868686;
- }
- .picTxt {
- .text {
- width: 524rpx;
- margin-left: 30rpx;
- font-weight: 400;
- .name {
- font-size: 32rpx;
- color: #333;
- }
- .info {
- font-size: 24rpx;
- color: #999;
- margin-top: 5rpx;
- }
- }
- .pictrue {
- width: 88rpx;
- height: 88rpx;
- image {
- width: 100%;
- height: 100%;
- border: 1px solid #eee;
- border-radius: 50%;
- }
- }
- }
- }
- .list {
- background-color: #fff;
- margin-top: 20rpx;
- .item {
- padding: 30rpx 30rpx 30rpx 0;
- border-bottom: 1rpx solid #f2f2f2;
- margin-left: 30rpx;
- font-size: 32rpx;
- color: #333;
- .grab {
- color: #ccc;
- .iconfont {
- font-size: 30rpx;
- color: #868686;
- margin-left: 6rpx;
- }
- }
- }
- }
- }
- </style>
- <script>
- import {
- getUserInfo
- } from '@/api/user.js';
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- mapGetters
- } from "vuex";
- export default {
- computed: {
- ...mapGetters(['isLogin']),
- hj() {
- return uni.getSystemInfoSync().platform;
- }
- },
- data() {
- return {
- menList: [],
- userInfo: {},
- isShowAuth: false
- }
- },
- onLoad() {},
- onShow() {
- if (this.isLogin) {
- this.getUserInfo();
- } else {
- //#ifndef MP
- toLogin();
- //#endif
- //#ifdef MP
- this.isShowAuth = true;
- //#endif
- }
- },
- methods: {
- /**
- * 小程序设置
- */
- Setting: function() {
- uni.openSetting({
- success: function(res) {}
- });
- },
- onLoadFun() {
- this.getUserInfo();
- this.isShowAuth = false
- },
- // 授权关闭
- authColse: function(e) {
- this.isShowAuth = e
- },
- getUserInfo() {
- let that = this;
- getUserInfo().then(res => {
- that.userInfo = res.data;
- });
- },
- // 获取用户列表
- getMenList() {
- uni.navigateTo({
- url:'/pages/users/switch_account/index'
- })
- // let that = this;
- // try {
- // that.$io.read("MenList.json").then(res => {
- // // res 读取的文件内容
- // that.menList = JSON.parse(res);
- // }).catch(err => {
- // // 找不到该文件就写入一个空白文件。
- // // that.$io.storage("MenList.json", []);
- // console.log(err, "err");
- // })
- // } catch (e) {
-
- // console.log(e);
- // }
- }
- }
- }
- </script>
|