jufubao-base 1.0.89 → 1.0.100-beta2
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/package.json
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
<xd-city
|
|
18
18
|
:top="layoutInfo.top"
|
|
19
19
|
city-location-type="baidu"
|
|
20
|
-
:getCityInfoByLocation="getCityInfoByLocation"
|
|
21
20
|
@getCityList="handleGetCityList"
|
|
22
21
|
></xd-city>
|
|
23
22
|
</view>
|
|
@@ -25,135 +24,122 @@
|
|
|
25
24
|
</template>
|
|
26
25
|
|
|
27
26
|
<script>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
28
|
+
import XdCity from "@/components/XdCityApi/XdCityApi";
|
|
29
|
+
import { jfbRootExec } from "@/utils/xd.event";
|
|
30
|
+
import JfbBaseCityMixin from "./JfbBaseCityMixin";
|
|
31
|
+
import componentsMixins from "@/mixins/componentsMixins";
|
|
32
|
+
import extsMixins from "@/mixins/extsMixins"
|
|
33
|
+
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
34
|
+
export default {
|
|
35
|
+
name: "JfbBaseCity",
|
|
36
|
+
components: {
|
|
37
|
+
XdFontIcon,
|
|
38
|
+
XdCity
|
|
39
|
+
},
|
|
40
|
+
mixins: [componentsMixins,extsMixins,JfbBaseCityMixin],
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
top: null,
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
watch: {
|
|
47
|
+
container(value) {
|
|
48
|
+
this.init(value)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
created() {
|
|
52
|
+
this.init(this.container);
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
onJfbLoad(options) {
|
|
46
56
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
/**
|
|
58
|
+
* @description 监听事件变化
|
|
59
|
+
* @param container {object} 业务组件对象自己
|
|
60
|
+
*/
|
|
61
|
+
init(container) {
|
|
62
|
+
|
|
51
63
|
},
|
|
52
|
-
created() {
|
|
53
|
-
this.init(this.container);
|
|
54
64
|
|
|
55
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @description 获取城市列表接口
|
|
67
|
+
* @param location
|
|
68
|
+
* @param resolve
|
|
69
|
+
*/
|
|
70
|
+
handleGetCityList({location}, resolve){
|
|
71
|
+
jfbRootExec("getAllMapCity", {
|
|
72
|
+
vm: this,
|
|
73
|
+
data: {}
|
|
74
|
+
}).then(res => {
|
|
75
|
+
console.log("getAllMapCity", res);
|
|
76
|
+
resolve(this.toCityFormat(res));
|
|
77
|
+
})
|
|
56
78
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
//this.height = getContainerPropsValue(container, 'content.height', 10);
|
|
66
|
-
},
|
|
67
|
-
getCityInfoByLocation(options, cb){
|
|
68
|
-
jfbRootExec("getLoadingCityBaseCityByLocationLv4", {
|
|
69
|
-
vm: this,
|
|
70
|
-
data: options
|
|
71
|
-
}).then(res => {
|
|
72
|
-
cb(res)
|
|
73
|
-
}).catch(e => {
|
|
74
|
-
this.$xdLog.setARMSCustomError('get_city_info_by_location_city', this.$runtime.getErrorInfo(e));
|
|
75
|
-
cb({data: this.$settings.defaultCity})
|
|
76
|
-
})
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @description 获取城市列表接口
|
|
81
|
-
* @param location
|
|
82
|
-
* @param resolve
|
|
83
|
-
*/
|
|
84
|
-
handleGetCityList({location}, resolve){
|
|
85
|
-
jfbRootExec("getAllMapCity", {
|
|
86
|
-
vm: this,
|
|
87
|
-
data: {}
|
|
88
|
-
}).then(res => {
|
|
89
|
-
console.log("getAllMapCity", res);
|
|
90
|
-
resolve(this.toCityFormat(res));
|
|
91
|
-
})
|
|
92
|
-
},
|
|
93
|
-
/**
|
|
94
|
-
* @description 数据格式转换
|
|
95
|
-
*/
|
|
96
|
-
toCityFormat(cityInfo){
|
|
97
|
-
let classifyList = [];
|
|
98
|
-
cityInfo.letters.map((item)=>{
|
|
99
|
-
classifyList.push({idx: item});
|
|
100
|
-
});
|
|
79
|
+
/**
|
|
80
|
+
* @description 数据格式转换
|
|
81
|
+
*/
|
|
82
|
+
toCityFormat(cityInfo){
|
|
83
|
+
let classifyList = [];
|
|
84
|
+
cityInfo.letters.map((item)=>{
|
|
85
|
+
classifyList.push({idx: item});
|
|
86
|
+
});
|
|
101
87
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
88
|
+
let hotData = [];
|
|
89
|
+
Object.keys(cityInfo.hot_city_data).map((key)=>{
|
|
90
|
+
hotData.push({
|
|
91
|
+
"city_name": cityInfo.hot_city_data[key],
|
|
92
|
+
"city_id": key,
|
|
93
|
+
"city_code": key,
|
|
94
|
+
},)
|
|
95
|
+
});
|
|
110
96
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
128
|
-
list.push(item);
|
|
97
|
+
let list = [];
|
|
98
|
+
Object.keys(cityInfo.city_data).map((key)=>{
|
|
99
|
+
let item = {idx: key, cities: []};
|
|
100
|
+
cityInfo.city_data[key].map(itm=>{
|
|
101
|
+
let city_id = itm[0]['value'];
|
|
102
|
+
let city_name = itm[1]['value'];
|
|
103
|
+
let province_name = itm[2]['value'];
|
|
104
|
+
item.cities.push({
|
|
105
|
+
city_id,
|
|
106
|
+
city_code: city_id,
|
|
107
|
+
city_name,
|
|
108
|
+
province_name,
|
|
109
|
+
city_pinyin: '',
|
|
110
|
+
py: '',
|
|
111
|
+
letter: key,
|
|
112
|
+
})
|
|
129
113
|
});
|
|
114
|
+
list.push(item);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
console.log(classifyList, hotData, list)
|
|
118
|
+
return {
|
|
119
|
+
city_nav: list,
|
|
120
|
+
classify_nav: classifyList,
|
|
121
|
+
hot_city: hotData
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
onJfbBack(options) {
|
|
126
|
+
this.$xdUniHelper.navigateBack();
|
|
127
|
+
},
|
|
130
128
|
|
|
131
|
-
console.log(classifyList, hotData, list)
|
|
132
|
-
return {
|
|
133
|
-
city_nav: list,
|
|
134
|
-
classify_nav: classifyList,
|
|
135
|
-
hot_city: hotData
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
onJfbBack(options) {
|
|
140
|
-
this.$xdUniHelper.navigateBack();
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
}
|
|
144
129
|
}
|
|
130
|
+
}
|
|
145
131
|
|
|
146
132
|
</script>
|
|
147
133
|
|
|
148
134
|
<style scoped lang="less">
|
|
149
|
-
|
|
135
|
+
@import "./JfbBaseCityLess.less";
|
|
150
136
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
137
|
+
.jfb-base-city {
|
|
138
|
+
&__edit {
|
|
139
|
+
z-index: 20;
|
|
140
|
+
}
|
|
141
|
+
&__body{
|
|
142
|
+
z-index: 10;
|
|
158
143
|
}
|
|
144
|
+
}
|
|
159
145
|
</style>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<view v-if="logined && textType ==='N'" :style="{color:color}">{{userInfo|getName}}</view>
|
|
45
45
|
<view class="vertical-user" v-if="logined && textType ==='Y'" :style="{color:color}">
|
|
46
46
|
<view>{{userInfo|getName}}</view>
|
|
47
|
-
<view @click="handleToLink()"
|
|
47
|
+
<view @click="handleToLink()">
|
|
48
48
|
<xd-font-icon :color="color" size="40" icon="iconshezhi_mian"></xd-font-icon>
|
|
49
49
|
</view>
|
|
50
50
|
</view>
|