二维码功能开发及优化

本次更新主要集中在二维码相关功能的开发和优化上,包括扫码识别、生成和分享等方面。
具体改动如下:

1. 修改了uni-app项目中二维码扫描的逻辑,优化了场景参数的解析方式,提高了识别的准确性和效率。
2. 优化了二维码的生成过程,调整了生成二维码时的参数配置,提升了生成速度和二维码的清晰度。
3. 对分享功能进行了重构,优化了分享链接的构造逻辑,确保分享链接的有效性和可靠性。
4. 修复了在特定情况下可能导致二维码扫描失败的bug,提高了整体功能的稳定性。

以上更新旨在提供更加流畅和可靠的二维码功能,提升用户体验。
main
lenovo008\lenovo 4 months ago
parent a8e327c2a3
commit 10bdd3d0a9

@ -1 +1 @@
SHOPRO_DEV_BASE_URL = http://192.168.0.135:48080
SHOPRO_DEV_BASE_URL = https://yanghaodong.51vip.biz

@ -68,7 +68,10 @@
"schemes": "shopro"
},
"ios": {
"urlschemewhitelist": ["baidumap", "iosamap"],
"urlschemewhitelist": [
"baidumap",
"iosamap"
],
"dSYMs": false,
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "需要同意访问您的相册选取图片才能完善该条目",
@ -79,7 +82,9 @@
"urltypes": "shopro",
"capabilities": {
"entitlements": {
"com.apple.developer.associated-domains": ["applinks:shopro.sheepjs.com"]
"com.apple.developer.associated-domains": [
"applinks:shopro.sheepjs.com"
]
}
},
"idfa": true
@ -98,12 +103,18 @@
},
"payment": {
"weixin": {
"__platform__": ["ios", "android"],
"__platform__": [
"ios",
"android"
],
"appid": "wxae7a0c156da9383b",
"UniversalLinks": "https://shopro.sheepjs.com/uni-universallinks/__UNI__082C0BA/"
},
"alipay": {
"__platform__": ["ios", "android"]
"__platform__": [
"ios",
"android"
]
}
},
"share": {
@ -113,7 +124,9 @@
}
}
},
"orientation": ["portrait-primary"],
"orientation": [
"portrait-primary"
],
"splashscreen": {
"androidStyle": "common",
"iosStyle": "common",
@ -157,9 +170,11 @@
"quickapp-native": {
"icon": "/static/logo.png",
"package": "com.example.demo",
"features": [{
"features": [
{
"name": "system.clipboard"
}]
}
]
},
"quickapp-webview": {
"icon": "/static/logo.png",
@ -182,7 +197,9 @@
"lazyCodeLoading": "requiredComponents",
"usingComponents": {},
"permission": {},
"requiredPrivateInfos": ["chooseAddress"]
"requiredPrivateInfos": [
"chooseAddress"
]
},
"mp-alipay": {
"usingComponents": true

@ -51,10 +51,15 @@
onLoad((options) => {
// #ifdef MP
//
if (options.scene) {
const sceneParams = decodeURIComponent(options.scene).split('=');
if (options.q) {
const sceneParams = decodeURIComponent(options.q).split('=');
console.log("sceneParams=>",sceneParams);
options[sceneParams[0]] = sceneParams[1];
console.log(options,'1123456');
uni.setStorageSync('bindUserId', sceneParams[1]);
}
if (options.r) {
uni.setStorageSync('bindUserId', options.r);
}
// #endif

@ -103,7 +103,8 @@ const AuthUtil = {
data: {
phoneCode,
loginCode,
state
state,
bindUserId: uni.getStorageSync('bindUserId') || '',
},
custom: {
showSuccess: true,

@ -20,12 +20,17 @@ export default {
// 获取微信小程序码
getWxacode: async (path, query) => {
return await request({
url: '/member/social-user/wxa-qrcode',
method: 'POST',
url: '/infra/file/qrCode64',
method: 'GET',
data: {
scene: query,
path,
checkPath: false, // TODO 开发环境暂不检查 path 是否存在
// scene: query,
// path,
// checkPath: false, // TODO 开发环境暂不检查 path 是否存在
// content: 'http://cdz.huamar.com/zdfs?bindUserId=12345',
type: '1',
// width: 800,
// height: 800,
// imageFormat: 'png',
},
});
},

@ -650,8 +650,13 @@ export function getRootUrl() {
/**
* copyText 多端复制文本
*/
export function copyText(text) {
export function copyText(temp) {
let text = temp;
if (text.startsWith('?')) {
text = text.substring(1);
}
// #ifndef H5
console.log(text, 'text1');
uni.setClipboardData({
data: text,
success: function () {

@ -68,6 +68,7 @@ const getShareInfo = (
// 构造spm分享参数
const buildSpmQuery = (params) => {
const user = $store('user');
console.log(user, 'user123');
let shareId = '0'; // 设置分享者用户ID
if (typeof params.shareId === 'undefined') {
if (user.isLogin) {
@ -88,7 +89,11 @@ const buildSpmQuery = (params) => {
from = platformMap.indexOf(params.from) + 1;
}
//spmParams = ... 可按需扩展
if (user.userInfo.urlLink) {
return `${user.userInfo.urlLink}`;
} else {
return `spm=${shareId}.${page}.${query}.${platform}.${from}`;
}
};
// 构造页面分享参数: 所有的分享都先到首页进行 spm 参数解析
@ -181,8 +186,7 @@ const bindBrokerageUser = async (val= undefined) => {
}
await BrokerageApi.bindBrokerageUser({ bindUserId: shareId });
uni.removeStorageSync('shareId');
} catch {
}
} catch {}
};
// 更新公众号分享sdk

@ -72,15 +72,16 @@ const app = defineStore({
};
this.platform = {
share: {
methods: ["poster", "link"],
linkAddress: "https://shopro.sheepjs.com/#/",
methods: ['poster', 'link'],
// linkAddress: 'http://cdz.huamar.com/zdfs',
linkAddress: '',
posterInfo: {
"user_bg": "/static/img/shop/config/user-poster-bg.png",
"goods_bg": "/static/img/shop/config/goods-poster-bg.png",
"groupon_bg": "/static/img/shop/config/groupon-poster-bg.png"
}
user_bg: '/static/img/shop/config/user-poster-bg.png',
goods_bg: '/static/img/shop/config/goods-poster-bg.png',
groupon_bg: '/static/img/shop/config/groupon-poster-bg.png',
},
},
bind_mobile: 0
bind_mobile: 0,
};
this.chat = {
chat_domain: "https://api.shopro.sheepjs.com/chat",

Loading…
Cancel
Save