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