5 Commits

Author SHA1 Message Date
@fawn-nine
72190b811d ios也可以获得参数 2023-11-28 17:24:17 +08:00
@fawn-nine
ecdc8a85ec 安卓接受参数,ios接受不到参数 2023-11-28 14:55:02 +08:00
@fawn-nine
f625109e2d 接受其他app传递的参数 2023-11-27 16:00:43 +08:00
@fawn-nine
d30d3553a1 .. 2023-11-24 17:27:17 +08:00
@fawn-nine
4440d4facb 初步效果 2023-11-23 15:01:30 +08:00
5 changed files with 126 additions and 58 deletions

24
App.vue
View File

@@ -19,9 +19,9 @@
import Vue from 'vue'
export default {
data(){
return{
platform:null, // 系统
data() {
return {
platform: null, // 系统
}
},
onLaunch: function(e) {
@@ -192,16 +192,28 @@
});
}
// #endif
// #ifdef APP-PLUS
setTimeout(function(){
var args = plus.runtime.arguments;
if (args) {
// 处理args参数如直达到某新页面等
console.log(args)
}
},300)
// #endif
},
onHide: function(){
plus.runtime.arguments = ''
console.log('清空')
},
onHide: function() {},
destroyed() {
store.commit('setUserInfo', {
'playFlag': true
})
console.log('页面销毁')
},
methods: {
}
methods: {}
};
</script>

View File

@@ -22,7 +22,7 @@
"prompt" : "template",
"template" : {
"title" : "用户协议和隐私政策",
"message" : "请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href='https://main.nuttyreading.com/agreement.html'>《用户协议》</a>和<a href='https://main.nuttyreading.com/privacy.html'>《隐私协议》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"message" : "请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href='https://www.nuttyreading.com/agreement.html'>《用户协议》</a>和<a href='https://www.nuttyreading.com/privacy.html'>《隐私协议》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意",
"buttonRefuse" : "暂不同意"
}
@@ -78,7 +78,8 @@
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"minSdkVersion" : 21,
"targetSdkVersion" : 30
"targetSdkVersion" : 30,
"schemes" : "nuttyreading"
},
"sdkConfigs" : {
"ad" : {},
@@ -114,7 +115,9 @@
"com.apple.developer.associated-domains" : [ "applinks:verification.nuttyreading.com" ]
}
},
"idfa" : false
"idfa" : false,
"urltypes" : "nuttyreading",
"urlschemewhitelist" : "everhealth"
},
"icons" : {
"android" : {

View File

@@ -561,13 +561,13 @@
"text": "我"
}
]
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "", //模式名称
"path": "", //启动页面,必选
"query": "" //启动参数在页面的onLoad函数里面得到
}]
}
// "condition": { //模式配置,仅开发期间生效
// "current": 0, //当前激活的模式(list 的索引项)
// "list": [{
// "name": "", //模式名称
// "path": "", //启动页面,必选
// "query": "" //启动参数在页面的onLoad函数里面得到
// }]
// }
}

View File

