提交 206c6990 编写于 作者: huangwensu's avatar huangwensu

活动首页接口联调

上级 38101a67
<template> <template>
<div class="detail-list br"> <div class="detail-list br">
<ul v-show="!dataList.length"> <div v-if="dataList.length">
<ul>
<li class="list" v-for="(item, index) in dataList" :key="index"> <li class="list" v-for="(item, index) in dataList" :key="index">
<img src="../../assets/type-2.png" alt=""> <!-- 1.课程 2.考试 3.调查问卷 4.患者招募 5.宣教漫画 6.打卡 7.邀请 8.任务排查 9.绑定居民到微信-->
<img v-if="item.resourceType == 1" src="../../static/images/task-two.png" />
<img v-if="item.resourceType == 3" src="../../static/images/task-five.png" />
<img v-if="item.resourceType == 7" src="../../static/images/task-one.png" />
<img v-if="item.resourceType == 8" src="../../static/images/task-three.png" />
<img v-if="item.resourceType == 9" src="../../static/images/task-four.png" />
<img v-if="item.resourceType == 10" src="../../static/images/task-six.png" />
<ul class="desc"> <ul class="desc">
<li class="text">邀请居民做健康排查</li> <li class="text">{{item.taskName}}</li>
<li class="time">2019.12.15 10:35</li> <li class="time">{{item.sortFinishTime}}</li>
</ul> </ul>
<span class="score"><span>+5</span>勤奋分</span> <span class="score"><span>+{{getRewardType(item.timsRewardResp)}}</span>勤奋分</span>
</li> </li>
</ul> </ul>
<div v-show="dataList.length" class="no-content"> <DetailBtn
style="margin-top: 30px;"
btnText="获得更多勤奋分"
:isFixed="!isFixed"
:needBT="needBT"
btnWidth="100%" />
</div>
<div v-if="!dataList.length" class="no-content">
<img src="../../assets/no-content.png" alt=""> <img src="../../assets/no-content.png" alt="">
<div class="text">暂无记录,您还没有参加活动</div> <div class="text">暂无记录,您还没有参加活动</div>
<DetailBtn style="margin-top: 30px;" btnText="立即参加" :isFixed="isFixed" btnWidth="50%"></DetailBtn> <DetailBtn
style="margin-top: 30px;"
btnText="立即参加"
:isFixed="isFixed"
btnWidth="50%" />
</div> </div>
</div> </div>
</template> </template>
...@@ -26,14 +44,30 @@ export default { ...@@ -26,14 +44,30 @@ export default {
props: { props: {
dataList: { dataList: {
type: Array, type: Array,
default: () => [0, 1, 3,0, 1, 3,0, 1, 3,0, 1, 3, 4] default: () => []
} }
}, },
data() { data() {
return { return {
needBT: true,
isFixed: false isFixed: false
} }
}, },
created() {
},
methods: {
getRewardType(data) {
if(data && data.length > 0) {
for(let i = 0;i < data.length;i++) {
if(data[i].rewardType == 3) {
return data[i].rewardQuantity;
}
}
}
}
}
} }
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -33,10 +33,6 @@ export default { ...@@ -33,10 +33,6 @@ export default {
type: Number | String, type: Number | String,
default: 300 default: 300
}, },
// isLogin: {
// type: Boolean | String,
// default: true
// },
statusTextList: { statusTextList: {
type: Array, type: Array,
default: () => ['100勤奋分', '200勤奋分', '300勤奋分'] default: () => ['100勤奋分', '200勤奋分', '300勤奋分']
...@@ -50,6 +46,11 @@ export default { ...@@ -50,6 +46,11 @@ export default {
userMobile(n, o) { userMobile(n, o) {
this.isLogin = n ? true : false; this.isLogin = n ? true : false;
this.init(); this.init();
},
minValue(n, o) {
if(n) {
this.init();
}
} }
}, },
data() { data() {
...@@ -68,9 +69,7 @@ export default { ...@@ -68,9 +69,7 @@ export default {
let htmlText = '登录后完成任务,就能获得瓜分云鹊豆的资格啦!'; let htmlText = '登录后完成任务,就能获得瓜分云鹊豆的资格啦!';
if(!this.isLogin) return htmlText; if(!this.isLogin) return htmlText;
let minValue = this.minValue, activeNum = 0, activeWidth; let minValue = this.minValue, activeNum = 0, activeWidth;
if(minValue <= 50) { if(minValue < 100 ) {
htmlText = `已经获得<span style="color: #FFE8A5">${minValue}</span>勤奋分啦,继续努力就能瓜分100万云鹊豆!`
} else if(minValue < 100 ) {
htmlText = `还差<span style="color">${100 - minValue}</span>分,就有资格瓜分<span style="color: #FFE8A5">100</span>万云鹊豆啦!` htmlText = `还差<span style="color">${100 - minValue}</span>分,就有资格瓜分<span style="color: #FFE8A5">100</span>万云鹊豆啦!`
} else if(minValue < 200) { } else if(minValue < 200) {
htmlText = `已经有资格瓜分<span style="color: #FFE8A5">100</span>万云鹊豆啦,继续努力还能瓜分<span style="color: #FFE8A5">200</span>万!` htmlText = `已经有资格瓜分<span style="color: #FFE8A5">100</span>万云鹊豆啦,继续努力还能瓜分<span style="color: #FFE8A5">200</span>万!`
......
...@@ -23,6 +23,10 @@ import './index.less'; ...@@ -23,6 +23,10 @@ import './index.less';
export default { export default {
name: 'Header', name: 'Header',
props: { props: {
isWeb: {
type: Boolean,
default: false
},
isScroll: { isScroll: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -35,10 +39,6 @@ export default { ...@@ -35,10 +39,6 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
isInNotice: {
type: Boolean,
default: false
},
token: { token: {
type: String, type: String,
default: '' default: ''
...@@ -75,15 +75,16 @@ export default { ...@@ -75,15 +75,16 @@ export default {
let shareUrl = ''; let shareUrl = '';
const { NUXT_ENV_APP } = process.env; const { NUXT_ENV_APP } = process.env;
const { tempId, token, shareTitle1, shareTitle2, shareIconUrl } = this; const { tempId, token, shareTitle1, shareTitle2, shareIconUrl } = this;
shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + '/template_v2/?id=' + tempId + '&token=' + token; //shareUrl = ENV_CONFIG[NUXT_ENV_APP]['shareUrl'] + '/compaign_ssr/?id=' + tempId + '&token=' + token;
const h5title = encodeURIComponent(shareTitle1); shareUrl = 'http://10.177.10.217:3000/compaign_ssr/login-point?id=' + tempId + '&token=' + token;
const h5desc = encodeURIComponent(shareTitle2);
const { id } = this.$route.query; // const { id } = this.$route.query;
this.$sendBuriedData({ // this.$sendBuriedData({
component_tag: `200#400089#${id}#${shareTitle1}` // class_name: '',
}); // component_tag: `200#400089#${id}#${shareTitle1}`
// });
this.$rocNative.shareWechat({ this.$rocNative.shareWechat({
type: 7, type: 6,
shareId: 0, shareId: 0,
shareUrl: shareUrl, shareUrl: shareUrl,
title1: shareTitle1, title1: shareTitle1,
......
...@@ -65,6 +65,10 @@ export default { ...@@ -65,6 +65,10 @@ export default {
userMobile: { userMobile: {
type: String, type: String,
default: '' default: ''
},
isWeb: {
type: Boolean,
default: false
} }
}, },
watch: { watch: {
...@@ -89,7 +93,7 @@ export default { ...@@ -89,7 +93,7 @@ export default {
}, },
methods: { methods: {
linkPage(item) { linkPage(item) {
if(!this.userMobile || !this.tokenFlag) { if(!this.userMobile) {
this.$rocNative.gotoLogin(); this.$rocNative.gotoLogin();
}else { }else {
// let flag = item.timeStatus == 1 && ((item.finishFrequency == item.doctorFinishFrequency) && item.resourceType != 8); // let flag = item.timeStatus == 1 && ((item.finishFrequency == item.doctorFinishFrequency) && item.resourceType != 8);
...@@ -97,8 +101,8 @@ export default { ...@@ -97,8 +101,8 @@ export default {
// if(item.timeStatus == 2 || flag || flag1) { // 已结束 、 已完成不可点击 // if(item.timeStatus == 2 || flag || flag1) { // 已结束 、 已完成不可点击
// return; // return;
// }else { // }else {
if(!this.clickFlag) return; // if(!this.clickFlag) return;
if(!this.isWeb) { this.clickFlag = false; } // if(!this.isWeb) { this.clickFlag = false; }
let data = { let data = {
id: item.id, id: item.id,
href: item.linkId, href: item.linkId,
...@@ -116,7 +120,7 @@ export default { ...@@ -116,7 +120,7 @@ export default {
if(self.isWeb) { if(self.isWeb) {
req = { req = {
id: acTempId, id: acTempId,
token: getCookie('token') || '2B7FA4D845C74D7EA3183F9E316630C6' token: cookies.get('token') || '2B7FA4D845C74D7EA3183F9E316630C6'
} }
}else { }else {
req = { req = {
...@@ -126,12 +130,12 @@ export default { ...@@ -126,12 +130,12 @@ export default {
} }
getNewActivityDesc({ id: req.id, token: req.token }).then(res => { getNewActivityDesc({ id: req.id, token: req.token }).then(res => {
if(res.code == '000000') { if(res.code == '000000') {
if(res.data.loginStatus == 2) { // 未登录 或者token失效 // if(res.data.loginStatus == 2) { // 未登录 或者token失效
cookies.remove('token'); // cookies.remove('token');
this.tokenFlag = false; // this.tokenFlag = false;
}else { // }else {
this.tokenFlag = true; // this.tokenFlag = true;
} // }
this.taskList = res.data.taskRuleData; this.taskList = res.data.taskRuleData;
for(let i = 0; i < this.taskList.length; i++) { for(let i = 0; i < this.taskList.length; i++) {
if(this.taskList[i].resourceType == 7 && this.taskList[i].resourceId == 2) { if(this.taskList[i].resourceType == 7 && this.taskList[i].resourceId == 2) {
......
...@@ -2769,6 +2769,11 @@ ...@@ -2769,6 +2769,11 @@
"schema-utils": "^1.0.0" "schema-utils": "^1.0.0"
} }
}, },
"callapp-lib": {
"version": "2.1.8",
"resolved": "http://192.168.110.93:4873/callapp-lib/-/callapp-lib-2.1.8.tgz",
"integrity": "sha512-9FUmTz0LCCF43LhiMEN3CJ4RuLGppu8hOn0u9UzUFyd7TU7AXW82Zc9qTq4Mfes36yOGqNYO1v8DJdkQY7+7rA=="
},
"caller-callsite": { "caller-callsite": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz",
...@@ -9230,6 +9235,33 @@ ...@@ -9230,6 +9235,33 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"dev": true "dev": true
}, },
"pica-call-app": {
"version": "1.0.42",
"resolved": "http://192.168.110.93:4873/pica-call-app/-/pica-call-app-1.0.42.tgz",
"integrity": "sha512-SV1Ipa02GU3lT1cPC1qVD1GfiqHdFvXUA2TdxdncqTVUbqfJ27FlT+Beu3eWu9GdqDI5nRnu0sGk+pwH0QcsIA==",
"requires": {
"callapp-lib": "^2.1.7",
"vant": "^1.4.2"
},
"dependencies": {
"@vant/icons": {
"version": "1.1.7",
"resolved": "http://192.168.110.93:4873/@vant%2ficons/-/icons-1.1.7.tgz",
"integrity": "sha1-KVYa3/+mp1DSedzNvpppt0OTTz8="
},
"vant": {
"version": "1.6.28",
"resolved": "http://192.168.110.93:4873/vant/-/vant-1.6.28.tgz",
"integrity": "sha512-yGiQFPA7tmvlA05ezWg2MnknDK2OKlHmJurvHm2mWt1zdjfiVDJj+XFh6xMY8jZUsBZMWqdBSc+gAKzII8fOqg==",
"requires": {
"@babel/runtime": "^7.4.3",
"@vant/icons": "1.1.7",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3",
"vue-lazyload": "1.2.3"
}
}
}
},
"picomatch": { "picomatch": {
"version": "2.0.7", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz",
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
"nuxt": "^2.0.0", "nuxt": "^2.0.0",
"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"
}, },
"devDependencies": { "devDependencies": {
"@nuxtjs/axios": "^5.5.4", "@nuxtjs/axios": "^5.5.4",
......
<template> <template>
<div class="container"> <div class="container">
<Header <Header
:isWeb="isWeb"
:token="token" :token="token"
:is-scroll="isScroll" :is-scroll="isScroll"
:share-title1="shareTitle1" :share-title1="shareTitle1"
...@@ -16,8 +17,8 @@ ...@@ -16,8 +17,8 @@
<div class="progress-container"> <div class="progress-container">
<div class="score-info"> <div class="score-info">
<div v-if="userMobile" class="text"> <div v-if="userMobile" class="text">
<img src="../static/images/task-four.png" /> <img :src="myAvatarl" />
<span class="tc">我的勤奋分<span>{{12345}}</span></span> <span class="tc">我的勤奋分<span>{{myScore}}</span></span>
<span class="bt" @click="selfInfo">个人明细 ></span> <span class="bt" @click="selfInfo">个人明细 ></span>
</div> </div>
<div v-if="!userMobile" class="text"> <div v-if="!userMobile" class="text">
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
<status-bar <status-bar
class="progress-bar" class="progress-bar"
:userMobile="userMobile" :userMobile="userMobile"
:minValue="minValue" :minValue="myScore"
:maxValue="maxValue"/> :maxValue="maxValue"/>
</div> </div>
</div> </div>
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
:stepText="stepText1" :stepText="stepText1"
:stepTime="stepTime1"/> :stepTime="stepTime1"/>
<task-activity <task-activity
:isWeb="isWeb"
:acToken="token" :acToken="token"
:userMobile="userMobile" :userMobile="userMobile"
:acTempId="activityId" :acTempId="activityId"
...@@ -73,7 +75,12 @@ import TaskActivity from '../components/task-activity'; ...@@ -73,7 +75,12 @@ import TaskActivity from '../components/task-activity';
import Header from '../components/header/index'; import Header from '../components/header/index';
import Step from '../components/step'; import Step from '../components/step';
import StatusBar from '../components/bussiness/status-bar'; import StatusBar from '../components/bussiness/status-bar';
import { checkToken, selectAppModuleParam } from "@/service"; import {
checkToken,
selectAppModuleParam,
getSelfAllScore } from "@/service";
import { setEventByModuleCode } from "@/utils"
import { ENV_CONFIG } from '@/utils/enumerate';
const cookies = require('cookie-universal')(); const cookies = require('cookie-universal')();
export default { export default {
...@@ -89,7 +96,7 @@ export default { ...@@ -89,7 +96,7 @@ export default {
isLogin: false, isLogin: false,
userMobile: '', userMobile: '',
stepFlag: true, stepFlag: true,
isWeb: true, isWeb: false,
activityId: 0, activityId: 0,
token: '', token: '',
shareTitle1: '', shareTitle1: '',
...@@ -108,8 +115,9 @@ export default { ...@@ -108,8 +115,9 @@ export default {
numText3: 3, numText3: 3,
stepText3: '公布排名获奖名单', stepText3: '公布排名获奖名单',
stepTime3:'4月3日10:00-4月7日16:00', stepTime3:'4月3日10:00-4月7日16:00',
minValue: 50, maxValue: 200,
maxValue: 200 myAvatarl: '',
myScore: 0
} }
}, },
async asyncData({ $axios }) { async asyncData({ $axios }) {
...@@ -122,10 +130,14 @@ export default { ...@@ -122,10 +130,14 @@ export default {
let _this = this; let _this = this;
if (process.client) { if (process.client) {
_this.activityId = _this.$route.query.id || 9; _this.activityId = _this.$route.query.id || 9;
_this.isWeb = _this.$rocNative.isWeb;
window.__refresh = function() { window.__refresh = function() {
_this.getUserInfo(); _this.getUserInfo();
} }
} }
if(!_this.isWeb && _this.$rocNative.appInit()){
_this.getUserInfo();
};
}, },
methods: { methods: {
getUserInfo() { getUserInfo() {
...@@ -143,10 +155,19 @@ export default { ...@@ -143,10 +155,19 @@ export default {
}else { }else {
_this.userMobile = params.userMobile; _this.userMobile = params.userMobile;
cookies.set('token', _this.token); cookies.set('token', _this.token);
_this.getSelfAllScore();
} }
}) })
}); });
}, },
// 获取个人信息
getSelfAllScore() {
let _this = this;
getSelfAllScore({ id: this.activityId, token: this.token }).then(res => {
_this.myAvatarl = res.data.avatarImageUrl;
_this.myScore = res.data.totalScore;
})
},
// 查看活动规则 // 查看活动规则
ruleDetail() { ruleDetail() {
this.$router.push({path: "/login-point/point-result",query: {}}); this.$router.push({path: "/login-point/point-result",query: {}});
...@@ -161,13 +182,31 @@ export default { ...@@ -161,13 +182,31 @@ export default {
}, },
// 查看个人明细 // 查看个人明细
selfInfo() { selfInfo() {
this.$router.push({path: "/perdetails",query: {}}); let queryData = {
id: this.activityId,
avatarImage: this.myAvatarl,
score: this.myScore,
token: this.token
};
this.$router.push({path: "/perdetails",query: queryData});
}, },
// 活动任务 // 活动任务
activityTaskJump(data) { activityTaskJump(data) {
if(data.resourceType == 7) { // 去邀请 if(data.resourceType == 7) { // 邀请好友点赞
let shareUrl = '';
}else if(data.resourceType == 8) { // 绑定居民微信 const { NUXT_ENV_APP } = process.env;
const { tempId, 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?id=' + tempId + '&token=' + token;
this.$rocNative.shareWechat({
type: 6,
shareId: 0,
shareUrl: shareUrl,
title1: shareTitle1,
title2: shareTitle2,
shareImageUrl: shareIconUrl || 'https://file.yunqueyi.com/logo.png?version=' + new Date().getTime()
});
}else if(data.resourceType == 9) { // 绑定居民微信
}else { }else {
this.jumpPage(data.href, data.id); this.jumpPage(data.href, data.id);
...@@ -187,7 +226,6 @@ export default { ...@@ -187,7 +226,6 @@ export default {
if(loginFlag){ if(loginFlag){
_this.$rocNative.getToken().then(res => { _this.$rocNative.getToken().then(res => {
const { userToken } = res; const { userToken } = res;
// alert('APP拿到的token=:'+userToken)
checkToken({ token: userToken }).then(res=>{ checkToken({ token: userToken }).then(res=>{
if(res.code == '200000' || res.code == '200006') { if(res.code == '200000' || res.code == '200006') {
_this.$rocNative.gotoLogin(); _this.$rocNative.gotoLogin();
...@@ -203,10 +241,8 @@ export default { ...@@ -203,10 +241,8 @@ export default {
}, },
// 原先的点击图片跳转逻辑 // 原先的点击图片跳转逻辑
oldJumpHandle(itemData, token){ oldJumpHandle(itemData, token){
// 不改动原先逻辑
if (itemData.code == 'M301') { if (itemData.code == 'M301') {
itemData.code = 'M300'; itemData.code = 'M300';
//鉴权 自己调用token
this.$rocNative.getToken().then(res => { this.$rocNative.getToken().then(res => {
const { userToken } = res; const { userToken } = res;
setCookie('token', userToken); setCookie('token', userToken);
......
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
}, },
getCourse() { getCourse() {
this.$router.push({path: "/login-point/point-result",query: {}});
} }
} }
} }
......
...@@ -54,10 +54,12 @@ export default { ...@@ -54,10 +54,12 @@ export default {
}, },
methods: { methods: {
openApp() { openApp() {
// let path = window.location.origin + window.location.hash;
let path = "http://10.177.10.217:3000/compaign_ssr/";
this.$callApp(path);
}, },
downloadApp() { downloadApp() {
window.location.href = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.picahealth.yunque';
} }
} }
} }
......
...@@ -9,27 +9,28 @@ ...@@ -9,27 +9,28 @@
<article class="user"> <article class="user">
<img class="user-img" src="../../assets/user-header.png" alt=""> <img class="user-img" src="../../assets/user-header.png" alt="">
<div class="profile"> <div class="profile">
<img src="../../assets/user-header.png" alt=""> <img :src="avatalImage" alt="">
<div class="desc"> <div class="desc">
<span class="score">22345</span> <span class="score">{{allScore}}</span>
<span class="text">我的勤奋分</span> <span class="text">我的勤奋分</span>
</div> </div>
</div> </div>
</article> </article>
<DetailList></DetailList> <DetailList :dataList="taskDataList"></DetailList>
<DetailBtn v-show="false" needBT=true @btnClick="goBack"></DetailBtn> <!-- <DetailBtn v-show="false" needBT=true @btnClick="goBack"></DetailBtn> -->
</section> </section>
</section> </section>
</template> </template>
<script> <script>
import DetailList from '@/components/bussiness/detail-list'; import DetailList from '@/components/bussiness/detail-list';
import DetailBtn from '@/components/bussiness/detail-btn'; // import DetailBtn from '@/components/bussiness/detail-btn';
import Header from '../../components/header'; import Header from '../../components/header';
import { getSelfActivity } from "@/service";
export default { export default {
components: { components: {
Header, Header,
DetailList, DetailList,
DetailBtn // DetailBtn
}, },
data() { data() {
return { return {
...@@ -38,8 +39,20 @@ export default { ...@@ -38,8 +39,20 @@ export default {
shareTitle2: '', shareTitle2: '',
shareIconUrl: '', shareIconUrl: '',
isScroll: true, isScroll: true,
activityId: 0,
avatalImage: '',
allScore: 0,
token: '',
taskDataList: []
} }
}, },
created() {
this.activityId = this.$route.query.id;
this.avatalImage = this.$route.query.avatarImage;
this.allScore = this.$route.query.score;
this.token = this.$route.query.token;
this.getSelfActivity();
},
methods: { methods: {
goBack() { goBack() {
if(this.$rocNative.isWeb) { if(this.$rocNative.isWeb) {
...@@ -48,7 +61,15 @@ export default { ...@@ -48,7 +61,15 @@ export default {
this.$rocNative.goBack(); this.$rocNative.goBack();
} }
}, },
}, // 获取个人明细列表
getSelfActivity() {
getSelfActivity({id: this.activityId, token: this.token}).then(res => {
if(res.data.personalDetails && res.data.personalDetails.length > 0) {
this.taskDataList = res.data.personalDetails;
}
})
}
}
} }
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -2,6 +2,7 @@ import Vue from 'vue'; ...@@ -2,6 +2,7 @@ import Vue from 'vue';
import { BASE_URL } from '@/utils/enumerate'; import { BASE_URL } from '@/utils/enumerate';
import rocNative from '@/utils/jsbridge'; 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 VConsole from 'vconsole/dist/vconsole.min.js' import VConsole from 'vconsole/dist/vconsole.min.js'
const { name } = require('../package.json'); const { name } = require('../package.json');
...@@ -16,6 +17,9 @@ if(!(process.env.NODE_ENV === 'uat' || process.env.NODE_ENV === 'pro')) { ...@@ -16,6 +17,9 @@ if(!(process.env.NODE_ENV === 'uat' || process.env.NODE_ENV === 'pro')) {
Vue.prototype.$cookies = cookies; 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.use(PicaCallApp);
if (name === 'nuxt_ssr') throw Error('需要给当前项目起一个有意义的名称,多英文单词用 _ 拼接,不能有空格。修改文件:package.json (name)'); if (name === 'nuxt_ssr') throw Error('需要给当前项目起一个有意义的名称,多英文单词用 _ 拼接,不能有空格。修改文件:package.json (name)');
// Vue.use(WebBuriedPoint, { // Vue.use(WebBuriedPoint, {
......
...@@ -36,3 +36,25 @@ export const selectAppModuleParam = async ({id, token }) => { ...@@ -36,3 +36,25 @@ export const selectAppModuleParam = async ({id, token }) => {
}); });
} }
// 活动首页个人信息
export const getSelfAllScore = async (data) => {
const { id, token } = data;
return request({
url: `/campaign/tims/getCumulativeReward?activityId=${id}&token=${token}&setEntry=true`,
headers: {
token
}
});
}
// 个人明细
export const getSelfActivity = async (data) => {
const { id, token } = data;
return request({
url: `/campaign/tims/personalDetails?activityId=${id}&token=${token}&setEntry=true`,
headers: {
token
}
});
}
...@@ -62,6 +62,43 @@ export const delCookie = (cname) => { ...@@ -62,6 +62,43 @@ export const delCookie = (cname) => {
} }
} }
export const setEventByModuleCode = (itemData, token) => {
let modeCode = itemData.code || '';
let paramList = itemData.paramList ? itemData.paramList : '';
if (modeCode === 'M001' || modeCode === 'M002' || modeCode === 'M003') {
paramList = '';
} else if (
modeCode === 'M100' ||
modeCode === 'M300' ||
modeCode === 'M500' || modeCode === 'M301'
) {
let urlPara = getUrlParmByCode(paramList, token);
paramList[0] && (paramList[0].value += urlPara);
// 前端拼接了数据,原生不用再拼接
paramList = paramList.slice(0, 1)
}
if (typeof paramList === 'string' && !paramList) {
paramList = [];
}
return paramList;
}
function getUrlParmByCode(paramList, token) {
if (paramList.length <= 1) return `?token=${token}`;
let dataStr = '', list = [];
let str = paramList.length > 0 && paramList[0].value.indexOf('?') > -1 ? '&' : '?';
for (let i = 1; i < paramList.length; i++) {
list.push(paramList[i].key + '=' + encodeURI(paramList[i].value));
}
dataStr = list.join('&');
if (dataStr !== '') return `${str}${dataStr}&token=${token}`;
return `${str}token=${token}`;
}
export const getConfigByEvtType = key => { export const getConfigByEvtType = key => {
return ENV_CONFIG[NUXT_ENV_APP][key]; return ENV_CONFIG[NUXT_ENV_APP][key];
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册