Browse Source

时间搜索

shish 5 năm trước cách đây
mục cha
commit
d28813ef87

+ 1 - 7
ghsApp/src/admin/home/order.vue

@@ -109,13 +109,9 @@
 </template>
 </template>
 
 
 <script>
 <script>
-const Month =
-  new Date().getMonth() + 1 < 10
-    ? "0" + (new Date().getMonth() + 1)
-    : new Date().getMonth() + 1;
+const Month = new Date().getMonth() + 1 < 10 ? "0" + (new Date().getMonth() + 1) : new Date().getMonth() + 1;
 const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
 const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
 import AppTabs from "@/components/plugin/tabs";
 import AppTabs from "@/components/plugin/tabs";
-// import ListModule from "@/components/module/app-order-list";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
 import ModalModule from "@/components/plugin/modal";
 import { getCategory, getUsage } from "@/utils/config";
 import { getCategory, getUsage } from "@/utils/config";
@@ -131,7 +127,6 @@ import BLE from "@/mixins/BLE";
 export default {
 export default {
   name: "order-list",
   name: "order-list",
   components: {
   components: {
-    // ListModule,
     rangeDatePick,
     rangeDatePick,
     AppTabs,
     AppTabs,
     AppWrapperEmpty,
     AppWrapperEmpty,
@@ -152,7 +147,6 @@ export default {
       customizationTimeType: "", //时间段
       customizationTimeType: "", //时间段
       menuObj: "", //时间筛选列表
       menuObj: "", //时间筛选列表
       tabIndex: 0,
       tabIndex: 0,
-      // classifyModal:false,
       tabs: [
       tabs: [
         {
         {
           name: "全部",
           name: "全部",

+ 153 - 177
ghsApp/src/components/module/dorpdownSelect.vue

@@ -1,26 +1,16 @@
 <template>
 <template>
     <view class="select-bg_bx">
     <view class="select-bg_bx">
-
         <view v-if="isShowTit" @click="switchCut" :class="['select-title',dropdownShow?'select_corlor':'']">
         <view v-if="isShowTit" @click="switchCut" :class="['select-title',dropdownShow?'select_corlor':'']">
-            <!--{{menuObjActive?menuObjActive:getMyShopInfo.shopName}}-->
-            <!--{{selectItemId?menuObjActive:''}}-->
-														<text v-if="typeTime">{{selectItemId?menuObjActive:menuObj.title}}</text>
-														<text v-else>{{menuObjActive?menuObjActive:getMyShopInfo.shopName}}</text>
-                            <text v-if="placeholder" style="color: #ccc;">{{placeholder}}</text>
-<!--            {{getMyShopInfo?getMyShopInfo.shopName:menuObj.title}}-->
+            <text v-if="typeTime">{{selectItemId?menuObjActive:menuObj.title}}</text>
+            <text v-else>{{menuObjActive?menuObjActive:getMyShopInfo.shopName}}</text>
+            <text v-if="placeholder" style="color: #ccc;">{{placeholder}}</text>
             <i v-if="isShowMore" class="iconfont iconsanjiao_xia"></i>
             <i v-if="isShowMore" class="iconfont iconsanjiao_xia"></i>
         </view>
         </view>
         <view v-else @click="switchCut" :class="['select-title',dropdownShow?'select_corlor':'']">
         <view v-else @click="switchCut" :class="['select-title',dropdownShow?'select_corlor':'']">
           <text v-if="placeholder" style="color: #ccc;">{{placeholder}}</text>
           <text v-if="placeholder" style="color: #ccc;">{{placeholder}}</text>
         </view>
         </view>
-         <view
-            class="select-mark-view" v-show="dropdownShow" @click="switchCut"></view>
-        <view
-            v-if="dropdownShow"
-            :style="{
-                top
-            }"
-            class="select-fixed_bx">
+        <view class="select-mark-view" v-show="dropdownShow" @click="switchCut"></view>
+        <view v-if="dropdownShow" :style="{top}" class="select-fixed_bx">
             <slot>
             <slot>
                 <view class="select-item-box">
                 <view class="select-item-box">
                     <view class="title">{{menuObj.titleChild}}</view>
                     <view class="title">{{menuObj.titleChild}}</view>
@@ -34,18 +24,10 @@
                         </button>
                         </button>
                     </view>
                     </view>
                 </view>
                 </view>
-                <view
-                    v-if="typeSelect === 1"
-                    class="select-item-box">
+                <view v-if="typeSelect === 1" class="select-item-box">
                     <view class="title">其他时间选择</view>
                     <view class="title">其他时间选择</view>
                     <view class="item-child_box" >
                     <view class="item-child_box" >
-																								<view class="admin-button-com mini-btn default custom" @tap="changeItem({name:'自定义',id:'custom'})">自定义</view>
-<!--                        <picker-->
-<!--                            class="admin-button-com mini-btn default custom"-->
-<!--                                mode="date" :value="selectItemId" @change="endTimeFn">-->
-<!--                            <div v-if="selectItemId&&formatSelect">{{ selectItemId }}</div>-->
-<!--                            <div class="tui-placeholder" v-else>自定义时间</div>-->
-<!--                        </picker>-->
+<view class="admin-button-com mini-btn default custom" @tap="changeItem({name:'自定义',id:'custom'})">自定义</view>
                     </view>
                     </view>
                 </view>
                 </view>
             </slot>
             </slot>
@@ -54,183 +36,177 @@
 </template>
 </template>
 
 
 <script>
 <script>
-    import DropdownList from "@/components/plugin/dropdown-list";
-    import AppDatePicker from "@/components/app-date-picker";
-				import rangeDatePick from '@/components/pyh-rdtpicker/pyh-rdtpicker.vue';
-				import {mapGetters} from "vuex";
-    export default {
-        name:'DorpdownSelect',
-        components:{
-            DropdownList,AppDatePicker,rangeDatePick
+import DropdownList from "@/components/plugin/dropdown-list";
+import AppDatePicker from "@/components/app-date-picker";
+import rangeDatePick from '@/components/pyh-rdtpicker/pyh-rdtpicker.vue';
+import {mapGetters} from "vuex";
+export default {
+    name:'DorpdownSelect',
+    components:{
+        DropdownList,AppDatePicker,rangeDatePick
+    },
+    props:{
+        menuObj:{
+            type: Object,
+            default: ()=>({
+                title:'时间',
+                titleChild:'时间',
+                list: [{name:'昨天',id:'0'},{name:'今天',id:'1'},{name:'本月',id:'2'},{name:'上月',id:'3'},{name:'今年',id:'4'}]
+            })
         },
         },
-        props:{
-            menuObj:{
-                type: Object,
-                default: ()=>({
-                    title:'时间',
-                    titleChild:'时间',
-                    list: [{name:'昨天',id:'0'},{name:'今天',id:'1'},{name:'本月',id:'2'},{name:'上月',id:'3'},{name:'今年',id:'4'}]
-                })
-            },
-            // 1 是时间  2是其他
-            typeSelect:{
-                type:Number,
-                default: 2
-            },
-            top:{
-               type: String,
-               default: 'auto'
-            },
-            selectItemId:{
-                type:[String,Number],
-                default:''
-            },
-            isShowTit:{
-                type: Boolean,
-                default: true
-            },
-											typeTime:{
-                type: Boolean,
-                default: false
-            },
-            isShowMore:{
-                type: Boolean,
-                default: true
-            },
-            placeholder: {
-              type: String,
-              default: ''
-            }
+        // 1 是时间  2是其他
+        typeSelect:{
+            type:Number,
+            default: 2
         },
         },
-        data(){
-            return {
-                dropdownShow: false,
-                selectItem:'',
-																menuObjActive:'',
-            }
+        top:{
+            type: String,
+            default: 'auto'
         },
         },
-        computed:{
-									...mapGetters(["getMyShopInfo"]),
-            formatSelect(){
-                if(!this.$util.isEmpty(this.selectItemId)&&
-                this.$util.isString(this.selectItemId)&&
-                this.selectItemId.split('-').length>1){
-                    return true
-                }else{
-                    return false
-                }
-            },
+        selectItemId:{
+            type:[String,Number],
+            default:''
+        },
+        isShowTit:{
+            type: Boolean,
+            default: true
+        },
+            typeTime:{
+            type: Boolean,
+            default: false
         },
         },
-        mounted(){
+        isShowMore:{
+            type: Boolean,
+            default: true
+        },
+        placeholder: {
+            type: String,
+            default: ''
+        }
+    },
+    data(){
+        return {
+            dropdownShow: false,
+            selectItem:'',
+            menuObjActive:'',
+        }
+    },
+    computed:{
+        ...mapGetters(["getMyShopInfo"]),
+        formatSelect(){
+            if(!this.$util.isEmpty(this.selectItemId)&&
+            this.$util.isString(this.selectItemId)&&
+            this.selectItemId.split('-').length>1){
+                return true
+            }else{
+                return false
+            }
+        },
+    },
+    mounted(){
 
 
+    },
+    onLoad(){
+    },
+    methods:{
+        switchCut(){
+            this.dropdownShow = !this.dropdownShow
         },
         },
-							onLoad(){
-							},
-        methods:{
-            switchCut(){
-                this.dropdownShow = !this.dropdownShow
-            },
-            changeItem(val){
-                if(val.id== this.selectItemId&&val.name!='自定义'){
-                    return false
-                }
-                this.$emit('update:selectItemId',val.id)
+        changeItem(val){
+            if(val.id== this.selectItemId&&val.name!='自定义'){
+                return false
+            }
+            this.$emit('update:selectItemId',val.id)
 
 
-                this.dropdownShow = false;
+            this.dropdownShow = false;
 
 
-                this.$emit('update:menuObj',{
-                    ...this.menuObj,
-                    title:val.name
-                })
-																this.menuObjActive = val.name;
+            this.$emit('update:menuObj',{
+                ...this.menuObj,
+                title:val.name
+            })
+            this.menuObjActive = val.name;
 
 
-                this.$emit('selectSussess',{
-                    select: this.$util.isString(val)?val:val.name,
-                    selectItem: val
-                })
-            },
-            endTimeFn(e){
+            this.$emit('selectSussess',{
+                select: this.$util.isString(val)?val:val.name,
+                selectItem: val
+            })
+        },
+        endTimeFn(e){
 
 
-                this.selectItemId = e.detail.value;
+            this.selectItemId = e.detail.value;
 
 
-                this.dropdownShow = false;
+            this.dropdownShow = false;
 
 
-                this.$emit('update:selectItemId',val.id)
+            this.$emit('update:selectItemId',val.id)
 
 
-                this.$emit('update:menuObj',{
-                    ...this.menuObj,
-                    title:e.detail.value
-                })
+            this.$emit('update:menuObj',{
+                ...this.menuObj,
+                title:e.detail.value
+            })
 
 
-                this.$emit('selectSussess',{
-                    select: e.detail.value,
-                    selectItem: val
-                })
-            }
+            this.$emit('selectSussess',{
+                select: e.detail.value,
+                selectItem: val
+            })
         }
         }
     }
     }
+}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-    .select-bg_bx {
-        .select-title {
-            color: #666666;
-            font-size: 26px;
+.select-bg_bx {
+    .select-title {
+        color: #666666;
+        font-size: 26px;
+        & .iconsanjiao_xia {
+            margin-left: 10px;
+        }
+        &.select_corlor {
+            color: #3385FF;
             & .iconsanjiao_xia {
             & .iconsanjiao_xia {
-                margin-left: 10px;
-            }
-            &.select_corlor {
-                color: #3385FF;
-                & .iconsanjiao_xia {
-                    transform: rotate(180deg);
-                }
+                transform: rotate(180deg);
             }
             }
         }
         }
-        .select-mark-view {
-            height: 100vh;
-            height: 100%;
-            position: fixed;
-            width: 100%;
-            background-color: rgba(0, 0, 0, 0.5);
-            left: 0;
-            top: 0px;
-            z-index: 900;
-        }
-        & .select-fixed_bx {
-            position: fixed;
-            width: 100%;
-            background-color: #FFFFFF;
-            left: 0;
-            z-index: 999;
-            // box-shadow: 0 6px 10px #cccccc;
-            padding:120px 30px 40px;
-            border-radius: 0px 0px 20px 20px;
-            transition: all 0.5s ease-in-out;
-            // top: 100px;
-            & .select-item-box {
-                & .title {
-                    font-size: 24px;
-                    color: #333333;
-                    font-weight: 600;
-                    text-align: left;
-                }
-                & .item-child_box {
-                    // display: flex;
-                    padding: 20px 0 0;
-                    align-items: center;
-                    // flex-flow: wrap;
-                    // justify-content: space-between;
-                    & .admin-button-com {
-                        margin-bottom: 20px;
-                        padding: 18px 50px;
-                        margin-right: 20px;
-                        &.custom {
-                            width: 100%;
-                        }
+    }
+    .select-mark-view {
+        height: 100vh;
+        height: 100%;
+        position: fixed;
+        width: 100%;
+        background-color: rgba(0, 0, 0, 0.5);
+        left: 0;
+        top: 0px;
+        z-index: 900;
+    }
+    & .select-fixed_bx {
+        position: fixed;
+        width: 100%;
+        background-color: #FFFFFF;
+        left: 0;
+        z-index: 999;
+        padding:120px 30px 40px;
+        border-radius: 0px 0px 20px 20px;
+        transition: all 0.5s ease-in-out;
+        & .select-item-box {
+            & .title {
+                font-size: 24px;
+                color: #333333;
+                font-weight: 600;
+                text-align: left;
+            }
+            & .item-child_box {
+                padding: 20px 0 0;
+                align-items: center;
+                & .admin-button-com {
+                    margin-bottom: 20px;
+                    padding: 18px 50px;
+                    margin-right: 20px;
+                    &.custom {
+                        width: 100%;
                     }
                     }
                 }
                 }
             }
             }
         }
         }
     }
     }
-
+}
 </style>
 </style>