Merge branch 'develop' into 'sit'

Develop

See merge request K17_AITS/tra-app!53
This commit is contained in:
李泉德
2025-07-22 10:55:38 +08:00
12 changed files with 135 additions and 99 deletions
+2 -2
View File
@@ -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'
@@ -17,4 +17,4 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
#VITE_APP_BASE_API_Url = 'http://25.18.122.66:9786'
# h5专用地址
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001'
-1
View File
@@ -7,7 +7,6 @@ export default {
animationType: 'slide-in-bottom'
});
})
console.log('App Launch')
},
onShow: function () {
// console.log('App Show')
+24 -24
View File
@@ -133,31 +133,31 @@ export const queryCurrentUser = (data) => request({
// 生成唯一文件名,避免冲突
const filename = pathName.split('/').pop()
const localFilePath = '_downloads/' + filename
console.log('localFilePath', localFilePath, url);
// 先检查是否存在
// uni.getFileInfo({
// filePath: localFilePath,
// success: () => {
// console.log('头像已存在,无需下载');
// updateUserAvatar(localFilePath)
// },
// fail: () => {
// console.log('开始下载头像:', url);
// const dtask = plus.downloader.createDownload(
// url, {
// method: 'GET',
// filename: '_downloads/' + filename
// },
// (download, status) => {
// if (status === 200) {
// console.log('头像下载成功:', download.filename);
// updateUserAvatar(download.filename)
// }
// }
// )
// dtask.start();
// }
// })
uni.getFileInfo({
filePath: localFilePath,
success: () => {
console.log('头像已存在,无需下载');
updateUserAvatar(localFilePath)
},
fail: () => {
console.log('开始下载头像:', url);
const dtask = plus.downloader.createDownload(
url, {
method: 'GET',
filename: '_downloads/' + filename
},
(download, status) => {
if (status === 200) {
console.log('头像下载成功:', download.filename);
updateUserAvatar(download.filename)
}
}
)
dtask.start();
}
})
} catch (error) {
+15 -15
View File
@@ -4,46 +4,46 @@ export default function showDialog(options) {
left: '0',
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0.5)',
backgroundColor: 'rgba(0,0,0,0.1)',
position: 'fixed'
});
const screenWidth = plus.screen.resolutionWidth;
const screenHeight = plus.screen.resolutionHeight;
const borderRadius = 10;
const contentPadding = 20; // 内容左右内边距
const lineHeight = 24; // 单行文本行高
const contentPadding = 12; // 内容左右内边距
const lineHeight = 17; // 单行文本行高
const maxLines = 2; // 最大行数
const fontSize = 16; // 字体大小
const fontSize = 14; // 字体大小
// 判断内容和标题是否存在
const hasContent = options.content && options.content.trim() !== '';
const hasTitle = options.title && options.title.trim() !== '';
// 弹窗宽度计算
const modalWidth = Math.min(0.8 * screenWidth, 500);
const modalWidth = Math.min(0.65 * screenWidth, 500);
const modalLeft = (screenWidth - modalWidth) / 2;
// 内容区域可用宽度
const contentAvailableWidth = modalWidth - 2 * contentPadding - 10;
// 动态计算各部分高度
const titleHeight = hasTitle ? 30 : 0;
const titleHeight = hasTitle ? 20 : 0;
const titleToContentSpacing = (hasTitle && hasContent) ? 10 : 0;
const contentHeight = hasContent ? (lineHeight * maxLines) : 0;
const contentToBtnSpacing = 10;
const btnHeight = 50;
const btnHeight = 46;
// 弹窗总高度
let modalHeight = contentPadding + titleHeight + titleToContentSpacing + contentHeight + contentToBtnSpacing + btnHeight;
let modalHeight = contentPadding + 6 + titleHeight + titleToContentSpacing + contentHeight + contentToBtnSpacing + btnHeight;
modalHeight = options.showCancel ? Math.min(modalHeight, 300) : Math.min(modalHeight, 250);
// 位置计算
const modalTop = (screenHeight - modalHeight) / 2;
const contentAreaTop = modalTop + contentPadding;
const contentAreaTop = modalTop + contentPadding + 6;
const titleTop = hasTitle ? contentAreaTop : 0;
// Fix: Calculate contentTop properly when there's no content
let contentTop;
if (hasContent) {
contentTop = hasTitle ? (titleTop + titleHeight + titleToContentSpacing) : contentAreaTop;
@@ -77,7 +77,7 @@ export default function showDialog(options) {
position: { top: titleTop + 'px', left: modalLeft + 'px', width: modalWidth + 'px', height: titleHeight + 'px' },
textStyles: {
color: '#000',
size: '20px',
size: '18px',
align: 'center',
fontWeight: 'bold',
verticalAlign: 'middle'
@@ -146,7 +146,7 @@ export default function showDialog(options) {
height: lineHeightPx + 'px'
},
textStyles: {
color: '#666',
color: '#111',
size: fontSizePx + 'px',
align: 'center',
verticalAlign: 'top',
@@ -165,19 +165,19 @@ export default function showDialog(options) {
elements.push({
tag: 'rect',
id: 'divider',
position: { top: btnTop + 'px', left: modalLeft + 'px', width: modalWidth + 'px', height: '1px' },
position: { top: btnTop + 'px', left: modalLeft + 'px', width: modalWidth + 'px', height: '0.5px' },
rectStyles: { color: '#b3b3b3' }
});
view.draw(elements);
// 绘制按钮(不变)
if (options.showCancel) {
const btnWidth = Math.floor((modalWidth - 2 * borderRadius) / 2);
view.draw([
{ tag: 'rect', id: 'cancelBtn', position: { top: (btnTop + 2) + 'px', left: (modalLeft + borderRadius) + 'px', width: btnWidth + 'px', height: (btnHeight - 3) + 'px' }, rectStyles: { color: '#fff' } },
{ tag: 'font', id: 'cancelText', text: options.cancelText || '取消', position: { top: btnTop + 'px', left: (modalLeft + borderRadius) + 'px', width: btnWidth + 'px', height: btnHeight + 'px' }, textStyles: { color: '#007AFF', size: '16px', align: 'center', verticalAlign: 'middle' } },
{ tag: 'rect', id: 'btnDivider', position: { top: btnTop + 'px', left: (modalLeft + borderRadius + btnWidth) + 'px', width: '1px', height: btnHeight + 'px' }, rectStyles: { color: '#b3b3b3' } },
{ tag: 'rect', id: 'btnDivider', position: { top: btnTop + 'px', left: (modalLeft + borderRadius + btnWidth) + 'px', width: '0.5px', height: btnHeight + 'px' }, rectStyles: { color: '#b3b3b3' } },
{ tag: 'rect', id: 'confirmBtn', position: { top: (btnTop + 2) + 'px', left: (modalLeft + borderRadius + btnWidth + 1) + 'px', width: btnWidth + 'px', height: (btnHeight - 3) + 'px' }, rectStyles: { color: '#fff' } },
{ tag: 'font', id: 'confirmText', text: options.confirmText || '确定', position: { top: btnTop + 'px', left: (modalLeft + borderRadius + btnWidth + 1) + 'px', width: btnWidth + 'px', height: btnHeight + 'px' }, textStyles: { color: '#007AFF', size: '16px', align: 'center', verticalAlign: 'middle' } }
]);
+22 -15
View File
@@ -2,22 +2,29 @@
import {getUserInfo} from "@/common/common.js"
import common from "@/common/common.js"
export const setMascot = () => {
const mascotState = common.getValue('mascotState') || false
console.log('设置科技鹿', mascotState);
// const mascotState = common.getValue('mascotState') || false
const mascotState = false
// console.log('设置科技鹿', mascotState);
if (!mascotState) {
const userInfo = getUserInfo()
const mascotInfo = userInfo['mascotInfo']
uni.setTabBarStyle({
midButton: {
iconPath: "/static/images/icon/fawn-" + (mascotInfo?.mascotNo || '1') + ".png",
width: "86px",
height: "86px",
iconWidth: "90px"
},
success: () => {
common.setValue('mascotState', true)
}
})
try{
const userInfo = getUserInfo()
const mascotInfo = userInfo?.mascotInfo
console.log('设置科技鹿', mascotInfo);
uni.setTabBarStyle({
midButton: {
iconPath: "/static/images/icon/fawn-" + (mascotInfo?.mascotNo || '1') + ".png",
width: "86px",
height: "86px",
iconWidth: "90px"
},
success: () => {
common.setValue('mascotState', true)
}
})
} catch(e){
}
}
return mascotState
}
+6 -6
View File
@@ -281,12 +281,12 @@ import { onShow } from "@dcloudio/uni-app"
getCourseTypeListApi().then(res=>{
courseTypeList.value = res.body||[]
})
// getPrdLineTypeListApi().then(res=>{
// coursePrdlineList.value = res.body||[]
// })
// getTraTagListApi().then(res=>{
// tagsTree.value = res.body||[]
// })
getPrdLineTypeListApi().then(res=>{
coursePrdlineList.value = res.body||[]
})
getTraTagListApi().then(res=>{
tagsTree.value = res.body||[]
})
changeTab({name:'全部'})
})
onActivated(() => {
+1
View File
@@ -194,6 +194,7 @@
top: 256rpx;
border-radius: 23rpx 23rpx 0rpx 0rpx;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
+5 -1
View File
@@ -378,7 +378,11 @@
}
onShow(() => {
setMascot()
mascotInfo.value = getUserInfo('mascotInfo')
const userInfo = getUserInfo()
if(userInfo) {
mascotInfo.value = userInfo?.mascotInfo
console.log('是', mascotInfo.value);
}
if (!common.isLogin()) {
common.navigateTo('/pages/login/login')
return
+1 -1
View File
@@ -105,7 +105,7 @@ const login_fun = (): void => {
account: account.value,
password: password.value
});
// res['mascotState']
if (res['mascotState']) { // 判断是否跳转到选科技鹿页面
common.redirectTo('/pages/mascot/mascot_select_list');
} else {
+13 -8
View File
@@ -75,14 +75,16 @@
getUserInfo
} from "@/common/common";
import {
onLoad
onLoad,
onBackPress
} from '@dcloudio/uni-app';
const back_state = ref(true);
const mascotList = reactive([])
const windowsInfo = uni.getWindowInfo()
const nowWidth = ref(0);
const pages = getCurrentPages();
const swiperCount = 4; // 总轮播项数量
let swiperIndex = ref(0); // 当前显示第1个(索引0
const isAnimating = ref(false); // 标记动画是否进行中
@@ -114,12 +116,13 @@
common.msg('设置成功')
common.setValue('mascotState', false)
setTimeout(() => {
const pages = getCurrentPages();
if (pages.length >= 2) {
// 页面栈只有一页,没有返回页,那就返回首页
back_state.value = false;
common.navigateBack(); // 返回登录的上一页
} else {
common.switchTab('/pages/index/index');
common.reLaunch('/pages/index/dialog',{ animationType: 'slide-in-bottom'});
}
}, 400)
}).catch(() => {
@@ -139,12 +142,14 @@
})
})
onMounted(() => {
back_state.value = pages.length <= 2;
})
onUnmounted(() => {
})
console.log('pages', pages.length);
onBackPress(() => back_state.value);
</script>
<style scoped lang="scss">
@@ -170,7 +175,7 @@
}
text-shadow:0 0 30rpx #dedede;
text-shadow:0 0 20rpx #ceceea;
}
.mascot_div {
@@ -242,7 +247,7 @@
width: 80%;
height: 120rpx;
position: relative;
.img {
position: absolute;
width: 100%;
+5 -9
View File
@@ -8,10 +8,9 @@
<view class="personal_information">
<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"
:src="user_info.imageAddr"></image-preview>
<image v-else class="img_100" src="/static/images/me/default_user_avatar.png"></image>
<image class="img_100" :src="user_info.imagePath"></image>
<!-- <image-preview v-else-if="user_info.imageAddr" class="img_100" :src="user_info.imageAddr"></image-preview>
<image v-else class="img_100" src="/static/images/me/default_user_avatar.png"></image> -->
</view>
<view class="personal_information_data">
<view class="name_sex_div">
@@ -185,12 +184,9 @@
this.stdtTmLen = stdtTmLen;
stdtTmLenRef.value.start();
}
console.log('统计数据已更新');
} else {
console.log('时间没到无需更新');
}
}
} catch (error) {
console.error('获取统计数据失败:', error);
// console.error('获取统计数据失败:', error);
}
}
});
+41 -17
View File
@@ -32,24 +32,23 @@
import showDialog from '@/common/dialogMessage'
const bbbb = () => {
showDialog({
title: '提示信息',
content: '检测到您已离开,即将退出学习页面。',
confirmText: '确认',
showCancel: false,
cancelText: '再想想',
success: (res) => {
if (res.confirm) {
console.log('用户点击确定');
}
},
cancel: () => {
console.log('用户点击取消');
}
// showDialog({
// title: '提示信息',
// content: '检测到您已离开,即将退出学习页面。',
// confirmText: '确认',
// showCancel: false,
// cancelText: '再想想',
// success: (res) => {
// if (res.confirm) {
// console.log('用户点击确定');
// }
// },
// cancel: () => {
// console.log('用户点击取消');
// }
});
}
const aaaa = () => {
// });
showDialog({
title: '提示',
content: '检测到您已存在学习记录,要继续学习吗?',
@@ -66,6 +65,31 @@
}
});
}
const aaaa = () => {
common.show('提示','检测到您已存在学习记录,要继续学习吗?','继续学习', '重新学习').then(res => {
})
// function show(title, msg, showCancel = true, cancelText = '取消', confirmText = '确定') {
// showDialog({
// title: '提示',
// content: '检测到您已存在学习记录,要继续学习吗?',
// confirmText: '重新学习',
// showCancel: true,
// cancelText: '继续学习',
// success: (res) => {
// if (res.confirm) {
// console.log('用户点击确定');
// }
// },
// cancel: () => {
// console.log('用户点击取消');
// }
// });
}
</script>
<style lang="scss" scoped>