Explorar el Código

加价 排序

shish hace 3 años
padre
commit
08247cff02

+ 2 - 1
ghsApp/src/admin/home/apply.vue

@@ -36,7 +36,8 @@ export default {
                         {name: "花材",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/item/list"},
                         {name: "分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/list"},
                         {name: "批量改分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/changeClass"},
-                        {name: "加价排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
+                        {name: "加价",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
+                        {name: "排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},
                         {name: "已下架",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/outList"},
                         {name: "已停用",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/stopList"},
                         {name: "已删除",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/removeList"}

+ 2 - 3
ghsApp/src/admin/itemClass/add.vue

@@ -4,12 +4,11 @@
 			<block v-if="!$util.isEmpty(list.data)">
 				<div class="list" v-for="(item, index) in list.data" :key="index">
 					<div class="list-index">{{ item.id }}</div>
-					<div class="list-det">
+					<div class="list-det" @click.stop="pageTo('/admin/itemClass/addPrice?classId='+item.id)">
 						<div class="app-size-28 app-color-0">{{ item.name || '' }}</div>
 						<div class="list-operate">
 							<text class="add-price"></text>
-							<text class="add-price" @click.stop="pageTo('/admin/itemClass/addPrice?classId='+item.id)">加价设置</text>
-							<text class="add-price" @click.stop="pageTo('/admin/itemClass/more?classId='+item.id)">排序设置</text>
+							<text class="add-price">加价设置</text>
 						</div>
 					</div>
 				</div>

+ 159 - 0
ghsApp/src/admin/itemClass/sort.vue

@@ -0,0 +1,159 @@
+<template>
+	<div class="app-content" @click="globalClick">
+		<div class="list-wrap">
+			<block v-if="!$util.isEmpty(list.data)">
+				<div class="list" v-for="(item, index) in list.data" :key="index">
+					<div class="list-index">{{ item.id }}</div>
+					<div class="list-det" @click.stop="pageTo('/admin/itemClass/more?classId='+item.id)">
+						<div class="app-size-28 app-color-0">{{ item.name || '' }}</div>
+						<div class="list-operate">
+							<text class="add-price"></text>
+							<text class="add-price">排序设置</text>
+						</div>
+					</div>
+				</div>
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+			</block>
+		</div>
+	</div>
+</template>
+<script>
+import ModalModule from '@/components/plugin/modal'
+import AppUploader from '@/components/app-uploader'
+import OperateModule from '@/admin/home/components/module/operate'
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import { list } from '@/mixins'
+import { getList} from '@/api/item-class'
+export default {
+	name: 'add',
+	components: {
+		ModalModule,
+		AppUploader,
+		OperateModule,
+		AppWrapperEmpty
+	},
+	mixins: [list],
+	data() {
+		return {
+			modifyModal: false,
+			modifyTitle: '添加',
+			replaceForm: {
+				name: '',
+				id:0,
+				inTurn: 100
+			},
+			delModal: false,
+			operateShow: false,
+			operateData: {},
+			operateIndex: null,
+			operateTop: 0
+		}
+	},
+	onPullDownRefresh() {
+		this.resetList()
+		this._list().then(res => {
+			uni.stopPullDownRefresh()
+		})
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this._list().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	onLoad() {
+	},
+	methods: {
+		async init() {
+			this._list()
+		},
+		_list() {
+			return getList({page: this.list.page}).then(res => {
+				this.completes(res)
+			})
+		}
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+	.app-content {
+		min-height: calc(100vh - 100upx);
+		padding-bottom: 100upx;
+	}
+	.list-wrap {
+		position: relative;
+		background-color: #fff;
+		.list {
+			height: 130upx;
+			@include disFlex(center, flex-start);
+			margin: 0 30upx 0 30upx;
+			color: $fontColor3;
+			border-bottom: 1upx solid $borderColor;
+			.list-index {
+				width: 80upx;
+			}
+			.list-img {
+				img {
+					height: 100%;
+				}
+			}
+			.list-det {
+				width: calc(100% - 50upx);
+				margin-left: 10upx;
+				& > div {
+					margin-top: 14upx;
+					&:first-child {
+						margin-top: 0;
+					}
+				}
+				.list-operate {
+					@include disFlex(center, space-between);
+					.operate-det {
+						& > span {
+							margin-left: 60upx;
+							&:first-child {
+								margin-left: 0;
+							}
+						}
+					}
+					.add-price{
+						text-decoration:underline;
+						font-size:30upx;
+						margin-left:10upx;
+					}
+					.operate-icon{
+						margin-left:30upx;
+					}
+				}
+			}
+		}
+	}
+	.app-footer {
+		justify-content: flex-end;
+		.admin-button-com {
+			width: 200upx;
+			margin-right: 30upx;
+		}
+	}
+	.modify-modal {
+		.prompt-text {
+			color: red;
+			position: relative;
+			right: 52upx;
+			bottom: 24upx;
+		}
+		.line-label {
+			width: 140upx;
+			flex-shrink: 0;
+		}
+		.switch-wrap {
+			margin-top: 30upx;
+		}
+	}
+</style>

+ 2 - 1
ghsApp/src/pages.json

@@ -391,7 +391,8 @@
 			"root": "admin/itemClass",
 			"pages": [
 				{"path": "list","style": {"navigationBarTitleText": "花材分类"}},
-				{"path": "add","style": {"navigationBarTitleText": "加价排序"}},
+				{"path": "add","style": {"navigationBarTitleText": "加价管理"}},
+				{"path": "sort","style": {"navigationBarTitleText": "排序管理"}},
 				{"path": "addPrice","style": {"navigationBarTitleText": "加价设置"}},
 				{"path": "more","style": {"navigationBarTitleText": "更多"}}
 			]