Commit 323a7ed7 by wjw

Merge branch 'master' of http://120.77.182.185/yanl/mini-shimao.git into master

parents 131a5ce2 d20b2e7f
......@@ -22,12 +22,17 @@ Page({
// 预约入园剩余名额
total: 0,
optionsTab:'',
frompage:''
},
onLoad: function (options) {
this.setData({
frompage: options.frompage,
optionsTab:options.tab
})
this.setReset()
},
setReset: function () {
let funcDate = App.modular.miment(new Date().getTime()).format('YYYY-MM-DD')
let endDate = this.getNextDay(funcDate, 3)
......@@ -222,20 +227,28 @@ Page({
this.setData({
appointmentComplete: false,
})
wx.navigateBack({
delta: 1
})
if (this.data.frompage=='appointment') {
wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab='+this.data.optionsTab,
})
} else {
wx.navigateBack({
delta: 1,
})
}
},
getNextDay(d, t) {
console.log(d, t)//格式为---2019-02-13 3
console.log(d, t) //格式为---2019-02-13 3
d = new Date(d);
console.log(d)//格式为---Wed Feb 13 2019 08:00:00 GMT+0800 (中国标准时间)
console.log(d) //格式为---Wed Feb 13 2019 08:00:00 GMT+0800 (中国标准时间)
d = +d + (1000 * 60 * 60 * 24) * t;
console.log(d)//格式为--时间戳1550275200000
console.log(d) //格式为--时间戳1550275200000
d = new Date(d);
console.log(d)//格式为---Sat Feb 16 2019 08:00:00 GMT+0800 (中国标准时间)
return App.modular.miment(new Date(d)).format("YYYY-MM-DD") //格式为"2019-02-16 00:00:00"
console.log(d) //格式为---Sat Feb 16 2019 08:00:00 GMT+0800 (中国标准时间)
return App.modular.miment(new Date(d)).format("YYYY-MM-DD") //格式为"2019-02-16 00:00:00"
},
})
\ No newline at end of file
......@@ -23,17 +23,20 @@ Page({
// 预约入园剩余名额
total: 0,
frompage: '',
optionsTab: ''
},
onLoad: function (options) {
this.setData({
frompage: options.frompage,
optionsTab: options.tab
})
this.setReset()
},
setReset: function () {
let funcDate = App.modular.miment().format('YYYY-MM-DD')
console.log(funcDate)
let endDate = this.getNextDay(funcDate, 3)
this.setData({
formName: '',
......@@ -43,11 +46,6 @@ Page({
appointmentDate: funcDate,
appointmentEndDate: endDate,
})
console.log(this.data.formDate)
console.log(this.data.appointmentDate)
console.log(this.data.appointmentEndDate)
this.queryQuota()
},
......@@ -239,10 +237,20 @@ Page({
type: 0,
},
success: (res) => {
this.setData({
appointmentComplete: true,
})
wx.lin.hideToast()
if (res.data && res.data.code == 500) {
wx.lin.showToast({
image: '/image/error.png',
title: res.data.msg,
})
} else {
this.setData({
appointmentComplete: true,
})
wx.lin.hideToast()
}
},
fail: (err) => {
wx.lin.showToast({
......@@ -257,9 +265,16 @@ Page({
this.setData({
appointmentComplete: false,
})
wx.navigateBack({
delta: 1
})
if (this.data.frompage == 'appointment') {
wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab=' + this.data.optionsTab,
})
} else {
wx.navigateBack({
delta: 1,
})
}
},
// 预约入园查询返回剩余名额
......@@ -282,14 +297,14 @@ Page({
},
getNextDay(d, t) {
console.log(d, t)//格式为---2019-02-13 3
console.log(d, t) //格式为---2019-02-13 3
d = new Date(d);
console.log(d)//格式为---Wed Feb 13 2019 08:00:00 GMT+0800 (中国标准时间)
console.log(d) //格式为---Wed Feb 13 2019 08:00:00 GMT+0800 (中国标准时间)
d = +d + (1000 * 60 * 60 * 24) * t;
console.log(d)//格式为--时间戳1550275200000
console.log(d) //格式为--时间戳1550275200000
d = new Date(d);
console.log(d)//格式为---Sat Feb 16 2019 08:00:00 GMT+0800 (中国标准时间)
return App.modular.miment(new Date(d)).format("YYYY-MM-DD") //格式为"2019-02-16 00:00:00"
console.log(d) //格式为---Sat Feb 16 2019 08:00:00 GMT+0800 (中国标准时间)
return App.modular.miment(new Date(d)).format("YYYY-MM-DD") //格式为"2019-02-16 00:00:00"
},
})
\ No newline at end of file
......@@ -51,25 +51,39 @@ Page({
that.setData({
isDoing: false
})
wx.lin.showToast({
image: '/image/success.png',
title: '取消成功',
})
setTimeout(() => {
let type = that.data.type
let tabType = 2
if (type == 0) {
//返回夜间入园预约列表
tabType = 1
} else {
// 返回看房预约
tabType = 2
}
wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab=' + tabType,
if (response.data&&response.data.code == 500) {
wx.lin.showToast({
image: '/image/error.png',
title: response.data.msg,
})
} else {
wx.lin.showToast({
image: '/image/success.png',
title: '取消成功',
})
setTimeout(() => {
let type = that.data.type
let tabType = 2
if (type == 0) {
//返回夜间入园预约列表
tabType = 1
} else {
// 返回看房预约
tabType = 2
}
wx.redirectTo({
url: '/pages/mine/appointment/appointment?tab=' + tabType,
})
}, 2000);
}
}, 2000);
}
})
} else if (res.cancel) {
......@@ -97,15 +111,13 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('.............', options.detail)
let detail = JSON.parse(options.detail);
console.log(detail);
let yyDate = detail.subscribeDate ? Date.parse(detail.subscribeDate.replace(/-/, '/')) : 0
let nowStr=new Date().toLocaleString().substr(0,10)+" 00:00:00"
let nowStr = new Date().toLocaleString().substr(0, 10) + " 00:00:00"
let now = Date.parse(nowStr)
console.log(yyDate, 'yyDateyyDateyyDateyyDateyyDate');
console.log(nowStr, 'nowStr');
console.log(now, 'now');
let isShowCancel = now <= yyDate
this.setData({
......
......@@ -12,6 +12,7 @@ Page({
* 页面的初始数据
*/
data: {
isLoading: false,
isFinished: false,
option: {},
isDoing: false,
......@@ -84,6 +85,7 @@ Page({
} else {
this.getList(type)
}
},
// 去使用
onOrderUse: function (event) {
......@@ -137,14 +139,14 @@ Page({
// 数据校验不通过
let that = this
console.log( );
console.log();
let funcItem = event.currentTarget.dataset.item
console.log( funcItem,'jjjj' );
console.log(funcItem, 'jjjj');
let wxRequest = funcItem.wxRequest
// 待支付返回的wx支付参数
if (wxRequest) {
......@@ -182,9 +184,10 @@ Page({
url = '/pages/play/activity/activity'
} else if (type == 1) {
// 夜间入园预约
url = '/pages/home/night-appointment/night-appointment'
url = '/pages/home/night-appointment/night-appointment?frompage=appointment&tab=1'
} else if (type == 2) {
url = "/pages/commodity/room-appointment/room-appointment"
// 房产预约
url = "/pages/commodity/room-appointment/room-appointment?frompage=appointment&tab=2"
}
wx.navigateTo({
url: url
......@@ -261,7 +264,10 @@ Page({
let that = this
wx.showLoading({
title: '加载中',
mask:true
mask: true
})
this.setData({
isLoading: true
})
App.wxRequest({
url: '/api/v1/activity/getMyActivityList',
......@@ -272,6 +278,9 @@ Page({
type: '1'
},
success: function (res) {
that.setData({
isLoading: false
})
wx.hideLoading({
success: (res) => {},
})
......@@ -294,12 +303,13 @@ Page({
address: item.address,
num: item.number,
amount: item.totalMoney.toFixed(2),
wxRequest:item.wxRequest
wxRequest: item.wxRequest
}
tmpArr.push(obj)
})
that.setData({
activityList: that.data.activityList.concat(tmpArr)
activityList: that.data.activityList.concat(tmpArr),
isLoading: false
})
}
})
......@@ -319,15 +329,19 @@ Page({
let that = this
wx.showLoading({
title: '加载中',
mask:true
mask: true
})
this.setData({
isLoading: true
})
App.wxRequest({
url: '/api/v1/subscribe/getList',
data: {
state: '',
state: 1, //未过期 1,其他 空字符""
type: type //0 入园预约 1 看房预约 全部 空字符
},
success: function (res) {
wx.hideLoading({
success: (res) => {},
})
......@@ -360,7 +374,8 @@ Page({
tmpArr.push(obj)
})
that.setData({
data: tmpArr
data: tmpArr,
isLoading: false
})
}
})
......
......@@ -215,28 +215,29 @@
</view>
<!-- 夜间入园预约、看房预约 -->
<view class="myAppointment-body" wx:if="{{data.length > 0 && active !== 0}}">
<view class="myAppointment-item" wx:for="{{data}}" wx:key="index" data-item="{{item}}" bindtap="gohotelAccommodation">
<view class="myAppointment-item" wx:for="{{data}}" wx:key="index" data-item="{{item}}"
bindtap="gohotelAccommodation">
<image src="{{item.url}}" class="item-img"></image>
<view class="item-content">
<view class="item-title {{item.type == 0 ?'item-num-1' : ''}}">{{item.title}}</view>
<view class="item-time {{item.type == 1 ?'item-time-1' : ''}}">预约时间 {{item.time}}</view>
<view wx:if="{{item.type == 0}}" class="item-num">预约人数 {{item.num}}人</view>
</view>
<view class="button" >预约凭证</view>
<view class="button">预约凭证</view>
</view>
</view>
</view>
<view class="noActive" wx:if="{{data.length === 0 && active === 1}}">
<view class="noActive" wx:if="{{data.length === 0 && active === 1&&!isLoading}}">
<view class="noActive-title">暂无夜间入园预约</view>
<view class="noActive-rule">20:00后入园需要提前预约,每日限流200人</view>
<view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view>
</view>
<view class="noActive" wx:if="{{data.length === 0 && active === 2}}">
<view class="noActive" wx:if="{{data.length === 0 && active === 2&&!isLoading}}">
<view class="noActive-title">暂无看房预约</view>
<view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view>
</view>
<!-- 主题活动数据为空 -->
<view class="noActive" wx:if="{{activityList.length === 0 && active === 0}}">
<view class="noActive" wx:if="{{activityList.length === 0 && active === 0&&!isLoading}}">
<view class="noActive-title">暂无活动预约</view>
<view class="noActive-botton" data-index="0" bindtap="goAppoint">去预约</view>
</view>
......
......@@ -185,7 +185,7 @@ Page({
let list = res.data.map(item => {
let shopFilter = that.data.shopConfig.filter(k => {
return k.name.toLowerCase() == item.officeName.toLowerCase()
return k.name.toLowerCase() == item.officeName.toLowerCase() || item.officeName.toLowerCase().indexOf(k.name.toLowerCase()) != -1
})
item.logo = shopFilter.length > 0 ? shopFilter[0].logo : ''
if (item.smOrderDetails.length > 3) {
......@@ -412,10 +412,11 @@ Page({
App.wxRequest({
url: '/api/v1/activity/getMyActivityList',
data: {
activeState: '1',
enrollState:2,//待使用
activeState: '1',//""全部 0 未开始 1进行中 2已结束
pageSize: -1,
pageNo: 1,
type: 1
type: 1 ,//0 影片 1 活动
},
success: function (res) {
let list = res.data.list
......
......@@ -67,7 +67,7 @@ Page({
})
wx.showLoading({
title: '加载中',
mask:true
mask: true
})
App.wxRequest({
url: '/api/v1/order/getOrderList',
......@@ -134,6 +134,12 @@ Page({
funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo
break
} else if (funcItem.shopName.toLowerCase().indexOf(App.globalData.shopId[i].name.toLowerCase()) != -1) {
// 5D星空影院
funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo
break
}
}
funcList.push(funcItem)
......
......@@ -205,30 +205,43 @@ Page({
* @returns
*/
eventImageAdd: function (event) {
console.log(event.detail, '新增------')
let that = this
let imgUrl = event.detail.all[0].url
let imgUrls = []
imgUrls.push(imgUrl)
this.setData({
imgUrls
})
wx.uploadFile({
url: App.globalData.baseUrl + '/api/v1/common/upload',
filePath: imgUrl,
name: 'file',
header: {
'Content-Type': 'multipart/form-data',
'token': App.globalData.token
},
success: function (res) {
let data = typeof (res.data) == 'string' ? JSON.parse(res.data) : res.data
that.data.fileResults.push(data.data.fileUrl)
// let imgUrl = event.detail.all[0].url
console.log(event, '8989');
}
let imgUrls = event.detail.all
let urlArr = []
imgUrls.forEach(item => {
urlArr.push(item.url)
})
// imgUrls.push(imgUrl)
// this.setData({
// imgUrls
// })
for (let i = 0; i < urlArr.length; i++) {
wx.showLoading({
title: '上传中',
mask: true
})
wx.uploadFile({
url: App.globalData.baseUrl + '/api/v1/common/upload',
filePath: urlArr[i],
name: 'file',
header: {
'Content-Type': 'multipart/form-data',
'token': App.globalData.token
},
success: function (res) {
wx.hideLoading({
success: (res) => {},
})
console.log(res, '9999');
let data = typeof (res.data) == 'string' ? JSON.parse(res.data) : res.data
that.data.fileResults.push(data.data.fileUrl[0])
}
})
}
},
/**
* 移除评价图片
......
......@@ -80,9 +80,8 @@
<view class="order-comment">
<l-textarea cursor-spacing="100" placeholder="您的评价与建议,会让园区做的更好" placeholder-style="color: #C2C7CF" maxlength="200"
l-class="l-textarea" border="{{false}}" bind:linconfirm="eventInputDone" />
<view class="order-picker">
<l-image-picker l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed"
<l-image-picker size-type="compressed" preview="{{true}}" l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed"
custom="{{true}}" bind:linchange="eventImageAdd" bind:linremove="eventImageRemove"
bind:linpreview="eventImagePreview">
<view class="col con-c align-c">
......
......@@ -211,7 +211,7 @@ Page({
'commodity': [],
'tipOrderNo': funcResponse.orderSerialNumber, // 订单编号
'tipTimeSubmit': funcResponse.createDate,
'tipTimePay': App.modular.miment(funcResponse.paymentTime).format('YYYY-MM-DD hh:mm:ss'),
'tipTimePay': funcResponse.paymentTime ? App.modular.miment(funcResponse.paymentTime).format('YYYY-MM-DD hh:mm:ss') : '',
'tipIntegral': funcResponse.integral,
'officeName': funcResponse.officeName,
'wxRequest': funcResponse.wxRequest,
......@@ -223,11 +223,11 @@ Page({
let shopName = funcResponse.officeName;
let shopFilter = this.data.shopConfig.filter(
item => {
return item.name.toLowerCase() == shopName.toLowerCase()
return item.name.toLowerCase() == shopName.toLowerCase() || shopName.toLowerCase().indexOf(item.name.toLowerCase()) != -1
}
)
funcOrderInfo.shopInfo = shopFilter[0]
console.log(shopFilter[0], '-----------shopFilter[0]------');
// 添加订单商品列表
let funcCommodity = funcResponse.smOrderDetails
for (let i = 0, l = funcCommodity.length; i < l; i++) {
......
......@@ -24,10 +24,9 @@
<text>订单已过期</text>
</view>
<view class="state-content-tip row">
<text>有效期xxx-xxx</text>
<text>有效期 {{orderInfo.expireTime}}</text>
</view>
</view>
<view class="state-content state-content-invalid col con-c" wx:if="{{orderInfo.state === -1}}">
<view class="state-content-title row">
<text>订单已取消</text>
......@@ -36,7 +35,6 @@
<text>下单后15分钟内未付款,自动取消订单</text>
</view> -->
</view>
<view class="state-content state-content-invalid col con-c" wx:if="{{orderInfo.state === 6}}">
<view class="state-content-title row">
<text>订单已评价</text>
......@@ -185,7 +183,7 @@
<view class="info-content col con-c">
<view class="info-content-item row">
<text class="info-content-item-label">电影</text>
<text class="info-content-item-title">儿童营地</text>
<text class="info-content-item-title">{{}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label">场次</text>
......@@ -193,11 +191,11 @@
</view>
<view class="info-content-item row">
<text class="info-content-item-label">订单信息</text>
<text class="info-content-item-tip">姓名</text>
<text class="info-content-item-tip">{{rderInfo.contactName}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text>
<text class="info-content-item-tip">{{rderInfo.contactPhone}}</text>
</view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}">
</image>
......@@ -236,7 +234,6 @@
<view class="logo-box">
<image src="{{resourcesBase + orderInfo.shopInfo.logo}}" mode="aspectFit"></image>
</view>
<text>{{orderInfo.officeName}}</text>
</view>
<block wx:for="{{orderInfo.commodity}}" wx:for-index="index" wx:for-item="item" wx:key="index">
......@@ -284,6 +281,7 @@
wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1&&orderInfo.tipIntegral}}">{{'获得积分:' + (orderInfo.tipIntegral?orderInfo.tipIntegral:'')}}</text>
</view>
</view>
</view>
<!-- 多张 扫码弹窗 -->
......@@ -347,6 +345,7 @@
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="footer-btn row con-e" wx:if="{{orderInfo.state !== 2}}">
<!-- 状态(-1已取消,0未付款,1未发货,2待使用,3已使用,4已过期,5已发货,6已关闭/已评价) -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment