jufubao-base 1.0.89 → 1.0.100

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.89",
3
+ "version": "1.0.100",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -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
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
29
- import XdCity from "@/components/XdCityApi/XdCityApi";
30
- import { jfbRootExec } from "@/utils/xd.event";
31
- import JfbBaseCityMixin from "./JfbBaseCityMixin";
32
- import componentsMixins from "@/mixins/componentsMixins";
33
- import extsMixins from "@/mixins/extsMixins"
34
- import { getContainerPropsValue } from "@/utils/xd.base";
35
- export default {
36
- name: "JfbBaseCity",
37
- components: {
38
- XdFontIcon,
39
- XdCity
40
- },
41
- mixins: [componentsMixins,extsMixins,JfbBaseCityMixin],
42
- data() {
43
- return {
44
- top: null,
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
- watch: {
48
- container(value) {
49
- this.init(value)
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
- //todo
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
- methods: {
58
- onJfbLoad(options) {
59
- },
60
- /**
61
- * @description 监听事件变化
62
- * @param container {object} 业务组件对象自己
63
- */
64
- init(container) {
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
- let hotData = [];
103
- Object.keys(cityInfo.hot_city_data).map((key)=>{
104
- hotData.push({
105
- "city_name": cityInfo.hot_city_data[key],
106
- "city_id": key,
107
- "city_code": key,
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
- let list = [];
112
- Object.keys(cityInfo.city_data).map((key)=>{
113
- let item = {idx: key, cities: []};
114
- cityInfo.city_data[key].map(itm=>{
115
- let city_id = itm[0]['value'];
116
- let city_name = itm[1]['value'];
117
- let province_name = itm[2]['value'];
118
- item.cities.push({
119
- city_id,
120
- city_code: city_id,
121
- city_name,
122
- province_name,
123
- city_pinyin: '',
124
- py: '',
125
- letter: key,
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
- @import "./JfbBaseCityLess.less";
135
+ @import "./JfbBaseCityLess.less";
150
136
 
151
- .jfb-base-city {
152
- &__edit {
153
- z-index: 20;
154
- }
155
- &__body{
156
- z-index: 10;
157
- }
137
+ .jfb-base-city {
138
+ &__edit {
139
+ z-index: 20;
140
+ }
141
+ &__body{
142
+ z-index: 10;
158
143
  }
144
+ }
159
145
  </style>