Merge branch 'minJeecg' into 'master'

Min jeecg

See merge request cxcxt/jeecguniapp!30
This commit is contained in:
闵 年泽 2025-07-24 11:09:15 +08:00
commit 5247e096b3
11 changed files with 486 additions and 4 deletions

View File

@ -76,6 +76,8 @@ export default defineManifestConfig({
'<uses-feature android:name="android.hardware.camera"/>',
'<uses-permission android:name="android.permission.WRITE_SETTINGS"/>',
],
// app访 by
schemes : "szcxapp"
},
/* ios打包配置 */
ios: {},

View File

@ -7,18 +7,35 @@
import { getLocation, useUpdateApp } from '@/utils';
export default {
onLaunch: function (options) {
console.log(options)
//
useUpdateApp().checkAppUpdate()
//
getLocation()
// min
if (options.path && options.query) {
const path = options.path; // "pages/home/index"
const query = options.query; // {id: 123}
uni.navigateTo({
url: `/${path}?${Object.keys(query).map(k => `${k}=${query[k]}`).join('&')}`
});
}
},
onShow: function (options) {
var args= plus.runtime.arguments;
if(args){
// args
}
console.log(args)
//
//
//jiang 20250605
//
const publicPages = [
'/pages/sljd/index'
'/pages/sljd/index',
'/pages/linktoapp/index'
]
//

View File

@ -44,7 +44,8 @@
"abiFilters": [
"armeabi-v7a",
"arm64-v8a"
]
],
"schemes": "szcxapp"
},
"ios": {},
"sdkConfigs": {

View File

@ -85,6 +85,15 @@
"navigationBarTitleText": "主页"
}
},
{
"path": "pages/linktoapp/index",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "跳转到APP"
}
},
{
"path": "pages/message/message",
"type": "page",

View File

@ -0,0 +1,209 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '跳转到APP',
},
}
</route>
<template>
<view class="container">
<!-- 顶部占位 -->
<view class="placeholder"></view>
<!-- 主要内容 -->
<view class="content">
<view class="logo-area">
<uni-title :title="'数智产销APP'" type="h1" color="white" />
</view>
<view class="action-area">
<!-- 主跳转按钮 -->
<button class="action-btn" @click="handleJump">立即打开APP</button>
<uni-section title="自定义颜色" type="line" padding>
<uni-link href="szcxapp://pages/login/login" text="立即打开APP" color="#007BFF"></uni-link>
</uni-section>
<!-- 备用方案 -->
<view class="tips" v-if="showTips">
<text>跳转失败请尝试</text>
<button class="secondary-btn" @click="openInBrowser">在浏览器中打开</button>
<button class="secondary-btn" @click="copyDownloadLink">复制下载链接</button>
<button class="secondary-btn" @click="tryIntent">高级跳转方式</button>
</view>
<!-- 特殊浏览器指引 -->
<view class="guide" v-if="showGuide">
<text>操作指引</text>
<text>1. 点击右上角 按钮</text>
<text>2. 选择"在浏览器中打开"</text>
<text>3. 在浏览器中点击"打开APP"按钮</text>
</view>
</view>
</view>
<!-- 隐藏的iframe用于Intent跳转 -->
<iframe id="intentIframe" style="display:none;"></iframe>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const showTips = ref(false)
const showGuide = ref(false)
// Scheme
const trySchemeJump = () => {
window.location.href = 'szcxapp://pages/login/login'
setTimeout(() => {
if (!document.hidden) {
showTips.value = true
detectSpecialBrowser()
}
}, 1000)
}
// Android Intent
const tryIntentJump = () => {
const iframe = document.getElementById('intentIframe')
iframe.src = `intent://open#Intent;scheme=szcxapp;package=${getAppPackageName()};end`
// setTimeout(() => {
// if (!document.hidden) {
// openInBrowser()
// }
// }, 1000)
}
//
const getAppPackageName = () => {
return 'uni.UNI1B02D50' //
}
//
const handleJump = () => {
trySchemeJump()
}
//
const tryIntent = () => {
tryIntentJump()
}
//
const openInBrowser = () => {
window.open('https://36.112.48.190//jeecg-boot/sys/common/static//D://opt//AppUpdate//apk//数智产销.apk')
}
//
const copyDownloadLink = () => {
uni.setClipboardData({
data: 'https://36.112.48.190//jeecg-boot/sys/common/static//D://opt//AppUpdate//apk//数智产销.apk',
success: () => {
uni.showToast({
title: '链接已复制',
icon: 'success'
})
}
})
}
//
const detectSpecialBrowser = () => {
const ua = navigator.userAgent.toLowerCase()
if (ua.indexOf('micromessenger') > -1 ||
ua.indexOf('weibo') > -1 ||
ua.indexOf('qq') > -1 ||
ua.indexOf('your-app-internal-browser') > -1) {
showGuide.value = true
}
}
onLoad(() => {
//
trySchemeJump()
})
</script>
<style>
.container {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #0a2463;
background-image:
linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
background-size: 20rpx 20rpx;
background-position: 0 0, 10rpx 10rpx;
}
.placeholder {
height: var(--status-bar-height);
}
.content {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 40rpx;
}
.logo-area {
display: flex;
justify-content: center;
margin-top: 80rpx;
}
.action-area {
margin-bottom: 80rpx;
}
.action-btn {
background-color: #007aff;
color: white;
border-radius: 50rpx;
padding: 20rpx 40rpx;
font-size: 32rpx;
margin-bottom: 40rpx;
}
.secondary-btn {
background-color: transparent;
color: #007aff;
border: 1rpx solid #007aff;
border-radius: 50rpx;
padding: 15rpx 30rpx;
font-size: 28rpx;
margin: 10rpx 0;
}
.tips {
display: flex;
flex-direction: column;
align-items: center;
color: #ffffff;
margin-top: 40rpx;
}
.guide {
display: flex;
flex-direction: column;
color: #ffffff;
margin-top: 40rpx;
padding: 20rpx;
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10rpx;
}
.guide text {
margin-bottom: 10rpx;
font-size: 28rpx;
}
</style>

