main
小米便签 1 week ago
parent 1a7782b27d
commit 1c567bbf54

@ -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,19 @@
// app.js
App({
onLaunch: function () {
if (!wx.cloud) {
console.error('请使用 2.2.3 或以上的基础库以使用云能力');
} else {
wx.cloud.init({
// env 参数说明:
// env 参数决定接下来小程序发起的云开发调用wx.cloud.xxx会默认请求到哪个云环境的资源
// 此处请填入环境 ID, 环境 ID 可打开云控制台查看
// 如不填则使用默认环境(第一个创建的环境)
env: 'cloud1-3gvvw1ak18d30298',
traceUser: true,
});
}
this.globalData = {};
}
});

@ -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,14 @@
<!--miniprogram/components/cloudTipModal/index.wxml-->
<!-- wx:if="{{showUploadTip}}" -->
<view class="install_tip" wx:if="{{showUploadTip}}">
<view class="install_tip_back"></view>
<view class="install_tip_detail">
<view class="install_tip_detail_title">云开发环境未找到</view>
<view class="install_tip_detail_tip">请点击上方「云开发」按钮,开通云开发环境后重试。</view>
<view class="install_tip_detail_tip">如果已经开通云开发请检查环境ID与 `miniprogram/app.js` 中的 `env` 参数是否一致。</view>
<view class="install_tip_detail_buttons">
<view bindtap="onCheckEnv" class="install_tip_detail_button install_tip_detail_button_primary">重新检测</view>
<view bindtap="onCheckEnvCancel" class="install_tip_detail_button">取消</view>
</view>
</view>
</view>

@ -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
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

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;

File diff suppressed because one or more lines are too long

@ -0,0 +1,5 @@
const config = {
key : 'c7088e9a24fc49390d873183a92bbad5'
}
module.exports.Config = config;

@ -0,0 +1,159 @@
const db=wx.cloud.database()
Page({
data: {
nicheng:'',
weixinhao:'',
date:'',
time:'',
renshu:'',
qidian:'',
price:'',
zhongdian:'',
ask:''
},
gettitle(e){
this.setData({
nicheng:e.detail.value
})
},
getweixin(e){
this.setData({
weixinhao:e.detail.value
})
},
getnum(e){
this.setData({
renshu:e.detail.value
})
},
getqi(e){
this.setData({
qidian:e.detail.value
})
},
getzhong(e){
this.setData({
zhongdian:e.detail.value
})
},
getprice(e){
this.setData({
price:e.detail.value
})
},
handleTextareaInput: function(e) {
this.setData({
ask:e.detail.value
});
},
bindTimeChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.setData({
time: e.detail.value,
})
},
bindDateChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.setData({
date: e.detail.value,
})
},
onLoad(options) {
},
submit(res){
let nicheng = this.data.nicheng
let weixinhao = this.data.weixinhao
let renshu = this.data.renshu
let qidian = this.data.qidian
let zhongdian = this.data.zhongdian
let ask = this.data.ask
let price =this.data.price
if(this.data.nicheng==''){
wx.showToast({
icon:'none',
title:'请填写微信昵称'
})
return
}
if(this.data.weixinhao==''){
wx.showToast({
icon:'none',
title:'请填写手机号'
})
return
}
if(this.data.price==''){
wx.showToast({
icon:'none',
title:'请填写总费用'
})
return
}
if(this.data.date==''){
wx.showToast({
icon:'none',
title:'请选择出发日期'
})
return
}
if(this.data.time==''){
wx.showToast({
icon:'none',
title:'请选择出发时间'
})
return
}
if(this.data.renshu==''){
wx.showToast({
icon:'none',
title:'请填写拼车人数'
})
return
}
if(this.data.qidian==''){
wx.showToast({
icon:'none',
title:'请填写出发地点'
})
return
}
if(this.data.zhongdian==''){
wx.showToast({
icon:'none',
title:'请填写到达终点'
})
return
}
db.collection("pinche").add({
data:{
nicheng:nicheng,
weixinhao:weixinhao,
price:price,
renshu:renshu,
qidian:qidian,
zhongdian:zhongdian,
date:this.data.date,
time:this.data.time,
ask:ask
}
}).then(res=>{
console.log(res)
wx.showToast({
title:'提交成功',
})
// wx.navigateTo({
// url: '../fenye/fenye',
// })
})
}
,
})

