This commit is contained in:
2025-01-15 15:45:01 +08:00
commit bb77f9bd85
216 changed files with 33343 additions and 0 deletions

127
components/LinkScan.vue Normal file
View File

@@ -0,0 +1,127 @@
<template>
<view class="scan_wraper">
<view class="zd-row">
<view class="zd-col-24 zd-row jcflexstart" @tap="focusState=true">
<view v-show="scanList.length" class="scaned_font">{{scanList.join()+','}}</view>
<input
type="text"
class="search_input"
confirm-type="go"
v-model="value"
:focus="focusState"
@focus="handleFocus"
@blur="handleBlur"
@confirm="handleSend">
</view>
<uni-icons v-show="scanList.length" class="mgr20" type="clear" size="24" color="#666" @tap="toDel"></uni-icons>
<uni-icons type="scan" size="22" :color="focusState ? '#D7592F' : '#666'" @tap="focusState=true"></uni-icons>
</view>
<view v-show="scanList.length > 0 && show" class="scan_list_select">
<view class="pop_arrow"></view>
<view class="zd-row" v-for="(e, i) in scanList" :key="i">
<view class="scan_list_item">{{e}}</view>
<uni-icons type="clear" size="20" color="#666" @tap="toDelItem(i)"></uni-icons>
</view>
</view>
</view>
</template>
<script>
import permision from "@/utils/permission.js"
export default {
data() {
return {
focusState: false,
scanList: [],
value: '',
show: false
};
},
methods: {
handleFocus () {
this.focusState = true
this.show = true
},
handleBlur () {
this.focusState = false
if (this.value) {
this.scanList.push(this.value)
this.value = ''
this.$emit('getScanlist', this.scanList)
}
this.show = false
},
toDel () {
this.value = ''
this.scanList = []
// setTimeout(()=> {
// this.focusState = true
// }, 100)
},
toDelItem (i) {
this.scanList.splice(i, 1)
this.$emit('getScanlist', this.scanList)
setTimeout(()=> {
this.focusState = true
}, 100)
},
handleSend (e) {
if (this.value) {
this.scanList.push(this.value)
this.value = ''
}
setTimeout(()=> {
this.focusState = true
}, 100)
this.$emit('getScanlist', this.scanList)
}
}
}
</script>
<style lang="stylus" scoped>
@import '../common/style/mixin.styl';
.scan_wraper
position relative
_wh(100%, 80rpx)
border: 1px solid #dcdfe6;
background-color: #fff;
border-radius: 10rpx;
padding: 0 10rpx
.search_input
width 50%
height 80rpx;
_font(28rpx, 80rpx, #606266,,)
border: 0;
background-color: transparent;
.scaned_font
max-width 50%
_font(26rpx, 60rpx, #606266,,)
white-space nowrap
text-overflow ellipsis
overflow hidden
margin-right 6rpx
.scan_list_select
position absolute
top calc(100% + 12px)
left 0
z-index 3
width 100%
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
padding: 8rpx 10rpx
.pop_arrow
position absolute
top: -12px
left: 10%
border: 6px solid #EBEEF5;
width: 0;
height: 0;
border-top-color: transparent;
border-left-color: transparent;
border-right-color: transparent;
.scan_list_select
_font(26rpx, 80rpx, #606266,,)
</style>

63
components/NavBar.vue Normal file
View File

@@ -0,0 +1,63 @@
<template>
<view class="header">
<span @tap="goBack" class="iconfont icon_back">&#xe6db;</span>
<span class="page_name">{{title}}</span>
<span @tap="backHome" class="iconfont icon_home" :class="{'vhide': show === false}">&#xe69b;</span>
</view>
</template>
<script>
export default {
data() {
return {
};
},
props: {
title: String,
inner: {
type: Boolean,
default: false
},
inner2: {
type: Boolean,
default: false
},
show: {
type: Boolean,
default: true
}
},
methods: {
goBack () {
if (this.inner) {
uni.navigateBack()
} else if (this.inner2) {
this.$emit('goIn')
} else {
uni.redirectTo({
url: '/pages/home/home'
})
}
},
backHome () {
uni.redirectTo({
url: '/pages/home/home'
})
}
}
}
</script>
<style lang="stylus" scoped>
@import '@/common/style/mixin.styl';
.header
_fj()
position fixed
_wh(100%, calc(var(--status-bar-height) + 88rpx))
background-color $red
background linear-gradient(90deg, $red1, $red2)
z-index 200
padding var(--status-bar-height) 20rpx 0 20rpx
.page_name
_font(32rpx, 32rpx, #fff,700,center)
</style>

70
components/SearchBox.vue Normal file
View File

@@ -0,0 +1,70 @@
<template>
<view class="zd-row scan_wraper">
<input
type="text"
class="zd-col-24 search_input"
confirm-type="go"
:value="value"
:focus="focusState"
@focus="handleFocus"
@blur="handleBlur"
@confirm="handleSend">
<uni-icons v-show="value.length" class="mgr20" type="clear" size="24" color="#666" @tap="toDel"></uni-icons>
<uni-icons type="scan" size="22" :color="focusState ? '#D7592F' : '#666'" @tap="focusState=true"></uni-icons>
</view>
</template>
<script>
import permision from "@/utils/permission.js"
export default {
data() {
return {
focusState: false
};
},
model: {
prop: 'value',
event: 'input'
},
props: {
value: String
},
methods: {
handleFocus () {
this.focusState = true
},
handleBlur (e) {
this.$emit('input', e.target.value)
// if (e.target.value.length) {
// this.$emit('handleChange', e.target.value)
// }
this.focusState = false
},
toDel () {
this.$emit('input', '')
},
handleSend (e) {
this.$emit('input', e.target.value)
if (e.target.value.length) {
this.$emit('handleChange', e.target.value)
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '../common/style/mixin.styl';
.scan_wraper
position relative
_wh(100%, 80rpx)
border: 1px solid #dcdfe6;
background-color: #fff;
border-radius: 10rpx;
padding: 0 10rpx
.search_input
height 80rpx;
_font(28rpx, 80rpx, #606266,,)
border: 0;
background-color: transparent;
</style>

View File

@@ -0,0 +1,77 @@
<template>
<view class="zd-row scan_wraper">
<input
type="text"
class="zd-col-24 search_input"
confirm-type="go"
:value="value"
:focus="focusState"
@focus="handleFocus"
@blur="handleBlur"
@confirm="handleSend"
@tap="handleFocus">
<uni-icons v-show="value.length" class="mgr20" type="clear" size="24" color="#666" @tap="toDel"></uni-icons>
<uni-icons type="scan" size="22" :color="focusState ? '#D7592F' : '#666'" @tap="focusState=true"></uni-icons>
</view>
</template>
<script>
import permision from "@/utils/permission.js"
export default {
data() {
return {
focusState: false
};
},
model: {
prop: 'value',
event: 'input'
},
props: {
value: String
},
methods: {
handleFocus () {
this.focusState = true
// setTimeout(() => {
// uni.hideKeyboard()
// }, 300)
},
handleBlur (e) {
this.$emit('input', e.target.value)
// if (e.target.value.length) {
// this.$emit('handleChange', e.target.value)
// }
this.focusState = false
},
toDel () {
this.$emit('input', '')
},
handleSend (e) {
this.$emit('input', e.target.value)
if (e.target.value.length) {
this.$emit('handleChange', e.target.value)
setTimeout(() => {
uni.hideKeyboard()
}, 300)
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '../common/style/mixin.styl';
.scan_wraper
position relative
_wh(100%, 80rpx)
border: 1px solid #dcdfe6;
background-color: #fff;
border-radius: 10rpx;
padding: 0 10rpx
.search_input
height 80rpx;
_font(28rpx, 80rpx, #606266,,)
border: 0;
background-color: transparent;
</style>

49
components/upTop.vue Normal file
View File

@@ -0,0 +1,49 @@
<template>
<view class="back-top" @tap="toTop" v-show="showBtn">
<uni-icons type="arrow-up" size="26" color="#9a99ac"></uni-icons>
</view>
</template>
<script>
export default {
name:"upTop",
data() {
return {
showBtn: false
};
},
props: {
scrollTop: {
type: Number,
default: 0
}
},
methods: {
topData(e) {
this.showBtn = e > 50
},
// 返回顶部
toTop() {
uni.pageScrollTo({
scrollTop: 0,
duration: 100
})
}
}
}
</script>
<style lang="stylus" scoped>
.back-top
position: fixed;
z-index: 299;
right: 10rpx;
bottom: 130rpx;
background-color: #fff;
width: 70rpx;
height: 70rpx;
line-height: 70rpx;
border-radius: 50%;
text-align: center;
box-shadow: 0 4rpx 16rpx rgba(28,31,35,.3);
</style>