Commit 5d2884d6 by 赵雅纹

种草触点header带参

parent 9d2288bf
......@@ -273,6 +273,7 @@ wxService.page({
// 加入购物车
this.getPutCart(trolleySku)
} else if (this.data.showSkuPopupType == 'buy') {
console.log('buy')
// 关闭弹框
this.setData({
showSkuPopup: false
......@@ -285,6 +286,7 @@ wxService.page({
trolleySku2Buy: JSON.stringify(trolleySku2Buy)
}
const { fromZc } = this.data
console.log('fromZc', fromZc)
//判断是否从种草商品过来购买
if (fromZc) {
wxService.updateLocalTentacleInfo();
......
......@@ -123,8 +123,8 @@ wxService.page({
//存储
var timestamp = Date.parse(new Date())
var expiration = timestamp + 1800000
wx.setStorageSync('TEMP_TENTACLE_INFO', tempObj);
wx.setStorageSync('TIME_EXPIRATION', expiration);
wx.setStorageSync('TEMP_TENTACLE_INFO', tempObj);
wxService.router(`/pages/productDetail/productDetail?id=${productId}&fromZc=1`);
},
......@@ -194,9 +194,6 @@ wxService.page({
//获取内容下商品列表
getProList(){
var params = {
productIds: this.data.contentInfo.productIds
}
......
......@@ -64,45 +64,20 @@ wxService.page({
if (!res) return false
const { result, data } = res.data
if (result == 0) {
let productIds = []
for (var i in data.spreadProducts){
if (data.spreadProducts[i].id){
productIds.push(data.spreadProducts[i].id)
}
}
this.getByIdExtendProList(productIds)
}
}).finally(() => {
})
},
// 根据商品id,获取商品列表
getByIdExtendProList(productIds){
let params = {
productIds: productIds
}
wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, params).then(res => {
if (!res) return false
const { result, data } = res.data
if (result == 0 && data.content) {
this.setData({
proList: data.content
proList: data
})
for (var i in data.content){
this.data.sharePicData.push(data.content[i].indexUrl)
for (var i in data) {
this.data.sharePicData.push(data[i].imgUrl)
this.setData({
sharePicData: this.data.sharePicData
})
}
console.log(this.data.sharePicData)
}
}).finally(() => {
})
},
/**
* 用户点击右上角分享
*/
......@@ -113,18 +88,6 @@ wxService.page({
item.id = item.productId
})
// wxService.getTentacleContent(tentacleInfo).then(res => {
// if (res && res.tentacleId) {
// let id = Integer.digit(this.data.id, 10, 64);
// let tentacleId = Integer.digit(res.tentacleId, 10, 64);
// var path = `subPackage/page/pages/friendShareList/friendShareList?id=${id}&t=${tentacleId}`;
// console.log(path)
// return {
// path: path
// }
// }
// });
//修改为参数memberId
const { memberId, member } = wx.getStorageSync('_baseUserInfo')
var path = `subPackage/page/pages/friendShareList/friendShareList`;
......
......@@ -21,16 +21,16 @@
<view class="buy-product-wrap">
<view class="buy-product-content">
<block wx:for="{{proList}}" wx:key="{{index}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{item.productId}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{item.id}}">
<view class="buy-list" data-item="{{contentInfo}}" data-productid="{{item.productId}}">
<view class="prod-img">
<image src="{{item.indexUrl}}" />
<image src="{{item.imgUrl}}" />
</view>
<view class="prod-info">
<view class="prod-name">{{item.productName}}</view>
<view class="prod-name">{{item.name}}</view>
<!-- <view class="sale-btn">限时特价</view> -->
<view class="bottom-price">
<text class="price">¥{{utils.numberFormat(item.minSalePrice / 100)}}</text>
<text class="price">¥{{utils.numberFormat(item.price)}}</text>
<!-- <text class="cost-price">¥456</text> -->
<view class="look-over">查看详情</view>
</view>
......
......@@ -224,8 +224,8 @@ class Http {
wx.setStorageSync('TIME_EXPIRATION', time + 30*60*1000);
return JSON.stringify(tentacle);
}else{
wx.removeStorageSync('TENTACLE_CONTENT')
wx.removeStorageSync('TIME_EXPIRATION')
// wx.removeStorageSync('TENTACLE_CONTENT')
// wx.removeStorageSync('TIME_EXPIRATION')
}
return JSON.stringify(null);
......
......@@ -317,6 +317,7 @@ class WXService extends Http {
//判断tentacleInfo是否为空
if (!tentacleInfo) {
wx.setStorageSync('TENTACLE_CONTENT', tempTentacleInfo);
console.log('TENTACLE_CONTENT', wx.getStorageSync('TENTACLE_CONTENT'))
return;
}
//tentacleInfo 不为空
......
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