first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<template>
<div class="book">
<view class="uni-list">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(value, key) in listData" :key="key" @click="goDetail(value)">
<view class="uni-media-list">
<image class="uni-media-list-logo" :src="value.cover"></image>
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">{{ value.title }}</view>
<view class="uni-media-list-text-bottom">
<text>{{ value.author_name }}</text>
<text>{{ value.published_at }}</text>
</view>
</view>
</view>
</view>
</view>
</div>
</template>
<script>
export default {
data() {
return {
listData: []
}
},
onLoad() {
this.getBootList()
},
methods: {
async getBootList () {
let data = await this.$http.selectUserBook({
data: {
id: (JSON.parse(localStorage.getItem("LoginStatus"))).id
}
});
console.log(data)
this.listData = data
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,142 @@
<template>
<div class="bookinfo">
<!-- background: url('infoData.imgurl'); -->
<div class="info-title">
<div class="title-background" :style="{ background: 'url('+infoData.imgurl+')' }"></div>
<div class="title-top">
<img :src="infoData.imgurl"/>
<div class="title-top-right">
<h3>{{ infoData.title }}</h3>
<p><span class="author">{{ infoData.author }}</span> | {{ infoData.type }}</p>
</div>
</div>
</div>
<div class="info-message">
<ul>
<li>
<h3 class="readNum">{{ infoData.readNum }}</h3>
<p class="readP">阅读次数</p>
</li>
<li>
<h3 class="readNum">{{ infoData.wordNum }}</h3>
<p class="readP">已更字数</p>
</li>
</ul>
</div>
<div class="info-desc">
<h4>简介</h4>
<p class="descCont">{{ infoData.desc }}</p>
</div>
<!-- 章节目录 -->
<view class="chapter">
<h4 class="chapterTitle">章节目录</h4>
<ul class="chapterList">
<li class="chapterTxt" v-for="(item,index) in infoData.zjList" :key="index">{{ item.text }}</li>
</ul>
</view>
<!-- 推荐 -->
<view class="recommend">
<view class="recommendTitle">喜欢过 {{ infoData.title }} 的人还喜欢 ...</view>
<ul class="recommendUl">
<li class="recommendList" v-for="(items,index) in GET_HOTLIST.list"
:key="index" @click="$utils.enterInfo(items.id)">
<image :src="items.imgUrl" mode="aspectFit"></image>
<view class="bookMsg">
<p class="bookName">{{items.title}}</p>
<p class="bookType">{{items.class}}</p>
</view>
</li>
</ul>
</view>
<view class="action">
<view class="action-read" @click="startRead()">
开始阅读
</view>
<view :class="[ isdouleClick ? 'red action-like' : 'blak action-like']" @click="isdouleClick ? addLike() : '' ">
加入收藏
</view>
</view>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {
isdouleClick: true,
bookid: null,
infoData: {}
}
},
onLoad(option) {
this.bookid = option.id
this.checkBook()
},
onReady () {
this.getIndexData();
},
methods: {
async startRead() {
uni.navigateTo({
url: `/pages/bookinfo/read?bookid=${this.bookid}&chapterId=${this.infoData.zjList[0].zid}`
});
},
async checkBook() {
let data = await this.$http.checkBook({
data: {
bookid: this.bookid,
id: (JSON.parse(localStorage.getItem("LoginStatus"))).id
}
});
if(data != "没有收藏本书") {
this.isdouleClick = false
}
},
async addLike () {
if(this.$utils.checkLogin()) {
let data = await this.$http.addLike({
data: {
bookid: this.bookid,
id: (JSON.parse(localStorage.getItem("LoginStatus"))).id
}
});
this.isdouleClick = false
} else {
uni.navigateTo({
url: '/pages/my/login'
});
}
},
async getIndexData() {
let data = await this.$http.getBookInfo({
data: {
bookid: this.bookid
}
});
this.infoData = data;
uni.setNavigationBarTitle({
title: data.title
});
}
},
computed: {
...mapGetters([
'GET_HOTLIST'
])
}
}
</script>
<style lang="less">
.red{
background: red;
}
.blak {
background: #8d8d8d !important;
}
@import "./../../common/less/page/bookinfo.less";
</style>

View File

@@ -0,0 +1,133 @@
<template>
<view class="read">
<scroll-view style="height: 100%;" scroll-y="true" @scroll="scroll">
<rich-text :nodes="nodes"></rich-text>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
bookid: null,
chapterId: null,
nodes: [],
history: localStorage.getItem("history") == null ? [] : JSON.parse(localStorage.getItem("history")),
currentIndex: null
}
},
onLoad(data) {
this.chapterId = data.chapterId;
this.bookid = data.bookid;
var status = true;
if(this.history.length != 0){
this.history.forEach((val,index) => {
// 如果该书已经被阅读过,那么status true,没有阅读 false
if (val.bookid == data.bookid) {
this.currentIndex = index
status = true
} else {
status = false
}
})
if (status) {
this.chapterId = this.history[this.currentIndex].chapterId;
this.bookid = data.bookid;
} else {
this.history.push({
bookid: data.bookid,
chapterId: data.chapterId
})
localStorage.setItem("history", JSON.stringify(this.history))
}
}
this.getReadList();
},
onReachBottom() {
this.getReadList();
},
methods: {
scroll(e) {
console.log(e)
},
async getReadList () {
if(this.history.length == 0){
this.history.push({
bookid: this.bookid,
chapterId: this.chapterId
})
localStorage.setItem("history", JSON.stringify(this.history))
} else {
this.history.forEach((val,index) => {
// 如果该书已经被阅读过,那么status true,没有阅读 false
if (val.bookid == this.bookid) {
this.currentIndex = index
status = true
} else {
status = false
}
});
if (status) {
this.history[this.currentIndex].chapterId = this.chapterId;
localStorage.setItem("history", JSON.stringify(this.history))
} else {
this.history.push({
bookid: this.bookid,
chapterId: this.chapterId
})
localStorage.setItem("history", JSON.stringify(this.history))
}
};
let data = (await this.$http.startRead({
data: {
bookid: this.bookid,
chapterId: this.chapterId
}
})).result;
uni.setNavigationBarTitle({
title: `${data.bookName} | ${data.chapterName}`
});
data.content = JSON.parse((JSON.stringify(data.content.split("</p>"))).replace(/<p>/g, ""));
data.content.unshift(data.chapterName+data.chapterNum)
data.content.forEach((val) => {
this.nodes.push({
name: 'p',
attrs: {
style: 'margin-bottom:10px;'
},
children: [{
type: 'text',
text: val
}]
})
})
this.chapterId = data.nextChapterId
}
}
}
</script>
<style scoped lang="less">
.read {
font-size: 17px;
background: rgb(230, 224, 208);
padding: 8px;
uni-rich-text {
text-indent: 10px;
}
}
</style>

