Commit 4c46f9d2 authored by Edwise's avatar Edwise 🍷

1234

parent 12ba612c
...@@ -11,6 +11,11 @@ const { ...@@ -11,6 +11,11 @@ const {
commonToast commonToast
} = tbcc.tb; } = tbcc.tb;
const nameArr = [
'Edwise',
'爱德',
'Mr.W'
];
Component({ Component({
props: { props: {
...@@ -55,7 +60,8 @@ Component({ ...@@ -55,7 +60,8 @@ Component({
/**随机名字,需要根据运营数据可配置 */ /**随机名字,需要根据运营数据可配置 */
randomName() { randomName() {
console.log("随即名字") console.log("随即名字")
let name = "Edwise" let index = Math.floor(Math.random()*nameArr.length)
let name = nameArr[index];
this.setData({ this.setData({
catNameText: name catNameText: name
}) })
......
...@@ -97,10 +97,10 @@ ...@@ -97,10 +97,10 @@
} }
.levelup .levelup_prizeView { .levelup .levelup_prizeView {
width: 353rpx; width: 350rpx;
height: 293rpx; height: 293rpx;
opacity: 1; opacity: 1;
left: 201rpx; left: 202rpx;
top: 380rpx; top: 380rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
...@@ -110,12 +110,12 @@ ...@@ -110,12 +110,12 @@
} }
.levelup .levelup_prizeImg { .levelup .levelup_prizeImg {
width: 360rpx; width: 356rpx;
height: 299rpx; height: 299rpx;
opacity: 1; opacity: 1;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
left: -3rpx; left: -1rpx;
top: -3rpx; top: -3rpx;
} }
......
...@@ -300,7 +300,7 @@ Page({ ...@@ -300,7 +300,7 @@ Page({
if (this.main) { if (this.main) {
this.main.run(); this.main.run();
this.main.dispatchGlobalEvent("onShow"); this.main.dispatchGlobalEvent("onShow");
my.__updateUserInfo__(); this.showPageLogin();
} }
}, },
...@@ -376,6 +376,28 @@ Page({ ...@@ -376,6 +376,28 @@ Page({
this.initCanvas(); this.initCanvas();
} }
}, },
/**页面显示登录 */
async showPageLogin() {
const {
nickName,
avatar
} = app;
const {
success,
data,
} = await API.login({
userNick: nickName,
avatar
}).catch(res => {
commonToast(res && res.message);
}) || {};
if (success) {
app.openId = data.openId;
my.__updateUserInfo__();
}
},
/**刷新用户信息 */ /**刷新用户信息 */
updateUserInfo() { updateUserInfo() {
console.log("通知canvas刷新用户信息") console.log("通知canvas刷新用户信息")
......
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