fuwei 5 lat temu
rodzic
commit
21d0ab924a

+ 92 - 0
ghs/src/admin/billing/components/Commodity.vue

@@ -0,0 +1,92 @@
+<template>
+    <view class="item-cmd_bx">
+        <view class="img_bx">
+            <app-img src="https://img.huaml.com/uploads/12358/202005/29/de74c55596d304b85e79154958e8bf57_small.jpeg" alt="商品图" mode="aspectFit" :height="160" />
+        </view>
+        <view class="cmd-info_bx">
+            <view class="tit">天使美人</view>
+            <view class="kc">库存1982</view>
+            <view class="num-open_bx">
+                <view class="price">¥389.50</view>
+                <view class="open-bx">
+                    <i class="iconfont icontianjiakehu"></i>
+                    <text class="num" @click="customNum">5/2</text>
+                    <i class="iconfont icontianjiakehu"></i>
+                </view>
+            </view>
+        </view>
+    
+    </view>
+</template>
+
+<script>
+    import AppImg from '@/components/app-img'
+    export default {
+        name:'Commodity',
+        components:{
+            AppImg
+        },
+        data(){
+            return {
+                
+            }
+        },
+        methods:{
+            customNum(){
+                this.$emit('customNum')
+            }
+        }
+    }
+</script>
+
+<style lang="scss" scoped>
+    .item-cmd_bx {
+        position: relative;
+        .img_bx {
+            height: 160px;
+            width: 160px;
+            position: absolute;
+            left: 0px;
+            top: 0px;
+        }
+        .cmd-info_bx {
+            padding-left: 177px;
+            & .tit {
+               font-size: 28px; 
+               font-weight: 400;
+               color: #333333;
+               padding-top: 10px;
+            }
+            & .kc {
+               color: #999999;
+               font-size: 24px;
+               padding: 8px 0 24px
+            }
+            & .num-open_bx {
+                display: flex;
+                align-items: center;
+                & .price {
+                    font-size: 28px;
+                    color: #FF2842;
+                    flex: 1;
+                }
+                & .open-bx {
+                    display: flex;
+                    align-items: center;
+                    & .iconfont {
+                        color: #3385FF;
+                        font-size: 40px;
+                    }
+                    & > .num {
+                        display: inline-block;
+                        margin: 0 8px;
+                        color: #333333;
+                        border-radius: 22px;
+                        background-color: #F5F5F5;
+                        padding: 5px 36px;
+                    }
+                }
+            }
+        }
+    }
+</style>

+ 73 - 0
ghs/src/admin/billing/components/FooterCart.vue

@@ -0,0 +1,73 @@
+<template>
+    <div class="cart-ft_bx">
+        <div class="cart-ct_bx">
+            <view class="cart-lf_bx">
+                <view class="cart-dot_bx">
+                    <i class="iconfont icontianjiakehu"></i>
+                </view>
+                <view class="price">
+                    ¥3566.88
+                </view>
+            </view>
+            <view class="cart-rg_bx">
+                选好了
+            </view>
+        </div>
+        
+    </div>
+</template>
+
+<script>
+    export default {
+        name:"FooterCart"
+    }
+</script>
+
+<style lang="scss" scoped>
+    .cart-ft_bx {
+        width: 702px;
+        height: 88px;
+        background-color: #444444;
+        position: fixed;
+        bottom: 15px;
+        border-radius: 50px;
+        left: 50%;
+        transform: translate(-50%,0);
+        z-index: 200;
+        overflow: hidden;
+        & .cart-ct_bx {
+            display: flex;
+            align-items: center;
+            height: 100%;
+            & .cart-lf_bx {
+                flex: 1;
+                display: flex;
+                align-items:center;
+                & .cart-dot_bx {
+                    width: 72px;
+                    height: 72px;
+                    border-radius: 50%;
+                    background-color: #3385FF;
+                    text-align: center;
+                    line-height: 72px;
+                    margin-left: 6px;
+                }
+                & .price {
+                    font-weight: 500;
+                    color: #FFFFFF;
+                    font-size: 36px;
+                    padding-left: 24px;
+                }
+            }
+            & .cart-rg_bx {
+                height: 100%;
+                width: 200px;
+                text-align: center;
+                font-size: 28px;
+                color: #FFFFFF;
+                background-color: #3385FF;
+                line-height: 88px;
+            }
+        }
+    }
+</style>

