diff --git a/App.vue b/App.vue index ac196bd5..ce22847b 100644 --- a/App.vue +++ b/App.vue @@ -66,14 +66,16 @@ weixin_privacy_setting_timer: null, // 微信小程序打开地图使用(0否, 1是)【腾讯位置服务路线规划】插件、(需要到小程序后台设置->第三方设置->插件管理里面添加【腾讯位置服务路线规划】插件,教程 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a) is_weixin_open_location_use_plugins: 0, + // 首页搜索框开启扫一扫自动(0否, 1是)仅【小程序、APP】支持 + is_home_search_scan: 1, // tabbar页面 tabbar_pages: ['/pages/index/index', '/pages/goods-category/goods-category', '/pages/cart/cart', '/pages/user/user'], // 请求地址 - // request_url: 'https://new.shopxo.vip/', - request_url: 'http://shopxo.com/', + request_url: 'https://new.shopxo.vip/', + // request_url: 'http://shopxo.com/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/) - // static_url: 'https://new.shopxo.vip/', - static_url: 'http://shopxo.com/', + static_url: 'https://new.shopxo.vip/', + // static_url: 'http://shopxo.com/', // 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立) system_type: 'default', // 基础信息 @@ -1119,12 +1121,21 @@ var is_redirect = parseInt(e.currentTarget.dataset.redirect || 0) == 1; this.url_open(value, is_redirect); }, + // 是否为url地址 + is_url(value) { + var arr = ['http:/', 'https:']; + return arr.indexOf(value.substr(0, 6)) != -1; + }, + // 是否为page页面地址 + is_page(value) { + var arr = ['/pages', 'pages/']; + return arr.indexOf(value.substr(0, 6)) != -1; + }, // url打开 url_open(value, is_redirect = false) { if ((value || null) != null) { // web地址 - var http_arr = ['http:/', 'https:']; - if (http_arr.indexOf(value.substr(0, 6)) != -1) { + if (this.is_url(value)) { this.open_web_view(value); // 打开外部小程序协议 } else if (value.substr(0, 8) == 'appid://') { @@ -1144,26 +1155,30 @@ this.call_tel(value.substr(6)); // 默认切换或跳转页面 } else { - if (this.is_tabbar_pages(value)) { - var temp = value.split('?'); - if (temp.length > 1 && (temp[1] || null) != null) { - value = temp[0]; - var query = this.url_params_to_json(temp[1]); - uni.setStorageSync(this.data.cache_page_tabbar_switch_params, query); - } - uni.switchTab({ - url: value, - }); - } else { - if (is_redirect) { - uni.redirectTo({ + if(this.is_page(value)) { + if (this.is_tabbar_pages(value)) { + var temp = value.split('?'); + if (temp.length > 1 && (temp[1] || null) != null) { + value = temp[0]; + var query = this.url_params_to_json(temp[1]); + uni.setStorageSync(this.data.cache_page_tabbar_switch_params, query); + } + uni.switchTab({ url: value, }); } else { - uni.navigateTo({ - url: value, - }); + if (is_redirect) { + uni.redirectTo({ + url: value, + }); + } else { + uni.navigateTo({ + url: value, + }); + } } + } else { + this.showToast('未知数据('+value+')'); } } } @@ -1937,6 +1952,63 @@ } return width; }, + + // weburl地址id值匹配 + web_url_value_mate(url, rules) { + var value = null; + for(var i in rules) { + if(url.indexOf(rules[i]) != -1) { + var temp = url.split(rules[i]); + if(temp.length > 1) { + temp = temp[1].split('.'); + if(temp.length > 0 && (temp[0] || null) != null) { + value = temp[0]; + break; + } + } + } + } + return value; + }, + + // 扫码解析处理 + scan_handle() { + var self = this; + uni.scanCode({ + success: function (res) { + if(res.result !== '') { + var value = res.result; + // 是否为url地址 + if(self.is_url(value)) { + // 是否为商品地址 + var goods_arr = ['/goods-', '/goods/index/id/', '=goods/index/id/']; + var goods_id = self.web_url_value_mate(value, goods_arr); + if(goods_id != null) { + uni.navigateTo({ + url: '/pages/goods-detail/goods-detail?id='+goods_id, + }); + return; + } + + // 是否为多商户店铺详情地址 + var shop_arr = ['/shop-index-detail-', '/plugins/index/pluginsname/shop/pluginscontrol/index/pluginsaction/detail/id/', '=plugins/index/pluginsname/shop/pluginscontrol/index/pluginsaction/detail/id/']; + var shop_id = self.web_url_value_mate(value, shop_arr); + if(shop_id != null) { + uni.navigateTo({ + url: '/pages/plugins/shop/detail/detail?id='+shop_id, + }); + return; + } + + // 默认打开url + self.open_web_view(value); + } else { + self.url_open(value); + } + } + }, + }); + } }, // 初始化完成时触发(全局只触发一次) onLaunch(params) {}, diff --git a/components/search/search.vue b/components/search/search.vue index 16642aab..961b45e3 100644 --- a/components/search/search.vue +++ b/components/search/search.vue @@ -186,8 +186,8 @@ .search-content .search-icon { z-index: 1; left: 20rpx; - top: calc(50% - 14rpx); - line-height: 22rpx; + top: calc(50% - 12rpx); + line-height: 26rpx; } .search-content input { diff --git a/pages/goods-category/goods-category.css b/pages/goods-category/goods-category.css index bf558a26..88b815ee 100644 --- a/pages/goods-category/goods-category.css +++ b/pages/goods-category/goods-category.css @@ -97,10 +97,6 @@ font-weight: 600; } -.content-item .desc { - margin-bottom: 56rpx; -} - .content-item .icon { width: 92rpx; height: 92rpx; @@ -117,6 +113,13 @@ .model-one .content-item:nth-child(3n) { border-right: 0; +} +.model-one .content .desc { + min-height: 52rpx; + line-height: 26rpx; +} +.model-one .content { + height: 240rpx; } .one-content image { diff --git a/pages/goods-category/goods-category.vue b/pages/goods-category/goods-category.vue index 623449cd..324c2993 100644 --- a/pages/goods-category/goods-category.vue +++ b/pages/goods-category/goods-category.vue @@ -29,9 +29,9 @@ - + {{ item.name }} - {{ item.describe }} + {{ item.describe }} @@ -227,7 +227,7 @@ - + {{ v.name }} @@ -248,7 +248,7 @@ - + {{ vs.name }} diff --git a/pages/index/index.vue b/pages/index/index.vue index 9ec915ef..555083bf 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -22,17 +22,28 @@ - - @onicon="search_icon_event" - propIcon="icon-mendian-sousuosm" - :propIsIconOnEvent="true" - - > + + + + @onicon="search_icon_event" + propIcon="icon-mendian-sousuosm" + :propIsIconOnEvent="true" + + > + + + + @@ -329,6 +340,7 @@ data_bottom_line_status: false, load_status: 0, currency_symbol: app.globalData.data.currency_symbol, + is_home_search_scan: app.globalData.data.is_home_search_scan, data_list: [], banner_list: [], navigation: [], @@ -635,13 +647,7 @@ // 搜索icon扫码事件 search_icon_event(e) { - console.log(1) - uni.scanCode({ - success: function (res) { - console.log(res.result) - app.globalData.open_web_view(res.result); - }, - }); + app.globalData.scan_handle(); } } }; diff --git a/pages/personal/personal.vue b/pages/personal/personal.vue index b29d1452..9bdb97d9 100644 --- a/pages/personal/personal.vue +++ b/pages/personal/personal.vue @@ -20,7 +20,6 @@ 昵称* - @@ -38,7 +37,6 @@ 详细地址 - diff --git a/pages/plugins/ask/detail/detail.vue b/pages/plugins/ask/detail/detail.vue index 919bf2b8..93076ec6 100644 --- a/pages/plugins/ask/detail/detail.vue +++ b/pages/plugins/ask/detail/detail.vue @@ -36,10 +36,10 @@ - - 管理员 + + 管理员回复 - 回复时间: {{ data.reply_time_date }} + 回复时间: {{ data.reply_time_date }} {{ data.reply }} @@ -59,7 +59,7 @@ - + 我要提问 @@ -89,7 +89,7 @@ export default { data() { return { - ask_static_url: app.globalData.get_static_url('ask', true), + logo_square: app.globalData.get_application_logo_square(), data_list_loding_status: 1, data_bottom_line_status: true, data: null, diff --git a/pages/plugins/ask/index/index.vue b/pages/plugins/ask/index/index.vue index f486feec..413ce77f 100644 --- a/pages/plugins/ask/index/index.vue +++ b/pages/plugins/ask/index/index.vue @@ -45,7 +45,7 @@ - + 我要提问 diff --git a/pages/plugins/scanpay/index/index.vue b/pages/plugins/scanpay/index/index.vue new file mode 100644 index 00000000..02409e35 --- /dev/null +++ b/pages/plugins/scanpay/index/index.vue @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/pages/setup/setup.vue b/pages/setup/setup.vue index b36ec2aa..aa14ef36 100644 --- a/pages/setup/setup.vue +++ b/pages/setup/setup.vue @@ -6,9 +6,8 @@ - + {{ user.user_name_view || '用户名' }} - ID {{ user.id }}