shish 2 лет назад
Родитель
Сommit
728464d14b

+ 3 - 3
ghsApp/src/admin/home/apply.vue

@@ -46,10 +46,10 @@ export default {
                     ]
                 },
                 {
-                    title:'集合',
+                    title:'产品',
                     list:[
-                        {name: "集合列表",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/jh/list"},
-                        {name: "集合分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/jh/class"}
+                        {name: "产品列表",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/jh/list"},
+                        {name: "产品分类",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/jh/class"}
                     ]
                 },
                 {

+ 1 - 1
ghsApp/src/admin/jh/class.vue

@@ -140,7 +140,7 @@ export default {
 		},
 		delJhClass(item){
 			let that = this
-			that.$util.confirmModal({content:'确认删除?此分类的集合将移到默认分类'},() => {
+			that.$util.confirmModal({content:'确认删除?此分类的产品将移到默认分类'},() => {
 				delJhClass({id:item.id}).then(res=>{
 					if(res.code == 1){
 						that.$msg('删除成功')

+ 168 - 0
ghsApp/src/admin/jh/components/ptJhItem.vue

@@ -0,0 +1,168 @@
+<template>
+	<view class="item-cmd_bx">
+		<view class="img_bx" style="background:#EEEEEE;z-index:99;" @click="showBigCover(info.bigCover)">
+			<image :src="info.cover"></image>
+		</view>
+		<view class="cmd-info_bx">
+			<view class="tit" style="display:flex;align-items:center;">
+				{{ info.name || "" }}
+				<image v-if="info.auth == 1" :src="`${constant.imgUrl}/icon/official8.png`" mode="widthFix" 
+				style="width:42upx;height:42upx;display:inline-block;margin-left:10upx;border-radius:12upx;"></image>
+			</view>
+			<view class="kc" @click="selectItem(info)">
+				<text style="font-size:28upx;">{{info.className}}</text> 
+				<text style="margin-left:20upx;color:#735d5d;font-size:28upx;font-weight:bold;">{{info.useNum}}家在用</text>
+				
+				<text v-if="info.select == 2 && info.is_delete == 1" style="position:absolute;right:7upx;color:#1f1cc0;">恢复</text>
+
+				<text v-if="info.select == 2 && info.is_delete == 0" style="position:absolute;right:7upx;color:#1f1cc0;">查看</text>
+
+				<text v-if="info.select == 2 && info.is_delete == 1" style="color:red;float:right;margin-right:110upx;font-weight:bold;">已删除</text>
+				<text v-else-if="info.select == 2" style="color:green;float:right;margin-right:110upx;font-weight:bold;">使用中</text>
+				<text v-else style="color:green;float:right;margin-right:110upx;border:1upx solid green;padding:10upx 10upx 10upx 10upx;border-radius:5upx;">采用</text>
+			</view>
+			<view class="num-open_bx">
+				<view class="open-bx warn">
+					<text>编号 {{info.id}}</text>
+					<text style="margin-left:25upx;" v-if="info.ratioType == 0">{{info.ratio}}{{info.smallUnit}}/<text @click="changeAuth(info.id)">{{ info.bigUnit }}</text></text>
+					<text style="margin-left:25upx;" v-else>若干{{info.smallUnit}}/<text @click="changeAuth(info.id)">{{ info.bigUnit }}</text></text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import AppImg from "@/components/app-img";
+export default {
+	name: "item",
+	components: {
+		AppImg
+	},
+	props: {
+
+		isPrice: {
+			type: Boolean,
+			default: true
+		},
+		isEdit: {
+			type: Boolean,
+			default: true
+		},
+		info: {
+			required: true
+		},
+		modifyStock:{
+			type:Object
+		}
+	},
+	data() {
+		return {
+			currentStock:null,
+			hidden:0
+		};
+	},
+	mounted() {
+	},
+	watch: {
+		modifyStock:{
+			handler(){
+				if(this.modifyStock.id == this.info.id && this.modifyStock.stock != this.info.stock){
+					this.currentStock = this.modifyStock.stock
+					let that = this
+					setTimeout(function(){
+						that.hidden = that.modifyStock.hidden
+					},800)
+				}
+			},
+			deep:true
+		}
+	},
+	methods: {
+		showBigCover(url){
+			console.log(url)
+			uni.previewImage({ urls: [url] })
+		},
+		selectItem(item){
+			this.$emit("selectItem",item);
+		},
+		addEvent() {
+			this.$emit("add");
+		},
+		subtractEvent() {
+			this.$emit("subtract");
+		},
+		delEvent() {
+			this.$emit("del");
+		},
+		changeAuth(id){
+			this.$emit("modifyAuth",id)
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.item-cmd_bx {
+	position: relative;
+	margin-bottom: 10upx;
+	.img_bx {
+		height: 150upx;
+		width: 150upx;
+		position: absolute;
+		left: 0upx;
+		top: 0upx;
+		image{
+			width: 100%;
+			height: 100%;
+			border-radius:10upx;
+		}
+	}
+	.cmd-info_bx {
+		position: relative;
+		padding-left: 177upx;
+		&.active{
+			&:before{
+				content: ' ';
+				height: 22upx;
+				width: 22upx;
+				border-width: 2upx 2upx 0 0;
+				border-color: #b2b2b2;
+				border-style: solid;
+				-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+				position: absolute;
+				top: 50%;
+				margin-top: -12upx;
+				right: 30upx;
+			}
+		}
+
+		& .tit {
+			font-size: 32upx;
+			font-weight: bold;
+			color: #333333;
+			padding-top: 0upx;
+		}
+		& .kc {
+			color: #9e9d9d;
+			font-size: 28upx;
+			padding: 17upx 0 17upx;
+		}
+		& .num-open_bx {
+			display: flex;
+			align-items: center;
+			& .price {
+				font-size: 28upx;
+				color: #999999;
+				flex: 1;
+			}
+			& .open-bx {
+				color: #9e9d9d;
+				text{
+					font-size: 24upx;
+				}
+			}
+		}
+	}
+}
+</style>

+ 2 - 2
ghsApp/src/admin/jh/list.vue

@@ -6,10 +6,10 @@
                       <button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
                   </view>
                   <view class="search-bar">
-                      <app-search-module v-model="py" placeholder="这里搜索集合" @input="searchFn"/>
+                      <app-search-module v-model="py" placeholder="这里搜索产品" @input="searchFn"/>
                   </view>
                   <view style="padding:0 0upx 0 15upx;" >
-                      <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添加集合</button>
+                      <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/jh/ptJhList' })">添加产品</button>
                   </view>
               </view>
               <view class="scroll-middle_bx">

+ 285 - 0
ghsApp/src/admin/jh/ptJhList.vue

@@ -0,0 +1,285 @@
+<template>
+    <view class="app-content">
+        <view class="billing_box_bg">
+            <view class="input-wrap" style="position: fixed;z-index:99999;background-color: white;width:100%;">
+                <view class="search-bar">
+                    <app-search-module v-model="py" placeholder="这里搜索产品" @input="searchFnContrapose"/>
+                </view>
+                <view style="padding:0 0upx 0 20upx;" >
+                    <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/item/add',type:2 })">添加新产品</button>
+                </view>
+            </view>
+            <view style="position:fixed;z-index:99999;text-align:center;top:100upx;background-color:white;width:100%;height:60upx;font-size:26upx;">
+                <view style="display:flex;align-items:center;justify-content:center;margin-top:12upx;">带
+                <image :src="`${constant.imgUrl}/icon/official8.png`" mode="widthFix" 
+                    style="width:38upx;height:38upx;display:inline-block;"></image>
+                    为平台认证产品,请优先采用,用后可改名称图片</view>
+            </view>
+            <view class="scroll-middle_bx">
+                <block v-if="!$util.isEmpty(globalClassItemListContrapose)">
+                    <view scroll-y class="item_list_bx" style="width: 100%">
+                        <template v-for="(productItem, productIndex) in globalClassItemListContrapose">
+                            <view style="padding: 20upx 0">
+                            <ptJhItemInfo
+                                :isPrice="false"
+                                :key="productIndex"
+                                :info="productItem"
+                                :isEdit="true"
+                                :modifyStock="modifyStock"
+                                @selectItem="selectItem"
+                                @modifyAuth="modifyAuth"
+                            ></ptJhItemInfo>
+                            </view>
+                        </template>
+                    </view>
+                </block>
+                <block v-else>
+                    <view style="width: 100%">
+                        <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(globalClassItemListContrapose)"/></view>
+                </block>
+            </view>
+        </view>
+    </view>
+    </template>
+    <script>
+    import AppSearchModule from "@/components/module/app-search";
+    import AppWrapperEmpty from "@/components/app-wrapper-empty";
+    import ptJhItemInfo from "./components/ptJhItem";
+    import productMins from "@/mixins/product";
+    import productContraposeMins from "@/mixins/ptProductContrapose";
+    import { mapGetters } from "vuex";
+    import { getAllItemClass } from "@/api/item-class";
+    import { delStatusUpdate } from "@/api/product";
+    import { changeAuth } from "@/api/pt-item";
+    export default {
+        name: "ptItemList",
+        components: {
+            AppSearchModule,
+            AppWrapperEmpty,
+            ptJhItemInfo
+        },
+        mixins: [productMins, productContraposeMins],
+        data() {
+            return {
+                autoLoad: false,
+                selectJobType: "getPtItem",
+                tabIndex: 0,
+                modifyStock:{},
+                allClass:[],
+                form: {
+            id:0,
+            delStatus:0,
+          },
+            };
+        },
+        computed:{
+            ...mapGetters(["getMyShopInfo","getLoginInfo"]),
+        },
+        onLoad() {
+            this.ptItemInit()
+        },
+        onReachBottom(){
+            this.page++
+            this.shopId = this.getMyShopInfo.id;
+            this.initDataContrapose({ type:'waring', shopId: this.shopId,status:0,delStatus:0})
+        },
+        onShow(){
+        },
+        methods: {
+            modifyAuth(id){
+                this.$util.confirmModal({content:'?'},() => {
+                    changeAuth({id:id}).then(res=>{
+                        if(res.code == 1){
+                            this.$msg('success')
+                        }
+                    })
+                })
+            },
+            ptItemInit(){
+                this.shopId = this.getMyShopInfo.id;
+                this.initDataContrapose({ type:'waring', shopId: this.shopId,status:0,delStatus:0})
+            },
+            init() {
+                let that = this
+                getAllItemClass().then(res => {
+                    if (this.$util.isEmpty(res.data)){
+                        return false;
+                    }
+                    that.allClass = res.data
+                });
+            },
+            selectItem(item){
+                let that = this
+                if(item.select == 2 && item.is_delete == 1){
+                    that.$util.confirmModal({content:'确认恢复?'},() => {
+                        delStatusUpdate({id: item.ghs_item_id, delStatus: 0}).then(res => {
+                            uni.hideLoading()
+                            if(res.code == 1){
+                                that.$msg("恢复成功")
+                            }
+                        })
+                    })
+                }else{
+                    if(item.select == 2){
+                        this.$util.confirmModal({content:'确认查看?'},() => {
+                            this.$util.pageTo({ url: '/admin/item/detail?id='+item.ghs_item_id})
+                        })
+                        return
+                    }
+                    this.$util.confirmModal({content:'确认采用?'},() => {
+                        this.$util.pageTo({ url: '/admin/item/detail',type:2,query:{ptItemId:item.id}})
+                    })
+                }
+            },
+            affirm(val) {
+                if (val.index === 0) {
+                    this.modalCancel();
+                }
+            },
+            change(e) {
+                if (this.tabIndex == e.index) {
+                    return false;
+                } else {
+                    uni.showLoading({
+                        title: "加载中"
+                    });
+                    this.tabIndex = e.index;
+                    this.globalClassItemListContrapose = this.allFilterProductInfoContrapose;
+                    uni.hideLoading();
+                }
+            },
+            scrollTop() {},
+            initProductInfo() {
+                this.globalClassItemListContrapose = [];
+                this.page = 1;
+                this.isMore = true;
+                },
+            selectSussess(val) {
+                uni.showLoading({ title: "加载中" })
+                this.initProductInfo();
+                let type = "waring";
+                this.shopId = val.selectItem.id;
+                this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
+            }
+        }
+    };
+    </script>
+    <style lang="scss" scoped>
+    .billing_box_bg {
+        height: 100%;
+        display: flex;
+        background: white;
+        flex-direction: column;
+        .input-wrap {
+            display: flex;
+            padding: 22upx 20upx 22upx 30upx;
+            .search-bar {
+                flex: 1;
+            }
+            .city-select {
+                display: flex;
+                flex-shrink: 0;
+                align-items: center;
+                margin-right: 15upx;
+                margin-left: 45upx;
+                background-color: #ffff;
+                .iconfont {
+                    margin-left: 20upx;
+                    font-size: 30upx;
+                }
+            }
+        }
+        .scroll-middle_bx {
+            flex: 1;
+            display: flex;
+            width: 100%;
+            height: 100%;
+            overflow: hidden;
+            margin-top:155upx;
+        }
+        .tab-view {
+            height: 100%;
+            width: 170upx;
+            flex-shrink: 0;
+            background-color: #f0f2f6;
+            .tab-bar-item {
+                position: relative;
+                width: 170upx;
+                height: 90upx;
+                box-sizing: border-box;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+                font-size: 26upx;
+                color: #444;
+                font-weight: 400;
+                .tag {
+                    display: flex;
+                    padding: 0 20upx;
+                    align-items: center;
+                    position: absolute;
+                    right: 0;
+                    top: 0;
+                    height: 32upx;
+                    background: #ff2842;
+                    border-radius: 16upx;
+                    color: #fff;
+                    font-size: 20upx;
+                }
+                &:last-child{
+                    margin-bottom: 110upx;
+                }
+            }
+            .active {
+                position: relative;
+                color: $mainColor;
+                font-size: 26upx;
+                background: #fff;
+            }
+            .active::before {
+                content: "";
+                position: absolute;
+                border-left: 8upx solid $mainColor;
+                height: 100%;
+                left: 0;
+            }
+        }
+        .right-box {
+            height: 100%;
+            flex: 1;
+            box-sizing: border-box;
+        }
+        .item_list_bx {
+            padding: 10upx 40upx;
+        }
+        .item_list_title {
+            margin-bottom: 20upx;
+            font-size: 24upx;
+            font-weight: 600;
+            color: #666666;
+        }
+        .select-cmd_bx {
+            & .kc {
+                color: #999999;
+                font-size: 28upx;
+                font-weight: 400;
+                margin-bottom: 60upx;
+                text-align: center;
+                margin-top: 10upx;
+            }
+            & .num_bx {
+                display: flex;
+                align-items: center;
+                margin-bottom: 80upx;
+                & > input {
+                    width: 212upx;
+                    height: 80upx;
+                    border: 1upx solid #dddddd;
+                    border-radius: 4upx;
+                    text-align: center;
+                    margin-right: 24upx;
+                }
+            }
+        }
+    }
+    </style>

+ 1 - 1
ghsApp/src/components/mx-datepicker/mx-datepicker.vue

@@ -294,7 +294,7 @@
 				title: '初始化', //标题
 				calendars: [[],[],[]], //日历数组
 				calendarIndex: 1, //当前日历索引
-				checkeds: [], //选中的日期对象集
+				checkeds: [], //选中的日期对象集
 				showTimePicker: false, //是否显示时间选择器
 				timeValue: [0, 0, 0], //时间选择器的值
 				timeType: 'begin', //当前时间选择的类型

+ 0 - 1
ghsApp/src/mixins/cgProduct.js

@@ -864,7 +864,6 @@ export default {
 			const query = uni.createSelectorQuery().in(this); //获得实力
 			//获取多个节点方式
 			query.selectAll(".suitSelectAll").boundingClientRect(data=>{
-				// console.log(data); //得到class类名为  selectAll的数组集合
 				this.suit_top_list = data.map(item=>{
 					return Math.ceil(item.top);
 				});

+ 4 - 3
ghsApp/src/pages.json

@@ -413,9 +413,10 @@
 		{
 			"root": "admin/jh",
 			"pages": [
-				{"path": "list","style": {"navigationBarTitleText": "集合列表"}},
-				{"path": "class","style": {"navigationBarTitleText": "集合分类"}},
-				{"path": "item","style": {"navigationBarTitleText": "花材"}}
+				{"path": "list","style": {"navigationBarTitleText": "产品列表"}},
+				{"path": "class","style": {"navigationBarTitleText": "产品分类"}},
+				{"path": "item","style": {"navigationBarTitleText": "花材"}},
+				{"path": "ptJhList","style": {"navigationBarTitleText": "平台产品"}}
 			]
 		},
 		{