初步效果

This commit is contained in:
@fawn-nine
2023-11-23 15:01:30 +08:00
parent 493d74d025
commit 4440d4facb
2 changed files with 94 additions and 39 deletions

View File

@@ -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

@@ -58,6 +58,10 @@
<view class="nav_list" @click="switchTab('../bookShop/orderList')">
<text>我的订单</text>
</view>
<view class="nav_list" @click="appJump()" v-if="this.osName !== null">
<text>打开一路健康</text>
</view>
<!-- <view class="nav_list" @click="onPageJump('../clock/clockList')">
<text>我的打卡</text>
</view> -->
@@ -123,7 +127,8 @@
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() {
@@ -135,6 +140,7 @@
playData: {},
isAndorid: true,
platform: null, // 设备系统
osName: null, // 系统名称
};
},
//第一次加载
@@ -144,6 +150,7 @@
// #ifdef APP-PLUS
this.getOS()
this.platform = uni.getSystemInfoSync().platform
this.osName = plus.os.name
// console.log('操纵系统',this.platform)
// #endif
},
@@ -155,6 +162,7 @@
// 隐藏原生的tabbar
uni.hideTabBar();
this.getData();
},
components: {
musicPlay
@@ -162,6 +170,48 @@
//方法
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: {
url: "everhealth://cn.com.everhealth" //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() {
let oprateOs = ''
@@ -280,7 +330,9 @@
// 退出登录
signOut() {
this.signShow = false
this.setUserInfo({'token': null})
this.setUserInfo({
'token': null
})
uni.reLaunch({
url: '../user/login'
});