@ -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,306 @@
var amapFile = require('../../libs/amap-wx.130.js');
var gaode_key = require('../../libs/config');
var markersData = [];
Page({
data: {
markers: [],
latitude: '',
longitude: '',
city: '',
city_e: '', // 目的地
latitude_e: '', // 目的地x
longitude_e: '', // 目的地y
textData: {},
gaode_type: 'car',
polyline: [],
includePoints: [],
transits: [], // 公交车信息
mapEndObj: {}, // 目的地信息
taxi_cost: '', // 出租车价格
multi_cost:'', // 多人拼车价格
bigger_cost:'', // 大型车
distance: '',
daohang: false,
mapState: true
},
makertap: function (e) {
var id = e.markerId;
var that = this;
that.showMarkerInfo(markersData, id);
that.changeMarkerColor(markersData, id);
},
onLoad: function () {
this.getPoiData() // 获取当前位置或指定位置周边
},
// 切换方式
changeGaodeType(event) {
console.log('切换方式,绘制路线', event.detail);
this.setData({
gaode_type: event.detail.gaode_type,
mapState: false
})
if (!this.data.longitude_e) {
return
}
// 绘制路线
this.getRoute(this.data.mapEndObj, 'end')
},
handleCustomEvent: function (event) {
console.log('接收到组件传递的数据:', event.detail);
const data = event.detail
this.setData({
mapEndObj: data.info
})
this.getRoute(data.info, data.inputType)
},
// 路线搜索 默认驾车
getRoute: function (info, type) {
var that = this;
console.log('搜索目的地及路线', info, type)
if (type === 'start') {
const markersData = [{
iconPath: "../../img/marker_checked.png",
id: 0,
latitude: info.location.split(',')[1],
longitude: info.location.split(',')[0],
width: 23,
height: 33,
name: info.name,
address: info.district
}]
that.setData({
city: info.name,
daohang: false,
city_e: '',
latitude: info.location.split(',')[1],
longitude: info.location.split(',')[0],
city: info.name,
polyline: [],
markers: markersData,
includePoints: [{
latitude: info.location.split(',')[1],
longitude: info.location.split(',')[0]
}]
});
that.showMarkerInfo(markersData, 0);
return
} else {
that.setData({
daohang: true,
city_e: info.name,
latitude_e: info.location.split(',')[1],
longitude_e: info.location.split(',')[0],
city_e: info.name
});
}
var key = gaode_key.Config.key;
var myAmapFun = new amapFile.AMapWX({
key: key
});
const gaodeParams = {
origin: `${this.data.longitude},${this.data.latitude}`,
destination: `${this.data.longitude_e},${this.data.latitude_e}`,
success: function (data) {
console.log('路线', data)
var points = [];
if (data.paths && data.paths[0] && data.paths[0].steps) {
var steps = data.paths[0].steps;
for (var i = 0; i < steps.length; i++) {
var poLen = steps[i].polyline.split(';');
for (var j = 0; j < poLen.length; j++) {
points.push({
longitude: parseFloat(poLen[j].split(',')[0]),
latitude: parseFloat(poLen[j].split(',')[1])
})
}
}
}
const markersData = [{
iconPath: "../../img/mapicon_navi_s.png",
id: 0,
latitude: that.data.latitude,
longitude: that.data.longitude,
width: 23,
height: 33
}, {
iconPath: "../../img/mapicon_navi_e.png",
id: 1,
latitude: that.data.latitude_e,
longitude: that.data.longitude_e,
width: 24,
height: 34
}]
that.setData({
polyline: [{
points: points,
color: "#0091ff",
width: 6
}],
markers: markersData,
includePoints: [{
latitude: that.data.latitude,
longitude: that.data.longitude
}, {
latitude: that.data.latitude_e,
longitude: that.data.longitude_e
}],
mapState: true
});
that.showMarkerInfo(markersData, 1);
if (that.data.gaode_type === 'car') {
if(data.paths[0] && data.paths[0].distance){
that.setData({
distance: (parseInt(data.paths[0].distance) / 1000).toFixed(2) + '千米' // 保留两位小数
});
}
if(data.taxi_cost){
that.setData({
taxi_cost: '出租车约' + parseInt(data.taxi_cost)*1.25.toFixed(2) + '元适宜乘坐1~4人',
multi_cost: '拼车约' + parseInt(data.taxi_cost)*0.85.toFixed(2) + '元适宜乘坐1~4人',
bigger_cost: '商务车约' + parseInt(data.taxi_cost)*2.25.toFixed(2) + '元适宜乘坐5~8人',
});
}
} else if (that.data.gaode_type === 'riding') {
if(data.paths[0] && data.paths[0].distance){
that.setData({
distance: (parseInt(data.paths[0].distance) / 1000).toFixed(2) + '千米'
});
}
if(data.taxi_cost){
that.setData({
taxi_cost: '打车约' + parseInt(data.taxi_cost)*1.3.toFixed(2) + '元适宜乘坐1~4人'
});
}
} else if (that.data.gaode_type === 'walk') {
if(data.paths[0] && data.paths[0].distance){
that.setData({
distance: (parseInt(data.paths[0].distance) / 1000).toFixed(2) + '千米' // 保留两位小数
});
}
if(data.paths[0] && data.paths[0].duration){
that.setData({
cost: parseInt(data.paths[0].duration/60) + '分钟'
});
}
} else if (that.data.gaode_type === 'bus') {
console.log('公交', data)
}
},
fail: function(info){
console.log('出现问题', info)
}
}
if (this.data.gaode_type === 'car') {
// 驾车
myAmapFun.getDrivingRoute(gaodeParams)
} else if (this.data.gaode_type === 'walk') {
// 步行
myAmapFun.getWalkingRoute(gaodeParams)
} else if (this.data.gaode_type === 'bus') {
// 公交
myAmapFun.getTransitRoute({
origin: `${this.data.longitude},${this.data.latitude}`,
destination: `${this.data.longitude_e},${this.data.latitude_e}`,
city: '广州',
success: function(data){
console.log('公交信息', data.transits)
if(data && data.transits){
var transits = data.transits;
for(var i = 0; i < transits.length; i++){
var segments = transits[i].segments;
transits[i].transport = [];
for(var j = 0; j < segments.length; j++){
if(segments[j].bus && segments[j].bus.buslines && segments[j].bus.buslines[0] && segments[j].bus.buslines[0].name){
var name = segments[j].bus.buslines[0].name
if(j!==0){
name = '--' + name;
}
transits[i].transport.push(name);
}
}
}
}
that.setData({
transits: transits,
mapState: true
});
},
fail: function(info){
wx.showModal({
title: info
})
console.log('出现问题', info)
}
})
} else if (this.data.gaode_type === 'riding') {
// 骑行
myAmapFun.getRidingRoute(gaodeParams)
}
},
// 地点搜索 如果搜索目的地搜索导航
getPoiData: function (keywords, searchType) {
var that = this;
let params = {
iconPathSelected: '../../img/marker_checked.png', //如:..­/..­/img/marker_checked.png
iconPath: '../../img/marker.png', //如:..­/..­/img/marker.png
success: function (data) {
console.log('当前位置', data)
markersData = data.markers;
// 搜索当前位置 附近poi
console.log('搜索当前位置,清除目的地信息')
that.setData({
markers: markersData,
latitude: markersData[0].latitude,
longitude: markersData[0].longitude,
city: markersData[0].name,
});
that.showMarkerInfo(markersData, 0);
},
fail: function (info) {
wx.showModal({
title: info.errMsg
})
}
}
if (keywords) {
params.querykeywords = keywords;
}
var myAmapFun = new amapFile.AMapWX({
key: gaode_key.Config.key
});
myAmapFun.getPoiAround(params)
},
showMarkerInfo: function (data, i) {
var that = this;
that.setData({
textData: {
name: data[i].name,
desc: data[i].address
}
});
},
changeMarkerColor: function (data, i) {
var that = this;
var markers = [];
for (var j = 0; j < data.length; j++) {
if (j == i) {
data[j].iconPath = "../../img/marker_checked.png"; //如:..­/..­/img/marker_checked.png
} else {
data[j].iconPath = "../../img/marker.png"; //如:..­/..­/img/marker.png
}
markers.push(data[j]);
}
that.setData({
markers: markers
});
}
})

