diff --git a/manifest.json b/manifest.json index 1ab7a77..ff03837 100644 --- a/manifest.json +++ b/manifest.json @@ -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" : { diff --git a/pages/peanut/mine.vue b/pages/peanut/mine.vue index 8a330e0..d82ec70 100644 --- a/pages/peanut/mine.vue +++ b/pages/peanut/mine.vue @@ -57,7 +57,11 @@ 我的订单 - + + + 打开一路健康 + + @@ -85,10 +89,10 @@ 地址管理 - + + --> 分享App @@ -102,7 +106,7 @@ 注销帐号 - + - + @@ -123,27 +127,30 @@ 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: null, // 系统名称 }; }, //第一次加载 onLoad(e) { // 隐藏原生的tabbar - uni.hideTabBar(); + uni.hideTabBar(); // #ifdef APP-PLUS - this.getOS() + this.getOS() this.platform = uni.getSystemInfoSync().platform + this.osName = plus.os.name // console.log('操纵系统',this.platform) // #endif }, @@ -155,27 +162,70 @@ // 隐藏原生的tabbar uni.hideTabBar(); this.getData(); + }, - components: { + components: { musicPlay }, //方法 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还是Android,Android进入应用宝下载app + //跟下面的是一个链接 + console.log(res); + }); + } + } else if (this.osName == "iOS") { //苹果 + //因为ios查不到B款app在ios系统手机里面,其实下载了,也是检测不到,所以就不检测了 + //直接打开B款app,B款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还是Android,ios进入应用宝下载app + //跟上面的是一个链接 + console.log(res); + }); + }); + } + + }, // 获得操作系统 - getOS(){ - let oprateOs = '' + 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 +235,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 +252,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 }); @@ -232,25 +282,25 @@ } }, - + // 新写分享 - 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 +320,7 @@ }) }, onPageJump(url) { - console.log(url,'url') + console.log(url, 'url') uni.navigateTo({ url: url }); @@ -280,7 +330,9 @@ // 退出登录 signOut() { this.signShow = false - this.setUserInfo({'token': null}) + this.setUserInfo({ + 'token': null + }) uni.reLaunch({ url: '../user/login' }); @@ -447,4 +499,4 @@ border-bottom: 0; } } - + \ No newline at end of file