View File

@@ -0,0 +1,181 @@
<template>
<div class="book">
<view class="uni-margin-wrap">
<swiper class="swiper" :indicator-dots="indicatorDots"
:autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in BannerList" :key="index">
<a :href="item.href">
<image :src="item.imgUrl" mode="widthFix"/>
</a>
</swiper-item>
</swiper>
</view>
<div class="main" v-for="(item,index) in BookList" :key="index">
<view class="item-list" v-if="item.hasOwnProperty('top')">
<view class="item-title">
{{ item.title }}
</view>
<div class="item-content" @click="enterInfo(item.top.id)">
<image class="hot" mode="scaleToFill" :src="item.top.imgUrl" />
<div class="content-right">
<h3 class="content-title">{{ item.top.title }}</h3>
<p class="content-desc">{{ item.top.desc }}</p>
<div class="content-class"></div>
</div>
</div>
<uni-list class="book-list">
<uni-list-item v-for="(t, inx) in item.list" :title="t.title"
:key="inx" @click="enterInfo(t.id)"/>
</uni-list>
</view>
<view class="item-list" v-else-if="item.title == '编辑力荐' ">
<view class="item-title">
{{ item.title }}
</view>
<div class="item-content" v-for="(o,p) in item.list" :key="p"
@click="enterInfo(o.id)">
<image class="hot" mode="scaleToFill" :src="o.imgUrl" />
<div class="content-right">
<h3 class="content-title">{{ o.title }}</h3>
<p class="content-desc">{{ o.desc }}</p>
<div class="content-class"></div>
</div>
</div>
</view>
<view class="item-list" v-else>
<view class="item-title">
{{ item.title }}
</view>
<div class="item-content">
<ul>
<li v-for="(a,y) in item.list" :key="y" @click="enterInfo(a.id)">
<img mode="scaleToFill" :src="a.imgUrl"/>
<p>{{ a.title }}</p>
</li>
</ul>
</div>
</view>
</div>
</div>
</template>
<script>
import { mapMutations } from "vuex";
import uniList from '@/components/uni-list/uni-list.vue'
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
export default {
data() {
return {
BannerList: [],
BookList: [],
indicatorDots: true,
autoplay: true,
interval: 3000,
duration: 500
}
},
created() {
this.getIndexData()
},
onLoad() {
},
methods: {
...mapMutations([
'SET_HOTLIST'
]),
async getIndexData() {
let indexData = await this.$http.getIndexData({ data: {}, header:{} });
this.SET_HOTLIST(indexData.booklist[0])
this.BannerList = indexData.banner
this.BookList = indexData.booklist
},
enterInfo(id) {
uni.navigateTo({
url: `/pages/bookinfo/bookinfo?id=${id}`
});
}
},
components: {
uniList,
uniListItem
},
}
</script>
<style lang="less">
.book {
swiper-item {
image {
height: 171px !important;
width: 100%;
}
}
.item-list {
padding: 20rpx;
.item-title {
border-left: 10upx solid #e95e56;
padding-left: 20upx;
font-size: 32upx;
}
.book-list {
margin-top: 5px;
}
.item-content {
ul {
display: flex;
justify-content: flex-start;
width: 100%;
flex-flow: wrap;
li {
width: 30%;
margin-right: 5%;
margin-bottom: 5%;
img {
width: 100%;
height: 320upx;
}
p {
}
&:nth-child(3n) {
margin-right: 0 !important;
}
}
}
display: flex;
flex-direction: row;
margin-top: 10px;
.hot {
width: 114px;
height: 85px;
}
.content-right {
margin-left: 17px;
.content-title {
font-size: 17px;
color: #333;
}
.content-desc {
font-size: 13px;
color: #888;
line-height: 20px;
}
.content-class {
}
}
}
}
}
</style>

