|
|
|
|
@ -5,13 +5,34 @@
|
|
|
|
|
<view class="top">
|
|
|
|
|
<image class="avatar" mode="aspectFit" :src="vuex_user.headimgurl || vuex_default_icon"></image>
|
|
|
|
|
|
|
|
|
|
<view class="info">
|
|
|
|
|
<view class="info-name">{{ vuex_user.nickname || '微信用户' }}</view>
|
|
|
|
|
<view class="info-mobile">手机号:{{ vuex_user.mobile || '' }}</view>
|
|
|
|
|
<view v-if="token" class="info" @click="isShowMyInfo = true">
|
|
|
|
|
<view class="info-name">
|
|
|
|
|
{{ vuex_user.nickname || '微信用户' }}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info-mobile">手机号:
|
|
|
|
|
<text v-if="vuex_user.mobile">
|
|
|
|
|
{{ vuex_user.mobile || '' }}
|
|
|
|
|
</text>
|
|
|
|
|
<!-- <u-button shape="circle"-->
|
|
|
|
|
<!-- size="mini"-->
|
|
|
|
|
<!-- type="primary"-->
|
|
|
|
|
<!-- ripple>获取手机号</u-button>-->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-else class="info">
|
|
|
|
|
<view class="info-name">未登录</view>
|
|
|
|
|
<u-button shape="circle"
|
|
|
|
|
size="mini"
|
|
|
|
|
type="primary"
|
|
|
|
|
ripple
|
|
|
|
|
@click="$u.route({
|
|
|
|
|
url: '/pages/login/login',
|
|
|
|
|
type: 'redirect'
|
|
|
|
|
})">点击登录</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="panel panel1">
|
|
|
|
|
<view v-if="token" class="panel panel1">
|
|
|
|
|
<view class="tab"
|
|
|
|
|
@click="$u.route({
|
|
|
|
|
url: '/package_sub/pages/OrderList/OrderList',
|
|
|
|
|
@ -44,6 +65,7 @@
|
|
|
|
|
@click="$u.route({
|
|
|
|
|
url: '/package_sub/pages/OrderList/OrderList',
|
|
|
|
|
params: {
|
|
|
|
|
pay_status: 2
|
|
|
|
|
}
|
|
|
|
|
})">
|
|
|
|
|
<image class="tab__icon" mode="aspectFit" src="~@/static/index/jiuyifuwu.png"></image>
|
|
|
|
|
@ -51,43 +73,128 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="panel panel2">
|
|
|
|
|
<view class="row" @click="isShowShare = true">
|
|
|
|
|
<button class="row" open-type="share">
|
|
|
|
|
<u-icon class="row__icon" name="share"></u-icon>
|
|
|
|
|
<view>我要分享</view>
|
|
|
|
|
</view>
|
|
|
|
|
</button>
|
|
|
|
|
<view class="row">
|
|
|
|
|
<u-icon class="row__icon" name="man-add"></u-icon>
|
|
|
|
|
<view>加入我们</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="row">
|
|
|
|
|
<u-icon class="row__icon" name="heart"></u-icon>
|
|
|
|
|
<view>关注</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="row">
|
|
|
|
|
<u-icon class="row__icon" name="kefu-ermai"></u-icon>
|
|
|
|
|
<view>联系我们</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="row" v-if="token" @click="logout">-->
|
|
|
|
|
<!-- <u-icon class="row__icon" name="backspace"></u-icon>-->
|
|
|
|
|
<!-- <view>退出</view>-->
|
|
|
|
|
<!-- </view>-->
|
|
|
|
|
</view>
|
|
|
|
|
<tabbar />
|
|
|
|
|
|
|
|
|
|
<share v-model="isShowShare" />
|
|
|
|
|
<!-- 设置头像 -->
|
|
|
|
|
<view class="myinfo">
|
|
|
|
|
<u-popup v-model="isShowMyInfo" mode="bottom" :border-radius="30" safe-area-inset-bottom>
|
|
|
|
|
<view class="form-wrapper">
|
|
|
|
|
<u-form :model="form" ref="uForm" label-width="140rpx">
|
|
|
|
|
<u-form-item label="头像">
|
|
|
|
|
<button class="btn-normal" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
|
|
|
|
<image :src="form.headimgurl || vuex_default_icon" mode="aspectFit"></image>
|
|
|
|
|
</button>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="性别">
|
|
|
|
|
<u-radio-group v-model="form.sex">
|
|
|
|
|
<u-radio name="男">男</u-radio>
|
|
|
|
|
<u-radio name="女">女</u-radio>
|
|
|
|
|
<u-radio name="保密">保密</u-radio>
|
|
|
|
|
</u-radio-group>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- <u-form-item label="手机号">-->
|
|
|
|
|
<!-- <button class="btn-normal" open-type="getPhoneNumber" @getphonenumber="onPhoneNumber">-->
|
|
|
|
|
<!-- <view>{{ vuex_user.mobile || '点击授权' }}</view>-->
|
|
|
|
|
<!-- </button>-->
|
|
|
|
|
<!-- </u-form-item>-->
|
|
|
|
|
</u-form>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 操作按钮 -->
|
|
|
|
|
<view class="footer">
|
|
|
|
|
<view class="btn-wrapper">
|
|
|
|
|
<u-button type="primary" shape="circle" ripple :custom-style="{ 'width': '90%', 'margin': 'auto' }" @click="submit">保存</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { ROOTPATH } from '@/common/config'
|
|
|
|
|
import { WXBizDataCrypt } from '@/libs/WXBizDataCrypt'
|
|
|
|
|
import Tabbar from "@/component/Tabbar/Tabbar.vue";
|
|
|
|
|
import Share from "@/component/Share/Share.vue";
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
Tabbar,
|
|
|
|
|
Share
|
|
|
|
|
Tabbar
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
isShowShare: false
|
|
|
|
|
isShowMyInfo: false,
|
|
|
|
|
form: {
|
|
|
|
|
headimgurl: '',
|
|
|
|
|
mobile: '',
|
|
|
|
|
sex: ''
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onChooseAvatar(e) {
|
|
|
|
|
uni.uploadFile({
|
|
|
|
|
url: ROOTPATH + "/api/mobile/upload-file",
|
|
|
|
|
filePath: e.detail.avatarUrl,
|
|
|
|
|
name: 'file',
|
|
|
|
|
header: {
|
|
|
|
|
['Authorization']: `Bearer ${this.token}`
|
|
|
|
|
},
|
|
|
|
|
success: (res) => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '上传成功',
|
|
|
|
|
duration: 1000,
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
let data = JSON.parse(res.data)
|
|
|
|
|
this.form.headimgurl = data.url
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
this.$u.api.updateUser(this.form).then(async (_) => {
|
|
|
|
|
const { user } = await this.$u.api.getUserInfo()
|
|
|
|
|
this.$u.vuex('vuex_user', user)
|
|
|
|
|
this.$u.toast('保存成功')
|
|
|
|
|
this.isShowMyInfo = false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
logout() {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: '确认退出?',
|
|
|
|
|
success: status => {
|
|
|
|
|
if (status.confirm) {
|
|
|
|
|
this.$u.vuex('vuex_token', '')
|
|
|
|
|
this.$u.vuex('vuex_user', {})
|
|
|
|
|
uni.setStorageSync('lifeData', {})
|
|
|
|
|
this.$u.route({
|
|
|
|
|
url: '/pages/index/index',
|
|
|
|
|
type: 'tab'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
token() {
|
|
|
|
|
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
},
|
|
|
|
|
@ -160,6 +267,16 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.panel2 {
|
|
|
|
|
button {
|
|
|
|
|
border: none;
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333;
|
|
|
|
|
&::after {
|
|
|
|
|
border: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.row {
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 20rpx 10rpx;
|
|
|
|
|
@ -173,4 +290,40 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-wrapper {
|
|
|
|
|
margin: 20rpx auto 20rpx auto;
|
|
|
|
|
padding: 0 40rpx;
|
|
|
|
|
width: 94%;
|
|
|
|
|
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
|
|
|
|
.btn-normal {
|
|
|
|
|
display: block;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
line-height: normal;
|
|
|
|
|
background: none;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
box-shadow: none;
|
|
|
|
|
border: none;
|
|
|
|
|
font-size: unset;
|
|
|
|
|
text-align: unset;
|
|
|
|
|
overflow: visible;
|
|
|
|
|
color: inherit;
|
|
|
|
|
|
|
|
|
|
image {
|
|
|
|
|
width: 120rpx;
|
|
|
|
|
height: 120rpx;
|
|
|
|
|
border-radius: 100%;
|
|
|
|
|
border: 2px solid #fff;
|
|
|
|
|
margin-right: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-normal::after {
|
|
|
|
|
border: none
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|