fuwei 4 лет назад
Родитель
Сommit
5f13110182

+ 131 - 3
ghsPad/src/admin/home/workbench.vue

@@ -54,7 +54,7 @@
 			<view>
 				客户
 			</view>
-			<view>
+			<view class="active">
 			</view>
 			<view>
@@ -65,7 +65,38 @@
 			</view>
 		</view>
 		<view class="shop-list">
-			212121
+			<view class="shop-type_box">
+				<view
+					v-for="item in shopListType"
+					:key="item.id"
+					class="active"
+				>
+					{{item.name}}
+				</view>
+			</view>
+			<view class="shop-show_box">
+				<view class="show-shop_box">
+					<image
+						class="img"
+						src="https://file02.16sucai.com/d/file/2014/0829/372edfeb74c3119b666237bd4af92be5.jpg"
+						mode="scaleToFill"
+					/>
+					<view class="shop-info_price">
+						<view>
+							<view>粉佳人</view>
+							<view>¥89</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="shop-footer_box">
+				<view class="btn-breakage">
+					报损
+				</view>
+				<view class="btn-account">
+					结算
+				</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -80,7 +111,20 @@ export default {
 	mixins: [productMins,autoUpdateMixins],
 	data() {
 		return {
-			
+			shopListType:[
+				{
+					name:'今日特价',
+					id:1
+				},
+				{
+					name:'常用玫瑰',
+					id:2
+				},
+				{
+					name:'拍市玫瑰',
+					id:3
+				}
+			]
 		};
 	},
 	computed: {
@@ -180,6 +224,90 @@ export default {
 				padding: 10upx;
 				color: #333333;
 				margin-bottom: 15upx;
+				font-size: 14upx;
+				&.active {
+					color: #008000;
+					border-color: #008000;
+					border-radius: 2upx;
+				}
+			}
+		}
+		& .shop-list {
+			height: 100%;
+			border: 1px solid #eee;
+			display: flex;
+			flex-direction: column;
+			& .shop-type_box {
+				max-height: 300upx;
+				display: flex;
+				align-items: center;
+				& > view {
+					border:1px solid #e4e4e4;
+					padding: 8upx 5upx;
+					font-size: 14px;
+					&.active {
+						background-color: #428369;
+						color: #ffffff;
+					}
+				}
+			}
+			& .shop-show_box {
+				flex: 1;
+				padding: 5upx;
+				display: flex;
+				flex-wrap: wrap;
+				& .show-shop_box {
+					position: relative;
+					width: 120upx;
+					height: 100upx;
+					 
+					& .img {
+						height: 100%;
+					}
+					.shop-info_price {
+						position: absolute;
+						height: 42upx;
+						background-color: rgba(0, 0, 0, 0.2);
+						bottom: 0;
+						width: 100%;
+						font-size: 14upx;
+						color: #ffffff;
+						& > view {
+							display: flex;
+							flex-direction: column;
+							padding: 3upx;
+						   
+							justify-content: center;
+							& > view:nth-child(1) {
+								margin-bottom: 2upx;
+							}
+						}
+					}
+				}
+			}
+			& .shop-footer_box {
+				height: 40upx;
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+				& > view {
+					height: 40upx;
+					padding: 5upx 25upx;
+					border-radius: 5upx;
+					font-size: 14upx;
+					margin: 0 10upx;
+					vertical-align: middle;
+					display: flex;
+					align-items: center;
+					&.btn-breakage {
+						background-color: #da9f5a;
+						color: #ffffff;
+					}
+					&.btn-account {
+						background-color: #009966;
+						color: #ffffff;
+					}
+				}
 			}
 		}
 	}

+ 329 - 0
ghsPad/src/components/plugin/vKeyboard/VKeyboard.vue

