Commit 5d2884d6 by 赵雅纹

种草触点header带参

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