@ -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>

@ -0,0 +1,39 @@
.input{
background-color: white;
width: 70%;
height: 70rpx;
float: left;
border: black 1px solid;
padding-left: 10rpx;
}
.zhanghao{
font-size: 50rpx;
}
.mima{
font-size: 50rpx;
}
image{
width: 100%;
height: 400rpx;
}
page{
background-color:#B6C2D6;
}
.zhang{
display: flex;
margin: 20rpx;
margin-top: 80rpx;
margin-left: 50rpx;
}
.mi{
display: flex;
margin: 20rpx;
margin-top: 30rpx;
margin-left: 50rpx;
}
.tipe{
font-size: 40rpx;
margin-left: 50rpx;
}

@ -0,0 +1,52 @@
let db=wx.cloud.database()
let nikname
Page({
data: {
userInfo: '',
nicheng:'',
},
onLoad() {
let user = wx.getStorageSync('user')
console.log('进入小程序index页面获取缓存', user)
this.setData({
userInfo: user
})
},
//授权登录
login (){
wx.getUserProfile({
desc: '必须点击授权才可以继续使用',
success: res => {
let user = res.userInfo
//把用户信息缓存到本地
wx.setStorageSync('user', user)
console.log('用户信息', res.userInfo)
nikname = res.userInfo.nickName
this.ge();
this.setData({
userInfo: user,
nicheng:nikname
})
},
fail: res => {
console.log('授权失败', res)
}
})
},
//退出登录
loginOut (){
this.setData ({
userInfo: ''
})
wx.setStorageSync('user', null)
},
ge(){
wx.redirectTo({
url: '../home/home',
})
}
})

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTextStyle": "black",
"navigationBarTitleText": "校园拼车登录",
"navigationBarBackgroundColor": "#B6C2D6"
}

@ -0,0 +1,8 @@
<image src="/pages/picture/2.png">背景图片</image>
<button wx:if="{{!userInfo}}" bindtap="login" class="login-button"> 授权登录 </button>
<view wx:else class="root">
<image class="touxiang" src="{{userInfo.avatarUrl}}"></image>
<text class="nicheng"> {{userInfo.nickName}} </text>
<button bind:tap="loginOut" class="out"> 退出登录 </button>
</view>

@ -0,0 +1,52 @@
.login-button {
position: absolute; /* 使用绝对定位 */
top: 50%; /* 垂直居中 */
left: 50%; /* 水平居中 */
transform: translate(-50%, 175%); /* 通过平移使其真正居中 */
background-color: rgb(0, 255, 0); /* 设置按钮背景为蓝色 */
color: rgb(0, 0, 0); /* 设置按钮文字颜色为白色,以确保文字可读性 */
width: 60px; /* 设置按钮宽度 */
height: 60px; /* 设置按钮高度 */
border-radius: 30px; /* 使按钮变为圆形 */
border: 2px solid rgba(128, 128, 128, 1.5); /* 添加白色边框 */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7); /* 添加阴影效果 */
display: flex; /* 使用 Flexbox 进行内容对齐 */
align-items: center; /* 垂直居中对齐 */
justify-content: center; /* 水平居中对齐 */
font-size: 20px; /* 设置字体大小 */
cursor: hand; /* 鼠标悬停时显示为手型 */
}
image{
width: 100%;
height: 600rpx;
}
.login-button:hover {
background-color: rgb(0, 255, 0); /* 悬停时改变背景颜色 */
}
page{
background-color:#B6C2D6;
}
.root {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.touxiang {
width: 200rpx;
height: 200rpx;
border-radius: 50% ;
margin-top: 30rpx;
margin-bottom: 10rpx;
}
.out{
position: relative;
text-indent: -1;
background-color: red;
color:white
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,233 @@
let db=wx.cloud.database()
let page
let num = 1
let con =1
Page({
data: {
key:null,
number:'',
list:[],
pages:'',
conter:'',
tip:0,
},
onLoad(options) {
wx.getStorage({
key: 'user', // 替换为缓存中的key
success: res=> {
console.log(res.data.nickName); // 输出获取到的数据
wx.cloud.database().collection('qingdan').where({
nikname:res.data.nickName
})
.skip(4*page).limit(4)
.get()
.then(res=>{
console.log('请求成功',res)
this.setData({
list:res.data
})
}).catch(res=>{
console.log('请求失败',res)
})
wx.cloud.database().collection('qingdan').where({
nikname:res.data.nickName
}).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
})
}
})
},
})
num = 1
this.setData({
tip:0
})
page = 0
this.setData({
pages:page+1
})
},
//获取数据库中数据个数
getnum(){
},
//获取数据
getList(){
wx.getStorage({
key: 'user', // 替换为缓存中的key
success: res=> {
console.log(res.data.nickName); // 输出获取到的数据
wx.cloud.database().collection('qingdan').where({
nikname:res.data.nickName
})
.skip(4*page).limit(4)
.get()
.then(res=>{
console.log('请求成功',res)
this.setData({
list:res.data
})
}).catch(res=>{
console.log('请求失败',res)
})
wx.cloud.database().collection('qingdan').where({
nikname:res.data.nickName
}).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
})
}
})
},
})
},
//下一页
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: '../yonghu/yonghu?id='+e.currentTarget.dataset.item._id,
})
},
})

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTextStyle": "black",
"navigationBarTitleText": "校园拼车申请管理",
"navigationBarBackgroundColor": "#B6C2D6"
}

