Commit ba4f24dc by 高淑倩

modify: 消费详情判断

parent 1444eba5
...@@ -19,25 +19,24 @@ wxService.page({ ...@@ -19,25 +19,24 @@ wxService.page({
status: '交易成功', status: '交易成功',
themeArr: { count: '数量', name: '商品名称', price: '价格' }, themeArr: { count: '数量', name: '商品名称', price: '价格' },
itemArr: [], itemArr: [],
orderDetail: {} orderDetail: {},
isShowDetail: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow () { onShow () {
const { orderNo } = this.options const { orderNo } = this.options
if(orderNo){ // if(orderNo){
this.initOrderDetail(orderNo) // this.initOrderDetail(orderNo)
} // }
// this.initOrderDetail('71110110025959520190610160256') this.initOrderDetail('71110110025959520190610160256')
}, },
initOrderDetail(orderNo){ initOrderDetail(orderNo){
...@@ -58,7 +57,8 @@ wxService.page({ ...@@ -58,7 +57,8 @@ wxService.page({
}) })
this.setData({ this.setData({
orderDetail: data, orderDetail: data,
totalNum: countTotal totalNum: countTotal,
isShowDetail: Reflect.ownKeys(data).length? true : false
}) })
} }
}).finally(() => { }).finally(() => {
......
<!--pages/consumptionDetails.wxml--> <!--pages/consumptionDetails.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" /> <wxs src="../../wxs/utils.wxs" module="utils" />
<view wx:if="{{!isShowDetail}}">
<view wx:if="{{!orderDetail}}">
<view class="no-speed">暂无消费</view> <view class="no-speed">暂无消费</view>
</view> </view>
<view class="consumption" wx:if="{{orderDetail}}"> <view class="consumption" wx:if="{{isShowDetail}}">
<view class="consumption-top"> <view class="consumption-top">
<view class="top-ract" /> <view class="top-ract" />
<view class="top-order"> <view class="top-order">
......
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 to comment