Commit abf50c06 authored by wildfirecode13's avatar wildfirecode13

Merge branch 'master' of gitlab2.dui88.com:wildfirecode13/icbcrpg

parents 239b2c4c d82767b4
No preview for this file type
project/public/assets/guide1.png

162 KB | W: | H:

project/public/assets/guide1.png

49.7 KB | W: | H:

project/public/assets/guide1.png
project/public/assets/guide1.png
project/public/assets/guide1.png
project/public/assets/guide1.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -10,6 +10,8 @@
<script id="scriptjs" src="//yun.duiba.com.cn/js-libs/px-token/0.0.4/px-token.min.js"></script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.0/rem.min.js"></script>
<script src="//yun.duiba.com.cn/h5/lib/zepto.min.js"></script>
<script src="http://yun.duiba.com.cn/db_games/libs0924/svgaParser.minWeb.js"></script>
<script>
function getApp() {
return {
......
......@@ -2,7 +2,7 @@
import { Toast } from '@spark/ui';
import React, { Component } from 'react';
import dataCenter, { getAPIdata, netErrMsg, Role, Store } from '../../dataCenter';
import dataCenter, { getAPIdata, getHomeInfo, netErrMsg, Role, Store } from '../../dataCenter';
import resList from '../../resconfig/resList'; //import API from '../../api';
import './select.less';
......@@ -130,7 +130,14 @@ class Select extends Component {
nickName:planame,
figureId:Role[this.nshowidx].figureid
});
// updateuinfo = {
// "code": null,
// "data": true,
// "message": null,
// "success": true
// }
if(updateuinfo&&updateuinfo.success){
getHomeInfo();
this.props.onClose();
dataCenter.setData(Store.needguide,true);
}else{
......
......@@ -43,7 +43,19 @@ export async function getAPIdata(netname,reqdata=null){
}
export async function getHomeInfo(){
let homeinfo = await getAPIdata(Store.homeinfo);
// homeinfo = {
// "code": null,
// "data": {
// "canUpdateNickName": null,
// "figures": [
// { "figureId": "1" }, { "figureId": "2" }, { "figureId": "3" }
// ],
// "newUser": true,
// "userInfo": null
// },
// "message": null,
// "success": true
// }
if(homeinfo&&homeinfo.success&&homeinfo.data){
dataCenter.setData(Store.homeinfo,homeinfo.data);
}
......
This diff is collapsed.
......@@ -6,8 +6,8 @@ import API from '../../api';
import { Aup, AUPOP, AUP_MBX_STATE } from '../../pop';
import './main3.less';
import { CanvasWidget } from 'spark-utils';
import { Guideact } from '@spark/guideact';//'./bundle';//
import { widgetConfig } from './widgetConfig';
import { Guideact } from './bundle';//'@spark/guideact';//
import { getStepData, widgetConfig } from './widgetConfig';
import { GDispatcher } from "spark-wrapper-fyge"
import dataCenter, { Store } from '../../dataCenter';
let _widget;
......@@ -23,7 +23,7 @@ class Main3 extends Component {
};
}
updateMoney(){
updateMoney() {
console.log('update money')
}
......@@ -33,7 +33,7 @@ class Main3 extends Component {
}
onClick_signBtn = () => {
API.signInfo().then((res)=>{
API.signInfo().then((res) => {
Aup.show('Sign', res.data, this);
})
}
......@@ -55,15 +55,15 @@ class Main3 extends Component {
}
componentDidMount() {
this.freshHomeInfo();
this.initEvent();
if( this.props.data &&!this.props.data.isnewUser) { //不是新用户
API.signInfo().then((res)=>{
const {needPopup} =res.data;
if(needPopup)
Aup.show('Sign', res.data, this);
});
this.freshHomeInfo();
}
}
initEvent() {
......@@ -99,327 +99,8 @@ class Main3 extends Component {
}
//新手引导的位置设定
setGuideConfig() {
let clientWidth = document.body.clientWidth;
let clientHeight = document.body.clientHeight;
let canvaswid = 750;
let canvashei = clientHeight * 750 / clientWidth;
console.log("CANVAS宽高===》", canvaswid, canvashei);
let holedata = {
holetype: "cirect",
holex: 15,
holey: 33,
holesize: [
395,
112,
70
]
}
let txtdata = {
text: "您可以在此处编辑信息查看欢趣豆数量",
txtwidth: 750,
txtx: 0,
txty: 224,
txtalign: "center"
}
let roledata = [
{
rolex: 375,
roley: 911,
roletex: "guide2_1"
}
];
let nextbtndata = {
btnx: 485,
btny: 303,
btntex: "nextbtn"
}
let skipbtndata = {
skipx: (canvaswid - 107) / 2,
skipy: canvashei - 200,
skiplevel: 9,
skiptex: "skipbtn",
};
let touchdata = {
touchx: 0,
touchy: 0,
touchsize: [
canvaswid,
canvashei
]
}
this.guideconfig[1] = {
hole: null,
txt: null,
role: [
{
rolex: 40,
roley: (canvashei - 764) / 2,
roletex: "guide1"
}
],
nextbtn: null,
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 1,
stepdata: this.guideconfig[1]
});
this.guideconfig[2] = {
hole: {
holetype: "cirect",
holex: 15,
holey: 33,
holesize: [
395,
112,
70
]
},
txt: {
text: "您可以在此处编辑信息查看欢趣豆数量",
txtwidth: 750,
txtx: 0,
txty: 224,
txtalign: "center"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 485,
btny: 303,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 2,
stepdata: this.guideconfig[2]
});
this.guideconfig[3] = {
hole: {
holetype: "cirect",
holex: 600,
holey: 26,
holesize: [
135,
440,
40
]
},
txt: {
text: "点击图标您可查看规则、进行分享和签到\n \n偷偷告诉您,连签7天可获得大额欢趣豆哦~",
txtwidth: 455,
txtx: 100,
txty: 245,
txtalign: "left"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 100,
btny: 520,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 3,
stepdata: this.guideconfig[3]
});
this.guideconfig[4] = {
hole: {
holetype: "cir",
holex: 185,
holey: 465,
holesize: [
165,
440
]
},
txt: {
text: "欢趣豆可以兑换立减金,\n进入趣赶集即可进行\n兑换哦~",
txtwidth: 375,
txtx: 375,
txty: 357,
txtalign: "left"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 375,
btny: 536,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 4,
stepdata: this.guideconfig[4]
});
this.guideconfig[5] = {
hole: {
holetype: "cir",
holex: 540,
holey: 600,
holesize: [
165,
440
]
},
txt: {
text: "农场主集结~在这里\n就是向往的生活!\n收获成果的同时还可\n以兑换丰厚礼物哦",
txtwidth: 320,
txtx: 55,
txty: 580,
txtalign: "left"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 55,
btny: 780,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 5,
stepdata: this.guideconfig[5]
});
this.guideconfig[6] = {
hole: {
holetype: "cir",
holex: 170,
holey: 820,
holesize: [
165,
440
]
},
txt: {
text: "点击任务大厅,进入\n任务界面,完成任务\n可获得好礼哦~",
txtwidth: 375,
txtx: 375,
txty: 500,
txtalign: "left"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 375,
btny: 665,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 6,
stepdata: this.guideconfig[6]
});
let offsety7 = 0;
let holly = 1110;
if((holly+165/2)>canvashei-300){
let holly1 = canvashei-300-165/2;
offsety7 = holly-holly1;
}
this.guideconfig[7] = {
hole: {
holetype: "cir",
holex: 575,
holey: 1110-offsety7,
holesize: [
165,
440
]
},
txt: {
text: "点击小卖铺可以进到\n商城页面,在这里购\n买心仪的物品哦~",
txtwidth: 320,
txtx: 85,
txty: 500-offsety7,
txtalign: "left"
},
role :[
{
rolex: 0,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 86,
btny: 665-offsety7,
btntex: "nextbtn"
},
skipbtn: {
skipx: (canvaswid - 107) / 2,
skipy: canvashei - 200,
skiplevel: 6,
skiptex: "skipbtn",
},
touch: touchdata,
pagey: offsety7,
}
console.log("77777偏移===》",offsety7);
_widget && _widget.dispatchInEvent("setStepData", {
step: 7,
stepdata: this.guideconfig[7]
});
this.guideconfig = getStepData();
_widget && _widget.dispatchInEvent("setStepConfig", this.guideconfig);
this.startGuide();
}
startGuide() {
......@@ -434,9 +115,9 @@ class Main3 extends Component {
case "guidecomplete":
dataCenter.setData(Store.needguide, false);
API.signInfo().then((res)=>{
const {needPopup} =res.data;
if(needPopup)
API.signInfo().then((res) => {
const { needPopup } = res.data;
if (needPopup)
Aup.show('Sign', res.data, this);
})
break;
......@@ -444,9 +125,10 @@ class Main3 extends Component {
case "nowstep":
//当前所处引导步骤
let nowstepdata = this.guideconfig[payload];
if (nowstepdata) {
let nowpagey = nowstepdata.pagey;
this.refs.main3.scrollTop = nowpagey;
console.log("滑动位置调整===》",nowpagey);
this.refs.main3.scrollTop = nowpagey * window.remScale;
}
break;
default:
......
......@@ -7,8 +7,8 @@
"txt": null,
"role": [
{
"rolex": 40,
"roley": 460,
"rolex": 360,
"roley": 875,
"roletex": "guide1"
}
],
......@@ -48,8 +48,8 @@
},
"role": [
{
"rolex": 375,
"roley": 911,
"rolex": 360,
"roley": 875,
"roletex": "guide2_1"
}
],
......@@ -93,8 +93,8 @@
},
"role": [
{
"rolex": 375,
"roley": 911,
"rolex": 360,
"roley": 875,
"roletex": "guide2_1"
}
],
......@@ -137,8 +137,8 @@
},
"role": [
{
"rolex": 375,
"roley": 911,
"rolex": 360,
"roley": 875,
"roletex": "guide2_1"
}
],
......@@ -181,8 +181,8 @@
},
"role": [
{
"rolex": 375,
"roley": 911,
"rolex": 360,
"roley": 875,
"roletex": "guide2_1"
}
],
......@@ -225,8 +225,8 @@
},
"role": [
{
"rolex": 375,
"roley": 911,
"rolex": 360,
"roley": 875,
"roletex": "guide2_1"
}
],
......@@ -344,8 +344,8 @@
},
"role": [
{
"rolex": 238,
"roley": 768,
"rolex": 0,
"roley": 0,
"roletex": "guide2_1"
}
],
......
let clientWidth = document.body.clientWidth;
let clientHeight = document.body.clientHeight;
let canvaswid = 750;
let canvashei = clientHeight * 750 / clientWidth;
let holedata = {
holetype: "cirect",
holex: 15,
holey: 33,
holesize: [
395,
112,
70
]
}
let txtdata = {
text: "您可以在此处编辑信息查看欢趣豆数量",
txtwidth: 750,
txtx: 0,
txty: 224,
txtalign: "center"
}
let roledata = [
{
rolex: 375,
roley: canvashei - 550,
}
]
let nextbtndata = {
btnx: 485,
btny: 303,
btntex: "nextbtn"
}
let skipbtndata = {
skipx: (canvaswid - 107) / 2,
skipy: canvashei - 200,
skiplevel: 7,
skiptex: "skipbtn",
};
let touchdata = {
touchx: 0,
touchy: 0,
touchsize: [
canvaswid,
canvashei
]
}
function getstep1() {
return {
hole: null,
txt: null,
role: roledata,
nextbtn: null,
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
}
function getstep2(){
return {
hole: {
holetype: "cirect",
holex: 15,
holey: 33,
holesize: [
395,
112,
70
]
},
txt: {
text: "您可以在此处编辑信息查看欢趣豆数量",
txtwidth: 750,
txtx: 0,
txty: 224,
txtalign: "center"
},
role: roledata,
nextbtn: {
btnx: 485,
btny: 303,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
}
function getstep3(){
return {
hole: {
holetype: "cirect",
holex: 600,
holey: 26,
holesize: [
135,
440,
40
]
},
txt: {
text: "点击图标您可查看规则、进行分享和签到\n \n偷偷告诉您,连签7天可获得大额欢趣豆哦~",
txtwidth: 455,
txtx: 100,
txty: 245,
txtalign: "left"
},
role: roledata,
nextbtn: {
btnx: 100,
btny: 520,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
}
function getstep4(){
return {
hole: {
holetype: "cir",
holex: 185,
holey: 465,
holesize: [
165,
440
]
},
txt: {
text: "欢趣豆可以兑换立减金,\n进入趣赶集即可进行\n兑换哦~",
txtwidth: 375,
txtx: 375,
txty: 357,
txtalign: "left"
},
role: roledata,
nextbtn: {
btnx: 375,
btny: 536,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
}
function getstep5(){
return {
hole: {
holetype: "cir",
holex: 540,
holey: 600,
holesize: [
165,
440
]
},
txt: {
text: "农场主集结~在这里\n就是向往的生活!\n收获成果的同时还可\n以兑换丰厚礼物哦",
txtwidth: 320,
txtx: 55,
txty: 580,
txtalign: "left"
},
role: roledata,
nextbtn: {
btnx: 55,
btny: 780,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
}
function getstep6(){
return {
hole: {
holetype: "cir",
holex: 170,
holey: 820,
holesize: [
165,
440
]
},
txt: {
text: "点击任务大厅,进入\n任务界面,完成任务\n可获得好礼哦~",
txtwidth: 375,
txtx: 375,
txty: 500,
txtalign: "left"
},
role: roledata,
nextbtn: {
btnx: 375,
btny: 665,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
}
function getstep7(){
let offsety = 0;
let holly = 1110;
if ((holly + 165 / 2) > canvashei - 300) {
let holly1 = canvashei - 300 - 165 / 2;
offsety = holly - holly1;
}
if(canvashei+offsety>1624){
offsety = 1624-canvashei;
}
return {
hole: {
holetype: "cir",
holex: 575,
holey: 1110 - offsety,
holesize: [
165,
440
]
},
txt: {
text: "点击小卖铺可以进到\n商城页面,在这里购\n买心仪的物品哦~",
txtwidth: 320,
txtx: 85,
txty: 750 - offsety,
txtalign: "left"
},
role: [
{
rolex: 0,
roley: canvashei - 550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 86,
btny: 910 - offsety,
btntex: "nextbtn"
},
skipbtn: {
skipx: (canvaswid - 107) / 2,
skipy: canvashei - 200,
skiplevel: 6,
skiptex: "skipbtn",
},
touch: touchdata,
pagey: offsety,
}
}
function getstep8(){
let offsety = 0;
let holly = 1325;
if ((holly + 165 / 2) > canvashei - 300) {
let holly1 = canvashei - 300 - 165 / 2;
offsety = holly - holly1;
}
if(canvashei+offsety>1624){
offsety = 1624-canvashei;
}
return {
hole: {
holetype: "cir",
holex: 180,
holey: 1325 - offsety,
holesize: [
165,
440
]
},
txt: {
text: "这就是你的小家啦~\n进入我的e家可以查看在小\n镇获得的各项荣誉勋章",
txtwidth: 375,
txtx: 375,
txty: 1100 - offsety,
txtalign: "left"
},
role: [
{
rolex: 220,
roley: (canvashei - 400) / 2 - 100,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 375,
btny: 1280 - offsety,
btntex: "nextbtn"
},
skipbtn: {
skipx: (canvaswid - 107) / 2,
skipy: canvashei - 200,
skiplevel: 6,
skiptex: "skipbtn",
},
touch: touchdata,
pagey: offsety,
}
}
function getstep9(){
return {
hole: null,
txt: {
text: "小镇将会越来越热闹\n小e也会在这儿一直陪伴你哦,\n那么赶紧去逛逛吧~",
txtwidth: 750,
txtx: 0,
txty: canvashei - 400,
txtalign: "center"
},
role: [
{
rolex: 0,
roley: (canvashei-1624)/2-100,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 250,
btny: canvashei - 250,
btntex: "finaguidebtn"
},
skipbtn: null,
touch: touchdata,
pagey: 0,
}
}
export function getStepData() {
let stepdata1 = getstep1();
let stepdata2 = getstep2();
let stepdata3 = getstep3();
let stepdata4 = getstep4();
let stepdata5 = getstep5();
let stepdata6 = getstep6();
let stepdata7 = getstep7();
let stepdata8 = getstep8();
let stepdata9 = getstep9();
return {
1:stepdata1,
2:stepdata2,
3:stepdata3,
4:stepdata4,
5:stepdata5,
6:stepdata6,
7:stepdata7,
8:stepdata8,
9:stepdata9,
}
}
export let widgetConfig = {
props:{
props: {
},
assets:[
assets: [
]
}
\ No newline at end of file
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