jufubao-base 1.0.258-beta1 → 1.0.258-beta31
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
|
@@ -137,6 +137,28 @@ export default {
|
|
|
137
137
|
scanType: ["qrCode"],
|
|
138
138
|
// 扫描成功后的回调函数
|
|
139
139
|
success: (res) => {
|
|
140
|
+
console.log(res.resultStr,'res.resultStr');
|
|
141
|
+
// 判断res.resultStr是否包含'wx/cake/index/'
|
|
142
|
+
if(res.resultStr.includes('wx/cake/index/')){
|
|
143
|
+
// 将res.resultStr以'wx/cake/index/'分割,取分割后的第一个元素
|
|
144
|
+
let shop_id=res.resultStr.split('wx/cake/index/')[1]
|
|
145
|
+
// 将shop_id以'_'分割,取分割后的第一个元素
|
|
146
|
+
shop_id = shop_id.split('_')[0]
|
|
147
|
+
// 将shop_id转换为整数,并加上100000
|
|
148
|
+
shop_id = parseInt(shop_id)+100000
|
|
149
|
+
// 将shop_id转换为Base64编码的URI
|
|
150
|
+
let xParams = `shop_id:${shop_id}`
|
|
151
|
+
xParams = Base64.encodeURI(xParams)
|
|
152
|
+
// 拼接change_url和x-params参数
|
|
153
|
+
let path = `${this.change_url}?x-params=${xParams}&referrer=official`;
|
|
154
|
+
// 打印xParams和path
|
|
155
|
+
console.log(xParams,'pathpath');
|
|
156
|
+
// 跳转到指定路径
|
|
157
|
+
this.$xdUniHelper.navigateTo({
|
|
158
|
+
url: path,
|
|
159
|
+
});
|
|
160
|
+
return
|
|
161
|
+
}
|
|
140
162
|
// 定义一个变量params,将url按照"?"进行分割,获取到参数部分
|
|
141
163
|
let params = res.resultStr.split("?")[1]
|
|
142
164
|
? res.resultStr.split("?")[1]
|
|
@@ -225,6 +247,27 @@ export default {
|
|
|
225
247
|
uni.scanCode({
|
|
226
248
|
scanType: ["qrCode"],
|
|
227
249
|
success: (res) => {
|
|
250
|
+
// 判断res.resultStr是否包含'wx/cake/index/'
|
|
251
|
+
if(res.result.includes('wx/cake/index/')){
|
|
252
|
+
// 将res.resultStr以'wx/cake/index/'分割,取分割后的第一个元素
|
|
253
|
+
let shop_id=res.result.split('wx/cake/index/')[1]
|
|
254
|
+
// 将shop_id以'_'分割,取分割后的第一个元素
|
|
255
|
+
shop_id = shop_id.split('_')[0]
|
|
256
|
+
// 将shop_id转换为整数,并加上100000
|
|
257
|
+
shop_id = parseInt(shop_id)+100000
|
|
258
|
+
// 将shop_id转换为Base64编码的URI
|
|
259
|
+
let xParams = `shop_id:${shop_id}`
|
|
260
|
+
xParams = Base64.encodeURI(xParams)
|
|
261
|
+
// 拼接change_url和x-params参数
|
|
262
|
+
let path = `${this.change_url}?x-params=${xParams}&referrer=official`;
|
|
263
|
+
// 打印xParams和path
|
|
264
|
+
console.log(xParams,'pathpath');
|
|
265
|
+
// 跳转到指定路径
|
|
266
|
+
this.$xdUniHelper.navigateTo({
|
|
267
|
+
url: path,
|
|
268
|
+
});
|
|
269
|
+
return
|
|
270
|
+
}
|
|
228
271
|
// 定义一个变量params,将url按照"?"进行分割,获取到参数部分
|
|
229
272
|
let params = res.result.split("?")[1] ? res.result.split("?")[1] : "";
|
|
230
273
|
// 将参数部分按照"&"进行分割,获取到每个参数
|