Browse Source

下注规则

master
tangmingyou 4 years ago
parent
commit
2c1d2ddaff
  1. 77
      src/pages/lobby/lobby.jsx
  2. 3
      src/pages/login/login.jsx
  3. 2
      src/pages/table/table.jsx
  4. 2
      src/pages/table/table.scss

77
src/pages/lobby/lobby.jsx

@ -1,5 +1,5 @@
import React, { Component, useState } from 'react'
import { View, Text, Button, Image } from '@tarojs/components'
import { View, Text, Button, Image, Radio, RadioGroup, Label, Slider,Head } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { useSelector, useDispatch } from 'react-redux'
@ -26,6 +26,42 @@ class Lobby extends Component {
tables: [],
defaultAvatar: "https://img0.baidu.com/it/u=2477829979,2171947490&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",
lobbyLoading: false,
gameType: [
{value: 1, text: '', checked: false},
],
list: [
{
value: '美国',
text: '美国',
checked: false
},
{
value: '中国',
text: '中国',
checked: true
},
{
value: '巴西',
text: '巴西',
checked: false
},
{
value: '日本',
text: '日本',
checked: false
},
{
value: '英国',
text: '英国',
checked: false
},
{
value: '法国',
text: '法国',
checked: false
}
],
}
this.circleEle = [1,2,3,4,5,6,7];
this.circleElePos = [{x:16,y:8},{x:70,y:-3},{x:110,y:28},{x:115,y:70},{x:80,y:105},{x:20,y:100},{x:-2,y:60}];
@ -82,6 +118,45 @@ class Lobby extends Component {
// const user = useSelector((state) => state.user)
// console.log('state', this.state)
// return (
// <View className='components-page'>
// <Text> step</Text>
// <Slider step={1} value={50}/>
// <Text> value</Text>
// <Slider step={1} value={50} showValue/>
// <Text>/</Text>
// <Slider step={1} value={100} showValue min={50} max={200}/>
// </View>
// );
return (
<View className='container'>
{/* <Head title='Radio' /> */}
<View className='page-body'>
<View className='page-section'>
<Text>默认样式</Text>
<Radio value='选中' checked>选中</Radio>
<Radio style='margin-left: 20rpx' value='未选中'>未选中</Radio>
</View>
<View className='page-section'>
<Text>推荐展示样式</Text>
<View className='radio-list'>
<RadioGroup>
{this.state.list.map((item, i) => {
return (
<Label className='radio-list__label' for={i} key={i}>
<Radio className='radio-list__radio' value={item.value} checked={item.checked}>{item.text}</Radio>
</Label>
)
})}
</RadioGroup>
</View>
</View>
</View>
</View>
);
return (
<View>
<Title title={"Lobby!!"} bgColor={true} leftSolt={

3
src/pages/login/login.jsx

@ -33,8 +33,9 @@ function Login() {
//const token = "AgOjcdf3goeYDX3lwWWwkXtVpcrL-l2rX8csrRKgs3_-BC3JOx0l6nZU0MV25eIn"
try {
const [tokenRes, opMapRes, wsRes] = await Promise.all([doLogin(state), fetchOpMap(), fetchRouteWs()]);
const [tokenRes, opMapRes] = await Promise.all([doLogin(state), fetchOpMap()]);
setStorage('_t', tokenRes.data.token);
const wsRes = await fetchRouteWs();
// websocket
ws.init(tokenRes.data.token, opMapRes.data, wsRes.data);
showToast({title: '登录成功', duration: 800});

2
src/pages/table/table.jsx

@ -242,7 +242,7 @@ class Table extends Component {
row.map(({index, player}, j) => (
<View key={j} className="player-wrap" onClick={(p => {console.log(p)}).bind(this, player)}>
{
player.status === 2 && <View className="p-status-ready"><Text>Ready!</Text></View>
player.status === 2 && <View className="p-status-ready"><Text>Ready</Text></View>
}
<View className="player-bar">
{

2
src/pages/table/table.scss

@ -18,7 +18,7 @@
position: absolute;
top: -25px;
left: 30px;
color: #EE914E;
color: #1BCE7D;
font-weight: bold;
font-size: 12px;
}

Loading…
Cancel
Save