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

Merge branch 'dev-new-campaign-0302' of...

Merge branch 'dev-new-campaign-0302' of 192.168.110.53:com.pica.cloud.education.frontend/pica-new-compaign into dev-new-campaign-0302
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
type: String | Number, type: String | Number,
default: '' default: ''
}, },
userId: { encryptId: {
type: String | Number, type: String | Number,
default: '' default: ''
}, },
...@@ -102,15 +102,9 @@ export default { ...@@ -102,15 +102,9 @@ export default {
share() { share() {
let shareUrl = ''; let shareUrl = '';
const { NUXT_ENV_APP } = process.env; const { NUXT_ENV_APP } = process.env;
const { tempId, taskId, userName, userId, avatarl, token, shareTitle1, shareTitle2, shareIconUrl } = this; const { tempId, taskId, userName, encryptId, avatarl, token, shareTitle1, shareTitle2, shareIconUrl } = this;
//shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + '/compaign_ssr/?id=' + tempId + '&token=' + token; shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + `/compaign_ssr/login-point?activityId=${tempId}&taskId=${taskId}&id=${userId}&name=${userName}&avatar=${avatarl}`;
shareUrl = `http://10.177.10.217:3000/compaign_ssr/login-point?activityId=${tempId}&taskId=${taskId}&id=${userId}&name=${userName}&avatar=${avatarl}`; //shareUrl = `http://10.177.10.217:3000/compaign_ssr/login-point?activityId=${tempId}&taskId=${taskId}&id=${encryptId}&name=${userName}&avatar=${avatarl}`;
// const { id } = this.$route.query;
// this.$sendBuriedData({
// class_name: '',
// component_tag: `200#400089#${id}#${shareTitle1}`
// });
this.$rocNative.shareWechat({ this.$rocNative.shareWechat({
type: 6, type: 6,
shareId: 0, shareId: 0,
......
此差异已折叠。
...@@ -14,13 +14,14 @@ ...@@ -14,13 +14,14 @@
"dependencies": { "dependencies": {
"cookie-universal": "^2.0.16", "cookie-universal": "^2.0.16",
"cross-env": "^5.2.0", "cross-env": "^5.2.0",
"js-base64": "^2.5.1",
"jsencrypt": "^3.0.0-rc.1",
"koa": "^2.6.2", "koa": "^2.6.2",
"nuxt": "^2.0.0", "nuxt": "^2.0.0",
"pica-call-app": "^1.0.42",
"vant": "^2.0.9", "vant": "^2.0.9",
"vconsole": "^3.3.4", "vconsole": "^3.3.4",
"web-buried-point": "^v2.1.0", "web-buried-point": "^v2.1.0"
"pica-call-app": "^1.0.42",
"js-base64": "^2.5.1"
}, },
"devDependencies": { "devDependencies": {
"@nuxtjs/axios": "^5.5.4", "@nuxtjs/axios": "^5.5.4",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:isShowRightIcon="isShowRightIcon" :isShowRightIcon="isShowRightIcon"
:tempId="activityId" :tempId="activityId"
:userName="userName" :userName="userName"
:userId="userId" :encryptId="encryptId"
:avatarl="myAvatarl" :avatarl="myAvatarl"
:taskId="taskId" :taskId="taskId"
/> />
...@@ -107,7 +107,8 @@ import { ...@@ -107,7 +107,8 @@ import {
checkToken, checkToken,
selectAppModuleParam, selectAppModuleParam,
getSelfAllScore, getSelfAllScore,
checkFirstEnter, checkFirstEnter,
getEncryptId,
getActivityTime, getActivityTime,
inviteFirstEnter, inviteFirstEnter,
getCarveStatus, getCarveStatus,
...@@ -137,10 +138,10 @@ export default { ...@@ -137,10 +138,10 @@ export default {
activityId: 0, activityId: 0,
token: '', token: '',
shareTitle1: '', shareTitle1: '',
shareTitle2: '', shareTitle2: '做任务瓜分500W云鹊豆,点一下你也能获得75分哦',
shareTitle3: '', shareTitle3: '',
shareTitle4: '', shareTitle4: '',
shareIconUrl: '', shareIconUrl: 'https://file.yunqueyi.com/h5/images/commons/share_hd1.png',
isScroll: false, isScroll: false,
imgSrc1: require('@/static/images/score.png'), imgSrc1: require('@/static/images/score.png'),
numText1: 1, numText1: 1,
...@@ -190,19 +191,12 @@ export default { ...@@ -190,19 +191,12 @@ export default {
_this.getUserInfo(); _this.getUserInfo();
}; };
_this.getActivityTime(); _this.getActivityTime();
_this.inviteFirstEnter();
_this.$sendBuriedData({ _this.$sendBuriedData({
action: '查看量', action: '查看量',
component_tag: '360#360000' component_tag: '360#360000'
}); });
}, },
methods: { methods: {
// 点赞后进入活动主页
inviteFirstEnter() {
inviteFirstEnter({taskId: this.taskId,activityId: this.activityId}).then(res => {
})
},
// 获取服务器当前时间 // 获取服务器当前时间
getActivityTime() { getActivityTime() {
getActivityTime().then(res => { getActivityTime().then(res => {
...@@ -258,7 +252,7 @@ export default { ...@@ -258,7 +252,7 @@ export default {
// 获取加密后的doctorId // 获取加密后的doctorId
getEncryptId() { getEncryptId() {
getEncryptId().then(res => { getEncryptId().then(res => {
if( res && res.code && res.code == '000000' ){ if( res.code == '000000' ){
this.encryptId = res.data; this.encryptId = res.data;
} }
}) })
...@@ -269,9 +263,10 @@ export default { ...@@ -269,9 +263,10 @@ export default {
getSelfAllScore({ id: this.activityId, token: this.token }).then(res => { getSelfAllScore({ id: this.activityId, token: this.token }).then(res => {
if(res.code == '000000') { if(res.code == '000000') {
_this.myAvatarl = res.data.avatarImageUrl; _this.myAvatarl = res.data.avatarImageUrl;
_this.myScore = res.data.totalScore; _this.myScore = res.data.totalScore;
_this.userId = res.data.id; _this.userId = res.data.id;
_this.userName = res.data.name; _this.userName = res.data.name;
_this.shareTitle1 = `${_this.userName}医生邀请您为他助力`;
} }
}) })
}, },
...@@ -305,18 +300,23 @@ export default { ...@@ -305,18 +300,23 @@ export default {
}; };
this.$router.push({path: "/perdetails",query: queryData}); this.$router.push({path: "/perdetails",query: queryData});
}, },
// 获取任务id // 获取点赞任务id
getTaskId(data) { getTaskId(data) {
this.taskId = data.taskId; this.taskId = data.taskId;
this.inviteFirstEnter();
},
// 点赞后进入活动主页
inviteFirstEnter() {
inviteFirstEnter({taskId: this.taskId, activityId: this.activityId}).then(res => {});
}, },
// 活动任务 // 活动任务
activityTaskJump(data) { activityTaskJump(data) {
let shareUrl = ''; let shareUrl = '';
const { NUXT_ENV_APP } = process.env; const { NUXT_ENV_APP } = process.env;
if(data.resourceType == 11) { // 邀请好友点赞 if(data.resourceType == 11) { // 邀请好友点赞
const { tempId, token, encryptId, userName, myAvatarl, shareTitle1, shareTitle2, shareIconUrl } = this; const { activityId, token, encryptId, userName, myAvatarl, shareTitle1, shareTitle2, shareIconUrl } = this;
//shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + '/compaign_ssr/?id=' + tempId + '&token=' + token; shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + `/compaign_ssr/login-point?activityId=${activityId}&taskId=${data.id}&id=${encryptId}&name=${userName}&avatar=${myAvatarl}`;
shareUrl = `http://10.177.10.217:3000/compaign_ssr/login-point?activityId=${tempId}&taskId=${data.id}&id=${encryptId}&name=${userName}&avatar=${myAvatarl}`; //shareUrl = `http://10.177.10.217:3000/compaign_ssr/login-point?activityId=${activityId}&taskId=${data.id}&id=${encryptId}&name=${userName}&avatar=${myAvatarl}`;
this.$rocNative.shareWechat({ this.$rocNative.shareWechat({
type: 6, type: 6,
shareId: 0, shareId: 0,
...@@ -328,7 +328,7 @@ export default { ...@@ -328,7 +328,7 @@ export default {
}else if(data.resourceType == 9) { // 绑定居民微信 }else if(data.resourceType == 9) { // 绑定居民微信
const { userId, origin, activityId, shareTitle3, shareTitle4, shareIconUrl } = this; const { userId, origin, activityId, shareTitle3, shareTitle4, shareIconUrl } = this;
let doctorId = Base64.encode(userId); let doctorId = Base64.encode(userId);
shareUrl = `${ENV_CONFIG[NUXT_ENV_APP]['shareUrl']}/active_news/activity/qrcode?doctorId=${doctorId}&origin=${origin}&activityId=${activityId}`; shareUrl = `${ENV_CONFIG[NUXT_ENV_APP]['shareUrl']}/active_news/activity/qrcode?doctorId=${doctorId}&origin=${origin}&activityId=${activityId}&taskId=${data.id}`;
this.$rocNative.shareWechat({ this.$rocNative.shareWechat({
type: 6, type: 6,
shareId: 0, shareId: 0,
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
</div> </div>
</template> </template>
<script> <script>
import { getCaptchaGet, getAuthCode, pointResult } from '@/service'; import { getCaptchaGet, getAuthCode, pointResult, getPublicKey } from '@/service';
import { CryptoJS } from '../../utils/aes';
const TIMEALL = 60000; // 倒计时常量 60 秒 const TIMEALL = 60000; // 倒计时常量 60 秒
export default { export default {
data() { data() {
...@@ -46,7 +47,8 @@ export default { ...@@ -46,7 +47,8 @@ export default {
captchaImg: '', captchaImg: '',
captchaToken: '', captchaToken: '',
flag: 0, flag: 0,
time: TIMEALL time: TIMEALL,
pubKey: ''
} }
}, },
created() { created() {
...@@ -59,8 +61,17 @@ export default { ...@@ -59,8 +61,17 @@ export default {
this.name = this.$route.query.name; this.name = this.$route.query.name;
this.avatarl = this.$route.query.avatar; this.avatarl = this.$route.query.avatar;
this.getCaptchaGet(); this.getCaptchaGet();
this.getPublicKey();
}, },
methods: { methods: {
// 获取公钥
getPublicKey() {
getPublicKey().then(res => {
if(res.code == '000000') {
this.pubKey = res.data;
}
})
},
// 获取图形验证码 // 获取图形验证码
getCaptchaGet() { getCaptchaGet() {
getCaptchaGet().then(res => { getCaptchaGet().then(res => {
...@@ -94,8 +105,9 @@ export default { ...@@ -94,8 +105,9 @@ export default {
this.$toast('请输入图形验证码'); this.$toast('请输入图形验证码');
return; return;
} }
let data = {mobile: mobilePhone, flag, captchaToken, captchaAnswer};
getAuthCode({mobilePhone, flag, captchaToken, captchaAnswer}).then(res=>{ let req = this.formatContent(JSON.stringify(data), this.pubKey);
getAuthCode(req).then(res=>{
// 发送成功 // 发送成功
if(res.code === '000000'){ if(res.code === '000000'){
this.notSend = false; this.notSend = false;
...@@ -105,6 +117,38 @@ export default { ...@@ -105,6 +117,38 @@ export default {
} }
}) })
}, },
formatContent(content, pubKey) { // obj为具体的json传参
let aesKey = this.getAesKey(16);
let params = {
key: '',
content: ''
};
params.content = this.aesEncrypt(content, aesKey);
params.key = this.rsaEncrypt(aesKey, pubKey);
return params;
},
aesEncrypt(content, aesKey) {
let sKey = CryptoJS.enc.Utf8.parse(aesKey);
let sContent = CryptoJS.enc.Utf8.parse(content);
let encrypted = CryptoJS.AES.encrypt(sContent, sKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
return encrypted.toString();
},
rsaEncrypt(aesKey, pubKey){
let _encrypt = new JSEncrypt();
let boss_public_key = pubKey;
_encrypt.setPublicKey(boss_public_key);
let encrypted = _encrypt.encrypt(aesKey);
return encrypted;
},
getAesKey(len) {
let aesKey = "";
let strList = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
let strLen = strList.length;
for(let i=0; i < len; i++){
aesKey += strList.charAt( Math.floor( Math.random()*strLen ) );
};
return aesKey;
},
// 倒计时结束 // 倒计时结束
finishCount(){ finishCount(){
this.time = TIMEALL; this.time = TIMEALL;
...@@ -122,11 +166,13 @@ export default { ...@@ -122,11 +166,13 @@ export default {
} }
pointResult(param).then(res => { pointResult(param).then(res => {
if(res.code == '000000') { if(res.code == '000000') {
if(res.data.code == '900001') { if(res.data == '900001') {
this.$toast('不能给自己点赞哦'); this.$toast('不能给自己点赞哦');
}else { }else {
this.$router.push({path: "/login-point/point-result",query: {code: res.data.code}}); this.$router.push({path: "/login-point/point-result",query: {code: res.data}});
} }
}else {
this.$toast(res.message);
} }
}) })
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<section class="point-container"> <section class="point-container">
<div class="point-bg"> <div class="point-bg">
<div class="point-status"> <div class="point-status">
<img v-if="status == 1 || status == 3" src="../../static/images/point-success.png" /> <img v-if="status == 1 || status == 3" src="../../static/images/point-success-nobg.png" />
<img v-if="status == 2" src="../../static/images/point-fail.png" /> <img v-if="status == 2" src="../../static/images/point-fail.png" />
</div> </div>
<div class="status-text"> <div class="status-text">
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
</section> </section>
</template> </template>
<script> <script>
import { ENV_CONFIG } from '@/utils/enumerate';
export default { export default {
data() { data() {
return { return {
...@@ -39,7 +40,7 @@ export default { ...@@ -39,7 +40,7 @@ export default {
this.pointText1 = "点赞成功"; this.pointText1 = "点赞成功";
this.pointText2 = "登陆云鹊医APP,您也可获得75勤奋分"; this.pointText2 = "登陆云鹊医APP,您也可获得75勤奋分";
this.btnText = "打开APP参与瓜分云鹊豆"; this.btnText = "打开APP参与瓜分云鹊豆";
}else if(this.code == '900003') { }else if(this.code == '900008') {
this.status = 1; this.status = 1;
this.pointText1 = "点赞成功"; this.pointText1 = "点赞成功";
this.pointText2 = "登陆云鹊医APP,参加活动瓜分云鹊豆"; this.pointText2 = "登陆云鹊医APP,参加活动瓜分云鹊豆";
...@@ -49,7 +50,7 @@ export default { ...@@ -49,7 +50,7 @@ export default {
this.pointText1 = "点赞成功,感谢您为TA拿下5勤奋分"; this.pointText1 = "点赞成功,感谢您为TA拿下5勤奋分";
this.pointText2 = "登陆云鹊医APP,您也可获得75勤奋分"; this.pointText2 = "登陆云鹊医APP,您也可获得75勤奋分";
this.btnText = "打开APP参与瓜分云鹊豆"; this.btnText = "打开APP参与瓜分云鹊豆";
}else if(this.code = '900005') { }else if(this.code == '900005') {
this.status = 2; this.status = 2;
this.pointText1 = "抱歉!您的点赞次数已达3次上限!"; this.pointText1 = "抱歉!您的点赞次数已达3次上限!";
this.pointText2 = "登陆云鹊医APP,您也可获得75勤奋分"; this.pointText2 = "登陆云鹊医APP,您也可获得75勤奋分";
...@@ -74,7 +75,8 @@ export default { ...@@ -74,7 +75,8 @@ export default {
methods: { methods: {
openApp() { openApp() {
// let path = window.location.origin + window.location.hash; // let path = window.location.origin + window.location.hash;
let path = "http://10.177.10.217:3000/compaign_ssr/"; const { NUXT_ENV_APP } = process.env;
let path = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + `/compaign_ssr/`;
this.$callApp(path); this.$callApp(path);
}, },
downloadApp() { downloadApp() {
...@@ -92,18 +94,19 @@ export default { ...@@ -92,18 +94,19 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
} }
.point-status { .point-status {
padding: 45px 0 25px; padding: 35px 0 12px;
text-align: center; text-align: center;
img { img {
width: 50px; width: 60px;
height: 50px; height: 55px;
} }
} }
.status-text { .status-text {
padding: 0px 0px 30px; padding: 0px 0px 35px;
text-align: center; text-align: center;
p { p {
font-size: 18px; font-size: 18px;
line-height: 28px;
font-weight: 700; font-weight: 700;
color:#373839 color:#373839
} }
...@@ -131,7 +134,7 @@ export default { ...@@ -131,7 +134,7 @@ export default {
.btn { .btn {
text-align: center; text-align: center;
// background: #fff; // background: #fff;
padding: 40px 0px 91px; padding: 40px 0px 0px;
margin-top: -1px; margin-top: -1px;
button { button {
display: inline-block; display: inline-block;
......
...@@ -4,6 +4,7 @@ import rocNative from '@/utils/jsbridge'; ...@@ -4,6 +4,7 @@ import rocNative from '@/utils/jsbridge';
import WebBuriedPoint, { sendBuriedData } from 'web-buried-point'; import WebBuriedPoint, { sendBuriedData } from 'web-buried-point';
import { callApp } from 'pica-call-app'; // H5唤起APP组件 import { callApp } from 'pica-call-app'; // H5唤起APP组件
import VConsole from 'vconsole/dist/vconsole.min.js'; import VConsole from 'vconsole/dist/vconsole.min.js';
import { jsencrypt } from 'jsencrypt';
import { import {
CountDown, CountDown,
...@@ -38,6 +39,7 @@ Vue.prototype.$cookies = cookies; ...@@ -38,6 +39,7 @@ Vue.prototype.$cookies = cookies;
Vue.prototype.$rocNative = new rocNative(); Vue.prototype.$rocNative = new rocNative();
Vue.prototype.$sendBuriedData = sendBuriedData; Vue.prototype.$sendBuriedData = sendBuriedData;
Vue.prototype.$callApp = callApp; Vue.prototype.$callApp = callApp;
Vue.prototype.$jsencrypt = jsencrypt;
// Vue.use(PicaCallApp); // Vue.use(PicaCallApp);
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(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);
......
...@@ -74,14 +74,20 @@ export const getCaptchaGet = async () => { ...@@ -74,14 +74,20 @@ export const getCaptchaGet = async () => {
}) })
} }
// 获取公钥
export const getPublicKey = async () => {
return request({
url: `account/cipher/key`,
method: 'get'
})
}
// 获取短信验证码 // 获取短信验证码
export const getAuthCode = ({ mobilePhone, flag, captchaToken, captchaAnswer }) => { export const getAuthCode = (data) => {
return request({ return request({
url: `account/account/authCode`, url: `account/account/authCode`,
method: 'get', method: 'post',
params: { data: data,
mobilePhone, flag, captchaToken, captchaAnswer
},
}) })
} }
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册