选择吉祥物
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ ENV = 'development'
|
||||
# VITE_APP_BASE_API_Url = 'http://25.18.122.78:9786'
|
||||
|
||||
# DEV
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
# app入口
|
||||
#VITE_APP_BASE_API_Url = 'http://25.16.122.65:7001'
|
||||
|
||||
+39
-29
@@ -24,39 +24,46 @@ export const useAccountLoginApp = (data) => request({
|
||||
}) => {
|
||||
if (rtnCode === '0000') {
|
||||
setToken(body)
|
||||
|
||||
// 获取科技鹿
|
||||
queryCurrentValidMascotInfo().then((res) => {
|
||||
const userInfo = getUserInfo()
|
||||
setUserInfo({
|
||||
...userInfo,
|
||||
'mascotInfo': res
|
||||
})
|
||||
console.log('科技', res);
|
||||
if (res.imgAddr) {
|
||||
setTimeout(() => {
|
||||
const img = new Image(); // 创建Image对象
|
||||
// 图片加载成功(缓存完成)
|
||||
img.onload = () => {
|
||||
console.log(`图片缓存成功: ${url}`);
|
||||
resolve(img); // 返回加载完成的Image对象
|
||||
};
|
||||
// queryCurrentValidMascotInfo().then(({body}) => {
|
||||
// const userInfo = getUserInfo()
|
||||
// setUserInfo({
|
||||
// ...userInfo,
|
||||
// 'mascotInfo': body
|
||||
// })
|
||||
// const userInfo2 = getUserInfo()
|
||||
// console.log('设置科技鹿', userInfo2);
|
||||
// if (body.imgAddr) {
|
||||
// setTimeout(() => {
|
||||
// const img = new Image(); // 创建Image对象
|
||||
// // 图片加载成功(缓存完成)
|
||||
// img.onload = () => {
|
||||
// console.log(`图片缓存成功: ${url}`);
|
||||
// resolve(img); // 返回加载完成的Image对象
|
||||
// };
|
||||
|
||||
// 图片加载失败
|
||||
img.onerror = () => {
|
||||
console.error(`图片缓存失败: ${url}`);
|
||||
reject(new Error(`Failed to load image: ${url}`));
|
||||
};
|
||||
// // 图片加载失败
|
||||
// img.onerror = () => {
|
||||
// console.error(`图片缓存失败: ${url}`);
|
||||
// reject(new Error(`Failed to load image: ${url}`));
|
||||
// };
|
||||
|
||||
// 开始加载图片(设置src触发请求,浏览器会自动缓存)
|
||||
img.src = url;
|
||||
})
|
||||
}
|
||||
// // 开始加载图片(设置src触发请求,浏览器会自动缓存)
|
||||
// img.src = url;
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// const user_data = await queryCurrentUser()
|
||||
const res = await Promise.all([queryCurrentUser(), queryCurrentValidMascotInfo()])
|
||||
const userInfo = getUserInfo()
|
||||
const mascotInfo = res[1]
|
||||
setUserInfo({
|
||||
...userInfo,
|
||||
'mascotInfo': mascotInfo
|
||||
})
|
||||
const user_data = await queryCurrentUser()
|
||||
|
||||
return user_data
|
||||
|
||||
return {
|
||||
mascotState:!mascotInfo.mascotId
|
||||
}
|
||||
}
|
||||
return Promise.reject({
|
||||
rtnCode,
|
||||
@@ -95,6 +102,7 @@ export const queryCurrentUser = (data) => request({
|
||||
method: 'post',
|
||||
data
|
||||
}).then(res => {
|
||||
|
||||
// deptId: ""
|
||||
// deptName: null
|
||||
// loginName: "ADMIN" // todo id
|
||||
@@ -103,7 +111,9 @@ export const queryCurrentUser = (data) => request({
|
||||
// userId: "USER001"
|
||||
// userName: "ADMIN" / todo name
|
||||
// userStatus: "01"
|
||||
|
||||
setUserInfo(res.body)
|
||||
|
||||
console.log('预加载头像');
|
||||
const base_url = get_base_url()
|
||||
// 预加载头像
|
||||
|
||||
+28
-5
@@ -1,6 +1,9 @@
|
||||
import request from '@/api/request'
|
||||
import {
|
||||
get_base_url
|
||||
} from '@/api/request.js'
|
||||
|
||||
const base_url = '/traapp'
|
||||
const app_url = '/traapp'
|
||||
|
||||
|
||||
/**
|
||||
@@ -17,7 +20,7 @@ const base_url = '/traapp'
|
||||
*/
|
||||
export const queryValidTraMascotInfo = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traMascotInfo/queryValidTraMascotInfo',
|
||||
url: app_url + '/traMascotInfo/queryValidTraMascotInfo',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
@@ -31,7 +34,7 @@ export const queryValidTraMascotInfo = (data) => {
|
||||
*/
|
||||
export const setTraMascotInfo = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traMascotInfo/setTraMascotInfo',
|
||||
url: app_url + '/traMascotInfo/setTraMascotInfo',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
@@ -53,9 +56,29 @@ export const setTraMascotInfo = (data) => {
|
||||
*/
|
||||
export const queryCurrentValidMascotInfo = (data) => {
|
||||
return request({
|
||||
url: base_url + '/traMascotInfo/queryCurrentValidMascotInfo',
|
||||
url: app_url + '/traMascotInfo/queryCurrentValidMascotInfo',
|
||||
method: 'post',
|
||||
toastErrors: true,
|
||||
data
|
||||
});
|
||||
}).then(({
|
||||
body
|
||||
}) => {
|
||||
if (body.imgAddr) {
|
||||
// setTimeout(() => {
|
||||
// const base_url = get_base_url()
|
||||
// const url = base_url + body.imgAddr
|
||||
// const img = new Image(); // 创建Image对象
|
||||
// img.onload = () => {
|
||||
// console.log(`图片缓存成功: ${url}`);
|
||||
// };
|
||||
// // 图片加载失败
|
||||
// img.onerror = () => {
|
||||
// console.error(`图片缓存失败: ${url}`);
|
||||
// };
|
||||
// img.src = url; // 开始加载图片(设置src触发请求,浏览器会自动缓存)
|
||||
// })
|
||||
}
|
||||
|
||||
return body
|
||||
})
|
||||
};
|
||||
@@ -15,7 +15,7 @@
|
||||
<view class="ai-info">
|
||||
<!-- <image src="@/static/images/dialog/pet-3.png" alt="" class="image-pet-bg"></image> -->
|
||||
<image src="@/static/images/dialog/pet-bg-base.png" alt="" class="image-pet-bg"></image>
|
||||
<image :src="userInfo.mascotInfo?.imgAddr ||''" alt="" class="image-pet"></image>
|
||||
<image-preview :src="userInfo.mascotInfo?.imgAddr ||''" alt="" class="image-pet"></image-preview>
|
||||
<view class="ai-info-bg-box">
|
||||
<view class="hello-text">Hi,我是{{ userInfo.mascotInfo?.mascotName || ''}}</view>
|
||||
<view class="info-text">工作学习,我都能帮你!</view>
|
||||
@@ -121,7 +121,7 @@
|
||||
const socketStore = useSocketStore()
|
||||
const { SocketObj } = storeToRefs(socketStore)
|
||||
const userInfo = computed(() => getUserInfo())
|
||||
|
||||
console.log('userInfoxxx', getUserInfo());
|
||||
const questionList = ref([
|
||||
'对公小程序开户流程?',
|
||||
'厅堂服务经理2025年管理办法?',
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
|
||||
<view class="item" @click="goto_course_detail(item.crsNum)">
|
||||
<view class="left">
|
||||
<image-preview class="img-box img" :imgId="item.imgThumbId" mode="scaleToFill"></image-preview>
|
||||
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill" :isCache="true" :width="240" :height="240"></image-preview>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="title ellipsis-text">{{item.crsName}}</view>
|
||||
@@ -161,8 +161,8 @@
|
||||
<view class="item_div">
|
||||
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
|
||||
<view class="item" @click="goto_course_detail(item.crsNum)">
|
||||
<view class="left">
|
||||
<image-preview class="img-box img" :imgId="item.imgThumbId" mode="scaleToFill"></image-preview>
|
||||
<view class="left">
|
||||
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill" :isCache="true" :width="240" :height="240"></image-preview>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="title ellipsis-text">{{item.crsName}}</view>
|
||||
@@ -194,7 +194,7 @@
|
||||
<uv-skeleton :loading="!item.crsNum" :rows="3" avatar avatar-shape="square" :title="false">
|
||||
<view class="item" @click="goto_course_detail(item.crsNum)">
|
||||
<view class="left">
|
||||
<image-preview class="img-box img" :imgId="item.imgThumbId" mode="scaleToFill"></image-preview>
|
||||
<image-preview class="img-box img" :imgId="item.imgId" mode="aspectFill" :isCache="true" :width="240" :height="240"></image-preview>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="title ellipsis-text">{{item.crsName}}</view>
|
||||
@@ -311,17 +311,17 @@
|
||||
const stdtTmLen = res.body.stdtTmLen
|
||||
const accmPracticeCnt = res.body.accmPracticeCnt
|
||||
const accmExamCnt = res.body.accmExamCnt
|
||||
if (stdtTmLen != this.stdtTmLen) { // 不相等就执行
|
||||
if (stdtTmLen != this.stdtTmLen) {
|
||||
this.startStdtTmLen = this.stdtTmLen
|
||||
this.stdtTmLen = stdtTmLen
|
||||
stdtTmLenRef.value.start()
|
||||
}
|
||||
if (accmPracticeCnt != this.accmPracticeCnt) { // 不相等就执行
|
||||
if (accmPracticeCnt != this.accmPracticeCnt) {
|
||||
this.startAccmPracticeCnt = this.accmPracticeCnt
|
||||
this.accmPracticeCnt = accmPracticeCnt
|
||||
accmPracticeCntRef.value.start()
|
||||
}
|
||||
if (accmExamCnt != this.accmExamCnt) { // 不相等就执行
|
||||
if (accmExamCnt != this.accmExamCnt) {
|
||||
this.startAccmExamCnt = this.accmExamCnt
|
||||
this.accmExamCnt = accmExamCnt
|
||||
accmExamCntRef.value.start()
|
||||
|
||||
+14
-17
@@ -98,30 +98,27 @@ const login_fun = (): void => {
|
||||
const secretKey = 'EtBzqj+ln5tSTof1SDhpTg==';
|
||||
const cipherText = encryptByAES(password.value, secretKey);
|
||||
useAccountLoginApp({ loginName: account.value, password: cipherText })
|
||||
.then(async () => {
|
||||
.then(async (res) => {
|
||||
common.hideLoading();
|
||||
common.msg('登录成功');
|
||||
// 登陆成功,缓存账号密码
|
||||
common.setValue('loginAccountData', {
|
||||
account: account.value,
|
||||
password: password.value
|
||||
});
|
||||
// setTimeout(() => {
|
||||
// this.$common.reLaunch('/pages/homepage/index');
|
||||
// }, this.GLOBAL_TIMER_SUBMIT_DELAY_TIME);
|
||||
|
||||
// 不再在登录时创建ws链接
|
||||
// socketStore.creatSocket();
|
||||
|
||||
const pages = getCurrentPages();
|
||||
|
||||
if (pages.length >= 2) {
|
||||
// 页面栈只有一页,没有返回页,那就返回首页
|
||||
console.log('返回登录的上一页');
|
||||
back_state.value = false;
|
||||
common.navigateBack(); // 返回登录的上一页
|
||||
console.log('resresres', res);
|
||||
if (res['mascotState']) { // 判断是否跳转到选科技鹿页面
|
||||
common.redirectTo('/pages/mascot/mascot_select_list');
|
||||
} else {
|
||||
common.switchTab('/pages/index/index');
|
||||
common.msg('登录成功');
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length >= 2) {
|
||||
// 页面栈只有一页,没有返回页,那就返回首页
|
||||
console.log('返回登录的上一页');
|
||||
back_state.value = false;
|
||||
common.navigateBack(); // 返回登录的上一页
|
||||
} else {
|
||||
common.switchTab('/pages/index/index');
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((res) => {
|
||||
|
||||
@@ -118,7 +118,13 @@
|
||||
common.hideLoading()
|
||||
common.msg('设置成功')
|
||||
setTimeout(() => {
|
||||
common.navigateBack()
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length >= 2) {
|
||||
// 页面栈只有一页,没有返回页,那就返回首页
|
||||
common.navigateBack(); // 返回登录的上一页
|
||||
} else {
|
||||
common.switchTab('/pages/index/index');
|
||||
}
|
||||
}, 400)
|
||||
}).catch(() => {
|
||||
common.hideLoading()
|
||||
|
||||
+59
-4
@@ -1,13 +1,12 @@
|
||||
<template>
|
||||
<view class="main_div max_page">
|
||||
<nav-bar :is_seat="false"></nav-bar>
|
||||
|
||||
<view class="bg_div">
|
||||
<image src="/static/images/me/bg.png" class="bg_img"></image>
|
||||
<view class="user_data_div">
|
||||
<!-- 用户个人信息 -->
|
||||
<view class="personal_information">
|
||||
<view class="profile">
|
||||
<view class="profile" @click="click_update_avatar()">
|
||||
<!-- <image-preview v-if="user_info.imageAddr" class="img_100" :src="user_info.imageAddr"></image-preview> -->
|
||||
<image v-if="user_info.imagePath" class="img_100" :src="user_info.imagePath"></image>
|
||||
<image-preview v-else-if="user_info.imageAddr" class="img_100"
|
||||
@@ -97,6 +96,8 @@
|
||||
</uv-cell-group>
|
||||
</view>
|
||||
<tabbar-shadow></tabbar-shadow>
|
||||
<avatar-cropper v-if="avatarCropperStatus" mode="ratio" :imageUrl="avatarCropperUrl" :width="500" :height="500"
|
||||
:delay="150" @cancel="onCancel" @confirm="onConfirm"></avatar-cropper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -104,7 +105,8 @@
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
reactive
|
||||
reactive,
|
||||
nextTick
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
@@ -125,8 +127,14 @@
|
||||
import {
|
||||
useSocketStore
|
||||
} from "@/store/socket.js"
|
||||
import {
|
||||
updateDfSysUserExtandInfoImageAddr
|
||||
} from "@/api/user.js"
|
||||
import {
|
||||
uploadFile
|
||||
} from '@/api/common'
|
||||
import { queryCurrentUser} from '@/api/login.js';
|
||||
const socketStore = useSocketStore()
|
||||
|
||||
const accmTaskCntRef = ref(null);
|
||||
const accmPointRef = ref(null);
|
||||
const stdtTmLenRef = ref(null);
|
||||
@@ -231,6 +239,53 @@
|
||||
console.log('下拉刷新');
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
|
||||
// 头像
|
||||
const avatarCropperStatus = ref(true)
|
||||
const avatarCropperUrl = ref('');
|
||||
// 点击修改头像
|
||||
const click_update_avatar = (value) => {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
success: (res) => {
|
||||
avatarCropperUrl.value = res.tempFilePaths[0];
|
||||
avatarCropperStatus.value = true
|
||||
},
|
||||
});
|
||||
};
|
||||
// 选择头像取消
|
||||
const onCancel = (value) => {
|
||||
avatarCropperStatus.value = false
|
||||
}
|
||||
// 选择头像确定
|
||||
const onConfirm = (file) => {
|
||||
avatarCropperStatus.value = false
|
||||
nextTick(async() => {
|
||||
common.loading('更新头像中')
|
||||
try{
|
||||
const data = {
|
||||
bizScen: 'S3007',
|
||||
thumbnailFlag: true,
|
||||
thumbImgSize:100
|
||||
}
|
||||
// 上传图片
|
||||
const res = await uploadFile(file.tempFilePath, data)
|
||||
// 更新个人信息
|
||||
await updateDfSysUserExtandInfoImageAddr({imageAddr : res.thumbFileId})
|
||||
// 更新个人信息
|
||||
const userData = await queryCurrentUser()
|
||||
console.log('userData', );
|
||||
common.msg('修改成功')
|
||||
|
||||
user_info.imageAddr = getUserInfo('imageAddr')
|
||||
user_info.imagePath = getUserInfo('imagePath')
|
||||
} catch {
|
||||
common.msg('修改失败')
|
||||
}
|
||||
common.hideLoading()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -172,8 +172,6 @@
|
||||
common.hideLoading()
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
onLoad((params) => {
|
||||
userInfo.value = getUserInfo()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user