liujd 6 лет назад
Родитель
Сommit
34f9d53ca1

+ 8 - 1
mobile-code/src/api/order/index.js

@@ -41,5 +41,12 @@ export const fastPay = data => {
  * 订单列表 b
  */
 export const getListB = data => {
-	return https.post('/order/list', data)
+	return https.get('/order/list', data)
+}
+
+/** *
+ * 订单详情 b
+ */
+export const getDetB = data => {
+	return https.get('/order/detail', data)
 }

+ 28 - 1
mobile-code/src/filters/constant.js

@@ -30,7 +30,7 @@ const _CONST_MAP = {
 			value: 2
 		}
 	],
-	// 优惠券
+	// 代理状态
 	PROXY_STATUS: [
 		{
 			label: '审核中',
@@ -52,6 +52,33 @@ const _CONST_MAP = {
 			label: '已到期',
 			value: 4
 		}
+	],
+	// 订单状态
+	ORDER_STATUS: [
+		{
+			label: '待付款',
+			value: 0
+		},
+		{
+			label: '待配送',
+			value: 1
+		},
+		{
+			label: '配送中',
+			value: 2
+		},
+		{
+			label: '待通知',
+			value: 3
+		},
+		{
+			label: '已取消',
+			value: 4
+		},
+		{
+			label: '已完成',
+			value: 4
+		}
 	]
 }
 

+ 11 - 0
mobile-code/src/pages.json

@@ -240,6 +240,17 @@
 					}
 				}
 			]
+		},
+		{
+			"root": "pages/template",
+			"pages": [
+				{
+					"path": "index",
+					"style": {
+						"navigationBarTitleText": "选择模板"
+					}
+				}
+			]
 		}
 	],
 	"globalStyle": {

+ 100 - 44
mobile-code/src/pages/admin/order.vue

@@ -1,24 +1,40 @@
 <template>
 	<div class="app-main app-content">
 		<app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" :height="100" @change="change" itemWidth="20%" />
-		<div class="list-wrap" v-for="(item, index) in 4" :key="index" @click="$util.pageTo('/pages/order/admin/detail')">
-			<div class="list-top flex-center-between">
-				<div class="app-color-3">订单编号:3261515151</div>
-				<div class="app-price">等待支付</div>
-			</div>
-			<div class="list-blo">
-				<list-module v-for="(item, subIndex) in 2" :key="subIndex" />
-			</div>
-			<div class="list-bottom">
-				<div>
-					<span class="freight-text">运费:¥50</span>
-					<span>应付金额:</span>
-					<span class="app-size-30 app-bold">¥580.00</span>
+		<div class="list-wrap">
+			<block v-if="!$util.isEmpty(list.data)">
+				<div class="list" v-for="(item, index) in list.data" :key="index" @click="$util.pageTo({
+					url: '/pages/order/admin/detail',
+					id: item.id
+				})">
+					<div class="list-top flex-center-between">
+						<div class="app-color-3">订单编号:{{ item.sendNum }}</div>
+						<div class="app-price">{{ item.status | constantfilter('ORDER_STATUS') }}</div>
+					</div>
+					<div class="list-blo">
+						<list-module v-for="(item, subIndex) in 2" :key="subIndex" />
+					</div>
+					<div class="list-bottom">
+						<div>
+							<span class="freight-text">运费:¥{{ item.sendCost }}</span>
+							<span>应付金额:</span>
+							<span class="app-size-30 app-bold">¥{{ item.actPrice }}</span>
+						</div>
+						<div class="list-button">
+							<!-- 待配送 -->
+							<div v-if="item.status == 2" class="admin-button-com">免发货</div>
+							<div v-if="item.status == 2" class="admin-button-com">发货</div>
+							<!-- 配送中 -->
+							<div v-if="item.status == 2" class="admin-button-com">继续</div>
+							<!-- 已完成 -->
+							<div v-if="item.status == 5" class="admin-button-com default">查看快递</div>
+						</div>
+					</div>
 				</div>
-				<div class="list-button">
-					<div class="admin-button-com default">发货管理</div>
-				</div>
-			</div>
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+			</block>
 		</div>
 	</div>
 </template>
