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,270 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="uni-numbox" :style="{width: width + 'rpx'}">
|
|
3
|
+
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-cursor-point">
|
|
4
|
+
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= uiMin || disabled }">-</text>
|
|
5
|
+
</view>
|
|
6
|
+
<input
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
@focus="_onFocus"
|
|
9
|
+
@blur="_onBlur"
|
|
10
|
+
class="uni-numbox__value"
|
|
11
|
+
:class="{disabled: disabled}"
|
|
12
|
+
type="number"
|
|
13
|
+
v-model="inputValue" />
|
|
14
|
+
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-cursor-point">
|
|
15
|
+
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= uiMax || disabled }">+</text>
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
/**
|
|
21
|
+
* XdNumberUni 数字输入框
|
|
22
|
+
* @description 带加减按钮的数字输入框
|
|
23
|
+
* @property {Number} value 输入框当前值
|
|
24
|
+
* @property {Number} min 最小值
|
|
25
|
+
* @property {Number} max 最大值
|
|
26
|
+
* @property {Number} step 每次点击改变的间隔大小
|
|
27
|
+
* @property {Boolean} disabled = [true|false] 是否为禁用状态
|
|
28
|
+
* @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: "XdNumberUni",
|
|
33
|
+
props: {
|
|
34
|
+
value: {
|
|
35
|
+
type: [Number, String],
|
|
36
|
+
default: 1
|
|
37
|
+
},
|
|
38
|
+
width: {
|
|
39
|
+
type: [Number, String],
|
|
40
|
+
default: 180
|
|
41
|
+
},
|
|
42
|
+
min: {
|
|
43
|
+
type: Number | String,
|
|
44
|
+
default: 0
|
|
45
|
+
},
|
|
46
|
+
max: {
|
|
47
|
+
type: Number | String,
|
|
48
|
+
default: 100
|
|
49
|
+
},
|
|
50
|
+
step: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 1
|
|
53
|
+
},
|
|
54
|
+
disabled: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
data() {
|
|
60
|
+
return {
|
|
61
|
+
inputValue: 0,
|
|
62
|
+
uiMin: 0,
|
|
63
|
+
uiMax: 0,
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
watch: {
|
|
67
|
+
value(val) {
|
|
68
|
+
this.inputValue = +val;
|
|
69
|
+
},
|
|
70
|
+
min(val){
|
|
71
|
+
if(this.$xdUniHelper.checkVarType(val) === 'string') {
|
|
72
|
+
this.uiMin = Number(val);
|
|
73
|
+
}else{
|
|
74
|
+
this.uiMin = val;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
max(val) {
|
|
78
|
+
if (this.$xdUniHelper.checkVarType(val) === 'string') {
|
|
79
|
+
this.uiMax = Number(val);
|
|
80
|
+
} else {
|
|
81
|
+
this.uiMax = val;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
created() {
|
|
86
|
+
|
|
87
|
+
if (this.$xdUniHelper.checkVarType(this.min) === 'string') {
|
|
88
|
+
this.uiMin = Number(this.min);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
this.uiMin = this.min;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (this.$xdUniHelper.checkVarType(this.max) === 'string') {
|
|
95
|
+
this.uiMax = Number(this.max);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this.uiMax = this.max;
|
|
99
|
+
}
|
|
100
|
+
this.inputValue = +this.value;
|
|
101
|
+
},
|
|
102
|
+
methods: {
|
|
103
|
+
_calcValue(type) {
|
|
104
|
+
console.log('_calcValue',type)
|
|
105
|
+
if (this.disabled) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const scale = this._getDecimalScale();
|
|
109
|
+
let value = this.inputValue * scale;
|
|
110
|
+
let step = this.step * scale;
|
|
111
|
+
if (type === "minus") {
|
|
112
|
+
value -= step;
|
|
113
|
+
if (value < (this.uiMin * scale)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (value > (this.uiMax * scale)) {
|
|
117
|
+
value = this.uiMax * scale
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (type === "plus") {
|
|
122
|
+
value += step;
|
|
123
|
+
if (value > (this.uiMax * scale)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (value < (this.uiMin * scale)) {
|
|
127
|
+
value = this.uiMin * scale
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this.inputValue = (value / scale).toFixed(String(scale).length - 1);
|
|
132
|
+
this.$emit("input", +this.inputValue);
|
|
133
|
+
this.$emit("change", +this.inputValue);
|
|
134
|
+
},
|
|
135
|
+
_getDecimalScale() {
|
|
136
|
+
|
|
137
|
+
let scale = 1;
|
|
138
|
+
// 浮点型
|
|
139
|
+
if (~~this.step !== this.step) {
|
|
140
|
+
scale = Math.pow(10, String(this.step).split(".")[1].length);
|
|
141
|
+
}
|
|
142
|
+
return scale;
|
|
143
|
+
},
|
|
144
|
+
_onBlur(event) {
|
|
145
|
+
this.$emit('blur', event)
|
|
146
|
+
let value = event.detail.value;
|
|
147
|
+
if (!value) {
|
|
148
|
+
this.$emit("input", '');
|
|
149
|
+
this.$emit("change", '');
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
value = +value;
|
|
153
|
+
if (value > this.uiMax) {
|
|
154
|
+
value = this.uiMax;
|
|
155
|
+
} else if (value < this.uiMin) {
|
|
156
|
+
value = this.uiMin;
|
|
157
|
+
}
|
|
158
|
+
const scale = this._getDecimalScale();
|
|
159
|
+
this.inputValue = value.toFixed(String(scale).length - 1);
|
|
160
|
+
this.$emit("input", +this.inputValue);
|
|
161
|
+
this.$emit("change", +this.inputValue);
|
|
162
|
+
},
|
|
163
|
+
_onFocus(event) {
|
|
164
|
+
this.$emit('focus', event)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
</script>
|
|
169
|
+
<style lang="scss" scoped>
|
|
170
|
+
$box-height: 50rpx;
|
|
171
|
+
/* #ifdef APP-NVUE */
|
|
172
|
+
$box-line-height: 35px;
|
|
173
|
+
/* #endif */
|
|
174
|
+
$box-line-height: 42rpx;
|
|
175
|
+
$box-width: 50rpx;
|
|
176
|
+
|
|
177
|
+
.uni-numbox {
|
|
178
|
+
|
|
179
|
+
/* #ifndef APP-NVUE */
|
|
180
|
+
display: flex;
|
|
181
|
+
justify-content: space-between;
|
|
182
|
+
align-items: center;
|
|
183
|
+
/* #endif */
|
|
184
|
+
flex-direction: row;
|
|
185
|
+
height: $box-height;
|
|
186
|
+
line-height: $box-height;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.uni-cursor-point {
|
|
190
|
+
/* #ifdef H5 */
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
/* #endif */
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.uni-numbox__value {
|
|
196
|
+
background-color: $uni-bg-color;
|
|
197
|
+
height: $box-height;
|
|
198
|
+
text-align: center;
|
|
199
|
+
font-size: $uni-font-size-lg;
|
|
200
|
+
border-width: 1rpx;
|
|
201
|
+
border-style: solid;
|
|
202
|
+
border-color: $uni-border-color;
|
|
203
|
+
border-left-width: 0;
|
|
204
|
+
border-right-width: 0;
|
|
205
|
+
box-sizing: border-box;
|
|
206
|
+
flex: 1;
|
|
207
|
+
width: 0;
|
|
208
|
+
|
|
209
|
+
&.disabled {
|
|
210
|
+
color: #bbb;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.uni-numbox__minus {
|
|
216
|
+
/* #ifndef APP-NVUE */
|
|
217
|
+
display: flex;
|
|
218
|
+
/* #endif */
|
|
219
|
+
flex-direction: row;
|
|
220
|
+
align-items: center;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
width: $box-width;
|
|
223
|
+
height: $box-height;
|
|
224
|
+
// line-height: $box-line-height;
|
|
225
|
+
// text-align: center;
|
|
226
|
+
font-size: 28rpx;
|
|
227
|
+
color: $uni-text-color;
|
|
228
|
+
background-color: $uni-bg-color-grey;
|
|
229
|
+
border-width: 1rpx;
|
|
230
|
+
border-style: solid;
|
|
231
|
+
border-color: $uni-border-color;
|
|
232
|
+
border-top-left-radius: $uni-border-radius-base;
|
|
233
|
+
border-bottom-left-radius: $uni-border-radius-base;
|
|
234
|
+
border-right-width: 0;
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
flex-shrink: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.uni-numbox__plus {
|
|
240
|
+
/* #ifndef APP-NVUE */
|
|
241
|
+
display: flex;
|
|
242
|
+
/* #endif */
|
|
243
|
+
flex-direction: row;
|
|
244
|
+
align-items: center;
|
|
245
|
+
justify-content: center;
|
|
246
|
+
width: $box-width;
|
|
247
|
+
height: $box-height;
|
|
248
|
+
border-width: 1rpx;
|
|
249
|
+
border-style: solid;
|
|
250
|
+
border-color: $uni-border-color;
|
|
251
|
+
border-top-right-radius: $uni-border-radius-base;
|
|
252
|
+
border-bottom-right-radius: $uni-border-radius-base;
|
|
253
|
+
background-color: $uni-bg-color-grey;
|
|
254
|
+
border-left-width: 0;
|
|
255
|
+
box-sizing: border-box;
|
|
256
|
+
flex-shrink: 0;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.uni-numbox--text {
|
|
260
|
+
font-size: 32rpx;
|
|
261
|
+
color: $uni-text-color;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.uni-numbox--disabled {
|
|
265
|
+
color: $uni-text-color-disable;
|
|
266
|
+
/* #ifdef H5 */
|
|
267
|
+
cursor: not-allowed;
|
|
268
|
+
/* #endif */
|
|
269
|
+
}
|
|
270
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
## XdNumberUni 数字输入框
|
|
4
|
+
> **组件名:xd-number-uni**
|
|
5
|
+
> 代码块: `XdNumberUni`
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
带加减按钮的数字输入框。
|
|
9
|
+
|
|
10
|
+
### 基本用法
|
|
11
|
+
|
|
12
|
+
在 ``template`` 中使用组件
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<xd-number-uni></xd-number-uni>
|
|
16
|
+
<xd-number-uni v-model="vModelValue" />
|
|
17
|
+
<xd-number-uni :min="0" :max="9"></xd-number-uni>
|
|
18
|
+
<xd-number-uni @change="bindChange"></xd-number-uni>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## API
|
|
22
|
+
|
|
23
|
+
### NumberBox Props
|
|
24
|
+
|
|
25
|
+
|属性名 |类型 |默认值 |说明 |
|
|
26
|
+
|:-: |:-: |:-: |:-: |
|
|
27
|
+
|value/v-model|Number |0 |输入框当前值 |
|
|
28
|
+
|min |Number |0 |最小值 |
|
|
29
|
+
|max |Number |100 |最大值 |
|
|
30
|
+
|step |Number |1 |每次点击改变的间隔大小 |
|
|
31
|
+
|disabled |Boolean|false |是否为禁用状态 |
|
|
32
|
+
|width |Number|180 |区域插件宽度 |
|
|
33
|
+
|
|
34
|
+
### NumberBox Events
|
|
35
|
+
|
|
36
|
+
|事件名称 |说明 |返回值 |
|
|
37
|
+
|:-: |:-: |:-: |
|
|
38
|
+
|change |输入框值改变时触发的事件,参数为输入框当前的 value |- |
|
|
39
|
+
|focus |输入框聚焦时触发的事件,参数为 event 对象 |- |
|
|
40
|
+
|blur |输入框失焦时触发的事件,参数为 event 对象 |- |
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="xd-online" v-if="info !== null">
|
|
3
|
+
<view class="xd-online__title">
|
|
4
|
+
<template v-if="timeStr">
|
|
5
|
+
<xd-font-icon size="36" icon="iconshijian"></xd-font-icon>
|
|
6
|
+
<text>支付剩余时间:{{timeStr}}</text>
|
|
7
|
+
</template>
|
|
8
|
+
</view>
|
|
9
|
+
<view class="xd-online__content" :style="'background:#fff' ">
|
|
10
|
+
<view class="xd-online__content-image">
|
|
11
|
+
<image :src="info['film_poster']" mode="scaleToFill"></image>
|
|
12
|
+
</view>
|
|
13
|
+
<view class="xd-online__content-text">
|
|
14
|
+
<view>
|
|
15
|
+
<text>影片:</text>
|
|
16
|
+
<text>{{info['film_name']}}</text>
|
|
17
|
+
</view>
|
|
18
|
+
<view>
|
|
19
|
+
<text></text>
|
|
20
|
+
<xd-tag type="primary" size="small" inverted="inverted">{{info['show_version']}}</xd-tag>
|
|
21
|
+
</view>
|
|
22
|
+
<view>
|
|
23
|
+
<text>影厅:</text>
|
|
24
|
+
<text>{{info['hall_name']}}</text>
|
|
25
|
+
</view>
|
|
26
|
+
<view>
|
|
27
|
+
<text>场次:</text>
|
|
28
|
+
<text>{{info['show_time']}}</text>
|
|
29
|
+
</view>
|
|
30
|
+
<view>
|
|
31
|
+
<text>座位:</text>
|
|
32
|
+
<text :style="'padding-right:10rpx; color:' + $mainColor">{{toSeatsStr(info['seats_name'])}}</text>
|
|
33
|
+
</view>
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
<view class="xd-online__tips">
|
|
37
|
+
<view class="xd-online__tips-icon">
|
|
38
|
+
<view>
|
|
39
|
+
<xd-font-icon size="30" icon="icongerenzhongxinchufabaocuo" color="red"></xd-font-icon>
|
|
40
|
+
<text>不支持退票</text>
|
|
41
|
+
</view>
|
|
42
|
+
<view>
|
|
43
|
+
<xd-font-icon size="30" icon="icongerenzhongxinchufabaocuo" color="red"></xd-font-icon>
|
|
44
|
+
<text>不支持改签</text>
|
|
45
|
+
</view>
|
|
46
|
+
</view>
|
|
47
|
+
<view class="xd-online__tips-price" v-if="info['total_price'] && info['ticket_count']">
|
|
48
|
+
<text>共 {{info['ticket_count']}} 张</text>
|
|
49
|
+
<xd-unit
|
|
50
|
+
:price="info['total_price']"
|
|
51
|
+
:color="$mainColor"
|
|
52
|
+
:font-size="26"
|
|
53
|
+
:iocn-size=".35"
|
|
54
|
+
font-weight="normal"
|
|
55
|
+
></xd-unit>
|
|
56
|
+
</view>
|
|
57
|
+
</view>
|
|
58
|
+
<view class="xd-online__phone">
|
|
59
|
+
<xd-font-icon size="80" icon="iconshoujizhifu" color="#55b2f8"></xd-font-icon>
|
|
60
|
+
<view class="xd-online__phone-text">
|
|
61
|
+
<view>取票手机号</view>
|
|
62
|
+
<view>{{info['phone']}}</view>
|
|
63
|
+
</view>
|
|
64
|
+
</view>
|
|
65
|
+
<xd-title-section bg="#fff" title="影院信息"></xd-title-section>
|
|
66
|
+
<view class="xd-online__cinema">
|
|
67
|
+
<view>{{info['cinema_name']}}</view>
|
|
68
|
+
<view>地址:{{info['cinema_address']}}</view>
|
|
69
|
+
</view>
|
|
70
|
+
<xd-title-section bg="#fff" :title="info['notice']['title']"></xd-title-section>
|
|
71
|
+
<view class="xd-online__notice">
|
|
72
|
+
<view v-for="(item,index) in info['notice']['content']" :key="index">{{item}}</view>
|
|
73
|
+
</view>
|
|
74
|
+
<view class="xd-online__btn-block"></view>
|
|
75
|
+
<view class="xd-online__btn">
|
|
76
|
+
<view class="xd-online__btn-top">
|
|
77
|
+
<view>应付</view>
|
|
78
|
+
<view>
|
|
79
|
+
<xd-unit
|
|
80
|
+
:price="info['total_price']"
|
|
81
|
+
:color="$mainColor"
|
|
82
|
+
:font-size="36"
|
|
83
|
+
:iocn-size="0.5"
|
|
84
|
+
></xd-unit>
|
|
85
|
+
</view>
|
|
86
|
+
</view>
|
|
87
|
+
<view class="xd-online__btn-bottom">
|
|
88
|
+
<xd-button type="primary" radius="10rpx" @click="goToPay">确认支付</xd-button>
|
|
89
|
+
</view>
|
|
90
|
+
</view>
|
|
91
|
+
</view>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script>
|
|
95
|
+
import XdTitleSection from "@/components/XdTitleSection/XdTitleSection";
|
|
96
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
97
|
+
import XdTag from "@/components/XdTag/XdTag";
|
|
98
|
+
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
99
|
+
import XdButton from "@/components/XdButton/XdButton";
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* XdOnlineConfirm
|
|
103
|
+
* @description 在线选座确认订单
|
|
104
|
+
*
|
|
105
|
+
* @property {Number} bottom 顶部到内容区域距离(备注可以从XdLayout插件done事件中获取到)
|
|
106
|
+
*
|
|
107
|
+
* @event {Function} onPay 点击确认支付 参数:info
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export default {
|
|
111
|
+
name: "XdOnlineConfirm",
|
|
112
|
+
components: {
|
|
113
|
+
XdTitleSection,
|
|
114
|
+
XdFontIcon,
|
|
115
|
+
XdTag,
|
|
116
|
+
XdUnit,
|
|
117
|
+
XdButton
|
|
118
|
+
},
|
|
119
|
+
props: {
|
|
120
|
+
bottom: {
|
|
121
|
+
type: Number,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
data() {
|
|
125
|
+
return {
|
|
126
|
+
info: null,
|
|
127
|
+
timeStr: '',
|
|
128
|
+
timeer: null,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @description 最小数据列
|
|
132
|
+
*/
|
|
133
|
+
testData: {
|
|
134
|
+
order_id: "402953720356552704",
|
|
135
|
+
show_time: " 2021-10-14 12:50:00",
|
|
136
|
+
film_poster: "https://gw.alicdn.com/i3/O1CN01nCaVI01Lt5lvXF92X_!!6000000001356-0-alipicbeacon.jpg_480x480Q30s150.jpg",
|
|
137
|
+
total_price: 180,
|
|
138
|
+
ticket_count: 2,
|
|
139
|
+
seats_name: ['2排5座', '2排6座'],
|
|
140
|
+
phone: '15110208397',
|
|
141
|
+
pay_time_leave: 600,
|
|
142
|
+
show_version: "中文 4D",
|
|
143
|
+
hall_name: "3号4DX厅(儿童需购票)",
|
|
144
|
+
film_name: "长津湖",
|
|
145
|
+
cinema_address: "朝阳区慈云寺北里209号未来汇2层",
|
|
146
|
+
cinema_name: "北京耀莱成龙影城(慈云寺店)",
|
|
147
|
+
notice: {
|
|
148
|
+
title: "购票须知",
|
|
149
|
+
content: [
|
|
150
|
+
'1.请核对订单,影票及卖品售出后不可退换。',
|
|
151
|
+
'2.影卡支付和码券支付不可同时使用。',
|
|
152
|
+
'3.影卡或码券未支付的部分可以用现金补足。',
|
|
153
|
+
'4.最多只能使用4张卡同时支付。(所使用的卡类型必须相同)',
|
|
154
|
+
'5.购票选座线上扣点与线下扣点存在差异,请知晓。',
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
created() {
|
|
161
|
+
this.getOrder();
|
|
162
|
+
},
|
|
163
|
+
methods: {
|
|
164
|
+
getOrder() {
|
|
165
|
+
this.$emit('onGetOrder', (order) => {
|
|
166
|
+
if (order === null) this.info = this.$xdUniHelper.cloneDeep(this.testData);
|
|
167
|
+
else {
|
|
168
|
+
this.info = order;
|
|
169
|
+
}
|
|
170
|
+
this.setInval(this.info['pay_time_leave']);
|
|
171
|
+
console.log('onGetOrder', order)
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
setInval(time) {
|
|
176
|
+
if (time === 0) {
|
|
177
|
+
this.timeStr = '00分00秒'
|
|
178
|
+
} else {
|
|
179
|
+
this.timeer = setInterval(() => {
|
|
180
|
+
if (time === 0) {
|
|
181
|
+
this.timeStr = '00分00秒';
|
|
182
|
+
clearInterval(this.timeer);
|
|
183
|
+
} else {
|
|
184
|
+
time--;
|
|
185
|
+
let f = Math.floor(time / 60);
|
|
186
|
+
f = f < 10 ? ('0' + f) : f;
|
|
187
|
+
let m = time % 60;
|
|
188
|
+
m = m < 10 ? ('0' + m) : m;
|
|
189
|
+
this.timeStr = `${f}分${m}秒`;
|
|
190
|
+
}
|
|
191
|
+
}, 1000);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
toSeatsStr(val) {
|
|
196
|
+
return `${val.join(' | ')}`;
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
goToPay() {
|
|
200
|
+
this.$emit('onPay', this.info)
|
|
201
|
+
},
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
</script>
|
|
205
|
+
|
|
206
|
+
<style scoped lang="less">
|
|
207
|
+
.xd-online {
|
|
208
|
+
&__title {
|
|
209
|
+
display: flex;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
align-items: center;
|
|
212
|
+
padding: unit(30, rpx) 0;
|
|
213
|
+
font-size: @xd-font-size-base+ 2;
|
|
214
|
+
min-height: unit(40, rpx);
|
|
215
|
+
|
|
216
|
+
& > text {
|
|
217
|
+
padding: 0 unit(6, rpx);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&__content {
|
|
222
|
+
display: flex;
|
|
223
|
+
justify-content: space-between;
|
|
224
|
+
align-items: flex-start;
|
|
225
|
+
padding: unit(20, rpx);
|
|
226
|
+
color: #666;
|
|
227
|
+
border-bottom: 1px solid #e8e8e8;
|
|
228
|
+
|
|
229
|
+
&-image {
|
|
230
|
+
margin-right: unit(20, rpx);
|
|
231
|
+
width: unit(200, rpx);
|
|
232
|
+
height: unit(264, rpx);
|
|
233
|
+
box-shadow: 0 0 unit(10, rpx) rgba(0, 0, 0, .2);
|
|
234
|
+
|
|
235
|
+
& > image {
|
|
236
|
+
max-width: 100%;
|
|
237
|
+
max-height: 100%;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&-text {
|
|
242
|
+
flex: 1;
|
|
243
|
+
|
|
244
|
+
& > view {
|
|
245
|
+
display: flex;
|
|
246
|
+
justify-content: flex-start;
|
|
247
|
+
align-items: flex-start;
|
|
248
|
+
font-size: @xd-font-size-base;
|
|
249
|
+
padding-bottom: unit(10, rpx);
|
|
250
|
+
color: #333;
|
|
251
|
+
|
|
252
|
+
& > text:first-child {
|
|
253
|
+
color: #666;
|
|
254
|
+
min-width: unit(80, rpx);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&__tips {
|
|
261
|
+
padding: unit(10, rpx) unit(20, rpx);
|
|
262
|
+
background: #fff;
|
|
263
|
+
font-size: @xd-font-size-sm;
|
|
264
|
+
display: flex;
|
|
265
|
+
justify-content: space-between;
|
|
266
|
+
align-items: center;
|
|
267
|
+
|
|
268
|
+
&-icon {
|
|
269
|
+
display: flex;
|
|
270
|
+
justify-content: space-between;
|
|
271
|
+
align-items: center;
|
|
272
|
+
|
|
273
|
+
& > view {
|
|
274
|
+
padding-right: unit(20, rpx);
|
|
275
|
+
display: flex;
|
|
276
|
+
justify-content: space-between;
|
|
277
|
+
align-items: center;
|
|
278
|
+
|
|
279
|
+
& > text {
|
|
280
|
+
padding: 0 unit(6, rpx);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&-price {
|
|
286
|
+
display: flex;
|
|
287
|
+
justify-content: flex-end;
|
|
288
|
+
align-items: center;
|
|
289
|
+
|
|
290
|
+
& > text {
|
|
291
|
+
padding: 0 unit(6, rpx);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
&__phone {
|
|
297
|
+
margin-top: unit(20, rpx);
|
|
298
|
+
padding: unit(20, rpx);
|
|
299
|
+
background: #fff;
|
|
300
|
+
display: flex;
|
|
301
|
+
justify-content: flex-start;
|
|
302
|
+
align-items: center;
|
|
303
|
+
|
|
304
|
+
&-text {
|
|
305
|
+
margin-left: unit(10, rpx);
|
|
306
|
+
font-size: @xd-font-size-base;
|
|
307
|
+
|
|
308
|
+
& > view:first-child {
|
|
309
|
+
font-size: @xd-font-size-base + 2;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
&__cinema {
|
|
315
|
+
background: #fff;
|
|
316
|
+
padding: unit(20, rpx) unit(20, rpx);
|
|
317
|
+
font-size: @xd-font-size-sm;
|
|
318
|
+
color: #666;
|
|
319
|
+
|
|
320
|
+
& > view:first-child {
|
|
321
|
+
font-size: @xd-font-size-lg;
|
|
322
|
+
color: #111;
|
|
323
|
+
padding-bottom: unit(10, rpx);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
&__notice {
|
|
328
|
+
background: #fff;
|
|
329
|
+
padding: unit(20, rpx) unit(20, rpx) unit(0, rpx);
|
|
330
|
+
font-size: @xd-font-size-sm;
|
|
331
|
+
color: #666;
|
|
332
|
+
line-height: @xd-font-size-sm * 1.2;
|
|
333
|
+
|
|
334
|
+
& > view {
|
|
335
|
+
padding-bottom: unit(20, rpx);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
&__btn {
|
|
340
|
+
position: fixed;
|
|
341
|
+
box-shadow: 0 0 unit(10, rpx) rgba(100, 100, 100, 0.1);
|
|
342
|
+
right: 0;
|
|
343
|
+
left: 0;
|
|
344
|
+
bottom: 0;
|
|
345
|
+
border-top: 1px solid #e8e8e8;
|
|
346
|
+
background: #fff;
|
|
347
|
+
height: unit(180, rpx);
|
|
348
|
+
padding: 0 unit(20, rpx);
|
|
349
|
+
.safe-area();
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
&-top {
|
|
353
|
+
display: flex;
|
|
354
|
+
height: unit(80, rpx);
|
|
355
|
+
line-height: unit(80, rpx);
|
|
356
|
+
padding: 0 unit(20, rpx);
|
|
357
|
+
justify-content: space-between;
|
|
358
|
+
align-items: center;
|
|
359
|
+
font-size: @xd-font-size-lg;
|
|
360
|
+
|
|
361
|
+
> view:last-child {
|
|
362
|
+
display: flex;
|
|
363
|
+
justify-content: flex-end;
|
|
364
|
+
align-items: center;
|
|
365
|
+
|
|
366
|
+
> * {
|
|
367
|
+
padding: 0 unit(10, rpx);
|
|
368
|
+
font-size: @xd-font-size-big + 5;
|
|
369
|
+
font-weight: bold;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
&-bottom {
|
|
375
|
+
padding: 0 unit(20, rpx) unit(20, rpx);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
&-block {
|
|
379
|
+
height: unit(180, rpx);
|
|
380
|
+
width: 100%;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
}
|
|
385
|
+
</style>
|