|
|
|
<template>
|
|
|
|
<view class="site">
|
|
|
|
<view class="site-bd">
|
|
|
|
<view class="item" @click="openPage(1)">
|
|
|
|
<view class="a">个人信息</view>
|
|
|
|
<view class="b">
|
|
|
|
<image src="https://www.lijkj.cn/static/icon-arrow.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="item" @click="openPage(2)">
|
|
|
|
<view class="a">关于我们</view>
|
|
|
|
<view class="b">
|
|
|
|
<image src="https://www.lijkj.cn/static/icon-arrow.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="item" @click="openPage(3)">
|
|
|
|
<view class="a">资质证明</view>
|
|
|
|
<view class="b">
|
|
|
|
<image src="https://www.lijkj.cn/static/icon-arrow.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="item" @click="openPage(4)">
|
|
|
|
<view class="a">协议规则</view>
|
|
|
|
<view class="b">
|
|
|
|
<image src="https://www.lijkj.cn/static/icon-arrow.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- <view class="item" @click="openPage(5)">
|
|
|
|
<view class="a">隐私协议</view>
|
|
|
|
<view class="b">
|
|
|
|
<image src="https://www.lijkj.cn/static/icon-arrow.png"></image>
|
|
|
|
</view>
|
|
|
|
</view> -->
|
|
|
|
</view>
|
|
|
|
<view class="btn" v-if="token" @click="openPage(6)">退出登录</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
token: {}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.token = uni.getStorageSync("token")
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
openPage(index){
|
|
|
|
if(index == 1){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "/pages/user/personal"
|
|
|
|
})
|
|
|
|
}else if(index == 2){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "/pages/view/outer?type=GYWM"
|
|
|
|
})
|
|
|
|
}else if(index == 3){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "/pages/view/outer?type=ZZZM"
|
|
|
|
})
|
|
|
|
}else if(index == 4){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "/pages/user/rule"
|
|
|
|
})
|
|
|
|
}else if(index == 5){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "/pages/view/outer?type=YSXY"
|
|
|
|
})
|
|
|
|
}else if(index == 6){
|
|
|
|
uni.showModal({
|
|
|
|
title: "温馨提示",
|
|
|
|
content: "确定要退出吗?",
|
|
|
|
confirmColor: "#00C6A9",
|
|
|
|
confirmText: "退出",
|
|
|
|
success(res) {
|
|
|
|
if(res.confirm){
|
|
|
|
uni.showToast({
|
|
|
|
title: "退出成功"
|
|
|
|
})
|
|
|
|
uni.removeStorageSync("token");
|
|
|
|
uni.removeStorageSync("userInfo");
|
|
|
|
setTimeout(()=>{
|
|
|
|
uni.navigateBack({
|
|
|
|
delta: 1
|
|
|
|
})
|
|
|
|
},2000)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async toSubmit() {
|
|
|
|
if (!this.userInfo.username) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '请输入用户名',
|
|
|
|
icon: 'none',
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (!this.userInfo.mobile) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '请输入手机号',
|
|
|
|
icon: 'none',
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!/^1[3456789]\d{9}$/.test(this.userInfo.mobile)) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '请输入正确手机号',
|
|
|
|
icon: 'none',
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
const { code, data, message } = await this.$api.editMember({
|
|
|
|
avatar: this.userInfo.avatar,
|
|
|
|
username: this.userInfo.username,
|
|
|
|
mobile: this.userInfo.mobile,
|
|
|
|
wx_qr_code: "",
|
|
|
|
alipay_account: "",
|
|
|
|
wx_account: "",
|
|
|
|
});
|
|
|
|
if(code == 200){
|
|
|
|
uni.showToast({
|
|
|
|
title: "提交成功"
|
|
|
|
})
|
|
|
|
setTimeout(()=>{
|
|
|
|
uni.navigateBack({
|
|
|
|
delta: 1
|
|
|
|
})
|
|
|
|
},1000)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
//上传图片
|
|
|
|
uploadImg() {
|
|
|
|
const that = this
|
|
|
|
uni.chooseImage({
|
|
|
|
count: 1,
|
|
|
|
sizeType: ["original"], //可以指定是原图还是压缩图,默认二者都有
|
|
|
|
sourceType: ["album", "camera"],
|
|
|
|
success: (res) => {
|
|
|
|
console.log(res.tempFilePaths[0])
|
|
|
|
uni.uploadFile({
|
|
|
|
name: 'file',
|
|
|
|
header: {
|
|
|
|
userToken: uni.getStorageSync('token')
|
|
|
|
},
|
|
|
|
url: this.$baseUrl+'api/user/upload',
|
|
|
|
filePath: res.tempFilePaths[0],
|
|
|
|
success: (upRes) => {
|
|
|
|
let end = JSON.parse(upRes.data)
|
|
|
|
that.userInfo.avatar = end.data.path
|
|
|
|
that.userInfo.avatar1 = end.data.url
|
|
|
|
},
|
|
|
|
fail: (err) => {
|
|
|
|
console.log("toUpload err",err)
|
|
|
|
console.log(err)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
fail(err){
|
|
|
|
console.log("fail",err)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.site{
|
|
|
|
padding: 25rpx;
|
|
|
|
overflow: hidden;
|
|
|
|
.btn{
|
|
|
|
width: 100%;
|
|
|
|
height: 90rpx;
|
|
|
|
box-shadow: 0px 3rpx 10rpx 0px rgba(9,44,39,0.05);
|
|
|
|
border-radius: 90rpx;
|
|
|
|
border: 1px solid #00C6A9;
|
|
|
|
line-height: 90rpx;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 30rpx;
|
|
|
|
color: #00C6A9;
|
|
|
|
margin-top: 400rpx;
|
|
|
|
}
|
|
|
|
&-bd{
|
|
|
|
width: 700rpx;
|
|
|
|
background: #FFFFFF;
|
|
|
|
box-shadow: 0px 3rpx 10rpx 0px rgba(9,44,39,0.05);
|
|
|
|
border-radius: 20rpx;
|
|
|
|
margin: 0 auto;
|
|
|
|
padding: 0 30rpx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
position: relative;
|
|
|
|
.item{
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
border-top: 1px solid #EAEAEA;
|
|
|
|
padding: 35rpx 0;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
&:first-child{
|
|
|
|
border-color: #FFFFFF;
|
|
|
|
}
|
|
|
|
.a{
|
|
|
|
width: 160rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 30rpx;
|
|
|
|
color: #222222;
|
|
|
|
}
|
|
|
|
.b{
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-end;
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #999999;
|
|
|
|
input{
|
|
|
|
flex: 1;
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #999999;
|
|
|
|
}
|
|
|
|
text{
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #00C6A9;
|
|
|
|
margin-left: 15rpx;
|
|
|
|
}
|
|
|
|
image{
|
|
|
|
width: 60rpx;
|
|
|
|
height: 60rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|