10
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<u-avatar @longpress="longpress" @click="click" @onError="errorHandle" :src="getAvatarUrl" :text="avatarText"
|
||||
bgColor="#0089FF" :defaultUrl="getDdefaultUrl" :shape="shape" :size="size" mode="aspectFill" font-size="14">
|
||||
bg-color="#cdcdcd" :defaultUrl="getDdefaultUrl" :shape="shape" :size="size" mode="aspectFill" font-size="14">
|
||||
</u-avatar>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,84 +1,71 @@
|
||||
<template>
|
||||
<view
|
||||
@click="onClick"
|
||||
class="setting_item"
|
||||
:class="{ setting_item_border: border }"
|
||||
>
|
||||
<text :style="{ color: danger ? '#FF381F' : '$uni-text-color' }">{{
|
||||
title
|
||||
}}</text>
|
||||
<u-switch
|
||||
:loading="loading"
|
||||
@change="onChange"
|
||||
:asyncChange="true"
|
||||
v-if="is_switch"
|
||||
size="20"
|
||||
:value="switchValue"
|
||||
/>
|
||||
<view v-else class="setting_right">
|
||||
<slot></slot>
|
||||
<u-icon v-if="arrow" name="arrow-right" color="#999" size="18" />
|
||||
</view>
|
||||
</view>
|
||||
<view @click="onClick" class="setting_item" :class="{ setting_item_border: border }">
|
||||
<text :style="{ color: danger ? '#FF381F' : '$uni-text-color' }">{{title}}</text>
|
||||
<u-switch :loading="loading" @change="onChange" :asyncChange="true" v-if="is_switch" size="20" :value="switchValue" />
|
||||
<view v-else class="setting_right">
|
||||
<slot></slot>
|
||||
<u-icon v-if="arrow" name="arrow-right" color="#999" size="18" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "",
|
||||
components: {},
|
||||
props: {
|
||||
title: String,
|
||||
danger: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
is_switch: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
switchValue: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
border: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
arrow: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
this.$emit("click");
|
||||
},
|
||||
onChange(value) {
|
||||
this.$emit("switch", value);
|
||||
},
|
||||
},
|
||||
};
|
||||
export default {
|
||||
name: "",
|
||||
components: {},
|
||||
props: {
|
||||
title: String,
|
||||
danger: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
is_switch: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
switchValue: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
border: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
arrow: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
this.$emit("click");
|
||||
},
|
||||
onChange(value) {
|
||||
this.$emit("switch", value);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.setting_item {
|
||||
@include btwBox();
|
||||
padding: 24rpx 36rpx;
|
||||
color: $uni-text-color;
|
||||
.setting_item {
|
||||
@include btwBox();
|
||||
padding: 24rpx 36rpx;
|
||||
color: $uni-text-color;
|
||||
|
||||
.setting_right {
|
||||
@include vCenterBox();
|
||||
}
|
||||
.setting_right {
|
||||
@include vCenterBox();
|
||||
}
|
||||
|
||||
&_border {
|
||||
border-bottom: 1px solid rgba(153, 153, 153, 0.2);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
&_border {
|
||||
border-bottom: 1px solid rgba(153, 153, 153, 0.2);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,9 +2,9 @@
|
||||
<view class="mask" :class="!show?'':'mask-show'" :style="{backgroundColor:show?maskBg:'rgba(0,0,0,0)'}" @tap="tapMask">
|
||||
<view class="popups" :class="[theme]"
|
||||
:style="{top: popupsTop ,left: popupsLeft,flexDirection:direction}">
|
||||
<text :class="dynPlace" :style="{width:'0px',height:'0px'}" v-if="triangle"></text>
|
||||
<text :class="dynPlace" :style="{width:'0px',height:'0px'}" v-show="triangle"></text>
|
||||
<template v-for="(item,index) in popData">
|
||||
<view @tap.stop="tapItem(item)" v-if="item.disabled==false"
|
||||
<view @tap.stop="tapItem(item)" v-show="item.disabled==false"
|
||||
class="itemChild view" :class="[direction=='row'?'solid-right':'solid-bottom',item.disabled?'disabledColor':'']">
|
||||
<u-icon :color="item.disabled?'#c8c9cc':'#ffffff'" :name="item.icon" size="20" v-if="item.icon"></u-icon>
|
||||
<text>{{item.title}}</text>
|
||||
|
||||
Reference in New Issue
Block a user