我的订单列表

This commit is contained in:
Kiyan 2017-04-28 16:06:18 +08:00
parent 52704d6a76
commit 7554a8a073
27 changed files with 689 additions and 58 deletions

View File

@ -1,17 +1,17 @@
{
"pages": [
"pages/shop/show",
"pages/index/index",
"pages/order/list",
"pages/mine/mine",
"pages/index/address",
"pages/order/show",
"pages/order/quasi",
"pages/shop/category",
"pages/shop/search",
"pages/address/list",
"pages/address/add",
"pages/address/select"
"pages/address/select",
"pages/index/index",
"pages/order/quasi",
"pages/shop/show",
"pages/mine/mine",
"pages/index/address",
"pages/shop/category",
"pages/shop/search",
"pages/order/show"
],
"window": {
"backgroundColor": "#f8f8f8",

View File

@ -22,6 +22,10 @@ page {
font-size: 0.8em;
}
.trangle {
padding-right: 15px;
}
.trangle::after {
content: "";
margin-top: -4px;
@ -59,6 +63,7 @@ button[type=primary], .weui-btn_primary {
font-size: 13px;
padding: 0 1.34em;
border-radius: 0;
vertical-align: middle;
}
button[type="primary"][plain] {

BIN
app/images/Shop-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

BIN
app/images/location.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1 +1,3 @@
{}
{
"navigationBarTitleText": "编辑收货地址"
}

View File

@ -1,2 +1,41 @@
<!--pages/address/add.wxml-->
<text>pages/address/add.wxml</text>
<view class="weui-cells">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">联系人</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="您的姓名" />
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">手机号</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="配送人员联系您的电话" />
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__hd">
<view class="weui-label">收货地址</view>
</view>
<view class="weui-cell__bd weui-cell__ft_in-access">
松散
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">门牌号</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="请输入门牌号等详细信息" />
</view>
</view>
</view>
<view class="button-sp-area">
<button class="weui-btn" type="primary">
保存
</button>
</view>

View File

@ -1,19 +1,55 @@
// pages/address/list.js
Page({
data:{},
onLoad:function(options){
data: {
list: [
{
"addr_id": "170",
"user_id": "4",
"city_id": "330300",
"district_id": null,
"addr": "龙华大厦",
"detail": "",
"longitude": "120.69101",
"latitude": "28.002974",
"receiver": "test4",
"phone": "13000000005",
"create_time": "2017-02-20 10:38:11",
"delete": "0",
"district_name": "",
"city_name": "温州市"
},
{
"addr_id": "160",
"user_id": "4",
"city_id": "330300",
"district_id": null,
"addr": "电商大厦",
"detail": "",
"longitude": "120.737561",
"latitude": "27.979617",
"receiver": "test4",
"phone": "13000000004",
"create_time": "2016-12-16 13:37:10",
"delete": "0",
"district_name": "",
"city_name": "温州市"
}
]
},
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
},
onReady:function(){
onReady: function () {
// 页面渲染完成
},
onShow:function(){
onShow: function () {
// 页面显示
},
onHide:function(){
onHide: function () {
// 页面隐藏
},
onUnload:function(){
onUnload: function () {
// 页面关闭
}
})

View File

@ -1 +1,3 @@
{}
{
"navigationBarTitleText": "我的地址"
}

View File

@ -1,2 +1,26 @@
<!--pages/address/list.wxml-->
<text>pages/address/list.wxml</text>
<view class="address-select">
<view class="address-select__hd">
我的地址
</view>
<view class="address__list">
<view wx:for="{{list}}" wx:key="addr_id" class="address__item">
<view class="">
{{item.receiver}} {{item.phone}}
</view>
<view class="grey-color">
{{item.addr}}
</view>
<navigator url="/pages/address/add?id={{item.addr_id}}" class="address__item-edit">
<image
class="address__item-edit-img"
src="/images/address_edit_white.png">
</image>
</navigator>
</view>
</view>
</view>
<navigator class="address-add-btn" url="/pages/address/add">
新增地址
</navigator>

View File

@ -1 +1,2 @@
/* pages/address/list.wxss */
@import 'select.wxss';

View File

@ -1,19 +1,56 @@
// pages/address/select.js
Page({
data:{},
onLoad:function(options){
data: {
selectedId: 170,
list: [
{
"addr_id": "170",
"user_id": "4",
"city_id": "330300",
"district_id": null,
"addr": "龙华大厦",
"detail": "",
"longitude": "120.69101",
"latitude": "28.002974",
"receiver": "test4",
"phone": "13000000005",
"create_time": "2017-02-20 10:38:11",
"delete": "0",
"district_name": "",
"city_name": "温州市"
},
{
"addr_id": "160",
"user_id": "4",
"city_id": "330300",
"district_id": null,
"addr": "电商大厦",
"detail": "",
"longitude": "120.737561",
"latitude": "27.979617",
"receiver": "test4",
"phone": "13000000004",
"create_time": "2016-12-16 13:37:10",
"delete": "0",
"district_name": "",
"city_name": "温州市"
}
]
},
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
},
onReady:function(){
onReady: function () {
// 页面渲染完成
},
onShow:function(){
onShow: function () {
// 页面显示
},
onHide:function(){
onHide: function () {
// 页面隐藏
},
onUnload:function(){
onUnload: function () {
// 页面关闭
}
})

View File

@ -1 +1,3 @@
{}
{
"navigationBarTitleText": "收货地址"
}

View File

@ -1,2 +1,28 @@
<!--pages/address/select.wxml-->
<text>pages/address/select.wxml</text>
<view class="address-select">
<view class="address-select__hd">
可选收货地址
</view>
<view class="address__list">
<view wx:for="{{list}}" wx:key="addr_id" class="address__item">
<image wx:if="{{selectedId == item.addr_id}}" class="address__item-selected-img" src="/images/address_list_selected.png"></image>
<view class="">
{{item.receiver}} {{item.phone}}
</view>
<view class="grey-color">
{{item.addr}}
</view>
<navigator url="/pages/address/add?id={{item.addr_id}}" class="address__item-edit">
<image
class="address__item-edit-img"
src="/images/address_edit_white.png">
</image>
</navigator>
</view>
</view>
</view>
<navigator class="address-add-btn" url="/pages/address/add">
新增地址
</navigator>

View File

@ -1 +1,54 @@
/* pages/address/select.wxss */
page {
padding-bottom: 50px;
}
.address-select__hd {
padding: 5px 15px;
font-size: 14px;
color: #999;
border-bottom: 1rpx solid #e8e8e8;
}
.address__list {
background-color: #fff;
}
.address__item {
position: relative;
padding: 10px 15px;
border-bottom: 1rpx solid #e8e8e8;
}
.address__item-selected-img {
position: absolute;
top: 0;
left: 0;
width: 29px;
height: 28px;
}
.address__item-edit {
position: absolute;
right: 15px;
top: 50%;
padding: 5px 10px;
transform: translateY(-50%);
}
.address__item-edit-img {
width: 20px;
height: 20px;
}
.address-add-btn {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 50px;
line-height: 50px;
text-align: center;
color: #fff;
background-color: #ff5801;
}

View File

@ -3,7 +3,7 @@
<!--index.wxml-->
<view class="topbar">
<view class="address trangle">
<image class="address__icon" src="/images/map-marker.png"></image>
<image class="address__icon" src="/images/location.png"></image>
电商大厦电商大厦(兴区路)
</view>
<view class="search">

View File

@ -24,6 +24,7 @@
}
.address__icon {
margin-top: -2px;
width: 24px;
height: 24px;
vertical-align: middle;

View File

@ -0,0 +1,9 @@
export const ORDER_STATES = {
"1": '订单待支付',
"2": '等待商家接单',
"3": '订单进行中',
"4": '订单已完成',
"5": '订单已取消',
"6": '退款中',
"7": '已退款'
}

View File

@ -1,19 +1,104 @@
// pages/order/list.js
import { ORDER_STATES } from './constant'
Page({
data:{},
onLoad:function(options){
data: {
login: true,
ORDER_STATES,
list: [
{
"order_id": "1370",
"order_no": "2017042815510158201158862546",
"seller_id": "2",
"seller_name": "鲜极道",
"title": "鸡腿饭(大)",
"add_time": "1493365861",
"order_price": "42.98",
"pay_price": "34.98",
"state": "1",
"is_reviews": "0",
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller_goods/1461034075146103407535640.jpg"
},
{
"order_id": "1347",
"order_no": "2017040708540884666377388205",
"seller_id": "2",
"seller_name": "鲜极道",
"title": "鸡翅饭",
"add_time": "1491526448",
"order_price": "36.00",
"pay_price": "28.00",
"state": "4",
"is_reviews": "0",
"pic_url": "http://mtest.ipaotui.com/"
},
{
"order_id": "1345",
"order_no": "2017033115480943749489684006",
"seller_id": "2",
"seller_name": "鲜极道",
"title": "香肠饭 等2件商品",
"add_time": "1490946489",
"order_price": "48.00",
"pay_price": "39.00",
"state": "5",
"is_reviews": "0",
"pic_url": "http://mtest.ipaotui.com/"
},
{
"order_id": "1344",
"order_no": "2017033016225869845172165968",
"seller_id": "2",
"seller_name": "鲜极道",
"title": "鸡翅饭",
"add_time": "1490862178",
"order_price": "36.00",
"pay_price": "26.00",
"state": "5",
"is_reviews": "0",
"pic_url": "http://mtest.ipaotui.com/"
},
{
"order_id": "1343",
"order_no": "2017033016045232046206634491",
"seller_id": "2",
"seller_name": "鲜极道",
"title": "鸡翅饭",
"add_time": "1490861092",
"order_price": "36.00",
"pay_price": "25.00",
"state": "5",
"is_reviews": "0",
"pic_url": "http://mtest.ipaotui.com/"
},
{
"order_id": "1342",
"order_no": "2017033014434386598425245711",
"seller_id": "2",
"seller_name": "鲜极道",
"title": "鸡腿饭",
"add_time": "1490856223",
"order_price": "40.98",
"pay_price": "30.98",
"state": "5",
"is_reviews": "0",
"pic_url": "http://mtest.ipaotui.com/Uploadfile/Img/seller_goods/1461034075146103407535640.jpg"
},
]
},
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
},
onReady:function(){
onReady: function () {
// 页面渲染完成
},
onShow:function(){
onShow: function () {
// 页面显示
},
onHide:function(){
onHide: function () {
// 页面隐藏
},
onUnload:function(){
onUnload: function () {
// 页面关闭
}
})

View File

@ -1,10 +1,31 @@
<!--pages/order/list.wxml-->
<view wx:if="{{login}}" class="order-list"></view>
<view wx:else class="order-logout">
<image class="order-logout__bg" src="/images/order-logout@2x.png"></image>
<view class="order-logout__tip">
您还没有登录, 登录后查看订单
<view wx:if="{{login}}" class="order-list">
<view class="order-item" wx:for="{{list}}" wx:key="order_id">
<view class="order-item__hd">
<navigator class="order-item__shop trangle" url="/pages/shop/show?id={{item.seller_id}}">
{{item.seller_name}}
</navigator>
<view class="order-item__status {{item.state==1? 'order-item__status_pay': ''}}">{{ORDER_STATES[item.state]}}</view>
</view>
<navigator url="url" class="weui-btn weui-btn_primary weui-btn_mini" hover-class="button-hover">登录</navigator>
<navigator url="/pages/order/show?id={{item.order_id}}" class="order-item__bd ">
<image class="order-item__pic" src="{{item.pic_url}}"></image>
<view class="order-item__content weui-cell__ft_in-access">
<view class="order-item__price">¥{{item.pay_price}}</view>
<view class="">{{item.add_time}}</view>
</view>
</navigator>
<view wx:if="{{item.state == 1 || item.state == 4}}" class="order-item__ft">
<button wx:if="{{item.state == 1}}" class="weui-btn_primary weui-btn_mini">立即付款</button>
<navigator wx:else url="url" class="weui-btn_primary weui-btn_mini">去评论</navigator>
</view>
</view>
</view>
<view wx:else class="order-logout">
<image class="order-logout__bg" src="/images/order-logout@2x.png"></image>
<view class="order-logout__tip">
您还没有登录, 登录后查看订单
</view>
<navigator url="url" class="weui-btn weui-btn_primary weui-btn_mini" hover-class="button-hover">登录</navigator>
</view>

View File

@ -1,15 +1,74 @@
/* pages/order/list.wxss */
.order-logout {
text-align: center;
text-align: center;
}
.order-logout__bg {
margin-top: 100px;
width: 176px;
height: 126px;
margin-top: 100px;
width: 176px;
height: 126px;
}
.order-logout__tip {
margin-top: 10px;
margin-top: 10px;
}
/* order-list */
.order-item {
margin-top: 10px;
background-color: #fff;
border-top: 1rpx solid #e8e8e8;
border-bottom: 1rpx solid #e8e8e8;
}
.order-item__hd {
margin-left: 15px;
padding: 5px 15px 5px 0;
border-bottom: 1rpx solid #e8e8e8;
overflow: hidden;
}
.order-item__shop {
position: relative;
float: left;
color: #000;
}
.order-item__status {
float: right;
color: #999;
font-size: 14px;
}
.order-item__status_pay {
color: #ff5801;
}
.order-item__bd {
display: flex;
padding: 10px 15px;
}
.order-item__ft {
margin-left: 15px;
padding: 5px 15px 5px 0;
text-align: right;
border-top: 1rpx solid #e8e8e8;
}
.order-item__content {
position: relative;
flex: 1;
}
.order-item__pic {
margin-right: 10px;
height: 60px;
width: 60px;
}
.order-item__price {
font-size: 1.2em;
color: #ff5801;
}

View File

@ -1,19 +1,76 @@
// pages/order/quasi.js
Page({
data:{},
onLoad:function(options){
data: {
info: {
"quasi_order_id": "2691",
"order_no": "2017042716455369061206686592",
"seller_id": "2",
"user_id": "4",
"state": "0",
"add_time": "1493282753",
"order_price": "42.98",
"pay_price": "34.98",
"goods_price": "22.98",
"cut_money": "8.00",
"coupon_money": "0.00",
"packing_fee": "2.00",
"delivery_fee": "18.00",
"receiver": "test4",
"receiver_addr": "龙华大厦",
"receiver_gps": "120.69101,28.002974",
"receiver_phone": "13000000005",
"receive_time": null,
"distance": "7.177",
"remark": null,
"is_reviews": "0",
"is_delete": "0",
"delivery_order_id": "0",
"title": "鸡腿饭(大)",
"receiver_city": "330300",
"commision": "0.00",
"user_coupon_id": null,
"coupon_type": null,
"real_delivery_fee": "18.00",
"cut_delivery_fee": "0.00",
"service_money": "0.00",
"seller_name": "鲜极道",
"seller_phone": "88888888",
"goods": [
{
"goods_id": "29",
"sub_id": "50",
"seller_id": "2",
"detail": "鸡腿饭 xx",
"sales": "46",
"praise": "0",
"state": "1",
"commision": "3.00",
"goods_name": "鸡腿饭(大)",
"price": "22.98",
"packing_fee": "2.00",
"stock": "74",
"is_delete": "0",
"pic_url": "http://test.storesystem.cn/Uploadfile/Img/seller_goods/1461034075146103407535640.jpg",
"num": "1",
"price_sum": "22.98"
}
]
},
},
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
},
onReady:function(){
onReady: function () {
// 页面渲染完成
},
onShow:function(){
onShow: function () {
// 页面显示
},
onHide:function(){
onHide: function () {
// 页面隐藏
},
onUnload:function(){
onUnload: function () {
// 页面关闭
}
})

View File

@ -1 +1,3 @@
{}
{
"navigationBarTitleText": "提交订单"
}

View File

@ -1,2 +1,82 @@
<!--pages/order/quasi.wxml-->
<text>pages/order/quasi.wxml</text>
<view class="quasi">
<view class="weui-panel weui-panel_address ">
<view class="weui-panel__bd ">
<navigator url class="weui-media-box weui-media-box_text weui-cell__ft_in-access weui-media-box_address">
<view class="weui-media-box__title weui-media-box__title_in-text">{{info.receiver}} {{info.receiver_phone}}</view>
<view class="weui-media-box__desc">
{{info.receiver_addr}}
</view>
</navigator>
</view>
</view>
<view class="weui-cells">
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd">支付方式</view>
<view class="">在线支付</view>
</view>
<navigator url="" wx:if="{{info.coupon_money > 0}}" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
<view class="weui-cell__bd">红包</view>
<view class="weui-cell__ft_in-access">¥{{info.coupon_money}}</view>
</navigator>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd">红包</view>
<view class="weui-cell__ft">暂无可用</view>
</view>
</view>
<view class="quasi-goods">
<view class="quasi-goods__hd">
<image class="quasi-goods__img" src="/images/Shop-icon.png"></image>
{{info.seller_name}}
</view>
<view class="quasi-goods__bd">
<view class="quasi-goods__list">
<view wx:for="{{info.goods}}" wx:key="{{index}}" class="quasi-goods__item">
<view class="quasi-goods__item-name">{{item.goods_name}}</view>
<view class="quasi-goods__item-num">x{{item.num}}</view>
<view class="quasi-goods__item-price">¥{{item.price_sum}}</view>
</view>
</view>
<view class="quasi-goods__list">
<view class="quasi-goods__item">
<view class="quasi-goods__item-name">餐盒费</view>
<view class="quasi-goods__item-num"></view>
<view class="quasi-goods__item-price">¥{{info.packing_fee}}</view>
</view>
<view class="quasi-goods__item">
<view class="quasi-goods__item-name">配送费</view>
<view class="quasi-goods__item-num"></view>
<view class="quasi-goods__item-price">¥{{info.delivery_fee}}</view>
</view>
</view>
<view class="quasi-goods__list">
<view class="quasi-goods__item">
<view class="quasi-goods__item-name quasi-goods__item-name_grey">商城优惠</view>
<view class="quasi-goods__item-num"></view>
<view class="quasi-goods__item-price">-¥{{info.cut_money}}</view>
</view>
</view>
<view class="quasi-goods__list">
<view class="quasi-goods__item">
<view class="quasi-goods__item-name quasi-goods__item-name_grey">
总计¥{{info.order_price}} 优惠¥{{info.cut_money}}
</view>
<view class="quasi-goods__item-num"></view>
<view class="quasi-goods__item-price">实付
<text class="primary-color">¥{{info.pay_price}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="quasi-actions">
<view class="quasi-actions__cut">已优惠¥{{info.cut_money}}</view>
<view class="quasi-actions__pay">
待支付 <text class="primary-color">¥{{info.pay_price}}</text>
</view>
<button class="weui-btn menu-cart__btn" type="primary" >
提交订单
</button>
</view>

View File

@ -1 +1,91 @@
/* pages/order/quasi.wxss */
.quasi {
padding-bottom: 50px;
}
.weui-media-box_address::after {
right: 15px;
}
/* quasi-goods */
.quasi-goods {
margin-top: 10px;
background-color: #fff;
border-top: 1rpx solid #e8e8e8;
border-bottom: 1rpx solid #e8e8e8;
}
.quasi-goods__hd {
margin-left: 10px;
padding: 10px 10px 10px 0;
color: #999;
border-bottom: 1rpx solid #e8e8e8;
}
.quasi-goods__img {
margin-top: -2px;
width: 20px;
height: 20px;
vertical-align: middle;
}
.quasi-goods__list {
margin-left: 10px;
}
.quasi-goods__list:not(:last-child) {
border-bottom: 1rpx solid #e8e8e8;
}
.quasi-goods__item {
display: flex;
padding: 10px 10px 10px 0;
}
.quasi-goods__item-name {
flex: 2;
}
.quasi-goods__item-name_grey {
color: #999;
}
.quasi-goods__item-num {
flex: 1;
color: #999;
}
/* quasi-action*/
.quasi-actions {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
height: 50px;
padding-left: 10px;
background-color: #fff;
align-items: center;
}
.quasi-actions__cut {
flex: 1;
}
.quasi-actions__pay {
margin-right: 10px;
}
.menu-cart__btn[type=primary] {
margin: 0;
height: 50px;
min-width: 100px;
font-size: 16px;
line-height: 50px;
border: none;
border-radius: 0;
}
.menu-cart__btn::after {
content: none;
}

View File

@ -1,4 +1,4 @@
<!--pages/order/show.wxml-->
<view class="header weui-flex">
<image src="src"></image>
test
</view>