Commit 55625764 authored by 实打实的's avatar 实打实的

工行迭代

parent 74796fa4
......@@ -11,7 +11,7 @@ export const homeInfo = {
"success": true
}
export const updateUinfo = {"code":"10004","data":null,"message":"昵称包含敏感词","success":true}
export const updateUinfo = { "code": "10004", "data": null, "message": "昵称包含敏感词", "success": true }
export const doshare = {
"code": null,
"data": true,
......@@ -80,16 +80,16 @@ export const signInfo = {
"message": null,
"success": true
}
const list=[]
for(let i=1;i<=20;i++){
const list = []
for (let i = 1; i <= 20; i++) {
list.push({ "bizType": "SUB", "credits": 100, "description": `每日签到${i}`, "gmtCreate": "2020-12-22 17:02:07" })
}
const list2=[]
for(let i=1;i<=5;i++){
const list2 = []
for (let i = 1; i <= 5; i++) {
list2.push({ "bizType": "SUB", "credits": 100, "description": `每日签到${i}`, "gmtCreate": "2020-12-22 17:02:07" })
}
const list3=[]
const list3 = []
export const pagelist = list
// export const pagelist = [
......@@ -118,6 +118,14 @@ export const dosign = {
"message": null,
"success": true
}
export const judgeAuthority = {
"code": 10012,
"data": {
"authority": "yes"
},
"message": null,
"success": true
}
// export const dosign ={
// "code": null,
......
......@@ -11,6 +11,7 @@ export default {
[`/projectx/${projectId}/e-family/update.do`]: efamily.updateUinfo,
[`/projectx/${projectId}/e-family/share.do`]: efamily.doshare,
[`/projectx/${projectId}/e-family/signInfo.do`]: efamily.signInfo,
[`/projectx/${projectId}/e-family/judgeAuthority.do`]: efamily.judgeAuthority,
[`/customActivity/icbcefamily/pageList`]: efamily.pagelist,
},
post: {
......
No preview for this file type
const {projectId} = CFG;
const { projectId } = CFG;
const apiCfg = {
ruledata: `/projectx/${projectId}/projectRule.query`,
homeinfo: `/projectx/${projectId}/e-family/index.do`,
updateUinfo: `/projectx/${projectId}/e-family/update.do`,
doshare: `/projectx/${projectId}/e-family/share.do`,
signInfo:`/projectx/${projectId}/e-family/signInfo.do`,
dosign:{
uri:`/projectx/${projectId}/e-family/sign.do`,
withToken:true,
signInfo: `/projectx/${projectId}/e-family/signInfo.do`,
dosign: {
uri: `/projectx/${projectId}/e-family/sign.do`,
withToken: true,
},
pageList:`/customActivity/icbcefamily/pageList`,
whitePerson:`/projectx/${projectId}/e-family/whitePerson.do`
pageList: `/customActivity/icbcefamily/pageList`,
whitePerson: `/projectx/${projectId}/e-family/whitePerson.do`,
judgeAuthority: {
method: 'get',
uri: `/projectx/${projectId}/e-family/judgeAuthority.do`,
withToken: true
}
}
export default apiCfg;
import apiCfg from './apicfg';
import {getPxToken} from "@spark/projectx";
import {callApi} from '@spark/api-base'
import { getPxToken } from "@spark/projectx";
import { callApi } from '@spark/api-base'
import {isFromShare, newUser} from 'duiba-utils';
import { isFromShare, newUser } from 'duiba-utils';
let mergeData = {
user_type: newUser ? '0' : '1',
......@@ -24,7 +24,7 @@ function getRequestParams(value) {
method: 'get'
}
} else if (typeof value === 'object') {
const {uri, method = 'post', headers, withToken, secret, secretKey} = value;
const { uri, method = 'post', headers, withToken, secret, secretKey } = value;
return {
uri,
method,
......@@ -44,11 +44,11 @@ function generateAPI(apiList) {
for (let key in apiList) {
let value = apiList[key];
const {method, uri, headers: mHeaders, withToken, secret, secretKey} = getRequestParams(value);
const { method, uri, headers: mHeaders, withToken, secret, secretKey } = getRequestParams(value);
api[key] = async (params = {}, headers) => {
let token;
if (withToken) {
const {type, payload} = await getPxToken();
const { type, payload } = await getPxToken();
switch (type) {
case 'success':
token = payload.token;
......@@ -59,12 +59,12 @@ function generateAPI(apiList) {
}
}
let mergedHeaders = {...mHeaders, ...headers}
let mergedHeaders = { ...mHeaders, ...headers }
if (withToken && token) {
params.token = token;
}
params = {...params, ...mergeData};
params = { ...params, ...mergeData };
const result = await callApi(uri, params, method, mergedHeaders, false, secret, secretKey);
if (result.type === 'success') {
......
'use strict';
import React, { Component } from 'react';
import { Toast } from '@spark/ui';
import resList from '../../resconfig/resList';
//import API from '../../api';
import API from '../../api';
import './task.less';
class Task extends Component {
constructor(props) {
super(props);
this.state = { resList: resList };
this.state = {
resList: resList,
flag: true
};
}
componentDidMount() {
this.judgeAuthority();
}
judgeAuthority = async () => {
const result = await API.judgeAuthority();
if (result && result.success) {
if (result.data.authority == 'yes') {
this.setState({
flag: false,
})
} else {
this.setState({
flag: true
})
}
} else {
Toast("网络错误,请刷新页面后重试");
}
}
toApplyCard = () => {
window.location.href = "https://elife.icbc.com.cn/OFSTCARD/creditCard/apply.do?channel=105BKRK0001000000000000000&coreCode=HZDW000174463&paraPromoCode=EW0004600000000EL01";
}
toPurchase = () => {
window.location.href = "https://ghjf.g-town.com.cn/activity/wsd.html?type=wsd";
}
render() {
return (
<div className="ren_wu_da_ting_jie_mian ">
<img className="bei_jing " src={this.state.resList['65a77904-29e0-45f4-9508-b2fe48bbe708'].url} />
<img className="bei_jing " src={this.state.resList['efe9d3d9-57ff-47a0-97ec-27847da411f9'].url} />
<div className="pai_zi ">
<img className="pai_zi_di_tu " src={this.state.resList['cc6efb64-16b2-4b10-9c43-e13735d76fcd'].url} />
<img className="xing_qiu_da_zuo_zhan " src={this.state.resList['144b92ac-5abf-4a61-b698-115894ac9d1e'].url} />
<img className="dong_wu_lian_meng " src={this.state.resList['676a2559-b5bd-4520-aab3-fd31795e6f3f'].url} />
<img className="pai_zi_di_tu " src={this.state.resList['89624160-97ff-4924-9d9b-1078ba3d2e65'].url} />
{this.state.flag && <img className="ban_li_wan_shi_da" src={this.state.resList['f2aea33a-42cd-4518-92e4-a79e80e8c487'].url} />}
{!this.state.flag && <img className="di_shi_ni_men_piao" src={this.state.resList['da5960d0-0d03-4dd8-9673-465c261d3ef2'].url} />}
<img className="xing_qiu_da_zuo_zhan " src={this.state.resList['654f2e6f-aea1-4555-979b-3ca520ed7381'].url} />
<img className="dong_wu_lian_meng " src={this.state.resList['b635ec14-2e70-4f6c-b304-d031e4b0b5d9'].url} />
</div>
<img
className="fan_hui_nong_chang_an_niu "
......@@ -24,7 +62,9 @@ class Task extends Component {
onClick={this.props.closeWin}
/>
<div className="jiao_hu_kuang ">
<img className="qian_jing " src={this.state.resList['2c4866b4-69c2-4008-88ab-be9461e8fe12'].url} />
<img className="qian_jing " src={this.state.resList['d9131617-ff12-4e1b-87ea-97304f2f5316'].url} />
{this.state.flag && <img className="qu_ban_li" src={this.state.resList['bd9cf4ad-19c0-42b7-a003-fd3a0e948215'].url} onClick={this.toApplyCard} />}
{!this.state.flag && <img className="qu_qiang_gou" src={this.state.resList['8d553195-1c36-4d3f-be97-34b0e697813e'].url} onClick={this.toPurchase} />}
<img
className="xing_qiu_da_zuo_zhan_qu_wan_wan "
src={this.state.resList['36bcd134-df2c-4957-b97f-0b8463b4481b'].url}
......
......@@ -6,43 +6,69 @@
display: block;
position: absolute;
top: 50%;
transform:translateY(-50%);
transform: translateY(-50%);
.bei_jing {
width: 750px;
height: 1624px;
opacity: 1;
position: absolute;
}
.pai_zi {
width: 663px;
height: 805px;
height: 986px;
opacity: 1;
left: 44px;
top: 390px;
// top: 390px;
top: 300px;
position: absolute;
.pai_zi_di_tu {
width: 663px;
height: 805px;
height: 986px;
opacity: 1;
position: absolute;
}
.xing_qiu_da_zuo_zhan {
width: 602px;
height: 256px;
opacity: 1;
left: 30px;
top: 171px;
// top: 427px;
top: 425.5px;
position: absolute;
}
.dong_wu_lian_meng {
width: 602px;
height: 256px;
opacity: 1;
left: 30px;
top: 464px;
top: 700px;
position: absolute;
}
.ban_li_wan_shi_da {
width: 602px;
height: 256px;
opacity: 1;
left: 30px;
top: 151px;
position: absolute;
}
.di_shi_ni_men_piao {
width: 602px;
height: 256px;
opacity: 1;
left: 30px;
top: 151px;
position: absolute;
}
}
.fan_hui_nong_chang_an_niu {
width: 105px;
height: 99px;
......@@ -51,38 +77,65 @@
top: 224px;
position: absolute;
}
.jiao_hu_kuang {
width: 750px;
height: 1303px;
// height: 1303px;
height: 1378px;
opacity: 1;
display: block;
left: 0px;
top: 321px;
// top: 321px;
top: 260px;
position: absolute;
.qian_jing {
width: 750px;
height: 1303px;
// height: 1303px;
height: 1378px;
opacity: 1;
top: 0px;
position: absolute;
}
.qu_ban_li {
width: 175px;
height: 52px;
opacity: 1;
display: block;
left: 285px;
top: 360px;
position: absolute;
}
.qu_qiang_gou {
width: 175px;
height: 52px;
opacity: 1;
display: block;
left: 285px;
top: 360px;
position: absolute;
}
.xing_qiu_da_zuo_zhan_qu_wan_wan {
width: 175px;
height: 52px;
opacity: 1;
display: block;
left: 285px;
top: 420px;
top: 635px;
position: absolute;
}
.dong_wu_lian_meng_qu_wan_wan {
width: 175px;
height: 52px;
opacity: 1;
display: block;
left: 285px;
top: 715px;
top: 910px;
position: absolute;
}
}
}
}
\ No newline at end of file
import { GDispatcher } from 'spark-wrapper-fyge';
import API from './api'
export const Store = {
homeinfo:"homeinfo",
ruledata:"ruledata",
updateUinfo:"updateUinfo",
doshare:"doshare",
signInfo:"signInfo",
dosign:"dosign",
homeinfo: "homeinfo",
ruledata: "ruledata",
updateUinfo: "updateUinfo",
doshare: "doshare",
signInfo: "signInfo",
dosign: "dosign",
judgeAuthority: "judgeAuthority",
//新手引导
needguide:"needguide",
newgoldnum:"newgoldnum",
needguide: "needguide",
newgoldnum: "newgoldnum",
}
//人物角色对应
export let Role = {
1:{
name:"熊猫1男",
figureid:1,
1: {
name: "熊猫1男",
figureid: 1,
},
2:{
name:"熊猫2女",
figureid:2,
2: {
name: "熊猫2女",
figureid: 2,
},
3:{
name:"熊猫3墨镜",
figureid:3,
3: {
name: "熊猫3墨镜",
figureid: 3,
}
}
export const netErrMsg = "活动太火爆了,请稍后再试";
export async function getAPIdata(netname,reqdata=null){
export async function getAPIdata(netname, reqdata = null) {
let apidata;
try{
if(reqdata){
try {
if (reqdata) {
apidata = await API[netname](reqdata);
}else{
} else {
apidata = await API[netname]();
}
}catch(e){
} catch (e) {
console.log(e)
}
return apidata;
}
export async function getHomeInfo(){
export async function getHomeInfo() {
let homeinfo = await getAPIdata(Store.homeinfo);
// homeinfo = {
// "code": null,
......@@ -57,9 +58,9 @@ export async function getHomeInfo(){
// "message": null,
// "success": true
// }
if(homeinfo&&homeinfo.success&&homeinfo.data){
dataCenter.setData(Store.homeinfo,homeinfo.data);
if (homeinfo && homeinfo.success && homeinfo.data) {
dataCenter.setData(Store.homeinfo, homeinfo.data);
}
}
......@@ -69,7 +70,7 @@ const Datas = new Map();
const dataCenter = {
setData: (key, value) => {
Datas.set(key, value);
if(key==Store.homeinfo||key==Store.needguide){
if (key == Store.homeinfo || key == Store.needguide) {
GDispatcher.dispatchEvent(key)
}
},
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment