import event from '../../utils/event'
import api from '../../utils/api'
import { formatTime } from '../../utils/util'
Page({
data:{
teacher: {
avatar: '../../images/teacher.png',
name: '选择老师'
},
address: '定位中,请稍后...',
date: formatTime(new Date(), 1),
time: formatTime(new Date(), 2)
},
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:', e.detail)
},
formReset: function() {
console.log('form发生了reset事件')
},
bindViewSpeak: function() {
wx.navigateTo({
url: '../speak/speak'
})
},
chooseTime() {
wx.navigateTo({
url: './chooseTime/chooseTime'
})
},
chooseAddress() {
wx.navigateTo({
url: './chooseAddress/chooseAddress'
})
},
chooseTeacher() {
wx.navigateTo({
url: '../teachers/teachers'
})
},
submit() {
wx.showModal({
title: '提示',
content: '恭喜你,预约成功!',
showCancel: false,
success: function(res) {
if (res.confirm) {
console.log('提交预约数据')
wx.navigateBack(getCurrentPages())
}
}
})
},
onLoad( options ) {
console.log(options)
if(options.teacherId){
api.get('vendor/didizuoye/teacher', {id: options.teacherId}, (data) => {
this.setData({
teacher: {
avatar: data.avatar,
name: data.name
}
})
})
}
event.on('address', (address) => {
this.setData({
address: address
})
})
event.on('orderDate', (date) => {
console.log(date)
this.setData({
date: date
})
})
event.on('orderTime', (time) => {
console.log(time)
this.setData({
time: time
})
})
wx.getLocation({
type: 'wgs84',
success: (res) => {
api.get('engine/map/geocoder', {
latitude: res.latitude,
longitude: res.longitude
}, (data)=>{
console.log(data)
this.setData({
address: data.result.address
})
})
}
})
}
})
微信小程序开发-滴滴作业案例源码.zip
版权申诉
59 浏览量
2021-11-21
16:44:44
上传
评论
收藏 1.6MB ZIP 举报
小小姑娘很大
- 粉丝: 4077
- 资源: 2319
最新资源
- Music-Player +PlayerActivity+ rockplayer+ SeeJoPlayer 播放器JAVA源码
- vscode-1.46.0.tar源码文件
- 最近很火植物大战僵尸杂交版2.08苹果+安卓+PC+防闪退工具V2+修改工具+高清工具+通关存档整合包更新
- 超级好用的截图工具PixPin,可录制Gif图
- Screenshot_2024-05-21-17-06-42-64_2332cb9b27b851b548ba47a91682926c.jpg
- 毕业设计参考 - 基于树莓派、OpenCV及Python的人脸识别
- node-v18.20.2-linux-arm64
- 222222222222
- 16张相机标定图片,可复现本文畸变矫正
- dbeaver-ce-23.3.1-x86_64-setup.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