Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
new_taobao
Commits
221ae749
Commit
221ae749
authored
Oct 17, 2020
by
zhangjinzhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码暂存
parent
91de5434
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
36 deletions
+36
-36
pagegamemain.axml
taobao_jn/client/pages/pagegamemain/pagegamemain.axml
+8
-8
pagegamemain.js
taobao_jn/client/pages/pagegamemain/pagegamemain.js
+28
-28
No files found.
taobao_jn/client/pages/pagegamemain/pagegamemain.axml
View file @
221ae749
...
...
@@ -15,33 +15,33 @@
<!--<image class="gamemroleimg1" src={{resList['70ad9e81-ebe3-43ab-ad49-38f3c4d675bd'].url}} /> -->
<view class="gamemplayer1" a:if="{{myidx==1}}">
<image class="gamempimg1" src={{resList['c68097a5-eb32-422f-8583-600e3d636c93'].url}} />
<label class="gamemptxt1">{{"我的队伍\n"+"当前温
度
值:"+roomdata[myidx-1].wd+"℃"}}</label>
<label class="gamemptxt1">{{"我的队伍\n"+"当前温
暖
值:"+roomdata[myidx-1].wd+"℃"}}</label>
</view>
<label class="gamemaitor1" a:if="{{myidx!=1}}">当前温
度
值:{{roomdata[0].wd}}℃</label>
<label class="gamemaitor1" a:if="{{myidx!=1}}">当前温
暖
值:{{roomdata[0].wd}}℃</label>
</view>
<view class="gamemrole2" a:if="{{roomdata.length>1}}">
<!--<image class="gamemroleimg2" src={{resList['70ad9e81-ebe3-43ab-ad49-38f3c4d675bd'].url}} /> -->
<view class="gamemplayer2" a:if="{{myidx==2}}">
<image class="gamempimg2" src={{resList['c68097a5-eb32-422f-8583-600e3d636c93'].url}} />
<label class="gamemptxt2">{{"我的队伍\n"+"当前温
度
值:"+roomdata[myidx-1].wd+"℃"}}</label>
<label class="gamemptxt2">{{"我的队伍\n"+"当前温
暖
值:"+roomdata[myidx-1].wd+"℃"}}</label>
</view>
<label class="gamemaitor2" a:if="{{myidx!=2}}">当前温
度
值:{{roomdata[1].wd}}℃</label>
<label class="gamemaitor2" a:if="{{myidx!=2}}">当前温
暖
值:{{roomdata[1].wd}}℃</label>
</view>
<view class="gamemrole3" a:if="{{roomdata.length>2}}">
<!--<image class="gamemroleimg3" src={{resList['70ad9e81-ebe3-43ab-ad49-38f3c4d675bd'].url}} /> -->
<view class="gamemplayer3" a:if="{{myidx==3}}">
<image class="gamempimg3" src={{resList['c68097a5-eb32-422f-8583-600e3d636c93'].url}} />
<label class="gamemptxt3">{{"我的队伍\n"+"当前温
度
值:"+roomdata[myidx-1].wd+"℃"}}</label>
<label class="gamemptxt3">{{"我的队伍\n"+"当前温
暖
值:"+roomdata[myidx-1].wd+"℃"}}</label>
</view>
<label class="gamemaitor3" a:if="{{myidx!=3}}">当前温
度
值:{{roomdata[2].wd}}℃</label>
<label class="gamemaitor3" a:if="{{myidx!=3}}">当前温
暖
值:{{roomdata[2].wd}}℃</label>
</view>
<view class="gamemrole4" a:if="{{roomdata.length>3}}">
<!--<image class="gamemroleimg4" src={{resList['70ad9e81-ebe3-43ab-ad49-38f3c4d675bd'].url}} /> -->
<view class="gamemplayer4" a:if="{{myidx==4}}">
<image class="gamempimg4" src={{resList['c68097a5-eb32-422f-8583-600e3d636c93'].url}} />
<label class="gamemptxt4">{{"我的队伍\n"+"当前温
度
值:"+roomdata[myidx-1].wd+"℃"}}</label>
<label class="gamemptxt4">{{"我的队伍\n"+"当前温
暖
值:"+roomdata[myidx-1].wd+"℃"}}</label>
</view>
<label class="gamemaitor4" a:if="{{myidx!=4}}">当前温
度
值:{{roomdata[3].wd}}℃</label>
<label class="gamemaitor4" a:if="{{myidx!=4}}">当前温
暖
值:{{roomdata[3].wd}}℃</label>
</view>
</view>
</view>
...
...
taobao_jn/client/pages/pagegamemain/pagegamemain.js
View file @
221ae749
...
...
@@ -19,9 +19,9 @@ const {
}
=
tbcc
.
tb
;
let
updateact
=
1
;
//请求
let
gameatime
=
100
;
//活动倒计时,100,
const
toolwarm
=
1
;
//升温道具+温度
值
const
taskwarm
=
1
;
//任务+温
度
值
const
invitewarm
=
2
;
//邀请+温度
值
const
toolwarm
=
3
;
//升温道具+温暖
值
const
taskwarm
=
1
;
//任务+温
暖
值
const
invitewarm
=
2
0
;
//邀请+温暖
值
let
gtoolcd
=
5
;
//
const
paple1
=
"cloud://F03F0071205084B1A58F9C560010C076//paple3.svga"
;
...
...
@@ -37,8 +37,8 @@ Page({
invitedata
:
[],
//邀请人
gametime
:
100
,
//活动倒计时,s
gametimeshow
:
"05:00"
,
roomdata
:
[],
//房间所有人温
度
信息
roomtdata
:
[],
//房间预期抵达温
度
roomdata
:
[],
//房间所有人温
暖
信息
roomtdata
:
[],
//房间预期抵达温
暖
roomnums
:
3
,
//房间人数
myidx
:
1
,
//我的位置
tooltime
:
5
,
//升温工具倒计时
...
...
@@ -235,9 +235,9 @@ Page({
let
attiontxt1
=
"游戏开始啦,共有"
+
this
.
data
.
roomnums
+
"名玩家加入游戏,快来升温队伍拿奖励吧。"
;
this
.
addAttionTxt
(
attiontxt1
);
this
.
updateAct
();
setTimeout
(()
=>
{
this
.
newAiControl
(
"invite"
,
1
);
},
4000
);
//
setTimeout(() => {
//
this.newAiControl("invite", 1);
//
}, 4000);
},
//新ai逻辑,tool==使用道具,task==任务,invite==邀请人
async
newAiControl
(
type
=
"tool"
,
ainum
=
1
,
aiwarm
=
0
)
{
...
...
@@ -398,7 +398,7 @@ Page({
let
aiwarm
=
data
[
2
];
let
othername
=
this
.
data
.
othername
;
if
(
type
==
"tool"
)
{
let
itxt
=
othername
[
i
]
+
"使用道具一次获得了"
+
toolwarm
+
"温
度
值"
;
let
itxt
=
othername
[
i
]
+
"使用道具一次获得了"
+
toolwarm
+
"温
暖
值"
;
this
.
addAttionTxt
(
itxt
);
let
inroomidx
=
i
;
let
inwd
=
this
.
data
.
roomdata
[
inroomidx
][
"wd"
];
...
...
@@ -412,7 +412,7 @@ Page({
addwarm
=
taskwarm
*
nums
;
}
if
(
addwarm
>
0
&&
nums
>
0
)
{
let
itxt
=
othername
[
i
]
+
"完成了"
+
nums
+
"个任务,获得了"
+
addwarm
+
"温
度
值"
;
let
itxt
=
othername
[
i
]
+
"完成了"
+
nums
+
"个任务,获得了"
+
addwarm
+
"温
暖
值"
;
this
.
addAttionTxt
(
itxt
);
let
inroomidx
=
i
;
let
inwd
=
this
.
data
.
roomdata
[
inroomidx
][
"wd"
];
...
...
@@ -422,7 +422,7 @@ Page({
}
else
if
(
type
==
"invite"
)
{
if
(
nums
>
0
)
{
let
itxt
=
othername
[
i
]
+
"邀请了"
+
nums
+
"位好友,获得了"
+
invitewarm
*
nums
+
"温
度
值"
;
let
itxt
=
othername
[
i
]
+
"邀请了"
+
nums
+
"位好友,获得了"
+
invitewarm
*
nums
+
"温
暖
值"
;
this
.
addAttionTxt
(
itxt
);
let
inroomidx
=
i
;
let
inwd
=
this
.
data
.
roomdata
[
inroomidx
][
"wd"
];
...
...
@@ -450,7 +450,7 @@ Page({
let
chatime
=
Math
.
ceil
(
Math
.
random
()
*
5
)
+
2
;
let
itime1
=
Number
((
Math
.
random
()
*
chatime
).
toFixed
(
2
))
*
1000
;
setTimeout
(()
=>
{
let
itxt
=
othername
[
i
]
+
"使用道具获得了"
+
toolwarm
+
"温
度
值"
;
let
itxt
=
othername
[
i
]
+
"使用道具获得了"
+
toolwarm
+
"温
暖
值"
;
this
.
addAttionTxt
(
itxt
);
let
inroomidx
=
i
+
1
;
let
inwd
=
this
.
data
.
roomdata
[
inroomidx
][
"wd"
];
...
...
@@ -475,7 +475,7 @@ Page({
//ai邀请
let
inviterange
=
[
0
,
5
];
let
invitenums
=
Math
.
round
(
Math
.
random
()
*
inviterange
[
1
])
+
inviterange
[
0
];
// console.log("邀请的温
度
值", invitenums);
// console.log("邀请的温
暖
值", invitenums);
this
.
ainvite
(
invitenums
,
i
);
//ai任务
let
taskrange
=
[
1
,
5
];
...
...
@@ -486,9 +486,9 @@ Page({
//机器使用道具
aiuseTool
(
time
,
i
,
chatime
)
{
setTimeout
(()
=>
{
// console.log("ai" + i + "使用道具升温
度
");
// console.log("ai" + i + "使用道具升温
暖
");
let
othername
=
this
.
data
.
othername
let
itxt
=
othername
[
i
]
+
"使用道具获得了"
+
toolwarm
+
"温
度
值"
;
let
itxt
=
othername
[
i
]
+
"使用道具获得了"
+
toolwarm
+
"温
暖
值"
;
this
.
addAttionTxt
(
itxt
);
let
inroomidx
=
i
+
1
;
let
inwd
=
this
.
data
.
roomdata
[
inroomidx
][
"wd"
];
...
...
@@ -515,8 +515,8 @@ Page({
// console.log(rangetime);
setTimeout
(()
=>
{
// console.log("ai" + i + "邀请好友升温
度
");
let
itxt
=
othername
[
i
]
+
"邀请了一位好友,获得了"
+
invitewarm
+
"温
度
值"
;
// console.log("ai" + i + "邀请好友升温
暖
");
let
itxt
=
othername
[
i
]
+
"邀请了一位好友,获得了"
+
invitewarm
+
"温
暖
值"
;
this
.
addAttionTxt
(
itxt
);
let
inroomidx
=
i
+
1
;
let
inwd
=
this
.
data
.
roomdata
[
inroomidx
][
"wd"
];
...
...
@@ -535,7 +535,7 @@ Page({
let
i1end
=
(
i1
+
1
)
*
chatime
-
5000
;
let
rangetime
=
Math
.
floor
(
Math
.
random
()
*
(
i1end
-
i1start
))
+
i1start
;
setTimeout
(()
=>
{
let
itxt
=
othername
[
i
]
+
"完成了一个任务,获得了"
+
taskwarm
+
"温
度
值"
;
let
itxt
=
othername
[
i
]
+
"完成了一个任务,获得了"
+
taskwarm
+
"温
暖
值"
;
this
.
addAttionTxt
(
itxt
);
let
inroomidx
=
i
+
1
;
let
inwd
=
this
.
data
.
roomdata
[
inroomidx
][
"wd"
];
...
...
@@ -616,7 +616,7 @@ Page({
});
},
//更新活动信息
//30s刷新一次邀请人列表,新增温
度
,结束前5s再请求一次,onshow请求一次
//30s刷新一次邀请人列表,新增温
暖
,结束前5s再请求一次,onshow请求一次
async
updateActInfo
(
gamestat
=
"now"
)
{
// console.log("updateActInfo=======>");
clearTimeout
(
updateact
);
...
...
@@ -865,7 +865,7 @@ Page({
},
//更新attionlist,玩家相关
async
updateAttionList
(
gamestat
=
"now"
)
{
// console.log("更新玩家++温
度
值");
// console.log("更新玩家++温
暖
值");
let
startime
=
this
.
data
.
startime
;
let
endtime
=
this
.
data
.
endtime
;
let
step
=
this
.
data
.
step
;
...
...
@@ -963,7 +963,7 @@ Page({
}
if
(
taskcount
>
0
&&
taskwarm
>
0
)
{
this
.
newAiControl
(
"task"
,
taskcount
,
taskwarm
);
let
tasktxt
=
"你完成了"
+
taskcount
+
"个任务,获得了"
+
taskwarm
+
"温
度
值"
;
let
tasktxt
=
"你完成了"
+
taskcount
+
"个任务,获得了"
+
taskwarm
+
"温
暖
值"
;
this
.
addAttionTxt
(
tasktxt
);
}
//邀请的单独来
...
...
@@ -992,7 +992,7 @@ Page({
let
chawarm
=
ndata
.
warms
-
ldata
.
warms
;
let
iattiontxt
=
""
;
if
(
type
==
"invite"
)
{
iattiontxt
=
"你邀请"
+
chacount
+
"人"
+
"获得了"
+
chawarm
+
"温
度
值"
;
iattiontxt
=
"你邀请"
+
chacount
+
"人"
+
"获得了"
+
chawarm
+
"温
暖
值"
;
this
.
setData
({
inviteshowdata
:
{
chacount
:
chacount
,
...
...
@@ -1001,19 +1001,19 @@ Page({
});
this
.
openInvite
();
}
else
if
(
type
==
"tool"
)
{
iattiontxt
=
"你使用道具"
+
chacount
+
"次"
+
"获得了"
+
chawarm
+
"温
度
值"
;
iattiontxt
=
"你使用道具"
+
chacount
+
"次"
+
"获得了"
+
chawarm
+
"温
暖
值"
;
}
else
if
(
type
==
"follow"
)
{
return
[
chacount
,
chawarm
];
// iattiontxt = "完成任务follow" + chacount + "次" + "获得了" + chawarm + "温
度
值";
// iattiontxt = "完成任务follow" + chacount + "次" + "获得了" + chawarm + "温
暖
值";
}
else
if
(
type
==
"sign"
)
{
return
[
chacount
,
chawarm
];
// iattiontxt = "完成任务sign" + chacount + "次" + "获得了" + chawarm + "温
度
值";
// iattiontxt = "完成任务sign" + chacount + "次" + "获得了" + chawarm + "温
暖
值";
}
else
if
(
type
==
"collect"
)
{
return
[
chacount
,
chawarm
];
// iattiontxt = "完成任务collect" + chacount + "次" + "获得了" + chawarm + "温
度
值";
// iattiontxt = "完成任务collect" + chacount + "次" + "获得了" + chawarm + "温
暖
值";
}
else
if
(
type
==
"browseGoods"
)
{
return
[
chacount
,
chawarm
];
// iattiontxt = "完成任务browseGoods" + chacount + "次" + "获得了" + chawarm + "温
度
值";
// iattiontxt = "完成任务browseGoods" + chacount + "次" + "获得了" + chawarm + "温
暖
值";
}
if
(
iattiontxt
.
length
>
0
)
{
return
iattiontxt
;
...
...
@@ -1437,7 +1437,7 @@ Page({
}
}
else
{
//机器胜利
let
doup
=
false
;
let
towarm
=
towarm
=
Math
.
round
(
Math
.
random
()
*
3
)
*
invitewarm
;
let
towarm
=
Math
.
round
(
Math
.
random
()
*
3
)
*
1
;
if
(
iwd
>
mywd
)
{
//可不处理
havechao
=
true
;
doup
=
Math
.
random
()
<
0.2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment