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

年终活动接口联调

上级 730c9724
...@@ -109,4 +109,23 @@ ...@@ -109,4 +109,23 @@
} }
} }
} }
.fix-btn{
width: 375px;
height: 50px;
position: fixed;
left: 0;
bottom: 0;
background: #fff;
div{
width: 345px;
height: 40px;
background:linear-gradient(270deg,rgba(255,88,36,1) 0%,rgba(254,163,86,1) 100%);
border-radius:20px;
margin: 5px auto 0 auto;
font-size:15px;
color:rgba(255,255,255,1);
line-height:40px;
text-align: center;
}
}
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
</div> </div>
<div class="btn-appoint btn-app-share"><img src="../assets/img/btn_appoint.png" /></div> <div class="btn-appoint btn-app-share" id="imgHeight3" @click="setRemind"><img src="../assets/img/btn_appoint.png" /></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" />
...@@ -46,37 +46,93 @@ ...@@ -46,37 +46,93 @@
</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>开赛时提醒我</div>
</div>
</section> </section>
</template> </template>
<script> <script>
import { Toast } from 'vant'; // import { Toast } from 'vant';
// import { mapMutations } from 'vuex' // import { mapMutations } from 'vuex'
import request from '@/service/api'; // import request from '@/service/api';
// import { check, questions,checkLogin } from '@/service'; import { remind, getRemindStatus, checkHospitalStatus } from '@/service';
// import popAll from '../components/popAll.vue'; // import popAll from '../components/popAll.vue';
// import { getBaseMainUrl, getCookie, delCookie, setCookie } from '../utils/index'; // import { getBaseMainUrl, getCookie, delCookie, setCookie } from '../utils/index';
const cookies = require('cookie-universal')(); const cookies = require('cookie-universal')();
const token = '3D093CC8931C4F73A938CD8939E1A640';
export default { export default {
head() { head() {
return { return {
title: '云鹊医-赋能基层医生', title: '云鹊医-赋能基层医生',
}; };
}, },
async asyncData({ query }) {
const { data } = await getRemindStatus(token);
console.log('服务端',data)
const remindStatus = data;
return {
remindStatus
}
},
data() { data() {
return {} return {
showFixed: false,
}
}, },
created() { created() {
}, },
mounted() { mounted() {
const imgHeight1 = document.getElementById('imgHeight1'); console.log('愉悦状态',this.remindStatus)
// const imgHeight2 = document.getElementById('imgHeight2'); this.scrollHandle();
console.log(imgHeight1.offsetHeight)
// console.log(this.$refs.imgHeight1)
}, },
methods: { methods: {
// 处理滚动按钮悬浮事件
scrollHandle(){
const _self = this;
const imgHeight1 = document.getElementById('imgHeight1').offsetHeight;
const imgHeight2 = document.getElementById('imgHeight2').offsetHeight;
const imgHeight3 = document.getElementById('imgHeight3').offsetHeight;
let bodyScrollTop = 0, documentScrollTop = 0;
window.onscroll = () => {
if(document.body){
bodyScrollTop = document.body.scrollTop;
}
if(document.documentElement){
documentScrollTop = document.documentElement.scrollTop;
}
const heightVal = imgHeight1 + imgHeight2 + imgHeight3;
const scrollVal = bodyScrollTop || documentScrollTop;
if(scrollVal>=heightVal){
_self.showFixed = true;
}else{
_self.showFixed = false;
}
}
},
setRemind(){
checkHospitalStatus(token).then(res=>{
console.log(res)
// status : 0无机构 1正常 2机构已关闭 5退出 10移除 15创建机构审核中 20创建机构审核不通过 25创建机构未提交
if(res.data.status==1){
}
if(!res.data.status){ // 0无机构
// native gotoActivityHospital
}else if(res.data.status==15){ // 15创建机构审核中
// native gotoInstitutionalReview
}else{
remind({token}).then(res=>{
console.log('res=>',res)
})
}
})
}
}, },
} }
</script> </script>
......
...@@ -2,48 +2,61 @@ ...@@ -2,48 +2,61 @@
import request from './api'; import request from './api';
// import { async } from 'q'; // import { async } from 'q';
export const check = async (params) => { // export const check = async (params) => {
return request({ // return request({
url: `/campaign/questionnaire/check`, // url: `/campaign/questionnaire/check`,
params, // params,
// 需要在headers设置token // // 需要在headers设置token
// withCredentials: true, // // withCredentials: true,
// headers: {
// token: params.token
// }
// })
// }
// export const checkLogin = async (params) => {
// return request({
// url: 'campaign/questionnaire/loginAuth',
// params,
// // 需要在headers设置token
// // withCredentials: true,
// // headers: {
// // token: params.token
// // }
// })
// }
// 查看当前token的机构状态
export const checkHospitalStatus = async (token) => {
return request({
url: `api-ws/doctors/hospital/status`,
method: 'get',
headers: { headers: {
token: params.token token: token
} }
}) })
} }
export const checkLogin = async (params) => {
return request({
url: 'campaign/questionnaire/loginAuth',
params,
// 需要在headers设置token
// withCredentials: true,
// headers: {
// token: params.token
// }
})
}
export const questions = async (params) => { // 设置开赛提醒接口 post
let h = params.setEntry ? { token: params.token} : {} export const remind = async (params) => {
return request({ return request({
url: `campaign/questionnaire/questions`, url: `campaign/preBook/book`,
params, method: 'post',
// withCredentials: true data: {"activityId":1}, // 为了日后的扩展,暂时固定传 1
headers: h headers: {
token: params.token
}
}) })
} }
export const postQuestion = async (params) => { // 预约状态 get
return request({ export const getRemindStatus = async (token) => {
url: `campaign/questionnaire/apply`, return request({
method: 'post', url: `campaign/preBook/status`,
data: params, method: 'get',
// withCredentials: true
headers: { headers: {
token: params.token token: token
} }
}) })
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ const { NUXT_ENV_APP } = process.env; ...@@ -2,7 +2,7 @@ const { NUXT_ENV_APP } = process.env;
export const BASE_URL = { export const BASE_URL = {
//dev: 'https://dev-sc.yunqueyi.com', //dev: 'https://dev-sc.yunqueyi.com',
dev:'https://uat-sc.yunqueyi.com', dev:'https://dev-sc.yunqueyi.com',
test: 'https://test1-sc.yunqueyi.com', test: 'https://test1-sc.yunqueyi.com',
uat: 'https://uat-sc.yunqueyi.com', uat: 'https://uat-sc.yunqueyi.com',
prod: 'https://sc.yunqueyi.com' prod: 'https://sc.yunqueyi.com'
......
...@@ -17,7 +17,7 @@ export const JsBridgeOptions = { ...@@ -17,7 +17,7 @@ export const JsBridgeOptions = {
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'], // value is string
initMethodsWithoutCallBack: ['appInit', 'goBack','gotoLogin', 'shareWechat', 'showNativeToast', 'dispatchEventByModuleCode', 'appBuryingPointEntrust', 'webLoadSuccess','WfileImageCallBack','selectPhoto'] // value is string initMethodsWithoutCallBack: ['appInit', 'goBack','gotoLogin', 'shareWechat', 'showNativeToast', 'dispatchEventByModuleCode', 'appBuryingPointEntrust', 'webLoadSuccess','WfileImageCallBack','selectPhoto','gotoInstitutionalReview', 'gotoActivityHospital'] // value is string
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册