页面更新

master
Eridani11579 6 years ago
parent 4f44a2ec04
commit de71aa5263

@ -1,6 +1,5 @@
{
"pages": [
"pages/shouye/shouye",
"pages/index/index",
"pages/logs/logs",
@ -8,9 +7,8 @@
"pages/gouwu/gouwu",
"pages/wode/wode",
"pages/detail/detail",
"pages/shdz/shdz"
"pages/shdz/shdz",
"pages/order/order"
],
"window": {
"backgroundTextStyle": "light",

@ -18,3 +18,63 @@
justify-content: space-between;
box-sizing: border-box;
}
.flexRowBetween{
display:flex;
flex-direction:row;
justify-content:space-between;
}
.flexRowBetween1{
display:flex;
flex-direction:row;
}
.flexColumnBetween{
flex-direction:column;
justify-content:space-between;
}
.avoidOverflow{
overflow-x:hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
/***********提交按钮***********/
.submit_info{
margin:0rpx 25rpx;
width:700rpx;
height:88rpx;
line-height:88rpx;
text-align:center;
font-size:36rpx;
color:#fff;
background:linear-gradient(to right,rgba(72,222,223,1.00),rgba(42,154,225,1.00));
border-radius:10rpx;margin-top:260rpx;}
/***********navbar***********/
.navbar{
height:115rpx;
width:100%;
position:fixed;
bottom:0rpx;
z-index:999;
background:#fff;
display:flex;
justify-content:center;
border-top:solid 1px #dbdbdb;
align-items:center;
}
.navbar_item{
width:25%;
text-align:center;
}
.navbar .text{
color:#656565;
}
.navbar .this-text{
color:#21c3d4;
}
.navigator-hover {
background:none;
color:#21c3d4;
}

@ -5,7 +5,6 @@ Page({
* 页面的初始数据
*/
data: {
'iscart': false, //控制购物车有没有数据
'goodList': [
{
'cover': '/pages/index/image/suanfa.jpg',
@ -51,6 +50,8 @@ Page({
'checkAll': false,
'totalCount': 0,
'totalPrice': 0,
'consignee':"杨盼成",
'phone':'12345678912'
},
/**

@ -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;
}

@ -5,8 +5,7 @@ Page({
userInfo: {},
motto: 'Hello World',
// orderItems
orderItems: [
{
orderItems: [{
typeId: 0,
name: '待付款',
url: 'bill',
@ -14,15 +13,15 @@ Page({
},
{
typeId: 1,
name: '待货',
name: '待货',
url: 'bill',
imageurl: '/pages/index/image/fahuo.png',
imageurl: '/pages/index/image/shouhuo.png'
},
{
typeId: 2,
name: '待货',
name: '待货',
url: 'bill',
imageurl: '/pages/index/image/shouhuo.png'
imageurl: '/pages/index/image/fahuo.png',
},
{
typeId: 3,
@ -33,23 +32,25 @@ Page({
],
},
//事件处理函数
toOrder: function () {
toOrder: function(event) {
var typeId = event.currentTarget.dataset.typeid
// console.log(typeId);
wx.navigateTo({
url: '../order/order'
url: '../order/order?typeId=' + typeId
})
},
onLoad: function () {
onLoad: function() {
console.log('onLoad')
var that = this
//调用应用实例的方法获取全局数据
app.getUserInfo(function (userInfo) {
app.getUserInfo(function(userInfo) {
//更新数据
that.setData({
userInfo: userInfo
})
})
},
getUserInfo: function (e) {
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
@ -57,7 +58,7 @@ Page({
hasUserInfo: true
})
},
address: function () {
address: function() {
wx.navigateTo({
url: "/pages/shdz/shdz"
})

Loading…
Cancel
Save