From 8771da2ccf6f7c3fd2a8c89a1a0e230c6386db7f Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期一, 17 十一月 2025 15:40:48 +0800
Subject: [PATCH] feat(api): 新增多个API接口并优化配置
---
components/key-bord/key-bord.vue | 258 ++++++++++++++++++++++++---------------------------
1 files changed, 123 insertions(+), 135 deletions(-)
diff --git a/components/key-bord/key-bord.vue b/components/key-bord/key-bord.vue
index feba484..86b3693 100644
--- a/components/key-bord/key-bord.vue
+++ b/components/key-bord/key-bord.vue
@@ -1,148 +1,136 @@
<template>
- <view>
- <view class="u-text-right u-font-30 color-666 u-p-20" @click="close">鍏抽棴</view>
- <view class="bord-box u-row-between">
- <view class="u-flex u-flex-wrap">
- <view v-for="(num,index) in numList" :key="index" class="num-item" hover-class="num-hover"
- @click="inputStr(num)">{{ num }}
- </view>
- </view>
- <view class="u-flex-col">
- <view hover-class="num-hover" class="del-item u-flex u-row-center" @click="delStr">
- <image src="@/static/del-icon.png" class="del-btn"></image>
- </view>
- <view hover-class="num-hover" :class="['pay-btn', 'u-font-30', 'color-fff', 'font-bold',{'disa-btn':Number(emitNum||'0')===0}]" @click="pay">浠樻
- </view>
- </view>
- </view>
- </view>
+ <view>
+ <view class="u-text-right u-font-30 color-666 u-p-20" @click="close">鍏抽棴</view>
+ <view class="u-p-10 bord-box u-flex u-row-between">
+ <view class="u-flex u-flex-wrap">
+ <view v-for="(num,index) in numList" :key="index" class="num-item" hover-class="num-hover"
+ @click="inputStr(num)">{{num}}</view>
+ </view>
+ <view class="flex-1 u-flex-col">
+ <view hover-class="num-hover" class="del-item u-flex u-row-center" @click="delStr">
+ <image src="@/static/imgs/del-icon.png" class="del-btn"></image>
+ </view>
+ <view hover-class="num-hover" class="flex-1 pay-btn u-font-30 color-fff font-bold" @click="pay">浠樻
+ </view>
+ </view>
+ </view>
+ </view>
</template>
<script>
-export default {
- props: {
- num: {
- type: String,
- default: ''
- }
- },
- watch: {
- num(val) {
- this.emitNum = val
- }
- },
- data() {
- return {
- emitNum: '',
- numList: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.']
- }
- },
- methods: {
- // 杈撳叆妗�
- inputStr(num) {
- var dotinx = this.emitNum.indexOf('.');
- if (dotinx != -1) {
- if (num == '.') {
- // 灏忔暟鐐逛笉鑳介噸澶嶆坊鍔�
- return;
- }
- if (this.emitNum == '0.0' && num == '0') {
- //灏忔暟鐐瑰悗闈笉鑳芥槸涓や釜0
- return;
- }
- if (dotinx == this.emitNum.length - 3) {
- //灏忔暟鐐瑰悗闈㈡渶澶氫袱浣�
- return;
- }
- } else if (num == '0' && this.emitNum == '0') {
- // 棣栦綅鐨�0鏈�澶�1涓�
- return;
- } else {
- if (num != '.' && this.emitNum.length > 7) {
- //鏁存暟涓嶈兘瓒呰繃10浣�
- return;
- }
- }
- if (num == '.' && this.emitNum == '') {
- this.emitNum = '0.';
- } else if (num != '.' && this.emitNum == '0') {
- this.emitNum = num;
- } else {
- this.emitNum += num;
- }
- this.$emit('changeMoney', this.emitNum)
- },
- // 鍒犻櫎
- delStr() {
- this.emitNum = this.emitNum.slice(0, -1)
- this.$emit('changeMoney', this.emitNum)
- },
- // 鏀粯
- pay() {
- if(Number(this.emitNum||'0')===0) return
- this.$emit('pay')
- },
- // 鍏抽棴杈撳叆妗�
- close() {
- this.$emit('close')
- }
- }
-}
+ export default {
+ props: {
+ num: {
+ type: String,
+ default: ''
+ }
+ },
+ watch: {
+ num(val) {
+ this.emitNum = val
+ }
+ },
+ data() {
+ return {
+ emitNum: '',
+ numList: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.']
+ }
+ },
+ methods: {
+ // 杈撳叆妗�
+ inputStr(num) {
+ var dotinx = this.emitNum.indexOf('.');
+ if (dotinx != -1) {
+ if (num == '.') {
+ // 灏忔暟鐐逛笉鑳介噸澶嶆坊鍔�
+ return;
+ }
+ if (dotinx == this.emitNum.length - 3) {
+ //灏忔暟鐐瑰悗闈㈡渶澶氫袱浣�
+ return;
+ }
+ } else if (num == '0' && this.emitNum == '0') {
+ // 棣栦綅鐨�0鏈�澶�1涓�
+ return;
+ } else {
+ if (num != '.' && this.emitNum.length > 7) {
+ //鏁存暟涓嶈兘瓒呰繃10浣�
+ return;
+ }
+ }
+ if (num == '.' && this.emitNum == '') {
+ this.emitNum = '0.';
+ } else if (num != '.' && this.emitNum == '0') {
+ this.emitNum = num;
+ } else {
+ this.emitNum += num;
+ }
+ this.$emit('changeMoney', this.emitNum)
+ },
+ // 鍒犻櫎
+ delStr() {
+ this.emitNum = this.emitNum.slice(0, -1)
+ this.$emit('changeMoney', this.emitNum)
+ },
+ // 鏀粯
+ pay() {
+ this.$emit('pay')
+ },
+ // 鍏抽棴杈撳叆妗�
+ close() {
+ this.$emit('close')
+ }
+ }
+ }
</script>
<style lang="scss">
-.bord-box {
- background-color: #F5F5F5;
- display: flex;
- padding: 10rpx 10rpx 0;
- font-size: 0;
-}
+ .bord-box {
+ background-color: #F5F5F5;
+ }
-.num-item {
- width: 175rpx;
- height: 80rpx;
- line-height: 80rpx;
- color: #333333;
- font-size: 32rpx;
- font-weight: bold;
- text-align: center;
- margin: 0 10rpx 10rpx 0;
- background-color: #FFFFFF;
- border-radius: 8rpx;
-}
+ .num-item {
+ width: 175rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ color: #333333;
+ font-size: 32rpx;
+ font-weight: bold;
+ text-align: center;
+ margin: 0 10rpx 10rpx 0;
+ background-color: #FFFFFF;
+ }
-.num-hover {
- opacity: 0.7;
-}
+ .num-hover {
+ opacity: 0.7;
+ }
-.num-item:nth-child(10n) {
- width: 356rpx;
-}
+ .num-item:nth-child(10n) {
+ width: 356rpx;
+ }
-.pay-btn {
- width: 175rpx;
- flex: 1;
- background-color: #D45159;
- border-radius: 8rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 10rpx;
-}
-.disa-btn{
- opacity: 0.7;
-}
+ .h-100 {
+ height: 100%;
+ }
-.del-item {
- width: 175rpx;
- height: 80rpx;
- border-radius: 8rpx;
- margin-bottom: 10rpx;
- background-color: #FFFFFF;
-}
+ .pay-btn {
+ background-color: #D45159;
+ border-radius: 16rpx;
+ text-align: center;
+ height: 270rpx;
+ line-height: 270rpx;
+ vertical-align: middle;
+ }
-.del-btn {
- width: 40rpx;
- height: 40rpx;
-}
-</style>
+ .del-item {
+ width: 175rpx;
+ height: 80rpx;
+ margin-bottom: 10rpx;
+ background-color: #FFFFFF;
+ }
+
+ .del-btn {
+ width: 40rpx;
+ height: 40rpx;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.1