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

年终活动接口联调

上级 730c9724
......@@ -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 @@
</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>
<img src="../assets/img/img6.png" />
<img src="../assets/img/img7.png" />
......@@ -46,37 +46,93 @@
</div>
<img class="bird" src="../assets/img/bird.png">
</div>
<div v-if="showFixed" @click="setRemind" class="fix-btn">
<div>开赛时提醒我</div>
</div>
</section>
</template>
<script>
import { Toast } from 'vant';
// import { Toast } from 'vant';
// import { mapMutations } from 'vuex'
import request from '@/service/api';
// import { check, questions,checkLogin } from '@/service';
// import request from '@/service/api';
import { remind, getRemindStatus, checkHospitalStatus } from '@/service';
// import popAll from '../components/popAll.vue';
// import { getBaseMainUrl, getCookie, delCookie, setCookie } from '../utils/index';
const cookies = require('cookie-universal')();
const token = '3D093CC8931C4F73A938CD8939E1A640';
export default {
head() {
return {
title: '云鹊医-赋能基层医生',
};
},
async asyncData({ query }) {
const { data } = await getRemindStatus(token);
console.log('服务端',data)
const remindStatus = data;
return {
remindStatus
}
},
data() {
return {}
return {
showFixed: false,
}
},
created() {
},
mounted() {
const imgHeight1 = document.getElementById('imgHeight1');
// const imgHeight2 = document.getElementById('imgHeight2');
console.log(imgHeight1.offsetHeight)
// console.log(this.$refs.imgHeight1)
console.log('愉悦状态',this.remindStatus)
this.scrollHandle();
},
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>
......
......@@ -2,48 +2,61 @@
import request from './api';
// import { async } from 'q';
export const check = async (params) => {
return request({
url: `/campaign/questionnaire/check`,
params,
// 需要在headers设置token
// withCredentials: true,
// export const check = async (params) => {
// return request({
// url: `/campaign/questionnaire/check`,
// params,
// // 需要在headers设置token
// // 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: {
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) => {
let h = params.setEntry ? { token: params.token} : {}
// 设置开赛提醒接口 post
export const remind = async (params) => {
return request({
url: `campaign/questionnaire/questions`,
params,
// withCredentials: true
headers: h
url: `campaign/preBook/book`,
method: 'post',
data: {"activityId":1}, // 为了日后的扩展,暂时固定传 1
headers: {
token: params.token
}
})
}
export const postQuestion = async (params) => {
return request({
url: `campaign/questionnaire/apply`,
method: 'post',
data: params,
// withCredentials: true
// 预约状态 get
export const getRemindStatus = async (token) => {
return request({
url: `campaign/preBook/status`,
method: 'get',
headers: {
token: params.token
}
token: token
}
})
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ const { NUXT_ENV_APP } = process.env;
export const BASE_URL = {
//dev: 'https://dev-sc.yunqueyi.com',
dev:'https://uat-sc.yunqueyi.com',
dev:'https://dev-sc.yunqueyi.com',
test: 'https://test1-sc.yunqueyi.com',
uat: 'https://uat-sc.yunqueyi.com',
prod: 'https://sc.yunqueyi.com'
......
......@@ -17,7 +17,7 @@ export const JsBridgeOptions = {
NATIVE_IOS_NAME: 'rociOS',
NATIVE_ANDROID_NAME: '__rocAndroid',
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册