增加部分公共样式
修改部分公共组件代码 修改台桌,代课下单逻辑代码 增加支付页面 修改用户列表页面
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<slot name="title">
|
||||
</slot>
|
||||
<view class="item" @tap.stop="itemClick(index)" v-for="(item,index) in props.list" :key="index">
|
||||
<button class="bg-fff" hover-class="btn-hover-class">{{item}}</button>
|
||||
<button class="bg-fff btn" hover-class="btn-hover-class">{{item}}</button>
|
||||
</view>
|
||||
<view class="bock-gary"></view>
|
||||
<view class="cancel-btn" @tap="close">
|
||||
@@ -82,6 +82,9 @@ import { ref } from 'vue';
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
border-bottom: 1px solid $bg;
|
||||
.btn{
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,14 @@
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
ref
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
const props = defineProps({
|
||||
show:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
zIndex: {
|
||||
type: [Number, String]
|
||||
},
|
||||
@@ -22,7 +27,10 @@
|
||||
}
|
||||
})
|
||||
const emits = defineEmits(['close', 'toggle', 'open'])
|
||||
let show = ref(false)
|
||||
watch(()=>props.show,(newval)=>{
|
||||
show.value=newval
|
||||
})
|
||||
let show = ref(props.show)
|
||||
|
||||
function close() {
|
||||
show.value = false
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
},
|
||||
borderColor:{
|
||||
type: String,
|
||||
default: '#707070',
|
||||
default: '#bbb',
|
||||
},
|
||||
size: {
|
||||
//单位px
|
||||
type: Number,
|
||||
default: 14,
|
||||
default: 16,
|
||||
},
|
||||
// v-modal
|
||||
modelValue: {
|
||||
@@ -56,6 +56,7 @@
|
||||
if(props.disabled){
|
||||
return
|
||||
}
|
||||
emits('click')
|
||||
let currentVal=props.modelValue
|
||||
let type=typeof currentVal
|
||||
if(type==='number'){
|
||||
|
||||
@@ -1,11 +1,27 @@
|
||||
<template>
|
||||
<view class="u-flex tabs">
|
||||
<view class="u-flex-1 u-text-center item"
|
||||
:class="{active:index===current}"
|
||||
@tap="changeCurrent(index)" v-for="(item,index) in props.list" :key="index">
|
||||
{{item}}
|
||||
<view class="u-relative bg border-r-16">
|
||||
|
||||
<view class="u-flex tabs zhanwei u-relative">
|
||||
<view class="active-block" :style="computedBlockStyle">
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center item"
|
||||
:class="{active:index===current}"
|
||||
@tap="changeCurrent(index)" v-for="(item,index) in props.list" :key="index">
|
||||
{{item}}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="u-flex tabs u-absolute position-all">
|
||||
|
||||
<view class="u-flex-1 u-text-center item"
|
||||
:class="{active:index===current}"
|
||||
@tap="changeCurrent(index)" v-for="(item,index) in props.list" :key="index">
|
||||
{{item}}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -28,6 +44,14 @@ import { computed, ref, watch } from 'vue';
|
||||
current.value=index
|
||||
emit('update:modelValue',index)
|
||||
}
|
||||
const computedBlockStyle=computed(()=>{
|
||||
const oneWidth= 100/props.list.length
|
||||
const left= current.value*oneWidth
|
||||
return{
|
||||
width:oneWidth+'%',
|
||||
left:left+'%'
|
||||
}
|
||||
})
|
||||
watch(()=>current.value,()=>{
|
||||
emit('change',current.value)
|
||||
})
|
||||
@@ -35,20 +59,57 @@ import { computed, ref, watch } from 'vue';
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tabs{
|
||||
padding: 4rpx 10rpx;
|
||||
.zhanwei{
|
||||
.item{
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.bg{
|
||||
background: #E6F0FF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
padding: 4rpx 10rpx;
|
||||
}
|
||||
.border-r-16{
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.active-block{
|
||||
background-color: $my-main-color;
|
||||
color: #fff;
|
||||
top: 4rpx;
|
||||
bottom: 4rpx;
|
||||
left: 10rpx;
|
||||
position: absolute;
|
||||
border-radius: 8rpx;
|
||||
transition: all .2s ease-in-out;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
.tabs{
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #318AFE;
|
||||
z-index: 2;
|
||||
.active-block{
|
||||
background-color: $my-main-color;
|
||||
color: #fff;
|
||||
top: 4rpx;
|
||||
bottom: 4rpx;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
border-radius: 8rpx;
|
||||
transition: all .2s ease-in-out;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
.item{
|
||||
padding: 8rpx 0;
|
||||
transition: all .3s ease-in-out;
|
||||
transition: all .2s ease-in-out;
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
z-index: 2;
|
||||
}
|
||||
.item.active{
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
background-color: $my-main-color;
|
||||
border-radius: 8rpx;
|
||||
// background-color: $my-main-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user