jufubao-base 1.0.28-beta21 → 1.0.28-beta23

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.28-beta21",
3
+ "version": "1.0.28-beta23",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -50,7 +50,7 @@
50
50
  "core-js": "^2.6.5",
51
51
  "flyio": "^0.6.2",
52
52
  "gxd-commands-bussiness": "^1.0.12",
53
- "gxd-uni-library-editx": "1.0.8-beta12",
53
+ "gxd-uni-library-editx": "1.0.8-beta16",
54
54
  "jweixin-module": "^1.6.0",
55
55
  "md5": "^2.3.0",
56
56
  "path-to-regexp": "^6.2.1",
@@ -4,6 +4,16 @@ export default {
4
4
  style: [],
5
5
  advanced: [],
6
6
  content: [
7
-
7
+ {
8
+ label: '卡解绑成功回跳地址:', //label
9
+ ele: 'xd-select-pages-path', //package 名称
10
+ valueKey: 'back_url', //form[valueKey]
11
+ placeholder: '请选择卡解绑成功回跳地址',
12
+ value: null,
13
+ setting: {
14
+ router: XdBus.getParentData('getPagesTree'),
15
+ },
16
+ inline: false,
17
+ },
8
18
  ],
9
19
  };
@@ -135,13 +135,10 @@
135
135
 
136
136
  download: '',
137
137
  qrcode: '',
138
-
139
- //todo
138
+ backUrl: ''
140
139
  }
141
140
  },
142
- created() {
143
- //todo
144
- },
141
+ created() {},
145
142
  methods: {
146
143
 
147
144
  onJfbLoad(options) {
@@ -247,9 +244,9 @@
247
244
  }
248
245
 
249
246
  }).then(res => {
250
- this.$xdUniHelper.navigateTo({
251
- url: `/pages/card/card`
252
- }, false)
247
+ this.$xdUniHelper.redirectTo({
248
+ url: this.backUrl
249
+ })
253
250
  }).catch()
254
251
  }
255
252
  }
@@ -290,7 +287,8 @@
290
287
  },
291
288
  init() {
292
289
  this.detail();
293
- this.refrush()
290
+ this.refrush();
291
+ this.backUrl = getContainerPropsValue(this.container, 'content.back_url', {value: '/pages/card/card'}).value;
294
292
  },
295
293
  /**
296
294
  * @description 获取卡详情
@@ -106,9 +106,7 @@
106
106
  backUrl: '',
107
107
  }
108
108
  },
109
- created() {
110
- this.backUrl = getContainerPropsValue(this.container, 'content.back_url', {value: '/pages/card/card'}).value;
111
- },
109
+ created() {},
112
110
  methods: {
113
111
  handleToLink(path) {
114
112
  if (this.card_password) {
@@ -150,7 +148,11 @@
150
148
  }).catch()
151
149
  }
152
150
  },
151
+ init() {
152
+ this.backUrl = getContainerPropsValue(this.container, 'content.back_url', {value: '/pages/card/card'}).value;
153
+ },
153
154
  onJfbLoad(options) {
155
+ this.init();
154
156
  this.qrcode = options.qrcode;
155
157
  this.card_number = options.card_number ? Base64.decode(options.card_number) : '';
156
158
  this.card_password = options.card_number ? Base64.decode(options.pwd) : '';
@@ -14,27 +14,36 @@
14
14
  </view>
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-city__body">
17
- <view>测试插件( {{containerId}} )</view>
17
+ <xd-city
18
+ :top="top"
19
+ city-location-type="baidu"
20
+ @getWeixinAppInfo="handleGetWeixinAppInfo"
21
+ @getCityList="handleGetCityList"
22
+ @getCityName="handleGetCityName"
23
+ ></xd-city>
18
24
  </view>
19
25
  </view>
20
26
  </template>
21
27
 
22
28
  <script>
23
29
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
30
+ import XdCity from "@/components/XdCity/XdCity";
31
+ import cityData from "./cityData.js";
24
32
  import { jfbRootExec } from "@/utils/xd.event";
25
33
  import JfbBaseCityMixin from "./JfbBaseCityMixin";
26
34
  import { getContainerPropsValue } from "@/utils/xd.base";
27
35
  export default {
28
36
  name: "JfbBaseCity",
29
37
  components: {
30
- XdFontIcon
38
+ XdFontIcon,
39
+ XdCity
31
40
  },
32
41
  mixins: [
33
42
  JfbBaseCityMixin
34
43
  ],
35
44
  data() {
36
45
  return {
37
-
46
+ top: null,
38
47
  //todo
39
48
  }
40
49
  },
@@ -66,10 +75,78 @@
66
75
  * @param container {object} 业务组件对象自己
67
76
  */
68
77
  init(container) {
78
+ //this.height = getContainerPropsValue(container, 'content.height', 10);
79
+ },
80
+ handleGetCityName(e){
69
81
 
70
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
82
+ },
83
+ /**
84
+ * @description 微信SDK获取appInfo 完成之后可以直接使用getApp().globalData.weixinSDK调用相关接口
85
+ * @param resolve
86
+ */
87
+ handleGetWeixinAppInfo(resolve){
88
+ setTimeout(()=>{
89
+ resolve({
90
+ appId: "wxb208eaa219459f14",
91
+ nonceStr: "61558dffb381f",
92
+ signature: "c9255180cbdfb8b493a9260223f191922724251c",
93
+ timestamp: 1632996863,
94
+ }, ['chooseWXPay', 'openLocation', 'getLocation']);
95
+ }, 2000);
71
96
 
72
- //this.height = getContainerPropsValue(container, 'content.height', 10);
97
+ },
98
+ /**
99
+ * @description 获取城市列表接口
100
+ * @param location
101
+ * @param resolve
102
+ */
103
+ handleGetCityList({location}, resolve){
104
+ console.log('handleGetCityList', location, cityData.result);
105
+ resolve(this.toCityFormat(cityData.result));
106
+ console.log(getApp().globalData.weixinSDK)
107
+ },
108
+ /**
109
+ * @description 数据格式转换
110
+ */
111
+ toCityFormat(cityInfo){
112
+ let classifyList = [];
113
+ cityInfo.letters.map((item)=>{
114
+ classifyList.push({idx: item});
115
+ });
116
+
117
+ let hotData = [];
118
+ Object.keys(cityInfo.hot_city_data).map((key)=>{
119
+ hotData.push({
120
+ "city_name": cityInfo.hot_city_data[key],
121
+ "city_id": Number(key),
122
+ },)
123
+ });
124
+
125
+ let list = [];
126
+ Object.keys(cityInfo.city_data).map((key)=>{
127
+ let item = {idx: key, cities: []};
128
+ cityInfo.city_data[key].map(itm=>{
129
+ let city_id = itm[0]['value'];
130
+ let city_name = itm[1]['value'];
131
+ let province_name = itm[2]['value'];
132
+ item.cities.push({
133
+ city_id,
134
+ city_name,
135
+ province_name,
136
+ city_pinyin: '',
137
+ py: '',
138
+ letter: key,
139
+ })
140
+ });
141
+ list.push(item);
142
+ });
143
+
144
+ console.log(classifyList, hotData, list)
145
+ return {
146
+ city_nav: list,
147
+ classify_nav: classifyList,
148
+ hot_city: hotData
149
+ }
73
150
  },
74
151
  onJfbScroll(options) {
75
152
  console.log('event.onJfbScroll', options)