Skip to content

Commit

Permalink
Merge branch 'v2' of github.com:mojisrc/fashop-admin into v2
Browse files Browse the repository at this point in the history
* 'v2' of github.com:mojisrc/fashop-admin:
  fix: 订单列表
  feat: 添加了拼团订单列表、拼团详情  ✨​
  feat: 图片标题限制行数 💄
  fix: 修复图片选种样式 🎨
  feat: 我的图库 ✨​
  feat: 拼团订单详情 ✨​
  fix: meta 标签 warn fix
  • Loading branch information
hanwenbo committed Jan 18, 2019
2 parents 09c78be + 67195ad commit 30a0909
Show file tree
Hide file tree
Showing 16 changed files with 615 additions and 133 deletions.
59 changes: 59 additions & 0 deletions src/components/order/detail/groupInfo/basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React, { Component } from "react";

import styles from "./index.css";
import { View } from "@/components/flexView";
import InfoRow from "@/components/public/info/infoRow";
import moment from 'moment'

export default class OrderDetailBasicInfo extends Component{
render() {
const { sn, create_time, state, trade_no, payment_code } = this.props
return (
<View className={styles.infoWarp}>
<p className={styles.infoTitle}>基本信息</p>
<InfoRow
infoList={[
{
title: '团编号',
info: sn,
},
{
title: '拼团状态',
info: moment(create_time, 'X').format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '拼团时限',
info: sn,
},
{
title: '参团人数',
info: trade_no,
},
{
title: '已参人数',
info: payment_code,
},
{
title: '限参件数',
info: payment_code,
},
{
title: '每人限参',
info: payment_code,
},
]}
/>
</View>
);
}
getPayName(payment_code){
switch (payment_code) {
case 'wechat_mini':
return '微信小程序支付'
case 'alipay':
return '支付宝'
default:
return '-'
}
}
}
56 changes: 56 additions & 0 deletions src/components/order/detail/groupInfo/group.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React, { Component } from "react";
import { Table, Tag } from "antd";
import styles from "./index.css";
import { View } from "@/components/flexView";
import moment from "moment";

export default class OrderDetailGoodsInfo extends Component {
render() {
const { extend_order_goods } = this.props
const columns = [
{
title: '昵称',
dataIndex: 'goods_title',
}, {
title: '身份',
dataIndex: 'goods_num',
}, {
title: '参与时间',
dataIndex: 'create_time',
render: text => moment(text,'X').format('YYYY-MM-DD HH:mm:ss')
}, {
title: '拼团状态',
dataIndex: 'group_state',
}, {
title: '订单状态',
dataIndex: 'order_state',
}, {
title: '消费金额(元)',
dataIndex: 'goods_pay_price',
}, {
title: '操作',
key: 'operating',
render: (record) => <a
onClick={() => {

}}
>
订单详情
</a>
}
]

return (
<View className={styles.infoWarp}>
<p className={styles.infoTitle}>组团信息</p>
<Table
bordered
columns={columns}
dataSource={extend_order_goods}
rowKey={record => record.id}
pagination={false}
/>
</View>
);
}
}
45 changes: 45 additions & 0 deletions src/components/order/detail/groupInfo/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.infoWarp{
margin-top: 15px;
}
.infoWarp:first-child{
margin-top: 0;
}
.infoWarp:last-child{
border-bottom: 0;
}
.infoTitle{
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC';
font-weight: 600;
font-style: normal;
font-size: 16px;
color: rgba(0, 0, 0, 0.847058823529412);
line-height: 24px;
margin-bottom: 15px;
display: inline-block;
}
.infoItem{
color: rgba(0, 0, 0, 0.847058823529412);
}
.infoItem span{
color: rgba(0, 0, 0, 0.647058823529412);
}
.btnWarp{
flex-direction: row;
}
.btnWarp button{
margin-right: 24px;
}
.goodsDesc{
flex-direction: row;
align-items: center;
}
.goodsDesc img{
width: 40px;
height: 40px;
border-radius: 4px;
margin-right: 5px;
}
.tableFooter{
margin: 0;
text-align: right;
}
29 changes: 29 additions & 0 deletions src/components/order/detail/groupInfo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { Component,Fragment } from "react";
import BasicInfo from "./basic";
import GroupInfo from "./group";

export default class OrderGroupDetailInfo extends Component {
render() {
const { orderInfo } = this.props;
const { info } = orderInfo;
const { extend_order_extend, create_time, sn, trade_no, state, extend_order_goods, payment_code } = info;
const { reciver_name } = extend_order_extend;
return (
<Fragment>
<BasicInfo
sn={sn}
reciver_name={reciver_name}
create_time={create_time}
state={state}
trade_no={trade_no}
payment_code={payment_code}
/>
<GroupInfo
extend_order_goods={extend_order_goods ? extend_order_goods : []}
// extend_order_goods={[]}
/>
</Fragment>
);

}
}
8 changes: 6 additions & 2 deletions src/components/order/detail/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import React, { Component } from "react";
import OrderDetailInfo from "./info";
import OrderGroupDetailInfo from "./groupInfo";
import { View } from "@/components/flexView";

export default class OrderDetail extends Component {
render() {
const { orderInfo, history } = this.props;
const { orderInfo, history, orderGroupInfo } = this.props;
return (
<View>
{orderInfo ? <OrderDetailInfo orderInfo={orderInfo} history={history} /> : null}
{
orderInfo ? <OrderDetailInfo orderInfo={orderInfo} history={history} /> :
orderGroupInfo ? <OrderGroupDetailInfo orderInfo={orderGroupInfo} history={history} /> : null
}
</View>
);
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/public/photoGallery/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@
display: block;
padding:0;
}
.title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Loading

0 comments on commit 30a0909

Please sign in to comment.