Feat:优惠券对接

This commit is contained in:
lifizer
2023-12-25 17:16:56 +08:00
parent 847a80f251
commit 18a2fbb8a6
46 changed files with 1360 additions and 858 deletions
@@ -211,7 +211,7 @@ export default {
let style = {};
if (this.color) {
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
style.color = this.plain ? this.color : "#EEEEEE";
style.color = this.plain ? this.color : "white";
if (!this.plain) {
// 非镂空,背景色使用自定义的颜色
style["background-color"] = this.color;
@@ -8,7 +8,7 @@
class="u-calendar-header__subtitle"
v-if="showSubtitle"
>{{ subtitle }}</text>
<!-- <view class="u-calendar-header__weekdays">
<view class="u-calendar-header__weekdays">
<text class="u-calendar-header__weekdays__weekday"></text>
<text class="u-calendar-header__weekdays__weekday"></text>
<text class="u-calendar-header__weekdays__weekday"></text>
@@ -16,7 +16,7 @@
<text class="u-calendar-header__weekdays__weekday"></text>
<text class="u-calendar-header__weekdays__weekday"></text>
<text class="u-calendar-header__weekdays__weekday"></text>
</view> -->
</view>
</view>
</template>
@@ -10,37 +10,15 @@
<view class="u-calendar-month__days__day" v-for="(item1, index1) in item.date" :key="index1"
:style="[dayStyle(index, index1, item1)]" @tap="clickHandler(index, index1, item1)"
:class="[item1.selected && 'u-calendar-month__days__day__select--selected']">
<view class="u-calendar-month__days__day__select flex-column" >
<view class="u-calendar-month__days__day__select__info day-info"
<view class="u-calendar-month__days__day__select" :style="[daySelectStyle(index, index1, item1)]">
<text class="u-calendar-month__days__day__select__info"
:class="[item1.disabled && 'u-calendar-month__days__day__select__info--disabled']"
:style="[daySelectStyle(index, index1, item1)]">
<text :style="[textStyle(item1)]">
{{ item1.day }}
</text>
</view>
<!-- <text v-if="getBottomInfo(index, index1, item1)"
:style="[textStyle(item1)]">{{ item1.day }}</text>
<text v-if="getBottomInfo(index, index1, item1)"
class="u-calendar-month__days__day__select__buttom-info"
:class="[item1.disabled && 'u-calendar-month__days__day__select__buttom-info--disabled']"
:style="[textStyle(item1)]">{{ getBottomInfo(index, index1, item1) }}</text> -->
<!-- <text v-if="item1.dot" class="u-calendar-month__days__day__select__dot"></text> -->
<view class="align-center justify-around" v-if="getBottomInfo(index, index1, item1).text">
<text
class="font-sm mr-1"
:class="[
{'grey--text' : getBottomInfo(index, index1, item1).status == 0 },
{'error--text' : getBottomInfo(index, index1, item1).status == 1 },
{'success--text' : getBottomInfo(index, index1, item1).status == 2 }]"
>
{{ getBottomInfo(index, index1, item1).text }}
</text>
<text
v-if="item1.dot"
:class="[
{'grey' : getBottomInfo(index, index1, item1).status == 0 },
{'error' : getBottomInfo(index, index1, item1).status == 1 },
{'success' : getBottomInfo(index, index1, item1).status == 2 }]"
class="day_dot" ></text>
</view>
:style="[textStyle(item1)]">{{ getBottomInfo(index, index1, item1) }}</text>
<text v-if="item1.dot" class="u-calendar-month__days__day__select__dot"></text>
</view>
</view>
</view>
@@ -203,11 +181,10 @@
if (this.mode === 'single') {
if (date === this.selected[0]) {
// 因为需要对nvue的兼容,只能这么写,无法缩写,也无法通过类名控制等等
style.borderRadius = '50%'
// style.borderTopLeftRadius = '3px'
// style.borderBottomLeftRadius = '3px'
// style.borderTopRightRadius = '3px'
// style.borderBottomRightRadius = '3px'
style.borderTopLeftRadius = '3px'
style.borderBottomLeftRadius = '3px'
style.borderTopRightRadius = '3px'
style.borderBottomRightRadius = '3px'
}
} else if (this.mode === 'range') {
if (this.selected.length >= 2) {
@@ -373,7 +350,6 @@
},
// 点击某一个日期
clickHandler(index1, index2, item) {
this.$emit('select', item)
if (this.readonly) {
return;
}
@@ -478,25 +454,7 @@
<style lang="scss" scoped>
@import "../../libs/css/components.scss";
.align-center{
flex-direction: row !important;
align-items: center !important;
}
.day-info{
background: #Fff;
border-radius: 50%;
height: 60rpx;
width: 60rpx;
line-height: 60rpx;
}
.flex-column{
flex-direction: column !important
}
.day_dot{
width: 30rpx;
height: 15rpx;
border-radius: 15rpx;
}
.u-calendar-month-wrapper {
margin-top: 4px;
}
@@ -38,7 +38,6 @@
:maxMonth="monthNum"
:readonly="readonly"
:maxRange="maxRange"
@select="$emit('select', $event)"
:rangePrompt="rangePrompt"
:showRangePrompt="showRangePrompt"
:allowSameDay="allowSameDay"
@@ -30,7 +30,7 @@
<slot name="right-icon" v-if="$slots['right-icon']">
</slot>
<u-icon v-else :name="rightIcon" :custom-style="rightIconStyle" :color="disabled ? '#c8c9cc' : 'info'"
:size="size === 'large' ? 36 : 32"></u-icon>
:size="size === 'large' ? 18 : 16"></u-icon>
</view>
</view>
<u-line v-if="border"></u-line>
@@ -210,5 +210,5 @@ export default {
'uicon-man-delete': '\ue61a',
'uicon-man-delete-fill': '\ue66a',
'uicon-zh': '\ue70a',
'uicon-en': '\ue692',
'uicon-en': '\ue692'
}
@@ -23,13 +23,13 @@
v-if="label !== ''"
class="u-icon__label"
:style="{
color: labelColor,
fontSize: $u.addUnit(labelSize),
marginLeft: labelPos == 'right' ? $u.addUnit(space) : 0,
marginTop: labelPos == 'bottom' ? $u.addUnit(space) : 0,
marginRight: labelPos == 'left' ? $u.addUnit(space) : 0,
marginBottom: labelPos == 'top' ? $u.addUnit(space) : 0,
}"
color: labelColor,
fontSize: $u.addUnit(labelSize),
marginLeft: labelPos == 'right' ? $u.addUnit(space) : 0,
marginTop: labelPos == 'bottom' ? $u.addUnit(space) : 0,
marginRight: labelPos == 'left' ? $u.addUnit(space) : 0,
marginBottom: labelPos == 'top' ? $u.addUnit(space) : 0,
}"
>{{ label }}</text>
</view>
</template>
@@ -114,7 +114,7 @@
* @event {Function} confirm 点击确认按钮时触发
* @event {Function} cancel 点击取消按钮时触发
* @event {Function} close 点击遮罩关闭出发,closeOnClickOverlay为true有效
* @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
* @example <u-modal :show="true" title="title" content="content"></u-modal>
*/
export default {
name: 'u-modal',
@@ -146,7 +146,7 @@
},
// 点击遮罩
// 从原理上来说,modal的遮罩点击,并不是真的点击到了遮罩
// 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽然遮罩,但是为了让弹窗内容能flex居中
// 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽然遮罩,但是为了让弹窗内容能flex居中
// 多了一个透明的遮罩,此透明的遮罩会覆盖在灰色的遮罩上,所以实际上是点击不到灰色遮罩的,popup内部在
// 透明遮罩的子元素做了.stop处理,所以点击内容区,也不会导致误触发
clickHandler() {
@@ -1,12 +1,5 @@
export default {
props: {
// 是否两行
isTwoLine: {
default: false
},
twoLineText: {
default: ''
},
// 是否开启顶部安全区适配
safeAreaInsetTop: {
type: Boolean,
@@ -43,17 +43,12 @@
</slot>
</view>
<slot name="center">
<view class="flex-column">
<text
class="u-line-1 u-navbar__content__title"
:style="[{
width: $u.addUnit(titleWidth),
}, $u.addStyle(titleStyle)]"
>{{ title }}</text>
<text class="u-line-1 u-navbar__content__title font-xs grey--text" v-if="isTwoLine">
{{ twoLineText }}
</text>
</view>
<text
class="u-line-1 u-navbar__content__title"
:style="[{
width: $u.addUnit(titleWidth),
}, $u.addStyle(titleStyle)]"
>{{ title }}</text>
</slot>
<view
class="u-navbar__content__right"
@@ -34,7 +34,7 @@
<u-icon
name="close"
color="#909399"
size="36"
size="18"
bold
></u-icon>
</view>
@@ -103,7 +103,7 @@
},
// 组件选中激活时的颜色
elActiveColor() {
return this.activeColor ? this.activeColor : (this.parentData.activeColor ? this.parentData.activeColor : '#0052D9');
return this.activeColor ? this.activeColor : (this.parentData.activeColor ? this.parentData.activeColor : '#2979ff');
},
// 组件选未中激活时的颜色
elInactiveColor() {
@@ -246,7 +246,7 @@
$u-radio-square-border-radius:3px !default;
$u-radio-checked-color:#fff !default;
$u-radio-checked-background-color:red !default;
$u-radio-checked-border-color: #0052D9 !default;
$u-radio-checked-border-color: #2979ff !default;
$u-radio-disabled-background-color:#ebedf0 !default;
$u-radio-disabled--checked-color:#c8c9cc !default;
$u-radio-label-margin-left: 5px !default;
@@ -10,10 +10,6 @@ export default {
icon: String,
default: uni.$u.props.tabbarItem.icon
},
iconSize: {
icon: String,
default: 20
},
// 右上角的角标提示信息
badge: {
type: [String, Number, null],
@@ -9,7 +9,7 @@
v-if="icon"
:name="icon"
:color="isActive? parentData.activeColor : parentData.inactiveColor"
:size="iconSize"
:size="20"
></u-icon>
<template v-else>
<slot
@@ -83,7 +83,7 @@ export default {
},
// 文字装饰,下划线,中划线等,可选值 none|underline|line-through
decoration: {
tepe: String,
type: String,
default: uni.$u.props.text.decoration
},
// 外边距,对象、字符串,数值形式均可