Commit 749e8459 by 严立

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

parents aa0acf14 0f38dae9
// pages/hotelAccommodation/hotelAccommodation.js const App = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -12,6 +11,9 @@ Page({ ...@@ -12,6 +11,9 @@ Page({
mobile: '', mobile: '',
num: '', num: '',
time: '', time: '',
tickerInfo: {},
isDoing: false,
isShowCancel: false
}, },
showHotline() { showHotline() {
...@@ -19,6 +21,65 @@ Page({ ...@@ -19,6 +21,65 @@ Page({
hotline: true hotline: true
}) })
}, },
//取消预约
onCancel: function (event) {
let that = this
if (this.data.isDoing) return
wx.lin.showDialog({
type: "confirm",
title: "",
content: "是否确认取消预约",
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
App.wxRequest({
url: '/api/v1/subscribe/cancelSubscribe',
data: {
'id': that.data.tickerInfo.id
},
success: (response) => {
wx.hideLoading()
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,
})
}, 2000);
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
//客服热线拨打 //客服热线拨打
call() { call() {
wx.makePhoneCall({ wx.makePhoneCall({
...@@ -39,12 +100,23 @@ Page({ ...@@ -39,12 +100,23 @@ Page({
console.log('.............', options.detail) console.log('.............', options.detail)
let detail = JSON.parse(options.detail); let detail = JSON.parse(options.detail);
console.log(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 now = Date.parse(nowStr)
console.log(yyDate, 'yyDateyyDateyyDateyyDateyyDate');
console.log(nowStr, 'nowStr');
console.log(now, 'now');
let isShowCancel = now <= yyDate
this.setData({ this.setData({
tickerInfo: detail,
type: detail.type, type: detail.type,
name: detail.name, name: detail.name,
mobile: detail.mobile, mobile: detail.mobile,
num: detail.num, num: detail.num,
time: detail.time, time: detail.time,
isShowCancel
}) })
}, },
}) })
\ No newline at end of file
...@@ -35,12 +35,16 @@ ...@@ -35,12 +35,16 @@
</view> </view>
<image src="http://sm-web.meiqicloud.com/userfiles/appResources/appointment/night/ornament-1.png" class="thanks"></image> <image src="http://sm-web.meiqicloud.com/userfiles/appResources/appointment/night/ornament-1.png" class="thanks"></image>
</view> </view>
<view class="bottom-btns"> <view class="bottom-btns" wx:if="{{isShowCancel}}">
<view class="custom" bindtap="showHotline">客服咨询</view> <view class="custom margin-right-20" bindtap="onCancel">取消预约</view>
<view class="custom" bindtap="showHotline">客服咨询</view> <view class="custom" bindtap="showHotline">客服咨询</view>
</view> </view>
<view wx:else class="custom" bindtap="showHotline">客服咨询</view>
</view> </view>
</view> </view>
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<!-- 客服热线 --> <!-- 客服热线 -->
<l-arc-popup show="{{hotline}}" arc-radius="30"> <l-arc-popup show="{{hotline}}" arc-radius="30">
......
...@@ -127,3 +127,6 @@ ...@@ -127,3 +127,6 @@
.bottom-btns { .bottom-btns {
display: flex; display: flex;
} }
.margin-right-20{
margin-right: 20rpx;
}
\ No newline at end of file
...@@ -12,9 +12,11 @@ Page({ ...@@ -12,9 +12,11 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
isFinished: false,
option: {}, option: {},
isDoing: false, isDoing: false,
pageNo: 1, pageNo: 1,
pageSize: 10,
// 导航栏相关属性 // 导航栏相关属性
navigationStyle: { navigationStyle: {
normal: { normal: {
...@@ -109,11 +111,12 @@ Page({ ...@@ -109,11 +111,12 @@ Page({
// 点击导航切换,默认是全部的 // 点击导航切换,默认是全部的
chageNav(e) { chageNav(e) {
let index = e.currentTarget.dataset.index let index = e.currentTarget.dataset.index
console.log(index, 'nav----------');
if (index === 0) { if (index === 0) {
this.setData({ this.setData({
pageNo: 1, pageNo: 1,
activityList: [] activityList: [],
isFinished: false
}) })
this.getActivity() this.getActivity()
} else { } else {
...@@ -247,15 +250,17 @@ Page({ ...@@ -247,15 +250,17 @@ Page({
}, },
// 我的活动 // 我的活动
getActivity: function () { getActivity: function () {
if (this.data.isFinished) return
let that = this let that = this
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
mask:true
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/activity/getMyActivityList', url: '/api/v1/activity/getMyActivityList',
data: { data: {
activeState: '', //""全部 0 未开始 1进行中 2已结束 activeState: '', //""全部 0 未开始 1进行中 2已结束
pageSize: '10', pageSize: this.data.pageSize,
pageNo: this.data.pageNo, pageNo: this.data.pageNo,
type: '1' type: '1'
}, },
...@@ -264,6 +269,11 @@ Page({ ...@@ -264,6 +269,11 @@ Page({
success: (res) => {}, success: (res) => {},
}) })
let funcData = res.data.list let funcData = res.data.list
if (funcData.length < that.data.pageSize) {
that.setData({
isFinished: true
})
}
let tmpArr = [] let tmpArr = []
funcData.forEach(item => { funcData.forEach(item => {
let obj = { let obj = {
...@@ -281,7 +291,7 @@ Page({ ...@@ -281,7 +291,7 @@ Page({
tmpArr.push(obj) tmpArr.push(obj)
}) })
that.setData({ that.setData({
activityList: tmpArr activityList: that.data.activityList.concat(tmpArr)
}) })
} }
}) })
...@@ -301,6 +311,7 @@ Page({ ...@@ -301,6 +311,7 @@ Page({
let that = this let that = this
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
mask:true
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/subscribe/getList', url: '/api/v1/subscribe/getList',
...@@ -336,7 +347,7 @@ Page({ ...@@ -336,7 +347,7 @@ Page({
id: item.id, id: item.id,
mobile: item.mobile, mobile: item.mobile,
name: item.name, name: item.name,
subscribeDate: item.subscribeDate
} }
tmpArr.push(obj) tmpArr.push(obj)
}) })
...@@ -355,7 +366,6 @@ Page({ ...@@ -355,7 +366,6 @@ Page({
if (this.data.active == 0) { if (this.data.active == 0) {
this.getActivity() this.getActivity()
} }
}, },
// 导航栏返回事件。 // 导航栏返回事件。
......
...@@ -225,11 +225,11 @@ ...@@ -225,11 +225,11 @@
<view class="noActive" wx:if="{{data.length === 0 && active === 1}}"> <view class="noActive" wx:if="{{data.length === 0 && active === 1}}">
<view class="noActive-title">暂无夜间入园预约</view> <view class="noActive-title">暂无夜间入园预约</view>
<view class="noActive-rule">20:00后入园需要提前预约,每日限流200人</view> <view class="noActive-rule">20:00后入园需要提前预约,每日限流200人</view>
<view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view> <view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view>
</view> </view>
<view class="noActive" wx:if="{{data.length === 0 && active === 2}}"> <view class="noActive" wx:if="{{data.length === 0 && active === 2}}">
<view class="noActive-title">暂无看房预约</view> <view class="noActive-title">暂无看房预约</view>
<view class="noActive-botton" data-index="1" bindtap="goAppoint">去预约</view> <view class="noActive-botton" data-index="2" bindtap="goAppoint">去预约</view>
</view> </view>
<!-- 主题活动数据为空 --> <!-- 主题活动数据为空 -->
<view class="noActive" wx:if="{{activityList.length === 0 && active === 0}}"> <view class="noActive" wx:if="{{activityList.length === 0 && active === 0}}">
......
...@@ -267,7 +267,7 @@ Page({ ...@@ -267,7 +267,7 @@ Page({
} }
}) })
}, },
//活动预约统计 //获取活动预约统计
getCountEnrollSubscribe() { getCountEnrollSubscribe() {
let that = this let that = this
App.wxRequest({ App.wxRequest({
...@@ -406,14 +406,14 @@ Page({ ...@@ -406,14 +406,14 @@ Page({
} }
}, },
// 我的活动 // 获取我的活动
getMyActivityList() { getMyActivityList() {
var that = this var that = this
App.wxRequest({ App.wxRequest({
url: '/api/v1/activity/getMyActivityList', url: '/api/v1/activity/getMyActivityList',
data: { data: {
activeState: '1', activeState: '1',
pageSize: 2, pageSize: -1,
pageNo: 1, pageNo: 1,
type: 1 type: 1
}, },
......
...@@ -232,7 +232,8 @@ ...@@ -232,7 +232,8 @@
<view class="order-activity-icon-wrapper col align-c" data-type='0' bindtap="goAppointment"> <view class="order-activity-icon-wrapper col align-c" data-type='0' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c"> <view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_theme.png'}}"></image> <image src="{{imageResourcesBase+'mine/home/yy_theme.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.active > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.active}}"> <view class="order-activity-badge {{ enrollSubscribeData.active > 9 ? 'badge-widen' : ''}}"
wx:if="{{enrollSubscribeData.active}}">
{{enrollSubscribeData.active}}</view> {{enrollSubscribeData.active}}</view>
</view> </view>
<text>主题活动</text> <text>主题活动</text>
...@@ -240,7 +241,8 @@ ...@@ -240,7 +241,8 @@
<view class="order-activity-icon-wrapper col align-c" data-type='1' bindtap="goAppointment"> <view class="order-activity-icon-wrapper col align-c" data-type='1' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c"> <view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_night.png'}}"></image> <image src="{{imageResourcesBase+'mine/home/yy_night.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.garden > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.garden}}"> <view class="order-activity-badge {{ enrollSubscribeData.garden > 9 ? 'badge-widen' : ''}}"
wx:if="{{enrollSubscribeData.garden}}">
{{enrollSubscribeData.garden}}</view> {{enrollSubscribeData.garden}}</view>
</view> </view>
<text>夜间入园预约</text> <text>夜间入园预约</text>
...@@ -248,7 +250,8 @@ ...@@ -248,7 +250,8 @@
<view class="order-activity-icon-wrapper col align-c" data-type='2' bindtap="goAppointment"> <view class="order-activity-icon-wrapper col align-c" data-type='2' bindtap="goAppointment">
<view class="order-activity-icon row con-c align-c"> <view class="order-activity-icon row con-c align-c">
<image src="{{imageResourcesBase+'mine/home/yy_house.png'}}"></image> <image src="{{imageResourcesBase+'mine/home/yy_house.png'}}"></image>
<view class="order-activity-badge {{ enrollSubscribeData.scanHouse > 9 ? 'badge-widen' : ''}}" wx:if="{{enrollSubscribeData.scanHouse}}"> <view class="order-activity-badge {{ enrollSubscribeData.scanHouse > 9 ? 'badge-widen' : ''}}"
wx:if="{{enrollSubscribeData.scanHouse}}">
{{enrollSubscribeData.scanHouse}}</view> {{enrollSubscribeData.scanHouse}}</view>
</view> </view>
<text>看房预约</text> <text>看房预约</text>
...@@ -257,7 +260,8 @@ ...@@ -257,7 +260,8 @@
<!-- 预约卡片 --> <!-- 预约卡片 -->
<view class="appintment"> <view class="appintment">
<!-- 主题活动 --> <!-- 主题活动 -->
<view class="appointment-wrapper" wx:for="{{activityList}}" wx:key="*this" data-item="{{item}}" bindtap="onOrderDetail"> <view class="appointment-wrapper" wx:for="{{activityList}}" wx:key="*this" data-item="{{item}}"
bindtap="onOrderDetail">
<view class="appointment-time">{{item.activeTime}}</view> <view class="appointment-time">{{item.activeTime}}</view>
<view class="appointment-activity-content row"> <view class="appointment-activity-content row">
<view class="appointment-activity-img"> <view class="appointment-activity-img">
...@@ -314,8 +318,7 @@ ...@@ -314,8 +318,7 @@
</view> --> </view> -->
</view> </view>
<!-- more --> <!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityListBackup.length>2}}">
<view class="more row align-c con-c" bindtap="onShowMoreActivity" wx:if="{{activityList.length>1}}">
<text wx:if="{{!showMoreActivity}}">展开更多</text> <text wx:if="{{!showMoreActivity}}">展开更多</text>
<text wx:else>收起</text> <text wx:else>收起</text>
<image wx:if="{{!showMoreActivity}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image> <image wx:if="{{!showMoreActivity}}" src="{{imageBase + 'icon/arrow-b-2.png'}}"></image>
......
...@@ -77,8 +77,6 @@ Page({ ...@@ -77,8 +77,6 @@ Page({
queryOrder: function () { queryOrder: function () {
// 数据全部加载完成不再执行 // 数据全部加载完成不再执行
console.log(this.data.isFinished, '-----------------------------------this.data.isFinished');
if (this.data.isFinished) return if (this.data.isFinished) return
let that = this; let that = this;
// let funcName = this.data.orderType[this.data.orderTypeActive].value // let funcName = this.data.orderType[this.data.orderTypeActive].value
...@@ -88,6 +86,7 @@ Page({ ...@@ -88,6 +86,7 @@ Page({
}) })
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
mask:true
}) })
App.wxRequest({ App.wxRequest({
url: '/api/v1/order/getOrderList', url: '/api/v1/order/getOrderList',
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<view class="info-content col con-c"> <view class="info-content col con-c">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">报名活动</text> <text class="info-content-item-label">报名活动</text>
<text class="info-content-item-title">儿童营地儿童营地儿童营地儿童营地儿童营地儿童营地</text> <text class="info-content-item-title">{{orderInfo.commodity[0].name}}</text>
</view> </view>
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">活动时间</text> <text class="info-content-item-label">活动时间</text>
...@@ -150,15 +150,15 @@ ...@@ -150,15 +150,15 @@
</view> </view>
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">活动地点</text> <text class="info-content-item-label">活动地点</text>
<text class="info-content-item-describe">儿童营地</text> <text class="info-content-item-describe">{{orderInfo.officeName}}</text>
</view> </view>
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">订单信息</text> <text class="info-content-item-label">订单信息</text>
<text class="info-content-item-tip">姓名</text> <text class="info-content-item-tip">{{orderInfo.contactName}}</text>
</view> </view>
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label"></text> <text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text> <text class="info-content-item-tip">{{orderInfo.contactPhone}}</text>
</view> </view>
<image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}"> <image wx:if="{{orderInfo.state!==2}}" class="seal-shot" src="{{resourcesBase+orderInfo.shopInfo.print}}">
</image> </image>
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<image class="seal-long" src="{{resourcesBase+orderInfo.shopInfo.printUse}}"></image> <image class="seal-long" src="{{resourcesBase+orderInfo.shopInfo.printUse}}"></image>
</view> </view>
<view class="info-code col con-c align-c"> <view class="info-code col con-c align-c">
<text>{{'张门票可用'}}</text> <text>{{orderInfo.commodity.length}}张门票可用</text>
<button bindtap="onFastScan" class="row con-c align-c">一键扫码</button> <button bindtap="onFastScan" class="row con-c align-c">一键扫码</button>
<text>{{orderInfo.expireTime}}</text> <text>{{orderInfo.expireTime}}</text>
</view> </view>
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
<text <text
wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1}}">{{'付款时间:' + (orderInfo.tipTimePay?orderInfo.tipTimePay:'')}}</text> wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1}}">{{'付款时间:' + (orderInfo.tipTimePay?orderInfo.tipTimePay:'')}}</text>
<text <text
wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1}}">{{'获得积分:' + (orderInfo.tipIntegral?orderInfo.tipIntegral:'')}}</text> wx:if="{{orderInfo.state !== 0 && orderInfo.state !== -1&&orderInfo.tipIntegral}}">{{'获得积分:' + (orderInfo.tipIntegral?orderInfo.tipIntegral:'')}}</text>
</view> </view>
</view> </view>
</view> </view>
......
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