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,579 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view>
|
|
3
|
+
<view class="xd-address" v-show="isShowAddress">
|
|
4
|
+
<view class="xd-address__close" @click="close">
|
|
5
|
+
<xd-font-icon
|
|
6
|
+
size="36"
|
|
7
|
+
icon="iconguanbi2"
|
|
8
|
+
color="#999"
|
|
9
|
+
:width="40"
|
|
10
|
+
:height="40"
|
|
11
|
+
></xd-font-icon>
|
|
12
|
+
</view>
|
|
13
|
+
<view class="xd-address__title">添加收货地址</view>
|
|
14
|
+
<view class="xd-address__body">
|
|
15
|
+
<view class="xd-address__body-item">
|
|
16
|
+
<view class="xd-address__body-item-label">收货人</view>
|
|
17
|
+
<view class="xd-address__body-item-input">
|
|
18
|
+
<input
|
|
19
|
+
class="xd-address__body-item-input-el"
|
|
20
|
+
placeholder-class="xd-address__body-item-input-placeholder"
|
|
21
|
+
@confirm="doneInput"
|
|
22
|
+
placeholder="收货人"
|
|
23
|
+
:adjust-position="false"
|
|
24
|
+
maxlength="20"
|
|
25
|
+
v-model="receipt_username"/>
|
|
26
|
+
</view>
|
|
27
|
+
<view class="xd-address__body-item-line" :style="{borderColor: $mainColor}"></view>
|
|
28
|
+
</view>
|
|
29
|
+
<view class="xd-address__body-item">
|
|
30
|
+
<view class="xd-address__body-item-label">手机号码</view>
|
|
31
|
+
<view class="xd-address__body-item-input">
|
|
32
|
+
<input
|
|
33
|
+
class="xd-address__body-item-input-el"
|
|
34
|
+
placeholder-class="xd-address__body-item-input-placeholder"
|
|
35
|
+
@confirm="doneInput"
|
|
36
|
+
placeholder="手机号码"
|
|
37
|
+
:adjust-position="false"
|
|
38
|
+
v-model="receipt_phone"/>
|
|
39
|
+
</view>
|
|
40
|
+
<view class="xd-address__body-item-line" :style="{borderColor: $mainColor}"></view>
|
|
41
|
+
</view>
|
|
42
|
+
<view class="xd-address__body-item">
|
|
43
|
+
<view class="xd-address__body-item-label">所在地区</view>
|
|
44
|
+
<view class="xd-address__body-item-input" @click="handleRegion">
|
|
45
|
+
<view style="color:#bbb" v-if="!receipt_region_name">所在地区</view>
|
|
46
|
+
<view v-else class="xd-address__body-content">{{receipt_region_name}}</view>
|
|
47
|
+
</view>
|
|
48
|
+
<view @click="toLocation">
|
|
49
|
+
<xd-font-icon size="30" icon="iconshouhuodizhi" color="#999"></xd-font-icon>
|
|
50
|
+
</view>
|
|
51
|
+
<view class="xd-address__body-item-line" :style="{borderColor: $mainColor, width: '95%'}"></view>
|
|
52
|
+
</view>
|
|
53
|
+
<view class="xd-address__body-item">
|
|
54
|
+
<view class="xd-address__body-item-label">详细地址</view>
|
|
55
|
+
<view class="xd-address__body-item-input">
|
|
56
|
+
<textarea
|
|
57
|
+
class="xd-address__body-item-input-textarea"
|
|
58
|
+
placeholder-class="xd-address__body-item-input-placeholder"
|
|
59
|
+
@confirm="doneInput"
|
|
60
|
+
placeholder="如道路、门牌号、小区、楼栋号、单元室等"
|
|
61
|
+
:adjust-position="false"
|
|
62
|
+
:focus="focus"
|
|
63
|
+
auto-height
|
|
64
|
+
maxlength="100"
|
|
65
|
+
:selection-start="focusNumber"
|
|
66
|
+
v-model="receipt_address"></textarea>
|
|
67
|
+
<div class="xd-address__body-item-input-tips" v-if="showTips">记得完善门牌号</div>
|
|
68
|
+
</view>
|
|
69
|
+
<view class="xd-address__body-item-line" :style="{borderColor: $mainColor}"></view>
|
|
70
|
+
</view>
|
|
71
|
+
</view>
|
|
72
|
+
<view class="xd-address__set">
|
|
73
|
+
<view>设为默认地址</view>
|
|
74
|
+
<view>
|
|
75
|
+
<xd-switch v-model="receipt_default" :checked="receipt_default" size="small"></xd-switch>
|
|
76
|
+
</view>
|
|
77
|
+
</view>
|
|
78
|
+
<view class="xd-address__btn">
|
|
79
|
+
<xd-button btn-type="primary" @click="save">保存</xd-button>
|
|
80
|
+
</view>
|
|
81
|
+
</view>
|
|
82
|
+
<view class="xd-select" v-show="!isShowAddress">
|
|
83
|
+
<view class="xd-address__close" @click="isShowAddress=!isShowAddress">
|
|
84
|
+
<xd-font-icon
|
|
85
|
+
size="36"
|
|
86
|
+
icon="iconguanbi2"
|
|
87
|
+
color="#999"
|
|
88
|
+
:width="40"
|
|
89
|
+
:height="40"
|
|
90
|
+
></xd-font-icon>
|
|
91
|
+
</view>
|
|
92
|
+
<view class="xd-select__title">请选择所在区域</view>
|
|
93
|
+
<view class="xd-select__body">
|
|
94
|
+
<view class="xd-select__body-warper">
|
|
95
|
+
<view
|
|
96
|
+
class="xd-select__body-item"
|
|
97
|
+
v-for="(item,index) in city_title"
|
|
98
|
+
:key="index"
|
|
99
|
+
>
|
|
100
|
+
<view
|
|
101
|
+
class="xd-select__body-item-text"
|
|
102
|
+
@click="reSelectCity(index)"
|
|
103
|
+
>{{city_name[index]||item}}
|
|
104
|
+
</view>
|
|
105
|
+
<view
|
|
106
|
+
class="xd-select__body-item-icon"
|
|
107
|
+
:style="{
|
|
108
|
+
borderColor : $mainColor,
|
|
109
|
+
background: (level < index? '#fff': $mainColor)
|
|
110
|
+
}"
|
|
111
|
+
></view>
|
|
112
|
+
</view>
|
|
113
|
+
</view>
|
|
114
|
+
<view class="xd-select__body-line" :style="{background:$mainColor}"></view>
|
|
115
|
+
</view>
|
|
116
|
+
<view class="xd-select__list" v-if="cityList.length > 0">
|
|
117
|
+
<view
|
|
118
|
+
class="xd-select__list-item"
|
|
119
|
+
v-for="(item,index) in cityList"
|
|
120
|
+
:key="index"
|
|
121
|
+
>
|
|
122
|
+
<text @click="selectCity(item)">{{item.label}}</text>
|
|
123
|
+
</view>
|
|
124
|
+
</view>
|
|
125
|
+
</view>
|
|
126
|
+
</view>
|
|
127
|
+
</template>
|
|
128
|
+
|
|
129
|
+
<script>
|
|
130
|
+
import XdSwitch from "@/components/XdSwitch/XdSwitch";
|
|
131
|
+
import XdButton from "@/components/XdButton/XdButton";
|
|
132
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
133
|
+
|
|
134
|
+
export default {
|
|
135
|
+
name: "XdAddress",
|
|
136
|
+
components: {
|
|
137
|
+
XdSwitch,
|
|
138
|
+
XdButton,
|
|
139
|
+
XdFontIcon
|
|
140
|
+
},
|
|
141
|
+
props: {
|
|
142
|
+
citySeparator: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: ' '
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
defaultValue: {
|
|
148
|
+
type: Object | null,
|
|
149
|
+
default: null
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
data() {
|
|
153
|
+
return {
|
|
154
|
+
id: null,
|
|
155
|
+
|
|
156
|
+
//添加地址
|
|
157
|
+
receipt_username: '', //收货人
|
|
158
|
+
receipt_phone: '', //手机号码
|
|
159
|
+
receipt_address: '', //详情地址
|
|
160
|
+
receipt_region: {}, //所在地址
|
|
161
|
+
receipt_region_name: '',//城市地址
|
|
162
|
+
receipt_default: false, //是否默认
|
|
163
|
+
|
|
164
|
+
//切换添加收货地址与切换城市UI
|
|
165
|
+
isShowAddress: true, //是否显示添加地址
|
|
166
|
+
|
|
167
|
+
//选择城市
|
|
168
|
+
level: -1, //-1 表示未选择任何城市 备注:0=>省份/区域 1=>城市 2=> 区/县 3=>街道
|
|
169
|
+
maxLevel: 4, //最大4级城市
|
|
170
|
+
maxStatus: false, //是否已到最大级别
|
|
171
|
+
cityList: [],
|
|
172
|
+
city_name: [], //城市名称
|
|
173
|
+
city_code: [], //城市代码
|
|
174
|
+
city_selected_data: [], //选择城市详情信息
|
|
175
|
+
city_title: ['省份/区域', '城市', '区/县', '街道'],
|
|
176
|
+
|
|
177
|
+
location: null, //用户定位信息
|
|
178
|
+
showTips: false, //是否显示提示
|
|
179
|
+
focus: false,
|
|
180
|
+
focusNumber: -1,
|
|
181
|
+
latitude: null,
|
|
182
|
+
longitude: null,
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
computed: {
|
|
186
|
+
|
|
187
|
+
getAddress() {
|
|
188
|
+
return {
|
|
189
|
+
id: this.id,
|
|
190
|
+
receipt_username: this.receipt_username,
|
|
191
|
+
receipt_phone: this.receipt_phone,
|
|
192
|
+
receipt_address: this.receipt_address,
|
|
193
|
+
receipt_default: this.receipt_default,
|
|
194
|
+
receipt_region: this.city_selected_data,
|
|
195
|
+
receipt_city_name: this.city_name,
|
|
196
|
+
receipt_city_code: this.city_code,
|
|
197
|
+
region_name: this.receipt_region_name,
|
|
198
|
+
latitude: this.latitude,
|
|
199
|
+
longitude: this.longitude
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
created() {
|
|
205
|
+
this.setValue();
|
|
206
|
+
|
|
207
|
+
/**监听用户定位成功事件**/
|
|
208
|
+
this.$bus.$on('onUserLocation', (location) => {
|
|
209
|
+
console.log('onUserLocation', location)
|
|
210
|
+
this.location = location;
|
|
211
|
+
this.latitude = location['latitude'];
|
|
212
|
+
this.longitude = location['longitude'];
|
|
213
|
+
this.receipt_address = location['sourceData']['title'];
|
|
214
|
+
|
|
215
|
+
this.handleParse(location);
|
|
216
|
+
this.showTips = true;
|
|
217
|
+
setTimeout(() => {
|
|
218
|
+
this.focus = true;
|
|
219
|
+
this.focusNumber = 200
|
|
220
|
+
}, 100)
|
|
221
|
+
|
|
222
|
+
setTimeout(() => {
|
|
223
|
+
this.showTips = false
|
|
224
|
+
}, 3000)
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
if (this.level === -1) {
|
|
229
|
+
this.getCity(0);
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
watch: {
|
|
234
|
+
defaultValue() {
|
|
235
|
+
this.setValue();
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
methods: {
|
|
240
|
+
handleRegion() {
|
|
241
|
+
if (!this.location) {
|
|
242
|
+
this.toLocation();
|
|
243
|
+
} else {
|
|
244
|
+
this.isShowAddress = !this.isShowAddress
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
handleParse(location) {
|
|
249
|
+
this.$emit('onAddressToCode', location, (res) => {
|
|
250
|
+
this.city_name = res['city_name'] || [];
|
|
251
|
+
this.city_code = res['city_code'] || [];
|
|
252
|
+
this.city_selected_data = res['city_selected_data'] || [];
|
|
253
|
+
this.receipt_region_name = res['receipt_region_name'] || '';
|
|
254
|
+
})
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
setValue() {
|
|
259
|
+
if (this.$xdUniHelper.checkVarType(this.defaultValue) === 'object') {
|
|
260
|
+
if (this.defaultValue['latitude']
|
|
261
|
+
&& this.defaultValue['longitude']
|
|
262
|
+
&& this.defaultValue['receipt_address']
|
|
263
|
+
) {
|
|
264
|
+
this.location = {
|
|
265
|
+
latitude: this.defaultValue['latitude'],
|
|
266
|
+
longitude: this.defaultValue['longitude'],
|
|
267
|
+
address: this.defaultValue['receipt_address']
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
Object.keys(this.defaultValue).map((key) => {
|
|
272
|
+
this[key] = this.defaultValue[key];
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
doneInput() {
|
|
278
|
+
uni.hideKeyboard()
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
setReceiptRegionName() {
|
|
282
|
+
this.receipt_region_name = this.city_name.join(this.citySeparator);
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @description 点击定位打开定位页面
|
|
287
|
+
*/
|
|
288
|
+
toLocation() {
|
|
289
|
+
this.$emit('onToLocation');
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @description 重新选择城市
|
|
294
|
+
*/
|
|
295
|
+
reSelectCity(level) {
|
|
296
|
+
//选择隔空城市不操作
|
|
297
|
+
if (level - this.level > 1) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
this.city_code = this.city_code.splice(0, level);
|
|
301
|
+
this.city_name = this.city_name.splice(0, level);
|
|
302
|
+
this.city_selected_data = this.city_selected_data.splice(0, level);
|
|
303
|
+
this.level = level - 1;
|
|
304
|
+
|
|
305
|
+
//获取城市信息
|
|
306
|
+
if (this.level === -1) {
|
|
307
|
+
this.getCity(0);
|
|
308
|
+
} else {
|
|
309
|
+
this.getCity(this.city_code[this.level]);
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
selectCity(item) {
|
|
314
|
+
if (this.level < (this.maxLevel - 1)) {
|
|
315
|
+
this.level++;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
//保存信息
|
|
320
|
+
this.$set(this.city_name, this.level, item.label)
|
|
321
|
+
this.$set(this.city_code, this.level, item.value)
|
|
322
|
+
this.$set(this.city_selected_data, this.level, item)
|
|
323
|
+
// this.city_name[this.level] = item.label;
|
|
324
|
+
// this.city_code[this.level] = item.value;
|
|
325
|
+
// this.city_selected_data[this.level] = item;
|
|
326
|
+
|
|
327
|
+
//是否启动获取城市列表
|
|
328
|
+
if (this.level < (this.maxLevel - 1)) {
|
|
329
|
+
this.getCity(item.value);
|
|
330
|
+
}
|
|
331
|
+
//选择完成操作
|
|
332
|
+
else {
|
|
333
|
+
this.isShowAddress = true;
|
|
334
|
+
this.setReceiptRegionName()
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* @description 获取城市数据接口
|
|
340
|
+
* @param parentId
|
|
341
|
+
* @example 城市数据格式 [{label: '北京市',value: 1},{label: '广东省',value: 2}]
|
|
342
|
+
*/
|
|
343
|
+
getCity(parentId) {
|
|
344
|
+
this.cityList = [];
|
|
345
|
+
this.$emit('getCity', {parentId, level: this.level + 1}, (cityList) => {
|
|
346
|
+
if (!this.$xdUniHelper.isEmpty(cityList)) {
|
|
347
|
+
if (!cityList[0]['label'] || !cityList[0]['value']) {
|
|
348
|
+
this.cityList = [];
|
|
349
|
+
throw new Error(`
|
|
350
|
+
1、当前数据格式错误,
|
|
351
|
+
2、正确格式需包含(label,value)字段。
|
|
352
|
+
例如: [{label: \'北京市\',value: 1},{label: \'广东省\',value: 2}]`
|
|
353
|
+
);
|
|
354
|
+
} else {
|
|
355
|
+
this.cityList = this.$xdUniHelper.cloneDeep(cityList);
|
|
356
|
+
}
|
|
357
|
+
} else {
|
|
358
|
+
//选择完成操作
|
|
359
|
+
this.isShowAddress = true;
|
|
360
|
+
this.setReceiptRegionName();
|
|
361
|
+
this.cityList = [];
|
|
362
|
+
}
|
|
363
|
+
})
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @description 保存事件
|
|
368
|
+
*/
|
|
369
|
+
save() {
|
|
370
|
+
this.$emit('save', this.getAddress);
|
|
371
|
+
},
|
|
372
|
+
|
|
373
|
+
close() {
|
|
374
|
+
this.$emit('close');
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
</script>
|
|
379
|
+
|
|
380
|
+
<style scoped lang="less">
|
|
381
|
+
|
|
382
|
+
.xd-address__body-content {
|
|
383
|
+
line-height: unit(36, rpx) !important;
|
|
384
|
+
|
|
385
|
+
& * {
|
|
386
|
+
line-height: unit(36, rpx) !important;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.xd-address {
|
|
392
|
+
padding: unit(40, rpx);
|
|
393
|
+
font-size: @xd-font-size-base + 1;
|
|
394
|
+
position: relative;
|
|
395
|
+
|
|
396
|
+
&__close {
|
|
397
|
+
width: unit(44, rpx);
|
|
398
|
+
height: unit(44, rpx);
|
|
399
|
+
position: absolute;
|
|
400
|
+
top: unit(10, rpx);
|
|
401
|
+
right: unit(10, rpx);
|
|
402
|
+
z-index: 2;
|
|
403
|
+
|
|
404
|
+
/deep/ .xd-iconfont {
|
|
405
|
+
display: flex;
|
|
406
|
+
justify-content: center;
|
|
407
|
+
align-items: center;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
&__title {
|
|
414
|
+
text-align: center;
|
|
415
|
+
line-height: unit(64, rpx);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
&__body {
|
|
419
|
+
&-item {
|
|
420
|
+
height: unit(102, rpx);
|
|
421
|
+
line-height: unit(102, rpx);
|
|
422
|
+
position: relative;
|
|
423
|
+
display: flex;
|
|
424
|
+
justify-content: flex-start;
|
|
425
|
+
align-items: center;
|
|
426
|
+
|
|
427
|
+
&-label {
|
|
428
|
+
width: unit(120, rpx);
|
|
429
|
+
padding-right: unit(20, rpx);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
&-input {
|
|
433
|
+
flex: 1;
|
|
434
|
+
display: flex;
|
|
435
|
+
justify-content: flex-start;
|
|
436
|
+
align-items: center;
|
|
437
|
+
position: relative;
|
|
438
|
+
|
|
439
|
+
&-tips {
|
|
440
|
+
background: #333;
|
|
441
|
+
color: #fff;
|
|
442
|
+
font-size: unit(22, rpx);
|
|
443
|
+
border-radius: unit(8, rpx);
|
|
444
|
+
position: absolute;
|
|
445
|
+
bottom: unit(-80, rpx);
|
|
446
|
+
line-height: unit(36, rpx);
|
|
447
|
+
padding: unit(10, rpx) unit(10, rpx);
|
|
448
|
+
left: 0;
|
|
449
|
+
opacity: .8;
|
|
450
|
+
z-index: 300;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
&-textarea {
|
|
454
|
+
font-size: @xd-font-size-base + 1;
|
|
455
|
+
width: 100%;
|
|
456
|
+
height: unit(40, rpx);
|
|
457
|
+
line-height: unit(40, rpx);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
&-el {
|
|
461
|
+
font-size: @xd-font-size-base + 1;
|
|
462
|
+
width: 100%;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/deep/ &-placeholder {
|
|
466
|
+
font-size: @xd-font-size-base + 1;
|
|
467
|
+
color: #ccc;
|
|
468
|
+
line-height: unit(40, rpx);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
&-line {
|
|
473
|
+
position: absolute;
|
|
474
|
+
bottom: 0;
|
|
475
|
+
left: 0;
|
|
476
|
+
right: 0;
|
|
477
|
+
border-bottom-width: 1px;
|
|
478
|
+
border-bottom-style: solid;
|
|
479
|
+
opacity: 0.2;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
&__set {
|
|
485
|
+
display: flex;
|
|
486
|
+
justify-content: space-between;
|
|
487
|
+
align-items: center;
|
|
488
|
+
font-size: @xd-font-size-base + 1;
|
|
489
|
+
height: unit(102, rpx);
|
|
490
|
+
line-height: unit(102, rpx);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.xd-select {
|
|
495
|
+
padding: unit(40, rpx);
|
|
496
|
+
font-size: @xd-font-size-base + 1;
|
|
497
|
+
position: relative;
|
|
498
|
+
|
|
499
|
+
&__close {
|
|
500
|
+
width: unit(44, rpx);
|
|
501
|
+
height: unit(44, rpx);
|
|
502
|
+
position: absolute;
|
|
503
|
+
top: unit(10, rpx);
|
|
504
|
+
right: unit(10, rpx);
|
|
505
|
+
z-index: 2;
|
|
506
|
+
|
|
507
|
+
/deep/ .xd-iconfont {
|
|
508
|
+
display: flex;
|
|
509
|
+
justify-content: center;
|
|
510
|
+
align-items: center;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
&__title {
|
|
516
|
+
text-align: center;
|
|
517
|
+
line-height: unit(64, rpx);
|
|
518
|
+
margin-bottom: unit(30, rpx);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
&__body {
|
|
522
|
+
position: relative;
|
|
523
|
+
height: unit(60, rpx);
|
|
524
|
+
|
|
525
|
+
&-warper {
|
|
526
|
+
height: unit(60, rpx);
|
|
527
|
+
display: flex;
|
|
528
|
+
justify-content: space-between;
|
|
529
|
+
align-items: center;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
&-item {
|
|
533
|
+
height: 100%;
|
|
534
|
+
width: 25%;
|
|
535
|
+
flex: 1;
|
|
536
|
+
text-align: center;
|
|
537
|
+
position: relative;
|
|
538
|
+
|
|
539
|
+
&-text {
|
|
540
|
+
height: 100%;
|
|
541
|
+
line-height: unit(60, rpx);
|
|
542
|
+
white-space: nowrap;
|
|
543
|
+
text-overflow: ellipsis;
|
|
544
|
+
overflow: hidden;
|
|
545
|
+
word-break: break-all;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
&-icon {
|
|
549
|
+
position: absolute;
|
|
550
|
+
bottom: unit(-10, rpx);
|
|
551
|
+
left: 50%;
|
|
552
|
+
transform: translateX(-50%);
|
|
553
|
+
height: unit(16, rpx);
|
|
554
|
+
width: unit(16, rpx);
|
|
555
|
+
box-sizing: border-box;
|
|
556
|
+
border-width: 1px;
|
|
557
|
+
border-style: solid;
|
|
558
|
+
border-radius: 50%;
|
|
559
|
+
background: #fff;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
&-line {
|
|
564
|
+
height: 2px;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
&__list {
|
|
569
|
+
margin: unit(20, rpx) 0;
|
|
570
|
+
height: 40vh;
|
|
571
|
+
overflow-y: auto;
|
|
572
|
+
|
|
573
|
+
&-item {
|
|
574
|
+
line-height: unit(60, rpx);
|
|
575
|
+
height: unit(60, rpx);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
</style>
|