Commit 9ae4544b by 谢中龙

修改优化功能

parent 4e862ab0
......@@ -46,11 +46,10 @@ Component({
bind: 'richText',
html: this.data.html || ``,
target: this,
enablePreviewImage: false, // 禁用图片预览功能
enablePreviewImage: true, // 禁用图片预览功能
tapLink: (url) => { // 点击超链接时的回调函数
// url 就是 HTML 富文本中 a 标签的 href 属性值
// 这里可以自定义点击事件逻辑,比如页面跳转
console.log(url)
if(url){
//跳转到web页面
if(url.indexOf('http:') > -1 || url.indexOf('https') > -1){
......
......@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4
//2006 泰华 , wx40fec8944623c8b3
......@@ -23,7 +23,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门
//2017 ACTREE wx2aae34874e88cdf5
//2992 山东盛联微商城 wx53dedc202ae0d0c2
const BRANCH_ID = 2010
const BRANCH_ID = 1002
const isMall = true
// const needMock = '' //
......
......@@ -167,7 +167,6 @@ wxService.page({
title: '加载中'
})
//获取商品详情
console.log('productId-----', this.data.productId)
wxService.get(`/sale/product/buyer/findByProductId?productId=${this.data.productId}`).then(res => {
const { result, data } = res.data
if (result == 0) {
......@@ -175,12 +174,34 @@ wxService.page({
data.type = 'share';
this.setData({
productInfo: data
})
},() => {
this.getUncacheStock();
});
}
}).finally(() => {
wx.hideLoading()
})
},
//刷新最新商品库存信息
getUncacheStock(){
//获取商品详情
wxService.get(`/sale/product/buyer/findDtoByProductId?productId=${this.data.productId}`).then(res => {
const { result, data } = res.data
if (result == 0) {
if(data){
this.data.productInfo.stock = data.stock;
this.data.productInfo.productSku = data.productSku;
if (data.descHtml){
this.data.productInfo.descHtml = data.descHtml;
}
this.setData({
productInfo: this.data.productInfo
})
}
}
}).finally(() => {})
},
// 获取会员等级开关
getMemberLevel() {
......
......@@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.8.2",
"appid": "wxe6d270a3e399ade9",
"appid": "wxac09792264c49b5c",
"projectname": "%E5%BE%AE%E5%95%86%E5%9F%8E",
"debugOptions": {
"hidedInDevtools": []
......@@ -43,7 +43,7 @@
"list": []
},
"miniprogram": {
"current": 16,
"current": 80,
"list": [
{
"id": -1,
......@@ -581,6 +581,13 @@
"pathName": "subPackageA/page/pages/shareArticle/shareArticle",
"query": "",
"scene": null
},
{
"id": -1,
"name": "分类下商品列表",
"pathName": "subPackage/page/pages/categoryPro/categoryPro",
"query": "id=659088011908222976&name=盖浇饭哦",
"scene": null
}
]
}
......
......@@ -33,7 +33,7 @@ const parse = ({ bind = 'wxParserData', html, target, enablePreviewImage = true,
return
}
let src = e.target.dataset.src
let tagFrom = e.target.dataset.from
let tagFrom = e.target.dataset.from;
if (typeof (tagFrom) !== 'undefined' && tagFrom.length > 0) {
wx.previewImage({
current: src, // 当前显示图片的 http 链接
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment