提交 da6bd765 authored 作者: ling's avatar ling

Initial commit

上级
流水线 #240 已失败 于阶段
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
DEV_BASE_API = 'http://8.218.0.138:8001/'
PRO_BASE_API = 'http://8.218.0.138:8001/'
PRODUCT_NAME = '轻投注'
\ No newline at end of file
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# IDE / Editor
.idea
# Service worker
sw.*
# macOS
.DS_Store
# Vim swap files
*.swp
# light-bet
## Build Setup
```bash
# install dependencies
$ npm install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm run start
# generate static project
$ npm run generate
```
For detailed explanation on how things work, check out the [documentation](https://nuxtjs.org).
## Special Directories
You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality.
### `assets`
The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets).
### `components`
The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components).
### `layouts`
Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts).
### `pages`
This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing).
### `plugins`
The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins).
### `static`
This directory contains your static files. Each file inside this directory is mapped to `/`.
Example: `/static/robots.txt` is mapped as `/robots.txt`.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static).
### `store`
This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/store).
import { fetcher } from '~/assets/scripts/fetcher.js'
export const sendEmail = async (email) => {
const result = await fetcher(`api/common/sendEmail/${email}`, 'GET')
return result
}
export const register = async (data) => {
const result = await fetcher('api/member/register', 'POST', data)
return result
}
export const login = async (data) => {
const result = await fetcher('api/member/login', 'POST', data)
return result
}
export const getInfo = async () => {
const result = await fetcher('api/member/getInfo', 'GET')
return result
}
\ No newline at end of file
@font-face {
font-family: 'modeng';
font-weight: normal;
src: url('~assets/font/design.ttf') format('truetype');
}
.iconfont {
font-family: 'modeng' !important;
font-size: 16px;
font-style: normal;
}
\ No newline at end of file
import Cookies from 'js-cookie'
const TokenKey = 'LIGHT-BET'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function removeToken() {
return Cookies.remove(TokenKey)
}
\ No newline at end of file
import axios from 'axios'
import { getToken } from '~/assets/scripts/auth'
axios.defaults.baseURL = '/'
axios.defaults.headers.common['Content-Type'] = 'application/json'
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'
axios.defaults.withCredentials = true
export const fetcher = async (APIUrl, httpVerb = 'POST', payload) => {
axios.defaults.headers.common.Authorization = getToken()
const axiosConfig = {
method: httpVerb.toLowerCase(),
url: APIUrl,
data: payload,
}
return await axios(axiosConfig)
.then(function (response) {
if (response.data.code === 200) {
return response.data
} else {
return Promise.reject(response)
}
})
.catch(function (error) {
// if (error.data.code === 401) {
// window.location.href = "/login"
// } else if (error.data.code === 407) {
// window.location.href = "/login"
// } else {
// return Promise.reject(error.data.msg)
// }
console.log(error)
})
}
<!-- Please remove this file from your project -->
<template>
<div v-if="displayStatus">
<van-tabbar class="footer" v-model="active">
<van-tabbar-item to="/">
<img src="@/assets/images/footer/index.png">
</van-tabbar-item>
<van-tabbar-item to="/plaza">
<img src="@/assets/images/footer/plaza.png">
</van-tabbar-item>
<van-tabbar-item to="/customer">
<img src="@/assets/images/footer/customer.png">
</van-tabbar-item>
<van-tabbar-item to="/my">
<img src="@/assets/images/footer/my.png">
</van-tabbar-item>
</van-tabbar>
</div>
</template>
<script>
export default {
data() {
return {
active: 0,
displayStatus: true,
};
},
watch: {
'$nuxt.$route.name'(data) {
this.navbarDisplay(data)
},
},
mounted() {
this.navbarDisplay(this.$nuxt.$route.name)
},
methods: {
navbarDisplay(data) {
switch (data) {
case 'login':
case 'register':
this.displayStatus = false
break
default:
this.displayStatus = true
break
}
},
},
};
</script>
<style lang="scss" scoped>
.footer {
background: url("@/assets/images/footer/bg.png");
background-repeat: no-repeat;
background-position: center;
background-size: 100%;
}
.van-tabbar-item--active {
background-color: transparent
}
</style>
# LAYOUTS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Application Layouts.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
<template>
<div>
<Nuxt />
<Footer />
</div>
</template>
<script>
export default {
name: "Default",
data() {
return {};
},
mounted() {},
methods: {},
};
</script>
<style>
html {
font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, "Helvetica Neue", Arial, sans-serif, noto Sans TC, 微軟正黑體;
font-size: 16px;
word-spacing: 1px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
width: 100%;
}
body {
-webkit-tap-highlight-color: transparent;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
}
</style>
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'light-bet',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'vant/lib/index.css',
"~/assets/css/fonts.css"
],
styleResources: {
scss: ['~/assets/style/common.scss'],
},
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'@/plugins/vant'
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
'@nuxtjs/axios',
'@nuxtjs/proxy'
],
axios: {
proxy: true,
},
proxy: {
'/api': {
target: process.env.NODE_ENV !== 'production' ? process.env.DEV_BASE_API : process.env.PRO_BASE_API,
pathRewrite: {
'^/api': '/',
},
changeOrigin: true,
},
},
publicRuntimeConfig: {
baseApi: process.env.NODE_ENV !== 'production' ? process.env.DEV_BASE_API : process.env.PRO_BASE_API,
productName: process.env.PRODUCT_NAME
},
env: {
baseUrl: process.env.NODE_ENV !== 'production' ? process.env.DEV_BASE_API : process.env.PRO_BASE_API
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
}
}
差异被折叠。
{
"name": "light-bet",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/proxy": "^2.1.0",
"axios": "^1.1.2",
"core-js": "^3.19.3",
"js-cookie": "^3.0.1",
"nuxt": "^2.15.8",
"sass": "^1.54.0",
"sass-loader": "^10.1.1",
"vant": "^2.12.36",
"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0"
},
"devDependencies": {}
}
<template>
<div class="customer">
<div class="customer-title">请您选择服务内容</div>
<div class="customer-line"></div>
<div v-for="item in list" :key="item.key" class="customer-item">
<div class="customer-item-img">
<img :src="require(`@/assets/images/customer/${item.img}.png`) ">
</div>
<div class="customer-item-text">
<div>{{item.title}}</div>
<div>{{item.content}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'CustomerPage',
data() {
return {
list: [{
title: '在线客服',
content: '追求卓越 尽善尽美',
img: 'avator',
},
{
title: 'VIP充值通道',
content: '尊贵一对一 一触即发',
img: 'avator',
},
{
title: '投诉与建议',
content: '邮箱:',
img: 'avator',
}]
};
},
methods: {}
}
</script>
<style lang="scss" scoped>
.customer {
background: url("@/assets/images/index/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
min-height: 100vh;
padding: 50px 0 50px;
&-title {
position: relative;
color: white;
text-align: center;
font-size: 18px;
background-color: #2730c9;
width: 190px;
margin: 0 auto;
z-index: 1;
}
&-line {
border-top: 1px solid white;
width: 90%;
margin: -12px auto 30px;
}
&-item {
background: linear-gradient(176deg, #37BBFC 0%, #13A4FF 100%);
box-shadow: 0px 2px 35px 0px rgba(5, 18, 100, 0.5);
border-radius: 15px;
width: 90%;
height: 120px;
margin: 0 auto 20px;
color: white;
font-family: PingFang SC, Arial;
display: flex;
align-items: center;
&-img {
width: 40%;
text-align: center;
img {
width: 90px;;
}
}
&-text {
div:first-child {
margin-bottom: 10px;
font-size: 20px;
font-weight: bold;
}
}
}
}
</style>
<template>
<div class="index">
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item>1</van-swipe-item>
<van-swipe-item>2</van-swipe-item>
<van-swipe-item>3</van-swipe-item>
<van-swipe-item>4</van-swipe-item>
</van-swipe>
<img class="index-recommend" src="@/assets/images/index/recommend.png">
<div class="recommend-item">
<div>
<div class="recommend-title">德国淘汰西班牙进入八强</div>
<div class="recommend-contain">德国西班牙进入死亡之组,谁最终进入八强,拭目以待</div>
<div class="recommend-dice">
<img src="@/assets/images/index/dice.png">
<div>1.32</div>
<img style="margin-left: 5px;" src="@/assets/images/index/dice.png">
<div>1.32</div>
</div>
</div>
<img src="@/assets/images/index/person.png">
</div>
<div class="recommend-item">
<div>
<div class="recommend-title">德国淘汰西班牙进入八强</div>
<div class="recommend-contain">德国西班牙进入死亡之组,谁最终进入八强,拭目以待</div>
<div class="recommend-dice">
<img src="@/assets/images/index/dice.png">
<div>1.32</div>
<img style="margin-left: 5px;" src="@/assets/images/index/dice.png">
<div>1.32</div>
</div>
</div>
<img src="@/assets/images/index/person.png">
</div>
<div class="recommend-item">
<div>
<div class="recommend-title">德国淘汰西班牙进入八强</div>
<div class="recommend-contain">德国西班牙进入死亡之组,谁最终进入八强,拭目以待</div>
<div class="recommend-dice">
<img src="@/assets/images/index/dice.png">
<div>1.32</div>
<img style="margin-left: 5px;" src="@/assets/images/index/dice.png">
<div>1.32</div>
</div>
</div>
<img src="@/assets/images/index/person.png">
</div>
<div class="recommend-item">
<div>
<div class="recommend-title">德国淘汰西班牙进入八强</div>
<div class="recommend-contain">德国西班牙进入死亡之组,谁最终进入八强,拭目以待</div>
<div class="recommend-dice">
<img src="@/assets/images/index/dice.png">
<div>1.32</div>
<img style="margin-left: 5px;" src="@/assets/images/index/dice.png">
<div>1.32</div>
</div>
</div>
<img src="@/assets/images/index/person.png">
</div>
<div class="recommend-item">
<div>
<div class="recommend-title">德国淘汰西班牙进入八强</div>
<div class="recommend-contain">德国西班牙进入死亡之组,谁最终进入八强,拭目以待</div>
<div class="recommend-dice">
<img src="@/assets/images/index/dice.png">
<div>1.32</div>
<img style="margin-left: 5px;" src="@/assets/images/index/dice.png">
<div>1.32</div>
</div>
</div>
<img src="@/assets/images/index/person.png">
</div>
<img class="index-battle" src="@/assets/images/index/battle.png">
</div>
</template>
<script>
export default {
name: 'IndexPage'
}
</script>
<style lang="scss" scoped>
.index {
background: url("@/assets/images/index/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
min-height: 100vh;
padding-bottom: 70px;
.index-recommend {
margin-top: 5px;
}
.index-battle {
display: block;
margin: 15px auto 0;
width: 200px;
}
.recommend-item {
width: 90%;
height: 90px;
margin: 5px auto 10px;
background-color: #068EF6FF;
border-radius: 5px;
display: flex;
padding: 3px 5px;
}
.recommend-dice {
display: flex;
font-size: 12px;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin: 5px 0;
img {
width: 10px;
margin-right: 5px;
}
}
.recommend-title {
font-family: "modeng";
color: #E0F3FFFF;
-webkit-text-stroke: 1px #02357AFF;
margin: 5px 0;
}
.recommend-contain {
font-family: "PingFang-SC-Medium";
color: #73CAFFFF;
font-weight: 500;
font-size: 12px;
margin: 5px 0;
}
.my-swipe .van-swipe-item {
color: #fff;
font-size: 20px;
line-height: 150px;
text-align: center;
background-color: #39a9ed;
}
}
</style>
<template>
<div class="login">
<div class="login-box">
<div class="login-box-content">
<div> <span>邮箱</span> <input v-model="email" type="text" placeholder="请输入邮箱"> </div>
<div> <span>密码</span> <input v-model="password" type="password" placeholder="请输入密码"></div>
<img @click="login" src="@/assets/images/login/login.png">
</div>
<div class="login-box-btn">
<img src="@/assets/images/login/forget.png">
<img @click="gotoRegister()" src="@/assets/images/login/gotoregister.png">
</div>
</div>
</div>
</template>
<script>
export default {
name: 'LoginPage',
data() {
return {
email: '',
password: ''
};
},
methods: {
gotoRegister() {
this.$router.push('/register')
},
login() {
if (this.email === '' || this.password === '') return this.$toast('请输入内容')
try {
const payload = {
email: this.email,
password: this.password,
}
this.$store.dispatch("user/Login", payload)
setTimeout(() => {
this.getInfo();
this.$router.push('/')
}, 1000)
} catch (err) {
this.$toast(err);
}
},
getInfo() {
try {
this.$store.dispatch("user/GetInfo")
} catch (err) {
this.$toast(err);
}
},
}
}
</script>
<style lang="scss" scoped>
.login {
background: url("@/assets/images/login/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
min-height: 100vh;
&-box {
position: relative;
background: url("@/assets/images/login/box_1.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 375px;
height: 470px;
margin: 0 auto;
top: calc(50vh - 300px);
padding-top: 152px;
&-content {
width: 260px;
height: 245px;
margin: 0 auto;
text-align: center;
padding-top: 50px;
div {
margin-bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
span {
font-family: "modeng";
color: white;
-webkit-text-stroke: 1px #1B5AA7FF;
font-size: 20px;
width: 65px;
text-align: start;
}
input {
padding: 10px;
width: 170px;
background: #1C62B8FF;
border: 1.5px solid #7FD7EB;
border-radius: 54px;
color: white;
&::placeholder {
color: #B5E1F2FF;
font-size: 15px;
}
}
}
img {
height: 60px;
}
}
&-btn {
display: flex;
justify-content: center;
margin-top: 80px;
img {
height: 60px;
margin: 0 10px;
}
}
}
}
</style>
<template>
<div class="my">
<div class="my-customer">
<img src="@/assets/images/my/customer.png">
</div>
<div class="my-header">
<div v-if="loginStatus">
<img :src="require(`@/assets/images/my/${userInfo.avator? userInfo.avator : 'avator'}.png`) ">
{{userInfo.userName}}
</div>
<div v-else>
<img src="@/assets/images/my/avator.png">
<nuxt-link class="my-header-tip" to="/login">点击登录/注册</nuxt-link>
</div>
<div>></div>
</div>
<div class="my-info">
<div>
<div>钱包</div>
<div v-if="loginStatus" class="my-info-wallet">{{userInfo.balance}}</div>
<div v-else class="my-info-tip">登陆后查看</div>
</div>
<div class="my-info-item">
<div><img src="@/assets/images/my/icon_1.png">存款</div>
<div><img src="@/assets/images/my/icon_2.png">取款</div>
<div><img src="@/assets/images/my/icon_3.png">转账</div>
</div>
</div>
<div class="my-box">
<div class="my-box-title">个人中心</div>
<div class="my-box-line"></div>
<div class="my-box-list">
<div><img src="@/assets/images/my/icon_4.png">个人资料</div>
<div><img src="@/assets/images/my/icon_5.png">账户管理</div>
<div><img src="@/assets/images/my/icon_6.png">安全中心</div>
</div>
</div>
<div class="my-box">
<div class="my-box-title">常用功能</div>
<div class="my-box-line"></div>
<div class="my-box-list top">
<div><img src="@/assets/images/my/icon_7.png">投注记录</div>
<div><img src="@/assets/images/my/icon_8.png">交易记录</div>
<div><img src="@/assets/images/my/icon_9.png">分享记录</div>
</div>
<div class="my-box-list">
<div><img src="@/assets/images/my/icon_10.png">活动中心</div>
<div><img src="@/assets/images/my/icon_11.png">信息提示</div>
<div><img src="@/assets/images/my/icon_12.png">帮助中心</div>
</div>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
import { getToken } from '~/assets/scripts/auth'
export default {
name: 'myPage',
data() {
return {
loginStatus: !!getToken(),
info: {
avator: 'avator',
name: 'TT',
wallet: 519.00
},
};
},
computed: {
...mapState({
userInfo: (state) => state.user.userInfo,
}),
},
methods: {}
}
</script>
<style lang="scss" scoped>
.my {
background: url("@/assets/images/index/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
min-height: 100vh;
padding: 20px 20px 70px;
&-customer {
display: flex;
justify-content: flex-end;
img {
width: 25px;
}
}
&-header {
display: flex;
justify-content: space-between;
align-items: center;
div {
display: flex;
align-items: center;
color: white;
font-size: 20px;
img {
width: 70px;
height: 70px;
margin-right: 10px;
}
}
.my-header-tip {
font-size: 18px;
font-family: PingFang SC;
font-weight: bold;
letter-spacing: 1px;
color: white
}
}
&-info {
background: linear-gradient(176deg, #37BBFC 0%, #13A4FF 100%);
border-radius: 15px;
color: white;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
margin-top: 15px;
&-wallet {
margin-top: 15px;
font-size: 22px;
}
.my-info-tip {
margin-top: 10px;
font-size: 18px;
font-family: PingFang SC;
font-weight: bold;
}
&-item {
display: flex;
div {
text-align: center;
margin-left: 15px;
font-size: 15px;
}
img {
width: 40px;
height: 40px;
display: block;
margin-bottom: 5px;
}
}
}
&-box {
background: linear-gradient(176deg, #37BBFC 0%, #13A4FF 100%);
border-radius: 15px;
color: white;
margin-top: 15px;
&-title {
padding: 10px 20px;
}
&-line {
border-top: 1px solid #0D92F7;
}
&-list {
padding: 20px;
display: flex;
justify-content: space-between;
font-size: 15px;
img {
width: 40px;
height: 40px;
display: block;
margin: 0 auto 5px;
}
}
.top {
padding: 20px 20px 0;
}
}
}
</style>
<template>
<div class="plaza">
<div v-for="item in list" :key="item.key" class="plaza-item">
<div class="plaza-item-header">{{item.type}}</div>
<div class="plaza-item-content">
<div class="plaza-item-title">{{item.title}}</div>
<div class="plaza-item-odds">
<div class="plaza-item-odds-left">
<div>{{item.odds1}}</div>
</div>
<div class="plaza-item-odds-middle">VS</div>
<div class="plaza-item-odds-right">
<div>{{item.odds2}}</div>
</div>
</div>
<div class="plaza-item-text">{{item.title}}</div>
<div class="plaza-item-text">接受本次挑战您需投入{ {{item.amount}} }元,如果结果为{ {{item.result}} },您将获得收益{ {{item.income}} }
</div>
<div class="plaza-item-btn">
<img src="@/assets/images/plaze/share.png">
<div class="plaza-item-btn-group">
<img src="@/assets/images/plaze/copy.png">
<img src="@/assets/images/plaze/challenge.png">
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'PlazaPage',
data() {
return {
list: [{
type: '体育',
title: '德国淘汰西班牙进入八强',
odds1: 1.35,
odds2: 1.35,
amount: 42.05,
result: '负',
income: 135
},
{
type: '体育',
title: '德国淘汰西班牙进入八强',
odds1: 1.35,
odds2: 1.35,
amount: 42.05,
result: '负',
income: 135
},
{
type: '体育',
title: '德国淘汰西班牙进入八强',
odds1: 1.35,
odds2: 1.35,
amount: 42.05,
result: '负',
income: 135
},
{
type: '体育',
title: '德国淘汰西班牙进入八强',
odds1: 1.35,
odds2: 1.35,
amount: 42.05,
result: '负',
income: 135
}]
};
},
methods: {}
}
</script>
<style lang="scss" scoped>
.plaza {
background: url("@/assets/images/index/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
min-height: 100vh;
padding:50px 0 50px;
&-item {
background: url("@/assets/images/plaze/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 90%;
height: 275px;
margin: 0 auto 10px;
color: white;
font-family: PingFang SC, Arial;
font-weight: bold;
&-header {
height: 35px;
padding-left: 10px;
display: flex;
align-items: center;
}
&-content {
padding: 10px;
}
&-title {
text-align: center;
padding: 5px 0;
width: 70%;
background: linear-gradient(83deg, #37BBFC 0%, #13A4FF 57%, #32B8FD 99%);
margin: 0 auto;
}
&-odds {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding: 0 10px;
&-left,
&-right {
display: flex;
align-items: center;
div {
border-radius: 50%;
width: 70px;
height: 70px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-weight: normal;
}
}
&-middle {
font-size: 36px;
font-family: Arial;
}
&-left div {
background: #008AD6;
margin-right: 10px;
}
&-right div {
background: #FF6161;
margin-left: 10px;
}
}
&-text {
text-align: center;
font-size: 14px;
padding: 0 18px;
line-height: 24px;
}
&-btn {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 18px;
margin-top: 3px;
img {
height: 30px;
}
&-group {
img {
height: 40px;
}
}
}
}
}
</style>
<template>
<div class="login">
<div class="login-box">
<div class="login-box-content">
<div> <span>邮箱</span> <input v-model="email" type="text" class="email" placeholder="请输入邮箱">
<div @click="getEmailCode" class="login-box-send">发送</div>
</div>
<div> <span>验证码</span> <input v-model="verifyCode" type="text" placeholder="请输入邮箱验证码"></div>
<div> <span>密码</span> <input v-model="password" type="password" placeholder="请输入密码"></div>
<img @click="register" src="@/assets/images/login/register.png">
</div>
<div class="login-box-btn">
<img @click="backLogin()" src="@/assets/images/login/backlogin.png">
</div>
</div>
</div>
</template>
<script>
import { sendEmail, register } from '~/api/user.js'
export default {
name: 'RegisterPage',
data() {
return {
email: '',
verifyCode: '',
password: ''
};
},
created() {
},
methods: {
backLogin() {
this.$router.push('/login')
},
async getEmailCode() {
if (this.email === '') return this.$toast('请输入邮箱')
try {
const res = await sendEmail(this.email)
this.$toast(res.data)
} catch (err) {
this.$toast(err)
}
},
async register() {
if (this.verifyCode === '' || this.email === '' || this.password === '') return this.$toast('请输入内容')
try {
const payload = {
code: this.verifyCode,
email: this.email,
password: this.password,
}
const res = await register(payload)
this.$toast(res.data)
setTimeout(() => {
this.$router.push('/login')
}, 1000);
} catch (err) {
this.$toast(err)
}
},
}
}
</script>
<style lang="scss" scoped>
.login {
background: url("@/assets/images/login/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
min-height: 100vh;
&-box {
position: relative;
background: url("@/assets/images/login/box_2.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 375px;
height: 548px;
margin: 0 auto;
top: calc(50vh - 300px);
padding-top: 152px;
&-content {
width: 260px;
height: 245px;
margin: 0 auto;
text-align: center;
padding-top: 50px;
div {
margin-bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
span {
font-family: "modeng";
color: white;
-webkit-text-stroke: 1px #1B5AA7FF;
font-size: 20px;
width: 65px;
text-align: start;
}
input {
padding: 10px;
width: 170px;
background: #1C62B8FF;
border: 1.5px solid #7FD7EB;
border-radius: 54px;
color: white;
&::placeholder {
color: #B5E1F2FF;
font-size: 15px;
}
}
.email {
padding-right: 60px;
}
}
.login-box-send {
position: absolute;
color: #B5E1F2FF;
font-size: 15px;
margin-bottom: 0;
margin-left: 170px;
border-left: 1px solid #B5E1F2FF;
padding-left: 10px;
}
img {
height: 60px;
}
}
&-btn {
display: flex;
justify-content: flex-end;
margin-top: 145px;
img {
height: 60px;
margin-right: 15%;
}
}
}
}
</style>
import Vue from 'vue'
import Vant from 'vant'
Vue.use(Vant)
import { login, getInfo, logout } from '~/api/user'
import { getToken, setToken, removeToken } from '~/assets/scripts/auth'
const user = {
state: {
token: getToken(),
userInfo: {},
},
mutations: {
SET_TOKEN: (state, token) => {
state.token = token
},
SET_USER: (state, user) => {
state.userInfo = user
},
SET_UNREAD: (state, user) => {
state.unRead = user
}
},
actions: {
Login({ commit }, userInfo) {
return new Promise((resolve, reject) => {
login(userInfo).then(res => {
setToken(res.data.token)
commit('SET_TOKEN', res.data.token)
setUserInfo(res.user, commit)
resolve()
}).catch(error => {
reject(error)
})
})
},
GetInfo({ commit }) {
return new Promise((resolve, reject) => {
getInfo().then(res => {
setUserInfo(res.data, commit)
commit('SET_USER', res.data)
resolve(res)
}).catch(error => {
reject(error)
})
})
},
LogOut({ commit }) {
return new Promise((resolve, reject) => {
logout().then(res => {
logOut(commit)
resolve()
}).catch(error => {
logOut(commit)
reject(error)
})
})
},
}
}
export const logOut = (commit) => {
commit('SET_TOKEN', '')
removeToken()
}
export const setUserInfo = (res, commit) => {
commit('SET_USER', res)
}
export default user
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论