+ 224 - 10
ghs/src/admin/billing/index.vue

@@ -1,25 +1,99 @@
 <template>
-    <view>
+    <view class="billing_box_bg">
         <view class="input-wrap">
-			<app-search-module placeholder="请输入关键词搜索" @search="searchFn" />
+			<app-search-module 
+            placeholder="请输入关键词搜索" @search="searchFn" />
 		</view>
-        <!-- :isFixed="true" -->
-        <app-tabs :tabs="tabs"  :currentTab="tabIndex" @change="change" itemWidth="33.33%" />
+        <app-tabs 
+            :tabs="tabs"  
+            :currentTab="tabIndex" 
+            @change="change" 
+            itemWidth="33.33%" />
+        <view class="scroll-middle_bx">
+            <scroll-view
+            scroll-y
+            scroll-with-animation
+            class="tab-view"
+            :scroll-top="scrollTop"
+            >
+            <div
+            v-for="(item,index) in tabbar"
+            :key="index"
+            class="tab-bar-item"
+            :class="[currentTab==index ? 'active' : '']"
+            :data-current="index"
+            @tap.stop="swichNav($event ,item)"
+            >
+            <text>{{item.categoryName || '暂无'}}</text>
+            </div>
+            </scroll-view>
+            <block v-for="(item,index) in tabbar" :key="index">
+                <scroll-view
+                    scroll-y
+                    class="right-box"
+                    v-if="currentTab==index"
+                >
+                <view class="item_list_bx">
+                    <Commondity @customNum="customNum"></Commondity>
+                </view>
+                 
+                <!--内容部分 start -->
+                <!-- v-if="!$util.isEmpty(list.data)" -->
+                   
+                <!-- <block v-else>
+                    <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+                </block> -->
+                <!--内容部分 end -->
+                </scroll-view>
+            </block>
+        </view>
+                <!-- :maskClosable="false" -->
+        <modal-module
+            :show="isModel"
+            @cancel="modalCancel"
+            @click="affirm"
+            title="花之物语 红色系"
+            color="#333"
+            :size="32"
+            padding="30rpx 30rpx"
+        >
+        <template slot="customContent">
+            <view class="select-cmd_bx">
+                <view class="kc">
+                    库存972
+                </view>
+                <view class="num_bx">
+                    <input type="number" >扎
+                    <input type="number" style="margin-left:24upx" >支
+                </view>
+            </view>
+            
+        </template>
+    </modal-module>
+    <FooterCart></FooterCart>
     </view>
 </template>
 
 <script>
     import AppSearchModule from '@/components/module/app-search'
     import AppTabs from '@/components/plugin/tabs'
+    import AppWrapperEmpty from "@/components/app-wrapper-empty";
+    import Commondity from './components/Commodity'
+    import ModalModule from "@/components/plugin/modal";
+    import FooterCart from './components/FooterCart'
     export default {
         name: "Billing", // 开单
         components: {
          AppTabs,
-         AppSearchModule
+         AppSearchModule,
+         AppWrapperEmpty,
+         Commondity,
+         ModalModule,
+         FooterCart
 	    },
         data() {
             return {
-               tabIndex: 0,
+                tabIndex: 0,
                 tabs: [
                     {
                         name: '花材'
@@ -29,24 +103,164 @@
                     },
                     {
                         name: '课程'
-                    }
+                    },
                 ], 
+                tabbar:[
+                    {
+                        categoryName: "花束",
+                        delStatus: "0",
+                        description: "",
+                        goodsNum: "0",
+                        id: "95",
+                        img: "https://img.huaml.com",
+                        inTurn: "0",
+                        merchantId: "12358",
+                        parentId: "0",
+                        sold: "0",
+                        status: "1",
+                    },
+                    {
+                        categoryName: "花篮",
+                        delStatus: "0",
+                        description: "",
+                        goodsNum: "0",
+                        id: "96",
+                        img: "https://img.huaml.com",
+                        inTurn: "0",
+                        merchantId: "12358",
+                        parentId: "0",
+                        sold: "0",
+                        status: "1",
+                    }
+                ],
+                currentTab: 0,
+                isModel: false
             }
         },
         methods:{
-            change(){
+            //自定义数量
+            customNum(){
+                this.isModel = true
+            },
+            modalCancel(){
+                this.isModel = false
+            }, // 取消 确认
+            affirm(val){
+                if(val.index === 0) {
+                    this.modalCancel()
+                }else{
 
+                }
+            },
+            change(e){
+                if (this.tabIndex == e.index) {
+                    return false;
+                } else {
+                    this.tabIndex = e.index;
+                }
             },
             searchFn(){
 
+            },
+            scrollTop(){
+
+            },
+            swichNav(e){
+                   let cur = e.currentTarget.dataset.current;
+                    if (this.currentTab == cur) {
+                        return false;
+                    } else {
+                        this.currentTab = cur;
+                        // this.form.categoryId = item.id;
+                        // this.resetList();
+                        // this._list();
+                        // this.checkCor()
+                    }
             }
         }
     }
 </script>
 
 <style lang="scss" scoped>