@@ -58,6 +58,11 @@
<view class="nav_list" @click="switchTab('../bookShop/orderList')">
<text>我的订单</text>
</view>
<view class="nav_list" @click="appJump()" v-if="this.osName != ''">
<text>打开一路健康</text>
</view>
<!-- <view class="nav_list" @click="onPageJump('../clock/clockList')">
<text>我的打卡</text>
</view> -->
@@ -123,18 +128,20 @@
import $http from '@/config/requestConfig.js';
// import appShare, { closeShare } from '@/uni_modules/zhouWei-APPshare/js_sdk/appShare';
import {
mapState,mapMutations
mapState,
mapMutations
} from 'vuex';
export default {
data() {
return {
showEbook:false, // 显示电子书相关
showEbook: false, // 显示电子书相关
userMes: {},
signShow: false,
signContent: '是否要退出登录?',
playData:{},
isAndorid:true,
platform : null, // 设备系统
playData: {},
isAndorid: true,
platform: null, // 设备系统
osName: '', // 系统名称
};
},
//第一次加载
@@ -144,6 +151,7 @@
// #ifdef APP-PLUS
this.getOS()
this.platform = uni.getSystemInfoSync().platform
this.osName = plus.os.name
// console.log('操纵系统',this.platform)
// #endif
},
@@ -155,6 +163,7 @@
// 隐藏原生的tabbar
uni.hideTabBar();
this.getData();
},
components: {
musicPlay
@@ -162,20 +171,62 @@
//方法
methods: {
...mapMutations(['setUserInfo']),
// app 跳转
appJump() {
// console.log(plus.os.name,'系统名称')
if (this.osName == "Android") { //安卓
if (plus.runtime.isApplicationExist({ //查看安卓系统手机有没有下载这款app
pname: 'cn.com.everhealth', //B款app云打包的包名
})) { //安装了app
plus.runtime.launchApplication({ //打开app
pname: "cn.com.everhealth", //B款app云打包的包名
extra: {
key1: "我是三方app携带的参数激活99" //B款app配置的schemes+云打包的包名
},
function(e) {
console.log("Open system default browser failed: " + e.message);
}
})
} else { //未安装app
plus.runtime.openURL('https://a.app.qq.com/o/simple.jsp?pkgname=cn.com.everhealth', function(res) {
//进入后台小哥哥给我的应用宝下载链接,让你们后台给你
//这链接会判断你手机是ios还是AndroidAndroid进入应用宝下载app
//跟下面的是一个链接
console.log(res);
});
}
} else if (this.osName == "iOS") { //苹果
//因为ios查不到B款app在ios系统手机里面其实下载了也是检测不到所以就不检测了
//直接打开B款appB款app没有的话会进入回调报错我们在回调去打开下载链接
plus.runtime.launchApplication({
action: "everhealth://"
}, function(e) {
plus.runtime.openURL('https://a.app.qq.com/o/simple.jsp?pkgname=cn.com.everhealth',
function(res) {
//进入后台小哥哥给我的appStore下载app链接让你们后台给你
//这链接会判断你手机是ios还是Androidios进入应用宝下载app
//跟上面的是一个链接
console.log(res);
});
});
}
},
// 获得操作系统
getOS(){
getOS() {
let oprateOs = ''
oprateOs = uni.getSystemInfoSync().platform
// console.log(oprateOs)
if(oprateOs == 'android'){
if (oprateOs == 'android') {
this.isAndorid = true
}else{
} else {
this.isAndorid = false
}
},
haveSelected(data){
console.log(data,' 选择的是')
if(data.index == 0){
haveSelected(data) {
console.log(data, ' 选择的是')
if (data.index == 0) {
// 分享到好友
uni.share({
provider: "weixin",
@@ -185,14 +236,14 @@
title: "疯子读书",
summary: "我正在使用疯子读书提升自己,赶紧跟我一起来体验吧!",
imageUrl: "static/fengziIcon.jpg",
success: function (res) {
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
}else if(data.index == 1){
} else if (data.index == 1) {
// 分享到朋友圈
uni.share({
provider: "weixin",
@@ -202,16 +253,16 @@
title: "疯子读书",
summary: "我正在使用疯子读书提升自己,赶紧跟我一起来体验吧!",
imageUrl: "static/fengziIcon.jpg",
success: function (res) {
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function (err) {
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
}
},
switchTab(url){
switchTab(url) {
uni.switchTab({
url: url
});
@@ -234,23 +285,23 @@
},
// 新写分享
newOnShare(){
newOnShare() {
this.$refs.share.open()
},
// 注销账户
logout(){
logout() {
let that = this
uni.showModal({
title: '提示',
content: '确定要注销当前账户吗?',
success: function (res) {
success: function(res) {
if (res.confirm) {
uni.showModal({
title: '提示',
showCancel:false,
showCancel: false,
content: `注销申请已提交成功,请联系客服进行后续操作022-24142321`,
success: function (res1) {
success: function(res1) {
if (res1.confirm) {
that.signOut()
}
@@ -270,7 +321,7 @@
})
},
onPageJump(url) {
console.log(url,'url')
console.log(url, 'url')
uni.navigateTo({
url: url
});
@@ -280,7 +331,9 @@
// 退出登录
signOut() {
this.signShow = false
this.setUserInfo({'token': null})
this.setUserInfo({
'token': null
})
uni.reLaunch({
url: '../user/login'
});

Binary file not shown.