@ -0,0 +1,22 @@
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
<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.nicheng}}</view>
<view style="height:30rpx;"></view>
性别:{{item.sex}}
</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,196 @@
const db=wx.cloud.database()
Page({
/**
* 页面的初始数据
*/
data: {
nicheng:'',
nikname:'',
weixinhao:'',
sno:'',
array: ['请选择', '男', '女'],
arr: ['请选择', '航空工程学院', '空中交通管理学院', '交通工程学院', '法学院', '中欧航空工程师学院', '安全科学与工程学院', '经济管理学院', '马克思主义学院', '外国语学院', '理学院', '电子信息与自动化学院', '计算机科学与技术学院', '职业技术学院'],
objectArray: [
{
id: 0,
name: '请选择'
},
{
id: 1,
name: '男'
},
{
id: 2,
name: '女'
},
{
id: 3,
name: '航空工程学院'
},
{
id: 4,
name: '中欧航空工程师学院'
},
{
id: 5,
name: '空中交通管理学院'
},
{
id: 6,
name: '法学院'
},
{
id: 7,
name: '交通工程学院'
},
{
id: 8,
name: '安全科学与工程学院'
},
{
id: 9,
name: '经济管理学院'
},
{
id: 10,
name: '马克思主义学院'
},
{
id: 11,
name: '外国语学院'
},
{
id: 12,
name: '理学院'
},
{
id: 13,
name: '电子信息与自动化学院'
},
{
id: 14,
name: '计算机科学与技术学院'
},
{
id: 15,
name: '职业技术学院'
},
],
index: 0,
ind:0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options.id) {
console.log('接收到的 ID:', options.id);
}
this.setData({
nikname:options.id
})
},
bindPickerChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.setData({
index: e.detail.value,
})
},
bindPicker: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.setData({
ind: e.detail.value,
})
},
gettitle(e){
this.setData({
nicheng:e.detail.value
})
},
getweixin(e){
this.setData({
weixinhao:e.detail.value
})
},
getsno(e){
this.setData({
sno:e.detail.value
})
},
submit(res){
let nicheng = this.data.nicheng
let weixinhao = this.data.weixinhao
let nikname = this.data.nikname
let sex =this.data.array[this.data.index]
let xueyuan =this.data.arr[this.data.ind]
let sno =this.data.sno
if(this.data.nicheng==''){
wx.showToast({
icon:'none',
title:'请填写微信昵称'
})
return
}
if(this.data.weixinhao==''){
wx.showToast({
icon:'none',
title:'请填写手机号'
})
return
}
if(this.data.weixinhao==''){
wx.showToast({
icon:'none',
title:'请填写手机号'
})
return
}
if(sex=='请选择'){
wx.showToast({
icon:'none',
title:'请选择性别'
})
return
}
if(sno==''){
wx.showToast({
icon:'none',
title:'请输入学号'
})
return
}
if(xueyuan=='请选择'){
wx.showToast({
icon:'none',
title:'请选择学院'
})
return
}
db.collection("qingdan").
add({
data:{
nicheng:nicheng,
weixinhao:weixinhao,
sex:sex,
xueyuan:xueyuan,
sno:sno,
nikname:nikname,
station:'请选择',
qing:0
}
}).then(res=>{
console.log(res)
wx.showToast({
title:'提交成功',
})
// wx.navigateTo({
// url: '../fenye/fenye',
// })
})
}
,
})

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTextStyle": "black",
"navigationBarTitleText": "校园拼车申请",
"navigationBarBackgroundColor": "#B6C2D6"
}