-    .input-wrap {
-        padding: 22px 20px 22px 30px;
+    .billing_box_bg {
+        height: 100%;
+        display: flex;
+        flex-direction: column;
+        .input-wrap {
+            padding: 22px 20px 22px 30px;
+        }
+        .scroll-middle_bx {
+            flex: 1;
+        }
+        .tab-view {
+            height: 100%; 
+            width: 170upx;
+            position: fixed;
+            left: 0;
+            z-index: 10;
+            background-color: #f0f2f6;
+        .tab-bar-item {
+            width: 170upx;
+            height: 90upx;
+            box-sizing: border-box;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            font-size: 26upx;
+            color: #444;
+            font-weight: 400;
+        }
+
+        .active {
+            position: relative;
+            color: $mainColor;
+            font-size: 26px;
+            background: #fff;
+        }
+
+        .active::before {
+            content: "";
+            position: absolute;
+            border-left: 8upx solid $mainColor;
+            height: 100%;
+            left: 0;
+        }
+        }
+        .right-box {
+        height: 100%;
+        width: 100%;
+        position: fixed;
+        padding-left: 170upx;
+        box-sizing: border-box;
+        left: 0;
+        }
+        .item_list_bx {
+            padding: 40px 16px;
+        }
+        .select-cmd_bx {
+            & .kc {
+                color: #999999;
+                font-size: 28px;
+                font-weight: 400;
+                margin-bottom: 60px;
+                text-align: center;
+                margin-top: 10px;
+            }
+            & .num_bx {
+                display: flex;
+                align-items: center;
+                margin-bottom: 80px;
+                & > input {
+                    width: 212px;
+                    height: 80px;
+                    border: 1px solid #DDDDDD;
+                    border-radius: 4px;
+                    text-align: center;
+                    margin-right: 24px;
+                }
+            }
+        }
     }
     
+    
 </style>

+ 14 - 1
ghs/src/components/plugin/modal.vue

@@ -4,7 +4,9 @@
 			<view v-if="!custom">
 				<view class="tui-modal-title" v-if="title">{{title}}</view>
 				<!-- <view class="tui-modal-content" :class="[title?'':'tui-mtop']"> -->
-				<view class="tui-modal-content">
+				<view 
+					v-if="!isCustomContent"
+					class="tui-modal-content">
 					<block v-if="content">
 						<div :style="{color:color,fontSize:size+'rpx'}">{{content}}</div>
 					</block>
@@ -12,6 +14,9 @@
 						<slot name="content"></slot>
 					</block>
 				</view>
+				<template v-else>
+					<slot name="customContent"></slot>
+				</template>
 				<view class="tui-modalBtn-box" :class="[button.length!=2?'tui-flex-column':'']">
 					<block v-for="(item,index) in button" :key="index">
 						<button class="tui-modal-btn" :class="['tui-primary'+(item.plain?'-outline':''),button.length!=2?'tui-btn-width':'',button.length>2?'tui-mbtm':'',shape=='circle'?'tui-circle-btn':'']"
@@ -107,11 +112,19 @@ export default {
 			default: false
 		}
 	},
+	computed:{
+		isCustomContent(){
+			return !!this.$slots.customContent
+		}
+	},
 	data() {
 		return {
 
 		}
 	},
+	mounted(){
+		console.log(this)
+	}, 
 	methods: {
 		handleClick(e) {
 			if (!this.show) return

+ 6 - 0
ghs/src/static/css/common.scss

@@ -459,4 +459,10 @@ li {
 
 .animate-close {
     transform: rotate(0);
+}
+//隐藏滚动条
+::-webkit-scrollbar {
+    width: 0;
+    height: 0;
+    color: transparent;
 }