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,
dotNumber: {
}
},
apiHost: 'https://dev-app.igandan.com/app',
//BASE_URL='https://dev-app.igandan.com/app'
},
onLaunch(options) {
//uni.setStorageSync('apiHost', 'value')
console.log('打印options');
console.log(options);
if (options && options.referrerInfo.extraData && options.referrerInfo.extraData.token) {
uni.setStorageSync("AUTH_TOKEN_App", options.referrerInfo.extraData.token);
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) {
uni.navigateTo({

View File

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

View File

@ -9,16 +9,16 @@
}
},
"pages": [
{
"path": "pages/loading/loading",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"app": {
"bounce": "none"
}
}
},
// {
// "path": "pages/loading/loading",
// "style": {
// "navigationBarTitleText": "",
// "navigationStyle": "custom",
// "app": {
// "bounce": "none"
// }
// }
// },
{
"path": "pages/index/index",
"style": {
@ -281,6 +281,28 @@
}
}
},
{
"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",
"style": {
@ -527,17 +549,7 @@
// }
// }
// },
// {
// "path": "patientVideo/patientVideo",
// "style": {
// "navigationStyle": "custom",
// "navigationBarRightButton":{ "hide": true},
// "navigationBarTitleText": "uni-app分页",
// "app": {
// "bounce": "none"
// }
// }
// },
// {
// "path": "selectPatient/selectPatient",

View File

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

View File

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

View File

@ -59,6 +59,10 @@

View File

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

View File

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

View File

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

View File

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