parent
4f44a2ec04
commit
de71aa5263
@ -0,0 +1,116 @@
|
||||
//index.js
|
||||
//获取应用实例
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
currentTap: 0,
|
||||
'iscart': false,
|
||||
'goodsDate': '2018-11-11',
|
||||
'totalCount': 0,
|
||||
'totalPrice': 0,
|
||||
'address':'湖南师范大学理学院',
|
||||
'consignee': "杨盼成",
|
||||
'phone': '12345678912',
|
||||
'unpaidList': [//待付款
|
||||
{
|
||||
'cover': '../index/image/suanfa.jpg',
|
||||
'isbn': '9787535482051',
|
||||
'desc': '计算机算法设计',
|
||||
'price': 20,
|
||||
'count': 2
|
||||
},
|
||||
{
|
||||
'cover': '../index/image/jichu.jpg',
|
||||
'isbn': '9787540455958',
|
||||
'desc': '计算机基础',
|
||||
'price': 30,
|
||||
'count': 1
|
||||
},
|
||||
{
|
||||
'cover': '../index/image/rjgcdl.jpg',
|
||||
'isbn': '9787539982830',
|
||||
'desc': '软件工程导论',
|
||||
'price': 25,
|
||||
'count': 5
|
||||
}
|
||||
],
|
||||
'deliverList':[//待发货
|
||||
{
|
||||
'cover': '../index/image/suanfa.jpg',
|
||||
'isbn': '9787535482051',
|
||||
'desc': '计算机算法设计',
|
||||
'count': 2
|
||||
},
|
||||
{
|
||||
'cover': '../index/image/jichu.jpg',
|
||||
'isbn': '9787540455958',
|
||||
'desc': '计算机基础',
|
||||
'count': 1
|
||||
},
|
||||
{
|
||||
'cover': '../index/image/rjgcdl.jpg',
|
||||
'isbn': '9787539982830',
|
||||
'desc': '软件工程导论',
|
||||
'count': 5
|
||||
}
|
||||
],
|
||||
'dueinList': [//待收货
|
||||
{
|
||||
'cover': '../index/image/suanfa.jpg',
|
||||
'isbn': '9787535482051',
|
||||
'desc': '计算机算法设计',
|
||||
'count': 2
|
||||
},
|
||||
{
|
||||
'cover': '../index/image/jichu.jpg',
|
||||
'isbn': '9787540455958',
|
||||
'desc': '计算机基础',
|
||||
'count': 1
|
||||
},
|
||||
{
|
||||
'cover': '../index/image/rjgcdl.jpg',
|
||||
'isbn': '9787539982830',
|
||||
'desc': '软件工程导论',
|
||||
'count': 5
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
onLoad: function () {
|
||||
var unpaidList = this.data.unpaidList;
|
||||
var totalCount = 0;
|
||||
var totalPrice = 0;
|
||||
for (var i = 0; i < unpaidList.length; i++) {
|
||||
var good = unpaidList[i];
|
||||
totalCount += good.count;
|
||||
totalPrice += good.count * good.price;
|
||||
}
|
||||
totalPrice = totalPrice.toFixed(2);
|
||||
this.setData({
|
||||
'totalCount': totalCount,
|
||||
'totalPrice': totalPrice
|
||||
})
|
||||
},
|
||||
|
||||
onLoad: function (options){
|
||||
var that = this
|
||||
this.setData({
|
||||
currentTap: options.typeId
|
||||
})
|
||||
},
|
||||
|
||||
deleteList: function (e) {
|
||||
this.setData({
|
||||
'unpaidList':null
|
||||
});
|
||||
},
|
||||
|
||||
order_status: function(e) {
|
||||
var current = e.currentTarget.dataset.current
|
||||
this.setData({
|
||||
currentTap: current
|
||||
})
|
||||
},
|
||||
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的订单"
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
<!--manageAddress.wxml-->
|
||||
<view class="order_sort flexRowBetween">
|
||||
<view class="order_item {{currentTap ==0?'order_this':''}}" data-current="0" bindtap="order_status">
|
||||
待付款
|
||||
</view>
|
||||
<view class="order_item {{currentTap ==1?'order_this':''}}" data-current="1" bindtap="order_status">
|
||||
待收货
|
||||
</view>
|
||||
<view class="order_item {{currentTap ==2?'order_this':''}}" data-current="2" bindtap="order_status">
|
||||
待发货
|
||||
</view>
|
||||
</view>
|
||||
<view class="order_list">
|
||||
<!--待付款页面-->
|
||||
<view class="order_all {{currentTap ==0?'order_show':''}}" wx:if='{{unpaidList!=null}}'>
|
||||
<view class="order_tlt flexRowBetween">
|
||||
<view class="tlt_left">
|
||||
<text>订单创建时期:</text>
|
||||
<text>{{goodsDate}}</text>
|
||||
</view>
|
||||
<view class="tlt_right" style="color:#21c3d4">
|
||||
等待付款
|
||||
</view>
|
||||
</view>
|
||||
<view class="same_stroe">
|
||||
<view class="flexRowBetween orderlistShow" wx:for='{{unpaidList}}' wx:for-item="good" wx:key="good.name">
|
||||
<view class="order_left">
|
||||
<image src="{{good.cover}}"></image>
|
||||
</view>
|
||||
<view class="order_name">
|
||||
<view class="text1">{{good.desc}}</view>
|
||||
<view class="orders flexRowBetween">
|
||||
<text class="order_type">数量:{{good.count}}</text>
|
||||
<text class="order_price">{{good.price*good.count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="handle">
|
||||
<view class="total_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="total_money">
|
||||
<text>合计:</text>
|
||||
<text class="text2">¥{{totalPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="handle_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="handle_orders delete_order" bindtap='deleteList'>删除订单</view>
|
||||
<view class="handle_orders comment_order">去付款</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--待收货页面-->
|
||||
<view class="order_all {{currentTap ==1?'order_show':''}}" wx:if='{{dueinList!=null}}'>
|
||||
<view class="order_tlt flexRowBetween">
|
||||
<view class="tlt_left">
|
||||
<text>发货日期:</text>
|
||||
<text>{{goodsDate}}</text>
|
||||
</view>
|
||||
<view class="tlt_right" style="color:#21c3d4">
|
||||
正在配送中
|
||||
</view>
|
||||
</view>
|
||||
<view class="same_stroe">
|
||||
<view class="flexRowBetween orderlistShow" wx:for='{{dueinList}}' wx:for-item="good" wx:key="good.name">
|
||||
<view class="order_left">
|
||||
<image src="{{good.cover}}"></image>
|
||||
</view>
|
||||
<view class="order_name">
|
||||
<view class="text1">{{good.desc}}</view>
|
||||
<view class="orders flexRowBetween">
|
||||
<text class="order_type">数量:{{good.count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="handle">
|
||||
<view class="total_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="total_money">
|
||||
<text>收货地址:</text>
|
||||
<text class="text2">{{address}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="total_money">
|
||||
<text>收货人:</text>
|
||||
<text class="text2">{{consignee}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="total_money">
|
||||
<text>电话:</text>
|
||||
<text class="text2">{{phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--
|
||||
<view class="handle_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="handle_orders delete_order" bindtap='deleteList'>删除订单</view>
|
||||
<view class="handle_orders comment_order">去付款</view>
|
||||
</view>
|
||||
</view>-->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="order_all {{currentTap ==2?'order_show':''}}" wx:if="{{deliverList!=null}}">
|
||||
<view class="order_tlt flexRowBetween">
|
||||
<view class="tlt_left">
|
||||
<text>付款日期:</text>
|
||||
<text>{{goodsDate}}</text>
|
||||
</view>
|
||||
<view class="tlt_right" style="color:#21c3d4">
|
||||
等待卖家发货
|
||||
</view>
|
||||
</view>
|
||||
<view class="same_stroe">
|
||||
<view class="flexRowBetween orderlistShow" wx:for='{{dueinList}}' wx:for-item="good" wx:key="good.name">
|
||||
<view class="order_left">
|
||||
<image src="{{good.cover}}"></image>
|
||||
</view>
|
||||
<view class="order_name">
|
||||
<view class="text1">{{good.desc}}</view>
|
||||
<view class="orders flexRowBetween">
|
||||
<text class="order_type">数量:{{good.count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="handle">
|
||||
<view class="total_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="total_money">
|
||||
<text>收货地址:</text>
|
||||
<text class="text2">{{address}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="total_money">
|
||||
<text>收货人:</text>
|
||||
<text class="text2">{{consignee}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total_order">
|
||||
<view class="flexRowBetween">
|
||||
<view class="total_money">
|
||||
<text>电话:</text>
|
||||
<text class="text2">{{phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,125 @@
|
||||
/**index.wxss**/
|
||||
page{
|
||||
width:100%;
|
||||
height:100vh;
|
||||
background:#f5f5f5;
|
||||
}
|
||||
.order_sort{
|
||||
padding:0rpx 25rpx;
|
||||
border-bottom:solid 1px #ececec;
|
||||
height:87rpx;
|
||||
line-height:84rpx;
|
||||
background:#fff;}
|
||||
.order_item{
|
||||
font-size:32rpx;
|
||||
color:#333;
|
||||
}
|
||||
.order_this{
|
||||
color:#21c3d4;
|
||||
border-bottom:solid 3rpx #21c3d4;
|
||||
}
|
||||
.all_select image{
|
||||
width:30rpx;
|
||||
height:30rpx;
|
||||
}
|
||||
.order_left{width:26%;
|
||||
text-align:left;
|
||||
}
|
||||
.order_all{
|
||||
display:none;
|
||||
}
|
||||
.order_show{
|
||||
display:block;
|
||||
}
|
||||
.order_list{
|
||||
|
||||
}
|
||||
.order_all .orderlistShow{
|
||||
width:100%;
|
||||
height:200rpx;
|
||||
|
||||
align-items:center;
|
||||
}
|
||||
.same_stroe{
|
||||
padding:0rpx 25rpx;
|
||||
overflow:hidden;
|
||||
border-bottom:solid 1rpx #fff;
|
||||
}
|
||||
.order_tlt{
|
||||
height:75rpx;
|
||||
line-height:75rpx;
|
||||
background:#fff;
|
||||
font-size:28rpx;
|
||||
padding:0rpx 25rpx;
|
||||
}
|
||||
.tlt_left{
|
||||
color:#666;
|
||||
}
|
||||
.handle{
|
||||
background:#fff;overflow:hidden;padding-bottom:30rpx;
|
||||
margin-bottom:30rpx;
|
||||
border-bottom:solid 1px #ececec;
|
||||
}
|
||||
.order_left image{
|
||||
width:160rpx;
|
||||
height:160rpx;
|
||||
}
|
||||
.order_name{
|
||||
width:66%;
|
||||
height:160rpx;
|
||||
}
|
||||
.order_name .text1{
|
||||
font-size:32rpx;
|
||||
height:50%;
|
||||
|
||||
}
|
||||
.orders{
|
||||
height:50%;
|
||||
align-items:center;
|
||||
font-size:28rpx;
|
||||
color:#808080;
|
||||
}
|
||||
.order_price{
|
||||
color:#21c3d4;
|
||||
font-size:32rpx;
|
||||
}
|
||||
.order_type{
|
||||
width:340rpx;
|
||||
}
|
||||
.total_money{
|
||||
font-size:28rpx;
|
||||
color:#666;
|
||||
}
|
||||
.total_money .text2{
|
||||
font-size:28rpx;
|
||||
color:#21c3d4;
|
||||
margin-left:10rpx;
|
||||
font-weight:bold;
|
||||
}
|
||||
.user_discount{
|
||||
color:#262626;
|
||||
font-size:24rpx;
|
||||
}
|
||||
.total_order{
|
||||
margin-top:16rpx;
|
||||
wdith:475rpx;
|
||||
float:right;
|
||||
margin-right:15rpx;
|
||||
}
|
||||
.handle_order{
|
||||
clear:both;
|
||||
width:364rpx;
|
||||
float:right;
|
||||
margin-right:25rpx;
|
||||
margin-top:20rpx;
|
||||
}
|
||||
.handle_orders{
|
||||
width:138rpx;
|
||||
height:50rpx;
|
||||
border:solid 1px #aeaeae;
|
||||
border-radius:10rpx;
|
||||
text-align:center;
|
||||
line-height:50rpx;
|
||||
font-size:28rpx;
|
||||
color:#636363;
|
||||
}
|
Loading…
Reference in new issue