From bfb8d05e66d3e8e3a8f487ea0cdda4ece629f515 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Fri, 27 Sep 2024 18:46:50 +0800 Subject: [PATCH 1/6] diy --- pages/goods-category/goods-category.vue | 7 +------ pages/index/index.vue | 12 +++++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pages/goods-category/goods-category.vue b/pages/goods-category/goods-category.vue index 526240c9..4ff1b93c 100644 --- a/pages/goods-category/goods-category.vue +++ b/pages/goods-category/goods-category.vue @@ -22,7 +22,7 @@ - + @@ -452,11 +452,6 @@ popup_status: false, // 获取搜索框高度 search_height: 0, - // 底部tab高度 - 只有H5下有值 - window_bottom_height: 0, - // #ifdef H5 - window_bottom_height: uni.getWindowInfo().windowBottom || 50, - // #endif // 样式 left_content_actual_style: '', right_content_actual_style: '', diff --git a/pages/index/index.vue b/pages/index/index.vue index 7560f4b2..bb2e55d3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -272,11 +272,13 @@ - - + + + - - + + + @@ -295,7 +297,7 @@ - + From 21c66208f318bdf02fd41405f90f9503543e5422 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Fri, 27 Sep 2024 19:08:26 +0800 Subject: [PATCH 2/6] debug --- node_modules/.package-lock.json | 15 ++++-------- node_modules/jweixin-module/README.md | 30 ------------------------ node_modules/jweixin-module/lib/index.js | 1 - node_modules/jweixin-module/package.json | 26 -------------------- package-lock.json | 30 +++++++----------------- pages/index/index.vue | 6 ++--- 6 files changed, 16 insertions(+), 92 deletions(-) delete mode 100644 node_modules/jweixin-module/README.md delete mode 100644 node_modules/jweixin-module/lib/index.js delete mode 100644 node_modules/jweixin-module/package.json diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 7dd9930e..877c987a 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,12 +1,7 @@ { - "name": "shopxo-uniapp", - "lockfileVersion": 2, - "requires": true, - "packages": { - "node_modules/jweixin-module": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz", - "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==" - } - } + "name": "jin-edit—仿简书非常好用的富文本编辑器", + "version": "1.1", + "lockfileVersion": 3, + "requires": true, + "packages": {} } diff --git a/node_modules/jweixin-module/README.md b/node_modules/jweixin-module/README.md deleted file mode 100644 index 7c91d7b0..00000000 --- a/node_modules/jweixin-module/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# jweixin-module - -微信JS-SDK - -## 安装 - -### NPM - -```shell -npm install jweixin-module --save -``` - -### UMD - -```http -https://unpkg.com/jweixin-module/out/index.js -``` - -## 使用 - -```js -var jweixin = require('jweixin-module') -jweixin.ready(function(){ - // TODO -}); -``` - -## 完整API - ->[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115) diff --git a/node_modules/jweixin-module/lib/index.js b/node_modules/jweixin-module/lib/index.js deleted file mode 100644 index 1b5014bf..00000000 --- a/node_modules/jweixin-module/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n + - + - - - From f62631eb11fdfec65144275a61fe1b1ca8298c94 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Fri, 27 Sep 2024 20:18:34 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=A1=B5=E9=9D=A2diy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/common/common.vue | 2 +- components/diy/diy.vue | 50 +++++++++++----- node_modules/jweixin-module/README.md | 30 ++++++++++ node_modules/jweixin-module/lib/index.js | 1 + node_modules/jweixin-module/package.json | 26 ++++++++ pages/diy/diy.vue | 22 +++---- pages/index/index.vue | 60 +++++++++++-------- .../components/uv-sticky/uv-sticky.vue | 2 +- 8 files changed, 140 insertions(+), 53 deletions(-) create mode 100644 node_modules/jweixin-module/README.md create mode 100644 node_modules/jweixin-module/lib/index.js create mode 100644 node_modules/jweixin-module/package.json diff --git a/components/common/common.vue b/components/common/common.vue index 3c97a728..1ad69567 100644 --- a/components/common/common.vue +++ b/components/common/common.vue @@ -67,7 +67,7 @@ // 底部菜单高度 footer_height_value_event(value) { this.setData({ - footer_height_value: (value*2)+40 + footer_height_value: (value*2)+20 }); this.$emit('footer-height', value); diff --git a/components/diy/diy.vue b/components/diy/diy.vue index 94a59014..12c21bd0 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -2,7 +2,7 @@ - + @@ -39,26 +39,34 @@ + + + - - - + + + + + + + + + @@ -107,7 +115,7 @@ propDataId: { type: [String, Number], default: '', - }, + } }, components: { componentDiyHeader, @@ -194,7 +202,10 @@ data_is_loading: 0, // 缓存key cache_key: app.globalData.data.cache_diy_data_key, - hackReset: false, + // 重置 + hack_reset: false, + // 底部导航高度 + footer_height_value: 0, }; }, created() { @@ -209,7 +220,7 @@ init_config(status) { if ((status || false) == true) { // 是否显示底部菜单,如果当前地址已经存在系统底部菜单中则不显示当前diy页面自定义的底部菜单 - var is_show_footer = this.propValue.header.com_data.content.bottom_navigation_show; + var is_show_footer = parseInt(this.propValue.header.com_data.content.bottom_navigation_show || 0) == 1; var is_tabbar = app.globalData.is_tabbar_pages(); this.setData({ is_show_footer: is_show_footer && !is_tabbar, @@ -223,7 +234,7 @@ init() { // tabs选项卡数据过滤 this.setData({ - hackReset: true, + hack_reset: true, header_data: this.propValue.header, footer_data: this.propValue.footer, diy_data: this.propValue.diy_data, @@ -242,7 +253,7 @@ this.setData({ is_tabs_type: bool, }); - const new_params = { + let new_params = { ...params, id: tabs_id, }; @@ -265,7 +276,7 @@ dataType: 'json', success: (res) => { // 数据处理 - const data = res.data.data.data; + let data = res.data.data.data; if (res.data.code == 0) { new_data = data?.config.diy_data || []; uni.setStorageSync(this.cache_key + tabs_id, new_data); @@ -329,7 +340,7 @@ title: this.$t('common.loading_in_text'), }); } - const new_data = { + let new_data = { category_id: this.tabs_id, page: this.goods_page, }; @@ -407,6 +418,8 @@ }, }); }, + + // 页面滚动事件 on_scroll_event(e) { this.setData({ scroll_top: e.detail.scrollTop, @@ -430,6 +443,13 @@ } // #endif }, + + // 底部菜单高度 + footer_height_value_event(value) { + this.setData({ + footer_height_value: (value*2)+20 + }); + } }, }; diff --git a/node_modules/jweixin-module/README.md b/node_modules/jweixin-module/README.md new file mode 100644 index 00000000..7c91d7b0 --- /dev/null +++ b/node_modules/jweixin-module/README.md @@ -0,0 +1,30 @@ +# jweixin-module + +微信JS-SDK + +## 安装 + +### NPM + +```shell +npm install jweixin-module --save +``` + +### UMD + +```http +https://unpkg.com/jweixin-module/out/index.js +``` + +## 使用 + +```js +var jweixin = require('jweixin-module') +jweixin.ready(function(){ + // TODO +}); +``` + +## 完整API + +>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115) diff --git a/node_modules/jweixin-module/lib/index.js b/node_modules/jweixin-module/lib/index.js new file mode 100644 index 00000000..1b5014bf --- /dev/null +++ b/node_modules/jweixin-module/lib/index.js @@ -0,0 +1 @@ +!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n - + - + + + + + - - - - + + \ No newline at end of file diff --git a/locale/en.json b/locale/en.json index 62d7ac8e..088b0296 100644 --- a/locale/en.json +++ b/locale/en.json @@ -63,7 +63,8 @@ "service_time": "service time ", "apply_time": "Application time", "verification_text": "Verification code", - "verification_message": "Please enter the verification code" + "verification_message": "Please enter the verification code", + "not_supported_scan_tips": "H5 webpage does not support scanning codes" }, "pages": { "goods-category": "Product classification", diff --git a/locale/zh.json b/locale/zh.json index f6700916..bc9470f1 100644 --- a/locale/zh.json +++ b/locale/zh.json @@ -63,7 +63,8 @@ "service_time": "服务时间", "apply_time": "申请时间", "verification_text": "核销码", - "verification_message": "请输入核销码" + "verification_message": "请输入核销码", + "not_supported_scan_tips": "H5网页不支持扫码" }, "pages": { "goods-category": "商品分类", diff --git a/pages/common/open-setting-location/open-setting-location.vue b/pages/common/open-setting-location/open-setting-location.vue index 5860105c..51ee6ce3 100644 --- a/pages/common/open-setting-location/open-setting-location.vue +++ b/pages/common/open-setting-location/open-setting-location.vue @@ -103,7 +103,8 @@ export default { // 调用位置选择组件 uni.chooseLocation({ success: (res) => { - // 位置数据存储缓存中 + // 位置数据存储缓存中,改变状态值(成功) + res['status'] = 1; uni.setStorageSync(this.cache_key, res); // 触发自定义事件并传递参数给上一页 @@ -116,7 +117,11 @@ export default { }, 500); // #endif }, - fail: (res) => { + fail: (res) => { + // 存在数据则改变状态值(失败) + var result = {...(uni.getStorageSync(this.cache_key) || {}), ...{status: 3}}; + uni.setStorageSync(this.cache_key, result); + // 取消则自动返回、则显示错误 // error=11 支付宝取消、msg包含cancel则其他平台 var msg = res.errorMessage || res.chooseLocation || res.errMsg || this.$t('open-setting-location.open-setting-location.hwn386'); diff --git a/pages/index/index.css b/pages/index/index.css index 52919cbb..3db744d8 100644 --- a/pages/index/index.css +++ b/pages/index/index.css @@ -14,8 +14,6 @@ } .home-top-nav-location { max-width: calc(100% - 200rpx); - height: 56rpx; - line-height: 56rpx; } .home-top-nav-logo { text-align: left; diff --git a/pages/index/index.vue b/pages/index/index.vue index 855df477..bba7249f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -33,14 +33,16 @@ - - + + + + @@ -331,6 +333,7 @@ import componentMagicList from '@/components/magic-list/magic-list'; import componentAppAdmin from '@/components/app-admin/app-admin'; import componentDiy from '@/components/diy/diy'; + import componentChoiceLocation from '@/components/choice-location/choice-location'; // 状态栏高度 var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true)); @@ -445,7 +448,8 @@ componentBindingList, componentMagicList, componentAppAdmin, - componentDiy + componentDiy, + componentChoiceLocation }, onLoad(params) { @@ -461,20 +465,6 @@ if (this.is_home_location_choice == 1) { // 用户位置初始化 this.user_location_init(); - // 先解绑自定义事件 - uni.$off('refresh'); - // 监听自定义事件并进行页面刷新操作 - uni.$on('refresh', (data) => { - // 初始位置数据 - if ((data.location_success || false) == true) { - // 用户位置初始化 - this.user_location_init(); - // 重新请求数据 - // #ifdef APP - this.init(); - // #endif - } - }); } // 数据加载 @@ -675,15 +665,17 @@ }, 3000); }, - // 选择用户地理位置 - choose_user_location_event(e) { - app.globalData.choose_user_location_event(); + // 选择用户地理位置回调 + user_back_choice_location(e) { + this.setData({ + user_location: e + }); }, // 用户地理位置初始化 user_location_init() { this.setData({ - user_location: app.globalData.choice_user_location_init(), + user_location: app.globalData.choice_user_location_init() }); }, From 25d59872b183889c6ca778207944f8f7188998b2 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sat, 28 Sep 2024 12:15:54 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 21 +++++++-- .../choice-location/choice-location.vue | 40 +++++++++++++---- .../extraction-apply/extraction-apply.vue | 33 ++++++++------ .../extraction-switch/extraction-switch.vue | 45 ++++++++++--------- pages/plugins/realstore/index/index.vue | 40 +++++++---------- pages/plugins/realstore/search/search.css | 3 ++ pages/plugins/realstore/search/search.vue | 40 ++++++----------- pages/user-address-save/user-address-save.vue | 37 +++++++++------ 8 files changed, 149 insertions(+), 110 deletions(-) diff --git a/App.vue b/App.vue index 1b635e2f..ddc3cb9d 100644 --- a/App.vue +++ b/App.vue @@ -1642,9 +1642,18 @@ // web地址 this.open_web_view(value, is_redirect); } else if (value.substr(0, 8) == 'appid://') { - // 打开外部小程序协议 + // 打开外部小程序协议(appid|/pages/index/index?pv=hello|extraData|envVersion) + var values = value.substr(8).split('|'); uni.navigateToMiniProgram({ - appId: value.substr(8), + appId: values[0], + path: values[1] || '', + extraData: values[2] || '', + envVersion: values[3] || 'release' + }); + } else if (value.substr(0, 12) == 'shortlink://') { + // 小程序分享链接 + uni.navigateToMiniProgram({ + shortLink: value.substr(12) }); } else if (value.substr(0, 6) == 'map://') { // 地图协议(名称|地址|lng|lat) @@ -2703,7 +2712,13 @@ }, }; } - user_location['text'] = user_location.name || user_location.address || i18n.t('shopxo-uniapp.app.4v6q86'); + // 默认名称 + var default_name = i18n.t('shopxo-uniapp.app.4v6q86'); + // 位置选择失败的状态,名称和默认名称不一致则认为是成功的 + if(user_location.status == 3 && user_location.name != default_name) { + user_location.status = 1; + } + user_location['text'] = user_location.name || user_location.address || default_name; return user_location; }, diff --git a/components/choice-location/choice-location.vue b/components/choice-location/choice-location.vue index 6191098d..78802652 100644 --- a/components/choice-location/choice-location.vue +++ b/components/choice-location/choice-location.vue @@ -1,12 +1,12 @@