|
@@ -11,7 +11,44 @@ Page({
|
|
|
active: 0,
|
|
|
list: [],
|
|
|
price: null,
|
|
|
- storeId:null
|
|
|
+ storeId: null,
|
|
|
+ show: false,
|
|
|
+ showid:null,
|
|
|
+ },
|
|
|
+ async getUserInfo(e) {
|
|
|
+ console.log(e.currentTarget.dataset.item.objectId);
|
|
|
+ let objectId = e.currentTarget.dataset.item.objectId
|
|
|
+ let newOrder = new Parse.Query('RoomOrder');
|
|
|
+ newOrder.equalTo('company', company);
|
|
|
+ newOrder.equalTo('objectId', objectId);
|
|
|
+ newOrder.notEqualTo('isDeleted', true);
|
|
|
+ let order = await newOrder.first();
|
|
|
+ console.log(order);
|
|
|
+ order.set('status',200)
|
|
|
+ try{
|
|
|
+ let saveDate = await order.save();
|
|
|
+ console.log('保存成功');
|
|
|
+ this.setData({
|
|
|
+ showid:null
|
|
|
+ })
|
|
|
+ this.getShopOrder()
|
|
|
+ }catch (error) {
|
|
|
+ console.error("保存数据时出现错误:", error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ onClose() {
|
|
|
+ this.setData({
|
|
|
+ show: false,
|
|
|
+ }); // 关闭弹窗并重置标志位
|
|
|
+ },
|
|
|
+ ONShow(e) {
|
|
|
+ const id =e.currentTarget.dataset.item.objectId
|
|
|
+ this.setData({
|
|
|
+ showid:id,
|
|
|
+ show: true,
|
|
|
+ }); // 设置弹窗显示
|
|
|
+ console.log(this.data.showid);
|
|
|
},
|
|
|
onChange(event) {
|
|
|
let active = event.detail.name
|
|
@@ -106,7 +143,7 @@ Page({
|
|
|
ShopOrder.equalTo('company', company);
|
|
|
ShopOrder.include('room');
|
|
|
ShopOrder.equalTo('shopStore', this.data.storeId);
|
|
|
-
|
|
|
+
|
|
|
if (this.data.active == 1) {
|
|
|
ShopOrder.equalTo('status', 100);
|
|
|
}
|
|
@@ -117,10 +154,11 @@ Page({
|
|
|
console.log(this.data.active);
|
|
|
ShopOrder.equalTo('status', 400);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ShopOrder.include('room');
|
|
|
+ ShopOrder.include('user');
|
|
|
ShopOrder.exists('status');
|
|
|
-
|
|
|
+
|
|
|
ShopOrder.find().then(res => {
|
|
|
let list = [];
|
|
|
res.forEach(item => {
|
|
@@ -129,12 +167,12 @@ Page({
|
|
|
activitys.Time = dateF.formatTime("mm-dd", activitys.endTime.iso);
|
|
|
activitys.a = dateF.formatTime("YYYY-mm-dd", activitys.startTime.iso); // 只保留日期部分
|
|
|
activitys.e = dateF.formatTime("YYYY-mm-dd", activitys.endTime.iso); // 只保留日期部分
|
|
|
-
|
|
|
+
|
|
|
// 计算天数,只考虑日期部分
|
|
|
activitys.day = parseInt((new Date(activitys.e).getTime() - new Date(activitys.a).getTime()) / (1000 * 60 * 60 * 24));
|
|
|
list.push(activitys);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
this.setData({
|
|
|
list
|
|
|
});
|
|
@@ -152,10 +190,12 @@ Page({
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
- onLoad: function(options) {
|
|
|
+ onLoad: function (options) {
|
|
|
let storeId = options.storeId;
|
|
|
console.log(storeId);
|
|
|
- this.setData({ storeId: storeId })
|
|
|
+ this.setData({
|
|
|
+ storeId: storeId
|
|
|
+ })
|
|
|
this.getShopOrder()
|
|
|
|
|
|
// this.getDayAll()
|
|
@@ -164,49 +204,49 @@ Page({
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
- onReady: function() {
|
|
|
+ onReady: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
- onShow: function() {
|
|
|
+ onShow: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
*/
|
|
|
- onHide: function() {
|
|
|
+ onHide: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
*/
|
|
|
- onUnload: function() {
|
|
|
+ onUnload: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
*/
|
|
|
- onPullDownRefresh: function() {
|
|
|
+ onPullDownRefresh: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
- onReachBottom: function() {
|
|
|
+ onReachBottom: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
- onShareAppMessage: function() {
|
|
|
+ onShareAppMessage: function () {
|
|
|
|
|
|
}
|
|
|
})
|