Commit d51177cd by daqian

modify: 订单详情

parent 7c7a5950
......@@ -61,8 +61,9 @@ wxService.page({
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
},
handelDetail(e) {
const {detail} = e.currentTarget.dataset
wxService.router(`/pages/orderDetail/orderDetail`).search(detail)
// const {detail} = e.currentTarget.dataset
const { id } = e.currentTarget.dataset
wxService.router(`/pages/orderDetail/orderDetail?id=${id}`)
},
initOrderList(pageNo, pageSize,trade) {
wx.showLoading({
......@@ -78,6 +79,8 @@ wxService.page({
this.setData({
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false
},()=> {
wx.setStorageSync('orderList', this.data.orderList)
})
}
}
......
......@@ -32,7 +32,7 @@
<text class="order-status" wx-if="{{item.status == 'D'}}">待收货</text>
<text class="order-status" wx-if="{{item.status == 'R'}}">已完成</text>
</view>
<view class="pro-list" data-detail="{{item}}" bindtap="handelDetail">
<view class="pro-list" data-detail="{{item}}" data-id="{{item.id}}" bindtap="handelDetail">
<scroll-view scroll-x="true">
<view class="uploadWrap" scroll-x="true">
<block wx:for='{{item.skuVOList}}' wx:for-item="sub" wx:key="s" >
......
......@@ -62,10 +62,15 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (!Object.keys(this.options).length){ return }
this.setData({
detail: this.options
})
const {id} = this.options
let detailOrderList = wx.getStorageSync('orderList')
let currentDetail = detailOrderList.filter(item => item.id == id)
console.log("currentDetail", currentDetail)
// if (!Object.keys(this.options).length){ return }
// this.setData({
// detail: this.options
// })
},
copy(e) {
wx.setClipboardData({
......
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