Compare commits
17 Commits
mft_develo
...
main
Author | SHA1 | Date |
---|---|---|
小米便签 | 4bfb38ccb2 | 1 week ago |
psbxr6a2u | dc45bf7992 | 1 week ago |
psbxr6a2u | 611c038839 | 1 week ago |
psbxr6a2u | d3d6b56dcd | 1 week ago |
小米便签 | 55d282a424 | 1 week ago |
psbxr6a2u | 76b104a990 | 1 week ago |
小米便签 | 1c567bbf54 | 1 week ago |
小米便签 | 1a7782b27d | 1 week ago |
psbxr6a2u | d8e533f7d1 | 1 week ago |
psbxr6a2u | 6daf4b076b | 1 week ago |
psbxr6a2u | b686ded65f | 1 week ago |
小米便签 | 99425e02d7 | 3 weeks ago |
小米便签 | d48b9b48c5 | 1 month ago |
psbxr6a2u | 281bf227da | 1 month ago |
小米便签 | 97f95ff91a | 1 month ago |
小米便签 | f330039fb1 | 1 month ago |
小米便签 | 9a22c5bafd | 1 month ago |
After Width: | Height: | Size: 202 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 227 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 219 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 204 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 213 KiB |
After Width: | Height: | Size: 366 KiB |
After Width: | Height: | Size: 157 KiB |
After Width: | Height: | Size: 396 KiB |
After Width: | Height: | Size: 143 KiB |
After Width: | Height: | Size: 414 KiB |
After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 139 KiB |
After Width: | Height: | Size: 246 KiB |
After Width: | Height: | Size: 193 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 943 KiB |
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Eslint config file
|
||||
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||
* Install the Eslint extension before using this feature.
|
||||
*/
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
wx: true,
|
||||
App: true,
|
||||
Page: true,
|
||||
getCurrentPages: true,
|
||||
getApp: true,
|
||||
Component: true,
|
||||
requirePlugin: true,
|
||||
requireMiniProgram: true,
|
||||
},
|
||||
// extends: 'eslint:recommended',
|
||||
rules: {},
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
# 云开发 quickstart
|
||||
|
||||
这是云开发的快速启动指引,其中演示了如何上手使用云开发的三大基础能力:
|
||||
|
||||
- 数据库:一个既可在小程序前端操作,也能在云函数中读写的 JSON 文档型数据库
|
||||
- 文件存储:在小程序前端直接上传/下载云端文件,在云开发控制台可视化管理
|
||||
- 云函数:在云端运行的代码,微信私有协议天然鉴权,开发者只需编写业务逻辑代码
|
||||
|
||||
## 参考文档
|
||||
|
||||
- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)
|
||||
|
@ -0,0 +1,40 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/list/list",
|
||||
"pages/home/home",
|
||||
"pages/fabu/fabu",
|
||||
"pages/jiaru/jiaru",
|
||||
"pages/xinguan/xinguan",
|
||||
"pages/xinping/xinping",
|
||||
"pages/index/index",
|
||||
"pages/login/login",
|
||||
"pages/jialook/jialook",
|
||||
"pages/xinlook/xinlook",
|
||||
"pages/shenqing/shenqing",
|
||||
"pages/shenguan/shenguan",
|
||||
"pages/wode/wode",
|
||||
"pages/yonghu/yonghu",
|
||||
"pages/wolook/wolook"
|
||||
|
||||
],
|
||||
"window": {
|
||||
"backgroundColor": "#F6F6F6",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#F6F6F6",
|
||||
"navigationBarTitleText": "地图导航",
|
||||
"navigationBarTextStyle": "black"
|
||||
},
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"style": "v2",
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于小程序位置接口的效果展示"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": [
|
||||
"getLocation"
|
||||
]
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
button {
|
||||
background: initial;
|
||||
}
|
||||
|
||||
button:focus{
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
button::after{
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
Component({
|
||||
properties: {
|
||||
type: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
NavigationOrNot: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
data: {
|
||||
gaodeType: 'car'
|
||||
},
|
||||
lifetimes: {
|
||||
attached: function() {
|
||||
// 在组件实例进入页面节点树时执行
|
||||
},
|
||||
ready: function() {
|
||||
// 在组件布局完成后执行
|
||||
this.initialize()
|
||||
},
|
||||
detached: function() {
|
||||
// 在组件实例被从页面节点树移除时执行
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'properties.NavigationOrNot'(val) {
|
||||
console.log('type变化', val)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initialize: function() {
|
||||
// 自定义的初始化方法
|
||||
console.log('initialize', this.properties)
|
||||
this.setData({
|
||||
gaodeType: this.properties.type
|
||||
})
|
||||
// 例如设置一些初始状态
|
||||
},
|
||||
setType: function(type) {
|
||||
this.setData({
|
||||
gaodeType: type
|
||||
})
|
||||
this.triggerEvent('changeType', {
|
||||
gaode_type: type
|
||||
});
|
||||
},
|
||||
goToCar: function() {
|
||||
// 处理驾车逻辑
|
||||
console.log('驾车')
|
||||
this.setType('car')
|
||||
},
|
||||
goToWalk: function() {
|
||||
// 处理步行逻辑
|
||||
console.log('步行')
|
||||
this.setType('walk')
|
||||
},
|
||||
goToBus: function() {
|
||||
// 处理公交逻辑
|
||||
console.log('公交')
|
||||
this.setType('bus')
|
||||
},
|
||||
goToRide: function() {
|
||||
// 处理骑行逻辑
|
||||
console.log('骑行')
|
||||
this.setType('riding')
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<view class="flex-style {{NavigationOrNot ? 'active' : ''}}">
|
||||
<view class="flex-item {{gaodeType === 'car' &&NavigationOrNot ? 'active' : ''}}" bindtouchstart="goToCar">驾车</view>
|
||||
<view class="flex-item {{gaodeType === 'walk' &&NavigationOrNot ? 'active' : ''}}" bindtouchstart="goToWalk">步行</view>
|
||||
<view class="flex-item {{gaodeType === 'bus' &&NavigationOrNot ? 'active' : ''}}" bindtouchstart="goToBus">公交</view>
|
||||
<view class="flex-item {{gaodeType === 'riding' &&NavigationOrNot ? 'active' : ''}}" bindtouchstart="goToRide">骑行</view>
|
||||
</view>
|
@ -0,0 +1,23 @@
|
||||
.flex-style{
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
opacity: 0.3;
|
||||
pointer-events: none;
|
||||
}
|
||||
.flex-style.active {
|
||||
background: #ffffff;
|
||||
opacity: 1;
|
||||
pointer-events: initial;
|
||||
}
|
||||
.flex-item{
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
text-align: center;
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-flex: 1;
|
||||
flex: 1
|
||||
}
|
||||
.flex-item.active{
|
||||
color:#0091ff;
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
// components/GaodeInputTips/GaodeInputTips.js
|
||||
var amapFile = require('../../libs/amap-wx.js');
|
||||
var config = require('../../libs/config.js');
|
||||
var lonlat;
|
||||
var city;
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
city: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
longitude: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
latitude: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
inputType: {
|
||||
type: String,
|
||||
value: ''
|
||||
},
|
||||
defaultValue: {
|
||||
type: String,
|
||||
value: '请输入'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
tips: {},
|
||||
tipsShow: false
|
||||
},
|
||||
lifetimes: {
|
||||
attached: function() {
|
||||
// 在组件实例进入页面节点树时执行
|
||||
},
|
||||
ready: function(e) {
|
||||
// 在组件布局完成后执行
|
||||
console.log('搜索框', e)
|
||||
},
|
||||
detached: function() {
|
||||
// 在组件实例被从页面节点树移除时执行
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
bindInput: function(e){
|
||||
console.log('输入内容', e)
|
||||
var that = this;
|
||||
var keywords = e.detail.value;
|
||||
if (keywords === '') {
|
||||
that.setData({
|
||||
tips: []
|
||||
});
|
||||
return false
|
||||
}
|
||||
var key = config.Config.key;
|
||||
var myAmapFun = new amapFile.AMapWX({key: key});
|
||||
myAmapFun.getInputtips({
|
||||
keywords: keywords,
|
||||
location: lonlat,
|
||||
city: city,
|
||||
success: function(data){
|
||||
if(data && data.tips){
|
||||
that.setData({
|
||||
tips: data.tips
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
bindSearch: function(e){
|
||||
console.log('点击搜索', e.target.dataset.info)
|
||||
console.log('点击搜索', e.target.dataset)
|
||||
this.triggerEvent('customEvent', {
|
||||
info: e.target.dataset.info,
|
||||
inputType: this.properties.inputType
|
||||
});
|
||||
},
|
||||
handleFocus: function(e) {
|
||||
this.setData({
|
||||
tipsShow: true
|
||||
});
|
||||
},
|
||||
handleBlur: function(e) {
|
||||
this.setData({
|
||||
tipsShow: false
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<view class="section">
|
||||
<input value="{{city}}" data-city="{{city}}" data-longitude="{{longitude}}" data-latitude="{{latitude}}" placeholder="{{defaultValue}}" bindinput="bindInput" bindfocus="handleFocus" bindblur="handleBlur"/>
|
||||
<view class="tips_container" wx:if="{{tipsShow}}">
|
||||
<view bindtouchstart="bindSearch" data-info="{{i}}" data-keywords="{{i.name}}" class="text_box" wx:for="{{tips}}" wx:for-item="i" wx:key="i">
|
||||
{{i.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,28 @@
|
||||
.section {
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.section input {
|
||||
width: 90%;
|
||||
margin: 5px auto;
|
||||
border: 1px solid #c3c3c3;
|
||||
height: 30px;
|
||||
border-radius: 3px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.text_box {
|
||||
margin: 10px 25px;
|
||||
border-bottom: 1px solid #c3c3c3;
|
||||
padding-bottom: 10px
|
||||
}
|
||||
|
||||
.tips_container {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
background: #FFF;
|
||||
width: 100%;
|
||||
max-height: 50vh;
|
||||
overflow: auto;
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
// miniprogram/components/cloudTipModal/index.js
|
||||
const { isMac } = require('../../envList.js');
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
showUploadTip: false,
|
||||
tipText: isMac ? 'sh ./uploadCloudFunction.sh' : './uploadCloudFunction.bat'
|
||||
},
|
||||
properties: {
|
||||
showUploadTipProps: Boolean
|
||||
},
|
||||
observers: {
|
||||
showUploadTipProps: function(showUploadTipProps) {
|
||||
this.setData({
|
||||
showUploadTip: showUploadTipProps
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCheckEnv(){
|
||||
wx.showLoading({
|
||||
title: '',
|
||||
});
|
||||
wx.cloud
|
||||
.callFunction({
|
||||
name: 'quickstartFunctions',
|
||||
data: {
|
||||
type: 'getOpenId',
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
wx.hideLoading();
|
||||
this.setData({
|
||||
showUploadTip: !this.data.showUploadTip
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
// 报错信息提示环境不存在
|
||||
wx.hideLoading();
|
||||
if(e.message.includes('env not exists') || e.message.includes('Environment not found') || e.message.includes('env check invalid be filterd')){
|
||||
wx.showToast({
|
||||
title: '环境未找到',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onCheckEnvCancel(){
|
||||
this.setData({
|
||||
showUploadTip: !this.data.showUploadTip
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
.install_tip_back {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.install_tip_detail {
|
||||
position: fixed;
|
||||
background-color: white;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
top: 65%;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
padding: 50rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.install_tip_detail_title {
|
||||
font-weight: 400;
|
||||
font-size: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.install_tip_detail_tip {
|
||||
font-size: 25rpx;
|
||||
color: rgba(0,0,0,0.4);
|
||||
margin-top: 20rpx;
|
||||
text-align: left;
|
||||
}
|
||||
.install_tip_detail_buttons {
|
||||
padding-top: 50rpx;
|
||||
display: flex;
|
||||
}
|
||||
.install_tip_detail_button {
|
||||
color: #07C160;
|
||||
font-weight: 500;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
width: 40%;
|
||||
text-align: center;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.install_tip_detail_button_primary {
|
||||
background-color: #07C160;
|
||||
color: #fff;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
Component({
|
||||
data: {
|
||||
modalVisible: false,
|
||||
tipText: '云开发>云模板>模板中心',
|
||||
},
|
||||
properties: {
|
||||
installModulePageTitleProps: String,
|
||||
modalVisibleProps: Boolean,
|
||||
tipTextProps: String,
|
||||
installModuleNameProps: String,
|
||||
},
|
||||
observers: {
|
||||
modalVisibleProps: function (modalVisibleProps) {
|
||||
this.setData({
|
||||
modalVisible: modalVisibleProps,
|
||||
});
|
||||
},
|
||||
tipTextProps: function (tipTextProps) {
|
||||
this.setData({
|
||||
tipText: tipTextProps,
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
hideModal() {
|
||||
if (this.data.modalVisible) {
|
||||
this.setData({
|
||||
modalVisible: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
onViewDetail() {
|
||||
this.hideModal();
|
||||
wx.navigateTo({
|
||||
url: `/pages/cloudbaseModuleInstallTips/index?moduleName=${this.properties.installModuleNameProps}&title=${this.properties.installModulePageTitleProps}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<!-- miniprogram/components/cloudTipModal/index.wxml -->
|
||||
<view class="install_tip" wx:if="{{ modalVisible }}">
|
||||
<view class="install_tip_back" bindtap="hideModal" />
|
||||
<view class="install_tip_detail">
|
||||
<view class="install_tip_detail_title">体验前需安装云模板</view>
|
||||
<view class="install_tip_detail_tip">请按照以下路径安装对应云模板</view>
|
||||
<view class="install_tip_detail_shell">{{ tipText }}</view>
|
||||
<view bindtap="onViewDetail" class="install_tip_detail_button">查看详情{{ installModuleName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -0,0 +1,57 @@
|
||||
.install_tip_back {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.install_tip_detail {
|
||||
position: fixed;
|
||||
background-color: white;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
top: 60%;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
padding: 50rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.install_tip_detail_title {
|
||||
font-weight: 400;
|
||||
font-size: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.install_tip_detail_tip {
|
||||
font-size: 25rpx;
|
||||
color: rgba(0,0,0,0.4);
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.install_tip_detail_shell {
|
||||
margin: 70rpx 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.install_tip_detail_copy {
|
||||
color: #546488;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.install_tip_detail_button {
|
||||
color: #07C160;
|
||||
font-weight: 500;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
width: 60%;
|
||||
text-align: center;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 0 auto;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
// components/cloudbaseModuleInstallPath/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
installModuleName: String,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<view class="tip">可以在“云开发>云模板>模板中心>{{installModuleName}}”找到该模板</view>
|
@ -0,0 +1,7 @@
|
||||
.tip {
|
||||
font-size: 23rpx;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
width: 90%;
|
||||
text-align: center;
|
||||
margin: 30rpx auto 0 auto;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
Component({
|
||||
data: {
|
||||
modalVisible: false,
|
||||
},
|
||||
properties: {
|
||||
visible: Boolean,
|
||||
imageSrc: String,
|
||||
},
|
||||
observers: {
|
||||
visible: function (visible) {
|
||||
this.setData({
|
||||
modalVisible: visible
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClose() {
|
||||
this.setData({ modalVisible: false });
|
||||
}
|
||||
}
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<view class="modal_container" wx:if="{{ modalVisible }}">
|
||||
<view class="icon_close" bind:tap="onClose">
|
||||
<view>X</view>
|
||||
</view>
|
||||
<view class="image_container">
|
||||
<image class="code_img" src="{{ imageSrc }}" />
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,95 @@
|
||||
.modal_container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.icon_close {
|
||||
position: fixed;
|
||||
right: 40rpx;
|
||||
top: 40rpx;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
/* background-color: #07c160; */
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
color: white;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.code_img {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
margin-top: 50%;
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.install_tip_back {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.install_tip_detail {
|
||||
position: fixed;
|
||||
background-color: white;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
top: 60%;
|
||||
border-radius: 40rpx 40rpx 0 0;
|
||||
padding: 50rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.install_tip_detail_title {
|
||||
font-weight: 400;
|
||||
font-size: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.install_tip_detail_tip {
|
||||
font-size: 25rpx;
|
||||
color: rgba(0,0,0,0.4);
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.install_tip_detail_shell {
|
||||
margin: 70rpx 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.install_tip_detail_copy {
|
||||
color: #546488;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.install_tip_detail_button {
|
||||
color: #07C160;
|
||||
font-weight: 500;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
width: 60%;
|
||||
text-align: center;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 0 auto;
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
const envList = [{"envId":"cloud1-3gvvw1ak18d30298","alias":"cloud1"}]
|
||||
const isMac = false
|
||||
module.exports = {
|
||||
envList,
|
||||
isMac
|
||||
}
|
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,31 @@
|
||||
function AMapWX(a){this.key=a.key;this.requestConfig={key:a.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};this.MeRequestConfig={key:a.key,serviceName:"https://restapi.amap.com/rest/me"}}
|
||||
AMapWX.prototype.getWxLocation=function(a,b){wx.getLocation({type:"gcj02",success:function(c){c=c.longitude+","+c.latitude;wx.setStorage({key:"userLocation",data:c});b(c)},fail:function(c){wx.getStorage({key:"userLocation",success:function(d){d.data&&b(d.data)}});a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
|
||||
AMapWX.prototype.getMEKeywordsSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.city&&(d.city=b.city);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);b.sig&&(d.sig=
|
||||
b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/local",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
|
||||
AMapWX.prototype.getMEIdSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.id&&(d.id=b.id);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/id",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&
|
||||
0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
|
||||
AMapWX.prototype.getMEPolygonSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.polygon&&(d.polygon=b.polygon);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);
|
||||
b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/polygon",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
|
||||
AMapWX.prototype.getMEaroundSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.center&&(d.center=b.center);b.radius&&(d.radius=b.radius);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&
|
||||
(d.pageSize=b.pageSize);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/around",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
|
||||
AMapWX.prototype.getGeo=function(a){var b=this.requestConfig,c=a.options;b={key:this.key,extensions:"all",s:b.s,platform:b.platform,appname:this.key,sdkversion:b.sdkversion,logversion:b.logversion};c.address&&(b.address=c.address);c.city&&(b.city=c.city);c.batch&&(b.batch=c.batch);c.sig&&(b.sig=c.sig);wx.request({url:"https://restapi.amap.com/v3/geocode/geo",data:b,method:"GET",header:{"content-type":"application/json"},success:function(d){(d=d.data)&&d.status&&"1"===d.status?a.success(d):a.fail({errCode:"0",
|
||||
errMsg:d})},fail:function(d){a.fail({errCode:"0",errMsg:d.errMsg||""})}})};
|
||||
AMapWX.prototype.getRegeo=function(a){function b(d){var e=c.requestConfig;wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:c.key,location:d,extensions:"all",s:e.s,platform:e.platform,appname:c.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){g=g.data.regeocode;var h=g.addressComponent,f=[],k=g.roads[0].name+"\u9644\u8fd1",m=d.split(",")[0],n=d.split(",")[1];if(g.pois&&
|
||||
g.pois[0]){k=g.pois[0].name+"\u9644\u8fd1";var l=g.pois[0].location;l&&(m=parseFloat(l.split(",")[0]),n=parseFloat(l.split(",")[1]))}h.provice&&f.push(h.provice);h.city&&f.push(h.city);h.district&&f.push(h.district);h.streetNumber&&h.streetNumber.street&&h.streetNumber.number?(f.push(h.streetNumber.street),f.push(h.streetNumber.number)):f.push(g.roads[0].name);f=f.join("");a.success([{iconPath:a.iconPath,width:a.iconWidth,height:a.iconHeight,name:f,desc:k,longitude:m,latitude:n,id:0,regeocodeData:g}])}else a.fail({errCode:g.data.infocode,
|
||||
errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this;a.location?b(a.location):c.getWxLocation(a,function(d){b(d)})};
|
||||
AMapWX.prototype.getWeather=function(a){function b(g){var h="base";a.type&&"forecast"==a.type&&(h="all");wx.request({url:"https://restapi.amap.com/v3/weather/weatherInfo",data:{key:d.key,city:g,extensions:h,s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(f){if(f.data.status&&"1"==f.data.status)if(f.data.lives){if((f=f.data.lives)&&0<f.length){f=f[0];var k={city:{text:"\u57ce\u5e02",data:f.city},
|
||||
weather:{text:"\u5929\u6c14",data:f.weather},temperature:{text:"\u6e29\u5ea6",data:f.temperature},winddirection:{text:"\u98ce\u5411",data:f.winddirection+"\u98ce"},windpower:{text:"\u98ce\u529b",data:f.windpower+"\u7ea7"},humidity:{text:"\u6e7f\u5ea6",data:f.humidity+"%"}};k.liveData=f;a.success(k)}}else f.data.forecasts&&f.data.forecasts[0]&&a.success({forecast:f.data.forecasts[0]});else a.fail({errCode:f.data.infocode,errMsg:f.data.info})},fail:function(f){a.fail({errCode:"0",errMsg:f.errMsg||""})}})}
|
||||
function c(g){wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:d.key,location:g,extensions:"all",s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(h){if(h.data.status&&"1"==h.data.status){h=h.data.regeocode;if(h.addressComponent)var f=h.addressComponent.adcode;else h.aois&&0<h.aois.length&&(f=h.aois[0].adcode);b(f)}else a.fail({errCode:h.data.infocode,errMsg:h.data.info})},
|
||||
fail:function(h){a.fail({errCode:"0",errMsg:h.errMsg||""})}})}var d=this,e=d.requestConfig;a.city?b(a.city):d.getWxLocation(a,function(g){c(g)})};
|
||||
AMapWX.prototype.getPoiAround=function(a){function b(e){e={key:c.key,location:e,s:d.s,platform:d.platform,appname:c.key,sdkversion:d.sdkversion,logversion:d.logversion};a.querytypes&&(e.types=a.querytypes);a.querykeywords&&(e.keywords=a.querykeywords);wx.request({url:"https://restapi.amap.com/v3/place/around",data:e,method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){if((g=g.data)&&g.pois){for(var h=[],f=0;f<g.pois.length;f++){var k=0==
|
||||
f?a.iconPathSelected:a.iconPath;h.push({latitude:parseFloat(g.pois[f].location.split(",")[1]),longitude:parseFloat(g.pois[f].location.split(",")[0]),iconPath:k,width:22,height:32,id:f,name:g.pois[f].name,address:g.pois[f].address})}a.success({markers:h,poisData:g.pois})}}else a.fail({errCode:g.data.infocode,errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this,d=c.requestConfig;a.location?b(a.location):c.getWxLocation(a,function(e){b(e)})};
|
||||
AMapWX.prototype.getStaticmap=function(a){function b(e){c.push("location="+e);a.zoom&&c.push("zoom="+a.zoom);a.size&&c.push("size="+a.size);a.scale&&c.push("scale="+a.scale);a.markers&&c.push("markers="+a.markers);a.labels&&c.push("labels="+a.labels);a.paths&&c.push("paths="+a.paths);a.traffic&&c.push("traffic="+a.traffic);e="https://restapi.amap.com/v3/staticmap?"+c.join("&");a.success({url:e})}var c=[];c.push("key="+this.key);var d=this.requestConfig;c.push("s="+d.s);c.push("platform="+d.platform);
|
||||
c.push("appname="+d.appname);c.push("sdkversion="+d.sdkversion);c.push("logversion="+d.logversion);a.location?b(a.location):this.getWxLocation(a,function(e){b(e)})};
|
||||
AMapWX.prototype.getInputtips=function(a){var b=Object.assign({},this.requestConfig);a.location&&(b.location=a.location);a.keywords&&(b.keywords=a.keywords);a.type&&(b.type=a.type);a.city&&(b.city=a.city);a.citylimit&&(b.citylimit=a.citylimit);wx.request({url:"https://restapi.amap.com/v3/assistant/inputtips",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.tips&&a.success({tips:c.data.tips})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||
|
||||
""})}})};
|
||||
AMapWX.prototype.getDrivingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.waypoints&&(b.waypoints=a.waypoints);a.avoidpolygons&&(b.avoidpolygons=a.avoidpolygons);a.avoidroad&&(b.avoidroad=a.avoidroad);wx.request({url:"https://restapi.amap.com/v3/direction/driving",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths,
|
||||
taxi_cost:c.data.route.taxi_cost||""})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
|
||||
AMapWX.prototype.getWalkingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/walking",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
|
||||
AMapWX.prototype.getTransitRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.city&&(b.city=a.city);a.cityd&&(b.cityd=a.cityd);wx.request({url:"https://restapi.amap.com/v3/direction/transit/integrated",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&(c=c.data.route,a.success({distance:c.distance||"",taxi_cost:c.taxi_cost||
|
||||
"",transits:c.transits}))},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
|
||||
AMapWX.prototype.getRidingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/riding",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};module.exports.AMapWX=AMapWX;
|
@ -0,0 +1,5 @@
|
||||
const config = {
|
||||
key : 'c7088e9a24fc49390d873183a92bbad5'
|
||||
}
|
||||
|
||||
module.exports.Config = config;
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "校园拼车发布",
|
||||
"navigationBarBackgroundColor": "#B6C2D6"
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
|
||||
|
||||
<view>
|
||||
<view class="id">微信昵称:</view>
|
||||
<input bindinput="gettitle" type="text" class="title" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="id">手机号:</view>
|
||||
<input bindinput="getweixin" type="text" class="title" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="id">拼车总费用:</view>
|
||||
<input bindinput="getprice" type="text" class="title" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<text>出发日期:</text>
|
||||
<picker mode="date" value="{{date}}" start="2024-3-18" end="2030-3-18" bindchange="bindDateChange">
|
||||
<view class="picker">
|
||||
当前选择:{{date}}
|
||||
</view>
|
||||
</picker>
|
||||
|
||||
<view style="height:20rpx;"></view>
|
||||
|
||||
<text>出发时间:</text>
|
||||
</view>
|
||||
<view>
|
||||
<picker mode="time" value="{{time}}" start="00:00" end="23:59" bindchange="bindTimeChange">
|
||||
<view class="picker">
|
||||
当前选择: {{time}}
|
||||
</view>
|
||||
</picker>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="id">拼车人数:</view>
|
||||
<input bindinput="getnum" type="text" class="title" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="id">出发地点:</view>
|
||||
<input bindinput="getqi" type="text" class="title" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="id">到达地点:</view>
|
||||
<input bindinput="getzhong" type="text" class="title" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view>对拼车人员的要求(非必填)</view>
|
||||
<view class="container">
|
||||
<textarea name="content" class="textarea" value="{{content}}" placeholder="请输入"bindinput="handleTextareaInput"></textarea>
|
||||
</view>
|
||||
<view style="height:20rpx;"></view>
|
||||
<view style="height:20rpx;"></view>
|
||||
<button class="button" style="width: 40%;height: 80rpx;background-color: skyblue;" bindtap="submit">提交</button>
|
||||
<view style="height:20rpx;"></view>
|
@ -0,0 +1,43 @@
|
||||
page{
|
||||
background-color:#B6C2D6;
|
||||
}
|
||||
image{
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
}
|
||||
.picker{
|
||||
border: 1px solid;
|
||||
padding:5rpx;
|
||||
margin: 5rpx;
|
||||
background-color: white;
|
||||
}
|
||||
input{
|
||||
border: 1px solid;
|
||||
padding:5rpx;
|
||||
margin: 5rpx;
|
||||
background-color: white;
|
||||
}
|
||||
.textarea{
|
||||
border: 1px solid;
|
||||
width: 99%;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.world{
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.load{
|
||||
width: 70%;
|
||||
}
|
||||
.mini-btn{
|
||||
float: right;
|
||||
margin-top: -65rpx;
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.button{
|
||||
margin-top: 60rpx;
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
Page({
|
||||
jiaru(){
|
||||
wx.navigateTo({
|
||||
url: '../jiaru/jiaru',
|
||||
})
|
||||
},
|
||||
kongguan(){
|
||||
wx.navigateTo({
|
||||
url: '../kongguan_chakan_yonghu/kongguan_chakan_yonghu',
|
||||
})
|
||||
},
|
||||
fabu(){
|
||||
wx.navigateTo({
|
||||
url: '../fabu/fabu',
|
||||
})
|
||||
},
|
||||
guanli(){
|
||||
wx.navigateTo({
|
||||
url: '../list/list',
|
||||
})
|
||||
},
|
||||
kongguan(){
|
||||
wx.redirectTo({
|
||||
url: '../login/login',
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
kuaisu(){
|
||||
wx.navigateTo({
|
||||
url: '../kslook /kslook',
|
||||
})
|
||||
},
|
||||
xinping(){
|
||||
wx.navigateTo({
|
||||
url: '../xinping/xinping',
|
||||
})
|
||||
},
|
||||
daohang(){
|
||||
wx.navigateTo({
|
||||
url: '../index/index',
|
||||
})
|
||||
},
|
||||
shen(){
|
||||
wx.navigateTo({
|
||||
url: '../shenguan/shenguan',
|
||||
})
|
||||
},
|
||||
wo(){
|
||||
wx.navigateTo({
|
||||
url: '../wode/wode',
|
||||
})
|
||||
},
|
||||
onLoad(){
|
||||
wx.getStorage({
|
||||
key: 'user', // 替换为缓存中的key
|
||||
success: function(res) {
|
||||
console.log(res.data.nickName); // 输出获取到的数据
|
||||
},
|
||||
fail: function(err) {
|
||||
console.error('获取缓存失败', err);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "校园拼车",
|
||||
"navigationBarBackgroundColor": "#B6C2D6"
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
|
||||
<view style="height:40rpx;"></view>
|
||||
<view class="button-container">
|
||||
<button class="button" bindtap="kongguan" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/yong.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">用户登录</text>
|
||||
</button>
|
||||
<button class="button" bindtap="fabu" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/fa.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">发布拼车</text>
|
||||
</button>
|
||||
|
||||
</view>
|
||||
<view class="button-container">
|
||||
<button class="button" bindtap="guanli" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/guan.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">管理登录</text>
|
||||
</button>
|
||||
<button class="button" bindtap="jiaru" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/jia.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">加入拼车</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="button-container">
|
||||
<button class="button" bindtap="daohang" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/di.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">地图导航</text>
|
||||
</button>
|
||||
<button class="button" bindtap="xinping" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/xin.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">信誉评价</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="button-container">
|
||||
<button class="button" bindtap="shen" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/li.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">申请管理</text>
|
||||
</button>
|
||||
<button class="button" bindtap="wo" style="display: flex; justify-content: center; align-items: center; width: 40%; height: 90rpx; background-color: skyblue; border: none; border-radius: 5px;">
|
||||
<image class="jiantou" src="/pages/picture/shen.png" style="width: 25px; height: 25px;"></image>
|
||||
<text class="weizi" style="margin-left: 5px;">我的申请</text>
|
||||
</button>
|
||||
</view>
|
@ -0,0 +1,14 @@
|
||||
image{
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
}
|
||||
page{
|
||||
background-color:#B6C2D6;
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.button{
|
||||
margin-top: 60rpx;
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"GaodeHeader": "/components/GaodeHeader/GaodeHeader",
|
||||
"GaodeInputTips": "/components/GaodeInputTips/GaodeInputTips"
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<GaodeHeader class="noDaohang" bindchangeType="changeGaodeType" type="{{gaode_type}}" NavigationOrNot="{{daohang}}"></GaodeHeader>
|
||||
<view class="section">
|
||||
<!-- 当前位置 -->
|
||||
<GaodeInputTips bindcustomEvent="handleCustomEvent" city="{{city}}" longitude="{{longitude}}" latitude="{{latitude}}" defaultValue="{{'当前位置'}}" inputType="start"></GaodeInputTips>
|
||||
<!-- 目的地 -->
|
||||
<GaodeInputTips bindcustomEvent="handleCustomEvent" city="{{city_e}}" longitude="{{longitude_e}}" latitude="{{latitude_e}}" defaultValue="{{'目的地'}}" inputType="end"></GaodeInputTips>
|
||||
</view>
|
||||
<view class="map_container">
|
||||
<map wx:if="{{gaode_type !== 'bus' && mapState}}" class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}" bindmarkertap="makertap" polyline="{{polyline}}" include-points="{{includePoints}}"></map>
|
||||
<!-- 公交 -->
|
||||
<view wx:if="{{gaode_type === 'bus' && mapState}}">
|
||||
<view class="text_box" wx:for="{{transits}}" wx:for-item="i" wx:key="i">
|
||||
<text class="text_item" wx:for="{{i.transport}}" wx:for-item="j" wx:key="j">
|
||||
{{j}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜索错误 -->
|
||||
<view wx:if="{{!mapState}}">搜索中...</view>
|
||||
</view>
|
||||
<view class="map_text">
|
||||
<text class="h1">{{textData.name}}</text>
|
||||
<text>{{textData.desc}}</text>
|
||||
<view class="text_box" wx:if="{{daohang}}">
|
||||
<view class="text">{{distance}}</view>
|
||||
<view class="text">{{taxi_cost}}</view>
|
||||
<view class="text">{{multi_cost}}</view>
|
||||
<view class="text">{{bigger_cost}}</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,53 @@
|
||||
.section{
|
||||
height: 80px;
|
||||
width: 100%;
|
||||
}
|
||||
.section input{
|
||||
width:90%;
|
||||
margin:5px auto;
|
||||
border:1px solid #c3c3c3;
|
||||
height:30px;
|
||||
border-radius: 3px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
.map_container{
|
||||
position: absolute;
|
||||
top: 110px;
|
||||
bottom: 100px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.map{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
/*最下总体框架*/
|
||||
.map_text{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-outline: 10px;
|
||||
bottom: 0px;
|
||||
height: 80px;
|
||||
background: rgb(255, 255, 255);
|
||||
padding: 0 15px;
|
||||
}
|
||||
/*地图首页下方显示地址的框*/
|
||||
text{
|
||||
margin: 5px 0;
|
||||
display: block;
|
||||
font-size: 15px;
|
||||
}
|
||||
/*地图首页下方框中文字*/
|
||||
.h1{
|
||||
margin: 25px 10;
|
||||
font-size:18px;
|
||||
}
|
||||
/* 公交样式 */
|
||||
.text_box{
|
||||
margin: 0 15px;
|
||||
padding: 0px 0;
|
||||
border-bottom: 0px solid #ff0000;
|
||||
font-size: 13px;
|
||||
}
|
||||
.text_box .text_item{display:inline-block;line-height: 8px;}
|
@ -0,0 +1,54 @@
|
||||
Page({
|
||||
data:{
|
||||
nicheng:'',
|
||||
weixinhao:'',
|
||||
date:'',
|
||||
price:'',
|
||||
time:'',
|
||||
qidian:'',
|
||||
zhongdian:'',
|
||||
ask:'',
|
||||
renshu:'',
|
||||
id:''
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log('携带的数据',options.id)
|
||||
wx.cloud.database().collection("pinche").where({
|
||||
_id:options.id
|
||||
}).get({
|
||||
success:(res)=>{
|
||||
let kong=res.data[0]
|
||||
console.log(kong)
|
||||
this.setData({
|
||||
id:kong._id,
|
||||
nicheng:kong.nicheng,
|
||||
weixinhao:kong.weixinhao,
|
||||
date:kong.date,
|
||||
time:kong.time,
|
||||
qidian:kong.qidian,
|
||||
zhongdian:kong.zhongdian,
|
||||
renshu:kong.renshu,
|
||||
price:kong.price
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
fanhui(e){
|
||||
if(this.data.renshu=='0'){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'加入拼车人数已满'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
wx.navigateTo({
|
||||
url: '../shenqing/shenqing?id='+ this.data.nicheng,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "拼车详细信息",
|
||||
"navigationBarBackgroundColor": "#B6C2D6"
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
|
||||
<view>
|
||||
<view class="id">发布拼车人微信昵称:</view>
|
||||
<input bindinput="gettitle" type="text" class="title" value="{{nicheng}}" disabled="{{true}}" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="id">发布拼车人手机号:</view>
|
||||
<input bindinput="getweixin" type="text" class="title" value="{{weixinhao}}" disabled="{{true}}"placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="id">拼车总费用:</view>
|
||||
<input bindinput="getweixin" type="text" class="title" value="{{price}}" disabled="{{true}}"placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="id">出发日期:</view>
|
||||
<input bindinput="getweixin" type="text" class="title" value="{{date}}" disabled="{{true}}"placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="id">出发时间:</view>
|
||||
<input bindinput="getweixin" type="text" class="title" value="{{time}}" disabled="{{true}}"placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
|
||||
|
||||
<view>
|
||||
<view class="id">出发地点:</view>
|
||||
<input disabled="{{true}}" type="text" class="title" value="{{qidian}}" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="id">到达地点:</view>
|
||||
<input disabled="{{true}}" type="text" class="title" value="{{zhongdian}}" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="id">拼车剩余人数:</view>
|
||||
<input disabled="{{true}}" type="text" class="title" value="{{renshu}}" placeholder="请输入"/>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
|
||||
<view>对拼车人员的要求(非必填)</view>
|
||||
<view class="container">
|
||||
<textarea name="content" class="textarea" value="{{content}}" bindinput="handleTextareaInput"></textarea>
|
||||
</view>
|
||||
<view style="height:20rpx;"></view>
|
||||
<view style="height:60rpx;"></view>
|
||||
<button class="button" style="width: 40%;height: 80rpx;background-color: skyblue;" bindtap="fanhui">申请加入</button>
|
@ -0,0 +1,38 @@
|
||||
page{
|
||||
background-color:#B6C2D6;
|
||||
}
|
||||
image{
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
}
|
||||
.picker{
|
||||
border: 1px solid;
|
||||
padding:5rpx;
|
||||
margin: 5rpx;
|
||||
background-color: white;
|
||||
}
|
||||
input{
|
||||
border: 1px solid;
|
||||
padding:5rpx;
|
||||
margin: 5rpx;
|
||||
background-color: white;
|
||||
}
|
||||
.textarea{
|
||||
border: 1px solid;
|
||||
width: 99%;
|
||||
height: 100px;
|
||||
background-color: white;
|
||||
}
|
||||
.describe{
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.load{
|
||||
width: 70%;
|
||||
}
|
||||
.mini-btn{
|
||||
float: right;
|
||||
margin-top: -65rpx;
|
||||
}
|
||||
.titles{
|
||||
font-size: 40rpx;
|
||||
}
|
@ -0,0 +1,241 @@
|
||||
let db=wx.cloud.database()
|
||||
let page
|
||||
let num = 1
|
||||
let con =1
|
||||
Page({
|
||||
|
||||
data: {
|
||||
key:null,
|
||||
number:'',
|
||||
list:[],
|
||||
pages:'',
|
||||
conter:'',
|
||||
tip:0
|
||||
},
|
||||
|
||||
search(){
|
||||
console.log(this.data.key)
|
||||
let key=this.data.key
|
||||
if(this.data.key){
|
||||
console.log('可以执行搜索')
|
||||
this.getcounter()
|
||||
db.collection('pinche')
|
||||
.where({
|
||||
zhongdian:db.RegExp({
|
||||
regexp:key,
|
||||
options:'i',
|
||||
})
|
||||
}).skip(4*page).limit(4).get().then(res=>{
|
||||
console.log('请求到的数据',res)
|
||||
if(res.data.length==0){
|
||||
this.setData({
|
||||
pages:0
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
}
|
||||
num=0
|
||||
this.setData({
|
||||
list:res.data
|
||||
})
|
||||
})
|
||||
}else{
|
||||
this.onLoad();
|
||||
}
|
||||
},
|
||||
//获取文本框内容
|
||||
getkey(e){
|
||||
this.setData({
|
||||
key:e.detail.value
|
||||
})
|
||||
},
|
||||
//获取符合要求数据的条数
|
||||
getcounter(){
|
||||
db.collection('pinche')
|
||||
.where({
|
||||
zhongdian:db.RegExp({
|
||||
regexp:this.data.key,
|
||||
options:'i',
|
||||
})
|
||||
}).count().then(res=>{
|
||||
if(res.total==0){
|
||||
con =0
|
||||
}else{
|
||||
con =1
|
||||
}
|
||||
this.setData({
|
||||
conter:Math.ceil(res.total/4),
|
||||
tip:1
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
num = 1
|
||||
this.setData({
|
||||
tip:0
|
||||
})
|
||||
page = 0
|
||||
this.getnum()
|
||||
this.getList()
|
||||
this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
},
|
||||
//获取数据库中数据个数
|
||||
getnum(){
|
||||
wx.cloud.database().collection('pinche').where({
|
||||
}).count()
|
||||
.then(res=>{
|
||||
console.log(Math.ceil(res.total/4)),
|
||||
this.setData({
|
||||
number:Math.ceil(res.total/4)
|
||||
})
|
||||
if(this.data.number==0){
|
||||
this.setData({
|
||||
number:1
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取数据
|
||||
getList(){
|
||||
wx.cloud.database().collection('pinche').where({
|
||||
})
|
||||
.skip(4*page).limit(4)
|
||||
.get()
|
||||
.then(res=>{
|
||||
console.log('请求成功',res)
|
||||
this.setData({
|
||||
list:res.data
|
||||
})
|
||||
}).catch(res=>{
|
||||
console.log('请求失败',res)
|
||||
})
|
||||
},
|
||||
//下一页
|
||||
bind(){
|
||||
if(con==0){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'没有符合条件数据'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(num==0){
|
||||
if(page<this.data.conter-1){
|
||||
page++
|
||||
this.search()
|
||||
}else{
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'当前已是最后一页'
|
||||
})
|
||||
}this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
|
||||
}else{
|
||||
if(page<this.data.number-1){
|
||||
page++
|
||||
this.getList()
|
||||
}else{
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'当前已是最后一页'
|
||||
})
|
||||
}this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
}
|
||||
},
|
||||
//上一页
|
||||
binds(){
|
||||
if(con==0){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'没有符合条件数据'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(num==0){
|
||||
if(page>0){
|
||||
page--
|
||||
this.search()
|
||||
}else{
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'当前已经是第一页'
|
||||
})
|
||||
} this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
}else{
|
||||
if(page>0){
|
||||
page--
|
||||
this.getList()
|
||||
}else{
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'当前已经是第一页'
|
||||
})
|
||||
} this.setData({
|
||||
pages:page+1
|
||||
})}
|
||||
},
|
||||
//首页
|
||||
start(){
|
||||
if(con==0){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'没有符合条件数据'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(num==0){
|
||||
page=0
|
||||
this.search()
|
||||
this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
}else{
|
||||
page=0
|
||||
this.getList()
|
||||
this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
}
|
||||
},
|
||||
//尾页
|
||||
end(){
|
||||
if(con==0){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title:'没有符合条件数据'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(num==0){
|
||||
page=this.data.conter-1
|
||||
this.search()
|
||||
this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
}else{
|
||||
page=this.data.number-1
|
||||
this.getList()
|
||||
this.setData({
|
||||
pages:page+1
|
||||
})
|
||||
}
|
||||
},
|
||||
golook(e){
|
||||
wx.navigateTo({
|
||||
url: '../jialook/jialook?id='+e.currentTarget.dataset.item._id,
|
||||
})
|
||||
},
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "校园拼车加入",
|
||||
"navigationBarBackgroundColor": "#B6C2D6"
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
|
||||
<input class="serach" placeholder="请输入标题" bindinput="getkey"/>
|
||||
<button class="mini" style="background-color: skyblue;" size="mini" bindtap="search" >搜索</button>
|
||||
<view wx:for="{{list}}" wx:key="index" class="list" >
|
||||
<view class="option" bind:tap="golook" data-item="{{item}}">
|
||||
<view data-item="{{item}}" bindtap="golook">起点:{{item.qidian}}</view>
|
||||
<view style="height:30rpx;"></view>
|
||||
终点:{{item.zhongdian}}
|
||||
|
||||
</view>
|
||||
<view style="height:20rpx;"></view>
|
||||
</view>
|
||||
<view class="button-container">
|
||||
<button class="mini-btn" style="background-color: skyblue;" size="mini" bindtap="start" >首页</button>
|
||||
<button class="mini-btn" style="background-color: skyblue;" size="mini" bindtap="binds" >上一页</button>
|
||||
<block wx:if="{{tip==0}}">
|
||||
<view class="yema">{{pages}}/{{number}}</view>
|
||||
</block>
|
||||
<block wx:if="{{tip==1}}">
|
||||
<view class="yema">{{pages}}/{{conter}}</view>
|
||||
</block>
|
||||
<button class="mini-btn"style="background-color: skyblue;" size="mini" bindtap="bind" >下一页</button>
|
||||
<button class="mini-btn" style="background-color: skyblue;" size="mini" bindtap="end" >尾页</button>
|
||||
</view>
|
@ -0,0 +1,70 @@
|
||||
page{
|
||||
background-color:#B6C2D6;
|
||||
}
|
||||
.images{
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
}
|
||||
.cont{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.imge{
|
||||
height: 70rpx;
|
||||
width: 70rpx;
|
||||
}
|
||||
.list{
|
||||
border: 1px solid;
|
||||
padding: 13rpx;
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
width: 99%;
|
||||
}
|
||||
.yema{
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.mini{
|
||||
margin-right: 0rpx;
|
||||
margin-top: -65rpx;
|
||||
|
||||
}
|
||||
.button-containe {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.option{
|
||||
position: relative;
|
||||
}
|
||||
.button3{
|
||||
position:absolute;
|
||||
right: 0rpx;
|
||||
top:0rpx;
|
||||
}
|
||||
.button4{
|
||||
position:absolute;
|
||||
right: 0rpx;
|
||||
}
|
||||
.picker{
|
||||
border: 1px solid;
|
||||
padding:5rpx;
|
||||
margin: 5rpx;
|
||||
background-color: white;
|
||||
width: 85%;
|
||||
}
|
||||
.serach{
|
||||
border: 1px solid;
|
||||
height: 60rpx;
|
||||
width:85%;
|
||||
background-color: white;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
.mini{
|
||||
margin-right: 0rpx;
|
||||
margin-top: -65rpx;
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
data: {
|
||||
zhanghao:'',
|
||||
password:''
|
||||
},
|
||||
getzhanghao(e){
|
||||
//console.log('获取账号',e.detail.value)
|
||||
this.setData({
|
||||
zhanghao:e.detail.value
|
||||
})
|
||||
},
|
||||
getpassword(e){
|
||||
//console.log('获取密码',e.detail.value)
|
||||
this.setData({
|
||||
password:e.detail.value
|
||||
})
|
||||
},
|
||||
login(){
|
||||
let zhanghao=this.data.zhanghao
|
||||
let password=this.data.password
|
||||
//console.log('账号',zhanghao,'密码',password)
|
||||
wx.cloud.database().collection('admin').where({
|
||||
zhanghao:zhanghao
|
||||
}). get({
|
||||
success(res){
|
||||
if(res.data.length==0){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title: '账号不正确',
|
||||
})
|
||||
return
|
||||
}
|
||||
let admin=res.data[0]
|
||||
if(password==admin.password){
|
||||
app.globalData.token = zhanghao
|
||||
console.log('登录成功')
|
||||
wx.showToast({
|
||||
title: '登录成功',
|
||||
})
|
||||
wx.navigateTo({
|
||||
url: '../xinguan/xinguan',
|
||||
})
|
||||
}
|
||||
else{
|
||||
console.log('登录失败')
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title: '密码不正确',
|
||||
})
|
||||
}
|
||||
},
|
||||
fail(res){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title: '获取数据失败',
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
})
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "管理员登录",
|
||||
"navigationBarBackgroundColor": "#B6C2D6"
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
|
||||
<span class="zhang">
|
||||
<view class="zhanghao">账号:</view>
|
||||
<input class="input" bindinput="getzhanghao"/>
|
||||
</span>
|
||||
<span class="mi">
|
||||
<view class="mima">密码:</view>
|
||||
<input class="input" password type="text" bindinput="getpassword" />
|
||||
</span>
|
||||
<view style="height:30rpx;"></view>
|
||||
<view class='tipe'>权限:管理员</view>
|
||||
<view style="height:200rpx;"></view>
|
||||
<button bindtap="login" type="primary">登录</button>
|