View File

@ -105,9 +105,9 @@
let pw = Base64.encode(encodeURIComponent(password.value))
loading.value = true
/*生产环境 begin */
// loginApi({ username: un, password: pw })
loginApi({ username: un, password: pw })
/*开发环境 begin */
loginApi({ username: userName.value, password: password.value, captcha: 'app' })
// loginApi({ username: userName.value, password: password.value, captcha: 'app' })
.then((res : any) => {
if (res.success) {
const { result } = res

View File

@ -8,6 +8,7 @@ interface NavigateToOptions {
"/pages/annotation/annotationDetail" |
"/pages/annotation/annotationList" |
"/pages/index/index" |
"/pages/linktoapp/index" |
"/pages/message/message" |
"/pages/more/more" |
"/pages/onlinePreview/detail" |

View File

@ -0,0 +1,17 @@
## 1.0.02021-11-19
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-link](https://uniapp.dcloud.io/component/uniui/uni-link)
## 1.1.72021-11-08
## 0.0.72021-09-03
- 修复 在 nvue 下不显示的 bug
## 0.0.62021-07-30
- 新增 支持自定义插槽
## 0.0.52021-06-21
- 新增 download 属性H5平台下载文件名
## 0.0.42021-05-12
- 新增 组件示例地址
## 0.0.32021-03-09
- 新增 href 属性支持 tel:|mailto:
## 0.0.22021-02-05
- 调整为uni_modules目录规范

View File

@ -0,0 +1,128 @@
<template>
<a v-if="isShowA" class="uni-link" :href="href"
:class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
:style="{color,fontSize:fontSize+'px'}" :download="download">
<slot>{{text}}</slot>
</a>
<!-- #ifndef APP-NVUE -->
<text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
:style="{color,fontSize:fontSize+'px'}" @click="openURL">
<slot>{{text}}</slot>
</text>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<text v-else class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}"
:style="{color,fontSize:fontSize+'px'}" @click="openURL">
{{text}}
</text>
<!-- #endif -->
</template>
<script>
/**
* Link 外部网页超链接组件
* @description uni-link是一个外部网页超链接组件在小程序内复制url在app内打开外部浏览器在h5端打开新网页
* @tutorial https://ext.dcloud.net.cn/plugin?id=1182
* @property {String} href 点击后打开的外部网页url
* @property {String} text 显示的文字
* @property {String} downlaod H5平台下载文件名
* @property {Boolean} showUnderLine 是否显示下划线
* @property {String} copyTips 在小程序端复制链接时显示的提示语
* @property {String} color 链接文字颜色
* @property {String} fontSize 链接文字大小
* @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link>
*/
export default {
name: 'uniLink',
props: {
href: {
type: String,
default: ''
},
text: {
type: String,
default: ''
},
download: {
type: String,
default: ''
},
showUnderLine: {
type: [Boolean, String],
default: true
},
copyTips: {
type: String,
default: '已自动复制网址,请在手机浏览器里粘贴该网址'
},
color: {
type: String,
default: '#999999'
},
fontSize: {
type: [Number, String],
default: 14
}
},
computed: {
isShowA() {
// #ifdef H5
this._isH5 = true;
// #endif
if ((this.isMail() || this.isTel()) && this._isH5 === true) {
return true;
}
return false;
}
},
created() {
this._isH5 = null;
},
methods: {
isMail() {
return this.href.startsWith('mailto:');
},
isTel() {
return this.href.startsWith('tel:');
},
openURL() {
// #ifdef APP-PLUS
if (this.isTel()) {
this.makePhoneCall(this.href.replace('tel:', ''));
} else {
plus.runtime.openURL(this.href);
}
// #endif
// #ifdef H5
window.open(this.href)
// #endif
// #ifdef MP
uni.setClipboardData({
data: this.href
});
uni.showModal({
content: this.copyTips,
showCancel: false
});
// #endif
},
makePhoneCall(phoneNumber) {
uni.makePhoneCall({
phoneNumber
})
}
}
}
</script>
<style>
/* #ifndef APP-NVUE */
.uni-link {
cursor: pointer;
}
/* #endif */
.uni-link--withline {
text-decoration: underline;
}
</style>

View File

@ -0,0 +1,87 @@
{
"id": "uni-link",
"displayName": "uni-link 超链接",
"version": "1.0.0",
"description": "uni-link是一个外部网页超链接组件在小程序内复制url在app内打开外部浏览器在h5端打",
"keywords": [
"uni-ui",
"uniui",
"link",
"超链接",
""
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@ -0,0 +1,11 @@
## Link 链接
> **组件名uni-link**
> 代码块: `uLink`
uni-link是一个外部网页超链接组件在小程序内复制url在app内打开外部浏览器在h5端打开新网页。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-link)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839