This commit is contained in:
zoujiandong 2025-11-20 10:29:35 +08:00
parent 76e619b85d
commit f4b1ef932d
10 changed files with 173 additions and 96 deletions

View File

@ -5,15 +5,18 @@
plAd: true, plAd: true,
dotNumber: { dotNumber: {
} },
apiHost: 'https://dev-app.igandan.com/app',
//BASE_URL='https://dev-app.igandan.com/app'
}, },
onLaunch(options) { onLaunch(options) {
//uni.setStorageSync('apiHost', 'value')
console.log('打印options'); console.log('打印options');
console.log(options); console.log(options);
if (options && options.referrerInfo.extraData && options.referrerInfo.extraData.token) { if (options && options.referrerInfo.extraData && options.referrerInfo.extraData.token) {
uni.setStorageSync("AUTH_TOKEN_App", options.referrerInfo.extraData.token); uni.setStorageSync("AUTH_TOKEN_App", options.referrerInfo.extraData.token);
uni.setStorageSync("userInfo", options.referrerInfo.extraData.userInfo); uni.setStorageSync("userInfo", options.referrerInfo.extraData.userInfo);
//getApp({allowDefault: true}).globalData.apiHost = options.referrerInfo.extraData.apiHost;
}; };
if (options && options.referrerInfo.extraData && options.referrerInfo.extraData.targetPath) { if (options && options.referrerInfo.extraData && options.referrerInfo.extraData.targetPath) {
uni.navigateTo({ uni.navigateTo({

View File

@ -18,6 +18,7 @@
"mobx": "^6.6.1", "mobx": "^6.6.1",
"nim-web-sdk-ng": "^10.9.50", "nim-web-sdk-ng": "^10.9.50",
"pinyin": "^4.0.0", "pinyin": "^4.0.0",
"uni-packing-wgt": "^1.2.3",
"uniapp-video-player": "^1.3.0", "uniapp-video-player": "^1.3.0",
"uview-plus": "^3.4.73", "uview-plus": "^3.4.73",
"vconsole": "^3.15.1" "vconsole": "^3.15.1"

View File

@ -9,16 +9,16 @@
} }
}, },
"pages": [ "pages": [
{ // {
"path": "pages/loading/loading", // "path": "pages/loading/loading",
"style": { // "style": {
"navigationBarTitleText": "", // "navigationBarTitleText": "",
"navigationStyle": "custom", // "navigationStyle": "custom",
"app": { // "app": {
"bounce": "none" // "bounce": "none"
} // }
} // }
}, // },
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
@ -280,6 +280,28 @@
"bounce": "none" "bounce": "none"
} }
} }
},
{
"path": "video/video",
"style": {
"navigationStyle": "custom",
"navigationBarRightButton":{ "hide": true},
"navigationBarTitleText": "uni-app分页",
"app": {
"bounce": "none"
}
}
},
{
"path": "patientVideo/patientVideo",
"style": {
"navigationStyle": "custom",
"navigationBarRightButton":{ "hide": true},
"navigationBarTitleText": "uni-app分页",
"app": {
"bounce": "none"
}
}
}, },
{ {
"path": "videoDetail/videoDetail", "path": "videoDetail/videoDetail",
@ -527,17 +549,7 @@
// } // }
// } // }
// }, // },
// {
// "path": "patientVideo/patientVideo",
// "style": {
// "navigationStyle": "custom",
// "navigationBarRightButton":{ "hide": true},
// "navigationBarTitleText": "uni-app分页",
// "app": {
// "bounce": "none"
// }
// }
// },
// { // {
// "path": "selectPatient/selectPatient", // "path": "selectPatient/selectPatient",

View File

@ -703,31 +703,31 @@
let url = ""; let url = "";
if (name == "我的患者") { if (name == "我的患者") {
url = "/pages_app/patientMsg/patientMsg"; url = "/pages_app/patientMsg/patientMsg";
sendAppMsgEvent('goPatientMsg', name); //sendAppMsgEvent('goPatientMsg', name);
} else if (name == "肝胆视频") { } else if (name == "肝胆视频") {
url = "/pages_app/video/video"; url = "/pages_app/video/video";
sendAppMsgEvent('goGdVideo', name); //sendAppMsgEvent('goGdVideo', name);
} else if (name == "公益咨询") { } else if (name == "公益咨询") {
url = "/pages_app/consult/consult"; url = "/pages_app/consult/consult";
sendAppMsgEvent('goFreeConsult', name); //sendAppMsgEvent('goFreeConsult', name);
} else if (name == "指南杂志") { } else if (name == "指南杂志") {
url = "/pages_app/zhinan/zhinan"; url = "/pages_app/zhinan/zhinan";
sendAppMsgEvent('goGuide', name); //sendAppMsgEvent('goGuide', name);
} else if (name == "肝胆新闻") { } else if (name == "肝胆新闻") {
url = "/pages_app/newsList/newsList"; url = "/pages_app/newsList/newsList";
sendAppMsgEvent('goGdNews', name); //sendAppMsgEvent('goGdNews', name);
} else if (name == "肝胆课件") { } else if (name == "肝胆课件") {
url = "/pages_app/ppt/ppt"; url = "/pages_app/ppt/ppt";
sendAppMsgEvent('goGdPpt', name); //sendAppMsgEvent('goGdPpt', name);
} else if (name == "精品课") { } else if (name == "精品课") {
url = "/pages_course/course/course"; url = "/pages_course/course/course";
sendAppMsgEvent('goCourse', name); //sendAppMsgEvent('goCourse', name);
} else if (name == "积分商城") { } else if (name == "积分商城") {
url = "/pages_goods/pointMall/pointMall"; url = "/pages_goods/pointMall/pointMall";
sendAppMsgEvent('goPointMall', name); //sendAppMsgEvent('goPointMall', name);
} else if (name == "我的福利") { } else if (name == "我的福利") {
url = "/pages_app/myWelfare/myWelfare"; url = "/pages_app/myWelfare/myWelfare";
sendAppMsgEvent('goMyWelfare', name); //sendAppMsgEvent('goMyWelfare', name);
} else if (name == "专题e站") { } else if (name == "专题e站") {
const encoded = encodeURIComponent( const encoded = encodeURIComponent(
"https://wx.igandan.com/Esite/index.htm#/home?fromtype=doctor" "https://wx.igandan.com/Esite/index.htm#/home?fromtype=doctor"
@ -738,9 +738,11 @@
}); });
} else { } else {
url = "/pages_app/myApplication/myApplication"; url = "/pages_app/myApplication/myApplication";
sendAppMsgEvent('goMyApplication', name); // sendAppMsgEvent('goMyApplication', name);
} }
navTo({
url: url,
});
}; };
const sendAppMsg = () => { const sendAppMsg = () => {
uni.sendNativeEvent('openPage', { uni.sendNativeEvent('openPage', {

View File

@ -115,9 +115,10 @@
</view> </view>
<!-- 底部区域信息页为下载条评论页为上传图片+输入+发送 --> <!-- 底部区域信息页为下载条评论页为上传图片+输入+发送 -->
<!-- <view v-if="activeTab === 'info'" class="bottom-download" @click="onDownload"> <view v-if="activeTab === 'info'" class="bottom-download" @click="onDownload">
<text class="download-text">点击下载(限时<text class="discount">5</text>仅需{{videoInfo.point}}积分)</text> <text class="download-text" v-if="!hasDownload">点击下载<text v-if="!isVideoDownloadRecord">(限时<text class="discount">5</text>仅需{{videoInfo.point}}积分)</text></text>
</view> --> <text class="download-text" v-else>查看缓存</text>
</view>
<view v-if="activeTab !== 'info'" class="bottom-comment"> <view v-if="activeTab !== 'info'" class="bottom-comment">
<input <input
class="comment-input" class="comment-input"
@ -205,6 +206,10 @@ const notEnoughContent = ref("");
const welfareNum = ref(0); const welfareNum = ref(0);
const showVideo = ref(false); const showVideo = ref(false);
const videoWidth = ref(375); const videoWidth = ref(375);
const hasDownload = ref(false);
let downList = uni.getStorageSync('downLoadVideo') || [];
const downLoadList = ref(downList);
//import DomVideoPlayer from 'uniapp-video-player' //import DomVideoPlayer from 'uniapp-video-player'
const notEnoughConfirm = () => { const notEnoughConfirm = () => {
notEnoughVisible.value = false; notEnoughVisible.value = false;
@ -226,6 +231,7 @@ const toCollection = () => {
const networkConfirm = () => { const networkConfirm = () => {
networkVisible.value = false; networkVisible.value = false;
pointVisible.value = true; pointVisible.value = true;
downAndSave(videoSrc.value,video_uuid.value);
}; };
const addVideoWatchRecord = async () => { const addVideoWatchRecord = async () => {
const res = await api.addVideoWatchRecord({ const res = await api.addVideoWatchRecord({
@ -253,7 +259,7 @@ const videoDetail = async () => {
if (res.code == 200) { if (res.code == 200) {
const userInfo = uni.getStorageSync("userInfo"); const userInfo = uni.getStorageSync("userInfo");
videoInfo.value = res.video; videoInfo.value = res.video;
hasDownload.value = downLoadList.value.includes(video_uuid.value);
let vid = res.video.polyv_uuid; let vid = res.video.polyv_uuid;
let uuid = vid.substring(0, 10); let uuid = vid.substring(0, 10);
let index = vid.lastIndexOf("_"); let index = vid.lastIndexOf("_");
@ -294,9 +300,27 @@ const VideoDownloadRecord = async () => {
const res = await api.isVideoDownloadRecord({ video_uuid: video_uuid.value }); const res = await api.isVideoDownloadRecord({ video_uuid: video_uuid.value });
if (res.code == 200) { if (res.code == 200) {
isVideoDownloadRecord.value = res.result == 0 ? false : true; isVideoDownloadRecord.value = res.result == 0 ? false : true;
console.log(isVideoDownloadRecord.value);
} }
}; };
const downAndSave = (url,uuid) => {
//let url='https://view.xdocin.com/view?src='+encodeURIComponent(pdfUrl);
uni.downloadFile({
url: url,
success: (res) => {
if (res.statusCode === 200) {
let index = downLoadList.value.find(cell => uuid == cell);
if (!index) {
downLoadList.value.push(item.uuid);
uni.setStorageSync('downLoadVideo', downLoadList.value);
};
}
},
});
};
const getWelfareNum = async () => { const getWelfareNum = async () => {
const res = await api.getWelfareNum({ const res = await api.getWelfareNum({
type: 1, type: 1,
@ -329,6 +353,7 @@ onShow(() => {
} }
videoDetail(); videoDetail();
uni.hideLoading(); uni.hideLoading();
}); });
const shareRef = ref(); const shareRef = ref();
@ -545,6 +570,7 @@ const payVideoDownload = async () => {
notEnoughContent.value = `您的积分不足,是否购买积分?`; notEnoughContent.value = `您的积分不足,是否购买积分?`;
} }
}; };
const onDownload = () => { const onDownload = () => {
console.log(isVideoDownloadRecord.value); console.log(isVideoDownloadRecord.value);
if (!isVideoDownloadRecord.value) { if (!isVideoDownloadRecord.value) {
@ -563,9 +589,14 @@ const onDownload = () => {
}, },
}); });
} else { } else {
if(hasDownload.value) {
navTo({ navTo({
url: "/pages_app/myDownLoad/myDownLoad", url: "/pages_app/myDownLoad/myDownLoad",
}); });
} else {
downAndSave(videoSrc.value,video_uuid.value);
}
} }
}; };
@ -752,7 +783,7 @@ overflow-y: scroll;
} }
.intro { .intro {
// background: #fff; // background: #fff;
padding: 24rpx 28rpx 40rpx; padding: 24rpx 28rpx 100rpx;
// margin-top: calc(var(--status-bar-height) + 44px + 220px + 88rpx); // margin-top: calc(var(--status-bar-height) + 44px + 220px + 88rpx);
// height: calc(100vh - var(--status-bar-height) - 44px - 220px - 88rpx); // height: calc(100vh - var(--status-bar-height) - 44px - 220px - 88rpx);
// overflow-y: scroll; // overflow-y: scroll;

View File

@ -59,6 +59,10 @@

View File

@ -1,19 +1,18 @@
let BASE_URL=''
if(process.env.UNI_PLATFORM =="h5"){ console.log('打印app');
if (window.location.href.indexOf('//casedata.igandan.com')>-1){ let BASE_URL='https://dev-app.igandan.com/app';
BASE_URL='https://dev-app.igandan.com/app' // try {
}else{ // const app = getApp({allowDefault: true});
BASE_URL='https://dev-app.igandan.com/app'
} // if(app.globalData.apiHost && app.globalData.apiHost.indexOf('dev')>-1){
}else if(process.env.UNI_PLATFORM =="mp-weixin"){ // BASE_URL='https://dev-app.igandan.com/app'
const { envVersion } = uni.getAccountInfoSync().miniProgram; // }else{
if (envVersion == "release") { // BASE_URL='https://app.igandan.com/app'
BASE_URL='https://app.igandan.com/app' // }
}else{ // console.log(app);
BASE_URL='https://dev-app.igandan.com/app' // } catch (error) {
}
}else{ // }
//BASE_URL='https://dev-app.igandan.com/app'
BASE_URL='https://app.igandan.com/app'
}
export default BASE_URL export default BASE_URL

View File

@ -1,19 +1,26 @@
let DOC_URL='' //const app = getApp();
if(process.env.UNI_PLATFORM =="h5"){ let DOC_URL='https://dev-doc.igandan.com/app/';
if (window.location.href.indexOf('//casedata.igandan.com')>-1){ // if(app.globalData.apiHost.indexOf('dev')>-1){
DOC_URL='https://doc.igandan.com/app/' // DOC_URL='https://dev-doc.igandan.com/app/'
}else{ // }else{
DOC_URL='https://dev-doc.igandan.com/app/' // DOC_URL='https://doc.igandan.com/app/'
} // }
}else if(process.env.UNI_PLATFORM =="mp-weixin"){ // if(process.env.UNI_PLATFORM =="h5"){
const { envVersion } = uni.getAccountInfoSync().miniProgram; // if (window.location.href.indexOf('//casedata.igandan.com')>-1){
if (envVersion == "release") { // DOC_URL='https://doc.igandan.com/app/'
DOC_URL='https://app.igandan.com/app/' // }else{
}else{ // DOC_URL='https://dev-doc.igandan.com/app/'
DOC_URL='https://dev-doc.igandan.com/app/' // }
} // }else if(process.env.UNI_PLATFORM =="mp-weixin"){
}else{ // const { envVersion } = uni.getAccountInfoSync().miniProgram;
//DOC_URL='https://dev-doc.igandan.com/app/' // if (envVersion == "release") {
DOC_URL='https://doc.igandan.com/app/' // DOC_URL='https://app.igandan.com/app/'
} // }else{
// DOC_URL='https://dev-doc.igandan.com/app/'
// }
// }else{
// //DOC_URL='https://dev-doc.igandan.com/app/'
// DOC_URL='https://doc.igandan.com/app/'
// }
export default DOC_URL export default DOC_URL

View File

@ -1,13 +1,19 @@
let OTHER_HOST='' let OTHER_HOST='https://dev-wx.igandan.com'
if(process.env.UNI_PLATFORM =="mp-weixin"){ //const app = getApp({allowDefault: true});
const { envVersion } = uni.getAccountInfoSync().miniProgram; // if(app.globalData.apiHost && app.globalData.apiHost.indexOf('dev')>-1){
if (envVersion == "release") { // OTHER_HOST='https://dev-wx.igandan.com'
OTHER_HOST='https://wx.igandan.com' // }else{
}else{ // OTHER_HOST='https://wx.igandan.com'
OTHER_HOST='https://dev-wx.igandan.com' // }
} // if(process.env.UNI_PLATFORM =="mp-weixin"){
}else{ // const { envVersion } = uni.getAccountInfoSync().miniProgram;
//OTHER_HOST='https://dev-wx.igandan.com' // if (envVersion == "release") {
OTHER_HOST='https://wx.igandan.com' // OTHER_HOST='https://wx.igandan.com'
} // }else{
// OTHER_HOST='https://dev-wx.igandan.com'
// }
// }else{
// //OTHER_HOST='https://dev-wx.igandan.com'
// OTHER_HOST='https://wx.igandan.com'
// }
export default OTHER_HOST export default OTHER_HOST

View File

@ -106,6 +106,10 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
if (loading) { if (loading) {
uni.hideLoading(); uni.hideLoading();
}; };
uni.showToast({
title: res.data.code,
icon: 'none'
});
if(url.indexOf('manager/getSystemTimeStamp')!=-1){ if(url.indexOf('manager/getSystemTimeStamp')!=-1){
e(res) e(res)
}else if (res.data.code == 200 || res.data.code == 1 || res.data.code == "1" || res.data.code == "200"){ }else if (res.data.code == 200 || res.data.code == 1 || res.data.code == "1" || res.data.code == "200"){
@ -133,12 +137,20 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
e(res.data) e(res.data)
}else if(res.data.code==35002){ }else if(res.data.code==35002){
n(res) n(res)
uni.sendNativeEvent('goTabbarPage', { uni.showToast({
msg: 'home' title: '登录过期,请重新登录',
},ret => { icon: 'none'
console.log(ret); });
}) uni.redirectTo({
plus.runtime.quit() url: '/pages_app/login/login'
});
// uni.sendNativeEvent('goTabbarPage', {
// msg: 'home'
// },ret => {
// console.log(ret);
// })
// plus.runtime.quit();
}else{ }else{
uni.showToast({ uni.showToast({
title: res.data.message, title: res.data.message,