This commit is contained in:
zoujiandong 2025-12-03 17:31:08 +08:00
parent f4c8df1950
commit 22104881f1
13 changed files with 104 additions and 65 deletions

View File

@ -9,16 +9,17 @@
} }
}, },
"pages": [ "pages": [
{
"path": "pages/loading/loading", // {
"style": { // "path": "pages/loading/loading",
"navigationBarTitleText": "", // "style": {
"navigationStyle": "custom", // "navigationBarTitleText": "",
"app": { // "navigationStyle": "custom",
"bounce": "none" // "app": {
} // "bounce": "none"
} // }
}, // }
// },
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {

View File

@ -269,6 +269,7 @@ import { encryptAesEcb, decryptAesEcb } from "@/utils/aesEcb.js";
import { getCameraPermission } from "@/utils/permission.js"; import { getCameraPermission } from "@/utils/permission.js";
import topTip from "@/components/topTip/topTip.vue"; import topTip from "@/components/topTip/topTip.vue";
import lazyImg from "@/static/default_news_iv.png"; import lazyImg from "@/static/default_news_iv.png";
import isAndroid from "@/utils/platform.js";
// //
const isTimePopupShow = ref(false); const isTimePopupShow = ref(false);
const isLocationPopupShow = ref(false); const isLocationPopupShow = ref(false);
@ -438,23 +439,25 @@ const sendWebsocketMsg = (code) => {
// }); // });
}; };
const handleScanCode = () => { const handleScanCode = () => {
if(isAndroid){
getCameraPermission(scanCode); getCameraPermission(scanCode);
// uni.sendNativeEvent('getScanCodeAuth', { }else{
// msg: 'getScanCodeAuth' console.log('ios执行');
// }, ret => { uni.sendNativeEvent('getScanCodeAuth', {
// console.log('getScanCodeAuth'); msg: 'getScanCodeAuth'
// console.log(ret); }, ret => {
// if(ret.code==200){ console.log('getScanCodeAuth回调数据');
// scanCode() console.log(ret);
// }else{ if(ret.code==200){
// uni.showToast({ scanCode()
// title: '', }else{
// icon: 'none' uni.showToast({
// }); title: '请在iPhone的"设置-隐私-相机"中允许肝胆相照专家端访问相机',
// } icon: 'none'
// }) });
}
})
}
} }
const scanCode = () => { const scanCode = () => {
uni.scanCode({ uni.scanCode({

View File

@ -122,9 +122,9 @@
<view class="bottom-box"> <view class="bottom-box">
<view class="storage-info"> <view class="storage-info">
<text <text
>手机存储:总空间{{ storageInfo.total }}G/剩余{{ >手机存储:总空间{{ storageInfo.total }}/剩余{{
storageInfo.available storageInfo.available
}}G可用</text }}可用</text
> >
</view> </view>
<view class="footer-btn" v-if="isEditMode"> <view class="footer-btn" v-if="isEditMode">
@ -157,8 +157,8 @@ const selectedItems = ref([]);
const activeTab = ref("completed"); // completed: , downloading: const activeTab = ref("completed"); // completed: , downloading:
const isEditMode = ref(false); const isEditMode = ref(false);
const storageInfo = ref({ const storageInfo = ref({
total: "461.31", total: "461.31G",
available: "312.92", available: "312.92G",
}); });
const delTask=()=>{ const delTask=()=>{
if(selectedItems.value.length === 0){ if(selectedItems.value.length === 0){
@ -360,10 +360,15 @@ const getStorageInfo = () => {
// //
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform !== 'android') { if (uni.getSystemInfoSync().platform !== 'android') {
console.log('此方法仅适用于Android平台'); uni.sendNativeEvent('getSysSpace',{
return; msg: 'getSysSpace'
} },(res) => {
storageInfo.value = {
total: res.total,
available: res.available,
};
});
}else{
// 1. Android // 1. Android
const Environment = plus.android.importClass("android.os.Environment"); const Environment = plus.android.importClass("android.os.Environment");
const StatFs = plus.android.importClass("android.os.StatFs"); const StatFs = plus.android.importClass("android.os.StatFs");
@ -402,14 +407,17 @@ const getStorageInfo = () => {
// //
storageInfo.value = { storageInfo.value = {
total: totalSizeInGB, total: totalSizeInGB+"G",
available: availableSizeInGB, available: availableSizeInGB+"G",
}; };
} catch (error) { } catch (error) {
console.error('获取存储信息时发生错误:', error); console.error('获取存储信息时发生错误:', error);
return null; return null;
} }
}
// #endif // #endif
}; };

View File

@ -1,13 +1,14 @@
<template> <template>
<view class="reply-page"> <view class="reply-page">
<!-- 导航栏 --> <!-- 导航栏 -->
<view class="navbox">
<view class="status_bar"></view>
<uni-nav-bar <uni-nav-bar
left-icon="left" left-icon="left"
title="回复" title="回复"
@clickLeft="goBack" @clickLeft="goBack"
fixed
color="#8B2316" color="#8B2316"
height="180rpx"
:border="false" :border="false"
backgroundColor="#eee" backgroundColor="#eee"
> >
@ -17,6 +18,7 @@
</view> </view>
</template> </template>
</uni-nav-bar> </uni-nav-bar>
</view>
<!-- 主内容区域 --> <!-- 主内容区域 -->
<view class="main-content"> <view class="main-content">
@ -86,7 +88,7 @@ onUnmounted(() => {
// //
const goBack = () => { const goBack = () => {
uni.navigateBack() uni.navigateBack();
} }
const confirmReply = async () => { const confirmReply = async () => {
@ -300,8 +302,9 @@ $blue: #007aff;
// //
.main-content { .main-content {
flex: 1; flex: 1;
padding: 20px 16px; padding: 10px 16px;
background-color: #fff;
margin-top: calc(var(--status-bar-height) + 44px);
.input-container { .input-container {
position: relative; position: relative;
background-color: $white; background-color: $white;

View File

@ -27,7 +27,7 @@
</view> </view>
<!-- <video <!-- <video
v-if="showVideo" v-if="showVideo && !isAndroid"
class="player-wrapper" class="player-wrapper"
:style="{width: videoWidth + 'px'}" :style="{width: videoWidth + 'px'}"
:src="videoSrc" :src="videoSrc"
@ -210,6 +210,7 @@ import sinaImg from "@/static/share_sina.png";
import wxImg from "@/static/share_weixin.png"; import wxImg from "@/static/share_weixin.png";
import friendImg from "@/static/share_wxc.png"; import friendImg from "@/static/share_wxc.png";
import logoImg from "@/static/weiboShare.png"; import logoImg from "@/static/weiboShare.png";
import isAndroid from "@/utils/platform.js";
import api from "@/api/api"; import api from "@/api/api";
import docUrl from "@/utils/docUrl"; import docUrl from "@/utils/docUrl";
import navTo from "@/utils/navTo"; import navTo from "@/utils/navTo";
@ -960,6 +961,7 @@ $theme-color: #8b2316;
position: relative; position: relative;
top: calc(var(--status-bar-height) + 44px); top: calc(var(--status-bar-height) + 44px);
z-index: 0; z-index: 0;
height:220px;
overflow: hidden; overflow: hidden;
} }
.share-img { .share-img {

View File

@ -134,8 +134,10 @@ onLoad((query) => {
summary.value = shareTitle.value; summary.value = shareTitle.value;
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS
const resInfo = uni.getSystemInfoSync(); // 使 uni.getSystemInfo({...}).then(res => {...})
let statusBarHeight = resInfo.statusBarHeight;
let wv = plus.webview.create("", "custom-webview", { let wv = plus.webview.create("", "custom-webview", {
top: "140rpx", top: (statusBarHeight+44) + "px",
bottom:"0rpx", bottom:"0rpx",
}); });
@ -148,7 +150,7 @@ onLoad((query) => {
currentWebview.append(wv); currentWebview.append(wv);
setTimeout(function () { setTimeout(function () {
wv = currentWebview.children()[0]; wv = currentWebview.children()[0];
wv.setStyle({ top: 80,height: height- 80,bottom:0,scalable:true, videoFullscreen: 'landscape',zIndex:-1}); wv.setStyle({ top: (statusBarHeight+44)+"px",height: height- 80,bottom:0,scalable:true, videoFullscreen: 'landscape',zIndex:-1});
}, 300); // }, 300); //
wv.onloaded = (e) => { wv.onloaded = (e) => {
@ -165,7 +167,7 @@ onLoad((query) => {
console.log('键盘高度',res.height); console.log('键盘高度',res.height);
setTimeout(function() { setTimeout(function() {
wv.setStyle({ //web-viewpx wv.setStyle({ //web-viewpx
top:80, top:(statusBarHeight+44)+"px",
videoFullscreen: 'landscape', videoFullscreen: 'landscape',
height: height-res.size.windowHeight+100, height: height-res.size.windowHeight+100,
scalable: true, //webview scalable: true, //webview
@ -178,7 +180,7 @@ onLoad((query) => {
} else { } else {
setTimeout(function() { setTimeout(function() {
wv.setStyle({ //web-viewpx wv.setStyle({ //web-viewpx
top:80, top:(statusBarHeight+44)+"px",
height:height-80, height:height-80,
videoFullscreen: 'landscape', videoFullscreen: 'landscape',
scalable: true, //webview scalable: true, //webview
@ -346,11 +348,16 @@ function createNativePopup() {
console.log(`图标 ${idx} (${it.text}): left=${left}, itemW=${itemW.toFixed(2)}, iconLeft=${iconLeftPx}, iconTop=${iconTopPx}, iconSize=${iconSizePx}`); console.log(`图标 ${idx} (${it.text}): left=${left}, itemW=${itemW.toFixed(2)}, iconLeft=${iconLeftPx}, iconTop=${iconTopPx}, iconSize=${iconSizePx}`);
// //
//
// - Android 使 convertLocalFileSystemURL file://
// - iOS plus.nativeObj.View.drawBitmap file://
// 使 "_www"
// 使 "_www/static/xxx.png" Android iOS
let iconPath = null; let iconPath = null;
try { try {
// 使
const iconFile = iconFiles[idx]; const iconFile = iconFiles[idx];
iconPath = plus.io.convertLocalFileSystemURL('_www/static/' + iconFile); // 使 _www iOS file://
iconPath = '_www/static/' + iconFile;
console.log(`图标 ${it.text} 路径: ${iconPath}`); console.log(`图标 ${it.text} 路径: ${iconPath}`);
} catch (e) { } catch (e) {
console.log('构建图标路径失败:', e); console.log('构建图标路径失败:', e);

View File

@ -12,7 +12,7 @@
:object-fit="objectFit" :object-fit="objectFit"
:style="{width: addUnit(videoWidth), height: addUnit(videoHeight)}" :style="{width: addUnit(videoWidth), height: addUnit(videoHeight)}"
@play="play" @play="play"
@pause="emit('pause')" @pause="pauseVideo"
@ended="ended" @ended="ended"
@error="(e) => emit('playError', e)" @error="(e) => emit('playError', e)"
@timeupdate="timeupdate" @timeupdate="timeupdate"
@ -321,6 +321,11 @@
state.enablePlayGesture = true state.enablePlayGesture = true
emit('play', e) emit('play', e)
}; };
function pauseVideo() {
state.isPlay = false;
emit('pause',e)
}
/** /**
* 视频播放进度变化 - 会触发emit事件 * 视频播放进度变化 - 会触发emit事件
* @param {Object} e event.detail = {currentTime, duration} * @param {Object} e event.detail = {currentTime, duration}

View File

@ -1,7 +1,7 @@
console.log('打印app'); console.log('打印app');
//let BASE_URL='https://dev-app.igandan.com/app'; let BASE_URL='https://dev-app.igandan.com/app';
let BASE_URL='https://app.igandan.com/app' //let BASE_URL='https://app.igandan.com/app'
// try { // try {
// const app = getApp({allowDefault: true}); // const app = getApp({allowDefault: true});

View File

@ -1,6 +1,6 @@
//const app = getApp({allowDefault: true}); //const app = getApp({allowDefault: true});
//let DOC_URL='https://dev-doc.igandan.com/app/'; let DOC_URL='https://dev-doc.igandan.com/app/';
let DOC_URL='https://doc.igandan.com/app/' //let DOC_URL='https://doc.igandan.com/app/'
// if(app.globalData.apiHost.indexOf('dev')>-1){ // if(app.globalData.apiHost.indexOf('dev')>-1){
// DOC_URL='https://dev-doc.igandan.com/app/' // DOC_URL='https://dev-doc.igandan.com/app/'
// }else{ // }else{

View File

@ -17,11 +17,7 @@ function navTo(obj) {
token = uni.getStorageSync('DEV_AUTH_TOKEN_App'); token = uni.getStorageSync('DEV_AUTH_TOKEN_App');
} }
}else{ }else{
if (BASE_URL.indexOf('dev') == -1) {
token = uni.getStorageSync('AUTH_TOKEN_App'); token = uni.getStorageSync('AUTH_TOKEN_App');
} else {
token = uni.getStorageSync('DEV_AUTH_TOKEN_App');
}
} }
if (!token) { if (!token) {
// let page_url = pageUrl(); // let page_url = pageUrl();

View File

@ -1,5 +1,5 @@
//let OTHER_HOST='https://dev-wx.igandan.com' let OTHER_HOST='https://dev-wx.igandan.com'
let OTHER_HOST='https://wx.igandan.com' //let OTHER_HOST='https://wx.igandan.com'
//const app = getApp({allowDefault: true}); //const app = getApp({allowDefault: true});
// if(app.globalData.apiHost && app.globalData.apiHost.indexOf('dev')>-1){ // if(app.globalData.apiHost && app.globalData.apiHost.indexOf('dev')>-1){
// OTHER_HOST='https://dev-wx.igandan.com' // OTHER_HOST='https://dev-wx.igandan.com'

13
utils/platform.js Normal file
View File

@ -0,0 +1,13 @@
let isAndroid = false;
uni.getSystemInfo({
success: (res) => {
console.log(res);
if(res.os == 'android'){
isAndroid = true;
}else{
isAndroid = false;
}
}
})
export default isAndroid

View File

@ -40,6 +40,7 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
token = uni.getStorageSync('AUTH_TOKEN_App'); token = uni.getStorageSync('AUTH_TOKEN_App');
} }
let header = { let header = {
'content-type': contentType, 'content-type': contentType,
} }