提交 112b2e0b 编写于 作者: huangwensu's avatar huangwensu

活动阶段页面编辑

上级 bfd08c19
.xb-header-container {
position: fixed;
width: 100%;
z-index: 999;
.top-header {
background: transparent;
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
margin-top: 25px;
padding: 5px 0 5px;
}
.top-header.active {
background-color: #fff;
}
.top-header .left-icon {
padding: 5px 5px 5px 10px;
}
.top-header .title {
width: 206px;
height: 18px;
line-height: 18px;
margin-left: 50px;
text-align: center;
color: #fff;
font-size: 18px;
overflow: hidden;
span {
display: none;
}
}
.top-header .title.active {
color: #000;
span {
display: block;
}
}
.top-header .right-icon {
margin-left: 20px;
padding: 5px 10px 5px 25px;
}
.top-header .left-icon img,
.top-header .right-icon img {
display: block;
width: 25px;
height: 25px;
}
}
.xb-header-container.active {
background-color: #fff;
}
.home-page {
width: 100% !important;
margin-left: 0 !important;
}
\ No newline at end of file
<template>
<div :class="{ active: isScroll }" class="xb-header-container">
<div :class="{ active: isScroll }" class="top-header">
<div class="content left-icon" @click="goBack">
<img :src="headerLeftIcon" />
</div>
<div :class="{ active: isScroll }" class="content title">
<span>{{ shareTitle1 }}</span>
</div>
<div class="content right-icon" @click="share">
<img :src="headerRightIcon" />
</div>
</div>
</div>
</template>
<script>
import { getShareUrl } from '@/utils';
import { ENV_CONFIG } from '@/utils/enumerate';
import './index.less';
export default {
name: 'Header',
props: {
isScroll: {
type: Boolean,
default: false
},
shareTitle1: {
type: String,
default: ''
},
shareTitle2: {
type: String,
default: ''
},
isInNotice: {
type: Boolean,
default: false
},
token: {
type: String,
default: ''
},
shareIconUrl: {
type: String
}
},
computed: {
headerLeftIcon() {
return !!this.isScroll ?
'https://file.yunqueyi.com/gpranking/left-icon.png' :
'https://file.yunqueyi.com/2019/04/template/left-array.png'
},
headerRightIcon() {
return !!this.isScroll ?
'https://file.yunqueyi.com/gpranking/right-icon.png' :
'https://file.yunqueyi.com/2019/04/template/share-icon.png'
}
},
methods: {
goBack() {
this.$emit('closeVideo');
this.$rocNative.goBack();
},
share() {
let shareUrl = '';
const { NUXT_ENV_APP } = process.env;
const { tempId, token, shareTitle1, shareTitle2, shareIconUrl } = this;
shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + '/template_v2/?id=' + tempId + '&token=' + token;
const h5title = encodeURIComponent(shareTitle1);
const h5desc = encodeURIComponent(shareTitle2);
const { id } = this.$route.query;
this.$sendBuriedData({
component_tag: `200#400089#${id}#${shareTitle1}`
});
this.$rocNative.shareWechat({
type: 7,
shareId: 0,
shareUrl: shareUrl,
title1: shareTitle1,
title2: shareTitle2,
shareImageUrl: shareIconUrl || 'https://file.yunqueyi.com/logo.png?version=' + new Date().getTime()
});
}
},
}
</script>
<template>
<div class="step-container">
<span class="step-num">{{numText}}</span>
<div class="step-content">
<div class="step-text">{{stepText}}</div>
<div class="step-time">{{stepTime}}</div>
</div>
<img :src="imgSrc"/>
</div>
</template>
<script>
export default {
props: {
imgSrc: {
type: String,
default: ''
},
numText: {
type: Number,
default: 0
},
stepText: {
type: String,
default: ''
},
stepTime: {
type: String,
default: ''
}
}
}
</script>
<style lang="scss" scoped>
.step-container {
display: flex;
flex-direction: row;
padding: 20px 10px 20px 0px;
.step-num {
display: inline-block;
margin-top: 7px;
font-size: 20px;
line-height: 30px;
color: #FFE8A5;
width: 30px;
height: 30px;
border: 1px solid #FFE8A5;
border-radius: 50%;
text-align: center;
}
.step-content {
padding-left: 10px;
color: #FFE8A5;
.step-text {
font-size: 18px;
font-weight: 700;
padding-bottom: 8px;
}
.step-time {
font-size: 13px;
}
}
img {
width: 40px;
height: 40px;
margin-left: 70px;
}
}
</style>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
"nodemon": "^1.18.9", "nodemon": "^1.18.9",
"postcss-pxtorem": "^4.0.1", "postcss-pxtorem": "^4.0.1",
"qs": "^6.7.0", "qs": "^6.7.0",
"vue-jest": "^3.0.3" "vue-jest": "^3.0.3",
"node-sass": "^4.12.0",
"sass-loader": "^7.2.0"
} }
} }
<template> <template>
<div class="container"> <div class="container">
<h1>nuxt-ssr</h1> <header
<about /> :token="token"
:is-scroll="isScroll"
:share-title1="shareTitle1"
:share-title2="shareTitle2"
:share-icon-url="shareIconUrl"
/>
<!-- 活动阶段 -->
<div class="activity-step">
<div class="step bt">
<step
:imgSrc="imgSrc1"
:numText="numText1"
:stepText="stepText1"
:stepTime="stepTime1"/>
<task-activity
:acToken="token"
:userMobile="userMobile"
:acTempId="activityId"
@activityTaskJump="activityTaskJump" />
</div>
<div class="step bt">
<step
:imgSrc="imgSrc2"
:numText="numText2"
:stepText="stepText2"
:stepTime="stepTime2"/>
</div>
<div class="step">
<step
:imgSrc="imgSrc3"
:numText="numText3"
:stepText="stepText3"
:stepTime="stepTime3"/>
</div>
</div>
<!-- 个人排名奖品 -->
</div> </div>
</template> </template>
<script> <script>
import request from '@/service/api' import TaskActivity from '../components/task-activity';
import { getHospital } from '@/service'; import Header from '@/components/header';
import Step from '../components/step';
import About from '../components/about';
import { getNcovRealReports } from "@/service"; import { getNcovRealReports } from "@/service";
export default { export default {
components: { components: {
About TaskActivity,
Header,
Step
},
data() {
return {
isWeb: true,
activityId: 9,
userMobile: '',
token: '',
shareTitle1: '',
shareTitle2: '',
shareIconUrl: '',
isScroll: false,
imgSrc1: require('@/static/images/score.png'),
numText1: 1,
stepText1: '做任务拿勤奋分',
stepTime1:'3月24日10:00-4月2日16:00',
imgSrc2: require('@/static/images/beans.png'),
numText2: 2,
stepText2: '瓜分云鹊豆',
stepTime2:'4月3日10:00-4月7日16:00',
imgSrc3: require('@/static/images/get-award.png'),
numText3: 3,
stepText3: '公布排名获奖名单',
stepTime3:'4月3日10:00-4月7日16:00'
}
}, },
async asyncData({ $axios }) { async asyncData({ $axios }) {
// console.log('index page async data');
// const { data } = await request({
// baseURL: 'https://sc.yunqueyi.com',
// url: '/contents/template/116/widgetList?token=55122B14EAD64B77B4D65E083C994979&setEntry=true'
// });
// return { hos: data.model.widgetList }
}, },
// fetch() {
// console.log('index page fetch');
// return {
// fetch: 'fetch'
// }
// },
created() { created() {
// this.$store.dispatch('searchHospital', { name: '测试' });
}, },
mounted() {}, mounted() {},
methods: { methods: {
...@@ -43,7 +91,12 @@ export default { ...@@ -43,7 +91,12 @@ export default {
} }
}); });
}, },
}, // 活动任务
activityTaskJump(data) {
//this.jumpPage(data.href, data.id);
},
}
} }
</script> </script>
...@@ -51,18 +104,18 @@ export default { ...@@ -51,18 +104,18 @@ export default {
.container { .container {
margin: 0 auto; margin: 0 auto;
min-height: 100vh; min-height: 100vh;
h1 { background: #B72541;
font-size: 36px; .activity-step {
text-align: center; margin: 0 10px;
} border-radius: 5px;
.m1 { background: #9A1F36;
width: 100%; .step {
> div { margin: 0 10px;
width: 100%;
} }
img { .step.bt {
width: 100%; border-bottom: 1PX solid #FFE0D9;
} }
} }
} }
</style> </style>
...@@ -10,4 +10,15 @@ export const getHospital = async (params) => { ...@@ -10,4 +10,15 @@ export const getHospital = async (params) => {
export const getNcovRealReports = async (pageSize) => { export const getNcovRealReports = async (pageSize) => {
return request({ url: `ncov/ncovPage/realReports?pageSize=${pageSize}` }); return request({ url: `ncov/ncovPage/realReports?pageSize=${pageSize}` });
}; };
\ No newline at end of file
// 新的任务列表查询
export const getNewActivityDesc = async (data) => {
const { id, token } = data;
return request({
url: `/campaign/tims/timsActivityInfo?activityId=${id}&token=${token}&setEntry=true`,
headers: {
token
}
});
}
\ No newline at end of file
...@@ -32,3 +32,40 @@ export const REPONSE_CODE = { ...@@ -32,3 +32,40 @@ export const REPONSE_CODE = {
504: '网关超时。' 504: '网关超时。'
}; };
// 其他的域名 跳转
export const ENV_CONFIG = {
dev: {
apiUrl: 'https://dev-api.yunqueyi.com',
shareUrl: 'https://dev-phome.yunqueyi.com',
topicUrl: 'https://dev-phome.yunqueyi.com/discuss',
appId: 'wxf4e66242d31c81c2', // 用于微信授权登录(张平)
noticeUrl: 'https://dev-notice.yunqueyi.com',
agreementUrl: "https://dev-scale.yunqueyi.com"
},
test: {
apiUrl: 'https://test1-api.yunqueyi.com',
shareUrl: 'https://test1-phome.yunqueyi.com',
topicUrl: 'https://test1-phome.yunqueyi.com/discuss',
appId: 'wxebc0cc65cca7694b', // 用于微信授权登录(李军)
noticeUrl: 'https://test1-notice.yunqueyi.com',
agreementUrl: "https://test1-scale.yunqueyi.com"
},
uat: {
apiUrl: 'https://uat-api.yunqueyi.com',
shareUrl: 'https://uat-phome.yunqueyi.com',
topicUrl: 'https://uat-phome.yunqueyi.com/discuss',
appId: 'wx342ef0e5afee54a7', // 用于微信授权登录(于蛟)
noticeUrl: 'https://uat-notice.yunqueyi.com',
agreementUrl: "https://uat-scale.yunqueyi.com"
},
prod: {
apiUrl: 'https://api.yunqueyi.com',
shareUrl: 'https://phome.yunqueyi.com',
topicUrl: 'https://phome.yunqueyi.com/discuss',
appId: 'wx2c577552a2d28550', // 用于微信授权登录
noticeUrl: 'https://notice.yunqueyi.com',
agreementUrl: "https://scale.yunqueyi.com"
}
}
...@@ -28,4 +28,43 @@ export const setItem = (name, value) => { ...@@ -28,4 +28,43 @@ export const setItem = (name, value) => {
export const removeItem = name => { export const removeItem = name => {
if (!name) return; if (!name) return;
sessionStorage.removeItem(name); sessionStorage.removeItem(name);
}; };
\ No newline at end of file
export const setCookie = (cname,cvalue, exdays = 7, domain = '.yunqueyi.com') => { //yunqueyi.com
let d = new Date(), expires = '';
 
if (NUXT_ENV_APP === 'dev') {
domain = window.location.hostname;
}
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
expires = `expires=${d.toUTCString()}`;
 
document.cookie = `${cname}=${cvalue};path=/;${expires};domain=${domain}`;
}
export const getCookie = (cname) => {
const reg = new RegExp('(^| )' + cname + '=([^;]*)(;|$)');
const arr = document.cookie.match(reg);
return arr ? unescape(arr[2]) : null;
}
export const delCookie = (cname) => {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(cname);
if(cval!=null){
document.cookie = 'token=; path=/; expires=' + new Date(0).toUTCString();
document.cookie = 'token=; path=/; domain=.yunqueyi.com; expires=' + new Date(0).toUTCString();
//document.cookie= name + "="+cval+";path=/;expires="+exp.toGMTString() + ";domain=" + domain;
}
}
export const getConfigByEvtType = key => {
return ENV_CONFIG[NUXT_ENV_APP][key];
}
export const getShareUrl = url => {
return `${getConfigByEvtType('shareUrl')}${url}`;
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册