更新设置头头像
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<view class="message_div" v-for="(item,index) in message_list">
|
||||
<view class="head_div">
|
||||
<image-preview v-if="item.userIconImgId" class="img-box img"
|
||||
:imgId="item.userIconImgId"></image-preview>
|
||||
:src="item.userIconImgId"></image-preview>
|
||||
<image v-else src="/static/images/me/default_user_avatar.png" class="img"></image>
|
||||
</view>
|
||||
<view class="msg_content">
|
||||
@@ -41,7 +41,7 @@
|
||||
<view class="message_div" v-for="childrenItem in item.children">
|
||||
<view class="head_div">
|
||||
<image-preview v-if="childrenItem.userIconImgId" class="img-box img"
|
||||
:imgId="childrenItem.userIconImgId"></image-preview>
|
||||
:src="childrenItem.userIconImgId"></image-preview>
|
||||
<image v-else src="/static/images/me/default_user_avatar.png" class="img"></image>
|
||||
</view>
|
||||
<view class="msg_content">
|
||||
|
||||
+17
-17
@@ -45,8 +45,7 @@
|
||||
color="rgba(255,255,255,0.7)" :speed="40" direction="column"></uv-notice-bar>
|
||||
</view>
|
||||
<!-- 学习时长和飞天兔子,为了挡住部分兔子只能多一个盒子 -->
|
||||
<view class="study_duration_and_profile_div"
|
||||
@click="common.navigateTo('/pages/courseDetail/index?crsNum=meirenmaixiyinchenque')">
|
||||
<view class="study_duration_and_profile_div">
|
||||
<!-- 飞天兔子 -->
|
||||
<view class="profile_div">
|
||||
<image src="/static/images/index/fttz.png" class="profile"></image>
|
||||
@@ -56,23 +55,24 @@
|
||||
<view class="item">
|
||||
<view class="top">本年学习时长</view>
|
||||
<view class="bottom">
|
||||
<uv-count-to :startVal="statistics_data['startStdtTmLen']" :endVal="statistics_data['stdtTmLen']"
|
||||
:useEasing="true" :decimals="1" ref="stdtTmLenRef"></uv-count-to>h
|
||||
<uv-count-to :startVal="statistics_data['startStdtTmLen']"
|
||||
:endVal="statistics_data['stdtTmLen']" :useEasing="true" :decimals="1"
|
||||
ref="stdtTmLenRef"></uv-count-to>h
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="top">累计训练次数</view>
|
||||
<view class="bottom">
|
||||
<uv-count-to :startVal="statistics_data['startAccmExamCnt']"
|
||||
:endVal="statistics_data['accmExamCnt']" :useEasing="true" ref="accmExamCntRef"></uv-count-to><span
|
||||
class="number">次</span>
|
||||
:endVal="statistics_data['accmExamCnt']" :useEasing="true"
|
||||
ref="accmExamCntRef"></uv-count-to><span class="number">次</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="top">累计考试次数</view>
|
||||
<view class="bottom"><uv-count-to :startVal="statistics_data['starAccmPracticeCnt']"
|
||||
:endVal="statistics_data['accmPracticeCnt']" :useEasing="true" ref="accmPracticeCntRef"></uv-count-to><span
|
||||
class="number">次</span>
|
||||
:endVal="statistics_data['accmPracticeCnt']" :useEasing="true"
|
||||
ref="accmPracticeCntRef"></uv-count-to><span class="number">次</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -252,8 +252,8 @@
|
||||
const stdtTmLenRef = ref(null);
|
||||
const accmPracticeCntRef = ref(null);
|
||||
const accmExamCntRef = ref(null);
|
||||
const three_list_request_time = ref(0); // 三个列表更新时间
|
||||
|
||||
const three_list_request_time = ref(0); // 三个列表更新时间
|
||||
|
||||
// 计算透明度
|
||||
const opacity = computed(() => {
|
||||
if (scrollTop.value <= 130) return 0;
|
||||
@@ -285,7 +285,7 @@
|
||||
const hot_class_list = ref([...init_class_data])
|
||||
const new_class_list = ref([...init_class_data])
|
||||
const recommend_class_list = ref([...init_class_data])
|
||||
|
||||
|
||||
const statistics_data = reactive({
|
||||
'stdtTmLen': 0, // 学习
|
||||
'accmPracticeCnt': 0, // 训练
|
||||
@@ -328,7 +328,7 @@
|
||||
this.accmExamCnt = accmExamCnt
|
||||
accmExamCntRef.value.start()
|
||||
}
|
||||
|
||||
|
||||
console.log('统计数据已更新');
|
||||
} else {
|
||||
console.log('时间没到无需更新');
|
||||
@@ -349,12 +349,12 @@
|
||||
}
|
||||
onShow(() => {
|
||||
console.log('onShow');
|
||||
if(!common.isLogin()){
|
||||
if (!common.isLogin()) {
|
||||
common.navigateTo('/pages/login/login')
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
statistics_data['get_statistics_data']() // 获取统计数据
|
||||
if(!common.isLogin()) return;
|
||||
if (!common.isLogin()) return;
|
||||
queryCrsInfoByLastnew().then(res => {
|
||||
new_class_list.value = res.body
|
||||
})
|
||||
@@ -366,7 +366,7 @@
|
||||
})
|
||||
})
|
||||
onLoad(async () => {
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -49,14 +49,11 @@
|
||||
</uv-checkbox-group>
|
||||
<view class="ysxy_tip font_pf">
|
||||
已阅读并同意
|
||||
<!-- #ifdef APP -->
|
||||
<span class="ysxy_term" @click="common.navigateTo('/pages/login/ysxy')">《服务条款》</span>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef APP -->
|
||||
<span class="ysxy_term" @click="common.navigateTo('/pages/login/ysxy')">《服务条款》</span>
|
||||
<!-- #endif -->
|
||||
|
||||
<span class="ysxy_term" @click="common.navigateTo('/pages/login/ysxy?page=1')">《服务条款》</span>
|
||||
|
||||
与
|
||||
<span class="ysxy_term">《隐私权政策》</span>
|
||||
<span class="ysxy_term" @click="common.navigateTo('/pages/login/ysxy?page=2')">《隐私权政策》</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -6,24 +6,37 @@
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
onMounted
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import common from '@/common/common'
|
||||
import {
|
||||
getYsxy
|
||||
} from '@/api/login.js'
|
||||
const ysxi_text = ref('')
|
||||
onMounted(() => {
|
||||
onLoad((e) => {
|
||||
common.loading()
|
||||
getYsxy().then(res => {
|
||||
ysxi_text.value = res.body.agtContt
|
||||
if (e.page == 1) {
|
||||
ysxi_text.value = "服务条款"
|
||||
common.hideLoading()
|
||||
});
|
||||
|
||||
} else {
|
||||
getYsxy().then(res => {
|
||||
ysxi_text.value = res.body.agtContt
|
||||
common.hideLoading()
|
||||
});
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main_div {
|
||||
margin-top: 20%;
|
||||
margin: 20% auto 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: 600;
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -179,6 +179,7 @@ const user_info = reactive({
|
||||
onShow(() => {
|
||||
const user_info_cache = getUserInfo();
|
||||
Object.assign(user_info, user_info_cache);
|
||||
console.log('user_info', user_info);
|
||||
statistics_data['get_statistics_data'](); // 获取统计数据
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
</template>
|
||||
<template #value>
|
||||
<view style="width: 42rpx; height: 42rpx;border-radius: 100%; overflow: hidden">
|
||||
<image-preview style="width: 100%" v-if="userInfo.imageAddr" :src="userInfo.imageAddr"></image-preview>
|
||||
<image v-if="userInfo.imagePath" class="img_100" :src="userInfo.imagePath"></image>
|
||||
<image-preview v-else class="img_100" :src="userInfo.imageAddr"></image-preview>
|
||||
</view>
|
||||
</template>
|
||||
</uv-cell>
|
||||
@@ -40,7 +41,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<<<<<<< HEAD
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
@@ -69,6 +69,7 @@
|
||||
const aaa = ref('');
|
||||
const userInfo = ref({
|
||||
gender: '',
|
||||
imagePath: '',
|
||||
imageAddr: ''
|
||||
});
|
||||
const avatarCropperStatus = ref(true)
|
||||
@@ -85,11 +86,9 @@
|
||||
avatarCropperStatus.value = false
|
||||
}
|
||||
const onConfirm = (file) => {
|
||||
|
||||
avatarCropperStatus.value = false
|
||||
nextTick(async() => {
|
||||
common.loading('更新头像中')
|
||||
|
||||
try{
|
||||
const data = {
|
||||
bizScen: 'S3010',
|
||||
@@ -103,21 +102,20 @@
|
||||
// 更新个人信息
|
||||
const userData = await queryCurrentUser()
|
||||
common.msg('修改成功')
|
||||
console.log(userData);
|
||||
userInfo.value.imageAddr = getUserInfo('imageAddr')
|
||||
userInfo.value.imagePath = getUserInfo('imagePath')
|
||||
} catch {
|
||||
common.msg('修改失败')
|
||||
}
|
||||
common.hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const cellCLick = (value) => {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
success: (res) => {
|
||||
|
||||
avatarCropperUrl.value = res.tempFilePaths[0];
|
||||
avatarCropperStatus.value = true
|
||||
},
|
||||
@@ -128,7 +126,8 @@
|
||||
common.loading("修改中")
|
||||
updateDfSysUserExtandInfoGender({
|
||||
gender: userInfo.value.gender
|
||||
}).then(res => {
|
||||
}).then(async() => {
|
||||
await queryCurrentUser()
|
||||
common.msg('修改成功')
|
||||
}).finally(() => {
|
||||
common.hideLoading()
|
||||
@@ -137,33 +136,7 @@
|
||||
|
||||
onLoad((params) => {
|
||||
userInfo.value = getUserInfo()
|
||||
console.log(userInfo.value);
|
||||
});
|
||||
=======
|
||||
import { reactive, ref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import common from '@/common/common';
|
||||
const index = ref(0);
|
||||
const form = ref({
|
||||
gender: 'Y'
|
||||
});
|
||||
const sexOptions = [
|
||||
{ value: 'Y', label: '男' },
|
||||
{ value: 'M', label: '女' }
|
||||
];
|
||||
const cellCLick = (value) => {
|
||||
sexOptions.length = 0;
|
||||
console.log(sexOptions,'sisisis');
|
||||
};
|
||||
const sexChange = (e) => {
|
||||
console.log(e);
|
||||
console.log(sexOptions[e.detail.value].value, 'sexOptions[e.detail.value].value');
|
||||
form.value.gender = sexOptions[e.detail.value].value;
|
||||
|
||||
console.log(form.value.gender, 'iiii');
|
||||
};
|
||||
onLoad((params) => {});
|
||||
>>>>>>> cea58939be69e08335a0aaf3f8fef73c5fdb914a
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user