init
This commit is contained in:
1
unpackage/dist/dev/.sourcemap/mp-weixin/utils/helper.js.map
vendored
Normal file
1
unpackage/dist/dev/.sourcemap/mp-weixin/utils/helper.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"helper.js","sources":["utils/helper.ts"],"sourcesContent":["\nimport {\n\tfetchConfig\n} from '../api/index';\n\n\nconst tabbar_pages = [\n\t'/pages/index/index',\n\t'/pages/cart/index',\n\t'/pages/mine/index',\n]\n\n\nexport const navigateTo = (url : string) => {\n\tlet is_tabbar_pages = false\n\ttabbar_pages.forEach(item => {\n\t\tif (url.indexOf(item) === 0) {\n\t\t\tis_tabbar_pages = true\n\t\t}\n\t})\n\tif (is_tabbar_pages) {\n\t\tswitchTab(url)\n\t} else {\n\t\tuni.navigateTo({\n\t\t\turl: url\n\t\t})\n\t}\n\n}\n\nexport const switchTab = (url : string) => {\n\tuni.switchTab({\n\t\turl: url\n\t})\n}\n\nexport const goToLoginPage = (redirect_url ?: string) => {\n\tnavigateTo('/pages/login/index?redirect_url=' + redirect_url)\n}\n// export const showWechatImg = () => {\n// \tuni.previewImage({\n// \t\turls: ['https://qn.19year.cn/20250329143234415bb1067.jpg']\n// \t})\n// }\n// export const showWechatPayImg = () => {\n// \tuni.previewImage({\n// \t\turls: ['https://qn.19year.cn/20250330193232a6aca4595.jpg']\n// \t})\n// }\n\nexport const goToOtherMiniProgram = async () => {\n\ttry {\n\t\tconst res = await fetchConfig();\n\t\tconsole.log('config response:', res);\n\t\tconst appid = res.go_to_app_id;\n\t\tconst path = res.go_to_app_path;\n\t\tuni.navigateToMiniProgram({\n\t\t\tappId: appid, // 替换为目标小程序的appid\n\t\t\tpath: path,\n\t\t\tsuccess(res) {\n\t\t\t\tconsole.log('跳转成功', res);\n\t\t\t},\n\t\t\tfail(err) {\n\t\t\t\tconsole.error('跳转失败', err);\n\t\t\t}\n\t\t});\n\t} catch (error) {\n\t\tconsole.error('Failed to load shop config:', error);\n\t\tuni.showToast({\n\t\t\ttitle: '加载失败',\n\t\t\ticon: 'none'\n\t\t});\n\t}\n}\n\nexport const showPayImgs = async () => {\n try {\n const res = await fetchConfig();\n console.log('config response:', res);\n // 注意这里可能要根据你的实际数据结构调整\n const store_qr_codes = res.pay_qr_code?.map(item => item.url) || [];\n if (store_qr_codes.length === 0) {\n uni.showToast({\n title: '暂无图片',\n icon: 'none'\n });\n return;\n }\n console.log('preview images:', store_qr_codes);\n uni.previewImage({\n urls: store_qr_codes\n });\n } catch (error) {\n console.error('Failed to load shop config:', error);\n uni.showToast({\n title: '加载失败',\n icon: 'none'\n });\n }\n}\n\nexport const clearReactiveData = (obj) => {\n\tfor (const key in obj) {\n\t\tdelete obj[key]\n\t}\n}\n\n\n// export const switchCart = (type) => {\n// \tuni.setStorageSync('SHOPPING_CART_TYPE', type)\n// \tuni.switchTab({ url: '/pages/cart/index' })\n// }"],"names":["uni"],"mappings":";;AAMA,MAAM,eAAe;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AACD;AAGa,MAAA,aAAa,CAAC,QAAiB;AAC3C,MAAI,kBAAkB;AACtB,eAAa,QAAQ,CAAQ,SAAA;AAC5B,QAAI,IAAI,QAAQ,IAAI,MAAM,GAAG;AACV,wBAAA;AAAA,IACnB;AAAA,EAAA,CACA;AACD,MAAI,iBAAiB;AACpB,cAAU,GAAG;AAAA,EAAA,OACP;AACNA,kBAAAA,MAAI,WAAW;AAAA,MACd;AAAA,IAAA,CACA;AAAA,EACF;AAED;AAEa,MAAA,YAAY,CAAC,QAAiB;AAC1CA,gBAAAA,MAAI,UAAU;AAAA,IACb;AAAA,EAAA,CACA;AACF;AAEa,MAAA,gBAAgB,CAAC,iBAA2B;AACxD,aAAW,qCAAqC,YAAY;AAC7D;;;;"}
|
||||
Reference in New Issue
Block a user