提交 143311fe 编写于 作者: tao.wu's avatar tao.wu

按钮隐藏显示与否逻辑修改,根据APP版本号反馈按钮点击信息

上级 645e55f3
......@@ -37,3 +37,36 @@
}
}
}
.version-toast{
width: 320px;
.van-dialog__header{
font-size:18px;
color:rgba(51,51,51,1);
line-height:18px;
padding-top: 30px;
}
.van-dialog__content{
.van-dialog__message{
font-size:14px;
color:rgba(103,104,105,1);
line-height:21px;
}
}
.van-dialog__footer{
border: .5px solid rgba(0,0,0,.3);
.van-dialog__cancel{
.van-button__text{
font-size:17px;
color:rgba(151,152,153,1);
line-height:24px;
}
}
.van-dialog__confirm{
.van-button__text{
font-size:17px;
color:rgba(68,146,132,1);
line-height:24px;
}
}
}
}
\ No newline at end of file
......@@ -19,8 +19,8 @@
</div>
</div>
<div class="btn-appoint btn-app-share" id="imgHeight3">
<img v-if="!remindStatus" @click="setRemind" src="../assets/img/btn_appoint.png" />
<template v-else>
<img v-if="showRemindBtn()" @click="setRemind" src="../assets/img/btn_appoint.png" />
<template v-if="remindStatus">
<img src="../assets/img/btn_appointed.png">
<div class="appoint-time">12月16号我们会提示你参加活动</div>
</template>
......@@ -59,7 +59,7 @@
<div class="abs-btn">
<img @click="ruleLink" src="../assets/img/btn_rules.png">
</div>
<div v-if="showFixed && !remindStatus" @click="setRemind" class="fix-btn">
<div v-if="showFixed && showRemindBtn()" @click="setRemind" class="fix-btn">
<div>开赛时提醒我</div>
</div>
</section>
......@@ -83,14 +83,14 @@ export default {
},
data() {
return {
canClick: false,
showWxMask: false,
showFixed: false,
remindStatus: false,
doctorIdCnt: '',
hospitalIdCnt: '',
scrollVal: 0,
isWeb: false,
remindStatus: false,
canClick: false,
shareObj: {}
}
},
......@@ -114,6 +114,9 @@ export default {
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.isWeb = this.$rocNative.isWeb;
// this.isWeb = false;
// this.remindStatus = false;
// this.canClick = true;
// 通过获取token,初始化数据
this.$rocNative.getToken().then(res => {
const { userToken } = res;
......@@ -154,6 +157,19 @@ export default {
})
},
methods: {
showRemindBtn(){
let flag;
if(this.isWeb){
flag = true;
}else{
if(this.canClick && !this.remindStatus){
flag = true;
}else{
flag = false;
}
}
return flag;
},
// 处理滚动按钮悬浮事件
scrollHandle() {
const _self = this;
......@@ -228,11 +244,13 @@ export default {
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
}
this.$rocNative.gotoInstitutionalReview({ url: window.location.href });
});
});
} else { // 除了1都是未加入机构
this.$dialog.confirm({
title: '提醒',
......@@ -241,16 +259,31 @@ export default {
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
this.checkVersion(()=>{
if (this.$rocNative.isAndroid) {
this.$rocNative.setNeedClearUrl({ url: 'year_end_ssr' });
}
this.$rocNative.gotoActivityHospital({ url: window.location.href });
})
});
}
})
});
}
},
checkVersion(callback){
this.$rocNative.getAppVersionCode().then(res => {
const appVersion = parseFloat(res.versionCode.replace(/\./g, ''));
if(appVersion>=317){
callback();
}else{
this.$dialog.alert({
message: '当前app版本过低,请升级版本后继续操作',
className: 'version-toast'
});
}
});
},
// 微信分享
goShare() {
this.$sendBuriedData({
......@@ -267,7 +300,29 @@ export default {
this.$sendBuriedData({
component_tag: `301#301003`
});
window.location.href = 'https://phome.yunqueyi.com/template_v2/?id=594';
this.$rocNative.dispatchEventByModuleCode({
modeCode: 'M300',
jsonString: [
{
"key":"pageUrl",
"value": 'https://phome.yunqueyi.com/template_v2/?id=594',
"type":4,
"seqNo":1
},
{
"key":"showTitle",
"value": false,
"type":1,
"seqNo":2
},{
"key":"title",
"value": '',
"type":1,
"seqNo":3
}
]
})
// window.location.href = 'https://phome.yunqueyi.com/template_v2/?id=594';
}
},
}
......
......@@ -16,8 +16,23 @@ export const JsBridgeOptions = {
GLOBAL_NAME: 'rocNative',
NATIVE_IOS_NAME: 'rociOS',
NATIVE_ANDROID_NAME: '__rocAndroid',
initMethodsWithCallBack: ['getToken', 'getUserInfo','addEnclosure', 'getStatusBarHeight'], // value is string
initMethodsWithoutCallBack: ['appInit', 'goBack','gotoLogin', 'shareWechat', 'showNativeToast', 'dispatchEventByModuleCode', 'appBuryingPointEntrust', 'webLoadSuccess','WfileImageCallBack','selectPhoto','gotoInstitutionalReview', 'gotoActivityHospital', 'setNeedClearUrl'] // value is string
initMethodsWithCallBack: ['getToken', 'getUserInfo','addEnclosure', 'getStatusBarHeight','getAppVersionCode'], // value is string
initMethodsWithoutCallBack: [
'appInit',
'goBack',
'gotoLogin',
'shareWechat',
'showNativeToast',
'dispatchEventByModuleCode',
'appBuryingPointEntrust',
'webLoadSuccess',
'WfileImageCallBack',
'selectPhoto',
'gotoInstitutionalReview',
'gotoActivityHospital',
'setNeedClearUrl',
'dispatchEventByModuleCode'
] // value is string
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册