Commit 3b6d9a36 authored by wlxuqu's avatar wlxuqu

将全局样式,抽离给内部组件专用,避免暴露全局污染的样式

parent 4e77b883
<template>
<view>
</view>
<u-card :title="title" :sub-title="subTitle" :thumb="thumb">
<view class="" slot="body">
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
<view class="u-body-item-title u-line-2">瓶身描绘的牡丹一如你初妆,冉冉檀香透过窗心事我了然,宣纸上走笔至此搁一半</view>
<image src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg" mode="aspectFill"></image>
</view>
<view class="u-body-item u-flex u-row-between u-p-b-0">
<view class="u-body-item-title u-line-2">釉色渲染仕女图韵味被私藏,而你嫣然的一笑如含苞待放</view>
<image src="https://img12.360buyimg.com/n7/jfs/t1/102191/19/9072/330688/5e0af7cfE17698872/c91c00d713bf729a.jpg" mode="aspectFill"></image>
</view>
</view>
<view class="" slot="foot"><u-icon name="chat-fill" size="34" color="" label="30评论"></u-icon></view>
</u-card>
</template>
<script>
export default {
data() {
return {
list: [{
text: '点赞',
color: 'blue',
fontSize: 28
}, {
text: '分享'
}, {
text: '评论'
}],
show: false
}
}
export default {
data() {
return {
title: '素胚勾勒出青花,笔锋浓转淡',
subTitle: '2020-05-15',
thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
};
}
};
</script>
<style scoped lang="scss">
.u-card-wrap {
background-color: $u-bg-color;
padding: 1px;
}
.u-body-item {
font-size: 32rpx;
color: #333;
padding: 20rpx 10rpx;
}
.u-body-item image {
width: 120rpx;
flex: 0 0 120rpx;
height: 120rpx;
border-radius: 8rpx;
margin-left: 12rpx;
}
</script>
\ No newline at end of file
</style>
\ No newline at end of file
......@@ -142,6 +142,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-tips {
font-size: 26rpx;
text-align: center;
......
......@@ -128,6 +128,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-alert-tips {
display: flex;
align-items: center;
......
......@@ -225,6 +225,8 @@ export default {
</script>
<style scoped>
@import '../../libs/css/style.components.scss';
.content {
background: rgba(255, 255, 255, 1);
}
......
......@@ -103,6 +103,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-avatar {
display: inline-flex;
align-items: center;
......
......@@ -123,6 +123,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-back-top {
width: 80rpx;
height: 80rpx;
......
......@@ -137,6 +137,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-badge-box {
display: inline-flex;
justify-content: center;
......
......@@ -350,6 +350,7 @@ export default {
</script>
<style scoped lang="scss">
@import '../../libs/css/style.components.scss';
.u-btn::after {
border: none;
}
......
......@@ -456,6 +456,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-calendar {
color: $u-content-color;
......
......@@ -165,6 +165,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-keyboard-grids {
background: rgb(215, 215, 217);
padding: 24rpx 0;
......
......@@ -242,6 +242,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-card {
position: relative;
overflow: hidden;
......
......@@ -55,6 +55,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-cell-box {
width: 100%;
}
......
......@@ -207,6 +207,7 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-cell {
position: relative;
display: flex;
......
......@@ -97,6 +97,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-checkbox-group {
/* #ifndef MP */
display: inline-flex;
......
......@@ -198,6 +198,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-checkbox {
display: -webkit-flex;
display: flex;
......
......@@ -197,6 +197,7 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-circle-progress {
position: relative;
display: inline-flex;
......
......@@ -38,6 +38,7 @@
</script>
<style lang="scss">
@import "../../libs/css/style.components.scss";
.u-col {
/* #ifdef MP-WEIXIN */
float: left;
......
......@@ -159,6 +159,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-collapse-head {
position: relative;
display: flex;
......
......@@ -94,5 +94,5 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
</style>
......@@ -180,6 +180,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-notice-bar {
width: 100%;
display: flex;
......
......@@ -262,6 +262,8 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-countdown {
display: inline-flex;
align-items: center;
......
......@@ -230,6 +230,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-count-num {
display: inline-block;
text-align: center;
......
......@@ -106,6 +106,7 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-divider {
width: 100%;
position: relative;
......
......@@ -187,6 +187,7 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.dropdown-list-wapper {
position: relative;
}
......
......@@ -95,6 +95,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-empty {
display: flex;
flex-direction: column;
......
......@@ -255,6 +255,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-field {
font-size: 28rpx;
padding: 20rpx 28rpx;
......
......@@ -270,6 +270,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-form-item {
display: flex;
// align-items: flex-start;
......
......@@ -102,4 +102,6 @@ export default {
};
</script>
<style></style>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
</style>
......@@ -37,6 +37,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-full-content {
background-color: #00C777;
}
......
......@@ -49,4 +49,6 @@ export default {
};
</script>
<style></style>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
</style>
......@@ -69,6 +69,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-grid-item {
box-sizing: border-box;
background: #fff;
......
......@@ -76,6 +76,8 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-grid {
width: 100%;
/* #ifdef MP */
......
......@@ -160,6 +160,7 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
@import '../../iconfont.css';
.u-icon {
......
......@@ -59,6 +59,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-index-anchor {
box-sizing: border-box;
padding: 14rpx 24rpx;
......
......@@ -269,6 +269,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-index-bar {
position: relative
}
......
......@@ -78,10 +78,6 @@ export default {
type: String,
default: 'text'
},
clearable: {
type: Boolean,
default: true
},
inputAlign: {
type: String,
default: 'left'
......
......@@ -159,6 +159,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-keyboard {
position: relative;
z-index: 1003;
......
......@@ -209,6 +209,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-wrap {
background-color: #eee;
overflow: hidden;
......
......@@ -94,6 +94,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-progress {
overflow: hidden;
height: 15px;
......
......@@ -76,6 +76,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-line {
vertical-align: middle;
}
......
......@@ -81,6 +81,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-link {
line-height: 1;
}
......
......@@ -52,6 +52,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-loading-circle {
display: inline-block;
vertical-align: middle;
......
......@@ -148,6 +148,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-load-more-wrap {
width: 100%;
display: flex;
......
......@@ -100,6 +100,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-mask {
position: fixed;
top: 0;
......
......@@ -175,6 +175,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
@keyframes breathe {
0% {
opacity: 0.3;
......
......@@ -241,7 +241,9 @@ export default {
};
</script>
<style lang="scss" scoped>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.btn-hover {
background-color: rgb(230, 230, 230);
}
......
......@@ -219,6 +219,8 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-navbar {
width: 100%;
}
......
......@@ -177,6 +177,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-no-network {
background-color: #fff;
position: fixed;
......
......@@ -215,6 +215,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-notice-bar-wrap {
overflow: hidden;
}
......
......@@ -243,6 +243,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-numberbox {
display: inline-flex;
align-items: center;
......
......@@ -116,6 +116,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-keyboard {
position: relative;
z-index: 1003;
......
......@@ -541,6 +541,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-datetime-picker {
position: relative;
z-index: 999;
......
......@@ -283,6 +283,8 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-drawer {
/* #ifndef APP-NVUE */
display: block;
......
......@@ -75,6 +75,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-radio-group {
/* #ifndef MP */
display: inline-flex;
......
......@@ -147,6 +147,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-radio {
display: -webkit-flex;
display: flex;
......
......@@ -178,6 +178,8 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-rate {
display: -webkit-inline-flex;
display: inline-flex;
......
......@@ -121,6 +121,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-content {
font-size: 30rpx;
color: $u-content-color;
......
......@@ -200,6 +200,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-notice-bar {
padding: 18rpx 24rpx;
overflow: hidden;
......
......@@ -59,6 +59,8 @@
</script>
<style lang="scss">
@import "../../libs/css/style.components.scss";
.u-row {
// 由于微信小程序编译后奇怪的页面结构,只能使用float布局实现,flex无法实现
/* #ifndef MP-WEIXIN */
......
......@@ -276,6 +276,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-search {
display: flex;
align-items: center;
......
......@@ -93,6 +93,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-section {
display: flex;
justify-content: space-between;
......
......@@ -292,6 +292,8 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-select {
&__action {
position: relative;
......
......@@ -139,6 +139,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.skeleton-fade {
width: 100%;
height: 100%;
......
......@@ -205,6 +205,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-slider {
position: relative;
border-radius: 999px;
......
......@@ -79,6 +79,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-steps {
display: flex;
}
......
......@@ -144,6 +144,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-sticky {
z-index: 9999999999;
}
......
......@@ -302,6 +302,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-subsection {
display: flex;
align-items: center;
......
......@@ -218,6 +218,8 @@ export default {
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-swipe-action {
width: auto;
height: initial;
......
......@@ -7,8 +7,8 @@
:style="{
height: height + 'rpx'
}">
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index" @tap="listClick(index)">
<view class="u-list-image-wrap" :class="[current != index ? 'u-list-scale' : '']" :style="{
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[current != index ? 'u-list-scale' : '']" :style="{
borderRadius: `${borderRadius}rpx`,
transform: effect3d && current != index ? 'scaleY(0.9)' : 'scaleY(1)',
margin: effect3d && current != index ? '0 20rpx' : 0,
......@@ -210,6 +210,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-swiper-wrap {
position: relative;
overflow: hidden;
......
......@@ -104,6 +104,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-switch {
position: relative;
display: inline-block;
......
......@@ -81,6 +81,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-table {
width: 100%;
box-sizing: border-box;
......
......@@ -371,6 +371,8 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
view,
scroll-view {
box-sizing: border-box;
......
......@@ -278,7 +278,9 @@
};
</script>
<style lang="scss">
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
view,
scroll-view {
box-sizing: border-box;
......
......@@ -146,6 +146,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-tag {
box-sizing: border-box;
align-items: center;
......
......@@ -52,6 +52,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-td {
display: flex;
flex-direction: column;
......
......@@ -43,6 +43,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-th {
display: flex;
flex-direction: column;
......
......@@ -51,6 +51,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-time-axis-item {
display: flex;
flex-direction: column;
......
......@@ -22,6 +22,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-time-axis {
padding-left: 40rpx;
position: relative;
......
......@@ -124,6 +124,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-toast {
position: fixed;
z-index: -1;
......
......@@ -68,6 +68,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
view {
box-sizing: border-box;
}
......
......@@ -28,6 +28,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-tr {
display: flex;
}
......
......@@ -426,6 +426,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-upload {
display: flex;
flex-wrap: wrap;
......
......@@ -153,6 +153,8 @@
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-code-wrap {
width: 0;
height: 0;
......
......@@ -159,6 +159,8 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-waterfall {
display: flex;
flex-direction: row;
......
......@@ -18,6 +18,6 @@
/* #endif */
// H5特有的样式
/* #ifdef MP */
/* #ifdef H5 */
@import "./libs/css/style.h5.scss";
/* #endif */
\ No newline at end of file
// nvue不能用标签命名样式
/* #ifndef APP-NVUE */
image {
display: inline-block;
// 解决图片加载时可能会瞬间变形的问题
will-change: transform;
}
view,
text {
box-sizing: border-box;
flex-direction: row;
}
/* #endif */
\ No newline at end of file
/* H5的时候,隐藏滚动条 */
/* #ifdef H5 */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
\ No newline at end of file
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
......@@ -3,18 +3,6 @@ page {
font-size: 28rpx;
}
image {
display: inline-block;
// 解决图片加载时可能会瞬间变形的问题
will-change: transform;
}
view,
text {
box-sizing: border-box;
flex-direction: row;
}
/* start--去除webkit的默认样式--start */
.u-fix-ios-appearance {
-webkit-appearance:none;
......
......@@ -19,7 +19,7 @@ function queryParams(data = {}, isPrefix = true, arrayFormat = 'brackets') {
switch (arrayFormat) {
case 'indices':
// 结果: ids[0]=1&ids[1]=2&ids[2]=3
for (i = 0; i < value.length; i++) {
for (let i = 0; i < value.length; i++) {
_result.push(key + '[' + i + ']=' + value[i])
}
break;
......
......@@ -3,7 +3,7 @@ function timeFormat(timestamp = null, fmt = 'yyyy-mm-dd') {
// yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
timestamp = parseInt(timestamp);
// 如果为null,则格式化当前时间
if (timestamp == null) timestamp = Number(new Date());
if (!timestamp) timestamp = Number(new Date());
// 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
if (timestamp.toString().length == 10) timestamp *= 1000;
let date = new Date(timestamp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment