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