个人中心页面路径配置
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
import http from '@/http/http.js'
|
import http from '@/http/http.js'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取提现金额
|
* 获取提现金额
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -9,3 +9,14 @@ export const selectUserById = (data) => {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户信息
|
||||||
|
*/
|
||||||
|
export const updateUsers = (data) => {
|
||||||
|
return http.request({
|
||||||
|
url: '/user/updateUsers',
|
||||||
|
method: 'POST',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -95,6 +95,11 @@
|
|||||||
"navigationBarTitleText": "注册",
|
"navigationBarTitleText": "注册",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "pages/login/bind",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "修改手机号"
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/login/registerApp",
|
"path": "pages/login/registerApp",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -9,14 +9,14 @@
|
|||||||
<image class="img" src="/static/logo.png" mode="widthFix"></image>
|
<image class="img" src="/static/logo.png" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="quick-menu">
|
<view class="quick-menu">
|
||||||
<image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit" @click="linkTo('/pages/share/index')"></image>
|
||||||
<image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit"></image>
|
||||||
<navigator hover-class="none" url="/pages/me/contact">
|
<navigator hover-class="none" url="/pages/me/contact">
|
||||||
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit"></image>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="top">
|
<view class="top" @click="linkTo('/pages/me/userInfo')">
|
||||||
<image class="avatar" :src="userInfo.avatar || '/static/default_avatar.png'" mode="aspectFill"></image>
|
<image class="avatar" :src="userInfo.avatar || '/static/default_avatar.png'" mode="aspectFill"></image>
|
||||||
<view class="info-wrap">
|
<view class="info-wrap">
|
||||||
<view class="name">{{ userInfo.phone || '请登录' }}</view>
|
<view class="name">{{ userInfo.phone || '请登录' }}</view>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<view class="title">我的追剧</view>
|
<view class="title">我的追剧</view>
|
||||||
<view class="num">{{ likeData.collectCount }}</view>
|
<view class="num">{{ likeData.collectCount }}</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<view class="item">
|
<view class="item" @click="linkTo('/pages/me/withdraw/index')">
|
||||||
<view class="title">我的红包</view>
|
<view class="title">我的红包</view>
|
||||||
<view class="num">{{ amount || 0 }}</view>
|
<view class="num">{{ amount || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -82,11 +82,11 @@
|
|||||||
<image class="icon" src="/static/me/menu_icon4.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon4.png" mode="aspectFit"></image>
|
||||||
<view class="name">帮助中心</view>
|
<view class="name">帮助中心</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item" @click="linkTo('/pages/login/download')">
|
||||||
<image class="icon" src="/static/me/menu_icon5.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon5.png" mode="aspectFit"></image>
|
||||||
<view class="name">检查更新</view>
|
<view class="name">检查更新</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item" @click="linkTo('/pages/me/agreement')">
|
||||||
<image class="icon" src="/static/me/menu_icon6.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon6.png" mode="aspectFit"></image>
|
||||||
<view class="name">用户协议</view>
|
<view class="name">用户协议</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<image class="icon" src="/static/me/menu_icon7.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon7.png" mode="aspectFit"></image>
|
||||||
<view class="name">关于我们</view>
|
<view class="name">关于我们</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item" @click="linkTo('/pages/me/privacy')">
|
||||||
<image class="icon" src="/static/me/menu_icon8.png" mode="aspectFit"></image>
|
<image class="icon" src="/static/me/menu_icon8.png" mode="aspectFit"></image>
|
||||||
<view class="name">隐私政策</view>
|
<view class="name">隐私政策</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive } from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
|
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
|
||||||
import { linkTo } from '@/utils/app.js';
|
import { linkTo } from '@/utils/app.js';
|
||||||
|
|
||||||
@@ -158,11 +158,13 @@ function toTask() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
userInfo.value = uni.getStorageSync('userInfo');
|
|
||||||
selectByUserIdAjax();
|
selectByUserIdAjax();
|
||||||
collectVideoSummaryAjax();
|
collectVideoSummaryAjax();
|
||||||
selectUserMoneyAjax();
|
selectUserMoneyAjax();
|
||||||
});
|
});
|
||||||
|
onShow(() => {
|
||||||
|
userInfo.value = uni.getStorageSync('userInfo');
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item">
|
<view class="item" @click="linkTo('/pages/login/bind')">
|
||||||
<view class="title">修改手机号</view>
|
<view class="title">修改手机号</view>
|
||||||
<up-icon name="arrow-right" />
|
<up-icon name="arrow-right" />
|
||||||
</view>
|
</view>
|
||||||
@@ -13,11 +13,11 @@
|
|||||||
<view class="title">意见反馈</view>
|
<view class="title">意见反馈</view>
|
||||||
<up-icon name="arrow-right" />
|
<up-icon name="arrow-right" />
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item" @click="linkTo('/pages/me/agreement')">
|
||||||
<view class="title">用户协议</view>
|
<view class="title">用户协议</view>
|
||||||
<up-icon name="arrow-right" />
|
<up-icon name="arrow-right" />
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item" @click="linkTo('/pages/me/privacy')">
|
||||||
<view class="title">隐私协议</view>
|
<view class="title">隐私协议</view>
|
||||||
<up-icon name="arrow-right" />
|
<up-icon name="arrow-right" />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<up-cell-group>
|
<up-cell-group>
|
||||||
<up-cell title="头像">
|
<up-cell title="头像">
|
||||||
<template #value>
|
<template #value>
|
||||||
<image :src="data.userInfo.avatar?data.userInfo.avatar:'../../static/default/avatar.png'" mode="" @click="uploadImg"
|
<image :src="data.userInfo.avatar?data.userInfo.avatar:'../../static/default/avatar.png'" mode="aspectFill" @click="uploadImg"
|
||||||
style="width: 111rpx;height: 111rpx;border-radius: 50%;"></image>
|
style="width: 111rpx;height: 111rpx;border-radius: 50%;"></image>
|
||||||
</template>
|
</template>
|
||||||
</up-cell>
|
</up-cell>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
import { onShow} from '@dcloudio/uni-app'
|
import { onShow} from '@dcloudio/uni-app'
|
||||||
import config from '@/commons/config.js';
|
import config from '@/commons/config.js';
|
||||||
import {selectUserById} from '@/api/user/user.js';
|
import { selectUserById, updateUsers } from '@/api/user/user.js';
|
||||||
|
|
||||||
let data = reactive({
|
let data = reactive({
|
||||||
userInfo: {
|
userInfo: {
|
||||||
@@ -37,7 +37,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// console.log(1)
|
|
||||||
getUserInfo()
|
getUserInfo()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -46,9 +45,7 @@
|
|||||||
*/
|
*/
|
||||||
async function getUserInfo () {
|
async function getUserInfo () {
|
||||||
let res = await selectUserById()
|
let res = await selectUserById()
|
||||||
if ( res.code == 0 ) {
|
data.userInfo = res
|
||||||
data.userInfo = res.data
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,25 +127,25 @@
|
|||||||
title: '温馨提示',
|
title: '温馨提示',
|
||||||
content: '确定保存信息',
|
content: '确定保存信息',
|
||||||
confirmColor: '#ff7581',
|
confirmColor: '#ff7581',
|
||||||
success: e => {
|
success: async e => {
|
||||||
if (e.confirm) {
|
if (e.confirm) {
|
||||||
http.request({
|
let res = await updateUsers({
|
||||||
url:'app/user/updateUsers',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
userName: data.userInfo.userName,
|
userName: data.userInfo.userName,
|
||||||
avatar: data.userInfo.avatar,
|
avatar: data.userInfo.avatar,
|
||||||
phone: data.userInfo.phone,
|
phone: data.userInfo.phone,
|
||||||
}
|
})
|
||||||
}).then(res => {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '保存成功',
|
title: '保存成功',
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
|
let userInfo = uni.getStorageSync('userInfo');
|
||||||
|
userInfo.userName = data.userInfo.userName
|
||||||
|
userInfo.avatar = data.userInfo.avatar
|
||||||
|
userInfo.phone = data.userInfo.phone
|
||||||
|
uni.setStorageSync('userInfo', userInfo);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user