diff --git a/.env.development.yh b/.env.development.yh index 18b7163e..3f9502f8 100644 --- a/.env.development.yh +++ b/.env.development.yh @@ -7,5 +7,5 @@ VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' # VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786' # VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.32.154:9604' # VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.156:9603' -VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.32.154:9601' +# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.32.154:9601' diff --git a/src/common/common.js b/src/common/common.js index 5915351e..3c6e12f2 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -1,4 +1,6 @@ -import { get_base_url } from '@/api/request'; +import { + get_base_url +} from '@/api/request'; // #ifdef APP-PLUS import showDialog from '@/common/dialogMessage' import common from '@/common/common' @@ -235,7 +237,7 @@ function setValue(key, value) { uni.setStorageSync(key, value); } -function getValue(key, defaultValue=null) { +function getValue(key, defaultValue = null) { return uni.getStorageSync(key) ?? defaultValue } @@ -278,65 +280,69 @@ export function setupKeyboardHeightListener(updateCallback) { } - - export const previewFileFnc = ({fileId, getFileSrc, fileName}) => { - let userInfo = getUserInfo() - let userParams = '/' + (userInfo?.loginName??'') - if (getPhoneEnvBool('AND')) { - navigateTo('/pages/index/preview?fileId=' + fileId +'&fileApiSrc=' + getFileSrc); - } else { - if (isDownloading.value) return - const base_url = get_base_url(getFileSrc); - let fileUrl = base_url + getFileSrc + fileId + userParams; - const localFilePath = '_doc/pdf_view/' + fileName + '.pdf'; - isDownloading.value = true - downloadFileFnc(fileUrl, localFilePath).then((res) => { - uni.openDocument({ - filePath: res, - showMenu: true, - success: function() { - console.log('打开文档成功'); - } - }) - }).finally(() => { - setTimeout(() => { - isDownloading.value = false - }, 1000) - }); - } +let isDownloading = false +export const previewFileFnc = ({ + fileId, + getFileSrc, + fileName +}) => { + let userInfo = getUserInfo() + let userParams = '/' + (userInfo?.loginName ?? '') + if (getPhoneEnvBool('AND')) { + navigateTo('/pages/index/preview?fileId=' + fileId + '&fileApiSrc=' + getFileSrc); + } else { + if (isDownloading) return + const base_url = get_base_url(getFileSrc); + let fileUrl = base_url + getFileSrc + fileId + userParams; + const localFilePath = '_doc/pdf_view/' + fileName + '.pdf'; + isDownloading = true + downloadFileFnc(fileUrl, localFilePath).then((res) => { + uni.openDocument({ + filePath: res, + showMenu: true, + success: function() { + console.log('打开文档成功'); + } + }) + }).finally(() => { + setTimeout(() => { + isDownloading = false + }, 1000) + }); } - const downloadFileFnc = async (fileUrl, localFilePath) => { - try { - //#ifdef APP-PLUS - return new Promise((resolve, reject) => { - console.log('开始下载:', fileUrl); - const dtask = plus.downloader.createDownload( - fileUrl, { - filename: localFilePath - }, - (d, status) => { - if (status === 200) { - console.log('保存路径:', d.filename); - resolve(d.filename); - } else { - console.error('文件下载失败:', status); - reject(new Error(`下载失败,状态码: ${status}`)); - } +} +const downloadFileFnc = async (fileUrl, localFilePath) => { + try { + //#ifdef APP-PLUS + return new Promise((resolve, reject) => { + console.log('开始下载:', fileUrl); + const dtask = plus.downloader.createDownload( + fileUrl, { + filename: localFilePath + }, + (d, status) => { + if (status === 200) { + console.log('保存路径:', d.filename); + resolve(d.filename); + } else { + console.error('文件下载失败:', status); + reject(new Error(`下载失败,状态码: ${status}`)); } - ); - dtask.start(); - }); - // #endif - //#ifdef H5 - return new Promise((resolve, reject) => { - resolve(); - }); - // #endif - } catch (error) { - console.error('创建目录失败:', error); - throw error; - } - }; + } + ); + dtask.start(); + }); + // #endif + //#ifdef H5 + return new Promise((resolve, reject) => { + resolve(); + }); + // #endif + } catch (error) { + console.error('创建目录失败:', error); + throw error; + } +}; export default { diff --git a/src/pages.json b/src/pages.json index 9487bedc..2b1a0443 100644 --- a/src/pages.json +++ b/src/pages.json @@ -533,7 +533,7 @@ }, { "text": "场景", - "pagePath": "pages/scene/index" + "pagePath": "pages/sparring/index" }, { "text": "我的", diff --git a/src/pages/charts/index.vue b/src/pages/charts/index.vue index 64fd530b..f5ef6346 100644 --- a/src/pages/charts/index.vue +++ b/src/pages/charts/index.vue @@ -1,172 +1,72 @@ - - + \ No newline at end of file diff --git a/src/pages/charts/index_old.vue b/src/pages/charts/index_old.vue new file mode 100644 index 00000000..64fd530b --- /dev/null +++ b/src/pages/charts/index_old.vue @@ -0,0 +1,845 @@ + + + + + diff --git a/src/pages/index/dialog.vue b/src/pages/index/dialog.vue index e492a5e7..1f129a9d 100644 --- a/src/pages/index/dialog.vue +++ b/src/pages/index/dialog.vue @@ -639,7 +639,7 @@ common.switchTab('/pages/course/index'); break; case 'AI练': - common.navigateTo('/pages/sparring/index'); + common.switchTab('/pages/sparring/index'); break; case 'AI考': common.navigateTo('/pages/testingHall/index'); diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index eef8800d..31aae318 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -94,7 +94,7 @@ AI问答 - + AI陪练 diff --git a/src/pages/sparring/components/card-swiper.vue b/src/pages/sparring/components/card-swiper.vue index adda52de..2d92398e 100644 --- a/src/pages/sparring/components/card-swiper.vue +++ b/src/pages/sparring/components/card-swiper.vue @@ -14,36 +14,38 @@ {{ item.chaAge }}岁 - + - - - - 身份情况 + + + + + 职业身份 + + {{ item.occupation }} - {{ item.occupation }} - - - - - 性格特点 + + + + 性格倾向 + + {{ item.personality }} - {{ item.personality }} - - - - - 提问思路 + + + + 沟通风格 + + {{ item.thoughtProcess }} - {{ item.thoughtProcess }} - - - - - 人物描述 + + + + 人物描述 + + {{ item.chaDesc }} - {{ item.chaDesc }} @@ -177,16 +179,18 @@ width: 590rpx; height: 100%; border-radius: 24rpx; - background: #e5eafd; + // background: #e5eafd; + background: linear-gradient(234deg, #e2e8fd 0%, #EAECFC 33%, #d9eafd 100%); overflow-x: hidden; overflow-Y: auto; transition: all 0.3s ease; position: relative; - padding: 50rpx 23rpx 23rpx; + padding: 50rpx 0rpx 23rpx; + .card-content { - padding: 24rpx; + padding: 24rpx 0; } - + .card-title { display: flex; font-size: 29rpx; @@ -199,44 +203,53 @@ text-align: center; margin: 33rpx auto; justify-content: center; - - &-name{ - margin-right: 20rpx; - line-height: 44rpx; - } - &-age{ + + &-name { margin-right: 20rpx; line-height: 44rpx; } - &-img{ + + &-age { + margin-right: 20rpx; + line-height: 44rpx; + } + + &-img { height: 44rpx; width: 30rpx; padding: 5rpx 0; box-sizing: border-box; } - &-icon{ + + &-icon { height: 30rpx; width: 30rpx; } } - + .card-items{ + padding: 0 24rpx; + height: calc(100% - 412rpx); + overflow-y: auto; + } .card-item { width: 100%; display: block; background: linear-gradient(209deg, #fefeff 0%, #ddeafc 100%); - border: 2rpx solid rgba(255, 255, 255, .65); + border: 2rpx solid rgba(255, 255, 255, .65); margin-bottom: 15rpx; border-radius: 15rpx; box-sizing: border-box; padding: 23rpx; font-size: 28rpx; line-height: 40rpx; - &-title{ + + &-title { color: #06f; padding-left: 38rpx; position: relative; margin-bottom: 8rpx; - &-icon{ + + &-icon { width: 30rpx; height: 30rpx; position: absolute; @@ -245,11 +258,10 @@ transform: translateY(-50%); } } - &-desc{ - - } + + &-desc {} } - + } .card:not(.active) { @@ -263,5 +275,4 @@ overflow: hidden; margin: 0 auto; } - \ No newline at end of file diff --git a/src/pages/sparring/components/question.vue b/src/pages/sparring/components/question.vue index ac76bc43..a5e2f35c 100644 --- a/src/pages/sparring/components/question.vue +++ b/src/pages/sparring/components/question.vue @@ -109,7 +109,7 @@ import { onUnload } from '@dcloudio/uni-app'; talkVoiceObj.value.onPlay(()=>{ if(isTesting.value){ talkVoiceObj.value.pause() - isTesting.value = false + isTesting.value = false } }) talkVoiceObj.value.onEnded(()=>{ @@ -121,8 +121,8 @@ import { onUnload } from '@dcloudio/uni-app'; }) itemVoice.value = unref(dataInfo).talkingVoice talkVoiceObj.value.src = itemVoice.value - talkVoiceObj.value.play() isTesting.value = true + talkVoiceObj.value.play() talkVoiceObj.value.pause() setTimeout(()=>{ setVoiceTime(0) diff --git a/src/pages/sparring/components/sparring-item.vue b/src/pages/sparring/components/sparring-item.vue index 66495125..d6dcd0c3 100644 --- a/src/pages/sparring/components/sparring-item.vue +++ b/src/pages/sparring/components/sparring-item.vue @@ -20,7 +20,7 @@ - 截至时间:{{itemInfo.endTm}} + 截至时间:{{itemInfo.limitTyp === '01'?'不限制':itemInfo.endTm}} 陪练次数:{{itemInfo.practiceTimes }}人次 diff --git a/src/pages/sparring/components/talking-item.vue b/src/pages/sparring/components/talking-item.vue index 06426b37..c2b36f0e 100644 --- a/src/pages/sparring/components/talking-item.vue +++ b/src/pages/sparring/components/talking-item.vue @@ -106,7 +106,8 @@ partnerChatPrompt({ execId: props.execId, traId: props.traId, - content: props.talkingInfo.talkingText + content: props.talkingInfo.talkingText, + chaId: roleInfo.value?.chaId }).then(res=>{ tipsContent.value = res.body loadingTips.value = false diff --git a/src/pages/sparring/detail.vue b/src/pages/sparring/detail.vue index c3c3fed6..8615e666 100644 --- a/src/pages/sparring/detail.vue +++ b/src/pages/sparring/detail.vue @@ -161,7 +161,7 @@ height: 436rpx; clip-path: ellipse(650rpx 327rpx at 375rpx 109rpx); width: 100%; - position: absolute; + position: fixed; top: var(--status-bar-height); left: 0; z-index: 2; diff --git a/src/pagesOther.json b/src/pagesOther.json index e8cf31c7..3b5f6d23 100644 --- a/src/pagesOther.json +++ b/src/pagesOther.json @@ -76,7 +76,7 @@ }, { "text": "场景", - "pagePath": "pages/scene/index" + "pagePath": "pages/sparring/index" }, { "text": "我的", diff --git a/src/static/images/charts/bg-top.png b/src/static/images/charts/bg-top.png new file mode 100644 index 00000000..0d96a40c Binary files /dev/null and b/src/static/images/charts/bg-top.png differ