// pages/order-2/order-2.js
var buy = "";
var myDate = new Date();
var date = myDate.getDate();
var month = myDate.getMonth + 1;
var tomorrow = date + 1;
var permission = true;
var time = false;
var money = "";
var tip = "";
var address = "";
var where = "";
var name = "";
var phone = "";
var school = "";
var id = "";
var helpId = "";
var help_id = "";
const app = getApp();
var newMoney = "";
var that = this;
var doing = true;
Page({
/**
* 页面的初始数据
*/
data: {
money:"",
tip:"",
actionSheetHidden:true,
actionSheetHidden2:true,
actionSheetHidden3:true,
Overdue: false,
showTime: "",
list: {},
multiSelectorData: [
['今天', '明天'],
[],
['00']
],
buy: "",
_id: "",
finish:false,
date:"",
value2:"",
value:"",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
//初始化购买时间
let i = 0;
let j = 1;
let hours = 6;
let minutes = 10;
while (hours < 24) {
let key = "multiSelectorData[1][" + i + "]";
this.setData({
[key]: hours,
})
hours++;
i++;
}
while (minutes < 60) {
let key2 = "multiSelectorData[2][" + j + "]";
this.setData({
[key2]: minutes,
})
minutes = minutes + 10;
j++;
}
//获取数据
console.log(options);
this.setData({
_id: options._id
})
school = options.school;
id = options.id;
wx.cloud.callFunction({
name: "docGet",
data: {
school: options.school,
id: options.id
}
})
.then(res => {
console.log("调用云函数docGet成功", res.result)
helpId = res.result.data.helpId;
where = res.result.data.where;
name = res.result.data.name
phone = res.result.data.phone;
money = res.result.data.money;
tip = res.result.data.tip;
help_id = res.result.data.help_id;
console.log(res.result.finish)
this.setData({
list: res.result.data,
buy: res.result.data.buy,
money: res.result.data.money,
tip: res.result.data.tip,
toWhere: res.result.data.toWhere,
address: res.result.data.address,
where: res.result.data.where,
name: res.result.data.name,
phone: res.result.data.phone,
date:res.result.data.date,
})
if(res.result.data.finish){
this.setData({
finish:true
})
}
if(this.data._id==2||this.data._id==3){
wx.cloud.database().collection("Helpers")
.where({
_openid:helpId
})
.get()
.then(res=> {
console.log("获取电话号码成功",res)
this.setData({
helpPhone:res.data[0].phone
})
})
.catch(err=> {
console.log("获取电话号码失败",err)
})
}
if (res.result.data.date == date) {
this.setData({
showTime: "今天" + res.result.data.time
})
} else if (res.result.data.date == tomorrow) {
this.setData({
showTime: "明天" + res.result.data.time
})
} else {
this.setData({
//判断订单是否过期
Overdue: true,
showTime: "已过期"
})
}
})
.catch(err => {
console.log("调用云函数docGet失败", err)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
getBuy(e) {
buy = e.detail.value;
},
openMap(e) {
console.log(this.data.list.toWhere)
if (permission) {
wx.chooseLocation({
success: (res) => {
console.log(res);
address = res.address;
this.setData({
toWhere: res.name,
address: res.address,
})
console.log("1");
permission = true;
},
fail: (err) => {
console.log("授权失败", err);
console.log(err.errMsg)
if (err.errMsg == "chooseLocation:fail auth deny") {
permission = false;
}
}
})
} else {
wx.openSetting({
success: (res) => {
console.log(res.authSetting["scope.userLocation"])
if (res.authSetting["scope.userLocation"]) {
permission = true;
}
}
})
}
},
goShouhuodizhi() {
wx.navigateTo({
url: '/pages/shouhuodizhi/shouhuodizhi?service=' + "1",
})
},
timeChange(e) {
var one = e.detail.value[0];
var two = e.detail.value[1];
var three = e.detail.value[2];
if (this.data.multiSelectorData[0][one] == "今天") {
this.data.date = date;
} else {
if (month == 2) {
if (date == 28) {
tomorrow = 1;
}
} else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
if (date == 31) {
tomorrow = 1;
}
} else {
if (date == 30) {
tomorrow = 1;
}
}
this.data.date = tomorrow;
}
var thone = this.data.multiSelectorData[0][one];
var thtwo = this.data.multiSelectorData[1][two];
var ththree = this.data.multiSelectorData[2][three];
time = true;
this.setData({
showTime: thone + " " + thtwo + ":" + ththree,
time: thtwo + ":" + ththree,
})
},
getMoney() {
this.setData({
actionSheetHidden:!this.data.actionSheetHidden
})
},
getTip() {
this.setData({
actionSheetHidden2:!this.data.actionSheetHidden2
})
},
changeOrder() {
if (this.data.Overdue && !time) {
wx.showToast({
icon: "none",
title: '需要选择新的购买时间',
})
} else if (buy == "" && address == "" && where == this.data.where && name == this.data.name && phone == this.data.phone && !time && money == this.data.money && tip == this.data.tip) {
wx.navigateBack({
delta: 1,
})
} else {
console.log(buy);
console.log(address);
console.log(this.data.money);
console.log(this.data.tip);
if (buy != "") {
this.data.buy = buy;
}
if(this.data.money!=money||this.data.tip!=tip){
this.setData({
actionSheetHidden3:!this.data.actionSheetHidden3,
pay:Number(this.data.money)+Number(this.data.tip)
})
return
}
wx.cloud.database().collection(school)
.doc(id)
.update({
data: {
buy: this.data.buy,
money: this.data.money,
tip: this.data.tip,
toWhere: this.data.toWhere,
address: this.data.address,
where: this.data.where,
name: this.data.name,
phone: this.data.phone,
time: this.data.time,
date: this.data.date,
}
})
.then(res => {
console.log("更改成功", res);
if (this.data.Overdue) {
wx.showToast({
title: '重新发布订单成功',
})
} else {
wx.showToast({
title: '更改订单成功',
})
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于微信小程序的校园快递代取平台项目源码+全部资料(毕业设计).zip人经导师指导并认可通过的高分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。 基于微信小程序的校园快递代取平台项目源码+全部资料(毕业设计).zip人经导师指导并认可通过的高分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。 基于微信小程序的校园快递代取平台项目源码+全部资料(毕业设计).zip人经导师指导并认可通过的高分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。 基于微信小程序的校园快递代取平台项目源码+全部资料(毕业设计).zip人经导师指导并认可通过的高分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。 基于微信小程序的校园快递代取平台项目源码+全部资料(毕业设计).zip人经导师指导并认可通过的高分毕业设计项目,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者。 基于微信小程序的校园快递代取平台项目源码+全部资料(毕业设计).zip人经导师指
资源推荐
资源详情
资源评论
收起资源包目录
基于微信小程序的校园快递代取平台项目源码+全部资料(毕业设计).zip (136个子文件)
.gitignore 145B
banner06.jpg 264KB
banner02.jpg 244KB
banner05.jpg 213KB
banner07.jpg 140KB
banner04.jpg 108KB
banner03.jpg 101KB
banner01.jpg 38KB
logo.jpg 8KB
Sever03.jpg 7KB
Sever01.jpg 5KB
chooseSchool.jpg 5KB
sever02.jpg 4KB
shou.jpg 2KB
mysever02.jpg 2KB
buy.jpg 2KB
xiaofei.jpg 2KB
time.jpg 2KB
money.jpg 2KB
change.jpg 2KB
order-2.js 14KB
order-1.js 13KB
order.js 11KB
service02.js 8KB
mine.js 5KB
service01.js 5KB
addshouhuodizhi.js 5KB
index.js 4KB
service03-2.js 3KB
service03-1.js 3KB
info.js 3KB
mysever02.js 3KB
shouhuodizhi.js 2KB
register.js 2KB
mysever06.js 2KB
app.js 1KB
service03.js 1KB
login.js 1KB
mysever05.js 851B
mysever01.js 851B
util.js 460B
index.js 363B
index.js 305B
index.js 293B
index.js 289B
index.js 286B
index.js 273B
index.js 228B
index.js 224B
index.js 169B
project.private.config.json 3KB
project.config.json 2KB
app.json 1KB
package.json 268B
package.json 259B
package.json 258B
package.json 256B
package.json 256B
package.json 256B
package.json 256B
package.json 253B
package.json 253B
sitemap.json 191B
order.json 71B
service03.json 58B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
mine.json 36B
shouhuodizhi.json 29B
addshouhuodizhi.json 27B
service03-1.json 27B
index.json 27B
service03-2.json 27B
service02.json 27B
order-2.json 27B
mysever02.json 27B
info.json 27B
mysever06.json 27B
register.json 27B
service01.json 27B
mysever05.json 27B
order-1.json 27B
login.json 27B
mysever01.json 27B
mysever05.png 2KB
mysever03.png 2KB
mysever06.png 1KB
mysever01.png 1KB
mysever04.png 1KB
order.wxml 8KB
order-2.wxml 4KB
order-1.wxml 4KB
mysever01.wxml 3KB
共 136 条
- 1
- 2
资源评论
- m0_620222322024-04-10怎么能有这么好的资源!只能用感激涕零来形容TAT...
程序员张小妍
- 粉丝: 1w+
- 资源: 3027
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240522_084328_com.tencent.mm.jpg
- 附件计算机专业课选课说明-1.xlsx
- 基于TypeScript的ahousepet-admin-web管理系统设计源码
- 《广东开放大学学习指引》期末考核要求0522.zip
- mkl-2021.1.1-py2.py3-none-macosx-10-15-x86-64.whl
- mkl-2018.0.3-py2.py3-none-manylinux1-x86-64.whl
- halcon实现两幅图像相减
- mkl-2021.3.0-py2.py3-none-manylinux1-x86-64.whl
- IAR9.3主题配置,包含字体颜色等
- 才从简来.apk
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功