提交 1db752fe 编写于 作者: tao.wu's avatar tao.wu

年终活动接口APP联调,剩下二次分享未确认

上级 d85e7f4e
assets/img/img1.png

146.4 KB | W: | H:

assets/img/img1.png

124.1 KB | W: | H:

assets/img/img1.png
assets/img/img1.png
assets/img/img1.png
assets/img/img1.png
  • 2-up
  • Swipe
  • Onion skin
assets/img/img2.png

268.3 KB | W: | H:

assets/img/img2.png

220.0 KB | W: | H:

assets/img/img2.png
assets/img/img2.png
assets/img/img2.png
assets/img/img2.png
  • 2-up
  • Swipe
  • Onion skin
assets/img/img6.png

189.3 KB | W: | H:

assets/img/img6.png

154.5 KB | W: | H:

assets/img/img6.png
assets/img/img6.png
assets/img/img6.png
assets/img/img6.png
  • 2-up
  • Swipe
  • Onion skin
assets/img/img7.png

141.4 KB | W: | H:

assets/img/img7.png

118.1 KB | W: | H:

assets/img/img7.png
assets/img/img7.png
assets/img/img7.png
assets/img/img7.png
  • 2-up
  • Swipe
  • Onion skin
assets/img/img8.png

114.1 KB | W: | H:

assets/img/img8.png

101.2 KB | W: | H:

assets/img/img8.png
assets/img/img8.png
assets/img/img8.png
assets/img/img8.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -46,6 +46,13 @@ ...@@ -46,6 +46,13 @@
img{ img{
padding-top: 15px; padding-top: 15px;
} }
.appoint-time{
margin-top: 5px;
text-align: center;
font-size:12px;
color:rgba(237,90,44,1);
line-height:16.5px;
}
} }
.btn-share{ .btn-share{
height: 166px; height: 166px;
...@@ -128,4 +135,15 @@ ...@@ -128,4 +135,15 @@
text-align: center; text-align: center;
} }
} }
} .abs-btn{
\ No newline at end of file width: 69px;
height: 25px;
position: absolute;
right: 0;
top: 260px;
img{
width: 69px;
height: 25px;
}
}
}
.remind-success{
width: 300px;
.van-dialog__header{
font-size:18px;
color:rgba(51,51,51,1);
line-height:18px;
padding-top: 30px;
}
.van-dialog__content{
.van-dialog__message{
padding: 14px 24px 30px 24px;
text-align: left;
font-size:14px;
color:rgba(103,104,105,1);
line-height:21px;
span{
font-size:14px;
color:#449284;
line-height:21px;
}
}
}
.van-dialog__footer{
.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
header{
width: 375px;
position: fixed;
left: 0;
top: 0;
z-index: 100;
.status{
width: 375px;
}
.head-wrap{
width: 375px;
height: 44px;
box-sizing: border-box;
padding: 0 20px 0 16px;
display: flex;
justify-content: space-between;
align-items: center;
img{
width: 25px;
height: 25px;
}
span{
font-size:17px;
font-weight:700;
color:rgba(3,3,3,1);
line-height:24px;
}
}
.bgfff{
background: #fff;
}
}
\ No newline at end of file
<template>
<header>
<div class="status" :class="{'bgfff': isScroll}" :style="{height: barHeight + 'px'}"></div>
<div class="head-wrap" :class="{'bgfff': isScroll}">
<img @click="goBack" :src="leftIcon">
<span v-if="isScroll">云鹊奖</span>
<img @click="goShare" :src="rightIcon">
</div>
</header>
</template>
<script>
import leftimg1 from './left-array.png';
import rightimg1 from './share-icon.png';
import leftimg2 from './left-icon.png';
import rightimg2 from './right-icon.png';
export default {
name: 'h5header',
data(){
return {
leftIcon: leftimg1,
rightIcon: rightimg1,
isScroll: false,
barHeight: 20
}
},
created(){
try{
this.$rocNative.getStatusBarHeight(res=>{
alert(JSON.stringify(res))
})
}catch(err){}
},
props: {
scrollVal: {
type: Number,
default: 0
},
},
watch: {
scrollVal(val){
if (val > 25) {
this.isScroll = true;
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
} else {
this.isScroll = false;
this.leftIcon = leftimg1;
this.rightIcon = rightimg1;
}
}
},
methods: {
goBack(){
this.$rocNative.goBack();
},
goShare(){
this.$rocNative.shareWechat({
shareUrl: window.location.href,
title1: '年终活动-标题',
title2: '年终活动-文字描述',
shareImageUrl: 'https://test-file.yunqueyi.com/png/2019/11/18/1574046505000_48x48.png'
});
}
}
}
</script>
<style lang="less">
@import './index.less';
</style>
<template> <template>
<section class="index-wrap"> <section class="index-wrap">
<h5header v-if="!isWeb" :scrollVal="scrollVal" />
<div id="imgHeight1"> <div id="imgHeight1">
<img src="../assets/img/img1.png" /> <img src="../assets/img/img1.png" />
<img src="../assets/img/img2.png" /> <img src="../assets/img/img2.png" />
...@@ -8,17 +9,23 @@ ...@@ -8,17 +9,23 @@
<div class="wrap-join" id="imgHeight2"> <div class="wrap-join" id="imgHeight2">
<div class="wrap-count"> <div class="wrap-count">
<div> <div>
<h1>2394847</h1> <h1>{{doctorIdCnt}}</h1>
<h5>已参与人数</h5> <h5>已参与人数</h5>
</div> </div>
<div> <div>
<h1>23948</h1> <h1>{{hospitalIdCnt}}</h1>
<h5>已参与机构</h5> <h5>已参与机构</h5>
</div> </div>
</div> </div>
</div> </div>
<div class="btn-appoint btn-app-share" id="imgHeight3" @click="setRemind"><img src="../assets/img/btn_appoint.png" /></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 src="../assets/img/btn_appointed.png">
<div class="appoint-time">12月16号我们会提示你参加活动</div>
</template>
</div>
<div> <div>
<img src="../assets/img/img6.png" /> <img src="../assets/img/img6.png" />
<img src="../assets/img/img7.png" /> <img src="../assets/img/img7.png" />
...@@ -26,7 +33,7 @@ ...@@ -26,7 +33,7 @@
<img src="../assets/img/img9.png" /> <img src="../assets/img/img9.png" />
<img src="../assets/img/img10.png" /> <img src="../assets/img/img10.png" />
</div> </div>
<div class="btn-share btn-app-share"><img src="../assets/img/btn_share.png" /></div> <div class="btn-share btn-app-share"><img @click="goShare" src="../assets/img/btn_share.png" /></div>
<div class="rule-show"> <div class="rule-show">
<img src="../assets/img/rule_title.png" /> <img src="../assets/img/rule_title.png" />
<div class="rule-bg"> <div class="rule-bg">
...@@ -42,27 +49,23 @@ ...@@ -42,27 +49,23 @@
<p>公布个人获奖名单和机构获奖名单</p> <p>公布个人获奖名单和机构获奖名单</p>
</section> </section>
<div class="line"></div> <div class="line"></div>
<div class="btn-rule">查看规则详情</div> <div @click="ruleLink" class="btn-rule">查看规则详情</div>
</div> </div>
<img class="bird" src="../assets/img/bird.png"> <img class="bird" src="../assets/img/bird.png">
</div> </div>
<div v-if="showFixed" @click="setRemind" class="fix-btn"> <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>开赛时提醒我</div> <div>开赛时提醒我</div>
</div> </div>
</section> </section>
</template> </template>
<script> <script>
// import { Toast } from 'vant'; import { Toast } from 'vant';
// import { mapMutations } from 'vuex' import { remind, getRemindStatus, checkHospitalStatus, getCnt } from '@/service';
// import request from '@/service/api'; import h5header from '@/components/h5header';
import { remind, getRemindStatus, checkHospitalStatus } from '@/service'; // const userToken = '9D5B30A3E4E34269BE3E4405C467F4F8';
// import popAll from '../components/popAll.vue';
// import { getBaseMainUrl, getCookie, delCookie, setCookie } from '../utils/index';
const cookies = require('cookie-universal')();
const token = '3D093CC8931C4F73A938CD8939E1A640';
export default { export default {
head() { head() {
...@@ -70,25 +73,39 @@ export default { ...@@ -70,25 +73,39 @@ export default {
title: '云鹊医-赋能基层医生', title: '云鹊医-赋能基层医生',
}; };
}, },
async asyncData({ query }) { components: {
const { data } = await getRemindStatus(token); h5header
console.log('服务端',data)
const remindStatus = data;
return {
remindStatus
}
}, },
data() { data() {
return { return {
showFixed: false, showFixed: false,
remindStatus: false,
doctorIdCnt: '',
hospitalIdCnt: '',
scrollVal: 0,
isWeb: false
} }
}, },
created() { created(){
// window.__refresh = function() {
// window.reolad();
// };
getCnt().then(res=>{
if(res.code=='000000'){
this.doctorIdCnt = res.data.doctorIdCnt;
this.hospitalIdCnt = res.data.hospitalIdCnt;
}
});
}, },
mounted() { mounted() {
console.log('愉悦状态',this.remindStatus) this.isWeb = this.$rocNative.isWeb;
this.$rocNative.getToken().then(res => {
const { userToken } = res;
getRemindStatus(userToken).then(res=>{
this.remindStatus = res.data;
});
});
this.scrollHandle(); this.scrollHandle();
}, },
methods: { methods: {
// 处理滚动按钮悬浮事件 // 处理滚动按钮悬浮事件
...@@ -107,6 +124,7 @@ export default { ...@@ -107,6 +124,7 @@ export default {
} }
const heightVal = imgHeight1 + imgHeight2 + imgHeight3; const heightVal = imgHeight1 + imgHeight2 + imgHeight3;
const scrollVal = bodyScrollTop || documentScrollTop; const scrollVal = bodyScrollTop || documentScrollTop;
this.scrollVal = scrollVal;
if(scrollVal>=heightVal){ if(scrollVal>=heightVal){
_self.showFixed = true; _self.showFixed = true;
}else{ }else{
...@@ -115,27 +133,91 @@ export default { ...@@ -115,27 +133,91 @@ export default {
} }
} }
}, },
// 提醒预约
setRemind(){ setRemind(){
checkHospitalStatus(token).then(res=>{ if(this.isWeb){
console.log(res) this.$dialog.confirm({
// status : 0无机构 1正常 2机构已关闭 5退出 10移除 15创建机构审核中 20创建机构审核不通过 25创建机构未提交 title: '提醒',
if(res.data.status==1){ message: '请前往云鹊医APP参与活动',
confirmButtonText: '下载APP',
} cancelButtonText: '我知道了',
if(!res.data.status){ // 0无机构 className: 'remind-success',
// native gotoActivityHospital }).then(() => {
}else if(res.data.status==15){ // 15创建机构审核中 window.location.href = 'https://android.myapp.com/myapp/detail.htm?apkName=com.picahealth.yunque&ADTAG=mobile';
// native gotoInstitutionalReview });
}else{ }else{
remind({token}).then(res=>{ this.$rocNative.getToken().then(data => {
console.log('res=>',res) const { userToken } = data;
}) checkHospitalStatus(userToken).then(res=>{
const status = res.data.status;
if(status==1){ // 机构状态正常
remind({userToken}).then(res=>{
if(res.code=='000000'){
this.$dialog.alert({
title: '设置提醒成功',
message: '云鹊奖活动正式时间:12月16日 10:00开始,我们将会以APP消息提醒和短信形式提醒道您,请记得及时参与活动',
confirmButtonText: '我知道了',
className: 'remind-success'
});
this.remindStatus = true;
}else{
this.$toast(res.message)
}
})
}else if(status==15){ // 15创建机构审核中
let hospital = '默认机构名称';
if(res.data && res.data.hospital) {
hospital = res.data.hospital
}
this.$dialog.confirm({
title: '提醒',
message: `抱歉,您创建的机构【${hospital}】正在审核中,审核通过后可参与活动<br/><br/>如有疑问可联系客:<span>400-920-8877</span><br/>(周一至周五9:00-18:00)`,
confirmButtonText: '查看进度',
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
if(this.$rocNative.isAndroid){
this.$rocNative.setNeedClearUrl({url: 'year_end_ssr'});
}
this.$rocNative.gotoInstitutionalReview({url: window.location.href});
});
}else{ // 除了1都是未加入机构
this.$dialog.confirm({
title: '提醒',
message: '抱歉,您暂未加入机构,需加入机构才可参与活动',
confirmButtonText: '加入机构',
cancelButtonText: '我知道了',
className: 'remind-success',
}).then(() => {
if(this.$rocNative.isAndroid){
this.$rocNative.setNeedClearUrl({url: 'year_end_ssr'});
}
this.$rocNative.gotoActivityHospital({url: window.location.href});
});
}
})
});
} }
}) },
// 微信分享
goShare(){
this.$rocNative.shareWechat({
shareUrl: window.location.href,
title1: '年终活动-标题',
title2: '年终活动-文字描述',
shareImageUrl: 'https://test-file.yunqueyi.com/png/2019/11/18/1574046505000_48x48.png'
});
},
// 活动规则
ruleLink(){
window.location.href = 'https://phome.yunqueyi.com/template_v2/?id=594';
} }
}, },
} }
</script> </script>
<style lang="less"> <style lang="less" scoped>
@import '../assets/style/index.less'; @import '../assets/style/index.less';
</style>
<style lang="less">
@import '../assets/style/revant.less';
</style> </style>
\ No newline at end of file
...@@ -26,8 +26,16 @@ import request from './api'; ...@@ -26,8 +26,16 @@ import request from './api';
// }) // })
// } // }
// 获取机构和个人参与人数
export const getCnt = () => {
return request({
url: `campaign/preBook/cnt`,
method: 'get',
})
}
// 查看当前token的机构状态 // 查看当前token的机构状态
export const checkHospitalStatus = async (token) => { export const checkHospitalStatus = (token) => {
return request({ return request({
url: `api-ws/doctors/hospital/status`, url: `api-ws/doctors/hospital/status`,
method: 'get', method: 'get',
...@@ -37,9 +45,8 @@ export const checkHospitalStatus = async (token) => { ...@@ -37,9 +45,8 @@ export const checkHospitalStatus = async (token) => {
}) })
} }
// 设置开赛提醒接口 post // 设置开赛提醒接口 post
export const remind = async (params) => { export const remind = (params) => {
return request({ return request({
url: `campaign/preBook/book`, url: `campaign/preBook/book`,
method: 'post', method: 'post',
......
...@@ -16,8 +16,8 @@ export const JsBridgeOptions = { ...@@ -16,8 +16,8 @@ export const JsBridgeOptions = {
GLOBAL_NAME: 'rocNative', GLOBAL_NAME: 'rocNative',
NATIVE_IOS_NAME: 'rociOS', NATIVE_IOS_NAME: 'rociOS',
NATIVE_ANDROID_NAME: '__rocAndroid', NATIVE_ANDROID_NAME: '__rocAndroid',
initMethodsWithCallBack: ['getToken', 'getUserInfo','addEnclosure'], // value is string initMethodsWithCallBack: ['getToken', 'getUserInfo','addEnclosure', 'getStatusBarHeight'], // value is string
initMethodsWithoutCallBack: ['appInit', 'goBack','gotoLogin', 'shareWechat', 'showNativeToast', 'dispatchEventByModuleCode', 'appBuryingPointEntrust', 'webLoadSuccess','WfileImageCallBack','selectPhoto','gotoInstitutionalReview', 'gotoActivityHospital'] // value is string initMethodsWithoutCallBack: ['appInit', 'goBack','gotoLogin', 'shareWechat', 'showNativeToast', 'dispatchEventByModuleCode', 'appBuryingPointEntrust', 'webLoadSuccess','WfileImageCallBack','selectPhoto','gotoInstitutionalReview', 'gotoActivityHospital', 'setNeedClearUrl'] // value is string
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册