@@ -0,0 +1,329 @@
+<template>
+	<view v-if="showKeyboard" :class="keyboardStyle" class="enl-size">
+		<view class="digit-keyboard" v-if="mode === 'digit' || digital">
+			<view class="digit-button-box">
+				<template v-for="(digit, index) in digits">
+					<!-- <view :key="index" class="enl-key-button enl-digit" @tap="typing('.')" v-if="index === 9">.</view> -->
+					<view :key="index" class="enl-key-button enl-digit" @tap="typing(digit)">{{digit}}</view>
+				</template>
+				<view class="enl-key-button enl-digit">
+					<i class="iconfont icon-shouqijianpan enl-middle" v-if="digital" @tap="deactivate"></i>
+					<i class="iconfont icon-ABC enl-middle" v-else @tap="typingLetter"></i>
+				</view>
+			</view>
+			<view class="special-button-box">
+				<view class="enl-key-button special-button enl-gray" @tap="backspace"><i class="iconfont icon-backspace enl-large"></i></view>
+				<view class="enl-key-button special-button enl-gray" @tap="enter"><i class="iconfont icon-huiche enl-large"></i></view>
+			</view>
+		</view>
+		<view class="full-keyboard" v-else>
+			<view class="line" v-for="(letters, index) in lines" :key="index">
+				<view class="enl-letter enl-key-button special-key enl-gray" v-if="index === 3 && mode === 'letter'" @tap="toggleCase"><i
+					 :class="'iconfont ' + (lowercase ? 'icon-xiaoxie' : 'icon-daxie')"></i></view>
+				<view class="enl-letter enl-key-button normal" v-for="letter in letters" @tap="typing(letter)" :key="letter">{{letter}}</view>
+				<view class="enl-letter enl-key-button special-key enl-gray" v-if="index === 3" @tap="backspace"><i class="iconfont icon-backspace"></i></view>
+			</view>
+			<view class="line special-line">
+				<view class="enl-letter enl-key-button swith-key enl-gray">
+					<i class="iconfont icon-fuhao" @tap="typingSymbol" v-if="mode === 'letter'"></i>
+					<i class="iconfont icon-ABC" @tap="typingLetter" v-if="mode === 'symbol'"></i>
+				</view>
+				<view class="enl-letter enl-key-button space" @tap="typing(' ')"><text class="enl-logo">spacebar</text></view>
+				<view class="enl-letter enl-key-button swith-key enl-gray" @tap="typingDigit"><i class="iconfont icon-shuzi"></i></view>
+				<view class="enl-letter enl-key-button swith-key enl-gray" @tap="enter"><i class="iconfont icon-huiche"></i></view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		natural,
+		order,
+		disorder,
+		symbols,
+		digits,
+		KEYBOARD_MODE
+	} from './utils'
+	export default {
+		props: {
+			//是否为纯数字键盘
+			digital: {
+				type: [Boolean, String],
+				default: false
+			},
+			//是否无序的排序键盘
+			disorderly: {
+				type: [Boolean, String],
+				default: false
+			}
+			/* ,
+						value: String */
+		},
+		//app中不生效,不知道为什么
+		/* model: {
+			prop: 'value',
+			event: 'typing'
+		}, */
+		computed: {
+			keyboardStyle() {
+				return 'v-keyboard ' + this.cls;
+			}
+		},
+		data() {
+			return {
+				cls: '',
+				visible: false, //是否显示
+				showKeyboard: false, //是否隐藏
+				digits: [], //自然数数组
+				lines: [], //字母+数字数组
+				lowercase: true, //是否小写输入状态
+				mode: KEYBOARD_MODE.LETTER, //键盘模式
+				keys: [] //键入的键值
+			}
+		},
+		methods: {
+			//大小写转换
+			toggleCase() {
+				this.lowercase = !this.lowercase;
+			},
+			//输入符号
+			typingSymbol() {
+				this.mode = KEYBOARD_MODE.SYMBOL;
+				this.lines = symbols;
+			},
+			//输入字母
+			typingLetter() {
+				this.mode = KEYBOARD_MODE.LETTER;
+				this.lines = this.disorderly ? disorder() : order;
+			},
+			//键入数字
+			typingDigit() {
+				this.mode = KEYBOARD_MODE.DIGIT;
+			},
+			//键盘键入
+			typing(input) {
+				this.keys.push(input);
+				//app中v-model不生效,改用事件方式在外处理
+				//this.$emit('typing', this.keys.join(''));
+
+				this.$emit('typing', {
+					backspace: false,
+					char: input
+				})
+			},
+			//退格键
+			backspace() {
+				if (this.keys.length) {
+					this.keys.pop()
+				}
+				//this.$emit('typing', this.keys.join(''));
+				this.$emit('typing', {
+					backspace: true
+				})
+			},
+			//键入回车
+			enter() {
+				//this.deactivate();
+				this.$emit('enter');
+			},
+			//激活键盘
+			activate() {
+				// #ifdef APP-PLUS
+				plus.key.hideSoftKeybord();
+				// #endif
+				this.showKeyboard = true
+				this.$nextTick(() => {
+					this.visible = true;
+				})
+			},
+			//隐藏键盘
+			deactivate() {
+				this.visible = false;
+				setTimeout(() => {
+					this.showKeyboard = false
+				}, 250)
+			}
+		},
+		watch: {
+			lowercase(val) {
+				let [...temp] = this.lines;
+				temp.forEach(line => {
+					line.forEach((letter, index) => {
+						line[index] = val ? letter.toLowerCase() : letter.toUpperCase();
+					});
+				});
+				this.lines = temp;
+			},
+			visible(val) {
+				this.cls = val ? 'slideup' : 'slidedown';
+			}
+		},
+		created() {
+			this.lines = this.disorderly ? disorder() : order;
+			this.digits = this.disorderly ? digits() : natural;
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import './css.scss'; //引入键盘样式
+	@import './icon.css'; //引入键盘icon
+
+	.iconfont {
+		font-family: "iconfont" !important;
+		font-size: 40upx;
+		font-style: normal;
+		-webkit-font-smoothing: antialiased;
+		-moz-osx-font-smoothing: grayscale;
+	}
+
+	.enl-size {
+		font-size: 40rpx;
+	}
+
+	.enl-key-button {
+		display: inline-block;
+		overflow: hidden;
+		vertical-align: middle;
+		border: 1px solid #e6e6e6;
+		color: #333;
+		background-color: #fff;
+		box-shadow: 0 2px 2px rgba(230, 230, 230, .7);
+		border-radius: 0.35em;
+		text-align: center;
+		white-space: nowrap;
+		user-select: none;
+		cursor: pointer;
+
+		&:active {
+			background: #d6d6d6;
+			scale: 0.7;
+		}
+	}
+
+	.v-keyboard {
+		transform: translateY(100%);
+		width: 100%;
+		position: absolute;
+		bottom: 0;
+		left: 0;
+		background: #f5f5f5;
+		padding: .5em 0;
+		z-index: 100;
+
+		/*全键盘*/
+		.full-keyboard {
+			.line {
+				text-align: center;
+
+				&:not(:last-child) {
+					margin-bottom: 0.5em;
+				}
+
+				.enl-letter {
+					height: 1.7em;
+					line-height: 1.7em;
+					font-size: 1em;
+
+					&:not(:last-child) {
+						margin-right: 0.12em;
+						// margin-right: 0.2em;
+					}
+				}
+
+				.normal {
+					// width: 1.73em;
+					width: 1.65em;
+				}
+
+				.special-key {
+					width: 2.6em;
+				}
+			}
+
+			.special-line {
+				padding: 0 0.35em;
+				display: flex !important;
+				justify-content: space-around;
+
+				.space {
+					flex: 1;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+				}
+
+				.swith-key {
+					width: 2.6em;
+				}
+
+				.enl-logo {
+					font-size: 30rpx;
+				}
+			}
+		}
+
+		/*数字键盘*/
+		.digit-keyboard {
+			display: flex;
+			flex-direction: row;
+			font-size: 38rpx;
+
+			.digit-button-box {
+				padding: 0 .35em;
+				flex: 80;
+
+				.enl-digit {
+					width: 4.46em;
+					height: 2.5em;
+					line-height: 2.5em;
+					margin-bottom: .35em;
+
+					&:nth-child(10),
+					&:nth-child(11),
+					&:nth-child(12) {
+						margin-bottom: 0;
+					}
+
+					&:not(:last-child) {
+						margin-right: .35em;
+					}
+				}
+			}
+
+			.special-button-box {
+				flex: 20;
+				padding: 0 .35em 0 0;
+
+				.special-button {
+					display: block;
+					line-height: 5.5em;
+					height: 5.5em;
+					width: 4em;
+
+					&:not(:last-child) {
+						margin-bottom: .35em;
+					}
+				}
+			}
+		}
+
+		.enl-gray {
+			background: #e1e1e1 !important;
+
+			&:active {
+				background: #fff !important;
+			}
+		}
+
+		.enl-large {
+			font-size: 2em !important;
+		}
+
+		.enl-middle {
+			font-size: 1.2em !important;
+			display: block;
+		}
+	}
+</style>

+ 61 - 0
ghsPad/src/components/plugin/vKeyboard/css.scss

@@ -0,0 +1,61 @@
+@mixin transform($trans) {
+  -webkit-transform: $trans;
+  -moz-transform: $trans;
+  -ms-transform: $trans;
+  -o-transform: $trans;
+  transform: $trans;
+}
+
+@mixin transition($trans) {
+  -moz-transition: $trans;
+  -ms-transition: $trans;
+  transition: $trans;
+}
+
+/*平滑动画,向上滑入,向下滑出*/
+@keyframes slidedown {
+  from {
+    transform: translateY(0);
+  }
+  to {
+    transform: translateY(100%);
+  }
+}
+
+@-webkit-keyframes slidedown {
+  from {
+    -webkit-transform: translateY(0);
+  }
+  to {
+    -webkit-transform: translateY(100%);
+  }
+}
+
+@-webkit-keyframes slideup {
+  from {
+    -webkit-transform: translateY(100%);
+  }
+  to {
+    -webkit-transform: translateY(0);
+  }
+}
+
+@keyframes slideup {
+  from {
+    transform: translateY(100%);
+  }
+  to {
+    transform: translateY(0);
+  }
+}
+
+.slidedown {
+  animation: slidedown 0.3s linear;
+  animation-fill-mode:forwards;
+  @include transform(translateY(100%));
+}
+.slideup {
+  animation: slideup 0.3s linear;
+  animation-fill-mode:forwards;
+  @include transform(translateY(0));
+}

Разница между файлами не показана из-за своего большого размера
+ 3 - 0
ghsPad/src/components/plugin/vKeyboard/icon.css


+ 22 - 0
ghsPad/src/components/plugin/vKeyboard/index.js

@@ -0,0 +1,22 @@
+import Vue from 'vue'
+import vKeyboard from './VKeyboard'
+
+//extend创建Vue组件类
+const vKeyboardClass = Vue.extend(vKeyboard)
+
+let instance;
+
+export default {
+  activate(options) {
+    options = options || {};
+    instance = new vKeyboardClass({propsData: options});
+    instance.vm = instance.$mount();
+    document.body.appendChild(instance.vm.$el);
+    /*document.body.appendChild(instance.vm.$el);*/
+    instance.activate();
+    return instance;
+  },
+  deactivate() {
+    instance.deactivate();
+  }
+}

+ 61 - 0
ghsPad/src/components/plugin/vKeyboard/utils.js

@@ -0,0 +1,61 @@
+//所有自然数
+export const natural = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '0'];
+//所有英文字母
+export const chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
+	'v', 'w', 'x', 'y', 'z'
+];
+
+//顺序排序全键盘
+export const order = [
+	['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'],
+	['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],
+	['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],
+	['z', 'x', 'c', 'v', 'b', 'n', 'm']
+];
+
+//随机排序全键盘
+export const disorder = () => {
+	let lines = [10, 9, 7];
+	let array = [];
+	array.push(digits());
+
+	let [...temp] = chars;
+
+	const random = (length) => {
+		let randoms = [];
+		for (let i = 0; i < length; i++) {
+			let index = Math.floor(Math.random() * temp.length);
+			randoms.push(temp[index]);
+			temp.splice(index, 1);
+		}
+		return randoms;
+	};
+
+	for (let i = 0; i < lines.length; i++) {
+		array.push(random(lines[i]));
+	}
+	return array;
+};
+
+//所有符号
+export const symbols = [
+	['~', '`', '!', '@', '#', '$', '%', '^', '&', '*'],
+	['(', ')', '-', '+', '=', '{', '}', '[', ']'],
+	['_', '|', '\\', ':', ';', '\'', '<', ',', '>'],
+	['"', '?', '.', '/', '€', '£', '¥']
+];
+
+//所有数字
+export const digits = () => {
+	let [...temp] = natural;
+	return temp.sort(function() {
+		return Math.random() > 0.5 ? -1 : 1; //用Math.random()函数生成0~1之间的随机数与0.5比较,返回-1或1
+	});
+};
+
+//键盘模式
+export const KEYBOARD_MODE = {
+	SYMBOL: 'symbol', //符号键盘
+	DIGIT: 'digit', //数字键盘
+	LETTER: 'letter' //字母键盘
+};

Некоторые файлы не были показаны из-за большого количества измененных файлов