shish 4 лет назад
Родитель
Сommit
570d876f76

+ 142 - 0
hdPad/src/admin/home/components/leftGroup.vue

@@ -0,0 +1,142 @@
+<template>
+    <view class="itemList-box">
+        <view class="title">列表</view>
+        <scroll-view class="itemList-item_box" scroll-y="true" @scrolltolower="reachBottom" lower-threshold="50">
+            <view v-for="item in list.data" :key="item.id" class="show-item_box">
+                <view class="item-body_box not-active">
+                    <view class="flower-name_box">
+                        <view class="current-item-title"><text class="name">{{item.name}}</text></view>
+                        <image class="flower-image" :src="item.cover"></image>
+                    </view>
+                    <view class="item-price-num"> <view>¥{{parseFloat(item.price)}}</view> <view>{{item.num}}次</view> <view>开单</view> </view>
+                </view>
+            </view>
+        </scroll-view>
+    </view>
+</template>
+<script>
+import {getGroupList} from "@/api/group"
+import { list } from "@/mixins";
+export default {
+    name:'leftItem',
+    components:{},
+	mixins: [list],
+	props: {
+		customId: {
+			type: Number,
+			default: 0
+		}
+    },
+    data(){
+        return {
+            totalShop:{ bigUnit: 0, smallUnit:0, totalPrice: 0 },
+            itemList:[],
+            selectJobType:'bill',
+            selectJobId:0,
+            groupList:[]
+        }
+    },
+    watch:{
+        customId:{
+            handler(newCustomId){
+                this.selectJobId = newCustomId
+            },
+            immediate:true
+        }
+    },
+    created(){
+        this.getGroupList()
+    },
+    methods:{
+        reachBottom() {
+            console.log('eeeeeee')
+            if (!this.list.finished) {
+                this.getGroupList().then((res) => {
+                    uni.stopPullDownRefresh();
+                });
+            } else {
+                uni.stopPullDownRefresh();
+            }
+        },
+        getGroupList(){
+            return getGroupList({page: this.list.page}).then(res=>{
+                if(res.code == 1){
+                    this.completes(res);
+                }
+            })
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+.itemList-box {
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    & .title {
+        padding: 3upx;
+        font-size: 12upx;
+        background-color: rgba(72, 91, 107, 1);
+        color: #FFFFFF;
+    }
+    & .itemList-item_box {
+        overflow-y: auto;
+        flex: 1;
+        border: 1px solid #eee;
+        & .show-item_box {
+            padding: 2upx;
+            & .item-body_box {
+                border-radius: 2upx;
+                padding: 2upx;
+                font-size: 14upx;
+                color:#666666;
+                height:50upx;
+                &.active {
+                    background-color: #d4d6d6;
+                }
+                &.not-active {
+                    background-color: #e7e9e9;
+                }
+                & .flower-name_box {
+                    padding: 0 5upx;
+                    position: relative;
+                    .current-item-title {
+                        .name{
+                            color: #333333;
+                            font-weight: bold;
+                            overflow: hidden;
+                            text-overflow:ellipsis;
+                            white-space: nowrap;
+                            width:60upx;
+                        }
+                    }
+                    .flower-image{
+                        position: absolute;
+                        right:1upx;
+                        top:1upx;
+                        width:30upx;
+                        height:30upx;
+                        border-radius:5upx;
+                    }
+                }
+                .item-price-num{
+                    color:#afaeae;
+                    font-size:10upx;
+                    display: flex;
+                    align-items: center;
+                    justify-content: space-between;
+                    padding: 15upx 2upx 0 2upx;
+                }
+            }
+        }
+    }
+    & .itemList-footer_box {
+        height: 20upx;
+        border: 1px solid #eee;
+        font-size: 10upx;
+        display: flex;
+        align-items: center;
+        justify-content: space-around;
+    }
+}
+</style>

+ 1 - 1
hdPad/src/admin/home/components/leftItem.vue

@@ -1,6 +1,6 @@
 <template>
     <view class="itemList-box">
-        <view class="title">花材列表</view>
+        <view class="title">列表</view>
         <view class="itemList-item_box">
             <view v-for="item in selectList" :key="item.id" class="show-item_box">
                 <view class="item-body_box not-active">

+ 2 - 0
hdPad/src/admin/home/components/middleButton.vue

@@ -142,7 +142,9 @@ export default {
 			this.$util.hitRemind()
 			uni.clearStorage()
 			this.$store.commit("setLoginInfo", {})
+			// #ifdef APP-PLUS
 			plus.runtime.restart()
+			// #endif
 		},
 		logout(){
 			this.$util.hitRemind()

+ 42 - 27
hdPad/src/admin/home/login.vue

@@ -2,13 +2,21 @@
 	<view>
 		<view class="login-model">
 			<view class="experFrame">
-			<view>
-				<view style="text-align:center;margin-bottom:20upx;"><image :src="`${constant.imgUrl}/logo4.png`" class="logo" mode="widthFix"></image></view>
-				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:50upx;">花惠宝</view>
-				<view><input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" /></view>
-				<view><input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" /></view>
-				<view style="margin-top:40upx;"><button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button></view>
-			</view>
+				<view>
+					<view class="logo-area">
+						<image :src="`${constant.imgUrl}/logo4.png`" class="logo" mode="widthFix"></image> 
+					</view>
+					<view style="color:#666666;text-align:center;margin-bottom:10upx;font-size:20upx;">花惠宝</view>
+					<view>
+						<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
+					</view>
+					<view>
+						<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
+					</view>
+					<view style="margin-top:10upx;">
+						<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
+					</view>
+				</view>
 			</view>
 		</view>
 	</view>
@@ -95,15 +103,15 @@ export default {
   overflow: hidden;
   text-align: center;
   & > .noData_img {
-    width: 318upx;
-    height: 318upx;
-    margin: 332upx auto 0;
+    width: 100upx;
+    height: 100upx;
+    margin: 100upx auto 0;
   }
   & > .no_data_text {
     font-size: 32upx;
     color: #ffffff;
     text-align: center;
-    margin: 50upx 0;
+    margin: 30upx 0;
   }
   & > .freeApply {
     width: 376upx;
@@ -117,17 +125,17 @@ export default {
     text-align: center;
   }
   &>.experience{
-    margin-top: 40upx;
+    margin-top: 20upx;
     color: #fff;
-    font-size: 30upx;
+    font-size: 20upx;
   }
   &>.experFrame{
-      margin-top:130upx;
-      height: 50upx;
+      margin-top: 25upx;
+      height: 0upx;
       .experInput{
-        height: 120upx;
-        width: 600upx;
-        margin-bottom:38upx;
+        height: 35upx;
+        width: 230upx;
+        margin-bottom:14upx;
         display: inline-block;
         vertical-align: middle;
         background-color: #f5f5f5;
@@ -140,18 +148,25 @@ export default {
       }
       .buttonText{
         display: inline-block;
-        line-height:120upx;
+        line-height:40upx;
         padding: 0 20upx;
         vertical-align: middle;
-        font-size: 45upx;
-        height: 120upx;
-        width: 600upx;
-      }
-      .logo{
-        width:200upx;
-        margin:0 auto;
-		border-radius:20upx;
+        font-size: 20upx;
+        width: 230upx;
+        height:40upx;
       }
+	  .logo-area{
+		text-align:center;
+		margin-bottom:10upx;
+		height:50upx;
+		text-align:center;
+		.logo{
+			width:50upx;
+			margin:0 auto;
+			border-radius:5upx;
+			margin:0 auto;
+		}
+	  }
   }
 }
 </style>

+ 14 - 7
hdPad/src/admin/home/workbench.vue

@@ -4,7 +4,7 @@
 		<loginComponent></loginComponent>
 	</view>
 	<view v-else>
-		<view v-if="customId == 0">
+		<view v-if="chooseCustomer">
 			<!-- 客户列表 -->
 			<customerList @selectCustomer="selectCustomer"> </customerList>
 		</view>
@@ -15,7 +15,8 @@
 			</view>
 			<!-- 已选花材列表 -->
 			<view class="itemList-box">
-				<leftItem :customId.sync="customId"></leftItem>
+				<leftItem v-if="!$util.isEmpty(selectList)" :customId.sync="customId"></leftItem>
+				<leftGroup v-else :customId.sync="customId"></leftGroup>
 			</view>
 			<!-- 按钮操作 -->
 			<view class="open-box">
@@ -37,11 +38,13 @@ import rightItemArea from './components/rightItemArea.vue'
 import middleButton from './components/middleButton.vue'
 import customerList from './components/customer-list.vue'
 import leftItem from './components/leftItem.vue'
+import leftGroup from './components/leftGroup.vue'
 import loginComponent from './login.vue'
+import productMins from "@/mixins/product";
 export default {
 	name: "workbench",
-	components: { rightItemArea,middleButton,  loginComponent, leftItem, customerList },
-	mixins: [autoUpdateApp],
+	components: { rightItemArea,middleButton,  loginComponent, leftItem,leftGroup, customerList },
+	mixins: [autoUpdateApp,productMins],
 	data() {
 		return {
 			itemList:[],
@@ -49,7 +52,10 @@ export default {
 			selectItem: {},
 			selectItemUser:{},
 			isLogin:false,
-			customId:980575
+			customId:0,
+            selectJobType:'bill',
+            selectJobId:0,
+			chooseCustomer:false
 		};
 	},
 	computed: {
@@ -77,10 +83,11 @@ export default {
 	},
 	methods: {
 		resetCustomer(){
-			this.customId = 0
+			this.chooseCustomer = true
 		},
 		selectCustomer(info){
 			this.customId = info.id ? parseInt(info.id) : 0
+			this.selectJobId = this.customId
 		},
 		init() {
 		},
@@ -100,7 +107,7 @@ export default {
 		flex: 5;
 		background-color: rgba(72, 91, 107, 1);
 		& .item-list {
-			margin-top: 23upx;
+			margin-top: 21upx;
 			font-size: 16upx;
 			text-align: center;
 			padding: 15upx 0;

+ 5 - 0
hdPad/src/api/group/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const getGroupList = data => {
+	return https.get('/group/list', data)
+}

+ 3 - 18
hdPad/src/components/app_input_all.vue

@@ -10,19 +10,6 @@
         <div
             :class="['my-input',arrowsRight?'isLink':'']">
             <slot name="content">
-                <!-- <textarea
-                    auto-height
-                    v-if="type == 'textarea'"
-                    class="text-line text-textarea"
-                    :disabled="disabled"
-                    ref="input"
-                    :type="type"
-                    v-model="currentValue"
-                    @blur="onBlur"
-                    @input="onChange"
-                    :isFocus="true"
-                    :placeholder="placeholder">
-                </textarea> -->
                 <appTextarea
                     auto-height
                     v-if="type == 'textarea'"
@@ -48,7 +35,6 @@
                 :focus="isFocus"
                 :placeholder="placeholder">
             </slot>
-            <!-- <i class="icon-butongguo" v-show="isClear&&currentValue !== ''" @click="clear"></i> -->
         </div>
         <div class="my-left">
              <slot name="inputRight"></slot>
@@ -141,7 +127,6 @@ export default {
 	}
 }
 </script>
-
 <style scoped lang="scss">
     .my-inputBox{
         position: relative;
@@ -153,10 +138,10 @@ export default {
         & .line{
             position: absolute;
             width: 100%;
-            height: 1px;
+            height: 1upx;
             left: 0;
             bottom: 0;
-            border-bottom: 1px solid #ebedf0;
+            border-bottom: 1upx solid #ebedf0;
         }
         .my-input{
             position: relative;
@@ -194,7 +179,7 @@ export default {
         outline:0;
         background-color:transparent;
         border:0;
-        font-size: 28upx;
+        font-size: 20upx;
         font-weight: normal;
         font-stretch: normal;
         letter-spacing: 0upx;

+ 1 - 1
hdPad/src/pages.json

@@ -1,6 +1,6 @@
 {
 	"pages": [
-		{ "path": "admin/home/workbench", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": true } },
+		{ "path": "admin/home/workbench", "style": { "navigationBarTitleText": ""} },
 		{ "path": "admin/home/login","style": {"navigationBarTitleText": "","enablePullDownRefresh": false}},
 		{ "path": "admin/home/order", "style": { "navigationBarTitleText": "订单", "enablePullDownRefresh": true } },
 		{ "path": "admin/home/member", "style": { "navigationBarTitleText": "客户", "enablePullDownRefresh": true } },

+ 12 - 18
hdPad/src/store/modules/product.js

@@ -1,32 +1,26 @@
 export default {
 	state: {
-		selectInfo: {} //选择商品信息  用页面pageType当key  查询对应模块选择的商品列表
+		//选中的花材信息
+		selectInfo: {}
 	},
 	getters: {
 		getSelectInfo(state) {
-			return state.selectInfo || {};
+			return state.selectInfo
 		}
 	},
 	actions: {
-		/**
-		 * 设置不同类别选中商品列表信息
-		 */
-		setSelectInfoByType({ commit }, { type, info }) {
-			commit("SET_SELECTINFO_BY_TYPE", { type, info });
+		//保存已选花材列表
+		setSelectInfo({ commit }, { selectJobType, info,selectJobId }) {
+			commit("SET_SELECTED_ITEM", { selectJobType, info,selectJobId });
 		},
-		/**
-		 * 清空不同类别选中商品列表信息
-		 */
-		resetSelectInfoByType({ commit }, type) {
-			commit("SET_SELECTINFO_BY_TYPE", { type, info: [] });
+		//清空已选花材信息
+		reSetSelectInfo({ commit }, {selectJobType,selectJobId}) {
+			commit("SET_SELECTED_ITEM", { selectJobType, info: [],selectJobId });
 		}
 	},
 	mutations: {
-		["SET_SELECTINFO_BY_TYPE"](state, { type, info }) {
-			state.selectInfo = {
-				...state.selectInfo,
-				[type]: info
-			};
+		SET_SELECTED_ITEM(state, { selectJobType, info,selectJobId }) {
+			state.selectInfo = { ...state.selectInfo, [selectJobType+'_'+selectJobId]: info }
 		}
 	}
-};
+};