提交 c333d6d4 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

Merge branch 'dev-stage2-20191125' of...

Merge branch 'dev-stage2-20191125' of http://192.168.110.53/com.pica.cloud.foundation.frontend/year-end-activitiy into dev-stage2-20191125
......@@ -3,12 +3,14 @@ header{
position: fixed;
left: 0;
top: 0;
z-index: 100;
z-index: 300;
.status{
width: 375px;
}
.head-wrap{
width: 375px;
height: 44Px;
line-height: 44Px;
box-sizing: border-box;
padding: 0 20px 0 16px;
display: flex;
......
<template>
<header>
<div class="status" :class="{'bgfff': isScroll}" :style="{height: statusBarHeight + 'px', background: bgColor}"></div>
<div class="head-wrap" :class="{'bgfff': isScroll}" :style="{height: titleHeight + 'px'}">
<div class="status" :class="{'bgfff': isScroll}" :style="{height: statusBarHeight + 'Px', background: bgColor}"></div>
<!-- <div class="head-wrap" :class="{'bgfff': isScroll}" :style="{height: titleHeight + 'px'}"> -->
<div class="head-wrap" :class="{'bgfff': isScroll}">
<img @click="goBack" :src="leftIcon">
<span v-if="isScroll">{{title}}</span>
<img @click="goShare" :src="rightIcon">
......@@ -18,6 +19,10 @@
export default {
name: 'h5header',
props: {
isOpacity: { // 是否需要透明背景
type: Boolean,
default: true
},
scrollVal: { // 实际滚动的距离
type: Number,
default: 25
......@@ -42,7 +47,11 @@
setedScroll: { // 是否使用外部父组件的scroll事件
type: Boolean,
default: false
}
},
isCheckAuth: { // 是否校驗權限
type: Boolean,
default: false
}
},
data(){
return {
......@@ -55,6 +64,7 @@
}
},
mounted(){
this.isScroll = !this.isOpacity;
this.setHeaderHeight();
if(!this.setedScroll){
this.scrollHandleOwn();
......@@ -63,22 +73,28 @@
watch: {
scrollVal(val){
this.setScrollHandle(val);
}
},
isScroll(val){
if(val){
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
}
}
},
methods: {
// 从APP获取电池栏高度并设置高度
setHeaderHeight(){
// this.statusBarHeight = 20 * window.devicePixelRatio; // 给一个默认值,20 * 2
// this.titleHeight = 44 * window.devicePixelRatio; // title高度默认是44px
this.$rocNative.getStatusBarHeight().then(res=>{
const dpr = window.devicePixelRatio;
if(this.$rocNative.isIOS){
this.statusBarHeight = res.statusBarHeight * dpr;
this.titleHeight = this.titleHeight * dpr;
// this.statusBarHeight = res.statusBarHeight * dpr;
// this.titleHeight = this.titleHeight * dpr;
this.statusBarHeight = res.statusBarHeight;
}else{
this.bgColor = '#ccc';
this.statusBarHeight = res.statusBarHeight / dpr;
}
this.$emit('getHeaderHeight', this.statusBarHeight + 44);
})
},
goBack(){
......@@ -91,7 +107,13 @@
this.$sendBuriedData({
component_tag: `301#301001`
});
this.$rocNative.shareWechat(this.shareObj);
if(this.isCheckAuth){
this.$emit('checkAuth', ()=>{
this.$rocNative.shareWechat(this.shareObj);
})
}else{
this.$rocNative.shareWechat(this.shareObj);
}
},
// 默认滚动事件
scrollHandleOwn(){
......@@ -103,7 +125,7 @@
if(document.documentElement){
documentScrollTop = document.documentElement.scrollTop;
}
const heightVal = imgHeight1 + imgHeight2 + imgHeight3;
// const heightVal = imgHeight1 + imgHeight2 + imgHeight3;
const scrollVal = bodyScrollTop || documentScrollTop;
this.setScrollHandle(scrollVal);
}
......
此差异已折叠。
此差异已折叠。
......@@ -92,6 +92,37 @@
mounted(){
document.querySelector('body').setAttribute('style', 'background: #FE9A51;');
this.checkCache();
// 微信分享
this.shareObj = {
shareUrl: window.location.href,
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15,
authUrl: window.location.href,
isDebug: false,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
},(wx)=>{
const title = this.shareObj.title1;
const desc = this.shareObj.title2;
const link = window.location.href;
const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友
wx.onMenuShareAppMessage({
title,desc,link,imgUrl
});
// 分享到朋友圈
wx.onMenuShareTimeline({
title,desc,link,imgUrl
});
})
},
methods: {
// 校验用户浏览器是否有登录缓存,此缓存为纯前端缓存,与token之类的无关
......
......@@ -63,6 +63,37 @@
},
mounted(){
document.querySelector('body').setAttribute('style', 'background: "";');
// 微信分享
this.shareObj = {
shareUrl: window.location.href,
title1: '分享title分享title',
title2: '分享desc分享desc',
shareImageUrl: 'https://file.yunqueyi.com/h5/nzhd19/share.png'
}
this.$picaWxShare({
// baseUrl: BASE_URL[process.env.NUXT_ENV_APP],
baseUrl: 'https://test1-sc.yunqueyi.com',
type: 15,
authUrl: window.location.href,
isDebug: false,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
},(wx)=>{
const title = this.shareObj.title1;
const desc = this.shareObj.title2;
const link = window.location.href;
const imgUrl = this.shareObj.shareImageUrl;
// 分享给朋友
wx.onMenuShareAppMessage({
title,desc,link,imgUrl
});
// 分享到朋友圈
wx.onMenuShareTimeline({
title,desc,link,imgUrl
});
})
},
methods: {
downApp(){
......
......@@ -2,8 +2,21 @@
import request from './api';
// 获取已邀请的医生列表
// 获取用户信息
// /ranking/user_info
export const getUserScoreInfo = () => {
return request({
url: `campaign/ranking/user_info`,
method: 'post',
withCredentials: true,
// headers: {
// token: '8F685DEFFEAC45C393AA55A4DD9E9048'
// }
})
}
// 获取已邀请的医生列表
export const getInviteList = () => {
return request({
url: `campaign/inviteDetail/oneList?pageNo=1&pageSize=10`,
......@@ -13,4 +26,26 @@ export const getInviteList = () => {
// token: token
// }
})
}
\ No newline at end of file
}
// 获取打卡状态
export const getClockStatus = (params) => {
return request({
url: `campaign/clock/${params.activityId}/status/${params.id}`,
method: 'get',
withCredentials: true,
})
}
// 去打卡状态
export const goToUpdateClock = (params) => {
return request({
url: `campaign/clock/clock`,
method: 'post',
data: params,
withCredentials: true,
})
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册