@@ -26,35 +42,41 @@
 <script>
 import AppTabs from '@/components/plugin/tabs'
 import ListModule from '@/components/module/app-order-list'
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import { list } from '@/mixins'
+// api
+import { getListB } from '@/api/order'
 export default {
 	name: 'order-list',
 	components: {
 		ListModule,
-		AppTabs
+		AppTabs,
+		AppWrapperEmpty
 	},
+	mixins: [list],
 	data() {
 		return {
 			tabIndex: 0,
 			tabs: [
 				{
 					name: '全部',
-					value: 212
+					value: 0
 				},
 				{
 					name: '待付款',
-					value: 213
+					value: 0
 				},
 				{
 					name: '待配送',
-					value: 214
+					value: 0
 				},
 				{
 					name: '配送中',
-					value: 215
+					value: 0
 				},
 				{
 					name: '已完结',
-					value: 216
+					value: 0
 				}
 			]
 		}
@@ -66,9 +88,38 @@ export default {
 	onReachBottom() {
 		console.log('5151')
 	},
+	onLoad: function() {
+		this.init()
+	},
 	methods: {
+		async init() {
+			this._list()
+		},
+		_list() {
+			let status = JSON.parse(JSON.stringify(this.tabIndex))
+			status = status == 4 ? 5 : status - 1
+			return getListB({
+				status: status,
+				search: '',
+				page: this.list.page
+			 }).then(res => {
+				this.completes(res)
+				if (this.$util.isEmpty(res.data)) return false
+				this.tabs[0].value = res.data.asset.totalOrder
+				this.tabs[1].value = res.data.asset.unPayOrder
+				this.tabs[2].value = res.data.asset.unSendOrder
+				this.tabs[3].value = res.data.asset.sendingOrder
+				this.tabs[4].value = res.data.asset.finishOrder
+			})
+		},
 		change(e) {
-			this.tabIndex = e.index
+			if (this.tabIndex == e.index) {
+				return false
+			} else {
+				this.tabIndex = e.index
+				this.resetList()
+				this._list()
+			}
 		}
 	}
 }
@@ -82,27 +133,32 @@ export default {
 		padding-top: 120px;
 		padding-bottom: 1px;
 		.list-wrap {
-			padding: 0 30px;
-			background-color: #fff;
-			margin-bottom: 20px;
-			.list-top,
-			.list-bottom {
-				padding: 26px 0;
-				border-bottom: 1px solid $borderColor;
-				color: $fontColor3;
-				.app-bold {
-					color: #333;
-				}
-				.freight-text {
-					margin-right: 60px;
-				}
-			}
-			.list-bottom {
-				& > div {
-					@include disFlex(center, flex-end);
+			.list {
+				padding: 0 30px;
+				background-color: #fff;
+				margin-bottom: 20px;
+				.list-top,
+				.list-bottom {
+					padding: 26px 0;
+					border-bottom: 1px solid $borderColor;
+					color: $fontColor3;
+					.app-bold {
+						color: #333;
+					}
+					.freight-text {
+						margin-right: 60px;
+					}
 				}
-				.list-button {
-					margin-top: 26px;
+				.list-bottom {
+					& > div {
+						@include disFlex(center, flex-end);
+					}
+					.list-button {
+						margin-top: 26px;
+						.admin-button-com {
+							margin-left: 20px;
+						}
+					}
 				}
 			}
 		}

+ 21 - 0
mobile-code/src/pages/order/admin/detail.vue

@@ -135,11 +135,32 @@
 <script>
 import ListModule from '@/components/module/app-order-list'
 import AppCoupon from '@/components/app-coupon-sel'
+// api
+import { getDetB } from '@/api/order'
 export default {
 	name: 'order-detail',
 	components: {
 		ListModule,
 		AppCoupon
+	},
+	data() {
+		return {
+			data: {}
+		}
+	},
+	onLoad() {
+		this.init()
+	},
+	methods: {
+		init() {
+			this._getDet()
+		},
+		_getDet() {
+			return getDetB({ id: this.option.id }).then(res => {
+				console.log(res)
+				this.data = res.data
+			})
+		}
 	}
 }
 </script>

+ 15 - 1
mobile-code/src/pages/order/list.vue

@@ -21,13 +21,16 @@
 
 <script>
 import ListModule from '@/components/module/app-order-list'
+// api
+import { getListB } from '@/api/order'
 export default {
 	name: 'order-list',
 	components: {
 		ListModule
 	},
 	data() {
-		return {}
+		return {
+		}
 	},
 	onPullDownRefresh() {
 		console.log('fasdfasdf')
@@ -36,7 +39,18 @@ export default {
 	onReachBottom() {
 		console.log('5151')
 	},
+	onLoad: function() {
+		this.init()
+	},
 	methods: {
+		async init() {
+			this._list()
+		},
+		_list() {
+			return getList({ status: this.tabIndex }).then(res => {
+				this.completes(res)
+			})
+		}
 	}
 }
 </script>

+ 69 - 0
mobile-code/src/pages/template/index.vue

@@ -0,0 +1,69 @@
+<template>
+	<div class="app-content">
+		<div class="title">
+			<span>请选择你喜欢的</span>
+			<span class="app-price">商城风格</span>
+		</div>
+		<radio-group class="radio-group" name="template" @change="checkChange">
+			<div class="list-wrap">
+				<label class="list">
+					<div class="list-img">
+						<img src="../../static/images/template/1.png" alt mode="widthFix" />
+					</div>
+					<div class="list-bottom">
+						<div>基础模板</div>
+						<div>
+							<radio value="1" :checked="memberCheck" />
+						</div>
+					</div>
+				</label>
+				<label class="list">
+					<div class="list-img">
+						<img src="../../static/images/template/1.png" alt mode="widthFix" />
+					</div>
+					<div class="list-bottom">
+						<div>分类定制模板</div>
+						<div>
+							<radio value="1" :checked="memberCheck" />
+						</div>
+					</div>
+				</label>
+			</div>
+		</radio-group>
+	</div>
+</template>
+
+<script>
+export default {
+	name: 'sel-template',
+	data() {
+		return {}
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+    .title {
+        text-align: center;
+        font-size: 30px;
+        padding-top: 44px;
+        padding-bottom: 54px;
+    }
+	// list
+	.list-wrap {
+        @include disFlex(center, space-between);
+        padding: 0 20px;
+		.list {
+            width: 48%;
+            box-shadow: 6px 6px 20px #eee;
+            border-radius: 10px;
+            background-color: #fff;
+            padding-right: 0;
+            .list-bottom {
+                @include disFlex(center, space-between);
+                padding: 40px 20px;
+                font-size: 28px;
+            }
+		}
+	}
+</style>

BIN
mobile-code/src/static/images/template/1.png


BIN
mobile-code/src/static/images/template/2.png