15 changed files with 398 additions and 68 deletions
@ -0,0 +1,86 @@ |
|||
// pages/order/comment/index.js
|
|||
let app = getApp() |
|||
import commonApi from "../../../utils/https/common" |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
goodsList: [], |
|||
ticketList: [], |
|||
productPrice: 0, |
|||
ticketPrice: 0 |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
console.log(app.globalData.kjId) |
|||
this.setData({ |
|||
goodsList: app.globalData.postProduct, |
|||
ticketList: app.globalData.list |
|||
}) |
|||
console.log(this.data.goodsList,this.data.ticketList) |
|||
}, |
|||
order: function (){ |
|||
let service = "order/create", postData = {data: JSON.stringify(app.globalData.createDate)} |
|||
commonApi.user_post(service, postData).then(res => { |
|||
|
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
this.setData({ |
|||
productPrice: app.globalData.productPrice, |
|||
ticketPrice: app.globalData.ticketPrice |
|||
}) |
|||
console.log(app.globalData.productPrice,app.globalData.ticketPrice) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"title":"/pages/component/TitleHeader" |
|||
} |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
<title title="订单列表"></title> |
|||
<view class="box" wx:if="{{goodsList.length != 0}}"> |
|||
<view wx:for="{{goodsList}}" wx:key="index"> |
|||
<view class="item-box"> |
|||
<view> |
|||
{{item.product.title}} |
|||
</view> |
|||
<view class="price"> |
|||
¥{{item.product.price/100}} |
|||
</view> |
|||
</view> |
|||
<view class="item-box"> |
|||
<view> |
|||
{{item.sku.sku_name}} |
|||
</view> |
|||
<view> |
|||
X{{item.productNum}} |
|||
</view> |
|||
</view> |
|||
<view class="item-box"> |
|||
<view> |
|||
运费 |
|||
</view> |
|||
<view class="price"> |
|||
¥{{item.postFee/100 || 0}} |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="box" wx:if="{{ticketList.length != 0}}"> |
|||
<view wx:for="{{ticketList}}" wx:key="index"> |
|||
<view class="item-box"> |
|||
<view> |
|||
{{item.product.title}} |
|||
</view> |
|||
<view class="price"> |
|||
¥{{item.sku.price/100}} |
|||
</view> |
|||
</view> |
|||
<view class="item-box"> |
|||
<view> |
|||
{{item.sku.sku_name}} |
|||
</view> |
|||
<view> |
|||
X{{item.num}} |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="fixed-bottom"> |
|||
<view class="fixed-price-box"> |
|||
<text>合计:</text> |
|||
<text class="price">¥{{productPrice + ticketPrice}}</text> |
|||
</view> |
|||
<view class="fixed-btn" bindtap="order">下一步</view> |
|||
</view> |
|||
@ -0,0 +1,53 @@ |
|||
page{ |
|||
background: #f5f5f5; |
|||
} |
|||
.box{ |
|||
width: 700rpx; |
|||
margin: 30rpx auto; |
|||
background: white; |
|||
padding: 20rpx; |
|||
} |
|||
.item-box{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
padding: 10rpx; |
|||
} |
|||
.price{ |
|||
color: #D62828; |
|||
} |
|||
.fixed-bottom { |
|||
position: fixed; |
|||
left: 0; |
|||
right: 0; |
|||
bottom: 0; |
|||
height: 113rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
background: white; |
|||
z-index: 1; |
|||
box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); |
|||
} |
|||
.fixed-btn { |
|||
width: 320rpx; |
|||
line-height: 113rpx; |
|||
background: #D62828; |
|||
color: #fff; |
|||
text-align: center; |
|||
font-size: 36rpx; |
|||
font-weight: 500; |
|||
} |
|||
|
|||
.fixed-price-box { |
|||
margin-left: 25rpx; |
|||
flex-shrink: 0; |
|||
font-size: 29rpx; |
|||
color: #333; |
|||
font-weight: 500; |
|||
} |
|||
|
|||
.fixed-price-box .price { |
|||
color: #D62828; |
|||
font-size: 36rpx; |
|||
margin-left: 10rpx; |
|||
} |
|||
Loading…
Reference in new issue