提交 ef6e2dc5 编写于 作者: 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
此差异已折叠。
.remind-success{ .remind-success {
width: 300px; width: 300px;
.van-dialog__header{
font-size:18px; .van-dialog__header {
color:rgba(51,51,51,1); font-size: 18px;
line-height:18px; color: rgba(51, 51, 51, 1);
padding-top: 30px; 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__content{ }
.van-dialog__message{
padding: 14px 24px 30px 24px; .van-dialog__footer {
text-align: left; .van-dialog__cancel {
font-size:14px; .van-button__text {
color:rgba(103,104,105,1); font-size: 17px;
line-height:21px; color: rgba(151, 152, 153, 1);
span{ line-height: 24px;
font-size:14px; }
color:#449284;
line-height:21px;
}
}
} }
.van-dialog__footer{
.van-dialog__cancel{ .van-dialog__confirm {
.van-button__text{ .van-button__text {
font-size:17px; font-size: 17px;
color:rgba(151,152,153,1); color: rgba(68, 146, 132, 1);
line-height:24px; line-height: 24px;
} }
}
.van-dialog__confirm{
.van-button__text{
font-size:17px;
color:rgba(68,146,132,1);
line-height:24px;
}
}
} }
}
} }
.version-toast{
width: 320px; .version-toast {
.van-dialog__header{ width: 320px;
font-size:18px;
color:rgba(51,51,51,1); .van-dialog__header {
line-height:18px; font-size: 18px;
padding-top: 30px; color: rgba(51, 51, 51, 1);
line-height: 18px;
padding-top: 30px;
}
.van-dialog__content {
.van-dialog__message {
font-size: 14px;
color: rgba(103, 104, 105, 1);
line-height: 21px;
} }
.van-dialog__content{ }
.van-dialog__message{
font-size:14px; .van-dialog__footer {
color:rgba(103,104,105,1); border: .5px solid rgba(0, 0, 0, .3);
line-height:21px;
} .van-dialog__cancel {
.van-button__text {
font-size: 17px;
color: rgba(151, 152, 153, 1);
line-height: 24px;
}
} }
.van-dialog__footer{
border: .5px solid rgba(0,0,0,.3); .van-dialog__confirm {
.van-dialog__cancel{ .van-button__text {
.van-button__text{ font-size: 17px;
font-size:17px; color: rgba(68, 146, 132, 1);
color:rgba(151,152,153,1); line-height: 24px;
line-height:24px; }
}
}
.van-dialog__confirm{
.van-button__text{
font-size:17px;
color:rgba(68,146,132,1);
line-height:24px;
}
}
} }
}
}
.wx-share-wrap {
.van-count-down {
line-height: 45px;
right: 20px;
position: absolute;
}
} }
\ No newline at end of file
<template>
<div class="wx-share-wrap">
<section>
<div class="invite-info">
<img :src="avatarImageUrl" />
<p class="title1">{{ name }}邀请您助力 为他赢大奖</p>
<p class="title2">领取课程即可助他一臂之力</p>
</div>
<div class="page-info">
<p class="title1">资深医生讲师、精选专业课程</p>
<p class="title2">已有超过20,000+的医生领取以下课程</p>
<div class="imgs-wrap">
<div>
<img src="../assets/img/ico1.png" />
<div class="img-txt">高血压课程</div>
</div>
<div>
<img src="../assets/img/ico2.png" />
<div class="img-txt">糖尿病课程</div>
</div>
<div>
<img src="../assets/img/ico3.png" />
<div class="img-txt">中医课程</div>
</div>
<div>
<img src="../assets/img/ico4.png" />
<div class="img-txt">全科课程</div>
</div>
</div>
</div>
<div class="form-info">
<div class="field-wrap">
<label>联系方式</label>
<input v-model="mobilePhone" type="tel" maxlength="11" placeholder="请输入手机号">
</div>
<div class="field-wrap">
<label>图形验证码</label>
<input v-model="captchaAnswer" type="text" maxlength="6" placeholder="请输入">
<div class="cap-box"><img :src="captchaImg" @click="getCaptcha"></div>
</div>
<div class="field-wrap">
<label>短信验证码</label>
<input v-model="authCode" type="tel" maxlength="6" placeholder="请输入">
<button v-if="notSend" @click="sendSms">{{btnMsg}}</button>
<van-count-down v-if="!notSend" :time="time" @finish="finishCount" :format="'ss' + 's'" />
</div>
<button class="btn-post" @click="getCourse">领取课程</button>
</div>
</section>
</div>
</template>
<script>
import { getInviteInfo, getCourseById, getCaptchaGet, getAuthCode } from '@/service';
const TIMEALL = 60000; // 倒计时常量 60 秒
export default {
data(){
return {
notSend: true,
mobilePhone: '',
authCode: '', // 短信验证码
flag: 0,
captchaImg: '', // 图形验证码图片字段
captchaToken: '', // captchaToken
captchaAnswer: '', // 输入的图形验证码
time: TIMEALL,
btnMsg: '点击获取'
}
},
async asyncData({ query }){
const { id, taskId, activityId } = query;
let avatarImageUrl, name, mobilePhone;
const res = await getInviteInfo(id);
if(res.code=='000000'){
const data = res.data;
avatarImageUrl = data.avatarImageUrl;
name = data.name ? data.name : data.mobilePhone;
}
return {
avatarImageUrl, name, id, taskId, activityId
}
},
mounted(){
this.getCaptcha();
},
methods: {
// 点击刷新验证码
getCaptcha(){
getCaptchaGet().then(res=>{
if(res.code==='000000'){
this.captchaImg = `data:image/png;base64,${res.data.content}`;
this.captchaToken = res.data.token;
}else{
this.$toast(res.message);
}
})
},
// 领取课程事件
getCourse(){
if(this.mobilePhone=='' || this.mobilePhone.length!=11){
this.$toast('请输入正确的手机号');
return;
}
if(this.authCode==''){
this.$toast('请输入短信验证码');
return;
}
const { mobilePhone, authCode, id, taskId, activityId } = this;
// 调用领取课程接口
getCourseById({
mobile: mobilePhone,
authCode,
id,
taskId,
activityId
}).then(res=>{
if(res.code=='000000'){
// res.data true 登记成功 、 false 登记失败
this.$router.push({
name: 'shareResult',
query: {
status: res.data
}
})
}else {
this.$toast(res.message);
}
})
},
// 发送获取短信验证码
sendSms(){
if(this.mobilePhone=='' || this.mobilePhone.length!=11){
this.$toast('请输入正确的手机号');
return;
}
// 校验图形验证码
if(this.captchaAnswer==''){
this.$toast('请输入图形验证码');
return;
}
// this.notSend = false;
const { mobilePhone, flag, captchaToken, captchaAnswer } = this;
getAuthCode({mobilePhone, flag, captchaToken, captchaAnswer}).then(res=>{
// 发送成功
if(res.code=='000000'){
this.notSend = false;
}else{
this.$toast(res.message);
this.getCaptcha();
}
})
},
// 倒计时结束
finishCount(){
this.time = TIMEALL;
this.notSend = true;
this.btnMsg = '重新获取';
}
}
}
</script>
<style lang="less" scoped>
@import '../assets/style/index.less';
</style>
<style lang="less">
@import '../assets/style/revant.less';
</style>
\ No newline at end of file
<template>
<div>
<h1>result-share</h1>
</div>
</template>
<script>
export default {
asyncData({ query }){
console.log(query)
const { status } = query; // 上个页面传递过来领取结果, false 为已领取, true 为领取成功
}
}
</script>
\ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import { BASE_URL } from '@/utils/enumerate'; import {
BASE_URL
} from '@/utils/enumerate';
import PicaWxShare from 'pica-wx-share'; import PicaWxShare from 'pica-wx-share';
Vue.prototype.$picaWxShare = PicaWxShare; Vue.prototype.$picaWxShare = PicaWxShare;
import PicaH5Login from 'pica-h5-login'; import PicaH5Login from 'pica-h5-login';
import { Dialog, Toast, Checkbox,Popup ,CheckboxGroup ,RadioGroup, Radio, Progress,ImagePreview ,Uploader,Overlay,Loading } from 'vant'; import {
import WebBuriedPoint, { sendBuriedData } from 'web-buried-point'; CountDown,
Field,
Cell,
CellGroup,
Button,
Dialog,
Toast,
Checkbox,
Popup,
CheckboxGroup,
RadioGroup,
Radio,
Progress,
ImagePreview,
Uploader,
Overlay,
Loading
} from 'vant';
import WebBuriedPoint, {
sendBuriedData
} from 'web-buried-point';
Vue.use(Popup).use(Checkbox).use(CheckboxGroup).use(RadioGroup).use(Radio).use(Progress).use(ImagePreview).use(Uploader).use(Overlay).use(Loading); Vue.use(CountDown).use(Field).use(Cell).use(CellGroup).use(Button).use(Popup).use(Checkbox).use(CheckboxGroup).use(RadioGroup).use(Radio).use(Progress).use(ImagePreview).use(Uploader).use(Overlay).use(Loading);
Vue.use(PicaH5Login); Vue.use(PicaH5Login);
Vue.use(Toast) Vue.use(Toast)
Vue.use(Dialog) Vue.use(Dialog)
const { NUXT_ENV_APP } = process.env; const {
NUXT_ENV_APP
} = process.env;
Vue.use(WebBuriedPoint, { Vue.use(WebBuriedPoint, {
class_name: `year_end_ssr`, class_name: `year_end_ssr`,
url: `${BASE_URL[NUXT_ENV_APP]}/file/log/trace1` url: `${BASE_URL[NUXT_ENV_APP]}/file/log/trace1`
}); });
Vue.prototype.$sendBuriedData = sendBuriedData; Vue.prototype.$sendBuriedData = sendBuriedData;
\ No newline at end of file \ No newline at end of file
...@@ -42,6 +42,7 @@ export const getRemindStatus = async (token) => { ...@@ -42,6 +42,7 @@ export const getRemindStatus = async (token) => {
}) })
} }
// 校验token是否有效
export const checkToken = async (token) => { export const checkToken = async (token) => {
return request({ return request({
url: `campaign/admin/task/checkToken?token=${token}`, url: `campaign/admin/task/checkToken?token=${token}`,
...@@ -50,4 +51,42 @@ export const checkToken = async (token) => { ...@@ -50,4 +51,42 @@ export const checkToken = async (token) => {
token: token token: token
} }
}) })
} }
\ No newline at end of file
// 获取邀请人的头像和名字信息
export const getInviteInfo = async (id) => {
return request({
url: `campaign/inviteOne/info?id=${id}`,
method: 'get'
})
}
// 领取课程 POST
export const getCourseById = ({ mobile, authCode, id, taskId, activityId }) => {
return request({
url: `campaign/inviteOne/invited`,
method: 'post',
data: {
mobile, authCode, id, taskId, activityId
},
})
}
// 获取图形验证码
export const getCaptchaGet = () => {
return request({
url: `account/account/captcha`,
method: 'get'
})
}
// 获取短信验证码
export const getAuthCode = ({ mobilePhone, flag, captchaToken, captchaAnswer }) => {
return request({
url: `account/account/authCode`,
method: 'get',
params: {
mobilePhone, flag, captchaToken, captchaAnswer
},
})
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册