Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6674fe67
authored
Dec 28, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
退款流程
parent
e262f568
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
280 additions
and
257 deletions
app.js
component/m-ui/m-tab/m-tab.js
component/m-ui/m-tab/m-tab.wxml
pages/campsite/home-mirror/home-mirror.js
pages/campsite/home/home.js
pages/commodity/home/home.js
pages/commodity/menu-food/menu-food.js
pages/commodity/project/project.js
pages/commodity/room-appointment/room-appointment.js
pages/commodity/shopping-cart/shopping-cart.js
pages/home/night-appointment/night-appointment.js
pages/mine/appointment-detail/appointment-detail.js
pages/mine/appointment-detail/appointment-detail.wxml
pages/mine/appointment-ticket/appointment-ticket.js
pages/mine/appointment/appointment.js
pages/mine/appointment/appointment.wxml
pages/mine/appointment/appointment.wxss
pages/mine/home/home.js
pages/mine/order/order.js
pages/mine/order/order.wxml
pages/pay/coupon-detail/coupon-detail.js
pages/pay/order-comment/order-comment.js
pages/pay/order-detail/order-detail.js
pages/pay/order-detail/order-detail.wxml
pages/pay/order-input/order-input.js
pages/play/activity/activity.js
pages/play/service-detail/service-detail.js
utils/request/interceptor.js
app.js
View file @
6674fe67
...
...
@@ -274,6 +274,7 @@ App({
let
funcShopInfo
=
JSON
.
parse
(
JSON
.
stringify
(
iEnvironmental
.
shopId
[
i
]))
if
(
funcShopType
)
funcShopInfo
.
shopType
=
funcShopType
console
.
log
(
'11'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
return
iEnvironmental
.
shopId
[
i
]
}
...
...
component/m-ui/m-tab/m-tab.js
View file @
6674fe67
...
...
@@ -4,44 +4,23 @@ Component({
scrollLock
:
false
,
properties
:
{
// tab 整体样式
classTab
:
{
type
:
String
,
value
:
'm-tab-container'
,
listOption
:
{
type
:
Object
,
value
:
{}
},
// tab 列表样式
classTabList
:
{
type
:
String
,
value
:
'm-tab-list'
,
},
// tab 列表项目样式
classTabItem
:
{
type
:
String
,
value
:
'm-item'
,
},
// 点击样式
classActive
:
{
type
:
String
,
value
:
'm-item-active'
,
},
// 默认样式
classInactive
:
{
type
:
String
,
value
:
'm-item-inactive'
,
itemOption
:
{
type
:
Object
,
value
:
{
align
:
'between'
,
// 左对齐 - left,居中对齐 - center,右对齐 - right,两侧对齐 - between,等分对齐 - around
}
},
item
:
{
type
:
Array
,
value
:
[]
},
activeIndex
:
{
type
:
Number
,
value
:
0
,
value
:
0
},
},
...
...
@@ -61,7 +40,6 @@ Component({
setItemElement
:
function
()
{
if
(
this
.
data
.
item
.
length
===
0
)
return
// 获取购物车高度
let
funcQuery
=
this
.
createSelectorQuery
()
funcQuery
.
selectAll
(
'.m-item-mark'
).
boundingClientRect
()
funcQuery
.
exec
((
funcResult
)
=>
{
...
...
@@ -87,30 +65,5 @@ Component({
})
this
.
triggerEvent
(
'tabChange'
,
Object
.
assign
(
funcItem
,
{
index
:
funcIndex
}))
},
eventTabScroll
:
function
(
funcEvent
)
{
if
(
this
.
scrollLock
)
return
let
funcScrollLeft
=
funcEvent
.
detail
.
scrollLeft
clearTimeout
(
this
.
scrollTimer
)
this
.
scrollTimer
=
setTimeout
(()
=>
{
let
funcItemElementLeft
=
this
.
data
.
itemElementLeft
for
(
let
i
=
0
,
l
=
funcItemElementLeft
.
length
;
i
<
l
;
i
++
)
{
// funcScrollLeft - 20 是为了弥补滚动到首个 item 时无法准确定位在 0 数值上的问题。
if
(
funcScrollLeft
-
20
<
funcItemElementLeft
[
i
])
{
this
.
scrollLock
=
true
this
.
setData
({
scrollLeft
:
funcItemElementLeft
[
i
]
})
clearTimeout
(
this
.
scrollTimer
)
this
.
scrollTimer
=
setTimeout
(()
=>
{
this
.
scrollLock
=
false
clearTimeout
(
this
.
scrollTimer
)
},
500
)
break
}
}
},
200
)
},
}
})
component/m-ui/m-tab/m-tab.wxml
View file @
6674fe67
<view class="m-tab
{{classTab}}
">
<view class="
{{classTabList}}
">
<view class="m-tab
m-tab-container
">
<view class="
m-tab-list
">
<block wx:for="{{item}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="m-item-mark
{{classTabItem}}
" data-item="{{item}}" data-index="{{index}}" bindtap="onItem">
<view class="row cc ac
{{classActive}}
" wx:if="{{activeIndex === index}}">
<view class="m-item-mark
m-item
" data-item="{{item}}" data-index="{{index}}" bindtap="onItem">
<view class="row cc ac
m-item-active
" wx:if="{{activeIndex === index}}">
<text>{{item.text}}</text>
</view>
<view class="row cc ac
{{classInactive}}
" wx:if="{{activeIndex !== index}}">
<view class="row cc ac
m-item-inactive
" wx:if="{{activeIndex !== index}}">
<text>{{item.text}}</text>
</view>
</view>
...
...
pages/campsite/home-mirror/home-mirror.js
View file @
6674fe67
...
...
@@ -46,6 +46,7 @@ Page({
'shopType'
:
funcShopType
,
'commodityLogo'
:
funcShopId
[
i
].
commodityLogo
}
console
.
log
(
'44'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
...
...
@@ -173,6 +174,7 @@ Page({
'shopType'
:
funcShopType
,
'commodityLogo'
:
funcShopId
[
i
].
commodityLogo
}
console
.
log
(
'55'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
...
...
pages/campsite/home/home.js
View file @
6674fe67
...
...
@@ -46,6 +46,7 @@ Page({
'shopType'
:
funcShopType
,
'commodityLogo'
:
funcShopId
[
i
].
commodityLogo
}
console
.
log
(
'22'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
...
...
@@ -173,6 +174,7 @@ Page({
'shopType'
:
funcShopType
,
'commodityLogo'
:
funcShopId
[
i
].
commodityLogo
}
console
.
log
(
'33'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
...
...
pages/commodity/home/home.js
View file @
6674fe67
...
...
@@ -30,6 +30,7 @@ Page({
},
onShow
:
function
()
{
wx
.
removeStorageSync
(
'shopInfoBuffer'
)
this
.
setData
({
appStatus
:
App
.
globalData
.
appStatus
})
this
.
setData
({
userInfo
:
wx
.
getStorageSync
(
'userInfo'
),
...
...
@@ -374,6 +375,7 @@ Page({
'shopType'
:
funcShopType
,
'commodityLogo'
:
funcShopId
[
i
].
commodityLogo
}
console
.
log
(
'66'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
...
...
pages/commodity/menu-food/menu-food.js
View file @
6674fe67
...
...
@@ -110,6 +110,7 @@ Page({
},
setShopInfo
:
function
()
{
console
.
log
(
'this.data.option'
,
this
.
data
.
option
)
if
(
this
.
data
.
option
.
formPage
===
'order'
)
{
let
funcAppId
=
Number
(
this
.
data
.
option
.
shopAppId
)
for
(
let
i
=
0
,
l
=
App
.
globalData
.
shopId
.
length
;
i
<
l
;
i
++
)
{
...
...
@@ -122,6 +123,7 @@ Page({
'shopType'
:
Number
(
this
.
data
.
option
.
commodityType
)
}
console
.
log
(
'77'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
...
...
pages/commodity/project/project.js
View file @
6674fe67
...
...
@@ -319,6 +319,7 @@ Page({
let
funcCommodityInfo
=
this
.
data
.
shopCommodityData
[
funcIndex
][
funcItemIndex
]
let
funcShopInfo
=
App
.
setShopInfo
(
this
.
data
.
shopAppId
[
funcIndex
].
appId
)
funcShopInfo
.
shopType
=
Number
(
funcCommodityInfo
.
typeId
)
console
.
log
(
'88'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
// 补充必要参数
...
...
@@ -343,6 +344,7 @@ Page({
App
.
setShopInfo
(
7
)
let
funcShopInfo
=
wx
.
getStorageSync
(
'shopInfoBuffer'
)
funcShopInfo
.
shopType
=
2
console
.
log
(
'99'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
wx
.
navigateTo
({
...
...
pages/commodity/room-appointment/room-appointment.js
View file @
6674fe67
...
...
@@ -208,14 +208,6 @@ Page({
},
})
.
then
((
response
)
=>
{
if
(
response
.
data
&&
response
.
data
.
code
===
500
)
{
App
.
ui
.
showToast
({
iconType
:
'error'
,
title
:
response
.
data
.
message
,
})
return
}
App
.
ui
.
hideToast
()
this
.
setData
({
appointmentComplete
:
true
,
...
...
pages/commodity/shopping-cart/shopping-cart.js
View file @
6674fe67
...
...
@@ -245,7 +245,6 @@ Page({
App
.
ui
.
showToast
({
iconType
:
'error'
,
title
:
'请选购商品后结算'
,
duration
:
30000
})
return
}
...
...
pages/home/night-appointment/night-appointment.js
View file @
6674fe67
...
...
@@ -230,20 +230,12 @@ Page({
},
})
.
then
((
response
)
=>
{
if
(
response
.
data
&&
response
.
data
.
code
==
500
)
{
App
.
ui
.
showToast
({
iconType
:
'error'
,
title
:
response
.
data
.
message
,
})
}
else
{
this
.
setData
({
appointmentComplete
:
true
,
})
App
.
ui
.
hideToast
()
}
this
.
setData
({
appointmentComplete
:
true
,
})
App
.
ui
.
hideToast
()
})
.
catch
((
response
)
=>
{
console
.
log
(
'response'
,
response
)
App
.
ui
.
showToast
({
iconType
:
'error'
,
title
:
response
.
message
,
...
...
pages/mine/appointment-detail/appointment-detail.js
View file @
6674fe67
...
...
@@ -161,6 +161,38 @@ Page({
},
1000
)
},
onOrderRefund
:
function
()
{
App
.
ui
.
showDialog
({
type
:
'confirm'
,
title
:
'是否确认申请退款?'
,
content
:
'申请后无法撤销'
,
cancel
:
'取消'
,
confirm
:
'确定'
,
success
:
()
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'loading'
,
'title'
:
'处理中'
,
})
this
.
setData
({
isDoing
:
true
})
App
.
request
({
url
:
'v1/order/orderRefund/'
+
this
.
data
.
orderInfo
.
id
,
method
:
'get'
,
params
:
{},
})
.
then
((
response
)
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
'退款申请已提交'
})
this
.
queryOrderDetail
()
})
},
fail
:
()
=>
{},
})
},
// 再次下单
onOrderAgain
:
function
()
{
if
(
this
.
data
.
orderInfo
.
goodsType
===
-
3
)
{
...
...
pages/mine/appointment-detail/appointment-detail.wxml
View file @
6674fe67
...
...
@@ -139,7 +139,7 @@
</block>
<!-- 活动 -->
<block wx:if="{{orderInfo.goodsType === -1}}">
<block wx:if="{{orderInfo.goodsType === -1
|| orderInfo.goodsType === -3
}}">
<view class="info-content column cc">
<view class="info-content-item row">
<text class="info-content-item-label">报名活动</text>
...
...
@@ -279,10 +279,11 @@
</view>
<!-- 底部按钮 -->
<view class="footer-btn row ce"
wx:if="{{orderInfo.state !== 2}}"
>
<view class="footer-btn row ce">
<!-- 状态(-1已取消,0未付款,1未发货,2待使用,3已使用,4已过期,5已发货,6已关闭/已评价) -->
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='0' wx:if="{{orderInfo.state===0}}">取消订单</view>
<view class="order-btn" bindtap="onOrderPay" wx:if="{{orderInfo.state===0}}">去支付</view>
<view class="delete-btn" bindtap="onOrderRefund" data-type='0' wx:if="{{orderInfo.state===2 && orderInfo.goodsType === -1}}">申请退款</view>
<view class="order-btn" bindtap="onOrderEvaluate" wx:if="{{orderInfo.state===3}}">去评价</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state===-1 || orderInfo.state===6 || orderInfo.state===7}}">删除订单</view>
<view class="order-btn" wx:if="{{orderInfo.state === -1}}" bindtap="onOrderAgain">再次报名</view>
...
...
pages/mine/appointment-ticket/appointment-ticket.js
View file @
6674fe67
...
...
@@ -69,36 +69,34 @@ Page({
},
})
.
then
((
response
)
=>
{
App
.
ui
.
hideToast
()
this
.
setData
({
isDoing
:
false
})
if
(
response
.
data
&&
response
.
data
.
code
==
500
)
{
App
.
ui
.
showToast
({
'iconType'
:
'error'
,
'title'
:
response
.
data
.
message
,
})
}
else
{
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
'取消成功'
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
'取消成功'
})
setTimeout
(()
=>
{
let
type
=
this
.
data
.
type
let
tabType
=
2
if
(
type
==
0
)
{
//返回夜间入园预约列表
tabType
=
1
}
else
{
// 返回看房预约
tabType
=
2
}
wx
.
redirectTo
({
url
:
'/pages/mine/appointment/appointment?tab='
+
tabType
,
})
setTimeout
(()
=>
{
let
type
=
this
.
data
.
type
let
tabType
=
2
if
(
type
==
0
)
{
//返回夜间入园预约列表
tabType
=
1
}
else
{
// 返回看房预约
tabType
=
2
}
wx
.
redirectTo
({
url
:
'/pages/mine/appointment/appointment?tab='
+
tabType
,
})
},
2000
);
}
},
2000
);
})
.
catch
((
response
)
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'error'
,
'title'
:
response
.
message
,
})
})
},
})
...
...
pages/mine/appointment/appointment.js
View file @
6674fe67
...
...
@@ -103,6 +103,8 @@ Page({
'pageNo'
:
this
.
data
.
pageNo
,
}
}).
then
((
response
)
=>
{
console
.
log
(
'queryActivityList'
,
response
);
App
.
ui
.
hideToast
()
let
funcData
=
response
.
data
.
list
...
...
@@ -120,8 +122,11 @@ Page({
'num'
:
funcData
[
i
].
number
,
'amount'
:
funcData
[
i
].
totalMoney
?
funcData
[
i
].
totalMoney
.
toFixed
(
2
)
:
0
,
'wxRequest'
:
funcData
[
i
].
wxRequest
,
'belongType'
:
Number
(
funcData
[
i
].
type
)
'belongType'
:
Number
(
funcData
[
i
].
type
),
'isRefund'
:
Boolean
(
Number
(
funcData
[
i
].
enableRefund
))
}
console
.
log
(
funcItem
);
if
(
funcItem
.
status
===
3
&&
funcItem
.
belongType
===
2
)
funcItem
.
status
=
6
funcList
.
push
(
funcItem
)
}
...
...
@@ -140,6 +145,39 @@ Page({
this
.
onOrderDetail
(
event
)
},
onOrderRefund
:
function
(
event
)
{
App
.
ui
.
showDialog
({
type
:
'confirm'
,
title
:
'是否确认申请退款?'
,
content
:
'申请后无法撤销'
,
cancel
:
'取消'
,
confirm
:
'确定'
,
success
:
()
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'loading'
,
'title'
:
'处理中'
,
})
this
.
setData
({
isDoing
:
true
})
let
funcItem
=
event
.
target
.
dataset
.
item
App
.
request
({
url
:
'v1/order/orderRefund/'
+
funcItem
.
orderId
,
method
:
'get'
,
params
:
{},
})
.
then
((
response
)
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
'退款申请已提交'
})
this
.
onReload
()
})
},
fail
:
()
=>
{},
})
},
/**
* 订单评价
* @function
...
...
@@ -260,25 +298,23 @@ Page({
},
})
.
then
((
response
)
=>
{
App
.
ui
.
hideToast
()
if
(
response
.
data
&&
response
.
data
.
code
==
500
)
{
App
.
ui
.
showToast
({
'iconType'
:
'error'
,
'title'
:
response
.
data
.
message
,
})
}
else
{
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
type
==
0
?
'取消成功'
:
'删除成功'
,
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
type
==
0
?
'取消成功'
:
'删除成功'
,
})
setTimeout
(()
=>
{
this
.
setData
({
'isDoing'
:
false
,
'pageNo'
:
1
,
})
setTimeout
(()
=>
{
this
.
setData
({
'isDoing'
:
false
,
'pageNo'
:
1
,
})
this
.
queryActivityList
()
},
2000
);
}
this
.
queryActivityList
()
},
2000
);
})
.
catch
((
response
)
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'error'
,
'title'
:
response
.
message
,
}
)
})
},
})
...
...
pages/mine/appointment/appointment.wxml
View file @
6674fe67
...
...
@@ -74,6 +74,7 @@
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<button wx:if="{{item.isRefund && item.status !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view data-item="{{item}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
</view>
</view>
...
...
@@ -106,6 +107,7 @@
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<button wx:if="{{item.isRefund && item.status !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view data-item="{{item}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
</view>
</view>
...
...
pages/mine/appointment/appointment.wxss
View file @
6674fe67
...
...
@@ -248,6 +248,18 @@
right: 172rpx;
bottom: 40rpx;
}
.delete {
width: 120rpx;
height: 56rpx;
border-radius: 4rpx;
border: 1px solid #c2c7cf;
font-size: 22rpx;
font-weight: 500;
line-height: 32rpx;
color: #656e7b;
}
.confirm-btn {
z-index: 4;
width: 120rpx;
...
...
pages/mine/home/home.js
View file @
6674fe67
...
...
@@ -119,6 +119,10 @@ Page({
this
.
queryClubAuditTotal
()
// 查询俱乐部审核数量
},
onHide
:
function
()
{
wx
.
removeStorageSync
(
'shopInfoBuffer'
)
},
/**
* 设置用户面板信息
* @function
...
...
@@ -228,10 +232,12 @@ Page({
'cardName'
:
'精灵鸟理想国'
+
funcData
[
i
].
name
}
// 设置门店信息
let
funcShopInfo
=
App
.
setShopInfo
(
funcItem
.
shopAppId
)
funcItem
.
shopName
=
funcShopInfo
.
name
funcItem
.
shopLogo
=
funcShopInfo
.
logo
if
(
i
===
0
)
{
// 设置门店信息
let
funcShopInfo
=
App
.
setShopInfo
(
funcItem
.
shopAppId
)
funcItem
.
shopName
=
funcShopInfo
.
name
funcItem
.
shopLogo
=
funcShopInfo
.
logo
}
funcList
.
push
(
funcItem
)
}
...
...
pages/mine/order/order.js
View file @
6674fe67
...
...
@@ -296,6 +296,7 @@ Page({
'logo'
:
funcItem
.
shopLogo
,
'shopType'
:
''
,
}
console
.
log
(
'1010'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
wx
.
navigateTo
({
url
:
`/pages/pay/order-detail/order-detail?id=
${
funcItem
.
id
}
&shopAppId=
${
funcItem
.
shopAppId
}
`
,
...
...
@@ -420,7 +421,7 @@ Page({
.
then
((
response
)
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
'退款
成功
'
'title'
:
'退款
申请已提交
'
})
this
.
setData
({
'isDoing'
:
false
,
...
...
@@ -520,30 +521,6 @@ Page({
url
:
'/pages/pay/order-comment/order-comment?pageFrom=orderList&id='
+
funcId
})
},
/**
* 缓存用户信息
* @function
* @param {object} - event
* @returns
*/
setShopInfo
:
function
(
funcShopAppId
,
funcShopType
)
{
// 获取门店基本信息
let
funcShopId
=
App
.
globalData
.
shopId
for
(
let
i
=
0
,
l
=
funcShopId
.
length
;
i
<
l
;
i
++
)
{
if
(
funcShopAppId
===
funcShopId
[
i
].
appId
)
{
let
funcShopInfo
=
{
'id'
:
funcShopId
[
i
].
id
,
'appId'
:
funcShopId
[
i
].
appId
,
'name'
:
funcShopId
[
i
].
title
[
funcShopType
],
'logo'
:
funcShopId
[
i
].
logo
,
'cover'
:
funcShopId
[
i
].
cover
,
'shopType'
:
funcShopType
,
}
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
}
},
/**
* 订单再次下单、去逛逛
...
...
pages/mine/order/order.wxml
View file @
6674fe67
...
...
@@ -64,6 +64,7 @@
<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>
...
...
@@ -98,11 +99,11 @@
<view class="row ac">
<button wx:if="{{item.isRefund && item.status !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<button wx:if="{{item.status === 0}}" class="delete row cc ac" data-index="{{index}}" data-item="{{item}}" catchtap="onOrderCancel" disabled="{{isDoing}}">取消订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1 || item.status === 4 || item.status === 6}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRemove">删除订单</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 disabled="{{isDoing}}" wx:if="{{item.status === 0}}" class="again row cc ac" data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 2}}" class="again 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 disabled="{{isDoing}}" wx:if="{{item.status === -1}}" class="again row cc ac" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1
|| item.status === 8
}}" class="again row cc ac" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button>
</view>
</view>
</view>
...
...
@@ -115,30 +116,4 @@
<button class="row cc ac" wx:if="{{statusActive === 0}}" bindtap="onToBuy">去逛逛</button>
</view>
</block>
</view>
<!-- 二维码弹窗 -->
<view class="code-mask row cc ac" wx:if="{{winCode}}">
<view class="code column cc ac">
<view class="code-tip column cc ac">
<text>{{'请将券码出示给门店核销人员'}}</text>
<text>{{'请将券码出示给门店核销人员'}}</text>
</view>
<view class="code-info column cc ac">
<view class="code-info-title">
<text>{{'《 阿凡达 》电影票'}}</text>
</view>
<view class="code-info-qrcode">
<image src="{{'data:image/png;base64,' + code.codeBase64}}"></image>
</view>
<view class="code-info-copy row cb ac">
<text>券码</text>
<text>{{'2719 7092 0925'}}</text>
<text>复制</text>
</view>
</view>
<view class="code-close row cc ac" bindtap="onCodeClose">
<image src="{{imageBase + 'icon/close-1.png'}}"></image>
</view>
</view>
</view>
\ No newline at end of file
pages/pay/coupon-detail/coupon-detail.js
View file @
6674fe67
...
...
@@ -86,22 +86,17 @@ Page({
},
})
.
then
((
response
)
=>
{
if
(
response
.
data
&&
response
.
data
.
code
*
1
==
500
)
{
App
.
ui
.
showToast
({
iconType
:
'error'
,
title
:
response
.
data
.
message
,
})
}
else
{
App
.
ui
.
showToast
({
iconType
:
'success'
,
title
:
'核销成功'
,
})
setTimeout
(()
=>
{
console
.
log
(
response
)
App
.
ui
.
showToast
({
iconType
:
'success'
,
title
:
'核销成功'
,
ending
:
()
=>
{
wx
.
navigateBack
()
}
,
2000
);
}
}
}
)
})
.
catch
((
response
)
=>
{
console
.
log
(
response
)
App
.
ui
.
showToast
({
iconType
:
'error'
,
title
:
response
.
message
,
...
...
pages/pay/order-comment/order-comment.js
View file @
6674fe67
...
...
@@ -44,7 +44,7 @@ Page({
* @param
* @returns
*/
queryOrderDetail
:
function
()
{
s
queryOrderDetail
:
function
()
{
App
.
request
({
url
:
'v1/order/getOrderDetail'
,
params
:
{
...
...
pages/pay/order-detail/order-detail.js
View file @
6674fe67
...
...
@@ -137,6 +137,38 @@ Page({
},
1000
)
},
onOrderRefund
:
function
()
{
App
.
ui
.
showDialog
({
type
:
'confirm'
,
title
:
'是否确认申请退款?'
,
content
:
'申请后无法撤销'
,
cancel
:
'取消'
,
confirm
:
'确定'
,
success
:
()
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'loading'
,
'title'
:
'处理中'
,
})
this
.
setData
({
isDoing
:
true
})
App
.
request
({
url
:
'v1/order/orderRefund/'
+
this
.
data
.
orderInfo
.
id
,
method
:
'get'
,
params
:
{},
})
.
then
((
response
)
=>
{
App
.
ui
.
showToast
({
'iconType'
:
'success'
,
'title'
:
'退款申请已提交'
})
this
.
onReload
()
})
},
fail
:
()
=>
{},
})
},
// 再次下单
onOrderAgain
:
function
(
event
)
{
if
(
this
.
data
.
orderInfo
.
goodsType
===
-
3
)
{
...
...
pages/pay/order-detail/order-detail.wxml
View file @
6674fe67
...
...
@@ -46,6 +46,11 @@
<text>退款申请正在审核中,请您耐心等待</text>
</view>
</view>
<view class="state-content state-content-invalid column cc" wx:if="{{orderInfo.state === 8}}">
<view class="state-content-title row">
<text>退款成功</text>
</view>
</view>
<view class="state-content state-content-invalid column cc" wx:if="{{orderInfo.state === 9}}">
<view class="state-content-title row">
<text>订单已完成</text>
...
...
@@ -291,13 +296,14 @@
</view>
<!-- 底部按钮 -->
<view class="footer-btn row ce" wx:if="{{orderInfo.state !==
2
}}">
<view class="footer-btn row ce" wx:if="{{orderInfo.state !==
7
}}">
<!-- 状态(-1已取消,0未付款,1未发货,2待使用,3已使用,4已过期,5已发货,6已关闭/已评价) -->
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='0' wx:if="{{orderInfo.state === 0}}">取消订单</view>
<view class="order-btn" bindtap="onOrderPay" wx:if="{{orderInfo.state === 0}}">去支付</view>
<view class="delete-btn" bindtap="onOrderRefund" wx:if="{{orderInfo.state === 2}}">申请退款</view>
<view class="order-btn" bindtap="onOrderEvaluate" wx:if="{{orderInfo.state === 3}}">去评价</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state === -1 || orderInfo.state === 6}}">删除订单</view>
<view class="order-btn" bindtap="onOrderAgain" wx:if="{{orderInfo.state === -1}}">再次下单</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state === -1 || orderInfo.state === 6
|| orderInfo.state === 8
}}">删除订单</view>
<view class="order-btn" bindtap="onOrderAgain" wx:if="{{orderInfo.state === -1
|| orderInfo.state === 8
}}">再次下单</view>
</view>
<!-- 二维码弹窗 -->
...
...
pages/pay/order-input/order-input.js
View file @
6674fe67
...
...
@@ -96,6 +96,7 @@ Page({
},
onLoad
:
function
(
options
)
{
console
.
log
(
options
)
if
(
options
.
type
)
options
.
type
=
Number
(
options
.
type
)
logicData
.
option
=
options
...
...
@@ -953,7 +954,48 @@ Page({
},
})
.
then
((
response
)
=>
{
if
(
/ 商品不存在/
.
test
(
response
.
data
.
message
))
{
// 库存充足正常下单支付
let
funcResponse
=
response
.
data
.
wxRequest
pagePayId
=
response
.
data
.
orderId
this
.
setData
({
orderId
:
pagePayId
})
// 支付金额为零,默认支付成功
if
(
Number
(
this
.
data
.
payAmount
)
===
0
)
{
this
.
payStatus
(
true
)
return
}
wx
.
requestPayment
({
'timeStamp'
:
funcResponse
.
timeStamp
,
'nonceStr'
:
funcResponse
.
nonceStr
,
'package'
:
funcResponse
.
package
,
'signType'
:
funcResponse
.
signType
,
'paySign'
:
funcResponse
.
paySign
,
success
:
(
response
)
=>
{
if
(
response
.
errMsg
===
'requestPayment:ok'
)
{
// 用户点击支付完成按钮回调
// this.payStatus(true)
}
if
(
response
.
errMsg
===
'requestPayment:fail cancel'
)
{
clearInterval
(
App
.
globalData
.
payStateTimer
)
this
.
payStatus
(
false
)
}
},
fail
:
(
response
)
=>
{
clearInterval
(
App
.
globalData
.
payStateTimer
)
this
.
payStatus
(
false
)
}
})
// 开启支付状态轮询
// wx.showLoading({ title: '正在获取数据', mask: true })
this
.
queryPayStatus
(
pagePayId
)
})
.
catch
((
response
)
=>
{
console
.
log
(
response
)
if
(
/商品不存在/
.
test
(
response
.
message
))
{
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[])
App
.
ui
.
showToast
({
iconType
:
'error'
,
...
...
@@ -967,7 +1009,7 @@ Page({
return
}
if
(
/价格不一致/
.
test
(
response
.
data
.
message
))
{
if
(
/价格不一致/
.
test
(
response
.
message
))
{
wx
.
setStorageSync
(
'shoppingCartBuffer'
,
[])
App
.
ui
.
showToast
({
iconType
:
'error'
,
...
...
@@ -981,10 +1023,10 @@ Page({
return
}
if
(
/订单未支付/
.
test
(
response
.
data
.
message
))
{
if
(
/订单未支付/
.
test
(
response
.
message
))
{
App
.
ui
.
showToast
({
iconType
:
'error'
,
title
:
response
.
data
.
message
,
title
:
response
.
message
,
})
this
.
setData
({
isPaySubmit
:
false
,
...
...
@@ -992,12 +1034,12 @@ Page({
return
}
if
(
/库存不足/
.
test
(
response
.
data
.
message
))
{
if
(
/库存不足/
.
test
(
response
.
message
))
{
let
funcList
=
[]
for
(
let
i
=
0
,
l
=
response
.
data
.
data
.
list
.
length
;
i
<
l
;
i
++
)
{
for
(
let
i
=
0
,
l
=
response
.
data
.
list
.
length
;
i
<
l
;
i
++
)
{
let
funcItem
=
{
'cover'
:
response
.
data
.
data
.
list
[
i
].
imgUrl
,
'name'
:
response
.
data
.
data
.
list
[
i
].
name
'cover'
:
response
.
data
.
list
[
i
].
imgUrl
,
'name'
:
response
.
data
.
list
[
i
].
name
}
funcList
.
push
(
funcItem
)
}
...
...
@@ -1008,47 +1050,6 @@ Page({
})
return
}
// 库存充足正常下单支付
let
funcResponse
=
response
.
data
.
wxRequest
pagePayId
=
response
.
data
.
orderId
this
.
setData
({
orderId
:
pagePayId
})
// 支付金额为零,默认支付成功
if
(
Number
(
this
.
data
.
payAmount
)
===
0
)
{
this
.
payStatus
(
true
)
return
}
wx
.
requestPayment
({
'timeStamp'
:
funcResponse
.
timeStamp
,
'nonceStr'
:
funcResponse
.
nonceStr
,
'package'
:
funcResponse
.
package
,
'signType'
:
funcResponse
.
signType
,
'paySign'
:
funcResponse
.
paySign
,
success
:
(
response
)
=>
{
if
(
response
.
errMsg
===
'requestPayment:ok'
)
{
// 用户点击支付完成按钮回调
// this.payStatus(true)
}
if
(
response
.
errMsg
===
'requestPayment:fail cancel'
)
{
clearInterval
(
App
.
globalData
.
payStateTimer
)
this
.
payStatus
(
false
)
}
},
fail
:
(
response
)
=>
{
clearInterval
(
App
.
globalData
.
payStateTimer
)
this
.
payStatus
(
false
)
}
})
// 开启支付状态轮询
// wx.showLoading({ title: '正在获取数据', mask: true })
this
.
queryPayStatus
(
pagePayId
)
})
.
catch
((
response
)
=>
{
this
.
setData
({
isPaySubmit
:
true
,
})
...
...
pages/play/activity/activity.js
View file @
6674fe67
...
...
@@ -249,6 +249,7 @@ Page({
let
funcShopInfo
=
JSON
.
parse
(
JSON
.
stringify
(
App
.
globalData
.
shopId
[
i
]))
console
.
log
(
funcShopInfo
.
name
)
if
(
funcShopType
)
funcShopInfo
.
shopType
=
funcShopType
console
.
log
(
'1111'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
}
}
...
...
pages/play/service-detail/service-detail.js
View file @
6674fe67
...
...
@@ -377,6 +377,7 @@ Page({
'cover'
:
App
.
globalData
.
shopId
[
i
].
cover
,
'shopType'
:
this
.
data
.
option
.
type
}
console
.
log
(
'1212'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcItem
)
this
.
setData
({
shopInfo
:
funcItem
...
...
@@ -656,6 +657,7 @@ Page({
'shopType'
:
funcShopType
,
'commodityLogo'
:
funcShopId
[
i
].
commodityLogo
}
console
.
log
(
'1313'
)
wx
.
setStorageSync
(
'shopInfoBuffer'
,
funcShopInfo
)
break
}
...
...
utils/request/interceptor.js
View file @
6674fe67
...
...
@@ -63,7 +63,7 @@ let Output = {
response
:
{
code
:
funcResponse
.
data
.
code
,
data
:
funcResponse
.
data
.
list
,
message
:
funcResponse
.
data
.
m
essage
message
:
funcResponse
.
data
.
m
sg
}
}
}
...
...
@@ -73,7 +73,7 @@ let Output = {
response
:
{
code
:
funcResponse
.
data
.
code
,
data
:
funcResponse
.
data
.
data
?
funcResponse
.
data
.
data
:
{},
message
:
funcResponse
.
data
.
m
essage
message
:
funcResponse
.
data
.
m
sg
}
}
break
...
...
@@ -83,14 +83,15 @@ let Output = {
break
case
500
:
console
.
log
(
'request 500'
,
funcResponse
)
return
{
success
:
false
,
response
:
{
code
:
funcResponse
.
data
.
code
,
data
:
''
,
message
:
funcResponse
.
data
.
message
}
data
:
funcResponse
.
data
.
data
?
funcResponse
.
data
.
data
:
''
,
message
:
funcResponse
.
data
.
msg
}
}
break
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment