no message

cyl/master
jscyl13849007907 1 week ago
parent e1f953c1b9
commit ce0d1e71b1

@ -699,7 +699,7 @@
"uniIdRouter": {},
"tabBar": {
"color": "#606266",
"selectedColor": "#00B666",
"selectedColor": "#3578f6",
"borderStyle": "black",
"backgroundColor": "#ffffff",
// "custom": true,

@ -39,18 +39,31 @@
<!-- <div v-if="appid == 'wxb0c590fd696b79be'">
<promotion cusType="image"></promotion>
</div> -->
<!-- <div>
<div>
<promotion cusType="image"></promotion>
</div> -->
</div>
</div>
<!--为最外层的大盒子-->
<!-- && appid != 'wxb0c590fd696b79be' -->
<!-- noticList.length > 0 && -->
<view class="g_flex_row_start flex_center g_bg_f g_ml_10 g_mr_10 g_radius_8" style="overflow: hidden" @click="noticeClick" v-if="false">
<view class="g_flex_row_start flex_center g_bg_f g_ml_10 g_mr_10 g_radius_8" style="overflow: hidden;margin-top: 8px;"
v-if="appid == 'wx15bc9c758f4eb129' && isAdmin"
>
<view class="g_flex_column_center g_h_48">
<image class="g_w_48 g_h_48" :src="noticeImg" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""> </image>
</view>
<u-notice-bar ref="noticeBar" :playState="showNotic" color="#333" padding="0rpx" font-size="32" style="width: calc(100% - 54px)" :speed="100" :volume-icon="false" type="none" :list="noticList"></u-notice-bar>
<u-notice-bar ref="noticeBar"
color="#333"
padding="0rpx"
font-size="32"
style="width: calc(100% - 54px)"
:speed="100"
:volume-icon="false"
type="none"
:list="noticList"
:more-icon='isAdmin ? true : false'
@getMore="getMore"
></u-notice-bar>
</view>
<view class="sticky g_flex_row_between flex_center" :class="toTop ? 'g_bg_f defaultShadow' : 'g_bg_f_5'" ref="tttop" id="tttop">
<view class="" style="">
@ -338,6 +351,7 @@ export default {
},
data() {
return {
isAdmin: uni.getStorageSync("apply-userinfo").admin,
hrtext: 2,
tabbarShow: true,
navbarHeight: 0, // navbar
@ -485,6 +499,12 @@ export default {
}
},
methods: {
getMore(){
let that = this;
uni.navigateTo({
url:'/root/merchantManagement/dynamicNotice?cont=' + that.noticList[0]
})
},
loadSelectedCityFromCache() {
// 'selectedCity'
return new Promise((reso, rej) => {

@ -1,6 +1,6 @@
<template>
<view class="p-root-merchantManagement-dynamicNotice g_bg_f_5 g_p_10 g_pb_120" style="min-height: 100vh;padding-top: 24px;">
<view class="g_pt_10" hover-class="none" hover-stop-propagation="false">
<view class="p-root-merchantManagement-dynamicNotice g_bg_f_5 g_p_10 g_pb_120" style="min-height: 100vh;padding-top: 10px;">
<view class="g_pt_10" hover-class="none" hover-stop-propagation="false" v-if="false">
<view class="g_mb_4 g_pl_10 g_c_6">预览</view>
<view class="g_flex_row_start flex_center g_bg_f g_radius_8" style="overflow: hidden">
<view class="g_flex_column_center g_h_48">
@ -9,14 +9,14 @@
<u-notice-bar color="#333" padding="0rpx" :playState="playState" font-size="32" style="width: calc(100% - 54px)" :speed="100" :volume-icon="false" type="none" :list="noticList"></u-notice-bar>
</view>
</view>
<view class="g_mt_32">
<view class="g_mb_4 g_pl_10 g_c_6">公告内</view>
<view class="">
<view class="g_mb_4 g_pl_10 g_c_6" v-if="false"></view>
<view class="g_bg_f g_pl_10 g_radius_8">
<u-input type="textarea" height="240" :customStyle="{ fontSize: '34rpx' }" :clearable="false" autoHeight :value="notice" @input="changeNotice"></u-input>
</view>
<view class="g_mt_32" hover-class="none" hover-stop-propagation="false">
<rh-button :type="isChange ? 'primary' : 'disabled'" btnText="提交" @clickBtn="subNameInfo"
:loading="isSubmit"
<view class="g_mt_32" hover-class="none" hover-stop-propagation="false" style="margin-top: 214px;">
<rh-button primaryColor='#3578f6' :type="isChange ? 'primary' : 'disabled'" btnText="完成" @clickBtn="subNameInfo"
:loading="isSubmit" size='new'
/>
</view>
</view>
@ -43,6 +43,9 @@ export default {
}
console.log(this.appInfo);
var reg = /[\r\n]/g;
if(options.cont){
this.appInfo.notice = options.cont;
}
this.noticList[0] = this.appInfo.notice.replace(reg, "");
this.notice = this.appInfo.notice;
this.sqlStr = this.appInfo.notice;
@ -104,21 +107,11 @@ export default {
</script>
<style lang="less">
.p-root-person-idform {
.m-submit {
.bocai_btn_type_infro {
background: #ccc !important;
color: #fff !important;
font-weight: 600 !important;
font-size: 18px !important;
}
}
.cardText {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
text-align: center;
.p-root-merchantManagement-dynamicNotice{
.g-components-button .bocai_btn_size_new{
width: 240px !important;
height: 40px !important;
line-height: 38px !important;
}
}
</style>

@ -0,0 +1,273 @@
<template>
<view class="u-notice-bar-wrap" v-if="isShow" :style="{
borderRadius: borderRadius + 'rpx',
}">
<block v-if="mode == 'horizontal' && isCircular">
<u-row-notice
:type="type"
:color="color"
:bgColor="bgColor"
:list="list"
:volumeIcon="volumeIcon"
:moreIcon="moreIcon"
:volumeSize="volumeSize"
:closeIcon="closeIcon"
:mode="mode"
:fontSize="fontSize"
:speed="speed"
:playState="playState"
:padding="padding"
@getMore="getMore"
@close="close"
@click="click"
></u-row-notice>
</block>
<block v-if="mode == 'vertical' || (mode == 'horizontal' && !isCircular)">
<u-column-notice
:type="type"
:color="color"
:bgColor="bgColor"
:list="list"
:volumeIcon="volumeIcon"
:moreIcon="moreIcon"
:closeIcon="closeIcon"
:mode="mode"
:volumeSize="volumeSize"
:disable-touch="disableTouch"
:fontSize="fontSize"
:duration="duration"
:playState="playState"
:padding="padding"
@getMore="getMore"
@close="close"
@click="click"
@end="end"
></u-column-notice>
</block>
</view>
</template>
<script>
/**
* noticeBar 滚动通知
* @description 该组件用于滚动通告场景有多种模式可供选择
* @tutorial https://www.uviewui.com/components/noticeBar.html
* @property {Array} list 滚动内容数组形式见上方说明
* @property {String} type 显示的主题默认warning
* @property {Boolean} volume-icon 是否显示小喇叭图标默认true
* @property {Boolean} more-icon 是否显示右边的向右箭头默认false
* @property {Boolean} close-icon 是否显示关闭图标默认false
* @property {Boolean} autoplay 是否自动播放默认true
* @property {String} color 文字颜色
* @property {String Number} bg-color 背景颜色
* @property {String} mode 滚动模式默认horizontal
* @property {Boolean} show 是否显示默认true
* @property {String Number} font-size 字体大小单位rpx默认28
* @property {String Number} volume-size 左边喇叭的大小默认34
* @property {String Number} duration 滚动周期时长只对步进模式有效横向衔接模式无效单位ms默认2000
* @property {String Number} speed 水平滚动时的滚动速度即每秒移动多少距离只对水平衔接方式有效单位rpx默认160
* @property {String Number} font-size 字体大小单位rpx默认28
* @property {Boolean} is-circular mode为horizontal时指明是否水平衔接滚动默认true
* @property {String} play-state 播放状态play - 播放paused - 暂停默认play
* @property {String Number} border-radius 通知栏圆角默认为0
* @property {String Number} padding 内边距字符串与普通的内边距css写法一直默认"18rpx 24rpx"
* @property {Boolean} no-list-hidden 列表为空时是否显示组件默认false
* @property {Boolean} disable-touch 是否禁止通过手动滑动切换通知只有mode = vertical或者mode = horizontal且is-circular = false时有效默认true
* @event {Function} click 点击通告文字触发只有mode = vertical或者mode = horizontal且is-circular = false时有效
* @event {Function} close 点击右侧关闭图标触发
* @event {Function} getMore 点击右侧向右图标触发
* @event {Function} end 列表的消息每次被播放一个周期时触发只有mode = vertical或者mode = horizontal且is-circular = false时有效
* @example <u-notice-bar :more-icon="true" :list="list"></u-notice-bar>
*/
export default {
name: "u-notice-bar",
emits: ["click", "close", "getMore", "end"],
props: {
//
list: {
type: Array,
default() {
return [];
}
},
// success|error|primary|info|warning
type: {
type: String,
default: 'warning'
},
//
volumeIcon: {
type: Boolean,
default: true
},
//
volumeSize: {
type: [Number, String],
default: 34
},
//
moreIcon: {
type: Boolean,
default: false
},
//
closeIcon: {
type: Boolean,
default: false
},
//
autoplay: {
type: Boolean,
default: true
},
// 使
color: {
type: String,
default: ''
},
//
bgColor: {
type: String,
default: ''
},
// horizontal-vertical-
mode: {
type: String,
default: 'horizontal'
},
//
show: {
type: Boolean,
default: true
},
// rpx
fontSize: {
type: [Number, String],
default: 28
},
// ms
duration: {
type: [Number, String],
default: 2000
},
// rpx
speed: {
type: [Number, String],
default: 160
},
//
// swiper
isCircular: {
type: Boolean,
default: true
},
// play-paused-
playState: {
type: String,
default: 'play'
},
//
// HX2.6.11App 2.5.5+H5 2.5.5+
disableTouch: {
type: Boolean,
default: true
},
//
borderRadius: {
type: [Number, String],
default: 0
},
//
padding: {
type: [Number, String],
default: '18rpx 24rpx'
},
// list
noListHidden: {
type: Boolean,
default: true
}
},
computed: {
// showfalsenoListHiddentruelist
isShow() {
if(this.show == false || (this.noListHidden == true && this.list.length == 0)) return false;
else return true;
}
},
methods: {
//
click(index) {
this.$emit('click', index);
},
//
close() {
this.$emit('close');
},
//
getMore() {
this.$emit('getMore');
},
//
end() {
this.$emit('end');
}
}
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-notice-bar-wrap {
overflow: hidden;
}
.u-notice-bar {
padding: 18rpx 24rpx;
overflow: hidden;
}
.u-direction-row {
@include vue-flex;
align-items: center;
justify-content: space-between;
}
.u-left-icon {
@include vue-flex;
align-items: center;
}
.u-notice-box {
flex: 1;
@include vue-flex;
overflow: hidden;
margin-left: 12rpx;
}
.u-right-icon {
margin-left: 12rpx;
@include vue-flex;
align-items: center;
}
.u-notice-content {
line-height: 1;
white-space: nowrap;
font-size: 26rpx;
animation: u-loop-animation 10s linear infinite both;
text-align: right;
//
padding-left: 100%;
}
@keyframes u-loop-animation {
0% {
transform: translate3d(0, 0, 0);
}
100% {
transform: translate3d(-100%, 0, 0);
}
}
</style>

@ -0,0 +1,270 @@
<template>
<view
v-if="show"
class="u-notice-bar"
:style="{
background: computeBgColor,
padding: padding
}"
:class="[
type ? `u-type-${type}-light-bg` : ''
]"
>
<view class="u-direction-row">
<view class="u-icon-wrap">
<u-icon class="u-left-icon" v-if="volumeIcon" name="volume-fill" :size="volumeSize" :color="computeColor"></u-icon>
</view>
<view class="u-notice-box" id="u-notice-box">
<view
class="u-notice-content"
id="u-notice-content"
:style="{
animationDuration: animationDuration,
animationPlayState: animationPlayState,
}"
>
<text class="u-notice-text" @tap="click" :style="[textStyle]"
:class="['u-type-' + type]">{{showText}}</text>
</view>
</view>
<view class="u-icon-wrap">
<u-icon @click="getMore" class="u-right-icon" v-if="moreIcon" name="arrow-right" :size="26" :color="computeColor"></u-icon>
<u-icon @click="close" class="u-right-icon" v-if="closeIcon" name="close" :size="24" :color="computeColor"></u-icon>
</view>
</view>
</view>
</template>
<script>
export default {
emits: ["close", "getMore"],
props: {
//
list: {
type: Array,
default() {
return [];
}
},
// success|error|primary|info|warning|none
// none(contentColor)
type: {
type: String,
default: 'warning'
},
//
volumeIcon: {
type: Boolean,
default: true
},
//
moreIcon: {
type: Boolean,
default: false
},
//
closeIcon: {
type: Boolean,
default: false
},
//
autoplay: {
type: Boolean,
default: true
},
// 使
color: {
type: String,
default: ''
},
//
bgColor: {
type: String,
default: ''
},
//
show: {
type: Boolean,
default: true
},
// rpx
fontSize: {
type: [Number, String],
default: 26
},
//
volumeSize: {
type: [Number, String],
default: 34
},
// rpx
speed: {
type: [Number, String],
default: 160
},
// play-paused-
playState: {
type: String,
default: 'play'
},
//
padding: {
type: [Number, String],
default: '18rpx 24rpx'
}
},
data() {
return {
textWidth: 0, //
boxWidth: 0, //
animationDuration: '10s', //
animationPlayState: 'paused', //
showText: '' //
};
},
watch: {
list: {
immediate: true,
handler(val) {
this.showText = val.join('');
this.$nextTick(() => {
this.initSize();
});
}
},
playState(val) {
if(val == 'play') this.animationPlayState = 'running';
else this.animationPlayState = 'paused';
},
speed(val) {
this.initSize();
}
},
computed: {
// uview
computeColor() {
if (this.color) return this.color;
// 使content-color
else if(this.type == 'none') return '#606266';
else return this.type;
},
//
textStyle() {
let style = {};
if (this.color) style.color = this.color;
else if(this.type == 'none') style.color = '#606266';
style.fontSize = this.fontSize + 'rpx';
return style;
},
//
computeBgColor() {
if (this.bgColor) return this.bgColor;
else if(this.type == 'none') return 'transparent';
}
},
mounted() {
this.$nextTick(() => {
this.initSize();
});
},
methods: {
initSize() {
let query = [],
boxWidth = 0,
textWidth = 0;
let textQuery = new Promise((resolve, reject) => {
uni.createSelectorQuery()
.in(this)
.select(`#u-notice-content`)
.boundingClientRect()
.exec(ret => {
this.textWidth = ret[0].width;
resolve();
});
});
query.push(textQuery);
Promise.all(query).then(() => {
// t=s/v(=/)#u-notice-box.u-notice-contentpadding-left: 100%
// #u-notice-box
this.animationDuration = `${this.textWidth / uni.upx2px(this.speed)}s`;
// APP(HX2.4.6IOS13)
this.animationPlayState = 'paused';
setTimeout(() => {
if(this.playState == 'play' && this.autoplay) this.animationPlayState = 'running';
}, 10);
});
},
//
click(index) {
this.$emit('click');
},
//
close() {
this.$emit('close');
},
//
getMore() {
this.$emit('getMore');
}
}
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-notice-bar {
padding: 18rpx 24rpx;
overflow: hidden;
}
.u-direction-row {
@include vue-flex;
align-items: center;
justify-content: space-between;
}
.u-left-icon {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
}
.u-notice-box {
flex: 1;
@include vue-flex;
overflow: hidden;
margin-left: 12rpx;
}
.u-right-icon {
margin-left: 12rpx;
display: inline-flex;
align-items: center;
}
.u-notice-content {
animation: u-loop-animation 10s linear infinite both;
text-align: right;
//
padding-left: 100%;
@include vue-flex;
flex-wrap: nowrap;
}
.u-notice-text {
font-size: 26rpx;
word-break: keep-all;
white-space: nowrap
}
@keyframes u-loop-animation {
0% {
transform: translate3d(0, 0, 0);
}
100% {
transform: translate3d(-100%, 0, 0);
}
}
</style>
Loading…
Cancel
Save