@@ -2,7 +2,7 @@
|
||||
|
||||
// 引入 uni-ajax 模块
|
||||
import ajax from '@/uni_modules/u-ajax'
|
||||
|
||||
import store from '@/store/index.js';
|
||||
// 创建请求实例
|
||||
const instance = ajax.create({
|
||||
// 初始配置
|
||||
@@ -11,7 +11,10 @@ const instance = ajax.create({
|
||||
|
||||
// 添加请求拦截器
|
||||
instance.interceptors.request.use(
|
||||
config => {
|
||||
config => {
|
||||
if (store.getters.getuserIsLogin) {
|
||||
config.header['token'] = store.state.user.token
|
||||
}
|
||||
// 在发送请求前做些什么
|
||||
return config
|
||||
},
|
||||
@@ -25,12 +28,14 @@ instance.interceptors.request.use(
|
||||
instance.interceptors.response.use(
|
||||
response => {
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
let res = response.data;
|
||||
if (res.hasOwnProperty('token'))
|
||||
uni.setStorageSync('token', res.token);
|
||||
return response.data
|
||||
}
|
||||
}
|
||||
// 对响应数据做些什么
|
||||
console.log(response)
|
||||
|
||||
|
||||
return response.data
|
||||
},
|
||||
error => {
|
||||
|
||||
@@ -113,13 +113,11 @@
|
||||
},
|
||||
onLoad: function() {},
|
||||
methods: {
|
||||
...mapMutations(["updateUserInfo", "saveUserInfoToStorge"]),
|
||||
onChooseAvatar(e) {
|
||||
console.log(e)
|
||||
...mapMutations(["updateUserInfo"]),
|
||||
onChooseAvatar(e) {
|
||||
const {
|
||||
avatarUrl
|
||||
} = e.detail
|
||||
|
||||
this.formDataReg.avatarUrl = avatarUrl
|
||||
},
|
||||
submitLogin(loginform) {
|
||||
@@ -169,8 +167,7 @@
|
||||
sessionKey: this.sessionKey,
|
||||
openId: this.openId,
|
||||
}).then(res => {
|
||||
this.formDataReg.mobile = res.data.phoneNumber
|
||||
console.log(res.data)
|
||||
this.formDataReg.mobile = res.data.phoneNumber
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
22
cpzs/chucang/chucang.vue
Normal file
22
cpzs/chucang/chucang.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
22
cpzs/chushou/chushou.vue
Normal file
22
cpzs/chushou/chushou.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
22
cpzs/diaohuo/diaohuo.vue
Normal file
22
cpzs/diaohuo/diaohuo.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
114
cpzs/index/index.vue
Normal file
114
cpzs/index/index.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view class="box-bg">
|
||||
<uni-nav-bar fixed="true" statusBar="true" leftIcon="left" leftText="返回" @clickLeft="back" rightIcon="scan" @clickRight="scan">
|
||||
<view class="input-view">
|
||||
<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
|
||||
<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词"
|
||||
@confirm="confirm" />
|
||||
</view>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
city: '北京'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
search() {
|
||||
uni.showToast({
|
||||
title: '搜索'
|
||||
})
|
||||
},
|
||||
scan() {
|
||||
// #ifdef H5
|
||||
uni.showToast({
|
||||
title: '暂不支持H5扫码'
|
||||
})
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
confirm() {
|
||||
uni.showToast({
|
||||
title: '搜索'
|
||||
})
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log('onPullDownRefresh')
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh()
|
||||
console.log('stopPullDownRefresh')
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
$nav-height: 30px;
|
||||
|
||||
.box-bg {
|
||||
background-color: #F5F5F5;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.city {
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
// width: 160rpx;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.input-view {
|
||||
/* #ifndef APP-PLUS-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
// width: 500rpx;
|
||||
flex: 1;
|
||||
background-color: #f8f8f8;
|
||||
height: $nav-height;
|
||||
border-radius: 15px;
|
||||
padding: 0 15px;
|
||||
flex-wrap: nowrap;
|
||||
margin: 7px 0;
|
||||
line-height: $nav-height;
|
||||
}
|
||||
|
||||
.input-uni-icon {
|
||||
line-height: $nav-height;
|
||||
}
|
||||
|
||||
.nav-bar-input {
|
||||
height: $nav-height;
|
||||
line-height: $nav-height;
|
||||
/* #ifdef APP-PLUS-NVUE */
|
||||
width: 370rpx;
|
||||
/* #endif */
|
||||
padding: 0 5px;
|
||||
font-size: 12px;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
</style>
|
||||
|
||||
22
cpzs/rucang/rucang.vue
Normal file
22
cpzs/rucang/rucang.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
22
cpzs/ruku/ruku.vue
Normal file
22
cpzs/ruku/ruku.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
22
cpzs/shouhou/shouhou.vue
Normal file
22
cpzs/shouhou/shouhou.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
22
cpzs/shouhoudo/shouhoudo.vue
Normal file
22
cpzs/shouhoudo/shouhoudo.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,77 +1,62 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<uni-nav-bar shadow left-icon="left" fixed leftText="返回" dark rightIcon="compose" rightText="编辑" title="个人资料"/>
|
||||
<uni-nav-bar shadow left-icon="left" fixed leftText="返回" dark rightIcon="compose" rightText="编辑" @clickRight="editTrue" title="个人资料"/>
|
||||
<view class="example">
|
||||
<!-- 基础表单校验 -->
|
||||
<uni-forms ref="valiForm" :rules="rules" :modelValue="formData">
|
||||
|
||||
<uni-forms-item label="签名">
|
||||
<uni-easyinput type="textarea" :disabled="isDisabled" v-model="formData.introduction"
|
||||
placeholder="请输入自我介绍" />
|
||||
<uni-easyinput type="textarea" :disabled="isDisabled" v-model="formData.signature"
|
||||
placeholder="个性签名" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="昵称" name="nickname">
|
||||
<uni-easyinput v-model="formData.nickname" placeholder="请输入昵称" :disabled="isDisabled" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="性别">
|
||||
<uni-forms-item label="性别" name="sex">
|
||||
<uni-data-checkbox v-model="formData.sex" :localdata="sexs" :disabled="isDisabled" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="生日">
|
||||
<uni-datetime-picker type="date" return-type="timestamp" v-model="formData.datetimesingle"
|
||||
<uni-forms-item label="生日" name="birthday">
|
||||
<uni-datetime-picker type="date" return-type="timestamp" v-model="formData.birthday"
|
||||
:disabled="isDisabled" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="身高" name="height">
|
||||
<uni-easyinput v-model="formData.height" type="number" placeholder="请输入姓名" :disabled="isDisabled" />
|
||||
<uni-easyinput v-model="formData.height" type="number" placeholder="身高" :disabled="isDisabled" />
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="所在地">
|
||||
<uni-data-picker popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
<uni-forms-item label="所在地" name="location">
|
||||
<uni-data-picker v-model="formData.location" popup-title="请选所在地区" :readonly="isDisabled"></uni-data-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="学历">
|
||||
<uni-data-select :localdata="educations" :disabled="isDisabled">
|
||||
<uni-forms-item label="学历" name="education">
|
||||
<uni-data-select v-model="formData.education" :localdata="educations" :disabled="isDisabled">
|
||||
</uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="职业">
|
||||
<uni-data-picker popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
<uni-forms-item label="职业" name="job">
|
||||
<uni-data-picker v-model="formData.job" popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="企业">
|
||||
<uni-easyinput type="number" placeholder="请输入姓名" :disabled="isDisabled" />
|
||||
<uni-forms-item label="企业" name="company">
|
||||
<uni-easyinput v-model="formData.company" type="text" placeholder="请输入姓名" :disabled="isDisabled" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="家乡">
|
||||
<uni-data-picker popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
<uni-forms-item label="家乡" name="hometown">
|
||||
<uni-data-picker v-model="formData.hometown" popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="自我介绍" name="introduction">
|
||||
<uni-forms-item label="简介" name="introduction">
|
||||
<uni-easyinput type="textarea" v-model="formData.introduction" placeholder="请输入自我介绍"
|
||||
:disabled="isDisabled" />
|
||||
</uni-forms-item>
|
||||
|
||||
|
||||
<uni-forms-item label="月收入">
|
||||
<uni-data-select :localdata="educations" :disabled="isDisabled">
|
||||
<uni-forms-item label="月收入" name="income">
|
||||
<uni-data-select v-model="formData.income" :localdata="educations" :disabled="isDisabled">
|
||||
</uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="婚姻">
|
||||
<uni-forms-item label="婚姻" name="marriage" >
|
||||
<uni-data-select :localdata="educations" :disabled="isDisabled">
|
||||
</uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="房产">
|
||||
<uni-forms-item label="房产" name="house">
|
||||
<uni-data-picker popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
</uni-forms-item>
|
||||
|
||||
|
||||
|
||||
<uni-forms-item label="所在地">
|
||||
<uni-data-picker popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="年龄">
|
||||
<uni-data-picker popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="身高">
|
||||
<uni-data-picker popup-title="请选择班级" :readonly="isDisabled"></uni-data-picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="学历">
|
||||
<uni-data-select :localdata="educations" :disabled="isDisabled">
|
||||
</uni-data-select>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<button type="primary" @click="submit('valiForm')">提交</button>
|
||||
</view>
|
||||
@@ -87,13 +72,20 @@
|
||||
isDisabled: true,
|
||||
// 基础表单数据
|
||||
formData: {
|
||||
signature:'',
|
||||
nickname: '',
|
||||
height:0,
|
||||
age: 0,
|
||||
sex: 1,
|
||||
birthday: 0,
|
||||
height:178,
|
||||
location:"",
|
||||
education:"",
|
||||
job:"",
|
||||
company:"",
|
||||
hometown:"",
|
||||
introduction: '',
|
||||
sex: 2,
|
||||
hobby: [5],
|
||||
datetimesingle: 1627529992399
|
||||
income:"",
|
||||
marriage:"",
|
||||
house:"",
|
||||
},
|
||||
|
||||
|
||||
@@ -212,6 +204,10 @@
|
||||
//this.$refs.customForm.setRules(this.customRules)
|
||||
},
|
||||
methods: {
|
||||
editTrue(){
|
||||
this.isDisabled = false;
|
||||
console.log(this.isDisabled)
|
||||
},
|
||||
onClickItem(e) {
|
||||
console.log(e);
|
||||
this.current = e.currentIndex
|
||||
|
||||
66
pages.json
66
pages.json
@@ -78,7 +78,71 @@
|
||||
}]
|
||||
},{
|
||||
"root": "cpzs",
|
||||
"pages": []
|
||||
"pages": [{
|
||||
"path" : "index/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "ruku/ruku",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "rucang/rucang",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "diaohuo/diaohuo",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "chushou/chushou",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "shouhou/shouhou",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "shouhoudo/shouhoudo",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
|
||||
@@ -1,36 +1,41 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="warp">
|
||||
<uni-search-bar @confirm="search" v-model="searchValue" @input="input" clearButton="always"
|
||||
cancelButton="none" @clear="scan">
|
||||
<template v-slot:clearIcon>
|
||||
<uni-icons color="#999999" size="18" type="scan" />
|
||||
</template>
|
||||
</uni-search-bar>
|
||||
<uni-nav-bar fixed="true" statusBar="true" leftWidth="10px" right-width="10px">
|
||||
<view style="display: flex; align-items: center; width: 100%; background-color: transparent; ">
|
||||
<uni-search-bar @confirm="search" v-model="searchValue" @input="input" clearButton="always"
|
||||
cancelButton="none" @clear="scan">
|
||||
<template v-slot:clearIcon>
|
||||
<uni-icons color="#999999" size="18" type="scan" />
|
||||
</template>
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
</uni-nav-bar>
|
||||
|
||||
<!-- 个人中心页方格列表数据 -->
|
||||
<view class="Grid">
|
||||
<view class="Grid-Item">
|
||||
<view class="Grid-Item-1">
|
||||
<image class="GSimg" src="../../../static/logo.png"></image>
|
||||
<view class="GStitle">测试功能</view>
|
||||
<view class="GStitle">新闻动态</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="Grid-Item">
|
||||
<view class="Grid-Item-1">
|
||||
<image class="GSimg" src="../../../static/logo.png"></image>
|
||||
<view class="GStitle">测试功能</view>
|
||||
<view class="GStitle">视频教程</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="Grid-Item">
|
||||
<view class="Grid-Item-1">
|
||||
<image class="GSimg" src="../../../static/logo.png"></image>
|
||||
<view class="GStitle">测试功能</view>
|
||||
<view class="GStitle">产品追溯</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="Grid-Item">
|
||||
<view class="Grid-Item-1">
|
||||
<image class="GSimg" src="../../../static/logo.png"></image>
|
||||
<view class="GStitle">测试功能</view>
|
||||
<view class="GStitle">车架查询</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1304,7 +1309,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
page {
|
||||
page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="warp warp1" style="">
|
||||
<view class="user" style="">
|
||||
<view>
|
||||
<view class="warp warp1">
|
||||
<view class="user">
|
||||
<view class="user-info">
|
||||
<text class="nickname"> {{userInfo.nickname}} </text>
|
||||
<text> UID {{userInfo.uid}}</text>
|
||||
<text> UID {{userInfo.uid}}</text>
|
||||
<text> 云深不知归处,爱你不会迷路</text>
|
||||
</view>
|
||||
<image class="user-avatar" mode="aspectFit" :src="userInfo.avatar"
|
||||
@@ -39,30 +39,24 @@
|
||||
</view>
|
||||
|
||||
<view style="padding: 10rpx;"></view>
|
||||
<uni-list style="">
|
||||
<uni-list-item :showExtraIcon="true" :extraIcon="{color: '#4cd964',size: '25',type: 'gear'}"
|
||||
title="列表左侧带扩展图标" clickable showArrow>
|
||||
<uni-list>
|
||||
<uni-list-item :showExtraIcon="true" link to="/member/profile/profile" :extraIcon="{color: '#4cd964',size: '25',type: 'gear'}"
|
||||
title="个人信息" clickable showArrow>
|
||||
</uni-list-item>
|
||||
<uni-list-item :showExtraIcon="true" :extraIcon="{color: '#4cd964',size: '25',type: 'gear'}"
|
||||
title="列表左侧带扩展图标" clickable showArrow>
|
||||
</uni-list-item>
|
||||
<uni-list-item :showExtraIcon="true" :extraIcon="{color: '#4cd964',size: '25',type: 'gear'}"
|
||||
title="列表左侧带扩展图标" clickable showArrow>
|
||||
</uni-list-item>
|
||||
title="账号与安全" clickable showArrow>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
<view style="padding: 10rpx;"></view>
|
||||
<uni-list>
|
||||
<uni-list-item title="列表左侧带略缩图"
|
||||
thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
|
||||
thumb-size="sm" rightText="右侧文字" showArrow></uni-list-item>
|
||||
<uni-list>
|
||||
<uni-list-item :showExtraIcon="true" :extraIcon="{color: '#4cd964',size: '25',type: 'gear'}" title="设置"
|
||||
clickable showArrow>
|
||||
</uni-list-item>
|
||||
<uni-list-item :showExtraIcon="true" :extraIcon="{color: '#4cd964',size: '25',type: 'info'}" title="关于"
|
||||
clickable showArrow>
|
||||
</uni-list-item>
|
||||
<uni-list-item :showExtraIcon="true" :extraIcon="{color: '#ff0000',size: '25',type: 'back'}" title="退出"
|
||||
clickable showArrow>
|
||||
<uni-list-item :showExtraIcon="true" @click="logOut"
|
||||
:extraIcon="{color: '#ff0000',size: '25',type: 'back'}" title="注销登录" clickable showArrow>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
</view>
|
||||
@@ -88,8 +82,7 @@
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
onLoad() {
|
||||
console.log(this.isLogin);
|
||||
onLoad() {
|
||||
if (!this.isLogin) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login"
|
||||
@@ -97,7 +90,23 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
logOut() {
|
||||
let self = this;
|
||||
uni.showModal({
|
||||
content: "确定注销登录嘛?",
|
||||
confirmText: "确定",
|
||||
cancelText: "取消",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
self.$store.dispatch("actionLogout");
|
||||
uni.reLaunch({
|
||||
url:"/pages/tabbar/home/home"
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
// #ifdef APP-PLUS
|
||||
@@ -108,24 +117,26 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.warp1{ }
|
||||
.warp1 {}
|
||||
|
||||
.user {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-items: center;
|
||||
padding: 180rpx 25rpx 25rpx 15rpx;
|
||||
/* #ifdef H5 */
|
||||
padding-top: 80rpx;
|
||||
/* #endif */
|
||||
|
||||
/* #endif */
|
||||
// background-image: url(/static/user/back.jpg);
|
||||
// background-size: 100% 100%;
|
||||
// background: linear-gradient(pink,#a900ff7a, pink);
|
||||
.user-avatar {
|
||||
width: 138rpx;
|
||||
height: 138rpx;
|
||||
border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
@@ -134,8 +145,8 @@
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding-left: 25rpx;
|
||||
|
||||
.nickname{
|
||||
|
||||
.nickname {
|
||||
font-size: 64rpx;
|
||||
font-weight: 48rpx;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// 子模块moduleB路径:store/modules/moduleB.js
|
||||
export default {
|
||||
state: {
|
||||
timestamp: 1608820295, //初始时间戳
|
||||
isLogin: false,
|
||||
timestamp: 1608820295, //初始时间戳
|
||||
token: uni.getStorageSync('token') || '',
|
||||
userinfo: JSON.parse(uni.getStorageSync('userinfo') || '{}'),
|
||||
openId: null,
|
||||
@@ -21,8 +20,8 @@ export default {
|
||||
var trDay = day < 10 ? '0' + day : day
|
||||
return year + '-' + trMon + '-' + trDay + " " + hours + ":" + minu + ":" + sec;
|
||||
},
|
||||
getuserIsLogin(state){
|
||||
return state.isLogin;
|
||||
getuserIsLogin(state){
|
||||
return Object.keys(state.userinfo).length > 0 ;
|
||||
},
|
||||
getSessionKey(state){
|
||||
return state.sessionKey;
|
||||
@@ -42,26 +41,11 @@ export default {
|
||||
state.timestamp = Date.now()
|
||||
},
|
||||
// 更新用户信息
|
||||
updateUserInfo(state, userinfo) {
|
||||
state.userinfo = userinfo
|
||||
state.isLogin = true;
|
||||
this.commit('saveUserInfoToStorge')
|
||||
},
|
||||
// 将用户信息持久化存储到本地
|
||||
saveUserInfoToStorge(state) {
|
||||
uni.setStorageSync('userinfo', JSON.stringify(state.userinfo))
|
||||
},
|
||||
// 更新 token 字符串
|
||||
updateToken(state, token) {
|
||||
state.token = token
|
||||
// 调用saveTokenToStorage方法
|
||||
this.commit('saveTokenToStorage')
|
||||
},
|
||||
|
||||
// 将 token 字符串持久化存储到本地
|
||||
saveTokenToStorage(state) {
|
||||
uni.setStorageSync('token', state.token)
|
||||
updateUserInfo(state, userinfo) {
|
||||
state.userinfo = userinfo ;
|
||||
uni.setStorageSync('userinfo', JSON.stringify(state.userinfo)) ;
|
||||
},
|
||||
|
||||
// 将 token 字符串持久化存储到本地
|
||||
saveOpenIdSession(state, res) {
|
||||
console.log("saveOpenIdSession",res)
|
||||
@@ -71,6 +55,11 @@ export default {
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
actionLogout(context ){
|
||||
uni.$ajax("/User/logout").then(res => {
|
||||
context.commit('updateUserInfo', {});
|
||||
uni.setStorageSync('token', "");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user