1h27min
147
components/login.vue
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<view class="begin">
|
||||||
|
<image src="/static/logo.png"></image>
|
||||||
|
<view>
|
||||||
|
<view>账号密码登录</view>
|
||||||
|
<view>欢迎使用原住民宿</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view>
|
||||||
|
<view>手机号码</view>
|
||||||
|
<input type="text" placeholder="请输入手机号码" />
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view>密码</view>
|
||||||
|
<view><input type="text" placeholder="请输入密码" />
|
||||||
|
<image src="/static/眼睛.png"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/组 151.png" mode="">
|
||||||
|
</image>
|
||||||
|
<view>我已同意并阅读<text>《用户隐私政策》</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view></view>
|
||||||
|
<view>忘记密码?</view>
|
||||||
|
</view>
|
||||||
|
<view><button type="primary" @click="goto()">登录</button></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goto() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/index/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(2) {
|
||||||
|
align-self: flex-start;
|
||||||
|
margin-left: 3%;
|
||||||
|
margin-bottom: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(2) view:first-child {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(2) view:nth-child(2) {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(3) {
|
||||||
|
align-self: flex-start;
|
||||||
|
margin: 5% auto;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(3) view {
|
||||||
|
margin-bottom: 7%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(3) view>view:first-child {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 2%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(3) view+input {
|
||||||
|
display: block;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #999;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(3) view>view:nth-child(2) {
|
||||||
|
display: flex;
|
||||||
|
border: 1px solid #999;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(3) view>view:nth-child(2) image {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(4) {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(4) view image {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(4) view:first-child {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:nth-child(4) view:first-child text {
|
||||||
|
color: cornflowerblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:last-child {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 5%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.begin>view:last-child button {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
15
pages.json
@@ -4,7 +4,20 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "uni-app"
|
"navigationBarTitleText": "uni-app"
|
||||||
}
|
}
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
"path": "components/login",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "components/login",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
"navigationBarTitleText": "uni-app",
|
"navigationBarTitleText": "uni-app",
|
||||||
|
|||||||
@@ -1,29 +1,113 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view>
|
||||||
|
<swiper :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000">
|
||||||
<view class="intro">本项目已包含uni ui组件,无需import和注册,可直接使用。在代码区键入字母u,即可通过代码助手列出所有可用组件。光标置于组件名称处按F1,即可查看组件文档。</view>
|
<swiper-item v-for="value in adv_list">
|
||||||
<text class="intro">详见:</text>
|
<view class="swiper-item">
|
||||||
<uni-link :href="href" :text="href"></uni-link>
|
<image :src="value[0]"></image>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view>
|
||||||
|
<view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/定位.png"></image>
|
||||||
|
<text>{{}}</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/坐标.png"></image>
|
||||||
|
<text>我的位置</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view>
|
||||||
|
<view>入住</view>
|
||||||
|
<view>请选择</view>
|
||||||
|
</view>
|
||||||
|
<view>共{{}}晚</view>
|
||||||
|
<view>
|
||||||
|
<view>离店</view>
|
||||||
|
<view>请选择</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<input type="search" placeholder="搜索民宿名称" />
|
||||||
|
</view>
|
||||||
|
<button style="background-color: orange;">开始搜索</button>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view>
|
||||||
|
<!-- <image src=""></image> -->
|
||||||
|
<text>民俗文化</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src=""></image>
|
||||||
|
<text>优惠促销</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="footer">
|
||||||
|
<view v-for="unit in footerlist">
|
||||||
|
<image :src="unit[0]"></image>
|
||||||
|
<text>{{unit[1]}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
const footerlist = ["首页", "数据分析", "民宿", "我的"].map((value, index) => [value,`/static${["首页_首页.png","导航-民宿.png","导航-攻略.png","导航-我的.png"][index]}`])
|
||||||
return {
|
return {
|
||||||
href: 'https://uniapp.dcloud.io/component/README?id=uniui'
|
adv_list: null,
|
||||||
|
footerlist
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
async request(method, path) {
|
||||||
|
let text
|
||||||
|
if (method == "post") {
|
||||||
|
text = await fetch(`http://124.93.196.45:10091/Neusoft/homestay${path}`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
// "Authorization":
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
"password": "0CYdq6Hn",
|
||||||
|
"username": "6dOMIgIU"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else if (method == "get") {
|
||||||
|
text = await fetch(`http://124.93.196.45:10091/Neusoft/homestay${path}`, {
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": (await this.request("post", "/api/login")).token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const data = await text.json()
|
||||||
|
console.log(data);
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
this.adv_list = (await this.request("get", "/api/adv/list")).data.map(x => [
|
||||||
|
`http://124.93.196.45:10091/Neusoft/homestay${x.image}`, x.id, x.title, x.createTime
|
||||||
|
])
|
||||||
|
console.log(this.adv_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.container {
|
swiper {
|
||||||
padding: 20px;
|
height: 25vh;
|
||||||
font-size: 14px;
|
}
|
||||||
line-height: 24px;
|
|
||||||
|
swiper image {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
BIN
static/logo.png
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 29 KiB |
BIN
static/坐标.png
Normal file
|
After Width: | Height: | Size: 901 B |
BIN
static/定位.png
Normal file
|
After Width: | Height: | Size: 870 B |
BIN
static/导航-我的-选中.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/导航-我的.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/导航-攻略-选中.png
Normal file
|
After Width: | Height: | Size: 637 B |
BIN
static/导航-攻略.png
Normal file
|
After Width: | Height: | Size: 579 B |
BIN
static/导航-民宿-选中.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
static/导航-民宿.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
static/支付宝.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
static/眼睛.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
static/组 148.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/组 151.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
static/首页_首页-5.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
static/首页_首页.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |