Commit cfa619c6 by 严立

订单列表,活动列表状态重构。

parent f2931965
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<view class="member-power row cc ac" wx:if="{{winPowerInfoEnter}}"> <view class="member-power row cc ac" wx:if="{{winPowerInfoEnter}}">
<view class="member-power-info column cc ac"> <view class="member-power-info column cc ac">
<text>权限提醒</text> <text>权限提醒</text>
<text>该俱乐部为业主专享,仅面向业主。如果您是业主,可前往【我的】页面进行业主认证。</text> <text>该俱乐部为业主专享,仅面向业主。如果您是业主,可前往【我的】页面进行业主认证。</text>
<button class="row cc ac" bindtap="onCloseTip">我知道了</button> <button class="row cc ac" bindtap="onCloseTip">我知道了</button>
</view> </view>
</view> </view>
......
...@@ -13,14 +13,11 @@ Page({ ...@@ -13,14 +13,11 @@ Page({
fromPage: '', fromPage: '',
codeInfo: {}, codeInfo: {},
isFromUse: false,
winCode: false, winCode: false,
residuePayTime: "", //剩余支付时间 residuePayTime: '', //剩余支付时间
codeList: [], codeList: [],
shopAppId: "",
activityId: '', activityId: '',
shopInfo: {}, shopInfo: {},
...@@ -40,9 +37,7 @@ Page({ ...@@ -40,9 +37,7 @@ Page({
options: options, options: options,
activityId: options.activityId, activityId: options.activityId,
orderInfo: { 'id': options.id }, orderInfo: { 'id': options.id },
shopAppId: options.shopAppId,
fromPage: options.fromPage === 'order' ? 'order' : '', fromPage: options.fromPage === 'order' ? 'order' : '',
isFromUse: options.showCode === 'true' ? true : false,
}) })
this.queryOrderDetail() this.queryOrderDetail()
}, },
...@@ -90,8 +85,12 @@ Page({ ...@@ -90,8 +85,12 @@ Page({
'instructions': funcResponse.particulars, 'instructions': funcResponse.particulars,
'expireTime': funcResponse.expireTime.replace(/-/g, '.').replace('~', '-'), //订单有效期 'expireTime': funcResponse.expireTime.replace(/-/g, '.').replace('~', '-'), //订单有效期
'wxRequest': funcResponse.wxRequest, 'wxRequest': funcResponse.wxRequest,
'isRefund': Boolean(Number(funcResponse.enableRefund)) 'isRefund': Boolean(Number(funcResponse.enableRefund)),
'viewButton': [],
} }
this.setActivityDetailView(funcOrderInfo)
console.log(funcOrderInfo)
// 电影 // 电影
if (funcOrderInfo.goodsType === -2 && funcOrderInfo.expireTime) { if (funcOrderInfo.goodsType === -2 && funcOrderInfo.expireTime) {
...@@ -128,18 +127,75 @@ Page({ ...@@ -128,18 +127,75 @@ Page({
goodsList: funcGoodsList, goodsList: funcGoodsList,
}) })
this.setData({
orderInfo: funcOrderInfo,
shopInfo: funcShopInfo,
userInfo: funcUserInfo,
goodsList: funcGoodsList,
})
// 等待支付时间计时 // 等待支付时间计时
if (funcOrderInfo.state == 0) this.setPayCountdown(funcOrderInfo.submitTime) if (funcOrderInfo.state == 0) this.setPayCountdown(funcOrderInfo.submitTime)
}).catch(() => {}) }).catch(() => {})
}, },
// +----------+----------+---------+-----------+------------------+------------------+-------------------------------+
// | 状态码 | 订单状态 | 状态码 | 活动状态 |   列表按钮   |   详情按钮   |       备注        |
// +----------+----------+---------+-----------+------------------+------------------+-------------------------------+
// |  0   | 待付款  |     |      | 取消报名 去支付 | 取消报名 去支付 |                 |
// |  1   | 未发货  |     |      |          |          | 不考虑。            |
// |  2   | 待使用  |  0   | 未开始  | 申请退款 去使用 | 申请退款     | 先判断订单状态,再判断活动状态。|
// |  2   | 待使用  |  1   | 进行中  | 申请退款 去使用 | 申请退款     | 先判断订单状态,再判断活动状态。|
// |  2   | 待使用  |  2   | 已结束  |          |          | 视为已过期。          |
// |  3   | 待评价  |     |      | 去评价      | 去评价      | 无视活动状态。         |
// |  4   | 已过期  |     |      | 删除报名     | 删除报名     | 无视活动状态。         |
// |  5   | 已发货  |     |      |          |          | 不考虑。            |
// |  6   | 已评价  |     |      | 删除报名     | 删除报名     | 无视活动状态。         |
// |  7   | 退款审核 |     |      |          |          | 无视活动状态。         |
// |  8   | 退款成功 |     |      | 删除报名 再次报名| 删除报名 再次报名| 无视活动状态。         |
// |  -1   | 已取消  |     |      | 删除报名 再次报名| 删除报名 再次报名| 无视活动状态。         |
// +----------+----------+---------+-----------+------------------+------------------+-------------------------------+
setActivityDetailView: function (funcItem) {
let funcButtonTypePredefined = {
cancel: { buttonId: 1, text: '取消报名', style: 'invalid'},
pay: { buttonId: 2, text: '去支付', style: 'tip'},
refund: { buttonId: 3, text: '申请退款', style: 'invalid'},
use: { buttonId: 4, text: '去使用', style: 'tip'},
evaluate: { buttonId: 5, text: '去评价', style: 'tip'},
delete: { buttonId: 6, text: '删除报名', style: 'invalid'},
again: { buttonId: 7, text: '再次报名', style: 'tip'},
}
switch (funcItem.state) {
case 0:
funcItem.viewButton.push(funcButtonTypePredefined.cancel)
funcItem.viewButton.push(funcButtonTypePredefined.pay)
break
case 2:
if (funcItem.isRefund) funcItem.viewButton.push(funcButtonTypePredefined.refund)
break
case 3:
funcItem.viewButton.push(funcButtonTypePredefined.evaluate)
break
case 4:
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 6:
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 7:
break
case 8:
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
case -1:
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
}
},
setPayCountdown: function (funcSubmitTime) { setPayCountdown: function (funcSubmitTime) {
let doTime = 15 * 60 * 1000 let doTime = 15 * 60 * 1000
let timeInter = setInterval(() => { let timeInter = setInterval(() => {
...@@ -207,62 +263,6 @@ Page({ ...@@ -207,62 +263,6 @@ Page({
} else { } else {
wx.navigateTo({ url: '/pages/play/activity/activity' }) wx.navigateTo({ url: '/pages/play/activity/activity' })
} }
return
let funcUrl = ''
let funcGoodsType = this.data.orderInfo.goodsType
let funcShopAppId = App.getShopInfo(this.data.shopInfo.id).appId
App.setShopInfo(this.data.shopInfo.id, funcGoodsType)
switch (funcShopAppId) {
case 0:
funcUrl = '/pages/club/home/home'
break
// 海错图
case 1:
if (funcGoodsType === -1) funcUrl = '/pages/play/activity/activity'
if (funcGoodsType === 1) funcUrl = '/pages/commodity/project-detail/project-detail'
if (funcGoodsType === 3) funcUrl = '/pages/commodity/project-detail/project-detail'
break
// 星空影院
case 2:
if (funcGoodsType === -2) funcUrl = '/pages/play/movie/movie'
break
// 儿童营地
case 3:
if (funcGoodsType === 1) funcUrl = '/pages/commodity/project-detail/project-detail'
if (funcGoodsType === 2) funcUrl = '/pages/commodity/menu-food/menu-food'
if (funcGoodsType === 3) funcUrl = '/pages/commodity/project-detail/project-detail'
break
// 原野MOJITO
case 4:
if (funcGoodsType === 5) funcUrl = '/pages/commodity/menu-food/menu-food'
break
// 拾光花坊
case 5:
if (funcGoodsType === -1) funcUrl = '/pages/play/activity/activity'
if (funcGoodsType === 5) funcUrl = '/pages/commodity/menu-food/menu-food'
break
// 原味舒食
case 6:
if (funcGoodsType === 5) funcUrl = '/pages/commodity/menu-food/menu-food'
break
// 元养水韵SPA
case 7:
if (funcGoodsType === 2) funcUrl = '/pages/commodity/project-detail/project-detail'
break
}
console.log(funcUrl)
wx.navigateTo({ url: funcUrl })
}, },
// 去支付 // 去支付
onOrderPay: function (event) { onOrderPay: function (event) {
...@@ -298,7 +298,7 @@ Page({ ...@@ -298,7 +298,7 @@ Page({
}, },
// 删除订单&取消订单 // 删除订单&取消订单
// type :1删除0取消 // type :1删除0取消
onDelOrCancelOrder: function (event) { doCancel: function (event) {
let funcItem = this.data.orderInfo let funcItem = this.data.orderInfo
let type = event.currentTarget.dataset.type let type = event.currentTarget.dataset.type
......
...@@ -293,13 +293,15 @@ ...@@ -293,13 +293,15 @@
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="footer-btn row ce ac"> <view class="footer-btn row ce ac">
<!-- 状态(-1已取消,0未付款,1未发货,2待使用,3已使用,4已过期,5已发货,6已关闭/已评价) --> <block wx:for="{{orderInfo.viewButton}}" wx:for-item="itemButton" wx:for-index="indexButton" wx:key="indexButton">
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='0' wx:if="{{orderInfo.state === 0}}">取消订单</view> <button wx:if="{{itemButton.buttonId === 1}}" class="operation-invalid row cc ac" data-type="0" catchtap="doCancel">取消报名</button>
<view class="order-btn" bindtap="onOrderPay" wx:if="{{orderInfo.state===0}}">去支付</view> <button wx:if="{{itemButton.buttonId === 2}}" class="operation-tip row cc ac" catchtap="onOrderPay">去支付</button>
<view class="delete-btn" bindtap="onOrderRefund" data-type='0' wx:if="{{orderInfo.state === 2 && orderInfo.goodsType === -1 && orderInfo.isRefund}}">申请退款</view> <button wx:if="{{itemButton.buttonId === 3}}" class="operation-invalid row cc ac" catchtap="onOrderRefund">申请退款</button>
<view class="order-btn" bindtap="onOrderEvaluate" wx:if="{{orderInfo.state===3}}">去评价</view> <button wx:if="{{itemButton.buttonId === 4}}" class="operation-tip row cc ac" catchtap="onOrderUse">去使用</button>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state === -1 || orderInfo.state === 6 || orderInfo.state === 8 || orderInfo.state === 9}}">删除订单</view> <button wx:if="{{itemButton.buttonId === 5}}" class="operation-tip row cc ac" catchtap="onOrderEvaluate">去评价</button>
<view class="order-btn" wx:if="{{orderInfo.state === -1}}" bindtap="onOrderAgain">再次报名</view> <button wx:if="{{itemButton.buttonId === 6}}" class="operation-invalid row cc ac" data-type="1" catchtap="doCancel">删除报名</button>
<button wx:if="{{itemButton.buttonId === 7}}" class="operation-tip row cc ac" catchtap="onOrderAgain">再次报名</button>
</block>
</view> </view>
<!-- 二维码弹窗 --> <!-- 二维码弹窗 -->
......
...@@ -797,7 +797,7 @@ ...@@ -797,7 +797,7 @@
border-top: 1px solid #e2e7ef; border-top: 1px solid #e2e7ef;
} }
.delete-btn, .order-btn { .operation-invalid {
width: 200rpx; width: 200rpx;
line-height: 96rpx; line-height: 96rpx;
margin: 32rpx 24rpx 32rpx 0; margin: 32rpx 24rpx 32rpx 0;
...@@ -805,15 +805,21 @@ ...@@ -805,15 +805,21 @@
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
}
.delete-btn {
color: #656e7b; color: #656e7b;
background: #FFFFFF; background: #FFFFFF;
border: 1px solid #c2c7cf; border: 1px solid #c2c7cf;
} }
.order-btn { .operation-tip {
width: 200rpx;
line-height: 96rpx;
margin: 32rpx 24rpx 32rpx 0;
border-radius: 4rpx;
font-size: 30rpx;
font-weight: 600;
text-align: center;
color: #FFFFFF; color: #FFFFFF;
background: #86c5e1; background: #86c5e1;
} }
......
...@@ -2,72 +2,40 @@ let App = getApp() ...@@ -2,72 +2,40 @@ let App = getApp()
Page({ Page({
data: { data: {
active: 0,
tabItem: [
{ content: '主题活动', type: '0' },
{ content: '夜间入园预约', type: '1' },
{ content: '看房预约', type: '2' },
],
isLoading: false, isLoading: false,
option: {}, option: {},
isDoing: false, isDoing: false,
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
tabItem: [{
content: '主题活动',
type: '0'
},
{
content: '夜间入园预约',
type: '1'
},
{
content: '看房预约',
type: '2'
},
],
// 订单状态(-1已取消, 0未付款, 2待使用, 3已使用, 4已过期 6已关闭)
// 活动状态(0 未开始 1进行中 2 已结束)
activityList: [], activityList: [],
data: [], data: [],
active: 0,
}, },
onLoad: function (options) { onLoad: function (options) {
console.log('options', options) console.log(options)
switch (options.tab) { switch (options.tab) {
case 'active': case 'active': options.tab = 0; break
options.tab = 0 case 'activity': options.tab = 0; break
break case 'garden': options.tab = 1; break
case 'scanHouse': options.tab = 2; break
case 'garden':
options.tab = 1
break
case 'scanHouse':
options.tab = 2
break
} }
let type = options.tab ? 1 * options.tab : 0
this.setData({ this.setData({
option: options, option: options,
active: type active: options.tab
}) })
type === 0 ? this.queryActivityList() : this.getList(type)
},
onShow: function () { if (options.tab === 0) {
let funcIsRefresh = wx.getStorageSync('option-appointment') this.queryActivityList()
if (funcIsRefresh === 'refresh') { } else {
this.setData({ this.getList(options.tab)
pageNo: 1,
pageSize: 10,
data: [],
activityList: [],
})
let type = this.data.option.tab ? 1 * this.data.option.tab : 0
if (type === 0) {
this.queryActivityList()
} else {
this.getList(type)
}
} }
}, },
...@@ -88,7 +56,6 @@ Page({ ...@@ -88,7 +56,6 @@ Page({
}, },
queryActivityList: function () { queryActivityList: function () {
wx.setStorageSync('option-appointment', '')
App.ui.showToast({ App.ui.showToast({
'iconType': 'loading', 'iconType': 'loading',
'title': '加载中', 'title': '加载中',
...@@ -114,9 +81,9 @@ Page({ ...@@ -114,9 +81,9 @@ Page({
'orderId': funcData[i].orderId, 'orderId': funcData[i].orderId,
'enrollId': funcData[i].enrollId, 'enrollId': funcData[i].enrollId,
'name': funcData[i].name, 'name': funcData[i].name,
'status': Number(funcData[i].status), // 订单状态(-1已取消, 0未付款, 2待使用, 3已使用, 4已过期 6已关闭) 'status': Number(funcData[i].status),
'orderStatus': Number(funcData[i].orderStatus), 'orderStatus': Number(funcData[i].orderStatus),
'activeState': Number(funcData[i].activeState), // 活动状态(0 未开始 1进行中 2 已结束) 'activeState': Number(funcData[i].activeState),
'cover': funcData[i].cover, 'cover': funcData[i].cover,
'date': funcData[i].activeTime, 'date': funcData[i].activeTime,
'address': funcData[i].address, 'address': funcData[i].address,
...@@ -124,11 +91,18 @@ Page({ ...@@ -124,11 +91,18 @@ Page({
'amount': funcData[i].totalMoney ? funcData[i].totalMoney.toFixed(2) : 0, 'amount': funcData[i].totalMoney ? funcData[i].totalMoney.toFixed(2) : 0,
'wxRequest': funcData[i].wxRequest, 'wxRequest': funcData[i].wxRequest,
'belongType': Number(funcData[i].type), 'belongType': Number(funcData[i].type),
'isRefund': Boolean(Number(funcData[i].enableRefund)) 'isRefund': Boolean(Number(funcData[i].enableRefund)),
'viewStateTip': '',
'viewStateWarning': '',
'viewStateInvalid': '',
'viewButton': [],
} }
console.log(funcItem); this.setActivityItemView(funcItem)
console.log(funcItem)
if (funcItem.status === 3 && funcItem.belongType === 2) funcItem.status = 6 // 俱乐部活动没有评价,直接设置为已评价状态。
// if (funcItem.status === 3 && funcItem.belongType === 2) funcItem.status = 6
funcList.push(funcItem) funcList.push(funcItem)
} }
...@@ -141,9 +115,85 @@ Page({ ...@@ -141,9 +115,85 @@ Page({
}).catch(() => {}) }).catch(() => {})
}, },
// +----------+----------+---------+-----------+------------------+------------------+-------------------------------+
// | 状态码 | 订单状态 | 状态码 | 活动状态 |   列表按钮   |   详情按钮   |       备注        |
// +----------+----------+---------+-----------+------------------+------------------+-------------------------------+
// |  0   | 待付款  |     |      | 取消报名 去支付 | 取消报名 去支付 |                 |
// |  1   | 未发货  |     |      |          |          | 不考虑。            |
// |  2   | 待使用  |  0   | 未开始  | 申请退款 去使用 | 申请退款     | 先判断订单状态,再判断活动状态。|
// |  2   | 待使用  |  1   | 进行中  | 申请退款 去使用 | 申请退款     | 先判断订单状态,再判断活动状态。|
// |  2   | 待使用  |  2   | 已结束  |          |          | 视为已过期。          |
// |  3   | 待评价  |     |      | 去评价      | 去评价      | 无视活动状态。         |
// |  4   | 已过期  |     |      | 删除报名     | 删除报名     | 无视活动状态。         |
// |  5   | 已发货  |     |      |          |          | 不考虑。            |
// |  6   | 已评价  |     |      | 删除报名     | 删除报名     | 无视活动状态。         |
// |  7   | 退款审核 |     |      |          |          | 无视活动状态。         |
// |  8   | 退款成功 |     |      | 删除报名 再次报名| 删除报名 再次报名| 无视活动状态。         |
// |  -1   | 已取消  |     |      | 删除报名 再次报名| 删除报名 再次报名| 无视活动状态。         |
// +----------+----------+---------+-----------+------------------+------------------+-------------------------------+
setActivityItemView: function (funcItem) {
let funcButtonTypePredefined = {
cancel: { buttonId: 1, text: '取消报名', style: 'invalid'},
pay: { buttonId: 2, text: '去支付', style: 'tip'},
refund: { buttonId: 3, text: '申请退款', style: 'invalid'},
use: { buttonId: 4, text: '去使用', style: 'tip'},
evaluate: { buttonId: 5, text: '去评价', style: 'tip'},
delete: { buttonId: 6, text: '删除报名', style: 'invalid'},
again: { buttonId: 7, text: '再次报名', style: 'tip'},
}
switch (funcItem.orderStatus) {
case 0:
funcItem.viewStateWarning = '待付款'
funcItem.viewButton.push(funcButtonTypePredefined.cancel)
funcItem.viewButton.push(funcButtonTypePredefined.pay)
break
case 2:
if (funcItem.activeState === 0) funcItem.viewStateWarning = '未开始'
if (funcItem.activeState === 1) funcItem.viewStateTip = '进行中'
if (funcItem.isRefund) funcItem.viewButton.push(funcButtonTypePredefined.refund)
funcItem.viewButton.push(funcButtonTypePredefined.use)
break
case 3:
funcItem.viewStateTip = '待评价'
funcItem.viewButton.push(funcButtonTypePredefined.evaluate)
break
case 4:
funcItem.viewStateInvalid = '已过期'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 6:
funcItem.viewStateInvalid = '已评价'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 7:
funcItem.viewStateWarning = '退款审核中'
break
case 8:
funcItem.viewStateTip = '退款成功'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
case -1:
funcItem.viewStateInvalid = '已取消'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
}
},
// 去使用 // 去使用
onOrderUse: function (event) { onOrderUse: function (event) {
this.onOrderDetail(event) let funcItem = event.currentTarget.dataset.item
wx.navigateTo({
url: '/pages/mine/appointment-detail/appointment-detail?id=' + funcItem.orderId + '&activityId=' + funcItem.enrollId + '&date=' + funcItem.date + '&belongType=' + funcItem.belongType,
})
}, },
onOrderRefund: function (event) { onOrderRefund: function (event) {
...@@ -199,13 +249,6 @@ Page({ ...@@ -199,13 +249,6 @@ Page({
}) })
}, },
// 跳转详情页面
onOrderDetail: function (event) {
let funcItem = event.currentTarget.dataset.item
wx.navigateTo({
url: '/pages/mine/appointment-detail/appointment-detail?id=' + funcItem.orderId + '&activityId=' + funcItem.enrollId + '&date=' + funcItem.date + '&belongType=' + funcItem.belongType,
})
},
// 点击导航切换,默认是全部的 // 点击导航切换,默认是全部的
onSelectionTab: function (event) { onSelectionTab: function (event) {
let index = event.currentTarget.dataset.index let index = event.currentTarget.dataset.index
...@@ -328,8 +371,7 @@ Page({ ...@@ -328,8 +371,7 @@ Page({
}, },
// 预约列表/我的预约 // 预约列表/我的预约
getList: function (index) { getList: function (index) {
wx.setStorageSync('option-appointment', '') console.log('getList', index)
index = index - 1 index = index - 1
let type = '' let type = ''
switch (index) { switch (index) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="tab row cb"> <view class="tab row cb">
<block wx:for="{{tabItem}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{tabItem}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="tab-item {{index == active? 'active':''}}" data-index="{{index}}" bindtap="onSelectionTab">{{item.content}}</view> <view class="tab-item {{index === active ? 'active' : ''}}" data-index="{{index}}" bindtap="onSelectionTab">{{item.content}}</view>
</block> </block>
</view> </view>
...@@ -13,192 +13,17 @@ ...@@ -13,192 +13,17 @@
<!-- 主题活动 --> <!-- 主题活动 -->
<view class="myAppointment-body" wx:if="{{activityList.length > 0 && active === 0}}"> <view class="myAppointment-body" wx:if="{{activityList.length > 0 && active === 0}}">
<block wx:for="{{activityList}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <block wx:for="{{activityList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<!-- 待付款 --> <view class="appointment-wrapper" data-item="{{item}}" bindtap="onOrderUse">
<view class="appointment-wrapper" wx:if="{{item.status === 0}}" data-item="{{item}}" bindtap="onOrderDetail"> <view wx:if="{{funcItem.orderStatus === 4 || funcItem.orderStatus === -1}}" class="mask-cancel" data-item="{{item}}" bindtap="onOrderUse"></view>
<view class="appointment-time">{{item.date}}</view> <view wx:if="{{funcItem.orderStatus === 4 || funcItem.orderStatus === -1}}" class="appointment-time mask-cancel-time">{{item.date}}</view>
<view class="appintment-activity-status-pay"> <view wx:if="{{funcItem.orderStatus !== 4 && funcItem.orderStatus !== -1}}" class="appointment-time">{{item.date}}</view>
<text>待付款</text>
</view> <view class="row ce ac">
<view class="appointment-activity-content row ac"> <text class="appintment-activity-status-tip" wx:if="{{item.viewStateTip}}">{{item.viewStateTip}}</text>
<view class="appointment-activity-img"> <text class="appintment-activity-status-warning" wx:if="{{item.viewStateWarning}}">{{item.viewStateWarning}}</text>
<image src="{{item.cover}}"></image> <text class="appintment-activity-status-invalid" wx:if="{{item.viewStateInvalid}}">{{item.viewStateInvalid}}</text>
</view>
<view class="appointment-activity-info column ca">
<view class="appointment-activity-title">
<text>{{item.name}}</text>
</view>
<view class="appointment-activity-address">
<text>{{item.address}}</text>
</view>
</view>
<view class="appointment-activity-num">
<text>{{'共' + item.num + '人'}}</text>
</view>
</view>
<view class="appointment-activity-footer row cb ac">
<view class="appointment-activity-price">
<text>¥</text>
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<view catchtap="doCancel" data-item="{{item}}" data-type='0' class="cancel-btn">取消报名</view>
<view catchtap="onOrderPay" data-item="{{item}}" class="confirm-btn">去支付</view>
</view>
</view>
</view>
<!-- 未开始 -->
<view class="appointment-wrapper" wx:if="{{item.status === 2 && item.activeState === 0}}" data-item="{{item}}" bindtap="onOrderDetail">
<view class="appointment-time">{{item.date}}</view>
<view wx:if="{{item.orderStatus === 2}}" class="appintment-activity-status">
<text>未开始</text>
</view>
<view wx:if="{{item.orderStatus === 7}}" class="appintment-activity-status-pay">
<text>退款审核中</text>
</view>
<view wx:if="{{item.orderStatus === 8}}" class="appintment-activity-status">
<text>退款成功</text>
</view>
<view class="appointment-activity-content row ac">
<view class="appointment-activity-img">
<image src="{{item.cover}}"></image>
</view>
<view class="appointment-activity-info column ca">
<view class="appointment-activity-title">
<text>{{item.name}}</text>
</view>
<view class="appointment-activity-address">
<text>{{item.address}}</text>
</view>
</view>
<view class="appointment-activity-num">
<text>{{'共' + item.num + '人'}}</text>
</view>
</view>
<view class="appointment-activity-footer row cb ac">
<view class="appointment-activity-price">
<text>¥</text>
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<button wx:if="{{item.isRefund && item.orderStatus !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view wx:if="{{item.isRefund}}" data-item="{{item}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
<view wx:if="{{item.orderStatus === 8}}" data-item="{{item}}" data-type='1' class="cancel-btn" catchtap="doCancel">删除报名</view>
</view>
</view>
</view>
<!-- 进行中 -->
<view class="appointment-wrapper" wx:if="{{item.status === 2 && item.activeState === 1}}" data-item="{{item}}" bindtap="onOrderDetail">
<view class="appointment-time">{{item.date}}</view>
<view wx:if="{{item.orderStatus === 2}}" class="appintment-activity-status">
<text>进行中</text>
</view>
<view wx:if="{{item.orderStatus === 7}}" class="appintment-activity-status-pay">
<text>退款审核中</text>
</view>
<view wx:if="{{item.orderStatus === 8}}" class="appintment-activity-status">
<text>退款成功</text>
</view>
<view class="appointment-activity-content row ac">
<view class="appointment-activity-img">
<image src="{{item.cover}}"></image>
</view>
<view class="appointment-activity-info column ca">
<view class="appointment-activity-title">
<text>{{item.name}}</text>
</view>
<view class="appointment-activity-address">
<text>{{item.address}}</text>
</view>
</view>
<view class="appointment-activity-num">
<text>{{'共' + item.num + '人'}}</text>
</view>
</view>
<view class="appointment-activity-footer row cb ac">
<view class="appointment-activity-price">
<text>¥</text>
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<button wx:if="{{item.isRefund && item.orderStatus !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view wx:if="{{item.isRefund}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
<view wx:if="{{item.orderStatus === 8}}" data-item="{{item}}" data-type='1' class="cancel-btn" catchtap="doCancel">删除报名</view>
</view>
</view>
</view>
<!-- 待评价 -->
<view class="appointment-wrapper" wx:if="{{item.status === 3 && item.activeState !== 0}}" data-item="{{item}}" bindtap="onOrderDetail">
<view class="appointment-time">{{item.date}}</view>
<view class="appintment-activity-status">
<text>待评价</text>
</view>
<view class="appointment-activity-content row ac">
<view class="appointment-activity-img">
<image src="{{item.cover}}"></image>
</view>
<view class="appointment-activity-info column ca">
<view class="appointment-activity-title">
<text>{{item.name}}</text>
</view>
<view class="appointment-activity-address">
<text>{{item.address}}</text>
</view>
</view>
<view class="appointment-activity-num">
<text>{{'共' + item.num + '人'}}</text>
</view>
</view>
<view class="appointment-activity-footer row cb ac">
<view class="appointment-activity-price">
<text>¥</text>
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<view class="confirm-btn" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</view>
</view>
</view>
</view>
<!-- 已过期 -->
<view class="appointment-wrapper" wx:if="{{item.status === 4 || item.status === 6}}" data-item="{{item}}" bindtap="onOrderDetail">
<view wx:if="{{item.status === 4}}" class="mask-cancel"></view>
<view class="appointment-time mask-cancel-time">{{item.date}}</view>
<view class="appintment-activity-status-cancel">
<text wx:if="{{item.status === 4}}">已过期</text>
<text wx:if="{{item.status === 6}}">{{item.belongType === 2 ? '已使用' : '已评价'}}</text>
</view>
<view class="appointment-activity-content row ac">
<view class="appointment-activity-img">
<image src="{{item.cover}}"></image>
</view>
<view class="appointment-activity-info column ca">
<view class="appointment-activity-title">
<text>{{item.name}}</text>
</view>
<view class="appointment-activity-address">
<text>{{item.address}}</text>
</view>
</view>
<view class="appointment-activity-num">
<text>{{'共' + item.num + '人'}}</text>
</view>
</view>
<view class="appointment-activity-footer row cb ac">
<view class="appointment-activity-price">
<text>¥</text>
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<view data-item="{{item}}" data-type='1' class="cancel-btn" catchtap="doCancel">删除报名</view>
</view>
</view>
</view>
<!-- 已取消 -->
<view class="appointment-wrapper" wx:if="{{item.status === -1}}">
<view class="mask-cancel" data-item="{{item}}" bindtap="onOrderDetail"></view>
<view class="appointment-time mask-cancel-time">{{item.date}}</view>
<view class="appintment-activity-status-cancel">
<text>已取消</text>
</view> </view>
<view class="appointment-activity-content row ac"> <view class="appointment-activity-content row ac">
<view class="appointment-activity-img"> <view class="appointment-activity-img">
<image src="{{item.cover}}"></image> <image src="{{item.cover}}"></image>
...@@ -221,13 +46,21 @@ ...@@ -221,13 +46,21 @@
<text>{{item.amount}}</text> <text>{{item.amount}}</text>
</view> </view>
<view class="appointment-activity-btn row"> <view class="appointment-activity-btn row">
<view class="cancel-btn cancel" data-item="{{item}}" catchtap="doCancel" data-type="1">删除报名</view> <block wx:for="{{item.viewButton}}" wx:for-item="itemButton" wx:for-index="indexButton" wx:key="indexButton">
<view class="confirm-btn confirm-once" data-item="{{item}}" catchtap="onToActivityDetail">再次报名</view> <button wx:if="{{itemButton.buttonId === 1}}" class="operation-invalid row cc ac" data-item="{{item}}" data-type="0" catchtap="doCancel">取消报名</button>
<button wx:if="{{itemButton.buttonId === 2}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button wx:if="{{itemButton.buttonId === 3}}" class="operation-invalid row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<button wx:if="{{itemButton.buttonId === 4}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onOrderUse">去使用</button>
<button wx:if="{{itemButton.buttonId === 5}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button>
<button wx:if="{{itemButton.buttonId === 6}}" class="operation-invalid row cc ac" data-item="{{item}}" data-type="1" catchtap="doCancel">删除报名</button>
<button wx:if="{{itemButton.buttonId === 7}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onToActivityDetail">再次报名</button>
</block>
</view> </view>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<!-- 夜间入园预约、看房预约 --> <!-- 夜间入园预约、看房预约 -->
<view class="myAppointment-body" wx:if="{{data.length > 0 && active !== 0}}"> <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">
......
...@@ -152,22 +152,21 @@ ...@@ -152,22 +152,21 @@
border-radius: 4rpx; border-radius: 4rpx;
} }
.appintment-activity-status { .appintment-activity-status-tip {
color: #86C5E1; color: #86C5E1;
text-align: right; text-align: right;
font-size: 26; font-size: 26;
line-height: 36rpx; line-height: 36rpx;
} }
.appintment-activity-status-pay { .appintment-activity-status-warning {
color: #E66060; color: #E66060;
font-size: 26; font-size: 26;
text-align: right; text-align: right;
line-height: 36rpx; line-height: 36rpx;
} }
.appintment-activity-status-invalid {
.appintment-activity-status-cancel {
color: #C2C7CF; color: #C2C7CF;
font-size: 26; font-size: 26;
text-align: right; text-align: right;
...@@ -231,18 +230,36 @@ ...@@ -231,18 +230,36 @@
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
} }
.cancel-btn {
.operation-tip {
z-index: 4; z-index: 4;
width: 120rpx; width: 120rpx;
height: 56rpx; height: 56rpx;
color: #656E7B; margin-left: 20rpx;
border-radius: 2px;
background: #86C5E1;
line-height: 56rpx;
font-size: 22rpx; font-size: 22rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
line-height: 56rpx; color: #fff;
border-radius: 4rpx; }
.operation-invalid {
z-index: 4;
width: 120rpx;
height: 56rpx;
border-radius: 2px;
border: 1px solid #C2C7CF; border: 1px solid #C2C7CF;
line-height: 56rpx;
font-size: 22rpx;
font-weight: 600;
text-align: center;
color: #656E7B;
} }
.cancel { .cancel {
position: absolute; position: absolute;
right: 172rpx; right: 172rpx;
...@@ -260,24 +277,6 @@ ...@@ -260,24 +277,6 @@
color: #656e7b; color: #656e7b;
} }
.confirm-btn {
z-index: 4;
width: 120rpx;
height: 56rpx;
margin-left: 20rpx;
color: #fff;
font-size: 22rpx;
font-weight: 600;
text-align: center;
line-height: 56rpx;
background: #86C5E1;
border-radius: 4rpx;
}
.confirm-once {
position: absolute;
right: 32rpx;
bottom: 40rpx;
}
.mask-cancel { .mask-cancel {
position: absolute; position: absolute;
z-index: 3; z-index: 3;
......
...@@ -28,7 +28,7 @@ Page({ ...@@ -28,7 +28,7 @@ Page({
icon: './image/order-1.png', icon: './image/order-1.png',
name: '门票', name: '门票',
quantity: 0, quantity: 0,
type: '3', type: '1',
}, { }, {
icon: './image/order-2.png', icon: './image/order-2.png',
name: '餐饮', name: '餐饮',
...@@ -249,7 +249,7 @@ Page({ ...@@ -249,7 +249,7 @@ Page({
/** /**
* 查询我的订单分类统计数量 * 查询我的订单分类统计数量
* -2 - 电影,2 - SPA,3 - 门票,4 - 文创,5 - 餐饮 * -2 - 电影,1 - 门票,2 - SPA,4 - 文创,5 - 餐饮
* @function * @function
* @param * @param
* @returns * @returns
......
...@@ -57,7 +57,8 @@ Page({ ...@@ -57,7 +57,8 @@ Page({
onCatchNewEvent: function (funcEvent) { onCatchNewEvent: function (funcEvent) {
console.log('page', funcEvent) console.log('page', funcEvent)
switch (funcEvent.type) { switch (funcEvent.type) {
case 'onReload': this.onReload() case 'onReload':
this.onReload()
} }
}, },
...@@ -84,80 +85,158 @@ Page({ ...@@ -84,80 +85,158 @@ Page({
queryOrder: function () { queryOrder: function () {
// 数据全部加载完成不再执行 // 数据全部加载完成不再执行
App.request({ App.request({
url: 'v1/order/getOrderList', url: 'v1/order/getOrderList',
params: { params: {
'goodType': this.data.orderTypeActive ? this.data.orderType[this.data.orderTypeActive].value : '', 'goodType': this.data.orderTypeActive ? this.data.orderType[this.data.orderTypeActive].value : this.data.orderType[0].value,
'status': this.data.tabItem[this.data.statusActive].value, 'status': this.data.tabItem[this.data.statusActive].value,
'pageSize': 10, 'pageSize': 20,
'pageNo': this.data.orderPages, 'pageNo': this.data.orderPages,
}
})
.then((response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].orderId,
'shopId': '',
'shopAppId': '',
'shopName': funcResponse[i].officeName,
'shopLogo': '',
'total': 0,
'status': Number(funcResponse[i].status),
'amount': funcResponse[i].totalMoney,
'commodity': [],
'commodityBackup': [],
'commoditySlice3': [],
'commodityType': Number(funcResponse[i].goodType),
'wxRequest': funcResponse[i].wxRequest,
'total': funcResponse[i].smOrderDetails.length,
'isRefund': Boolean(Number(funcResponse[i].enableRefund))
} }
})
.then((response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].orderId,
'shopId': '',
'shopAppId': '',
'shopName': funcResponse[i].officeName,
'shopLogo': '',
'total': 0,
'status': Number(funcResponse[i].status),
'amount': funcResponse[i].totalMoney,
'commodity': [],
'commodityBackup': [],
'commoditySlice3': [],
'commodityType': Number(funcResponse[i].goodType),
'wxRequest': funcResponse[i].wxRequest,
'total': funcResponse[i].smOrderDetails.length,
'isRefund': Boolean(Number(funcResponse[i].enableRefund)),
'viewStateTip': '',
'viewStateWarning': '',
'viewStateInvalid': '',
'viewButton': [],
}
// 添加订单商品列表 this.setActivityItemView(funcItem)
let funcTotal = 0
let funcCommodity = funcResponse[i].smOrderDetails // 添加订单商品列表
let commodityBackup = [] let funcTotal = 0
for (let ii = 0, ll = funcCommodity.length; ii < ll; ii++) { let funcCommodity = funcResponse[i].smOrderDetails
let funcCommodityItem = { let commodityBackup = []
'cover': funcCommodity[ii].imgUrl ? funcCommodity[ii].imgUrl : this.data.resourcesBase + 'commodity/menu/commodity-item.png', for (let ii = 0, ll = funcCommodity.length; ii < ll; ii++) {
'name': funcCommodity[ii].name, let funcCommodityItem = {
'quantity': funcCommodity[ii].number, 'cover': funcCommodity[ii].imgUrl ? funcCommodity[ii].imgUrl : this.data.resourcesBase + 'commodity/menu/commodity-item.png',
'price': funcCommodity[ii].unitPrice, 'name': funcCommodity[ii].name,
'quantity': funcCommodity[ii].number,
'price': funcCommodity[ii].unitPrice,
}
funcTotal = funcTotal + funcCommodityItem.quantity
funcItem.commodity.push(funcCommodityItem)
funcItem.commodityBackup.push(funcCommodityItem)
}
// 处理大于三条数据的问题
if (funcItem.commodity.length > 3) {
funcItem.commoditySlice3 = funcItem.commodityBackup.slice(0, 3)
} }
funcTotal = funcTotal + funcCommodityItem.quantity
funcItem.commodity.push(funcCommodityItem)
funcItem.commodityBackup.push(funcCommodityItem)
}
// 处理大于三条数据的问题
if (funcItem.commodity.length > 3) {
funcItem.commoditySlice3 = funcItem.commodityBackup.slice(0, 3)
}
funcItem.total = funcTotal funcItem.total = funcTotal
// 映射门店信息 // 映射门店信息
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) { for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcItem.shopName.toLowerCase() === App.globalData.shopId[i].name.toLowerCase()) { if (funcItem.shopName.toLowerCase() === App.globalData.shopId[i].name.toLowerCase()) {
funcItem.shopId = App.globalData.shopId[i].id funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo funcItem.shopLogo = App.globalData.shopId[i].logo
break break
} else if (funcItem.shopName.toLowerCase().indexOf(App.globalData.shopId[i].name.toLowerCase()) != -1) { } else if (funcItem.shopName.toLowerCase().indexOf(App.globalData.shopId[i].name.toLowerCase()) != -1) {
// 5D星空影院 // 5D星空影院
funcItem.shopId = App.globalData.shopId[i].id funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo funcItem.shopLogo = App.globalData.shopId[i].logo
break break
}
} }
funcList.push(funcItem)
} }
funcList.push(funcItem)
}
this.setData({ console.log('funcList', funcList)
orderList: this.data.orderPages === 1 ? funcList : this.data.orderList.concat(funcList) this.setData({
orderList: this.data.orderPages === 1 ? funcList : this.data.orderList.concat(funcList)
})
}) })
}) },
// +----------+----------+------------------+------------------+-------------------------------+
// | 状态码 | 订单状态 |   列表按钮   |   详情按钮   |       备注        |
// +----------+----------+------------------+------------------+-------------------------------+
// |  0   | 待付款  | 取消订单 去支付 | 取消订单 去支付 |                 |
// |  1   | 未发货  |          |          | 不考虑。            |
// |  2   | 待使用  | 申请退款 去使用 | 申请退款     |                 |
// |  3   | 待评价  | 去评价      | 去评价      |                 |
// |  4   | 已过期  | 删除订单     | 删除订单     |                 |
// |  5   | 已发货  |          |          | 不考虑。            |
// |  6   | 已评价  | 删除订单     | 删除订单     |                 |
// |  7   | 退款审核 |          |          |                 |
// |  8   | 退款成功 | 删除订单 再次下单| 删除订单 再次下单|                 |
// |  -1   | 已取消  | 删除订单 再次下单| 删除订单 再次下单|                 |
// +----------+----------+------------------+------------------+-------------------------------+
setActivityItemView: function (funcItem) {
let funcButtonTypePredefined = {
cancel: { buttonId: 1, text: '取消订单', style: 'invalid'},
pay: { buttonId: 2, text: '去支付', style: 'tip'},
refund: { buttonId: 3, text: '申请退款', style: 'invalid'},
use: { buttonId: 4, text: '去使用', style: 'tip'},
evaluate: { buttonId: 5, text: '去评价', style: 'tip'},
delete: { buttonId: 6, text: '删除订单', style: 'invalid'},
again: { buttonId: 7, text: '再次下单', style: 'tip'},
}
switch (funcItem.status) {
case 0:
funcItem.viewStateWarning = '待付款'
funcItem.viewButton.push(funcButtonTypePredefined.cancel)
funcItem.viewButton.push(funcButtonTypePredefined.pay)
break
case 2:
funcItem.viewStateWarning = '待使用'
if (funcItem.isRefund) funcItem.viewButton.push(funcButtonTypePredefined.refund)
funcItem.viewButton.push(funcButtonTypePredefined.use)
break
case 3:
funcItem.viewStateTip = '待评价'
funcItem.viewButton.push(funcButtonTypePredefined.evaluate)
break
case 4:
funcItem.viewStateInvalid = '已过期'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 6:
funcItem.viewStateInvalid = '已评价'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 7:
funcItem.viewStateWarning = '退款审核中'
break
case 8:
funcItem.viewStateTip = '退款成功'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
case -1:
funcItem.viewStateInvalid = '已取消'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
}
}, },
/** /**
...@@ -168,65 +247,64 @@ Page({ ...@@ -168,65 +247,64 @@ Page({
*/ */
setOrderType: function () { setOrderType: function () {
App.request({ App.request({
url: 'v1/common/getDictByType', url: 'v1/common/getDictByType',
params: { params: {
'type': 'order_good_type', 'type': 'order_good_type',
}, },
})
.then((response) => {
let funcResponse = response.data
let funcList = [{
'value': '',
'name': '全部分类'
}]
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem ={
'value': funcResponse[i].value,
}
if(funcResponse[i].value==3 ){
//门票
funcItem.name = "门票"
funcList.push(funcItem)
} else if( funcResponse[i].value==5 ){
// 餐饮
funcItem.name = "餐饮"
funcList.push(funcItem)
}else if( funcResponse[i].value==-2 ){
// 影票
funcItem.name = "影票"
funcList.push(funcItem)
}else if( funcResponse[i].value==2 ){
// SPA
funcItem.name = "SPA"
funcList.push(funcItem)
}else if( funcResponse[i].value==4 ){
// 文创
funcItem.name = "文创"
funcList.push(funcItem)
}
}
let typeTitle = '全部分类' //
let orderTypeActive = 0 //
let aVal = ''
funcList.forEach((item, index) => {
if (item.value == this.data.optionsGoodType) {
typeTitle = item.name
orderTypeActive = index
}
}) })
.then((response) => {
let funcResponse = response.data
let funcList = [{
'value': '',
'name': '全部分类'
}]
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'value': funcResponse[i].value,
}
if (funcResponse[i].value == 3) {
//门票
funcItem.name = "门票"
funcList.push(funcItem)
} else if (funcResponse[i].value == 5) {
// 餐饮
funcItem.name = "餐饮"
funcList.push(funcItem)
} else if (funcResponse[i].value == -2) {
// 影票
funcItem.name = "影票"
funcList.push(funcItem)
} else if (funcResponse[i].value == 2) {
// SPA
funcItem.name = "SPA"
funcList.push(funcItem)
} else if (funcResponse[i].value == 4) {
// 文创
funcItem.name = "文创"
funcList.push(funcItem)
}
}
let typeTitle = '全部分类' //
let orderTypeActive = 0 //
funcList.forEach((item, index) => {
if (item.value == this.data.optionsGoodType) {
typeTitle = item.name
orderTypeActive = index
}
})
// if (filter.length > 0) { // if (filter.length > 0) {
// typeTitle = filter[0].name // typeTitle = filter[0].name
// orderTypeActive = 0 // orderTypeActive = 0
// } // }
this.setData({ this.setData({
'orderType': funcList, 'orderType': funcList,
'orderTypeTitle': typeTitle, 'orderTypeTitle': typeTitle,
orderTypeActive orderTypeActive
})
this.queryOrder()
}) })
this.queryOrder()
})
}, },
onOrderType: function () { onOrderType: function () {
...@@ -309,7 +387,7 @@ Page({ ...@@ -309,7 +387,7 @@ Page({
* @param * @param
* @returns * @returns
*/ */
onOrderCancel: function (event) { doCancel: function (event) {
App.ui.showDialog({ App.ui.showDialog({
type: 'confirm', type: 'confirm',
title: '是否确认取消订单', title: '是否确认取消订单',
...@@ -327,26 +405,26 @@ Page({ ...@@ -327,26 +405,26 @@ Page({
}) })
let funcItem = event.target.dataset.item let funcItem = event.target.dataset.item
App.request({ App.request({
url: 'v1/order/cancelOrder', url: 'v1/order/cancelOrder',
params: { params: {
'orderId': funcItem.id, 'orderId': funcItem.id,
'type': 0, 'type': 0,
}, },
})
.then((response) => {
App.ui.showToast({
'iconType': 'success',
'title': '取消成功'
}) })
this.setData({ .then((response) => {
'isDoing': false, App.ui.showToast({
'orderList': [], 'iconType': 'success',
'orderPages': 1, 'title': '取消成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
}) })
this.queryOrder()
})
}, },
fail: () => { }, fail: () => {},
}) })
}, },
...@@ -356,7 +434,7 @@ Page({ ...@@ -356,7 +434,7 @@ Page({
* @param * @param
* @returns * @returns
*/ */
onOrderRemove: function (event) { doCancel: function (event) {
App.ui.showDialog({ App.ui.showDialog({
type: 'confirm', type: 'confirm',
title: '是否确认删除订单?', title: '是否确认删除订单?',
...@@ -374,24 +452,24 @@ Page({ ...@@ -374,24 +452,24 @@ Page({
}) })
let funcItem = event.target.dataset.item let funcItem = event.target.dataset.item
App.request({ App.request({
url: 'v1/order/cancelOrder', url: 'v1/order/cancelOrder',
params: { params: {
'orderId': funcItem.id, 'orderId': funcItem.id,
'type': 1, 'type': 1,
}, },
})
.then((response) => {
App.ui.showToast({
'iconType': 'success',
'title': '删除成功'
}) })
this.setData({ .then((response) => {
'isDoing': false, App.ui.showToast({
'orderList': [], 'iconType': 'success',
'orderPages': 1, 'title': '删除成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
}) })
this.queryOrder()
})
}, },
fail: () => {}, fail: () => {},
}) })
...@@ -414,22 +492,22 @@ Page({ ...@@ -414,22 +492,22 @@ Page({
}) })
let funcItem = event.target.dataset.item let funcItem = event.target.dataset.item
App.request({ App.request({
url: 'v1/order/orderRefund/' + funcItem.id, url: 'v1/order/orderRefund/' + funcItem.id,
method: 'get', method: 'get',
params: {}, params: {},
})
.then((response) => {
App.ui.showToast({
'iconType': 'success',
'title': '退款申请已提交'
}) })
this.setData({ .then((response) => {
'isDoing': false, App.ui.showToast({
'orderList': [], 'iconType': 'success',
'orderPages': 1, 'title': '退款申请已提交'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
}) })
this.queryOrder()
})
}, },
fail: () => {}, fail: () => {},
}) })
...@@ -532,7 +610,9 @@ Page({ ...@@ -532,7 +610,9 @@ Page({
let funcItem = event.currentTarget.dataset.item let funcItem = event.currentTarget.dataset.item
console.log(funcItem) console.log(funcItem)
if (funcItem.commodityType === -3) { if (funcItem.commodityType === -3) {
wx.navigateTo({ url: '/pages/club/home/home' }) wx.navigateTo({
url: '/pages/club/home/home'
})
return return
} }
...@@ -546,12 +626,12 @@ Page({ ...@@ -546,12 +626,12 @@ Page({
if (funcItem.commodityType === 4) funcUrl = '/pages/commodity/menu-food/menu-food' if (funcItem.commodityType === 4) funcUrl = '/pages/commodity/menu-food/menu-food'
break break
// 星空影院 // 星空影院
case 2: case 2:
if (funcItem.commodityType === -2) funcUrl = '/pages/play/movie/movie' if (funcItem.commodityType === -2) funcUrl = '/pages/play/movie/movie'
break break
// 儿童营地 // 儿童营地
case 3: case 3:
if (funcItem.commodityType === 1) funcUrl = '/pages/commodity/project-detail/project-detail' if (funcItem.commodityType === 1) funcUrl = '/pages/commodity/project-detail/project-detail'
if (funcItem.commodityType === 2) funcUrl = '/pages/commodity/menu-food/menu-food' if (funcItem.commodityType === 2) funcUrl = '/pages/commodity/menu-food/menu-food'
...@@ -559,22 +639,22 @@ Page({ ...@@ -559,22 +639,22 @@ Page({
if (funcItem.commodityType === 4) funcUrl = '/pages/commodity/menu-food/menu-food' if (funcItem.commodityType === 4) funcUrl = '/pages/commodity/menu-food/menu-food'
break break
// 原野MOJITO // 原野MOJITO
case 4: case 4:
if (funcItem.commodityType === 5) funcUrl = '/pages/commodity/menu-food/menu-food' if (funcItem.commodityType === 5) funcUrl = '/pages/commodity/menu-food/menu-food'
break break
// 拾光花坊 // 拾光花坊
case 5: case 5:
if (funcItem.commodityType === 5) funcUrl = '/pages/commodity/menu-food/menu-food' if (funcItem.commodityType === 5) funcUrl = '/pages/commodity/menu-food/menu-food'
break break
// 原味舒食 // 原味舒食
case 6: case 6:
if (funcItem.commodityType === 5) funcUrl = '/pages/commodity/menu-food/menu-food' if (funcItem.commodityType === 5) funcUrl = '/pages/commodity/menu-food/menu-food'
break break
// 元养水韵SPA // 元养水韵SPA
case 7: case 7:
if (funcItem.commodityType === 2) funcUrl = '/pages/commodity/project-detail/project-detail' if (funcItem.commodityType === 2) funcUrl = '/pages/commodity/project-detail/project-detail'
break break
......
...@@ -57,14 +57,9 @@ ...@@ -57,14 +57,9 @@
<text>{{item.shopName}}</text> <text>{{item.shopName}}</text>
</view> </view>
<view> <view>
<text class="warning" wx:if="{{item.status === 0}}">待付款</text> <text class="warning" wx:if="{{item.viewStateTip}}">{{item.viewStateTip}}</text>
<text class="warning" wx:if="{{item.status === 2}}">待使用</text> <text class="warning" wx:if="{{item.viewStateWarning}}">{{item.viewStateWarning}}</text>
<text class="warning" wx:if="{{item.status === 3}}">待评价</text> <text class="message" wx:if="{{item.viewStateInvalid}}">{{item.viewStateInvalid}}</text>
<text class="message" wx:if="{{item.status === -1}}">已取消</text>
<text class="message" wx:if="{{item.status === 4}}">已过期</text>
<text class="message" wx:if="{{item.status === 6}}">已评价</text>
<text class="warning" wx:if="{{item.status === 7}}">退款审核中</text>
<text class="message" wx:if="{{item.status === 8}}">退款成功</text>
</view> </view>
</view> </view>
...@@ -97,13 +92,15 @@ ...@@ -97,13 +92,15 @@
<text class="amount">¥{{item.amount}}</text> <text class="amount">¥{{item.amount}}</text>
</view> </view>
<view class="row ac"> <view class="row ac">
<button wx:if="{{item.isRefund && item.status !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button> <block wx:for="{{item.viewButton}}" wx:for-item="itemButton" wx:for-index="indexButton" wx:key="indexButton">
<button wx:if="{{item.status === 0}}" class="delete row cc ac" data-index="{{index}}" data-item="{{item}}" catchtap="onOrderCancel" disabled="{{isDoing}}">取消订单</button> <button wx:if="{{itemButton.buttonId === 1}}" class="operation-invalid row cc ac" data-item="{{item}}" data-type="0" catchtap="doCancel">取消订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1 || item.status === 4 || item.status === 6 || item.status === 8}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRemove">删除订单</button> <button wx:if="{{itemButton.buttonId === 2}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 0}}" class="again row cc ac" data-item="{{item}}" catchtap="onOrderPay">去支付</button> <button wx:if="{{itemButton.buttonId === 3}}" class="operation-invalid row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 2}}" class="again row cc ac" data-item="{{item}}" catchtap="onOrderUse">去使用</button> <button wx:if="{{itemButton.buttonId === 4}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onOrderUse">去使用</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 3}}" class="again row cc ac" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button> <button wx:if="{{itemButton.buttonId === 5}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1 || item.status === 8}}" class="again row cc ac" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button> <button wx:if="{{itemButton.buttonId === 6}}" class="operation-invalid row cc ac" data-item="{{item}}" data-type="1" catchtap="doCancel">删除订单</button>
<button wx:if="{{itemButton.buttonId === 7}}" class="operation-tip row cc ac" data-item="{{item}}" catchtap="onOrderAgain">再次订单</button>
</block>
</view> </view>
</view> </view>
</view> </view>
......
/* 订单分类 */ /* 订单分类 */
.order-category { .order-category {
z-index: 3; z-index: 5;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
/* 订单类型选择 */ /* 订单类型选择 */
.order-type-selection { .order-type-selection {
z-index: 7; z-index: 6;
position: fixed; position: fixed;
top: 176rpx; top: 176rpx;
left: 0; left: 0;
...@@ -125,6 +125,11 @@ ...@@ -125,6 +125,11 @@
color: #c2c7cf; color: #c2c7cf;
} }
.order-list-item-title .tip {
font-weight: 800;
color: #86c5e1;
}
.order-list-item-title image { .order-list-item-title image {
/* display: block; /* display: block;
max-width: 100rpx; max-width: 100rpx;
...@@ -169,27 +174,33 @@ ...@@ -169,27 +174,33 @@
color: #15191f; color: #15191f;
} }
.order-list-item-operation .delete { .operation-tip {
z-index: 4;
width: 120rpx; width: 120rpx;
height: 56rpx; height: 56rpx;
border-radius: 4rpx; margin-left: 20rpx;
border: 1px solid #c2c7cf; border-radius: 2px;
background: #86C5E1;
line-height: 56rpx;
font-size: 22rpx; font-size: 22rpx;
font-weight: 500; font-weight: 600;
line-height: 32rpx; text-align: center;
color: #656e7b; color: #fff;
} }
.order-list-item-operation .again { .operation-invalid {
z-index: 4;
width: 120rpx; width: 120rpx;
height: 56rpx; height: 56rpx;
margin-left: 20rpx; border-radius: 2px;
border-radius: 4rpx; border: 1px solid #C2C7CF;
background: #86c5e1;
line-height: 56rpx;
font-size: 22rpx; font-size: 22rpx;
font-weight: 500; font-weight: 600;
line-height: 32rpx; text-align: center;
color: #fff; color: #656E7B;
} }
/* 券码 */ /* 券码 */
......
...@@ -284,7 +284,7 @@ Page({ ...@@ -284,7 +284,7 @@ Page({
iconType: 'success', iconType: 'success',
title: '评价成功', title: '评价成功',
ending: () => { ending: () => {
if (pageFrom === 'activityList' || pageFrom === 'orderList') { if (this.data.pageFrom === 'activityList' || this.data.pageFrom === 'orderList') {
wx.navigateBack({ wx.navigateBack({
event: { event: {
'type': 'onReload', 'type': 'onReload',
...@@ -292,7 +292,7 @@ Page({ ...@@ -292,7 +292,7 @@ Page({
}) })
} }
if (pageFrom == 'orderDetail') { if (this.data.pageFrom == 'orderDetail') {
wx.navigateBack({ wx.navigateBack({
delta: 2, delta: 2,
event: { event: {
......
...@@ -80,8 +80,11 @@ Page({ ...@@ -80,8 +80,11 @@ Page({
'instructions': funcResponse.particulars, 'instructions': funcResponse.particulars,
'expireTime': funcResponse.expireTime.replace(/-/g, '.').replace('~', '-'), //订单有效期 'expireTime': funcResponse.expireTime.replace(/-/g, '.').replace('~', '-'), //订单有效期
'wxRequest': funcResponse.wxRequest, 'wxRequest': funcResponse.wxRequest,
'isRefund': Boolean(Number(funcResponse.enableRefund)) 'isRefund': Boolean(Number(funcResponse.enableRefund)),
'viewButton': [],
} }
this.setActivityItemView(funcOrderInfo)
console.log(funcOrderInfo)
// 电影 // 电影
if (funcOrderInfo.goodsType === -2 && funcOrderInfo.expireTime) { if (funcOrderInfo.goodsType === -2 && funcOrderInfo.expireTime) {
...@@ -122,6 +125,75 @@ Page({ ...@@ -122,6 +125,75 @@ Page({
}) })
}, },
// +----------+----------+------------------+------------------+-------------------------------+
// | 状态码 | 订单状态 |   列表按钮   |   详情按钮   |       备注        |
// +----------+----------+------------------+------------------+-------------------------------+
// |  0   | 待付款  | 取消订单 去支付 | 取消订单 去支付 |                 |
// |  1   | 未发货  |          |          | 不考虑。            |
// |  2   | 待使用  | 申请退款 去使用 | 申请退款     |                 |
// |  3   | 待评价  | 去评价      | 去评价      |                 |
// |  4   | 已过期  | 删除订单     | 删除订单     |                 |
// |  5   | 已发货  |          |          | 不考虑。            |
// |  6   | 已评价  | 删除订单     | 删除订单     |                 |
// |  7   | 退款审核 |          |          |                 |
// |  8   | 退款成功 | 删除订单 再次下单| 删除订单 再次下单|                 |
// |  -1   | 已取消  | 删除订单 再次下单| 删除订单 再次下单|                 |
// +----------+----------+------------------+------------------+-------------------------------+
setActivityItemView: function (funcItem) {
let funcButtonTypePredefined = {
cancel: { buttonId: 1, text: '取消订单', style: 'invalid'},
pay: { buttonId: 2, text: '去支付', style: 'tip'},
refund: { buttonId: 3, text: '申请退款', style: 'invalid'},
use: { buttonId: 4, text: '去使用', style: 'tip'},
evaluate: { buttonId: 5, text: '去评价', style: 'tip'},
delete: { buttonId: 6, text: '删除订单', style: 'invalid'},
again: { buttonId: 7, text: '再次下单', style: 'tip'},
}
switch (funcItem.state) {
case 0:
funcItem.viewStateWarning = '待付款'
funcItem.viewButton.push(funcButtonTypePredefined.cancel)
funcItem.viewButton.push(funcButtonTypePredefined.pay)
break
case 2:
funcItem.viewStateTip = '待使用'
if (funcItem.isRefund) funcItem.viewButton.push(funcButtonTypePredefined.refund)
break
case 3:
funcItem.viewStateTip = '待评价'
funcItem.viewButton.push(funcButtonTypePredefined.evaluate)
break
case 4:
funcItem.viewStateInvalid = '已过期'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 6:
funcItem.viewStateInvalid = '已评价'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
break
case 7:
funcItem.viewStateWarning = '退款审核中'
break
case 8:
funcItem.viewStateTip = '退款成功'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
case -1:
funcItem.viewStateInvalid = '已取消'
funcItem.viewButton.push(funcButtonTypePredefined.delete)
funcItem.viewButton.push(funcButtonTypePredefined.again)
break
}
},
setPayCountdown: function (funcSubmitTime) { setPayCountdown: function (funcSubmitTime) {
let doTime = 15 * 60 * 1000 let doTime = 15 * 60 * 1000
let timeInter = setInterval(() => { let timeInter = setInterval(() => {
...@@ -271,7 +343,7 @@ Page({ ...@@ -271,7 +343,7 @@ Page({
// 删除订单&取消订单 // 删除订单&取消订单
// type :1删除0取消 // type :1删除0取消
onDelOrCancelOrder: function (event) { doCancel: function (event) {
let type = event.currentTarget.dataset.type let type = event.currentTarget.dataset.type
App.ui.showDialog({ App.ui.showDialog({
type: 'confirm', type: 'confirm',
......
...@@ -296,14 +296,16 @@ ...@@ -296,14 +296,16 @@
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="footer-btn row ce ac" wx:if="{{orderInfo.state !== 7}}"> <view class="footer-btn row ce ac">
<!-- 状态(-1已取消,0未付款,1未发货,2待使用,3已使用,4已过期,5已发货,6已关闭/已评价) --> <block wx:for="{{orderInfo.viewButton}}" wx:for-item="itemButton" wx:for-index="indexButton" wx:key="indexButton">
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='0' wx:if="{{orderInfo.state === 0}}">取消订单</view> <button wx:if="{{itemButton.buttonId === 1}}" class="operation-invalid row cc ac" data-type="0" catchtap="doCancel">取消订单</button>
<view class="order-btn" bindtap="onOrderPay" wx:if="{{orderInfo.state === 0}}">去支付</view> <button wx:if="{{itemButton.buttonId === 2}}" class="operation-tip row cc ac" catchtap="onOrderPay">去支付</button>
<view class="delete-btn" bindtap="onOrderRefund" wx:if="{{orderInfo.state === 2 && orderInfo.isRefund}}">申请退款</view> <button wx:if="{{itemButton.buttonId === 3}}" class="operation-invalid row cc ac" catchtap="onOrderRefund">申请退款</button>
<view class="order-btn" bindtap="onOrderEvaluate" wx:if="{{orderInfo.state === 3}}">去评价</view> <button wx:if="{{itemButton.buttonId === 4}}" class="operation-tip row cc ac" catchtap="onOrderUse">去使用</button>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state === -1 || orderInfo.state === 6 || orderInfo.state === 8 || orderInfo.state === 9}}">删除订单</view> <button wx:if="{{itemButton.buttonId === 5}}" class="operation-tip row cc ac" catchtap="onOrderEvaluate">去评价</button>
<view class="order-btn" bindtap="onOrderAgain" wx:if="{{orderInfo.state === -1 || orderInfo.state === 8}}">再次下单</view> <button wx:if="{{itemButton.buttonId === 6}}" class="operation-invalid row cc ac" data-type="1" catchtap="doCancel">删除订单</button>
<button wx:if="{{itemButton.buttonId === 7}}" class="operation-tip row cc ac" catchtap="onOrderAgain">再次下单</button>
</block>
</view> </view>
<!-- 二维码弹窗 --> <!-- 二维码弹窗 -->
......
...@@ -847,6 +847,33 @@ ...@@ -847,6 +847,33 @@
background: #86c5e1; background: #86c5e1;
} }
.operation-invalid {
width: 200rpx;
line-height: 96rpx;
margin: 32rpx 24rpx 32rpx 0;
border-radius: 4rpx;
font-size: 30rpx;
font-weight: 600;
text-align: center;
color: #656e7b;
background: #FFFFFF;
border: 1px solid #c2c7cf;
}
.operation-tip {
width: 200rpx;
line-height: 96rpx;
margin: 32rpx 24rpx 32rpx 0;
border-radius: 4rpx;
font-size: 30rpx;
font-weight: 600;
text-align: center;
color: #FFFFFF;
background: #86c5e1;
}
.logo-box { .logo-box {
width: 100rpx; width: 100rpx;
height: 80rpx; height: 80rpx;
......
...@@ -558,7 +558,7 @@ Page({ ...@@ -558,7 +558,7 @@ Page({
*/ */
onEntryComplete: function () { onEntryComplete: function () {
wx.reLaunch({ wx.reLaunch({
url: '/pages/mine/appointment/appointment?fromPage=pay' url: '/pages/mine/appointment/appointment?fromPage=pay&tab=activity'
}) })
}, },
...@@ -1181,7 +1181,7 @@ Page({ ...@@ -1181,7 +1181,7 @@ Page({
}) })
} else { } else {
wx.reLaunch({ wx.reLaunch({
url: '/pages/mine/appointment/appointment?fromPage=pay' url: '/pages/mine/appointment/appointment?fromPage=pay&tab=activity'
}) })
} }
} }
......
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