添加代码
This commit is contained in:
+64
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 显示的内容,字符串
|
||||
text: {
|
||||
type: [Array],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.text
|
||||
},
|
||||
// 是否显示左侧的音量图标
|
||||
icon: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.icon
|
||||
},
|
||||
// 通告模式,link-显示右箭头,closable-显示右侧关闭图标
|
||||
mode: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.mode
|
||||
},
|
||||
// 文字颜色,各图标也会使用文字颜色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.color
|
||||
},
|
||||
// 背景颜色
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.bgColor
|
||||
},
|
||||
// 字体大小,单位px
|
||||
fontSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.fontSize
|
||||
},
|
||||
// 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度
|
||||
speed: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.speed
|
||||
},
|
||||
// direction = row时,是否使用步进形式滚动
|
||||
step: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.step
|
||||
},
|
||||
// 滚动一个周期的时间长,单位ms
|
||||
duration: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.duration
|
||||
},
|
||||
// 是否禁止用手滑动切换
|
||||
// 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序
|
||||
disableTouch: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.disableTouch
|
||||
},
|
||||
justifyContent: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.columnNotice.justifyContent
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-column-notice/props.js.map
|
||||
Vendored
+110
@@ -0,0 +1,110 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uColumnNotice_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const uni_modules_uviewPlus_libs_function_test = require("../../libs/function/test.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uColumnNotice_props.props],
|
||||
watch: {
|
||||
text: {
|
||||
immediate: true,
|
||||
handler(newValue, oldValue) {
|
||||
if (!uni_modules_uviewPlus_libs_function_test.test.array(newValue)) {
|
||||
uni_modules_uviewPlus_libs_function_index.error("noticebar组件direction为column时,要求text参数为数组形式");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 文字内容的样式
|
||||
textStyle() {
|
||||
let style = {};
|
||||
style.color = this.color;
|
||||
style.fontSize = uni_modules_uviewPlus_libs_function_index.addUnit(this.fontSize);
|
||||
return style;
|
||||
},
|
||||
// 垂直或者水平滚动
|
||||
vertical() {
|
||||
if (this.mode == "horizontal")
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
index: 0
|
||||
};
|
||||
},
|
||||
emits: ["click", "close"],
|
||||
methods: {
|
||||
noticeChange(e) {
|
||||
this.index = e.detail.current;
|
||||
},
|
||||
// 点击通告栏
|
||||
clickHandler() {
|
||||
this.$emit("click", this.index);
|
||||
},
|
||||
// 点击关闭按钮
|
||||
close() {
|
||||
this.$emit("close");
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
|
||||
_easycom_u_icon2();
|
||||
}
|
||||
const _easycom_u_icon = () => "../u-icon/u-icon.js";
|
||||
if (!Math) {
|
||||
_easycom_u_icon();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx.icon
|
||||
}, _ctx.icon ? {
|
||||
b: common_vendor.p({
|
||||
name: _ctx.icon,
|
||||
color: _ctx.color,
|
||||
size: "19"
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.f(_ctx.text, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item),
|
||||
b: index
|
||||
};
|
||||
}),
|
||||
d: common_vendor.s($options.textStyle),
|
||||
e: _ctx.justifyContent,
|
||||
f: _ctx.disableTouch,
|
||||
g: _ctx.step ? false : true,
|
||||
h: _ctx.duration,
|
||||
i: common_vendor.o((...args) => $options.noticeChange && $options.noticeChange(...args)),
|
||||
j: ["link", "closable"].includes(_ctx.mode)
|
||||
}, ["link", "closable"].includes(_ctx.mode) ? common_vendor.e({
|
||||
k: _ctx.mode === "link"
|
||||
}, _ctx.mode === "link" ? {
|
||||
l: common_vendor.p({
|
||||
name: "arrow-right",
|
||||
size: 17,
|
||||
color: _ctx.color
|
||||
})
|
||||
} : {}, {
|
||||
m: _ctx.mode === "closable"
|
||||
}, _ctx.mode === "closable" ? {
|
||||
n: common_vendor.o($options.close),
|
||||
o: common_vendor.p({
|
||||
name: "close",
|
||||
size: 16,
|
||||
color: _ctx.color
|
||||
})
|
||||
} : {}) : {}, {
|
||||
p: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bacc3427"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-column-notice/u-column-notice.js.map
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"u-icon": "../u-icon/u-icon"
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<view class="u-notice data-v-bacc3427" bindtap="{{p}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><view wx:if="{{a}}" class="u-notice__left-icon data-v-bacc3427"><u-icon wx:if="{{b}}" class="data-v-bacc3427" u-i="bacc3427-0" bind:__l="__l" u-p="{{b}}"></u-icon></view></block><swiper disable-touch="{{f}}" vertical="{{g}}" circular interval="{{h}}" autoplay="{{true}}" class="u-notice__swiper data-v-bacc3427" bindchange="{{i}}"><swiper-item wx:for="{{c}}" wx:for-item="item" wx:key="b" class="u-notice__swiper__item data-v-bacc3427" style="{{'justify-content:' + e}}"><text class="u-notice__swiper__item__text u-line-1 data-v-bacc3427" style="{{d}}">{{item.a}}</text></swiper-item></swiper><view wx:if="{{j}}" class="u-notice__right-icon data-v-bacc3427"><u-icon wx:if="{{k}}" class="data-v-bacc3427" u-i="bacc3427-1" bind:__l="__l" u-p="{{l}}"></u-icon><u-icon wx:if="{{m}}" class="data-v-bacc3427" bindclick="{{n}}" u-i="bacc3427-2" bind:__l="__l" u-p="{{o}}"></u-icon></view></view>
|
||||
Vendored
+79
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/* uni.scss */
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
.u-empty.data-v-bacc3427,
|
||||
.u-empty__wrap.data-v-bacc3427,
|
||||
.u-tabs.data-v-bacc3427,
|
||||
.u-tabs__wrapper.data-v-bacc3427,
|
||||
.u-tabs__wrapper__scroll-view-wrapper.data-v-bacc3427,
|
||||
.u-tabs__wrapper__scroll-view.data-v-bacc3427,
|
||||
.u-tabs__wrapper__nav.data-v-bacc3427,
|
||||
.u-tabs__wrapper__nav__line.data-v-bacc3427,
|
||||
.up-empty.data-v-bacc3427,
|
||||
.up-empty__wrap.data-v-bacc3427,
|
||||
.up-tabs.data-v-bacc3427,
|
||||
.up-tabs__wrapper.data-v-bacc3427,
|
||||
.up-tabs__wrapper__scroll-view-wrapper.data-v-bacc3427,
|
||||
.up-tabs__wrapper__scroll-view.data-v-bacc3427,
|
||||
.up-tabs__wrapper__nav.data-v-bacc3427,
|
||||
.up-tabs__wrapper__nav__line.data-v-bacc3427 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
flex-basis: auto;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
}
|
||||
.u-notice.data-v-bacc3427 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.u-notice__left-icon.data-v-bacc3427 {
|
||||
align-items: center;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.u-notice__right-icon.data-v-bacc3427 {
|
||||
margin-left: 5px;
|
||||
align-items: center;
|
||||
}
|
||||
.u-notice__swiper.data-v-bacc3427 {
|
||||
height: 16px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
.u-notice__swiper__item.data-v-bacc3427 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.u-notice__swiper__item__text.data-v-bacc3427 {
|
||||
font-size: 14px;
|
||||
color: #f9ae3d;
|
||||
}
|
||||
Reference in New Issue
Block a user