吉祥物缓存,替换安卓弹窗
@@ -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'
|
||||
@@ -18,4 +18,4 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
# h5专用地址
|
||||
|
||||
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.66:9786'
|
||||
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
ENV = 'uat'
|
||||
|
||||
# base api
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7003'
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7003'
|
||||
@@ -1 +1 @@
|
||||
.uv-overlay[data-v-c913fd43]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7)}.overlay-box[data-v-de693c21]{position:relative;height:100%}.overlay-box .detail-img[data-v-de693c21]{position:absolute;left:50%;top:50%;width:100vw;max-height:100%;transform:translate(-50%,-50%)}.title_div[data-v-751a74a5]{width:60vw;text-shadow:.3125rem 0 .9375rem #3c3c3c}.title_div .img[data-v-751a74a5]{width:100%}.tip_div[data-v-751a74a5]{text-shadow:0 0 .625rem #ceceea}.tip_div .tip_msg[data-v-751a74a5]{font-family:PingFangSC;font-weight:400;font-size:.9375rem;color:#fff;line-height:1.25rem;text-align:center;font-style:normal}.mascot_div[data-v-751a74a5]{width:100%;height:100%;display:flex;align-items:center;position:relative}.mascot_div .swiper[data-v-751a74a5]{white-space:nowrap;height:120vw;flex:1}.mascot_div .swiper-item-div[data-v-751a74a5]{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;height:120vw}.mascot_div .swiper-item-div .img[data-v-751a74a5]{width:80vw;height:100%}.mascot_div .doct_icon[data-v-751a74a5]{padding:0%;position:absolute;width:3.125rem;display:flex;align-items:center;flex-direction:column}.mascot_div .doct_icon .doct_icon_div[data-v-751a74a5]{width:100%;display:flex;align-items:center;justify-content:center;padding:1.25rem 0}.mascot_div .doct_icon.left[data-v-751a74a5]{top:40%;left:2%;z-index:10}.mascot_div .doct_icon.right[data-v-751a74a5]{top:40%;right:2%}.mascot_div .doct_icon .img[data-v-751a74a5]{width:40%}.button_div[data-v-751a74a5]{margin-top:.625rem;width:80%;height:3.75rem;position:relative}.button_div .img[data-v-751a74a5]{position:absolute;width:100%;height:100%}.bg_img[data-v-751a74a5]{position:absolute;top:-2%;left:-1%;width:102%;height:104%;z-index:-1}.bg_img .img[data-v-751a74a5]{width:100%;height:100%}.main_div[data-v-751a74a5]{display:flex;flex-direction:column;position:relative;max-width:100vh;align-items:center;overflow:hidden}
|
||||
.uv-overlay[data-v-c913fd43]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7)}.overlay-box[data-v-de693c21]{position:relative;height:100%}.overlay-box .detail-img[data-v-de693c21]{position:absolute;left:50%;top:50%;width:100vw;max-height:100%;transform:translate(-50%,-50%)}.title_div[data-v-d0634458]{width:60vw;text-shadow:.3125rem 0 .9375rem #3c3c3c}.title_div .img[data-v-d0634458]{width:100%}.tip_div[data-v-d0634458]{text-shadow:0 0 .625rem #ceceea}.tip_div .tip_msg[data-v-d0634458]{font-family:PingFangSC;font-weight:400;font-size:.9375rem;color:#fff;line-height:1.25rem;text-align:center;font-style:normal}.mascot_div[data-v-d0634458]{width:100%;height:100%;display:flex;align-items:center;position:relative}.mascot_div .swiper[data-v-d0634458]{white-space:nowrap;height:120vw;flex:1}.mascot_div .swiper-item-div[data-v-d0634458]{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;height:120vw}.mascot_div .swiper-item-div .img[data-v-d0634458]{width:80vw;height:100%}.mascot_div .doct_icon[data-v-d0634458]{padding:0%;position:absolute;width:3.125rem;display:flex;align-items:center;flex-direction:column}.mascot_div .doct_icon .doct_icon_div[data-v-d0634458]{width:100%;display:flex;align-items:center;justify-content:center;padding:1.25rem 0}.mascot_div .doct_icon.left[data-v-d0634458]{top:40%;left:2%;z-index:10}.mascot_div .doct_icon.right[data-v-d0634458]{top:40%;right:2%}.mascot_div .doct_icon .img[data-v-d0634458]{width:40%}.button_div[data-v-d0634458]{margin-top:.625rem;width:80%;height:3.75rem;position:relative}.button_div .img[data-v-d0634458]{position:absolute;width:100%;height:100%}.bg_img[data-v-d0634458]{position:absolute;top:-2%;left:-1%;width:102%;height:104%;z-index:-1}.bg_img .img[data-v-d0634458]{width:100%;height:100%}.main_div[data-v-d0634458]{display:flex;flex-direction:column;position:relative;max-width:100vh;align-items:center;overflow:hidden}
|
||||
|
||||
@@ -1 +1 @@
|
||||
.nav-bar[data-v-e7a2d2df]{width:100%;height:var(--status-bar-height);position:fixed}.nav-bar-seat[data-v-e7a2d2df]{width:100%;height:var(--status-bar-height)}.nav-bar-div[data-v-e7a2d2df]{z-index:1900;width:100%;position:relative}uni-view[data-v-843a5998],uni-scroll-view[data-v-843a5998],uni-swiper-item[data-v-843a5998]{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}@font-face{font-family:uvicon-iconfont;src:url(../../assets/uvicons.04d281cc.ttf) format("truetype")}.uv-icon[data-v-843a5998]{display:flex;align-items:center}.uv-icon--left[data-v-843a5998]{flex-direction:row-reverse;align-items:center}.uv-icon--right[data-v-843a5998]{flex-direction:row;align-items:center}.uv-icon--top[data-v-843a5998]{flex-direction:column-reverse;justify-content:center}.uv-icon--bottom[data-v-843a5998]{flex-direction:column;justify-content:center}.uv-icon__icon[data-v-843a5998]{font-family:uvicon-iconfont;position:relative;display:flex;flex-direction:row;align-items:center}.uv-icon__icon--primary[data-v-843a5998]{color:#06f}.uv-icon__icon--success[data-v-843a5998]{color:#5ac725}.uv-icon__icon--error[data-v-843a5998]{color:#f56c6c}.uv-icon__icon--warning[data-v-843a5998]{color:#f9ae3d}.uv-icon__icon--info[data-v-843a5998]{color:#909399}.uv-icon__img[data-v-843a5998]{height:auto;will-change:transform}.uv-icon__label[data-v-843a5998]{line-height:1}.uv-line[data-v-37b2eb6f]{vertical-align:middle}uni-view[data-v-97e65963],uni-scroll-view[data-v-97e65963],uni-swiper-item[data-v-97e65963]{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}.uv-cell__body[data-v-97e65963]{display:flex;flex-direction:row;box-sizing:border-box;padding:10px 15px;font-size:15px;color:#303133}.uv-cell__body__content[data-v-97e65963]{display:flex;flex-direction:row;align-items:center;flex:1}.uv-cell__body--large[data-v-97e65963]{padding-top:13px;padding-bottom:13px}.uv-cell__left-icon-wrap[data-v-97e65963],.uv-cell__right-icon-wrap[data-v-97e65963]{display:flex;flex-direction:row;align-items:center;font-size:16px}.uv-cell__left-icon-wrap[data-v-97e65963]{margin-right:4px}.uv-cell__right-icon-wrap[data-v-97e65963]{margin-left:4px;transition:transform .3s}.uv-cell__right-icon-wrap--up[data-v-97e65963]{transform:rotate(-90deg)}.uv-cell__right-icon-wrap--down[data-v-97e65963]{transform:rotate(90deg)}.uv-cell__title[data-v-97e65963]{flex:1}.uv-cell__title-text[data-v-97e65963]{font-size:15px;line-height:22px;color:#303133}.uv-cell__title-text--large[data-v-97e65963]{font-size:16px}.uv-cell__label[data-v-97e65963]{margin-top:5px;font-size:12px;color:#909193;line-height:18px}.uv-cell__label--large[data-v-97e65963]{font-size:14px}.uv-cell__value[data-v-97e65963]{text-align:right;font-size:14px;line-height:24px;color:#606266}.uv-cell__value--large[data-v-97e65963]{font-size:15px}.uv-cell--clickable[data-v-97e65963]{background-color:#f3f4f6}.uv-cell--disabled[data-v-97e65963]{color:#c8c9cc;cursor:not-allowed}.uv-cell--center[data-v-97e65963]{align-items:center}uni-view[data-v-c010df49],uni-scroll-view[data-v-c010df49],uni-swiper-item[data-v-c010df49]{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}.uv-cell-group[data-v-c010df49]{flex:1}.uv-cell-group__title[data-v-c010df49]{padding:16px 16px 8px}.uv-cell-group__title__text[data-v-c010df49]{font-size:15px;line-height:16px;color:#303133}.uv-cell-group__wrapper[data-v-c010df49]{position:relative}.detail-body[data-v-0925a3e8]{margin:.9375rem 1.5625rem 0;background:#fff;border-radius:.46875rem;z-index:101;overflow:hidden}.detail-body[data-v-0925a3e8] .uv-line{width:calc(100% - 1.5rem)!important;margin:0 .75rem!important}.detail-body[data-v-0925a3e8] .uv-cell__body{padding:12px 15px}.detail-body[data-v-0925a3e8] .uv-cell__title{flex:none!important}.detail-main[data-v-0925a3e8]{background-color:#f6f8ff}.title[data-v-0925a3e8]{color:#000;font-size:1.0625rem;height:1.0625rem;font-weight:600;line-height:1.0625rem}.fixed_search_div[data-v-0925a3e8]{padding:calc(.3125rem + var(--status-bar-height)) .46875rem .75rem .9375rem;display:flex;align-items:center;background-color:#f6f7f8}.fixed_search_div .back_div[data-v-0925a3e8]{margin-right:.3125rem}.fixed_search_div .back_div .back-icon[data-v-0925a3e8]{position:relative;width:1.25rem;height:1.25rem;cursor:pointer;display:flex;align-items:center}.fixed_search_div .back_div .back-icon[data-v-0925a3e8]:before,.fixed_search_div .back_div .back-icon[data-v-0925a3e8]:after{content:"";position:absolute;transition:all .3s ease}.fixed_search_div .back_div .back-icon[data-v-0925a3e8]:after{top:25%;left:25%;width:40%;height:40%;border-top:.125rem solid #2b2c2e;border-left:.125rem solid #2b2c2e;transform:rotate(-45deg)}
|
||||
.container{padding:20px;display:flex;flex-direction:column;align-items:center}.download-btn{padding:10px 20px;background-color:#007aff;color:#fff;border-radius:5px;margin-bottom:20px}.image-container{width:100%;height:300px;background-color:#f5f5f5;border-radius:5px;margin-bottom:20px;display:flex;justify-content:center;align-items:center}.preview-image{max-width:100%;max-height:100%}.status-text{color:#666;font-size:14px}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 248 KiB |
|
After Width: | Height: | Size: 305 KiB |
|
After Width: | Height: | Size: 297 KiB |
|
After Width: | Height: | Size: 143 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 150 KiB |
|
After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 933 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
@@ -140,7 +140,7 @@ export const queryCurrentUser = (data) => request({
|
||||
// 生成唯一文件名
|
||||
const generateUniqueFilename = (pathName) => {
|
||||
if (!pathName || typeof pathName !== 'string') {
|
||||
throw new Error('无效的头像路径');
|
||||
throw new Error('无效的路径');
|
||||
}
|
||||
|
||||
// 直接使用原始文件名(带扩展名)
|
||||
|
||||
@@ -42,6 +42,17 @@ export const setTraMascotInfo = (data) => {
|
||||
};
|
||||
|
||||
// 查询当前已经选择的吉祥物
|
||||
// 检查文件是否存在
|
||||
const checkFileExists = (filePath) => {
|
||||
return new Promise((resolve) => {
|
||||
uni.getFileInfo({
|
||||
filePath,
|
||||
success: () => resolve(true),
|
||||
fail: () => resolve(false)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前已经选择的吉祥物
|
||||
* 出参:
|
||||
@@ -64,21 +75,37 @@ export const queryCurrentValidMascotInfo = (data) => {
|
||||
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触发请求,浏览器会自动缓存)
|
||||
// })
|
||||
console.log('body.imgAddrmascotNo');
|
||||
const base_url = get_base_url()
|
||||
const pathName = body.imgAddr
|
||||
const fileUrl = base_url + pathName
|
||||
const localFilePath = '_doc/mascot/' + body.mascotNo + '.png'
|
||||
console.log('fileUrl', fileUrl);
|
||||
// 将 Promise 回调函数声明为 async
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// 现在可以在这里使用 await 了
|
||||
const exists = await checkFileExists(localFilePath)
|
||||
if (exists) {
|
||||
console.log('已存在,无需下载')
|
||||
resolve({...body, imgAddr:localFilePath})
|
||||
} else {
|
||||
console.log('开始下载吉祥物:', fileUrl)
|
||||
const dtask = plus.downloader.createDownload(fileUrl, {
|
||||
filename: localFilePath
|
||||
}, (d, status) => {
|
||||
if (status === 200) {
|
||||
console.log("保存路径:", d.filename)
|
||||
resolve({...body, imgAddr:d.filename})
|
||||
} else {
|
||||
console.error("文件下载失败:", status)
|
||||
reject(new Error(`下载失败,状态码: ${status}`))
|
||||
}
|
||||
})
|
||||
|
||||
dtask.start()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return body
|
||||
})
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import showDialog from '@/common/dialogMessage'
|
||||
|
||||
function msg(title, duration = 1000) {
|
||||
uni.showToast({
|
||||
@@ -9,21 +10,39 @@ function msg(title, duration = 1000) {
|
||||
}
|
||||
|
||||
function show(title, msg, showCancel = true, cancelText = '取消', confirmText = '确定') {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.showModal({
|
||||
title: title,
|
||||
content: msg,
|
||||
showCancel: showCancel,
|
||||
cancelText: cancelText,
|
||||
confirmText: confirmText,
|
||||
success: function(res) {
|
||||
resolve(res.confirm)
|
||||
},
|
||||
fail: function(res) {
|
||||
reject(res)
|
||||
},
|
||||
});
|
||||
})
|
||||
return new Promise((resolve, reject) => {
|
||||
// 创建通用参数对象
|
||||
const dialogOptions = {
|
||||
title,
|
||||
content: msg,
|
||||
showCancel,
|
||||
cancelText,
|
||||
confirmText,
|
||||
success: (res) => {
|
||||
// 统一处理成功回调,解析为布尔值
|
||||
resolve(!!res.confirm);
|
||||
}
|
||||
};
|
||||
|
||||
if (getPhoneEnvBool('AND')) {
|
||||
// 安卓环境使用showDialog,补充cancel回调
|
||||
showDialog({
|
||||
...dialogOptions,
|
||||
cancel: () => {
|
||||
console.log('用户点击取消');
|
||||
resolve(false); // 取消时也返回Promise结果
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 其他环境使用uni.showModal,补充fail回调
|
||||
uni.showModal({
|
||||
...dialogOptions,
|
||||
fail: (res) => {
|
||||
reject(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const loading = (title = '加载中', mask = true) => uni.showLoading({
|
||||
|
||||
@@ -1,87 +1,78 @@
|
||||
<template>
|
||||
<view class="comment_div">
|
||||
<uv-load-more :status="status" loadmore-text="轻轻上拉加载" ></uv-load-more>
|
||||
<!-- <view class="empty_message_div" v-if="message_list.length == 0">
|
||||
<image class="img" src="@/static/images/courseDetail/empty_message.png"></image>
|
||||
</view> -->
|
||||
<!-- message_list -->
|
||||
<!-- <scroll-view :scroll-y="true" class="comment_scroll"> -->
|
||||
<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"
|
||||
:src="item.userIconImgId"></image-preview>
|
||||
<image v-else src="/static/images/me/default_user_avatar.png" class="img"></image>
|
||||
<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" :src="item.userIconImgId"></image-preview>
|
||||
<image v-else src="/static/images/me/default_user_avatar.png" class="img"></image>
|
||||
</view>
|
||||
<view class="msg_content">
|
||||
<view class="title_div">
|
||||
<view class="name">{{item.userName}}</view>
|
||||
<view class="title_tip">{{item.bbsTagDesc}}</view>
|
||||
</view>
|
||||
<view class="msg_content">
|
||||
<view class="title_div">
|
||||
<view class="name">{{item.userName}}</view>
|
||||
<view class="title_tip">{{item.bbsTagDesc}}</view>
|
||||
</view>
|
||||
<view class="title">
|
||||
{{item.bbsContent}}
|
||||
</view>
|
||||
<view class="img_div pic-cell">
|
||||
<image-preview v-for="img in item.imgIdList" @click="showPicture(item.imgIdList, img)"
|
||||
:src="img" class="pic-item" mode="scaleToFill"></image-preview>
|
||||
</view>
|
||||
<view class="time_and_reply">
|
||||
<view class="time">{{item.bbsTm.substr(0,16)}}</view>
|
||||
<view class="reply" @click="click_reply(item, item.bbsId, index)">回复</view>
|
||||
</view>
|
||||
<view class="show_close_div" v-if="item.children?.length" @click="item.show = !item.show">
|
||||
<template v-if="item.show">
|
||||
<view>收起</view>
|
||||
<view class="back_div">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view>展开{{item.children?.length}}条回复</view>
|
||||
<view class="back_div">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="children" v-if="item.show">
|
||||
<view class="message_div" v-for="childrenItem in item.children">
|
||||
<view class="head_div">
|
||||
<image-preview v-if="childrenItem.userIconImgId" class="img-box img"
|
||||
:src="childrenItem.userIconImgId"></image-preview>
|
||||
<image v-else src="/static/images/me/default_user_avatar.png" class="img"></image>
|
||||
</view>
|
||||
<view class="msg_content">
|
||||
<view class="title_div">
|
||||
<view class="name">{{childrenItem.userName}}</view>
|
||||
<view class="arrow"></view>
|
||||
<view class="name">{{childrenItem.rtnUName}}</view>
|
||||
<view class="title">
|
||||
{{item.bbsContent}}
|
||||
</view>
|
||||
<view class="img_div pic-cell">
|
||||
<image-preview v-for="img in item.imgIdList" @click="showPicture(item.imgIdList, img)" :src="img"
|
||||
class="pic-item" mode="scaleToFill"></image-preview>
|
||||
</view>
|
||||
<view class="time_and_reply">
|
||||
<view class="time">{{item.bbsTm.substr(0,16)}}</view>
|
||||
<view class="reply" @click="click_reply(item, item.bbsId, index)">回复</view>
|
||||
</view>
|
||||
<view class="show_close_div" v-if="item.children?.length" @click="item.show = !item.show">
|
||||
<template v-if="item.show">
|
||||
<view>收起</view>
|
||||
<view class="back_div">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view>展开{{item.children?.length}}条回复</view>
|
||||
<view class="back_div">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="children" v-if="item.show">
|
||||
<view class="message_div" v-for="childrenItem in item.children">
|
||||
<view class="head_div">
|
||||
<image-preview v-if="childrenItem.userIconImgId" class="img-box img"
|
||||
:src="childrenItem.userIconImgId"></image-preview>
|
||||
<image v-else src="/static/images/me/default_user_avatar.png" class="img"></image>
|
||||
</view>
|
||||
<view class="msg_content">
|
||||
<view class="title_div">
|
||||
<view class="name">{{childrenItem.userName}}</view>
|
||||
<view class="arrow"></view>
|
||||
<view class="name">{{childrenItem.rtnUName}}</view>
|
||||
|
||||
</view>
|
||||
<view class="title">
|
||||
{{childrenItem.bbsContent}}
|
||||
</view>
|
||||
<view class="img_div">
|
||||
</view>
|
||||
<view class="time_and_reply">
|
||||
<view class="time">{{childrenItem.bbsTm.substr(0,16)}}</view>
|
||||
<view class="reply"
|
||||
@click="click_reply(childrenItem, childrenItem.parentId, index)">回复
|
||||
</view>
|
||||
</view>
|
||||
<view class="title">
|
||||
{{childrenItem.bbsContent}}
|
||||
</view>
|
||||
<view class="img_div">
|
||||
</view>
|
||||
<view class="time_and_reply">
|
||||
<view class="time">{{childrenItem.bbsTm.substr(0,16)}}</view>
|
||||
<view class="reply" @click="click_reply(childrenItem, childrenItem.parentId, index)">回复
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- </scroll-view> -->
|
||||
<!-- <view class="send_evaluate_div">
|
||||
<uv-button type="primary" class="send_evaluate"
|
||||
@click="common.navigateTo('/pages/courseDetail/submit?crsNum='+props.crsNum+'&imgId='+props.imgId)">发布评价</uv-button>
|
||||
</view> -->
|
||||
<uni-popup ref="popup">
|
||||
<view class="bottom_reply_input_div">
|
||||
<uv-input v-model="reply_data.bbsContent" placeholderStyle='color:#999999;font-size:26rpx'
|
||||
:placeholder="reply_data.placeholder" :focus="true" :maxlength="100">
|
||||
</view>
|
||||
<view class="empty_message_div" v-if="status=='nomore' && total == 0">
|
||||
<image class="img" src="@/static/images/courseDetail/empty_message.png"></image>
|
||||
</view>
|
||||
<uv-load-more :status="status" loadmore-text="轻轻上拉加载"></uv-load-more>
|
||||
<uni-popup ref="popup" class="popup">
|
||||
<view class="bottom_reply_input_div" :style="{marginBottom:popup_input_bottom}">
|
||||
<uv-input v-model="reply_data.bbsContent" :adjustPosition="false"
|
||||
placeholderStyle='color:#999999;font-size:26rpx' :placeholder="reply_data.placeholder" :focus="true"
|
||||
:maxlength="100">
|
||||
</uv-input>
|
||||
<view class="" style="display: flex;flex-direction: column; margin:10rpx 20rpx;">
|
||||
<view class="fl1"></view>
|
||||
@@ -90,7 +81,6 @@
|
||||
<view class="fl1"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
@@ -99,7 +89,8 @@
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted
|
||||
onMounted,
|
||||
nextTick
|
||||
} from 'vue'
|
||||
import {
|
||||
queryTraCrsBbsInfoByCrsId,
|
||||
@@ -112,11 +103,14 @@
|
||||
} from '@/api/request.js'
|
||||
|
||||
const popup = ref(null)
|
||||
const popup_input_bottom = ref('0px')
|
||||
|
||||
const inputValue = ref('')
|
||||
const placeholder = ref('')
|
||||
const message_list = reactive([])
|
||||
const status = ref('loading') // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20
|
||||
const status = ref('') // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15
|
||||
const total = ref(-1)
|
||||
const page = ref(0)
|
||||
const reply_data_init = {
|
||||
"index": null,
|
||||
@@ -134,17 +128,23 @@
|
||||
crsNum: String,
|
||||
imgId: String
|
||||
})
|
||||
const click_reply = ({
|
||||
userName,
|
||||
bbsId
|
||||
}, parentBbsId, index) => {
|
||||
popup.value.open('bottom')
|
||||
reply_data.placeholder = '回复 ' + userName + ":"
|
||||
const click_reply = (item, parentBbsId, index) => {
|
||||
popup.value.open('bottom');
|
||||
reply_data.placeholder = '回复 ' + item.userName + ":"
|
||||
reply_data.parentBbsId = parentBbsId
|
||||
reply_data.bbsId = bbsId
|
||||
reply_data.bbsId = item.bbsId
|
||||
reply_data.index = index
|
||||
nextTick(() => {
|
||||
uni.onKeyboardHeightChange(res => {
|
||||
popup_input_bottom.value = `${res.height}px`;
|
||||
console.log(res);
|
||||
});
|
||||
})
|
||||
}
|
||||
const reply_send = async () => {
|
||||
if (reply_data.bbsContent === '') {
|
||||
return common.msg('回复内容不能为空')
|
||||
}
|
||||
try {
|
||||
popup.value.close()
|
||||
common.loading('发送中...')
|
||||
@@ -166,20 +166,24 @@
|
||||
common.hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
const getData = () => {
|
||||
if (status.value !== 'loadmore' && status.value !== '') return
|
||||
status.value = 'loading'
|
||||
page.value ++
|
||||
page.value++
|
||||
queryTraCrsBbsInfoByCrsId({
|
||||
crsId: props.crsId,
|
||||
page:page.value,
|
||||
limit:20
|
||||
}).then(({
|
||||
body
|
||||
}) => {
|
||||
|
||||
message_list.concat(body)
|
||||
// console.log('body', body);
|
||||
Object.assign(message_list, message_list.concat(body))
|
||||
page: page.value,
|
||||
limit: limit
|
||||
}).then(res => {
|
||||
total.value = res.total
|
||||
message_list.push(...res.body)
|
||||
}).finally(() => {
|
||||
if (message_list.length >= total.value) {
|
||||
status.value = 'nomore'
|
||||
} else {
|
||||
status.value = 'loadmore'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -187,6 +191,9 @@
|
||||
const showPicture = (urls, item) => {
|
||||
const base_url = get_base_url()
|
||||
const current = urls.findIndex(res => item === res)
|
||||
if (current === -1) {
|
||||
return false
|
||||
}
|
||||
const urlsList = urls.map(res => base_url + res)
|
||||
console.log(urlsList, current);
|
||||
uni.previewImage({
|
||||
@@ -198,9 +205,7 @@
|
||||
success: function(data) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: urlsList[data.index],
|
||||
success: function() {
|
||||
// that.$common.msg('下载成功')
|
||||
}
|
||||
success: function() {}
|
||||
});
|
||||
},
|
||||
fail: function(err) {}
|
||||
@@ -216,6 +221,10 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.popup {
|
||||
z-index: 1200;
|
||||
}
|
||||
|
||||
.empty_message_div {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -274,6 +283,7 @@
|
||||
height: 100%;
|
||||
background-color: #FFFFFF;
|
||||
display: flex;
|
||||
bottom: 40vh;
|
||||
align-items: center;
|
||||
padding: 10rpx 10rpx;
|
||||
|
||||
@@ -447,11 +457,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.comment_scroll{
|
||||
|
||||
.comment_scroll {
|
||||
height: calc(100vh - 92rpx - 22rpx - 187rpx);
|
||||
}
|
||||
|
||||
.comment_div {
|
||||
padding: 20rpx 0 200rpx 0;
|
||||
padding: 20rpx 0 20rpx 0;
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
position: relative;
|
||||
|
||||
@@ -17,67 +17,12 @@
|
||||
<view class="fz-30 font_pf text ellipsis-text">{{ item.pgrphContent }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="point-item mb-30" v-for="(item, index) in modelValue?.pgrphData || []" :key="item.index"
|
||||
@click="toDetail(item)" :class="item.pgrphStdyStateName == '已学习' ? 'learn' : 'unlearn'">
|
||||
<view class="top mb-30">
|
||||
<view class="blue-ball">
|
||||
<view class="ball"></view>
|
||||
</view>
|
||||
<view class="fz-30 font_pf title">知识点{{ item.pgrphNm }}</view>
|
||||
<view class="fl1">
|
||||
|
||||
</view>
|
||||
<view class="font_pf fz-24 study-status" >
|
||||
{{ item.pgrphStdyStateName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="fz-30 font_pf text ellipsis-text">{{ item.pgrphContent }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="point-item mb-30" v-for="(item, index) in modelValue?.pgrphData || []" :key="item.index"
|
||||
@click="toDetail(item)" :class="item.pgrphStdyStateName == '已学习' ? 'learn' : 'unlearn'">
|
||||
<view class="top mb-30">
|
||||
<view class="blue-ball">
|
||||
<view class="ball"></view>
|
||||
</view>
|
||||
<view class="fz-30 font_pf title">知识点{{ item.pgrphNm }}</view>
|
||||
<view class="fl1">
|
||||
|
||||
</view>
|
||||
<view class="font_pf fz-24 study-status" >
|
||||
{{ item.pgrphStdyStateName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="fz-30 font_pf text ellipsis-text">{{ item.pgrphContent }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="point-item mb-30" v-for="(item, index) in modelValue?.pgrphData || []" :key="item.index"
|
||||
@click="toDetail(item)" :class="item.pgrphStdyStateName == '已学习' ? 'learn' : 'unlearn'">
|
||||
<view class="top mb-30">
|
||||
<view class="blue-ball">
|
||||
<view class="ball"></view>
|
||||
</view>
|
||||
<view class="fz-30 font_pf title">知识点{{ item.pgrphNm }}</view>
|
||||
<view class="fl1">
|
||||
|
||||
</view>
|
||||
<view class="font_pf fz-24 study-status" >
|
||||
{{ item.pgrphStdyStateName }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="fz-30 font_pf text ellipsis-text">{{ item.pgrphContent }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {computed} from "vue"
|
||||
import common from '@/common/common';
|
||||
const emit = defineEmits(['toStudyPrgh'])
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<view class="detail-body">
|
||||
<view class="head-title font_pf">
|
||||
<view class="title-text">
|
||||
{{ '自行车支持下支自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩自行车支持下支持下在踩踩踩踩踩踩踩踩踩持下在踩踩踩踩踩踩踩踩踩' }}
|
||||
{{ form.crsName || '' }}
|
||||
</view>
|
||||
<view class="title-num">
|
||||
<view class="num-item">
|
||||
@@ -29,7 +29,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="body-box">
|
||||
<uv-sticky :customNavHeight="statusBarHeight" id='tabsDiv'>
|
||||
<uv-sticky :customNavHeight="statusBarHeight" id='tabsDiv' class="sticky">
|
||||
<view class="body-tab">
|
||||
<uv-tabs class="font_pf" :current="tabAct" :list="tabList" @change="tabSwitch"
|
||||
:scrollable="false" line-color="#0066FF"
|
||||
@@ -52,7 +52,8 @@
|
||||
<!-- </swiper-item>
|
||||
<swiper-item> -->
|
||||
<view class="evaluate" v-if="tabAct == 2 && form">
|
||||
<comment ref="commentRef" :crsNum="form.crsNum" :crsId="form.crsId" :imgId="form.imgId"></comment>
|
||||
<comment ref="commentRef" :crsNum="form.crsNum" :crsId="form.crsId" :imgId="form.imgId">
|
||||
</comment>
|
||||
</view>
|
||||
<!-- </swiper-item>
|
||||
</swiper> -->
|
||||
@@ -61,18 +62,17 @@
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
<view class="btn-box btn-box-height font_pf" v-if="[0,1,2].includes(tabAct)">
|
||||
|
||||
<uv-button type="primary"
|
||||
@click="common.navigateTo('/pages/course/study?crsNum='+crsNum+'&crsId='+form.crsId + '&imgId=' + form.imgId)">去学习</uv-button>
|
||||
<uv-button type="primary">去练习</uv-button>
|
||||
<uv-button type="primary">去考试</uv-button>
|
||||
|
||||
<!-- <template v-if="tabAct == 2">
|
||||
<view class="btn-box btn-box-height font_pf">
|
||||
<template v-if="[0,1].includes(tabAct)">
|
||||
<uv-button type="primary"
|
||||
@click="common.navigateTo('/pages/course/study?crsNum='+crsNum+'&crsId='+form.crsId + '&imgId=' + form.imgId)">去学习</uv-button>
|
||||
<uv-button type="primary">去练习</uv-button>
|
||||
<uv-button type="primary">去考试</uv-button>
|
||||
</template>
|
||||
<template v-if="tabAct == 2">
|
||||
<uv-button type="primary" class="send_evaluate"
|
||||
@click="common.navigateTo('/pages/courseDetail/submit?crsNum='+crsNum)">发布评价</uv-button>
|
||||
</template> -->
|
||||
|
||||
@click="common.navigateTo('/pages/courseDetail/submit?crsNum='+crsNum+'&imgId='+form.imgId)">发布评价</uv-button>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -148,26 +148,26 @@
|
||||
const childScrollStatus = ref(false)
|
||||
const scroll_fun = (e) => {
|
||||
scrollTop.value = e.detail.scrollTop
|
||||
getElementPosition().then(res => {
|
||||
childScrollStatus.value = statusBarHeight === res.top
|
||||
})
|
||||
// getElementPosition().then(res => {
|
||||
// childScrollStatus.value = statusBarHeight === res.top
|
||||
// })
|
||||
}
|
||||
|
||||
const swiper_change = (res) => {
|
||||
tabAct.value = res.detail.current
|
||||
}
|
||||
|
||||
const getElementPosition = () => {
|
||||
return new Promise((resolve) => {
|
||||
uni.createSelectorQuery()
|
||||
.select('#tabsDiv')
|
||||
.boundingClientRect(rect => {
|
||||
if (rect) {
|
||||
resolve(rect) // 距离视口顶部的距离
|
||||
}
|
||||
}).exec()
|
||||
})
|
||||
}
|
||||
// const getElementPosition = () => {
|
||||
// return new Promise((resolve) => {
|
||||
// uni.createSelectorQuery()
|
||||
// .select('#tabsDiv')
|
||||
// .boundingClientRect(rect => {
|
||||
// if (rect) {
|
||||
// resolve(rect) // 距离视口顶部的距离
|
||||
// }
|
||||
// }).exec()
|
||||
// })
|
||||
// }
|
||||
|
||||
onMounted(async () => {
|
||||
uni.$on('refresh_comment_data', () => {
|
||||
@@ -299,6 +299,7 @@
|
||||
padding-right: 16rpx;
|
||||
padding-top: 20rpx;
|
||||
padding-bottom: 245rpx;
|
||||
|
||||
}
|
||||
|
||||
.body-tab {
|
||||
@@ -308,16 +309,13 @@
|
||||
padding-bottom: 22rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.course-info,.point {
|
||||
|
||||
.course-info,
|
||||
.point,
|
||||
.evaluate {
|
||||
min-height: calc(100vh - 92rpx - 22rpx - 245rpx - var(--status-bar-height));
|
||||
}
|
||||
|
||||
// .body-swiper {
|
||||
// // min-height: 100vh;
|
||||
// height: calc(100vh - 92rpx - 22rpx - 187rpx - 20rpx - var(--status-bar-height));
|
||||
// }
|
||||
|
||||
|
||||
.btn-box-height {
|
||||
height: 187rpx;
|
||||
}
|
||||
@@ -330,7 +328,6 @@
|
||||
padding-top: 37rpx;
|
||||
justify-content: space-around;
|
||||
background-color: #ffffff;
|
||||
// background-color: red;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
z-index: 1000;
|
||||
|
||||
@@ -361,7 +358,7 @@
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.learn {
|
||||
color: #1dd17a;
|
||||
|
||||
@@ -16,7 +16,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-preview :src="userInfo.mascotInfo?.imgAddr ||''" alt="" class="image-pet"></image-preview>
|
||||
<image :src="userInfo.mascotInfo?.imgAddr ||''" alt="" class="image-pet" mode="widthFix"></image>
|
||||
<view class="ai-info-bg-box">
|
||||
<view class="hello-text">Hi,我是{{ userInfo.mascotInfo?.mascotName || ''}}</view>
|
||||
<view class="info-text">工作学习,我都能帮你!</view>
|
||||
@@ -611,13 +611,13 @@
|
||||
|
||||
.image-pet {
|
||||
width: 230rpx;
|
||||
height: 235rpx;
|
||||
// height: 235rpx;
|
||||
position: absolute;
|
||||
right: 24rpx;
|
||||
top: 15rpx;
|
||||
top: -20rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
|
||||
.image-pet-bg {
|
||||
position: absolute;
|
||||
padding: 0 24rpx;
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<view class="study_duration_and_profile_div">
|
||||
<!-- 飞天兔子 -->
|
||||
<view class="profile_div">
|
||||
<image-preview :src="mascotInfo?.imgAddr ||''" alt="" class="profile"></image-preview>
|
||||
<image :src="mascotInfo?.imgAddr ||''" alt="" class="profile"></image>
|
||||
<!-- <image src="/static/images/index/fttz.png" class="profile"></image> -->
|
||||
</view>
|
||||
<!-- 学习时长 -->
|
||||
@@ -225,9 +225,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
computed,
|
||||
nextTick,
|
||||
onBeforeMount,
|
||||
onMounted,
|
||||
reactive,
|
||||
@@ -236,7 +236,8 @@
|
||||
import {
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onLoad
|
||||
onLoad,
|
||||
onHide
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
customStyles,
|
||||
@@ -249,15 +250,18 @@
|
||||
} from '@/common/common';
|
||||
|
||||
import common from '@/common/common'
|
||||
import {setMascot} from "@/common/mascot.js"
|
||||
import {
|
||||
setMascot
|
||||
} from "@/common/mascot.js"
|
||||
import {
|
||||
getStatisticsData,
|
||||
queryCrsInfoByLastnew,
|
||||
queryCrsInfoByPopular,
|
||||
queryCrsInfoByRecmd,
|
||||
} from '@/api/index.js'
|
||||
|
||||
|
||||
const scrollTop = ref(0);
|
||||
const mascotShow = ref(false);
|
||||
const stdtTmLenRef = ref(null);
|
||||
const accmPracticeCntRef = ref(null);
|
||||
const accmExamCntRef = ref(null);
|
||||
@@ -272,14 +276,14 @@
|
||||
const bgOpacity = computed(() => {
|
||||
return `rgba(246,248,255,${opacity.value})`;
|
||||
});
|
||||
|
||||
|
||||
// 首页滑动事件监听
|
||||
onPageScroll((e) => {
|
||||
scrollTop.value = e.scrollTop
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 滚动消息
|
||||
const notice_text = ref(['绿色金融政策解析与商业银行绿色水水水水水水水水水水水水水', '绿色金融政策解析与商业银行红色'])
|
||||
const init_class_data = [{
|
||||
@@ -386,10 +390,10 @@
|
||||
common.navigateTo('/pages/login/login')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
setMascot()
|
||||
const userInfo = getUserInfo()
|
||||
if(userInfo) {
|
||||
if (userInfo) {
|
||||
mascotInfo.value = userInfo?.mascotInfo
|
||||
}
|
||||
statistics_data['get_statistics_data']() // 获取统计数据
|
||||
@@ -403,6 +407,9 @@
|
||||
recommend_class_list.value = res.body
|
||||
})
|
||||
})
|
||||
onHide(() => {
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -603,6 +610,7 @@
|
||||
color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.message_num_font {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
@@ -661,6 +669,7 @@
|
||||
color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.message_num_font {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
@@ -729,18 +738,20 @@
|
||||
.study_duration_div {
|
||||
height: 162rpx;
|
||||
background: linear-gradient(180deg, rgba(238, 246, 255, 0.65) 0%, #C5DFFD 4%, #FFFFFF 100%);
|
||||
|
||||
|
||||
border-radius: 23rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
z-index: 20;
|
||||
opacity: .9;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
// background-color: red;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
.top {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
@@ -877,4 +888,4 @@
|
||||
flex-direction: column;
|
||||
background-color: #F6F8FF;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -67,8 +67,10 @@
|
||||
} from 'vue';
|
||||
import {
|
||||
queryValidTraMascotInfo,
|
||||
queryCurrentValidMascotInfo,
|
||||
setTraMascotInfo
|
||||
} from "@/api/mascot.js"
|
||||
|
||||
import common from '@/common/common.js'
|
||||
import {
|
||||
setUserInfo,
|
||||
@@ -105,11 +107,12 @@
|
||||
common.loading()
|
||||
setTraMascotInfo({
|
||||
mascotId: item.mascotId
|
||||
}).then(res => {
|
||||
}).then(async(res) => {
|
||||
const mascotInfo = await queryCurrentValidMascotInfo()
|
||||
const userInfo = getUserInfo()
|
||||
setUserInfo({
|
||||
...userInfo,
|
||||
'mascotInfo': item
|
||||
'mascotInfo': mascotInfo
|
||||
})
|
||||
common.hideLoading()
|
||||
common.msg('设置成功')
|
||||
|
||||
@@ -1,176 +1,168 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<button class="download-btn" @click="saveImage2">下载图片</button>
|
||||
<view class="image-container" v-if="localImagePath">
|
||||
<image :src="localImagePath" mode="aspectFit" class="preview-image"></image>
|
||||
</view>
|
||||
<view class="status-text">{{statusText}}</view>
|
||||
</view>
|
||||
<view class="max_page detail-main">
|
||||
<nav-bar :is_seat="false"></nav-bar>
|
||||
<view class="fixed_search_div">
|
||||
<view class="back_div" @click="common.navigateBack()">
|
||||
<view class="back-icon"></view>
|
||||
</view>
|
||||
<view class="title font_pf">系统参数</view>
|
||||
</view>
|
||||
<view class="detail-body">
|
||||
<uv-cell-group :border="false">
|
||||
<uv-cell title="根域名" :value="url"></uv-cell>
|
||||
<uv-cell title="当前环境:" :value="ENV.MODE"></uv-cell>
|
||||
<uv-cell title="版本名称" :value="appBaseInfo.appVersion"></uv-cell>
|
||||
<uv-cell title="版本号" :value="appBaseInfo.appVersionCode"></uv-cell>
|
||||
<uv-cell title="点击1:" @click="aaaa"></uv-cell>
|
||||
<uv-cell title="点击2:" :border="false" @click="bbbb"></uv-cell>
|
||||
</uv-cell-group>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import common from '@/common/common';
|
||||
import {
|
||||
get_base_url
|
||||
} from '../../api/request';
|
||||
const url = get_base_url();
|
||||
const ENV = import.meta.env
|
||||
const appBaseInfo = uni.getAppBaseInfo()
|
||||
console.log('appBaseInfo', appBaseInfo);
|
||||
import showDialog from '@/common/dialogMessage'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
remoteImageUrl: 'https://aitstest.jlbank.com.cn:7002/traoss/tras3/show/S3T0250181221032025072317561000000449416', // 替换为实际图片URL
|
||||
localImagePath: '',
|
||||
statusText: '点击下载图片'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
downloadImage() {
|
||||
// const filePath = '_doc/uniapp_save/17532626796030.jpeg';
|
||||
|
||||
// // 使用uni.getFileInfo替代access方法
|
||||
// uni.getFileInfo({
|
||||
// filePath: filePath, // 注意这里参数名是filePath而非path
|
||||
// success: (res) => {
|
||||
// console.log('本地图片存在,文件大小:', res.size);
|
||||
// this.localImagePath = filePath;
|
||||
// },
|
||||
// fail: (err) => {
|
||||
// console.log('本地图片不存在或获取失败:', err.errMsg);
|
||||
// this.localImagePath = '';
|
||||
// }
|
||||
// });
|
||||
const bbbb = () => {
|
||||
// showDialog({
|
||||
// title: '提示信息',
|
||||
// content: '检测到您已离开,即将退出学习页面。',
|
||||
// confirmText: '确认',
|
||||
// showCancel: false,
|
||||
// cancelText: '再想想',
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// console.log('用户点击确定');
|
||||
// }
|
||||
// },
|
||||
// cancel: () => {
|
||||
// console.log('用户点击取消');
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
this.statusText = '正在下载图片...'
|
||||
uni.downloadFile({
|
||||
url: this.remoteImageUrl,
|
||||
success: (downloadResult) => {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
this.saveImage(downloadResult.tempFilePath)
|
||||
} else {
|
||||
this.statusText = `下载失败,状态码: ${downloadResult.statusCode}`
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
this.statusText = `下载失败: ${err.errMsg}`
|
||||
}
|
||||
})
|
||||
},
|
||||
saveImage(tempFilePath) {
|
||||
const savedFilePath = ''
|
||||
this.statusText = '正在保存图片...'
|
||||
uni.saveFile({
|
||||
tempFilePath: tempFilePath,
|
||||
filePath: savedFilePath,
|
||||
success: (res) => {
|
||||
this.localImagePath = res.savedFilePath
|
||||
this.statusText = '图片保存成功'
|
||||
this.showImage()
|
||||
},
|
||||
fail: (err) => {
|
||||
if (err.errMsg.includes('permission denied')) {
|
||||
this.statusText = '需要相册权限才能保存图片'
|
||||
uni.showModal({
|
||||
title: '权限申请',
|
||||
content: '需要相册权限来保存图片到本地',
|
||||
success: (modalRes) => {
|
||||
if (modalRes.confirm) {
|
||||
uni.openSetting()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.statusText = `保存失败: ${err.errMsg}`
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
saveFileWithCN(fileUrl, customFileName) { // 文件下载地址, 自定义文件名
|
||||
// const defaultPathPrefix = "_doc/uniapp_save";
|
||||
// const fullPath = `${defaultPathPrefix}/${customFileName}`;
|
||||
const fullPath = customFileName;
|
||||
|
||||
const dtask = plus.downloader.createDownload(fileUrl, {
|
||||
filename: fullPath
|
||||
}, (d, status) => {
|
||||
if (status === 200) {
|
||||
console.log("保存路径:", d.filename);
|
||||
this.localImagePath = d.filename
|
||||
} else {
|
||||
console.error("文件下载失败:", status);
|
||||
showDialog({
|
||||
title: '提示',
|
||||
content: '检测到您已存在学习记录,要继续学习吗?',
|
||||
confirmText: '重新学习',
|
||||
showCancel: true,
|
||||
cancelText: '继续学习',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
});
|
||||
|
||||
dtask.start();
|
||||
},
|
||||
saveImage2() {
|
||||
const base_url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
const pathName = '/traoss/tras3/show/S3T0250181221032025072318450600000455860'
|
||||
const fileUrl = base_url + pathName
|
||||
// 生成唯一文件名,避免冲突
|
||||
const filename = pathName.split('/').pop()
|
||||
const localFilePath = '_doc/jax/' + filename+'.png'
|
||||
console.log('localFilePath', localFilePath, fileUrl);
|
||||
// 先检查是否存在
|
||||
uni.getFileInfo({
|
||||
filePath: localFilePath,
|
||||
success: () => {
|
||||
console.log('头像已存在,无需下载');
|
||||
this.localImagePath = localFilePath
|
||||
},
|
||||
fail: () => {
|
||||
console.log('头像不存在');
|
||||
console.log('开始下载头像:', fileUrl);
|
||||
const dtask = plus.downloader.createDownload(fileUrl, {
|
||||
filename: localFilePath
|
||||
}, (d, status) => {
|
||||
if (status === 200) {
|
||||
console.log("保存路径:", d.filename);
|
||||
this.localImagePath = d.filename
|
||||
} else {
|
||||
console.error("文件下载失败:", status);
|
||||
}
|
||||
});
|
||||
|
||||
dtask.start();
|
||||
cancel: () => {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
showImage() {
|
||||
// 使用saveFile保存后的本地路径直接加载
|
||||
console.log('本地图片路径:', this.localImagePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
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>
|
||||
.container {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.download-btn {
|
||||
padding: 10px 20px;
|
||||
background-color: #007AFF;
|
||||
color: white;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.image-container {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.preview-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
.status-text {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$bg-margin-left: 50rpx;
|
||||
|
||||
.detail-body {
|
||||
margin: 30rpx $bg-margin-left 0 $bg-margin-left;
|
||||
background: #ffffff;
|
||||
border-radius: 15rpx;
|
||||
z-index: 101;
|
||||
overflow: hidden;
|
||||
|
||||
// 为了让线缩进来24单位
|
||||
:deep(.uv-line) {
|
||||
width: calc(100% - 48rpx) !important;
|
||||
margin: 0 24rpx !important;
|
||||
}
|
||||
|
||||
:deep(.uv-cell__body) {
|
||||
padding: 12px 15px;
|
||||
}
|
||||
|
||||
:deep(.uv-cell__title) {
|
||||
flex: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-main {
|
||||
background-color: #F6F8FF;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #000000;
|
||||
font-size: 34rpx;
|
||||
height: 34rpx;
|
||||
font-weight: 600;
|
||||
// margin-bottom: 30rpx;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.fixed_search_div {
|
||||
padding: calc(10rpx + var(--status-bar-height)) 15rpx 24rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f6f7f8;
|
||||
|
||||
.back_div {
|
||||
margin-right: 10rpx;
|
||||
|
||||
.back-icon {
|
||||
position: relative;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.back-icon::before,
|
||||
.back-icon::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.back-icon::after {
|
||||
top: 25%;
|
||||
left: 25%;
|
||||
width: 40%;
|
||||
height: 40%;
|
||||
border-top: 4rpx solid #2b2c2e;
|
||||
border-left: 4rpx solid #2b2c2e;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||