gxd-uni-library-editx 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +14 -0
- package/README.md +447 -0
- package/index.js +3 -0
- package/package.json +104 -0
- package/postcss.config.js +22 -0
- package/settings.js.tpl +68 -0
- package/src/XdAppClass.1.0.js +257 -0
- package/src/XdAppClass.js +150 -0
- package/src/components/XdAddress/XdAddress.vue +579 -0
- package/src/components/XdAddressSelect/XdAddressSelect.vue +243 -0
- package/src/components/XdBaiduMap/XdBaiduMap.vue +204 -0
- package/src/components/XdBaiduOverlay/XdBaiduOverlay.vue +345 -0
- package/src/components/XdBaiduSearch/XdBaiduSearch.vue +354 -0
- package/src/components/XdBar/XdBar.vue +339 -0
- package/src/components/XdButton/XdButton.vue +288 -0
- package/src/components/XdCartList/XdCartList.vue +791 -0
- package/src/components/XdCartNoStoreList/XdCartNoStoreList.vue +747 -0
- package/src/components/XdCity/XdCity.vue +620 -0
- package/src/components/XdCity/city.js +93 -0
- package/src/components/XdCity/testData.js +124 -0
- package/src/components/XdCityLocation/XdCityLocation.vue +314 -0
- package/src/components/XdCityLocation/jweixin.js +72 -0
- package/src/components/XdCityShow/XdCityShow.vue +354 -0
- package/src/components/XdClipImage/XdClipImage.vue +879 -0
- package/src/components/XdCoins/XdCoins.vue +66 -0
- package/src/components/XdConfirm/XdConfirm.vue +240 -0
- package/src/components/XdContentXss/XdContentXss.vue +71 -0
- package/src/components/XdDailog/XdDailog.vue +258 -0
- package/src/components/XdDate/XdDataItemOne.vue +236 -0
- package/src/components/XdDate/XdDate.vue +1081 -0
- package/src/components/XdDate/XdDateItem.vue +316 -0
- package/src/components/XdDate/XdDateTime.vue +929 -0
- package/src/components/XdDate/i18n/en.json +19 -0
- package/src/components/XdDate/i18n/index.js +8 -0
- package/src/components/XdDate/i18n/zh-Hans.json +19 -0
- package/src/components/XdDate/i18n/zh-Hant.json +19 -0
- package/src/components/XdDate/keypress.js +45 -0
- package/src/components/XdDate/util.js +418 -0
- package/src/components/XdDownDrawer/XdDownDrawer.vue +176 -0
- package/src/components/XdEditPwd/XdEditPwd.vue +305 -0
- package/src/components/XdEnterOrderList/XdEnterOrderList.vue +413 -0
- package/src/components/XdExpressTimeLine/XdExpressTimeLine.vue +280 -0
- package/src/components/XdFilter/XdFilter.vue +541 -0
- package/src/components/XdFontIcon/XdFontIcon.vue +165 -0
- package/src/components/XdFontIcon/css/icon.less +498 -0
- package/src/components/XdFooterBar/XdFooterBar.vue +291 -0
- package/src/components/XdFooterTabbar/XdFooterTabbar.vue +284 -0
- package/src/components/XdForm/XdForm.vue +481 -0
- package/src/components/XdForm/validate.js +486 -0
- package/src/components/XdFormCheckbox/XdFormCheckbox.vue +858 -0
- package/src/components/XdFormDate.vue +187 -0
- package/src/components/XdFormInput/XdFormInput.vue +535 -0
- package/src/components/XdFormInput/common.js +56 -0
- package/src/components/XdFormItem/XdFormItem.vue +583 -0
- package/src/components/XdFormSelect/XdFormSelect.vue +119 -0
- package/src/components/XdImage/XdImage.vue +113 -0
- package/src/components/XdItemCardUser/XdItemCardUser.vue +232 -0
- package/src/components/XdItemFilmImage/XdItemFilmImage.vue +146 -0
- package/src/components/XdItemFilmText/XdItemFilmText.vue +83 -0
- package/src/components/XdItemPhysical/XdItemPhysical.vue +410 -0
- package/src/components/XdItemPhysicalPack/XdItemPhysicalPack.vue +240 -0
- package/src/components/XdItemStore/XdItemStore.vue +236 -0
- package/src/components/XdItemUserInfo/XdItemUserInfo.vue +175 -0
- package/src/components/XdJson/XdJson.vue +398 -0
- package/src/components/XdKeyValue/XdKeyValue.vue +150 -0
- package/src/components/XdLabelNew/XdLabelNew.vue +193 -0
- package/src/components/XdLayout/XdLayout.vue +634 -0
- package/src/components/XdLoading/XdLoading.vue +165 -0
- package/src/components/XdMore/XdMore.vue +66 -0
- package/src/components/XdMpHtml/XdMpHtml.vue +458 -0
- package/src/components/XdMpHtml/node/node.vue +536 -0
- package/src/components/XdMpHtml/parser.js +1260 -0
- package/src/components/XdMpHtml/static/js/handler.js +1 -0
- package/src/components/XdMpHtml/static/js/uni.webview.min.js +1 -0
- package/src/components/XdMpHtml/static/local.html +1 -0
- package/src/components/XdMy/XdMy.vue +294 -0
- package/src/components/XdMySuccess/XdMySuccess.vue +603 -0
- package/src/components/XdNavTab/XdNavTab.vue +147 -0
- package/src/components/XdNoData/XdNoData.vue +87 -0
- package/src/components/XdNoticeBar/XdNoticeBar.vue +501 -0
- package/src/components/XdNumber/XdNumber.vue +210 -0
- package/src/components/XdNumberUni/XdNumberUni.vue +270 -0
- package/src/components/XdNumberUni/readme.md +42 -0
- package/src/components/XdOnlineConfirm/XdOnlineConfirm.vue +385 -0
- package/src/components/XdOnlineDetail/XdOnlineDetail.vue +332 -0
- package/src/components/XdOnlinePay/XdOnlinePay.vue +349 -0
- package/src/components/XdOnlineSchedule/XdOnlineSchedule.vue +453 -0
- package/src/components/XdOnlineSeat/XdOnlineSeat.vue +796 -0
- package/src/components/XdOnlineSeatMove/XdOnlineSeatMove.vue +1012 -0
- package/src/components/XdPayCombo/XdPayCombo.vue +118 -0
- package/src/components/XdPreviewImage/XdPreviewImage.vue +372 -0
- package/src/components/XdPwPay/XdPwPay.vue +214 -0
- package/src/components/XdRadio/XdRadio.vue +151 -0
- package/src/components/XdRangeSlider/XdRangeSlider.vue +355 -0
- package/src/components/XdRedName/XdRedName.vue +35 -0
- package/src/components/XdSearchBar/XdSearchBar.vue +286 -0
- package/src/components/XdSelect/XdSelect.vue +382 -0
- package/src/components/XdSelectCity/XdSelectCity.vue +270 -0
- package/src/components/XdSelectTime/XdSelectTime.vue +342 -0
- package/src/components/XdStar/XdStar.vue +261 -0
- package/src/components/XdStoreCashier/XdStoreCashier.vue +526 -0
- package/src/components/XdStoreItem/XdStoreItem.vue +400 -0
- package/src/components/XdStoreOrderDetail/XdStoreOrderDetail.vue +1571 -0
- package/src/components/XdStoreOrderList/XdStoreOrderList.vue +450 -0
- package/src/components/XdStoreProductInfo/XdStoreProductInfo.vue +940 -0
- package/src/components/XdStoreProductType/XdStoreProductType.vue +307 -0
- package/src/components/XdSuccess/XdSuccess.vue +527 -0
- package/src/components/XdSwipeSelect/XdSwipeSelect.vue +99 -0
- package/src/components/XdSwiper/XdSwiper.vue +124 -0
- package/src/components/XdSwitch/XdSwitch.vue +204 -0
- package/src/components/XdTab/XdTab.vue +220 -0
- package/src/components/XdTabScroll/XdTabScroll.vue +212 -0
- package/src/components/XdTag/XdTag.vue +423 -0
- package/src/components/XdTimeLine/XdTimeLine.vue +121 -0
- package/src/components/XdTips/XdTips.vue +212 -0
- package/src/components/XdTipsBlock/XdTipsBlock.vue +141 -0
- package/src/components/XdTitleSection/XdTitleSection.vue +152 -0
- package/src/components/XdTitleTab/XdTitleTab.vue +227 -0
- package/src/components/XdUnit/XdUnit.vue +206 -0
- package/src/components/XdUpload/XdUpload.vue +197 -0
- package/src/components/XdUploadImage/XdUploadImage.vue +145 -0
- package/src/components/Xdlogs/XdLogs.vue +144 -0
- package/src/components/autoload.js +211 -0
- package/src/components/swipeAction/UniSwipeAction.vue +43 -0
- package/src/components/swipeActionItem/UniSwipeActionItem.vue +386 -0
- package/src/components/swipeActionItem/bindingx.js +298 -0
- package/src/components/swipeActionItem/index.wxs +321 -0
- package/src/components/swipeActionItem/isPC.js +18 -0
- package/src/components/swipeActionItem/mpalipay.js +210 -0
- package/src/components/swipeActionItem/mpother.js +252 -0
- package/src/components/swipeActionItem/mpwxs.js +140 -0
- package/src/dome/dome/address.vue +415 -0
- package/src/dome/dome/auth/login.vue +166 -0
- package/src/dome/dome/baidu_show.vue +20 -0
- package/src/dome/dome/cake.vue +186 -0
- package/src/dome/dome/cart.vue +205 -0
- package/src/dome/dome/cart_store.vue +149 -0
- package/src/dome/dome/cashier/cashier.vue +73 -0
- package/src/dome/dome/cashier/check_cashier.vue +469 -0
- package/src/dome/dome/cashier/success.vue +127 -0
- package/src/dome/dome/city.vue +148 -0
- package/src/dome/dome/cityData.js +9 -0
- package/src/dome/dome/clip.vue +82 -0
- package/src/dome/dome/date/date.vue +273 -0
- package/src/dome/dome/date/selected.js +315 -0
- package/src/dome/dome/dcom/app1.vue +13 -0
- package/src/dome/dome/dcom/app2.vue +13 -0
- package/src/dome/dome/dcom/app3.vue +13 -0
- package/src/dome/dome/dcom/app4.vue +13 -0
- package/src/dome/dome/dcom/app5.vue +13 -0
- package/src/dome/dome/dcom/index.vue +1 -0
- package/src/dome/dome/debug/debug.vue +95 -0
- package/src/dome/dome/docache/docache.vue +88 -0
- package/src/dome/dome/express.vue +269 -0
- package/src/dome/dome/form.vue +312 -0
- package/src/dome/dome/icon.js +125 -0
- package/src/dome/dome/icon.vue +93 -0
- package/src/dome/dome/index.vue +725 -0
- package/src/dome/dome/item.vue +236 -0
- package/src/dome/dome/json/json.vue +88 -0
- package/src/dome/dome/layout.vue +105 -0
- package/src/dome/dome/line.vue +113 -0
- package/src/dome/dome/map/search.vue +70 -0
- package/src/dome/dome/my.vue +171 -0
- package/src/dome/dome/notice.vue +93 -0
- package/src/dome/dome/online/confirm.vue +92 -0
- package/src/dome/dome/online/detail.vue +80 -0
- package/src/dome/dome/online/pay.vue +78 -0
- package/src/dome/dome/online/schedule.vue +73 -0
- package/src/dome/dome/online/seat.vue +98 -0
- package/src/dome/dome/order/detail.vue +166 -0
- package/src/dome/dome/order/enter_order.vue +294 -0
- package/src/dome/dome/order/list.vue +219 -0
- package/src/dome/dome/order/order.js +18 -0
- package/src/dome/dome/order/success.vue +68 -0
- package/src/dome/dome/product.vue +179 -0
- package/src/dome/dome/store_cashier.vue +67 -0
- package/src/dome/dome/swiper.vue +32 -0
- package/src/dome/dome/webview.vue +61 -0
- package/src/install.js +183 -0
- package/src/main/address/address.vue +251 -0
- package/src/main/cart/cart.vue +149 -0
- package/src/main/cashier/cashier.vue +72 -0
- package/src/main/cashier/check_cashier.vue +483 -0
- package/src/main/city/city.vue +149 -0
- package/src/main/date/date.vue +260 -0
- package/src/main/order/order.js +19 -0
- package/src/main/order/order.vue +222 -0
- package/src/main/product/detail.vue +121 -0
- package/src/main/product/type.vue +108 -0
- package/src/main/search/search.vue +501 -0
- package/src/pages.json +337 -0
- package/src/plugins/CreatedComponentsPlugin.js +19 -0
- package/src/plugins/JsonRename.js +72 -0
- package/src/plugins/SetAppParams.js +171 -0
- package/src/project.js +18 -0
- package/src/utils/Cookie.js +68 -0
- package/src/utils/Runtime.js +105 -0
- package/src/utils/Storage.js +104 -0
- package/src/utils/XdNetwork.js +133 -0
- package/src/utils/helper.js +1321 -0
- package/src/utils/nourl.js +95 -0
- package/src/utils/project.js +17 -0
- package/src/utils/xd.auth.js +61 -0
- package/src/utils/xd.base.js +474 -0
- package/src/utils/xd.common.js +240 -0
- package/src/utils/xd.event.js +99 -0
- package/src/utils/xd.frame.js +96 -0
- package/src/utils/xd.path.js +96 -0
- package/src/utils/xdAppLog.js +170 -0
- package/src/utils/xdWxLog.js +302 -0
- package/src/utils/xdh5log.js +307 -0
- package/src/websetting.js +64 -0
- package/tsconfig.json +9 -0
- package/xd.less +180 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view v-if="show" class="uni-noticebar" :style="{ backgroundColor: backgroundColor }" @click="onClick">
|
|
3
|
+
<!-- #ifdef MP-ALIPAY -->
|
|
4
|
+
<view
|
|
5
|
+
v-if="showClose === true || showClose === 'true'"
|
|
6
|
+
class="uni-noticebar-close uni-cursor-point"
|
|
7
|
+
@click="close"
|
|
8
|
+
>
|
|
9
|
+
<xd-font-icon
|
|
10
|
+
:color="color"
|
|
11
|
+
size="20"
|
|
12
|
+
icon="iconguanbi2"
|
|
13
|
+
width="30"
|
|
14
|
+
height="30"
|
|
15
|
+
></xd-font-icon>
|
|
16
|
+
</view>
|
|
17
|
+
<view
|
|
18
|
+
v-if="showIcon === true || showIcon === 'true'"
|
|
19
|
+
class="uni-noticebar-icon"
|
|
20
|
+
>
|
|
21
|
+
<xd-font-icon
|
|
22
|
+
icon="icontongzhi"
|
|
23
|
+
:color="color"
|
|
24
|
+
size="30"
|
|
25
|
+
width="30"
|
|
26
|
+
height="30"
|
|
27
|
+
></xd-font-icon>
|
|
28
|
+
</view>
|
|
29
|
+
<!-- #endif -->
|
|
30
|
+
<!-- #ifndef MP-ALIPAY -->
|
|
31
|
+
<xd-font-icon
|
|
32
|
+
class="uni-noticebar-icon"
|
|
33
|
+
v-if="showIcon === true || showIcon === 'true'"
|
|
34
|
+
icon="icontongzhi"
|
|
35
|
+
:color="color"
|
|
36
|
+
size="30"
|
|
37
|
+
width="30"
|
|
38
|
+
height="30"
|
|
39
|
+
></xd-font-icon>
|
|
40
|
+
<!-- #endif -->
|
|
41
|
+
<view
|
|
42
|
+
ref="textBox"
|
|
43
|
+
class="uni-noticebar__content-wrapper"
|
|
44
|
+
:class="{
|
|
45
|
+
'uni-noticebar__content-wrapper--scrollable':scrollable,
|
|
46
|
+
'uni-noticebar__content-wrapper--single':!scrollable && (single || moreText)
|
|
47
|
+
}">
|
|
48
|
+
<view
|
|
49
|
+
:id="elIdBox"
|
|
50
|
+
class="uni-noticebar__content"
|
|
51
|
+
:class="{
|
|
52
|
+
'uni-noticebar__content--scrollable':scrollable,
|
|
53
|
+
'uni-noticebar__content--single':!scrollable && (single || moreText)
|
|
54
|
+
}">
|
|
55
|
+
<view
|
|
56
|
+
:id="elId" ref="animationEle"
|
|
57
|
+
class="uni-noticebar__content-text"
|
|
58
|
+
:class="{
|
|
59
|
+
'uni-noticebar__content-text--scrollable':scrollable,
|
|
60
|
+
'uni-noticebar__content-text--single':!scrollable && (single || moreText)
|
|
61
|
+
}"
|
|
62
|
+
:style="{
|
|
63
|
+
color:color,
|
|
64
|
+
width:wrapWidth+'px',
|
|
65
|
+
'animationDuration': animationDuration,
|
|
66
|
+
'-webkit-animationDuration': animationDuration ,
|
|
67
|
+
animationPlayState: webviewHide?'paused':animationPlayState,
|
|
68
|
+
'-webkit-animationPlayState':webviewHide?'paused':animationPlayState,
|
|
69
|
+
animationDelay: '1s',
|
|
70
|
+
'-webkit-animationDelay':'1s'
|
|
71
|
+
}">
|
|
72
|
+
<slot>
|
|
73
|
+
<view>1. 本插件需要申请的系统权限列表:</view>
|
|
74
|
+
<view>2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:</view>
|
|
75
|
+
<view>3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:</view>
|
|
76
|
+
</slot>
|
|
77
|
+
</view>
|
|
78
|
+
</view>
|
|
79
|
+
</view>
|
|
80
|
+
<xd-font-icon
|
|
81
|
+
v-if="showClose === true || showClose === 'true'"
|
|
82
|
+
:color="color"
|
|
83
|
+
size="20"
|
|
84
|
+
icon="iconguanbi2"
|
|
85
|
+
@click="close"
|
|
86
|
+
width="30"
|
|
87
|
+
height="30"
|
|
88
|
+
></xd-font-icon>
|
|
89
|
+
<view
|
|
90
|
+
v-if="showGetMore === true || showGetMore === 'true'"
|
|
91
|
+
class="uni-noticebar__more uni-cursor-point"
|
|
92
|
+
@click="clickMore"
|
|
93
|
+
>
|
|
94
|
+
<text v-if="moreText" :style="{ color: moreColor }" class="uni-noticebar__more-text">{{ moreText }}</text>
|
|
95
|
+
<xd-font-icon
|
|
96
|
+
:color="color"
|
|
97
|
+
size="20"
|
|
98
|
+
icon="iconjiantou"
|
|
99
|
+
width="30"
|
|
100
|
+
height="30"
|
|
101
|
+
></xd-font-icon>
|
|
102
|
+
</view>
|
|
103
|
+
</view>
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<script>
|
|
107
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
108
|
+
|
|
109
|
+
// #ifdef APP-NVUE
|
|
110
|
+
const dom = weex.requireModule('dom');
|
|
111
|
+
const animation = weex.requireModule('animation');
|
|
112
|
+
// #endif
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* XdNoticeBar 自定义导航栏
|
|
116
|
+
* @description 通告栏组件
|
|
117
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=30
|
|
118
|
+
* @property {Number} speed 文字滚动的速度,默认100px/秒
|
|
119
|
+
* @property {String} text 显示文字
|
|
120
|
+
* @property {String} backgroundColor 背景颜色
|
|
121
|
+
* @property {String} color 文字颜色
|
|
122
|
+
* @property {String} moreColor 查看更多文字的颜色
|
|
123
|
+
* @property {String} moreText 设置“查看更多”的文本
|
|
124
|
+
* @property {Boolean} single = [true|false] 是否单行
|
|
125
|
+
* @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行
|
|
126
|
+
* @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标
|
|
127
|
+
* @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮
|
|
128
|
+
* @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行
|
|
129
|
+
* @event {Function} click 点击 NoticeBar 触发事件
|
|
130
|
+
* @event {Function} close 关闭 NoticeBar 触发事件
|
|
131
|
+
* @event {Function} getmore 点击”查看更多“时触发事件
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
export default {
|
|
135
|
+
name: 'XdNoticeBar',
|
|
136
|
+
components: {
|
|
137
|
+
XdFontIcon
|
|
138
|
+
},
|
|
139
|
+
props: {
|
|
140
|
+
text: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: ''
|
|
143
|
+
},
|
|
144
|
+
moreText: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: ''
|
|
147
|
+
},
|
|
148
|
+
backgroundColor: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: '#fffbe8'
|
|
151
|
+
},
|
|
152
|
+
speed: {
|
|
153
|
+
// 默认1s滚动100px
|
|
154
|
+
type: Number,
|
|
155
|
+
default: 50
|
|
156
|
+
},
|
|
157
|
+
color: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: '#de8c17'
|
|
160
|
+
},
|
|
161
|
+
moreColor: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: '#999999'
|
|
164
|
+
},
|
|
165
|
+
single: {
|
|
166
|
+
// 是否单行
|
|
167
|
+
type: [Boolean, String],
|
|
168
|
+
default: false
|
|
169
|
+
},
|
|
170
|
+
scrollable: {
|
|
171
|
+
// 是否滚动,添加后控制单行效果取消
|
|
172
|
+
type: [Boolean, String],
|
|
173
|
+
default: false
|
|
174
|
+
},
|
|
175
|
+
showIcon: {
|
|
176
|
+
// 是否显示左侧icon
|
|
177
|
+
type: [Boolean, String],
|
|
178
|
+
default: false
|
|
179
|
+
},
|
|
180
|
+
showGetMore: {
|
|
181
|
+
// 是否显示右侧查看更多
|
|
182
|
+
type: [Boolean, String],
|
|
183
|
+
default: false
|
|
184
|
+
},
|
|
185
|
+
showClose: {
|
|
186
|
+
// 是否显示左侧关闭按钮
|
|
187
|
+
type: [Boolean, String],
|
|
188
|
+
default: false
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
data() {
|
|
192
|
+
const elId = `Uni_text_${Math.ceil(Math.random() * 10e5).toString(36)}`
|
|
193
|
+
const elIdBox = `Uni_box_${Math.ceil(Math.random() * 10e5).toString(36)}`
|
|
194
|
+
return {
|
|
195
|
+
textWidth: 0,
|
|
196
|
+
boxWidth: 0,
|
|
197
|
+
wrapWidth: '',
|
|
198
|
+
webviewHide: false,
|
|
199
|
+
// #ifdef APP-NVUE
|
|
200
|
+
stopAnimation: false,
|
|
201
|
+
// #endif
|
|
202
|
+
elId: elId,
|
|
203
|
+
elIdBox: elIdBox,
|
|
204
|
+
show: true,
|
|
205
|
+
animationDuration: 'none',
|
|
206
|
+
animationPlayState: 'paused',
|
|
207
|
+
animationDelay: '0s'
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
created() {
|
|
211
|
+
// #ifdef APP-PLUS
|
|
212
|
+
var pages = getCurrentPages();
|
|
213
|
+
var page = pages[pages.length - 1];
|
|
214
|
+
var currentWebview = page.$getAppWebview();
|
|
215
|
+
currentWebview.addEventListener('hide', () => {
|
|
216
|
+
this.webviewHide = true
|
|
217
|
+
})
|
|
218
|
+
currentWebview.addEventListener('show', () => {
|
|
219
|
+
this.webviewHide = false
|
|
220
|
+
})
|
|
221
|
+
// #endif
|
|
222
|
+
|
|
223
|
+
this.$nextTick(() => {
|
|
224
|
+
this.initSize()
|
|
225
|
+
})
|
|
226
|
+
},
|
|
227
|
+
// #ifdef APP-NVUE
|
|
228
|
+
beforeDestroy() {
|
|
229
|
+
this.stopAnimation = true
|
|
230
|
+
},
|
|
231
|
+
// #endif
|
|
232
|
+
methods: {
|
|
233
|
+
getEleDone(ele){
|
|
234
|
+
let el = (e, callback)=>{
|
|
235
|
+
uni.createSelectorQuery()
|
|
236
|
+
// #ifndef MP-ALIPAY
|
|
237
|
+
.in(this)
|
|
238
|
+
// #endif
|
|
239
|
+
.select(e)
|
|
240
|
+
.boundingClientRect()
|
|
241
|
+
.exec((res) => {
|
|
242
|
+
if(res[0]['width']) {
|
|
243
|
+
res[0]['key'] = e.split('_')[1];
|
|
244
|
+
callback(res[0]);
|
|
245
|
+
}else{
|
|
246
|
+
setTimeout(()=>{
|
|
247
|
+
el(e, callback)
|
|
248
|
+
},100)
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
return new Promise((resolve, reject) => {
|
|
253
|
+
el(ele,(res)=>{
|
|
254
|
+
resolve(res)
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
},
|
|
259
|
+
initSize() {
|
|
260
|
+
if (this.scrollable) {
|
|
261
|
+
// #ifndef APP-NVUE
|
|
262
|
+
let query = [];
|
|
263
|
+
let textQuery = this.getEleDone(`#${this.elId}`);
|
|
264
|
+
let boxQuery = this.getEleDone(`#${this.elIdBox}`);
|
|
265
|
+
query.push(textQuery);
|
|
266
|
+
query.push(boxQuery);
|
|
267
|
+
Promise.all(query).then((res) => {
|
|
268
|
+
console.log('Promise.all',res);
|
|
269
|
+
res.map((item)=>{
|
|
270
|
+
if(item.key === 'text') {
|
|
271
|
+
this.textWidth = item.width;
|
|
272
|
+
this.animationDuration = `${item.width / this.speed}s`
|
|
273
|
+
}
|
|
274
|
+
if(item.key === 'box') {
|
|
275
|
+
this.boxWidth = item.width;
|
|
276
|
+
this.animationDelay = `0.5s`
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
setTimeout(() => {
|
|
280
|
+
this.animationPlayState = 'running'
|
|
281
|
+
}, 10)
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
// #endif
|
|
286
|
+
// #ifdef APP-NVUE
|
|
287
|
+
dom.getComponentRect(this.$refs['animationEle'], (res) => {
|
|
288
|
+
let winWidth = getApp().globalData.$systemInfo.windowWidth
|
|
289
|
+
this.textWidth = res.size.width
|
|
290
|
+
animation.transition(this.$refs['animationEle'], {
|
|
291
|
+
styles: {
|
|
292
|
+
transform: `translateX(-${winWidth}px)`
|
|
293
|
+
},
|
|
294
|
+
duration: 0,
|
|
295
|
+
timingFunction: 'linear',
|
|
296
|
+
delay: 0
|
|
297
|
+
}, () => {
|
|
298
|
+
if (!this.stopAnimation) {
|
|
299
|
+
animation.transition(this.$refs['animationEle'], {
|
|
300
|
+
styles: {
|
|
301
|
+
transform: `translateX(-${this.textWidth}px)`
|
|
302
|
+
},
|
|
303
|
+
timingFunction: 'linear',
|
|
304
|
+
duration: (this.textWidth - winWidth) / this.speed * 1000,
|
|
305
|
+
delay: 1000
|
|
306
|
+
}, () => {
|
|
307
|
+
if (!this.stopAnimation) {
|
|
308
|
+
this.loopAnimation()
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
})
|
|
314
|
+
// #endif
|
|
315
|
+
}
|
|
316
|
+
// #ifdef APP-NVUE
|
|
317
|
+
if (!this.scrollable && (this.single || this.moreText)) {
|
|
318
|
+
dom.getComponentRect(this.$refs['textBox'], (res) => {
|
|
319
|
+
this.wrapWidth = res.size.width
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
// #endif
|
|
323
|
+
},
|
|
324
|
+
loopAnimation() {
|
|
325
|
+
// #ifdef APP-NVUE
|
|
326
|
+
animation.transition(this.$refs['animationEle'], {
|
|
327
|
+
styles: {
|
|
328
|
+
transform: `translateX(0px)`
|
|
329
|
+
},
|
|
330
|
+
duration: 0
|
|
331
|
+
}, () => {
|
|
332
|
+
if (!this.stopAnimation) {
|
|
333
|
+
animation.transition(this.$refs['animationEle'], {
|
|
334
|
+
styles: {
|
|
335
|
+
transform: `translateX(-${this.textWidth}px)`
|
|
336
|
+
},
|
|
337
|
+
duration: this.textWidth / this.speed * 1000,
|
|
338
|
+
timingFunction: 'linear',
|
|
339
|
+
delay: 0
|
|
340
|
+
}, () => {
|
|
341
|
+
if (!this.stopAnimation) {
|
|
342
|
+
this.loopAnimation()
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
// #endif
|
|
348
|
+
},
|
|
349
|
+
clickMore() {
|
|
350
|
+
this.$emit('getmore')
|
|
351
|
+
},
|
|
352
|
+
close() {
|
|
353
|
+
this.show = false;
|
|
354
|
+
this.$emit('close')
|
|
355
|
+
},
|
|
356
|
+
onClick() {
|
|
357
|
+
this.$emit('click')
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
</script>
|
|
362
|
+
|
|
363
|
+
<style lang="less" scoped>
|
|
364
|
+
|
|
365
|
+
.uni-noticebar {
|
|
366
|
+
/* #ifndef APP-NVUE */
|
|
367
|
+
display: flex;
|
|
368
|
+
width: 100%;
|
|
369
|
+
box-sizing: border-box;
|
|
370
|
+
/* #endif */
|
|
371
|
+
flex-direction: row;
|
|
372
|
+
align-items: center;
|
|
373
|
+
padding: unit(12, rxp) unit(24, rpx);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.uni-cursor-point {
|
|
377
|
+
/* #ifdef H5 */
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
/* #endif */
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.uni-noticebar-close {
|
|
383
|
+
margin-right: unit(10, rpx);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.uni-noticebar-icon {
|
|
387
|
+
margin-right: unit(10, rpx);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.uni-noticebar__content-wrapper {
|
|
391
|
+
flex: 1;
|
|
392
|
+
flex-direction: column;
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.uni-noticebar__content-wrapper--single {
|
|
397
|
+
/* #ifndef APP-NVUE */
|
|
398
|
+
line-height: unit(36, rpx);
|
|
399
|
+
/* #endif */
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.uni-noticebar__content-wrapper--single,
|
|
403
|
+
.uni-noticebar__content-wrapper--scrollable {
|
|
404
|
+
flex-direction: row;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* #ifndef APP-NVUE */
|
|
408
|
+
.uni-noticebar__content-wrapper--scrollable {
|
|
409
|
+
position: relative;
|
|
410
|
+
height: unit(36, rpx);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/* #endif */
|
|
414
|
+
|
|
415
|
+
.uni-noticebar__content--scrollable {
|
|
416
|
+
/* #ifdef APP-NVUE */
|
|
417
|
+
flex: 0;
|
|
418
|
+
/* #endif */
|
|
419
|
+
/* #ifndef APP-NVUE */
|
|
420
|
+
flex: 1;
|
|
421
|
+
display: block;
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
/* #endif */
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.uni-noticebar__content--single {
|
|
427
|
+
/* #ifndef APP-NVUE */
|
|
428
|
+
display: flex;
|
|
429
|
+
flex: none;
|
|
430
|
+
width: 100%;
|
|
431
|
+
justify-content: center;
|
|
432
|
+
/* #endif */
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.uni-noticebar__content-text {
|
|
436
|
+
font-size: unit(28, rpx);
|
|
437
|
+
line-height: unit(36, rpx);
|
|
438
|
+
/* #ifndef APP-NVUE */
|
|
439
|
+
word-break: break-all;
|
|
440
|
+
/* #endif */
|
|
441
|
+
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.uni-noticebar__content-text--single {
|
|
445
|
+
/* #ifdef APP-NVUE */
|
|
446
|
+
lines: 1;
|
|
447
|
+
/* #endif */
|
|
448
|
+
/* #ifndef APP-NVUE */
|
|
449
|
+
display: block;
|
|
450
|
+
width: 100%;
|
|
451
|
+
white-space: nowrap;
|
|
452
|
+
/* #endif */
|
|
453
|
+
overflow: hidden;
|
|
454
|
+
text-overflow: ellipsis;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.uni-noticebar__content-text--scrollable {
|
|
458
|
+
/* #ifdef APP-NVUE */
|
|
459
|
+
lines: 1;
|
|
460
|
+
padding-left: unit(750, rpx);
|
|
461
|
+
/* #endif */
|
|
462
|
+
/* #ifndef APP-NVUE */
|
|
463
|
+
position: absolute;
|
|
464
|
+
height: unit(36, rpx);
|
|
465
|
+
line-height: unit(36, rpx);
|
|
466
|
+
white-space: nowrap;
|
|
467
|
+
padding-left: 100%;
|
|
468
|
+
animation: notice 10s 0s linear infinite both;
|
|
469
|
+
animation-play-state: paused;
|
|
470
|
+
/* #endif */
|
|
471
|
+
display: flex;
|
|
472
|
+
justify-content: flex-start;
|
|
473
|
+
align-items: flex-start;
|
|
474
|
+
flex-flow: nowrap;
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
/deep/ & > view {
|
|
478
|
+
padding-right: unit(30, rpx);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.uni-noticebar__more {
|
|
483
|
+
/* #ifndef APP-NVUE */
|
|
484
|
+
display: inline-flex;
|
|
485
|
+
/* #endif */
|
|
486
|
+
flex-direction: row;
|
|
487
|
+
flex-wrap: nowrap;
|
|
488
|
+
align-items: center;
|
|
489
|
+
padding-left: unit(10, rpx);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.uni-noticebar__more-text {
|
|
493
|
+
font-size: unit(28, rpx);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
@keyframes notice {
|
|
497
|
+
100% {
|
|
498
|
+
transform: translate3d(-100%, 0, 0);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
</style>
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="xd-number">
|
|
3
|
+
<view class="xd-number__label" v-if="label">{{label}}</view>
|
|
4
|
+
<view class="xd-number__cut">
|
|
5
|
+
<xd-font-icon
|
|
6
|
+
icon="iconjian1"
|
|
7
|
+
size="24"
|
|
8
|
+
@click="cut"
|
|
9
|
+
:color="color"
|
|
10
|
+
:width="46"
|
|
11
|
+
:height="46"
|
|
12
|
+
></xd-font-icon>
|
|
13
|
+
</view>
|
|
14
|
+
<view class="xd-number__input">
|
|
15
|
+
<input
|
|
16
|
+
class="xd-number__input-cont"
|
|
17
|
+
:style="{width:width + 'rpx'}"
|
|
18
|
+
:focus="focus"
|
|
19
|
+
@blur="handleChange"
|
|
20
|
+
@confirm="doneInput"
|
|
21
|
+
type="number"
|
|
22
|
+
confirm-type="search"
|
|
23
|
+
:placeholder="placeholder"
|
|
24
|
+
:adjust-position="false"
|
|
25
|
+
:disabled="disabled"
|
|
26
|
+
v-model="searchValue"/>
|
|
27
|
+
</view>
|
|
28
|
+
<view class="xd-number__add">
|
|
29
|
+
<xd-font-icon
|
|
30
|
+
:width="46"
|
|
31
|
+
:height="46"
|
|
32
|
+
icon="iconjia2"
|
|
33
|
+
size="24"
|
|
34
|
+
:color="endColor"
|
|
35
|
+
@click="add"
|
|
36
|
+
></xd-font-icon>
|
|
37
|
+
</view>
|
|
38
|
+
</view>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import XdFontIcon from '@/components/XdFontIcon/XdFontIcon';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* XdNumber 按钮UI
|
|
46
|
+
* @description 数量输入插件
|
|
47
|
+
* @tutorial
|
|
48
|
+
* @property {Number} value/v-model 双向绑定值 默认:null
|
|
49
|
+
* @property {String} label label名称 (选填) 默认:购买数量 值为空不显示
|
|
50
|
+
* @property {Boolean} focus 输入框是否聚焦 (选填)
|
|
51
|
+
* @property {Number} min 默认最小值 (选填) 默认:1
|
|
52
|
+
* @property {Number} width 输入框最大宽度 (选填) 默认:100rpx
|
|
53
|
+
* @property {String} placeholder 提示文案
|
|
54
|
+
*
|
|
55
|
+
* @v-model {Number} value
|
|
56
|
+
* @event {Function} change 点击加减按钮事件
|
|
57
|
+
*/
|
|
58
|
+
export default {
|
|
59
|
+
name: "XdNumber",
|
|
60
|
+
components: {XdFontIcon},
|
|
61
|
+
props:{
|
|
62
|
+
disabled: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
label: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: '',
|
|
69
|
+
},
|
|
70
|
+
value:{
|
|
71
|
+
type: Number|null,
|
|
72
|
+
default: null
|
|
73
|
+
},
|
|
74
|
+
focus: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: false
|
|
77
|
+
},
|
|
78
|
+
min:{
|
|
79
|
+
type:Number,
|
|
80
|
+
default: 1
|
|
81
|
+
},
|
|
82
|
+
width: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: 100
|
|
85
|
+
},
|
|
86
|
+
placeholder: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: ''
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
watch:{
|
|
92
|
+
value(val){
|
|
93
|
+
this.setValue(val);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
data(){
|
|
97
|
+
return {
|
|
98
|
+
searchValue: null,
|
|
99
|
+
color: '#595757',
|
|
100
|
+
endColor: '#595757',
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
created(){
|
|
104
|
+
this.setValue(this.value);
|
|
105
|
+
|
|
106
|
+
},
|
|
107
|
+
methods:{
|
|
108
|
+
doneInput() {
|
|
109
|
+
uni.hideKeyboard();
|
|
110
|
+
console.log(this.value)
|
|
111
|
+
},
|
|
112
|
+
setValue(val){
|
|
113
|
+
if(this.disabled) {
|
|
114
|
+
this.color = this.endColor = '#ccc';
|
|
115
|
+
this.searchValue = 1;
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (val <= this.min) {
|
|
120
|
+
this.color = '#ccc';
|
|
121
|
+
this.searchValue = this.min;
|
|
122
|
+
this.$emit('input', this.searchValue);
|
|
123
|
+
}else{
|
|
124
|
+
this.searchValue = val === null ? this.min: val;
|
|
125
|
+
this.$emit('input', this.searchValue);
|
|
126
|
+
this.color = '#595757';
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
cut(){
|
|
130
|
+
if(this.disabled) {
|
|
131
|
+
this.color = '#ccc';
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
if(this.searchValue > this.min) {
|
|
135
|
+
this.searchValue--;
|
|
136
|
+
this.$emit('input', this.searchValue);
|
|
137
|
+
this.$emit('change', this.searchValue, 'cut');
|
|
138
|
+
console.log(this.searchValue)
|
|
139
|
+
if(this.searchValue === this.min) {
|
|
140
|
+
this.color = '#ccc';
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this.color = '#595757'
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
this.color = '#ccc';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
},
|
|
151
|
+
add(){
|
|
152
|
+
if (this.disabled) {
|
|
153
|
+
this.color = '#ccc';
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
this.searchValue++;
|
|
157
|
+
this.color = '#595757';
|
|
158
|
+
this.$emit('input', this.searchValue);
|
|
159
|
+
this.$emit('change', this.searchValue, 'add');
|
|
160
|
+
console.log(this.searchValue)
|
|
161
|
+
},
|
|
162
|
+
handleChange(value){
|
|
163
|
+
if(value['detail'] === '' || value['detail'] === '0' ) {
|
|
164
|
+
this.searchValue = '1';
|
|
165
|
+
}
|
|
166
|
+
this.setValue(Number(this.searchValue));
|
|
167
|
+
console.log(this.searchValue)
|
|
168
|
+
this.$emit('change', this.searchValue);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
</script>
|
|
173
|
+
|
|
174
|
+
<style scoped lang="less">
|
|
175
|
+
.xd-number {
|
|
176
|
+
font-size: @xd-font-size-sm;
|
|
177
|
+
display: flex;
|
|
178
|
+
justify-content: flex-start;
|
|
179
|
+
align-items: center;
|
|
180
|
+
color: #595757;
|
|
181
|
+
|
|
182
|
+
&__label {
|
|
183
|
+
padding-right: unit(10,rpx);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&__cut,&__add {
|
|
187
|
+
border: 1px solid #dfdfdf;
|
|
188
|
+
background: #f9f9f9;
|
|
189
|
+
border-radius: unit(6,rpx);
|
|
190
|
+
height: unit(46, rpx);
|
|
191
|
+
width: unit(46, rpx);
|
|
192
|
+
box-sizing: border-box;
|
|
193
|
+
display: flex;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
align-items: center;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&__input {
|
|
199
|
+
&-cont {
|
|
200
|
+
text-align: center;
|
|
201
|
+
border: 1px solid #dfdfdf;
|
|
202
|
+
background: #f9f9f9;
|
|
203
|
+
border-radius: unit(6, rpx);
|
|
204
|
+
height: unit(46,rpx);
|
|
205
|
+
box-sizing: border-box;
|
|
206
|
+
font-size: @xd-font-size-sm;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
</style>
|