View File

@@ -0,0 +1,89 @@
<template>
<view class="type">
<view class="type_left">
<ul>
<li :class="index == currentIndex ? 'active' : '' "
v-for="(item,index ) in leftData" :key="index"
@click="renderRight(index)">{{item.title}}</li>
</ul>
</view>
<view class="type_right">
<ul>
<li v-for="(item,index) in rightData" :key="index" @click="turnToclassify(item.cid)">{{item.text}}</li>
</ul>
</view>
</view>
</template>
<script>
export default {
data() {
return {
currentIndex: 0,
leftData: [],
rightData: [],
pid:''
}
},
onLoad() {},
created(){
this.getData()
},
methods: {
async getData () {
let Data = await this.$http.getClass({ data:{} });
// console.log(Data)
this.leftData = Data
this.renderRight(0)
},
renderRight(index) {
this.currentIndex = index;
this.rightData = this.leftData[index].child;
this.pid = this.leftData[index].pid
// console.log(this.pid)
},
turnToclassify(cid){
uni.navigateTo({
url: `./classify?pid=${this.pid}&cid=${cid}`
});
}
}
}
</script>
<style lang="less">
.type {
.active {
color: red;
}
.type_left {
float: left;
width: 20%;
position: fixed;
height: 100%;
border-right: 1px solid #e6e6e6;
overflow-y: scroll;
ul {
padding-bottom: 88px;
li {
text-align: center;
padding: 10px 0;
}
}
}
.type_right {
float: left;
width: 80%;
position: relative;
left: 20%;
ul {
li {
float: left;
margin: 10px;
}
}
}
}
</style>

View File

