12345678910111213141516171819202122232425262728293031323334353637 |
- const {
- globalData: {
- util: {
- regeneratorRuntime,
- api: {
- reservationDetail,
- reservationCancel
- },
- navigateBack,
- showTip,
- request: {
- get
- },
- }
- }
- } = getApp()
- Page({
- async onLoad({
- id
- }) {
- this.setData({
- item: await get(reservationDetail, { id }, { loading: true, loadingMsg: '信息加载中' }),
- id
- })
- },
- async cancelReservation({ currentTarget: { dataset: { id } } }) {
- let { _err } = await get(reservationCancel, { id })
- if (_err) return _err.status && showTip('取消失败')
- navigateBack()
- showTip('取消成功')
- },
- navigateBack
- })
|