@ -0,0 +1,34 @@
<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>
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker">
{{array[index]}}
</view>
</picker>
<view style="height:20rpx;"></view>
<view>
<view class="id">学号:</view>
<input bindinput="getsno" type="text" class="title" placeholder="请输入"/>
<view style="height:20rpx;"></view>
</view>
<view>学院:</view>
<picker bindchange="bindPicker" value="{{ind}}" range="{{arr}}">
<view class="picker">
{{arr[ind]}}
</view>
</picker>
<view style="height:20rpx;"></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,233 @@
let db=wx.cloud.database()
let page
let num = 1
let con =1
Page({
data: {
key:null,
number:'',
list:[],
pages:'',
conter:'',
tip:0,
},
onLoad(options) {
wx.getStorage({
key: 'user', // 替换为缓存中的key
success: res=> {
console.log(res.data.nickName); // 输出获取到的数据
wx.cloud.database().collection('qingdan').where({
nicheng:res.data.nickName
})
.skip(4*page).limit(4)
.get()
.then(res=>{
console.log('请求成功',res)
this.setData({
list:res.data
})
}).catch(res=>{
console.log('请求失败',res)
})
wx.cloud.database().collection('qingdan').where({
nikname:res.data.nickName
}).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
})
}
})
},
})
num = 1
this.setData({
tip:0
})
page = 0
this.setData({
pages:page+1
})
},
//获取数据库中数据个数
getnum(){
},
//获取数据
getList(){
wx.getStorage({
key: 'user', // 替换为缓存中的key
success: res=> {
console.log(res.data.nickName); // 输出获取到的数据
wx.cloud.database().collection('qingdan').where({
nikname:res.data.nickName
})
.skip(4*page).limit(4)
.get()
.then(res=>{
console.log('请求成功',res)
this.setData({
list:res.data
})
}).catch(res=>{
console.log('请求失败',res)
})
wx.cloud.database().collection('qingdan').where({
nikname:res.data.nickName
}).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
})
}
})
},
})
},
//下一页
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: '../wolook/wolook?id='+e.currentTarget.dataset.item._id,
})
},
})

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTextStyle": "black",
"navigationBarTitleText": "我的拼车申请",
"navigationBarBackgroundColor": "#B6C2D6"
}

@ -0,0 +1,22 @@
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
<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.nikname}}</view>
<view style="height:30rpx;"></view>
申请情况:{{item.station}}
</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,56 @@
let num
Page({
data:{
nicheng:'',
weixinhao:'',
sex:'',
xueyuan:'',
sno:'',
station:'',
qing:'',
renshu:'',
date:''
},
onLoad(options) {
console.log('携带的数据',options.id)
wx.cloud.database().collection("qingdan").where({
_id:options.id
}).get({
success:(res)=>{
let kong=res.data[0]
console.log(kong)
this.setData({
id1:kong._id,
nicheng:kong.nikname,
station:kong.station,
})
wx.cloud.database().collection('pinche').where({
nicheng:this.data.nicheng
}).get({
success:(res)=>{
let pin=res.data[0]
console.log(pin)
this.setData({
id2:pin._id,
weixinhao:pin.weixinhao,
date:pin.date,
sno:pin.qidian,
xueyuan:pin.zhongdian
})
}
})
}
})
},
submit(){
wx.navigateBack({
delta: 1
})
},
})

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTextStyle": "black",
"navigationBarTitleText": "我的拼车申请详情",
"navigationBarBackgroundColor": "#B6C2D6"
}

@ -0,0 +1,40 @@
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
<view>
<view class="id">发布拼车人微信昵称:</view>
<input type="text" class="title" value="{{nicheng}}" disabled="{{true}}"/>
<view style="height:20rpx;"></view>
</view>
<view>
<view class="id">发布拼车人手机号:</view>
<input disabled="{{true}}" type="text" class="title" value="{{weixinhao}}"/>
<view style="height:20rpx;"></view>
</view>
<view>
<view class="id">出发时间:</view>
<input disabled="{{true}}" type="text" class="title" value="{{date}}"/>
<view style="height:20rpx;"></view>
</view>
<view>
<view class="id">出发地点:</view>
<input disabled="{{true}}" type="text" class="title" value="{{sno}}"/>
<view style="height:20rpx;"></view>
</view>
<view>
<view class="id">终点:</view>
<input disabled="{{true}}" type="text" class="title" value="{{xueyuan}}"/>
<view style="height:20rpx;"></view>
</view>
<view style="height:20rpx;"></view>
<view>
<view class="id">申请情况:</view>
<input disabled="{{true}}" type="text" class="title" value="{{station}}"/>
<view style="height:20rpx;"></view>
</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,243 @@
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('pingjia')
.where({
nicheng: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('pingjia')
.where({
nicheng: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('pingjia').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('pingjia').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: '../xinlook/xinlook?id='+e.currentTarget.dataset.item._id,
})
},
})

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTextStyle": "black",
"navigationBarTitleText": "信誉积分管理",
"navigationBarBackgroundColor": "#B6C2D6"
}

@ -0,0 +1,25 @@
<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" bind:tap="golook">
<view class="option" bind:tap="golook" data-item="{{item}}">
<view style="height:30rpx;"></view>
<view data-item="{{item}}" bindtap="golook">用户昵称:{{item.nicheng}}</view>
<view style="height:30rpx;"></view>
</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,55 @@
Page({
data:{
nicheng:'',
ask:'',
src:'',
station:'',
id:'',
score:100,
sc:100
},
getscore(e){
this.setData({
score:e.detail.value
})
},
onLoad(options) {
console.log('携带的数据',options.id)
wx.cloud.database().collection("pingjia").where({
_id:options.id
}).get({
success:(res)=>{
let kong=res.data[0]
console.log(kong)
this.setData({
id:kong._id,
nicheng:kong.nicheng,
ask:kong.ask,
sc:kong.score
})
if(this.data.sc==''){
this.setData({
sc:100
})
}
}
})
},
fanhui(){
wx.cloud.database().collection("pingjia").where({
_id:this.data.id
}).update({
data:{
score:this.data.score
}
}).then(res=>{
console.log(res)
wx.showToast({
title:'更改成功',
})
})
}
})

@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTextStyle": "black",
"navigationBarTitleText": "评价详细信息",
"navigationBarBackgroundColor": "#B6C2D6"
}

@ -0,0 +1,19 @@
<image src="https://636c-cloud1-3gvvw1ak18d30298-1324895773.tcb.qcloud.la/1.png?sign=390079e22fca5988b1539945f44d5395&t=1730684201">背景图片</image>
<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="container">
<textarea name="content" disabled="{{true}}" class="textarea" value="{{ask}}" bindinput="handleTextareaInput"></textarea>
</view>
<view class="id">被投诉对象信誉积分:</view>
<input type="text" class="title" value="{{sc}}" disabled="{{true}}"/>
<view class="id">更改被投诉对象信誉积分:</view>
<input bindinput="getscore" type="text" class="title" />
<view style="height:20rpx;"></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;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save