@@ -0,0 +1,108 @@
<template>
<view class="classify">
<view class="classify_title">
<p>奇幻玄幻--东方玄幻</p>
</view>
<ul>
<li v-for="(item,index) in classifyList" :key="index" @click="enterInfo( item.bookId)">
<view class="bookList">
<img :src="item.coverUrl">
<view class="message">
<h3 class="title">{{ item.bookName }}</h3>
<p>作者:{{ item.authorName }}</p>
<p>更新至:{{ item.updteChapterName }}</p>
<p class="introduction">简介:{{ item.description }}</p>
</view>
</view>
</li>
</ul>
</view>
</template>
<script>
export default{
data() {
return {
cid: null,
cPid: null,
pageNum: 1,
classifyList:[],
categoryName:'',//大分类
subCateName:''//小分类
}
},
onLoad(option) {
this.cid = option.cid
this.cPid = option.pid
this.getClassifyData()
},
onReachBottom() {
this.pageNum++;
this.getClassifyData();
},
methods:{
async getClassifyData () {
let Data = await this.$http.getClassify({ data:{ cPid:this.cPid, cid:this.cid ,pageNum: this.pageNum} });
this.classifyList = [...this.classifyList, ...Data.ranklist]
this.categoryName = this.classifyList[0].categoryName
this.subCateName =this.classifyList[0].subCateName
uni.setNavigationBarTitle({
title: this.classifyList[0].subCateName
});
},
enterInfo(id) {
uni.navigateTo({
url: `/pages/bookinfo/bookinfo?id=${id}`
});
}
}
}
</script>
<style lang="less">
.classify{
.classify_title{
height: 60upx;
background-color: #f2f2f2;
font-size: 28upx;
border-bottom: 1upx solid #dfdfdf;
display: flex;
align-items: center;
padding-left: 20upx;
}
ul{
width: 100%;
height: 100%;
li{
height: 90px;
padding: 20upx;
position: relative;
border-bottom: 1upx solid #dfdfdf;
.bookList{
width: 100%;
height: 100%;
display: flex;
flex-flow: row;
justify-content: flex-start;
img{width:140upx;height: 160upx}
.message{
margin-left: 20upx;
.title{
font-size: 32upx;
}
p{font-size: 24upx; color: #8f8f8f}
.introduction{
width: 580upx;
font-size: 24upx; color: #8f8f8f;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,201 @@
<template>
<view class="login">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="text" active-color="#4c86f7"></uni-segmented-control>
<view class="content">
<view v-show="current === 0">
<view class="signIn">
<view class="userIcon">
<image src="../../static/icon.png" mode=""></image>
</view>
<view class="txtInput">
<view class="inputBox">
<label for="username">
<span class="inputIcon"><image src="../../static/username.png" mode=""></image></span>
<input type="text" value="" class="username" v-model="loginMessage.username" placeholder="请输入用户名"/>
</label>
</view>
<view class="inputBox">
<label for="password">
<span class="inputIcon"><image src="../../static/password.png" mode=""></image></span>
<input type="text" value="" class=" password" v-model="loginMessage.password" placeholder="请输入密码"/>
</label>
</view>
<button type="primary" form-type="submit" >登录</button>
</view>
</view>
</view>
<view v-show="current === 1">
<view class="signOut">
<view class="inputBox">
<label for="username">
<span>用户名</span>
<input type="text" value="" class="username" v-model="signOutmessage.username" placeholder="请输入用户名"/>
</label>
<label for="phone">
<span>手机号</span>
<input type="text" value="" class="phone" v-model="signOutmessage.phone" placeholder="请输入手机号"/>
</label>
<label for="password">
<span>密码</span>
<input type="text" value="" class="password" v-model="signOutmessage.password" placeholder="请输入密码"/>
</label>
</view>
<button type="primary" form-type="submit" >注册</button>
</view>
</view>
</view>
</view>
</template>
<script>
import uniSegmentedControl from "@/components/uni-segmented-control/uni-segmented-control.vue"
export default{
components: {uniSegmentedControl},
data() {
return {
items: ['登录','注册'],
current: 0,
loginMessage: {
username: '',
userpwd: ''
},
signOutmessage:{
username:'',
phone:'',
userpwd:''
}
}
},
methods:{
onClickItem(index) {
// 列表切换
if (this.current !== index) {
this.current = index;
}
uni.setNavigationBarTitle({
title: this.items[index]
});
},
async login(){
let data = await this.$http.userLogin({
data: this.loginMessage
});
console.log(data)
this.$utils.setLocalStorage("LoginStatus",data)
}
}
}
</script>
<!-- ffb400 -->
<style lang="less">
.login{
padding: 20upx;
.content{
.signIn{
.userIcon{
width: 100%;
height: 300upx;
display: flex;
justify-content: center;
align-items: center;
image{
width: 180upx;
height: 180upx;
}
}
.txtInput{
padding: 20upx;
.inputBox{
label{
width: 80%;
margin: 0 auto;
display: flex;
align-items: center;
margin-top: 20upx;
.inputIcon{
image{width: 60upx; height: 60upx;}
}
input{
color: #999999;
font-size: 28upx;
margin-left: 20upx;
display: inline-block;
background: none;
padding: 10upx 0;
position: relative;
}
input::after{
content: "";
width: 0;
height: 2upx;
background-color: #4c86f7;
position: absolute;
left: 50%;
bottom: 0;
opacity: 0;
transition: all 0.3s ease-in-out;
}
}
label:hover input::after{
width: 100%;
left: 0;
opacity: 1;
}
}
uni-button{
height: 70upx;
margin-top: 100upx;
box-shadow: 0 0 10upx #4c86f7;
border-radius: 50upx;
line-height: 70upx;
font-size: 32upx;
}
}
}
.signOut{
min-height: 540upx;
background: url("./../../static/novel.png") top left no-repeat;
background-size: 100%;
position: relative;
margin-top: 20upx;
.inputBox{
padding-top: 540upx;
label{
width: 68%;
margin: 0 auto;
display: flex;
align-items: center;
margin-top: 30upx;
display: flex;
justify-content: space-between;
span{
color: #999999;
}
input{
color: #999999;
font-size: 28upx;
margin-left: 20upx;
display: inline-block;
background: none;
padding: 10upx;
position: relative;
border-radius: 20upx;
box-shadow: 0 0 6upx #4c86f7;
}
}
}
uni-button{
height: 70upx;
margin-top: 100upx;
box-shadow: 0 0 10upx #4c86f7;
border-radius: 50upx;
line-height: 70upx;
font-size: 32upx;
}
}
}
}
</style>

View File

@@ -0,0 +1,229 @@
<template>
<view class="my">
<view class="logined" v-if="isLogin">
<view class="myTitle">
<image src="../../static/defaulticon.png" mode="aspectFit"></image>
<view class="userMsg">
<h3>Mr.Right</h3>
<p>这家伙真懒,签名都不设置</p>
</view>
</view>
<view class="nav">
<ul>
<li><image src="../../static/collection.png" mode="aspectFit"></image><p>收藏</p></li>
<li><image src="../../static/read.png" mode="aspectFit"></image><p>阅读</p></li>
<li><image src="../../static/message.png" mode="aspectFit"></image><p>消息</p></li>
</ul>
</view>
<view class="other">
<view class="vip">
<view class="otherTitle"> <image src="../../static/vip.png" mode="aspectFit"></image> vip会员</view>
<p>立即开通 > </p>
</view>
<ul>
<li>
<view class="icon"><image src="../../static/like.png" mode="aspectFit"></image>想读</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/upload.png" mode="aspectFit"></image> 上传</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/buy.png" mode="aspectFit"></image> 已购买</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/histroy.png" mode="aspectFit"></image>浏览记录</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/help.png" mode="aspectFit"></image>帮助中心</view>
<p>0</p>
</li>
</ul>
</view>
<button type="primary">退出</button>
</view>
<view class="unlogin" v-else="">
<view class="myTitle">
<image src="../../static/defaulticon.png" mode="aspectFit"></image>
<view class="userMsg">
<h3>您还未登录</h3>
<view class="toLogin" @click="toLogin()">登录</view>
</view>
</view>
<view class="nav">
<ul>
<li><image src="../../static/collection.png" mode="aspectFit"></image><p>收藏</p></li>
<li><image src="../../static/read.png" mode="aspectFit"></image><p>阅读</p></li>
<li><image src="../../static/message.png" mode="aspectFit"></image><p>消息</p></li>
</ul>
</view>
<view class="other">
<view class="vip">
<view class="otherTitle"> <image src="../../static/vip.png" mode="aspectFit"></image> vip会员</view>
<p>立即开通 > </p>
</view>
<ul>
<li>
<view class="icon"><image src="../../static/like.png" mode="aspectFit"></image>想读</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/upload.png" mode="aspectFit"></image> 上传</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/buy.png" mode="aspectFit"></image> 已购买</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/histroy.png" mode="aspectFit"></image>浏览记录</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/help.png" mode="aspectFit"></image>帮助中心</view>
<p>0</p>
</li>
</ul>
</view>
</view>
</view>
</template>
<script>
import { mapGetters, mapMutations, mapActions } from 'vuex'
export default {
data() {
return {
isLogin: false
}
},
created() {
},
onShow() {
// this.$utils.AuthenticateLogin()
},
methods: {
toLogin(){
uni.navigateTo({
url: './login'
});
}
},
computed: {
}
}
</script>
<style lang="less">
.my{
.myTitle{
height: 200upx;
display: flex;
align-items: center;
flex-flow: row;
padding: 0upx 40upx;
.toLogin{
text-align: center;
border-radius: 50upx;
width: 180upx;
height: 50upx;
color: #ffffff;
background-color: #efa716;
}
image{
width: 120upx;
}
.userMsg{
margin-left: 40upx;
h3{
font-size: 36upx;
color: #3c3c3c;
font-weight: bold;
}
p{
font-size: 28upx;
color: #999999;
}
}
}
.nav{
height: 100upx;
padding: 20upx 0;
border-top: 1upx solid #f3f3f3;
border-bottom: 1upx solid #f3f3f3;
ul{
height: 100%;
display: flex;
flex-flow: row;
flex-wrap: nowrap;
align-items: center;
justify-content: space-around;
li{
height: 100%;
display: inline-flex;
justify-content: center;
align-items: center;
flex-flow: column;
color: #999999;
image{
width: 72upx;
}
}
}
}
.other{
display: flex;
flex-flow: column;
color: #999999;
.vip{
height: 100upx;
display: flex;
flex-flow: row;
align-items: center;
justify-content: space-between;
padding: 0 20upx;
border-top: 8upx solid #f3f3f3;
border-bottom: 10upx solid #f3f3f3;
.otherTitle{
height: 100%;
display: inline-flex;
justify-content: center;
align-items: center;
}
}
image{
width: 32upx;
height: 32upx;
margin-right: 20upx;
}
ul{
li{
height: 100upx;
border-bottom: 1upx solid #f3f3f3;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20upx;
.icon{
display: flex;
justify-content: center;
flex-flow: row;
align-items: center;
}
}
}
}
uni-button{
width: 600upx;
height: 80upx;
border-radius: 40upx;
line-height: 80upx;
margin-top: 20upx;
}
}
</style>

View File

@@ -0,0 +1,70 @@
<template>
<view class="login">
<view class="userIcon">
<view class="headericon">
<image src="../../static/icon.png" mode="aspectFit"></image>
</view>
</view>
<view class="loginForm">
<form action="" method="" name="">
<view class="inputBox">
<label for="username">
<span>手机号</span><input type="text" v-model="loginMessage.username" class="uni-input username" id="username" placeholder="请填写手机号" />
</label>
</view>
<view class="inputBox">
<label for="password">
<span>密 &nbsp; 码</span><input type="text" v-model="loginMessage.userpwd" class="uni-input password" id="password" placeholder="请输入你的密码" />
</label>
</view>
<button type="primary" form-type="submit" class="signIn" @click="login()" >登录</button>
</form>
</view>
</view>
</template>
<script>
export default{
data() {
return {
loginMessage: {
username: '',
userpwd: ''
}
}
},
created() {
},
onLoad() {
},
methods:{
getStatus () {
},
nochecked () {
uni.showToast({
title: "请先勾选协议",
duration: 2000
});
},
async login(){
let data = await this.$http.userLogin({
data: this.loginMessage
});
console.log(data)
localStorage.setItem("LoginStatus", JSON.stringify(data))
uni.switchTab({
url: '/pages/city/city'
});
}
// terunTo(){
// }
}
}
</script>
<style lang="less">
@import "./../../common/less/page/login.less";
</style>