forked from Tencent/tdesign-miniprogram-starter-retail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
address.js
31 lines (30 loc) · 815 Bytes
/
address.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/** 地址 */
export function genAddress(id) {
return {
saasId: '88888888',
uid: `8888888820550${id}`,
authToken: null,
id: `${id}`,
addressId: `${id}`,
phone: '17612345678',
name: `测试用户${id}`,
countryName: '中国',
countryCode: 'chn',
provinceName: '甘肃省',
provinceCode: '620000',
cityName: '甘南藏族自治州',
cityCode: '623000',
districtName: '碌曲县',
districtCode: '623026',
detailAddress: `松日鼎盛大厦${id}层${id}号`,
isDefault: `${id}` === '0' ? 1 : 0,
addressTag: id === 0 ? '' : '公司',
latitude: '34.59103',
longitude: '102.48699',
storeId: null,
};
}
/** 地址列表 */
export function genAddressList(len = 10) {
return new Array(len).fill(0).map((_, idx) => genAddress(idx));
}