diff --git a/config.js b/config.js index 9325d95..f340b07 100644 --- a/config.js +++ b/config.js @@ -14,7 +14,8 @@ export default { * 商城ID (必填) * 可在超管后台-商城列表中查看10025 */ - storeId: 10001, + // storeId: 10001, + storeId: 10045, // storeId: 10037, diff --git a/manifest.json b/manifest.json index 2f9cbcc..04e172b 100644 --- a/manifest.json +++ b/manifest.json @@ -92,7 +92,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wx68d198de972a9e9d", + "appid" : "wxe843b6d7a4bd3389", "libVersion" : "latest", "setting" : { // 是否检查安全域名和 TLS 版本 diff --git a/pages.json b/pages.json index b7ff968..6edc952 100644 --- a/pages.json +++ b/pages.json @@ -745,6 +745,13 @@ "enablePullDownRefresh": true } }, + { + "path": "webView", + "style": { + "navigationBarTitleText": "商品详情", + "enablePullDownRefresh": true + } + }, { "path": "detail", "style": { diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index 3622b30..a142158 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -204,7 +204,9 @@ - + + @@ -557,6 +559,13 @@ } }, methods: { + onLook(isLink, url) { + if (isLink) { + uni.navigateTo({ + url: '/pages/goods/webView?src=' + encodeURIComponent(url) //url是h5的展示地址pageB + }) + } + }, async getGoodsStockInfor() { let params = { list: [{ @@ -878,6 +887,29 @@ } }) }, + getLinksFromRichText(richText) { + // 正则表达式匹配a标签及其href属性 + const regex = /]*href="?([^">]+)"?[^>]*>(.*?)<\/a>/gim; + let matches, links = ''; + + // 执行正则表达式匹配 + while ((matches = regex.exec(richText)) !== null) { + // matches[1]是href属性值,matches[2]是标签内的文本 + links = matches[1]; + } + + return links; + }, + getValueAfterSymbol(str, symbol) { + const parts = str.split(symbol); + if (parts.length > 1) { + return parts[1].trim(); // 使用trim()移除前后空格 + } + return str; // 如果没有找到符号,返回空字符串 + }, + containsLetterMix(str, mix) { + return new RegExp(mix.split('').join('\\w*')).test(str) + }, // 获取商品信息 getGoodsDetail(type) { const that = this @@ -897,10 +929,11 @@ .replace(/style=""/g, '') .replace(/ { this.$set(this.goods, item, info[item]) - // that.goods[item] = info[item] }) that.isTodo = true; @@ -1009,7 +1042,6 @@ return; } // 立即下单 - console.log(this.token, '登录信息') if (this.goods.stock_total == 0) { return this.$toast('库存不足,请选择其他商品购买') } diff --git a/pages/goods/webView.vue b/pages/goods/webView.vue new file mode 100644 index 0000000..c4a5c5a --- /dev/null +++ b/pages/goods/webView.vue @@ -0,0 +1,28 @@ +//PageWebview.vue + + + + + diff --git a/project.config.json b/project.config.json index 435aa7e..06a195e 100644 --- a/project.config.json +++ b/project.config.json @@ -1,5 +1,5 @@ { - "appid": "wx68d198de972a9e9d", + "appid": "wxe843b6d7a4bd3389", "compileType": "miniprogram", "libVersion": "3.3.3", "packOptions": {