Commit a88b9d43 by zhangxw

首页修改

1 parent 9c79d042
...@@ -80,5 +80,13 @@ module.exports = { ...@@ -80,5 +80,13 @@ module.exports = {
/**获取门店数据 */ /**获取门店数据 */
getMerchantData(data) { getMerchantData(data) {
return http.fetch('scrm.api.shopmall.score.list.merchant', {...data}) return http.fetch('scrm.api.shopmall.score.list.merchant', {...data})
},
/**进入商品详情页面埋点 */
dynamicRecordAdd(data) {
return http.fetch('scrm.api.shopmall.scrm.customer.dynamic.record.add', {...data})
},
/**离开商品详情页面埋点 */
dynamicRecordLeave(data) {
return http.fetch('scrm.api.shopmall.scrm.customer.dynamic.record.leave', {...data})
} }
}; };
...@@ -61,8 +61,7 @@ ...@@ -61,8 +61,7 @@
"pages/integral/withdrawalRules/withdrawalRules", "pages/integral/withdrawalRules/withdrawalRules",
"pages/confirmOrder/index", "pages/confirmOrder/index",
"pages/exchangeSuccess/index", "pages/exchangeSuccess/index",
"pages/integral/withdrawalDetail/withdrawalDetail", "pages/integral/withdrawalDetail/withdrawalDetail"
"pages/selfGoodsDetail/index"
] ]
}, },
{ {
......
...@@ -52,7 +52,7 @@ Component({ ...@@ -52,7 +52,7 @@ Component({
}, },
// 替换积分钱包名称 // 替换积分钱包名称
replaceNickName(data) { replaceNickName(data) {
let userInfo = wx.p.cache.userInfo.getUserInfo() let userInfo = wx.p.storage.get('userInfo')
commonApi.replaceWalletName({ commonApi.replaceWalletName({
nickName: data?.name, nickName: data?.name,
phone: data?.phone, phone: data?.phone,
......
// components/GoodsAction/GoodsAction.js // components/GoodsAction/GoodsAction.js
import cartApi from '~/api/module/cart.js'
import NP from 'number-precision'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -36,11 +38,31 @@ Component({ ...@@ -36,11 +38,31 @@ Component({
click(e) { click(e) {
let { event } = e.currentTarget.dataset let { event } = e.currentTarget.dataset
this.triggerEvent('click', event) this.triggerEvent('click', event)
},
getCartNum() {
let userInfo = wx.p.storage.get('userInfo')
let para = {
scoreSource: userInfo?.channelSource,
merchantId: userInfo?.merchantId
}
cartApi.getCartList(para).then(res => {
let cartNum = 0
res?.goodsList?.forEach(el => {
cartNum = NP.plus(cartNum, el.sellQty)
})
this.setData({
cartNum
})
})
} }
}, },
lifetimes: { lifetimes: {
attached() { attached() {
this.getViewInfo() this.getViewInfo()
let { custom } = this.data
if (!custom) {
this.getCartNum()
}
} }
} }
}) })
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="goods-action"> <view class="goods-action">
<view class="navigation-box"> <view class="navigation-box">
<view class="item" wx:if="{{!hideShop}}" bindtap="jump"> <view class="item" wx:if="{{!hideShop}}" bindtap="jump">
<view v-if="{{true}}" class="goods-num">{{15}}</view> <view v-if="{{true}}" class="goods-num">{{cartNum}}</view>
<view class="sprite-icon" > <view class="sprite-icon" >
<glsx-image src="/index/goods-cart.png"></glsx-image> <glsx-image src="/index/goods-cart.png"></glsx-image>
</view> </view>
......
...@@ -14,9 +14,7 @@ Component({ ...@@ -14,9 +14,7 @@ Component({
this.setData({ this.setData({
detailInfo: JSON.parse(JSON.stringify(n)) detailInfo: JSON.parse(JSON.stringify(n))
}, () => { }, () => {
this.setData({ this.setDefaultSku(n)
['detailInfo.platformGlGoodsSpecifications[0].active']: true
})
}) })
} }
}, },
...@@ -50,22 +48,57 @@ Component({ ...@@ -50,22 +48,57 @@ Component({
}) })
this.triggerEvent('cancelSku') this.triggerEvent('cancelSku')
}, },
setDefaultSku(detailInfo) {
let specificationDetailList = detailInfo.platformGlGoodsSpecifications && detailInfo.platformGlGoodsSpecifications[0]
let defaultGoods = specificationDetailList?.specificationData.split('&')
detailInfo.platformGlGoodsSpecificationList?.map(e => {
defaultGoods.map(i => {
let [key, value] = i.split('-')
if (key == e.specificationName) {
e.platformSpecificationValueList.map(c => {
if (c.specificationValue == value) c.active = true
})
}
})
})
this.setData({
detailInfo
})
},
// 选择规格
choose(e) { choose(e) {
let { target } = e.currentTarget.dataset let { index, ind } = e.currentTarget.dataset
let { detailInfo } = this.data let { detailInfo } = this.data
detailInfo?.platformGlGoodsSpecifications?.forEach(val => { let { platformGlGoodsSpecificationList, platformGlGoodsSpecifications } = detailInfo
val.active = false let activeList = []
if (val.specificationData == target.specificationData) val.active = true if (platformGlGoodsSpecificationList[index].platformSpecificationValueList[ind].active) return
platformGlGoodsSpecificationList[index].platformSpecificationValueList.map(i => (i.active = false))
platformGlGoodsSpecificationList[index].platformSpecificationValueList[ind].active = true
platformGlGoodsSpecificationList.map(i => {
i.platformSpecificationValueList.map(c => {
if (c.active) activeList.push(`${i.specificationName}-${c.specificationValue}`)
})
})
let specificationData = activeList.join('&')
let redeemPoints, goodsStock, saleAmount
platformGlGoodsSpecifications?.map(val => {
if (val.specificationData == specificationData) {
redeemPoints = val.retailPrice
goodsStock = val.stock
saleAmount = val.saleAmount
}
}) })
this.setData({ this.setData({
detailInfo, detailInfo,
['detailInfo.redeemPoints']: target.retailPrice, ['detailInfo.redeemPoints']: redeemPoints,
['detailInfo.goodsStock']: target.stock, ['detailInfo.goodsStock']: goodsStock,
['detailInfo.specificationData']: target.specificationData ['detailInfo.specificationData']: specificationData
}) })
const thisPage = wx.p.router.getPageInstance() const thisPage = wx.p.router.getPageInstance()
thisPage.setData({ thisPage.setData({
activeSku: target.specificationData activeSku: specificationData,
goodsStock,
saleAmount
}) })
}, },
changeCount(e) { changeCount(e) {
...@@ -92,6 +125,7 @@ Component({ ...@@ -92,6 +125,7 @@ Component({
if (!['pay', 'join'].includes(clickType)) { if (!['pay', 'join'].includes(clickType)) {
return this.cancel() return this.cancel()
} }
if (!detailInfo.goodsStock) return wx.p.wxApi.showToast('暂无存货')
detailInfo.sellQty = goodsNumber || detailInfo.sellQty detailInfo.sellQty = goodsNumber || detailInfo.sellQty
detailInfo?.platformGlGoodsSpecifications?.forEach(val => { detailInfo?.platformGlGoodsSpecifications?.forEach(val => {
if (val.active) detailInfo.specificationData = val.specificationData if (val.active) detailInfo.specificationData = val.specificationData
...@@ -111,6 +145,7 @@ Component({ ...@@ -111,6 +145,7 @@ Component({
wx.hideLoading() wx.hideLoading()
wx.p.wxApi.showToast('加入购物车成功') wx.p.wxApi.showToast('加入购物车成功')
this.cancel() this.cancel()
this.triggerEvent('joinSuccess')
}) })
return return
} }
......
...@@ -80,9 +80,35 @@ ...@@ -80,9 +80,35 @@
} }
.sku-list { .sku-list {
display: flex; .sku-title {
flex-wrap: wrap; color: #2D2D2E;
font-weight: 500;
padding-top: var(--margin);
display: flex;
align-items: center;
justify-content: space-between;
}
.sku-item {
display: flex;
flex-wrap: wrap;
.item {
height: 52rpx;
line-height: 52rpx;
background: #F7F8FA;
padding: 0 20rpx;
margin: 20rpx 20rpx 0 0;
font-size: 24rpx;
color: #656566;
border: 2rpx solid #F7F8FA;
box-sizing: border-box;
border-radius: 12rpx;
&.active {
border-color: #FC5B32;
color: #FC5B32;
background-color: #fc5b320f;
}
}
}
.sku { .sku {
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
background: #F7F8FA; background: #F7F8FA;
...@@ -103,6 +129,10 @@ ...@@ -103,6 +129,10 @@
color: #000000!important; color: #000000!important;
} }
} }
.flex-w {
display: flex;
flex-wrap: wrap;
}
} }
.count-box { .count-box {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="price-box"> <view class="price-box">
<text class="price">{{detailInfo.redeemPoints}}</text><text>积分</text> <text class="price">{{detailInfo.redeemPoints}}</text><text>积分</text>
</view> </view>
<view wx:if="{{detailInfo.stock}}" class="stock">有货(库存{{detailInfo.stock}})</view> <view wx:if="{{detailInfo.goodsStock}}" class="stock">有货(库存{{detailInfo.goodsStock}})</view>
<view wx:else class="stock">暂无存货</view> <view wx:else class="stock">暂无存货</view>
<block> <block>
<view wx:if="{{detailInfo.goodsSource == 1}}" class="selct-box">已选:{{goodsNumber}}{{detailInfo.goodsUnit}}</view> <view wx:if="{{detailInfo.goodsSource == 1}}" class="selct-box">已选:{{goodsNumber}}{{detailInfo.goodsUnit}}</view>
...@@ -19,15 +19,24 @@ ...@@ -19,15 +19,24 @@
</view> </view>
</view> </view>
<view class="sku-box"> <view class="sku-box">
<block wx:if="{{detailInfo.goodsSource == 1}}">
<view class="title">规格</view> <view class="title">规格</view>
<view class="sku-list" wx:if="{{detailInfo.goodsSource == 1}}"> <view class="sku-list flex-w">
<block wx:for="{{detailInfo.specificationResponses}}" wx:key="index"> <block wx:for="{{detailInfo.specificationResponses}}" wx:key="index">
<view class="sku flex_cc sku_active">{{item.specName}}:{{item.specValue}}</view> <view class="sku flex_cc sku_active">{{item.specName}}:{{item.specValue}}</view>
</block> </block>
</view> </view>
</block>
<view class="sku-list" wx:else> <view class="sku-list" wx:else>
<block wx:for="{{detailInfo.platformGlGoodsSpecifications}}" wx:key="index"> <block wx:for="{{detailInfo.platformGlGoodsSpecificationList}}" wx:key="index">
<view class="sku flex_cc {{item.active ? 'sku_active' : ''}} {{i.stock ===0?'disabled':''}}" bindtap="choose" data-target="{{item}}">{{item.specificationData}}</view> <view class="sku-title">{{item.specificationName}}</view>
<view class="sku-item">
<block wx:for="{{item.platformSpecificationValueList}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="item text-center {{i.active?'active':''}} {{i.stock ===0?'disabled':''}}" bindtap="choose" data-index="{{index}}"
data-ind="{{ind}}">{{i.specificationValue}}</view>
</block>
</view>
<!-- <view class="sku flex_cc {{item.active ? 'sku_active' : ''}} {{i.stock ===0?'disabled':''}}" bindtap="choose" data-target="{{item}}">{{item.specificationData}}</view> -->
</block> </block>
</view> </view>
</view> </view>
...@@ -36,7 +45,7 @@ ...@@ -36,7 +45,7 @@
<view class="right flex_sc"> <view class="right flex_sc">
<!-- <view class="tip">至少购买{{goods.startQty}}{{goods.goodsUnit}}</view> --> <!-- <view class="tip">至少购买{{goods.startQty}}{{goods.goodsUnit}}</view> -->
<view class="stepper"> <view class="stepper">
<stepper count="{{goodsNumber}}" max="{{detailInfo.goodsStock}}" catchchange="changeCount"></stepper> <stepper count="{{goodsNumber}}" max="{{detailInfo.goodsStock || 1}}" catchchange="changeCount"></stepper>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -16,7 +16,6 @@ Component({ ...@@ -16,7 +16,6 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
IMGURL: wx.$imgUrl
}, },
/** /**
...@@ -37,13 +36,12 @@ Component({ ...@@ -37,13 +36,12 @@ Component({
// 进入商品详情 // 进入商品详情
handleSale(e) { handleSale(e) {
let { target } = e.currentTarget.dataset let { target } = e.currentTarget.dataset
// 自营商品与云中鹤商品数据不同
let url = target?.goodsSource == 1 ? '/packageIndex/pages/goodsDetail/index' : '/packageIndex/pages/selfGoodsDetail/index'
// wx.p.router.go(url, target)
wx.p.router.go('/packageIndex/pages/goodsDetail/index', target) wx.p.router.go('/packageIndex/pages/goodsDetail/index', target)
}, },
joinCart(e) { joinCart(e) {
this.handleSale(e) let { target } = e.currentTarget.dataset
// this.handleSale(e)
this.triggerEvent('join', target)
} }
}, },
lifetimes: { lifetimes: {
......
// components/selfSku/index.js
import { centsToyuan } from '~/utils/format'
import cartApi from '~/api/module/cart.js'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer(n) {
if (n)
this.setData({
close: false
})
}
},
showName: String,
skuData: {
type: Object,
observer(n) {
this.setDefaultSku(n)
}
},
clickType: String,
defaultAds: String,
defaultAddress: Object
},
/**
* 组件的初始数据
*/
data: {
goodsNumber: 1
},
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setDefaultSku(skuData) {
let { specificationList } = skuData
let [specificationDetailList] = skuData.specificationDetailList
let defaultGoods = specificationDetailList.specificationData.split('&')
specificationList.map(e => {
defaultGoods.map(i => {
let [key, value] = i.split('-')
if (key == e.specificationName) {
e.specificationValueList.map(c => {
if (c.specificationValue == value) c.active = true
})
}
})
})
specificationDetailList.retailPrice = centsToyuan(specificationDetailList.retailPrice)
this.setData({
skuObj: skuData,
goodsInfo: specificationDetailList
})
},
choose(e) {
let { ind, index } = e.currentTarget.dataset
let {
skuObj: { specificationList, id, specificationExtraList }
} = this.data
let activeList = []
if (specificationList[index].specificationValueList[ind].active) return
specificationList[index].specificationValueList.map(i => (i.active = false))
specificationList[index].specificationValueList[ind].active = true
specificationList.map(i => {
i.specificationValueList.map(c => {
if (c.active) activeList.push(`${i.specificationName}-${c.specificationValue}`)
})
})
let specificationData = activeList.join('&')
this.setData({
[`skuObj.specificationList[${index}]`]: specificationList[index]
})
shopmallApi
.getGoodsSpecificationExtra({
goodsId: id,
specificationData
})
.then(data => {
data.retailPrice = centsToyuan(data.retailPrice)
this.setData({
goodsInfo: data
})
console.log(this.data.goodsInfo)
})
this.setData({
goodsNumber: 1
})
const thisPage = wx.p.router.getPageInstance()
thisPage.setData({
activeSku: specificationData
})
},
changeCount(e) {
let goodsNumber = e.detail
this.setData({
goodsNumber
})
},
closeSku() {
let thisPage = wx.p.router.getPageInstance()
let { showName } = this.data
this.setData({
close: true
}, () => {
thisPage.setData({
[showName]: false
})
})
},
intRemain(e) {
this.setData({
remain: e.detail.value
})
},
toShowAddressModal() {
let thisPage = wx.p.router.getPageInstance()
thisPage.setData({
showAddress: true
})
},
toCreatedOrder() {
let { clickType, goodsInfo, goodsNumber } = this.data
let userInfo = wx.p.storage.get('userInfo')
if (!clickType) {
return this.cancel()
}
if (clickType == 'join') {
console.log('加入购物车成功')
const PARAMS = {
goodsId: goodsInfo.id,
sellQty: goodsNumber,
goodsSkuCode: goodsInfo.goodsSkuCode,
goodsSource: goodsInfo.goodsSource,
scoreSource: userInfo?.channelSource
}
cartApi.addToCart(PARAMS).then(res => {
this.cancel()
wx.$api.showToast('加入购物车成功')
})
return
}
const { remain, goods, defaultAddress,staffShop } = this.data
console.log(defaultAddress)
if(!defaultAddress.receiveName){
return wx.p.wxApi.showToast('请选择收货地址')
}
// 跳转到确认订单
let query = {
receiveName: defaultAddress.receiveName,
receiveMobile: defaultAddress.receiveMobile,
provinceId: defaultAddress.provinceId,
provinceName: defaultAddress.provinceName,
cityId: defaultAddress.cityId,
cityName: defaultAddress.cityName,
countyId: defaultAddress.countyId,
countyName: defaultAddress.countyName,
address: defaultAddress.address,
customerOpenId:staffShop?userStorage.weChatOpenId:userInfo.openId,
buyerMsg: remain,
orderGoodsList: [{
goodsSkuCode: goods.goodsSkuCode,
goodsSkuName: goods.goodsSkuName,
sellQty: goodsNumber,
}],
}
wx.p.router.go('/packageIndex/pages/confirmOrder/index', query)
},
cancel() {
this.setData({
show: false
})
this.triggerEvent('cancelSku')
},
},
lifetimes: {
attached() {
}
}
})
/* components/selfSku/index.wxss */
.sku {
position: fixed;
left: 0;
bottom: 0;
right: 0;
top: 0;
z-index: 9;
}
.sku-bg {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .5);
}
.sku-box {
position: absolute;
bottom: 0;
width: 100%;
height: 76%;
background: #FFFFFF;
border-radius: 16rpx 16rpx 0 0;
left: 0;
z-index: 2;
}
.sku-box.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.sku-content {
box-sizing: border-box;
height: calc(100% - 100rpx);
}
.sku-content .view {
padding: 0 40rpx;
}
.sku-content .goods-box {
display: flex;
align-items: center;
position: sticky;
background-color: #fff;
z-index: 2;
top: 0;
padding-bottom: 18rpx;
}
.sku-content .goods-box .preview {
width: 180rpx;
height: 180rpx;
border-radius: 4rpx;
margin-right: 40rpx;
overflow: hidden;
margin-top: 40rpx;
}
.sku-content .goods-box .goods-info {
width: calc(100% - 220rpx);
}
.sku-content .goods-box .price {
color: #FC5B32;
font-size: 64rpx;
margin-bottom: 10rpx;
font-weight: 600;
}
.sku-content .goods-box .price text {
font-size: 40rpx;
margin-left: 4rpx;
}
.sku-content .goods-box .count {
color: #858A94;
font-size: 20rpx;
margin-bottom: var(--borderRadius);
}
.sku-content .goods-box .active {
font-size: 20rpx;
color: #3F444D;
}
.sku-box .sku-list {
padding-bottom: 40rpx;
}
.sku-box .sku-title {
color: #0A0D14;
font-weight: 500;
padding-top: 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.sku-title .value {
color: #0A0D14;
font-weight: normal;
}
.sku-box .sku-item {
display: flex;
flex-wrap: wrap;
}
.sku-box .sku-item .item {
height: 52rpx;
background: #F7F8FA;
padding: 0 20rpx;
margin: 20rpx 20rpx 0 0;
font-size: 24rpx;
color: #3F444D;
box-sizing: border-box;
border-radius: 12rpx;
display: flex;
align-items: center;
}
.sku-box .sku-item .item.active {
border: 2rpx solid #FC5B32;
color: #FC5B32;
background-color: #fc5b320f;;
}
.sku-btn-box {
height: 100rpx;
padding: 10rpx var(--margin);
}
.sku-btn {
border-radius: var(--borderRadius);
display: flex;
overflow: hidden;
}
.sku-btn .join,
.sku-btn .pay {
flex: 1;
height: 80rpx;
color: #fff;
}
.sku-btn .join {
background-color: #FDC23E;
}
.sku-btn .pay {
background-color: var(--btnColor);
}
.disabled{
background-color: #B1B1B3 !important;
/* border-color: #B1B1B3 !important; */
color: #000000!important;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
.textarea-box {
margin-top: 48rpx;
.title {
font-weight: 400;
font-size: 28rpx;
color: #4C4D4F;
margin-bottom: 20rpx;
}
.pannel {
width: 100%;
box-sizing: border-box;
padding: 16rpx 20rpx;
height: 128rpx;
background: #F5F6FA;
border-radius: 16rpx;
.textarea-placeholder {
font-weight: 400;
font-size: 24rpx;
color: #9E9EA8;
}
.textArea {
height: 100%;
}
}
}
.adress-box {
margin-top: 52rpx;
.title {
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
}
.content {
font-weight: 400;
font-size: 24rpx;
color: #333435;
width: 490rpx;
text-align: right;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 8rpx;
}
.emptyText {
color: #858A94;
}
.pos {
width: 36rpx;
height: 36rpx;
}
}
.btn-wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
box-sizing: border-box;
padding: 8rpx 40rpx 68rpx;
background: white;
.btn {
width: 100%;
height: 80rpx;
background: #FB8A32;
border-radius: 20rpx;
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
}
.diable_btn{
background: #999999;
color: #FFFFFF;
border: none;
box-shadow: none;
}
}
\ No newline at end of file \ No newline at end of file
<!--components/selfSku/index.wxml-->
<view class="sku" catchtouchmove="noScroll" hidden="{{!show}}">
<view class="sku-bg" bindtap="closeSku"></view>
<view class="sku-box isFullSucreen">
<scroll-view class="sku-content" scroll-y>
<view class="view">
<view class="goods-box">
<view class="preview">
<image webp src="{{skuObj.goodsImage || skuObj.activityImg}}"></image>
</view>
<view class="goods-info">
<view class="price">
{{goodsInfo.retailPrice}}<text>积分</text>
</view>
<view class="count">
<block wx:if="{{goodsInfo.stock}}">
有货(库存{{goodsInfo.stock}})
</block>
<block wx:else>无货</block>
</view>
<view class="active text-hide">已选:{{goodsInfo.specificationData}}</view>
</view>
</view>
<view class="sku-list">
<block wx:for="{{skuObj.specificationList}}" wx:key="index">
<view class="sku-title">{{item.specificationName}}</view>
<view class="sku-item">
<block wx:for="{{item.specificationValueList}}" wx:key="ind" wx:for-index="ind" wx:for-item="i">
<view class="item text-center {{i.active?'active':''}} {{i.stock ===0?'disabled':''}}" bindtap="choose" data-index="{{index}}"
data-ind="{{ind}}">{{i.specificationValue}}</view>
</block>
</view>
</block>
<view class="sku-title">
数量
<stepper count="{{goodsNumber}}" max="{{goodsInfo.stock}}" bindchange="changeCount"></stepper>
</view>
<view class="sku-title">
发货
<view class="value">快递:{{skuObj.expressFee||'免运费(请以提交订单时为准)'}}</view>
</view>
</view>
<view class="textarea-box" wx:if="{{clickType != 'join'}}">
<view class="title">订单备注</view>
<view class="pannel">
<textarea bindinput="intRemain" maxlength="100" class="textArea" placeholder="请输入备注信息(选填)" placeholder-class="textarea-placeholder"></textarea>
</view>
</view>
<view bind:tap="toShowAddressModal" class="adress-box flex_scb" wx:if="{{clickType != 'join'}}">
<view class="title">收货地址</view>
<view class="right flex_scb">
<view class="content {{defaultAds?'':'emptyText'}}">{{defaultAds || '请选择'}}</view>
<mp-icon icon="arrow" bind:tap="showSkuModal" color="#B1B1B3" size="{{10}}"></mp-icon>
</view>
</view>
</view>
</scroll-view>
<view class="btn-wrap flex_cc">
<view bind:tap="toCreatedOrder" class="btn flex_cc">确认</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/SpecialSale/SpecialSale.js // packageIndex/pages/SpecialSale/SpecialSale.js
import cartApi from '~/api/module/cart.js'
import homeApi from '~/api/module/home.js'
Page({ Page({
/** /**
...@@ -6,15 +8,72 @@ Page({ ...@@ -6,15 +8,72 @@ Page({
*/ */
data: { data: {
pageParams: {}, pageParams: {},
goodsList: [] goodsList: [
{
"id" : 243,
"goodsSkuCode" : "2888888889106540",
"brandName" : "维仕蓝维仕蓝维仕蓝维仕蓝维仕蓝",
"goodsSkuName" : "志翔验收白名单 丹青额 ",
"goodsImgUrl" : "https://img.yunzhonghe.com/image/1650792972441AZtFGalcxH.jpg",
"goodsStock" : 185,
"redeemPoints" : 100,
"salePrice" : 0.00,
"sellPrice" : 100.00,
"marketPrice" : 100.00,
"firstCategoryName" : "数码dcg ",
"secondCategoryName" : "摄影摄像",
"lastCategoryName" : "单电微单相机",
"shelvesStatus" : 1001,
"saleDate" : 1755571007000,
"saleFlag" : 1,
"saleAmount" : 12,
"fronCategoryId" : null,
"fronCategoryName" : null,
"pageView" : null,
"visitorCount" : 0,
"goodsSource" : 1,
"minGoodsStock" : 0,
"minSalePrice" : 0,
"maxSalePrice" : 0,
"maxGoodsStock" : 0
}, {
"id" : 251,
"goodsSkuCode" : "SKUGLCODE959010599847862272",
"brandName" : null,
"goodsSkuName" : "测试商品1",
"goodsImgUrl" : "https://img.yunzhonghe.com/image/1650002967483MFjkVZlvEn.jpg",
"goodsStock" : null,
"redeemPoints" : 100,
"salePrice" : 0.00,
"sellPrice" : null,
"marketPrice" : null,
"firstCategoryName" : null,
"secondCategoryName" : null,
"lastCategoryName" : null,
"shelvesStatus" : 1001,
"saleDate" : 1755568022000,
"saleFlag" : 1,
"saleAmount" : 0,
"fronCategoryId" : null,
"fronCategoryName" : null,
"pageView" : null,
"visitorCount" : 0,
"goodsSource" : 2,
"minGoodsStock" : 4,
"minSalePrice" : 10,
"maxSalePrice" : 10,
"maxGoodsStock" : 7
}
]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo})
wx.p.router.getRouterParams(options).then(params => { wx.p.router.getRouterParams(options).then(params => {
console.log(params)
this.setData({ this.setData({
pageParams: params pageParams: params
}) })
...@@ -23,6 +82,48 @@ Page({ ...@@ -23,6 +82,48 @@ Page({
}) })
}, },
// 加入购物车
handleAddToCart(e) {
let value = e.detail
let { userInfo } = this.data
const PARAMS = {
goodsId: value.id,
sellQty: 1,
goodsSource: value.goodsSource,
scoreSource: userInfo?.channelSource,
merchantId: userInfo?.merchantId
}
if (value.goodsSource == 1) {
cartApi.addToCart(PARAMS).then(res => {
wx.p.wxApi.showToast('加入购物车成功')
})
} else {
// 获取商品详情
this.getDetail(value)
}
},
getDetail(options) {
homeApi.getGoodsDetailInfo({id: options.id, businessType: 1}).then(res => {
res.goodsSource = options.goodsSource
if (res && res.specificationResponses?.length) {
this.toGetSpecString(res, res.startQty)
}
if (res && res.platformGlGoodsSpecifications?.length) {
let item = res.platformGlGoodsSpecifications[0] || {}
res.redeemPoints = item.retailPrice
res.goodsStock = item.stock
res.specificationData = item.specificationData
this.setData({
activeSku: item.specificationData
})
}
this.setData({
detailInfo: res || {},
showSku: true
})
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
{ {
"usingComponents": { "usingComponents": {
"goods": "/components/goods/goods" "goods": "/components/goods/goods",
"sku": "/components/Sku/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
<view class="goods-content"> <view class="goods-content">
<view class="goods-content-top"></view> <view class="goods-content-top"></view>
<view class="goods-box"> <view class="goods-box">
<goods list="{{goodsList}}"></goods> <goods list="{{goodsList}}" bindjoin="handleAddToCart"></goods>
</view> </view>
</view> </view>
</view> </view>
<sku bind:cancelSku="closeSku" bind:getCount="getCount" show="{{showSku}}" goods="{{detailInfo}}" clickType="join"></sku>
</block> </block>
\ No newline at end of file \ No newline at end of file
import homeApi from '~/api/module/home.js' import homeApi from '~/api/module/home.js'
import commonApi from '~/api/module/common.js'
import NP from 'number-precision' import NP from 'number-precision'
let timer
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -25,20 +25,21 @@ Page({ ...@@ -25,20 +25,21 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then(params => { wx.p.router.getRouterParams(options).then(params => {
let userInfo = wx.p.storage.get('userInfo')
this.setData({ this.setData({
goodsInfo: params goodsInfo: params,
userInfo
}) })
console.log(params)
this.getMoney(params) this.getMoney(params)
this.getAddressList() this.getAddressList()
this.getPointsData()
}).catch(err => { }).catch(err => {
console.error('参数获取失败:', err) console.error('参数获取失败:', err)
}) })
}, },
dialogConfirm(e) { dialogConfirm(e) {
let { value } = e.detail let { value } = e.detail
let userInfo = wx.p.storage.get('userInfo') let { goodsInfo, contactInfo, userInfo, money } = this.data
let { goodsInfo, contactInfo } = this.data
this.setData({ this.setData({
showModal: false showModal: false
}) })
...@@ -58,7 +59,7 @@ Page({ ...@@ -58,7 +59,7 @@ Page({
buyerMsg: goodsInfo?.buyerMsg, buyerMsg: goodsInfo?.buyerMsg,
addressId: contactInfo?.id, addressId: contactInfo?.id,
orderGoodsList, orderGoodsList,
redeemPoints: goodsInfo?.redeemPoints, redeemPoints: money,
scoreSource: userInfo?.channelSource, scoreSource: userInfo?.channelSource,
merchantId: userInfo?.merchantId, merchantId: userInfo?.merchantId,
merchantName: userInfo?.merchantName merchantName: userInfo?.merchantName
...@@ -82,28 +83,53 @@ Page({ ...@@ -82,28 +83,53 @@ Page({
this.getMoney(this.data.goodsInfo) this.getMoney(this.data.goodsInfo)
}) })
}, },
// 获取积分数量
getPointsData() {
let { userInfo } = this.data
// 获取当前积分数量
commonApi.getPointsSummary({staffPhone: userInfo?.phone, channelSource: userInfo?.channelSource, merchantId: userInfo?.merchantId}).then(r => {
if (r?.code == 0) {
this.setData({
walletObj: {currentScore: r?.data?.currentScore || 0}
})
} else {
wx.p.wxApi.showToast(r.message)
}
})
},
// 计算商品总价或者积分 // 计算商品总价或者积分
getMoney(goodsInfo) { getMoney(goodsInfo) {
const goodsList = goodsInfo.goodsList const goodsList = goodsInfo.goodsList
if (!goodsList || !goodsList.length) return if (!goodsList || !goodsList.length) return
let money = 0, let money = 0,
goodsNum = 0 goodsNum = 0,
expressFee = 0,
expressFeeArray = []
goodsList.forEach(el => { goodsList.forEach(el => {
money = NP.plus(money, NP.times(el.redeemPoints || 0, el.sellQty || 0)) //总价 money = NP.plus(money, NP.times(el.redeemPoints || 0, el.sellQty || 0)) //总价
goodsNum = NP.plus(goodsNum, el.sellQty) goodsNum = NP.plus(goodsNum, el.sellQty)
el.goodsImage = el.goodsImageUrl || el.imageResponses[0]?.imgUrl // 购物车结算和订单详情下单图片数据有区别 el.goodsImage = el.goodsImageUrl || el.imageResponses[0]?.imgUrl // 购物车结算和订单详情下单图片数据有区别
expressFeeArray.push(el.expressFee || 0)
})
//取运费最大值
expressFeeArray.sort((a, b) => {
return b - a
}) })
expressFee = expressFeeArray[0]
this.setData({ this.setData({
money, money,
goodsNum, goodsNum,
goodsInfo goodsInfo,
expressFee,
total: NP.plus(money, expressFee || 0)
}) })
}, },
checkOut() { checkOut() {
let { money, walletObj } = this.data
if (money > walletObj?.currentScore) return // 积分不足
this.setData({ this.setData({
showModal: true showModal: true
}) })
// if (true) return // 积分不足
}, },
goodsActionReady(e) { goodsActionReady(e) {
this.setData({ this.setData({
......
...@@ -33,14 +33,16 @@ ...@@ -33,14 +33,16 @@
<view class="content"> <view class="content">
<view class="goods-info"> <view class="goods-info">
<view class="preview"> <view class="preview">
<image webp src="{{item.goodsImage}}"></image> <image webp src="{{item.goodsImageUrl}}"></image>
</view> </view>
<view class="text"> <view class="text">
<view class="name"> <view class="name">
<view class="text-hide"> <view class="text-hide">
{{item.goodsSkuName}} {{item.goodsSkuName}}
</view> </view>
<view class="text-hide description">{{item.specificationData || ''}}</view> <view class="specificationData-text">
<view class="text-hide description">{{item.specificationData || ''}}</view>
</view>
</view> </view>
<view class="price-box"> <view class="price-box">
<view class="price"> <view class="price">
...@@ -66,12 +68,12 @@ ...@@ -66,12 +68,12 @@
</view> </view>
<view class="all-item"> <view class="all-item">
<text>合计</text> <text>合计</text>
<view class="price">{{money || 0}}<text>积分</text></view> <view class="price">{{total || 0}}<text>积分</text></view>
</view> </view>
</view> </view>
<view class="tips"> <view class="tips">
<text>当前积分</text> <text>当前积分</text>
{{1500}} {{walletObj.currentScore}}
</view> </view>
</view> </view>
</view> </view>
...@@ -84,18 +86,18 @@ ...@@ -84,18 +86,18 @@
</view> </view>
<view class="total"> <view class="total">
<view class="price"> <view class="price">
{{money|| 0}} {{total|| 0}}
<text>积分</text> <text>积分</text>
</view> </view>
</view> </view>
</view> </view>
<view class="btn text-center {{money > 1500 ? 'disabled' : ''}}" bindtap="checkOut">立即兑换</view> <view class="btn text-center {{money > walletObj.currentScore ? 'disabled' : ''}}" bindtap="checkOut">立即兑换</view>
</view> </view>
</goods-action> </goods-action>
</block> </block>
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" title="积分兑换"> <Dialog show="{{ showModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" title="积分兑换">
<view class="suggest-box"> <view class="suggest-box">
<view>您当前总积分为<text>{{400}}</text>积分</view> <view>您当前总积分为<text>{{walletObj.currentScore}}</text>积分</view>
<view>确认使用<text>{{400}}</text>积分兑换该商品</view> <view>确认使用<text>{{total}}</text>积分兑换该商品</view>
</view> </view>
</Dialog> </Dialog>
\ No newline at end of file \ No newline at end of file
...@@ -70,6 +70,12 @@ ...@@ -70,6 +70,12 @@
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
} }
.box .item {
margin-bottom: 20rpx;
}
.box .item:last-child {
margin-bottom: 0;
}
.box .item .content .goods-info { .box .item .content .goods-info {
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -148,10 +154,20 @@ ...@@ -148,10 +154,20 @@
margin-left: 4rpx; margin-left: 4rpx;
} }
.text .specificationData-text {
display: flex;
}
.text .description { .text .description {
font-size: 24rpx; font-size: 24rpx;
margin-top: 4rpx; margin-top: 4rpx;
color: #B1B1B3; color: #6E6E7A;
}
.text .specificationData-text .select {
margin-left: 8rpx;
transform: rotate(-90deg);
} }
.tips { .tips {
......
{
"component": true,
"usingComponents": {
"stepper": "/components/Stepper/Stepper"
}
}
\ No newline at end of file \ No newline at end of file
...@@ -3,6 +3,7 @@ let navBarHeight = 38 ...@@ -3,6 +3,7 @@ let navBarHeight = 38
import homeApi from '~/api/module/home.js' import homeApi from '~/api/module/home.js'
import cartApi from '~/api/module/cart.js' import cartApi from '~/api/module/cart.js'
import mineApi from '~/api/module/mine.js' import mineApi from '~/api/module/mine.js'
import commonApi from '~/api/module/common.js'
Page({ Page({
data: { data: {
navStyle, navStyle,
...@@ -19,6 +20,7 @@ Page({ ...@@ -19,6 +20,7 @@ Page({
skuInfo: '', skuInfo: '',
payWayActions: [{ name: '金额支付', type: 1, disabled: false }, { name: '积分兑换', type: 2, disabled: false }], payWayActions: [{ name: '金额支付', type: 1, disabled: false }, { name: '积分兑换', type: 2, disabled: false }],
detailInfo: {}, detailInfo: {},
eventFlag: false,
addressList: [{ addressList: [{
"userId" : 91713345, "userId" : 91713345,
"cityId" : null, "cityId" : null,
...@@ -81,13 +83,30 @@ Page({ ...@@ -81,13 +83,30 @@ Page({
this.showSkuModal(e.detail) this.showSkuModal(e.detail)
}, },
onLoad(options) { onLoad(options) {
let userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo})
wx.p.router.getRouterParams(options).then(params => { wx.p.router.getRouterParams(options).then(params => {
this.setData({pageParams: params})
this.getDetail(params) this.getDetail(params)
this.heartbeatFn({type: 'add'})
}).catch(err => { }).catch(err => {
console.error('参数获取失败:', err) console.error('参数获取失败:', err)
}) })
this.getPlatFormAddress() this.getPlatFormAddress()
}, },
heartbeatFn(e) {
let eventApi = e.type == 'add' ? 'dynamicRecordAdd' : 'dynamicRecordLeave'
let { pageParams, userInfo } = this.data
let params = {
goodsId: pageParams.id,
goodsType: 1,
customerMobile: userInfo?.phone,
customerName: userInfo?.nickName,
merchantId: userInfo?.merchantId,
merchantName: userInfo?.merchantName,
}
commonApi[eventApi](params)
},
showSkuModal(type) { showSkuModal(type) {
this.setData({ this.setData({
showSku: true, showSku: true,
...@@ -189,13 +208,15 @@ Page({ ...@@ -189,13 +208,15 @@ Page({
let item = res.platformGlGoodsSpecifications[0] || {} let item = res.platformGlGoodsSpecifications[0] || {}
res.redeemPoints = item.retailPrice res.redeemPoints = item.retailPrice
res.goodsStock = item.stock res.goodsStock = item.stock
res.saleAmount = item.saleAmount
res.specificationData = item.specificationData res.specificationData = item.specificationData
this.setData({
activeSku: item.specificationData
})
} }
this.setData({ this.setData({
detailInfo: res || {} detailInfo: res || {},
eventFlag: true,
activeSku: res.specificationData,
goodsStock: res.goodsStock,
saleAmount: res.saleAmount
}) })
}) })
}, },
...@@ -216,35 +237,31 @@ Page({ ...@@ -216,35 +237,31 @@ Page({
}, },
// 添加购物车 // 添加购物车
toAddShopCar() { toAddShopCar() {
const { detailInfo } = this.data const { detailInfo, userInfo } = this.data
let userInfo = wx.p.storage.get('userInfo')
const PARAMS = { const PARAMS = {
goodsId: detailInfo.id, goodsId: detailInfo.id,
sellQty: this.count || detailInfo.startQty, sellQty: this.count || detailInfo.startQty,
goodsSource: detailInfo.goodsSource || 1, goodsSource: detailInfo.goodsSource,
scoreSource: userInfo?.channelSource, scoreSource: userInfo?.channelSource,
specificationData: detailInfo?.specificationData, specificationData: detailInfo?.specificationData,
merchantId: userInfo?.merchantId merchantId: userInfo?.merchantId
} }
cartApi.addToCart(PARAMS).then(res => { cartApi.addToCart(PARAMS).then(res => {
wx.p.wxApi.showToast('加入购物车成功') wx.p.wxApi.showToast('加入购物车成功')
this.joinSuccess()
}) })
}, },
joinSuccess() {
// 获取最新购物车数据更新显示的数量
const goodsAction = this.selectComponent('#goods-action')
if (goodsAction) {
goodsAction.getCartNum()
}
},
// 同步选择的地址 // 同步选择的地址
resetAddress(e) { resetAddress(e) {
this.setData(e.detail) this.setData(e.detail)
}, },
getViewInfo() {
wx.$api.getViewInfo(
'.fixed_btn_wrap',
res => {
this.setData({
padding_bottom: res.height
})
},
this
)
},
closeSku() { closeSku() {
this.setData({ this.setData({
showSku: false showSku: false
...@@ -256,35 +273,9 @@ Page({ ...@@ -256,35 +273,9 @@ Page({
}) })
}, },
onUnload: function () { onUnload: function () {
const { this.heartbeatFn({type: 'level'})
isCarOwner
} = this.data
if (!isCarOwner) return
if (this.timer) clearInterval(this.timer)
this.trackQuery.view = 5
}, },
onShareAppMessage: function () { onShareAppMessage: function () {
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
const userInfo = wx.p.util.getUserInfo()
let {
detailInfo,
isCarOwner
} = this.data, open_id = ''
if (!isCarOwner) return
this.trackQuery.view = 4
if (userInfo) open_id = userInfo.openId
let title = detailInfo.goodsSkuName
let path = `${this.route}?id=${detailInfo.id}&openId=${open_id}`
let imageUrl = ''
detailInfo.imageResponses.map(e => {
imageUrl = e.imgUrl
})
if (merchantId) path = `${path}&merchantId=${merchantId}&isCarOwner=${isCarOwner || false}`
return {
imageUrl,
title,
path
}
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents":{ "usingComponents":{
"mp-html":"/components/mp-html/index", "mp-html":"/components/mp-html/index",
"sku": "./components/Sku/index", "sku": "/components/Sku/index",
"address":"/components/Adress/index" "address":"/components/Adress/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -136,7 +136,7 @@ page { ...@@ -136,7 +136,7 @@ page {
height: 44rpx; height: 44rpx;
font-size: 24rpx; font-size: 24rpx;
color: #2D2D2E; color: #2D2D2E;
.address-text { .text {
width: 520rpx; width: 520rpx;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
...@@ -152,14 +152,61 @@ page { ...@@ -152,14 +152,61 @@ page {
} }
} }
.goods-detail-box { .goods-detail-box {
background: #FFFFFF;
.title { .title {
margin-left: 40rpx; padding: 32rpx 40rpx;
font-size: 32rpx; font-size: 32rpx;
color: #282829; color: #282829;
font-weight: 500; font-weight: 500;
} }
} }
} }
.inner {
.title {
padding: 32rpx 40rpx;
font-weight: 500;
font-size: 32rpx;
color: #282829;
}
.table-wrap {
box-sizing: border-box;
padding: 0 24rpx;
.cell {
.label-box {
width: 216rpx;
height: 64rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
font-weight: 400;
font-size: 24rpx;
color: #B1B1B3;
box-sizing: border-box;
padding-left: 32rpx;
}
.content-box {
width: 488rpx;
height: 64rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
font-weight: 400;
font-size: 24rpx;
color: #656566;
box-sizing: border-box;
padding-left: 32rpx;
}
.title-box {
width: 100%;
height: 64rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
font-weight: 400;
font-size: 24rpx;
color: #2D2D2E;
padding-left: 32rpx;
}
}
}
}
} }
.tab-widget { .tab-widget {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</view> </view>
</navigation-bar> </navigation-bar>
</view> </view>
<view class="tab-widget flex_sc" wx:if="{{!showSku}}" style="top:{{padding_bottom}}px;opacity:{{opacity}};z-index:{{opacity>0.9?99:1}}"> <view class="tab-widget flex_sc" wx:if="{{!showSku && detailInfo.goodsSource == 1}}" style="top:{{padding_bottom}}px;opacity:{{opacity}};z-index:{{opacity>0.9?99:1}}">
<block wx:for="{{tabs}}" wx:key="index"> <block wx:for="{{tabs}}" wx:key="index">
<view bind:tap="changeTab" data-index="{{index}}" class="tab-box flex_cc"> <view bind:tap="changeTab" data-index="{{index}}" class="tab-box flex_cc">
<text>{{item}}</text> <text>{{item}}</text>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<view class="market-price">¥{{detailInfo.marketPrice}}</view> <view class="market-price">¥{{detailInfo.marketPrice}}</view>
</view> </view>
<view class="count"> <view class="count">
<text>剩余 {{detailInfo.remaining}}</text> | <text>销售 {{detailInfo.saleNum}}</text> <text>剩余 {{goodsStock}}</text> | <text>销售 {{saleAmount}}</text>
</view> </view>
</view> </view>
<view class="goods-title"><text wx:if="{{detailInfo.goodsSource == 1}}">{{detailInfo.brandName}}</text>{{detailInfo.goodsSkuName}}</view> <view class="goods-title"><text wx:if="{{detailInfo.goodsSource == 1}}">{{detailInfo.brandName}}</text>{{detailInfo.goodsSkuName}}</view>
...@@ -65,38 +65,53 @@ ...@@ -65,38 +65,53 @@
<view class="flex"> <view class="flex">
<view class="title">配送</view> <view class="title">配送</view>
<view data-is-choose-address class="content flex_ccc"> <view data-is-choose-address class="content flex_ccc">
<view class="address-text">{{contactAddress || '--'}}</view> <view class="text">{{contactAddress || '--'}}</view>
</view> </view>
</view> </view>
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon> <mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon>
</view> </view>
<view class="cell"> <block>
<view class="title">服务</view> <view class="cell" wx:if="{{detailInfo.goodsSource == 1}}">
<view class="title">服务</view>
<view class="content flex_ccc">
<view class="text">{{service[detailInfo.returnGoodsRules]}},包邮,正品保障</view>
</view>
</view>
<view class="cell" wx:else>
<view class="title">运费</view>
<view class="content flex_ccc">
<block wx:if="{{detailInfo.expressFee}}">{{detailInfo.expressFee}}</block>
<block wx:else>免运费(请以提交订单时为准)</block>
</view>
</view>
</block>
<view wx:if="{{detailInfo.goodsSource == 2 && detailInfo.serviceDesc}}">
<view class="title">服务说明</view>
<view class="content flex_ccc"> <view class="content flex_ccc">
<view>{{service[detailInfo.returnGoodsRules]}},包邮,正品保障</view> <text>{{goodsInfo.serviceDesc}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="goods-detail-box"> <view class="goods-detail-box" wx:if="{{detailInfo.goodsDescribe || goodsInfo.goodsDescList.length}}">
<view class="title">商品详情</view> <view class="title">商品详情</view>
<view class="image-list-wrap" wx:if="{{detailInfo.goodsSource == 1}}"> <view class="image-list-wrap" wx:if="{{detailInfo.goodsSource == 1}}">
<mp-html content="{{detailInfo.goodsDescribe}}"></mp-html> <mp-html content="{{detailInfo.goodsDescribe}}"></mp-html>
</view> </view>
<view wx:else> <view wx:else>
<block wx:for="{{goodsInfo.goodsDescList}}" wx:key="index"> <block wx:for="{{goodsInfo.goodsDescList}}" wx:key="index">
<view class="content"> <view class="content">
<block wx:if="{{item.resType == 1}}"> <block wx:if="{{item.resType == 1}}">
<image webp src="{{item.content}}" mode="widthFix" bindtap="previewImage" data-current="{{item.content}}" data-item="{{goodsInfo.goodsDescList}}" lazy-load></image> <image webp src="{{item.content}}" mode="widthFix" bindtap="previewImage" data-current="{{item.content}}" data-item="{{goodsInfo.goodsDescList}}" lazy-load></image>
</block> </block>
<block wx:elif="{{item.resType == 2}}"> <block wx:elif="{{item.resType == 2}}">
{{item.content}} {{item.content}}
</block> </block>
<block wx:else> <block wx:else>
<video src="{{item.content}}" style="height:{{item.height}}px;width:100%"></video> <video src="{{item.content}}" style="height:{{item.height}}px;width:100%"></video>
</block> </block>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -123,8 +138,8 @@ ...@@ -123,8 +138,8 @@
</view> </view>
</view> </view>
</view> </view>
<block wx:if="{{navHeight}}"> <block wx:if="{{navHeight && eventFlag}}">
<goods-action platformShop="{{true}}" bindready="goodsActionReady" pay-disabled="{{false}}" upgradeSet="{{!detailInfo.retailPrice&&detailInfo.exchangeIntegral}}" stock="{{detailInfo.goodsStock===0}}" buyFlag="{{false}}" bindclick="goodsActionClick" hideShop="{{false}}"></goods-action> <goods-action platformShop="{{true}}" id="goods-action" bindready="goodsActionReady" pay-disabled="{{false}}" upgradeSet="{{!detailInfo.retailPrice&&detailInfo.exchangeIntegral}}" stock="{{detailInfo.goodsStock===0}}" buyFlag="{{false}}" bindclick="goodsActionClick" hideShop="{{false}}"></goods-action>
</block> </block>
<sku bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" clickType="{{clickType}}" address="{{addressList}}" defaultAddress="{{defaultAddress}}"></sku> <sku bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" bind:joinSuccess="joinSuccess" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" clickType="{{clickType}}" address="{{addressList}}" defaultAddress="{{defaultAddress}}"></sku>
<address address="{{addressList}}" defaultAddress="{{defaultAddress}}" bind:getAddress="getAddress" show="{{showAddress}}"></address> <address address="{{addressList}}" defaultAddress="{{defaultAddress}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/selfGoodsDetail/index.js
import homeApi from '~/api/module/home.js'
import mineApi from '~/api/module/mine.js'
const navStyle = 'background-color: transparent;'
let navBarHeight = 38
Page({
/**
* 页面的初始数据
*/
data: {
navStyle,
goodsFlag: true,
goodsInfo: {},
addressList: [{
"userId" : 91713345,
"cityId" : null,
"areaId" : 440305,
"createTime" : 1755922362000,
"provinceId" : null,
"city" : "深圳市",
"area" : "南山区",
"postCode" : "518000",
"receiveName" : "qw",
"province" : "广东省",
"address" : "广东省深圳市南山区南山街道学府路30号",
"updateTime" : null,
"isDefault" : 1,
"phoneNumber" : "18555558878",
"id" : 139
}],
defaultAddress: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.p.router.getRouterParams(options).then(params => {
this.getDetail(params)
}).catch(err => {
console.error('参数获取失败:', err)
})
// this.getPlatFormAddress()
},
navbarReady(e) {
navBarHeight = e.detail.height
},
goodsActionReady(e) {
this.setData({
padding_bottom: e.detail
})
},
onPageScroll(e) {
const { curTabIndex } = this.data
if (curTabIndex == 0) {
this.scrollY = e.scrollTop
}
this.setData({
navStyle: e.scrollTop >= navBarHeight || curTabIndex ? '' : navStyle,
opacity: curTabIndex == 1 ? 1 : e.scrollTop / 200,
})
},
// 点击添加购物车或立即兑换
goodsActionClick(e) {
let type = e.detail
this.showSkuFun()
this.setData({
clickType: type
})
},
// 显示sku弹窗
showSkuFun() {
this.setData({
showSku: true
})
wx.setPageStyle({
style: {
overflow: 'hidden'
}
})
},
// 显示地址选择弹窗
toShowAddressModal() {
this.setData({
showAddress: true
})
},
// 地址选择确定
getAddress(e) {
this.setData({
contactAddress: e.detail.contactAddress,
defaultAddress: e.detail.defaultAddress
})
},
changeBanner(e) {
this.setData({
bannerIndex: e.detail.current
})
},
previewImage(e) {
let {
current,
item
} = e.currentTarget.dataset
let urls = []
item.map(i => {
urls.push(i.content)
})
wx.p.wxApi.previewImage({
current,
urls
})
},
back() {
wx.p.router.back()
},
getDetail(options) {
homeApi.getGoodsDetailInfo({id: options.id}).then(res => {
console.log(res)
if (res && res.platformGlGoodsSpecifications?.length) {
this.setData({
activeSku: res.platformGlGoodsSpecifications[0].specificationData,
['goodsInfo.redeemPoints']: res.platformGlGoodsSpecifications[0].retailPrice
})
}
})
},
// 获取地址
getPlatFormAddress(staff) {
wx.p.wxApi.showLoading()
mineApi.platformAddressList({}).then(data => {
console.log(data)
wx.hideLoading()
let contactAddress = '', defaultAddress = {}
let _isSetDefault = false
if (data && data.length) {
data.forEach(el => {
if (el.isDefault == 1) {
contactAddress = el.provinceName + el.cityName + el.countyName + el.address,
defaultAddress = el
_isSetDefault = true
}
})
if (!_isSetDefault) {
let _first = data[0]
contactAddress = _first.provinceName + _first.cityName + _first.countyName + _first.address,
defaultAddress = _first
}
}
this.setData({
addressList: data,
contactAddress,
defaultAddress
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents": {
"selfSku": "/components/selfSku/index",
"address": "/components/Adress/index"
}
}
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/selfGoodsDetail/index.wxss */
page {
background: #F7F8FA;
}
.flex {
display: flex;
align-items: center;
position: relative;
}
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
.navigation {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.back {
position: absolute;
left: 20rpx;
width: 64rpx;
height: 64rpx;
background: #ffffff80;
border: 1rpx solid #E5E5E5;
border-radius: 32rpx;
}
.page-title {
font-size: 34rpx;
font-weight: 600;
color: #282829;
}
}
}
.layout {
.banner-box {
height: 750rpx;
position: relative;
.banner {
height: 100%;
}
.dot-box {
position: absolute;
bottom: 24rpx;
border-radius: 2rpx;
overflow: hidden;
display: flex;
}
.banner video {
width: 100%;
height: 100%;
}
.dot {
width: 20rpx;
height: var(--borderRadius);
background: rgba(255, 255, 255, 0.3);
transition: all .5s;
}
.dot.active {
background-color: #fff;
}
}
.goods-container {
background: #F7F8FA;
padding: 16rpx 0;
.container-item {
margin: 0 16rpx;
padding: 28rpx 24rpx;
background: #FFFFFF;
border-radius: 24rpx;
margin-bottom: 16rpx;
}
.goods-box {
.price{
display: flex;
justify-content: space-between;
}
.price-box {
display: flex;
.sale-price {
font-size: 54rpx;
color: #FC5B32;
font-weight: 700;
text {
font-size: 28rpx;
font-weight: 500;
}
}
.market-price {
text-decoration: line-through;
font-size: 24rpx;
color: #B1B1B3;
margin: 36rpx 0 0 12rpx;
}
}
.count {
color: #B1B1B3;
font-size: 24rpx;
}
.goods-title {
margin-top: 20rpx;
color: #282829;
font-size: 34rpx;
font-weight: 500;
font-family: PingFangSC-Medium;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
.select-params-box {
.cell {
height: 88rpx;
display: flex;
align-items: center;
.flex {
width: 100%;
}
.title {
width: 80rpx;
font-size: 24rpx;
color: #707071;
}
.content {
width: 520rpx;
height: 44rpx;
font-size: 24rpx;
color: #2D2D2E;
.address-text {
width: 520rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
}
.flex_ccc {
display: flex;
justify-content: center;
flex-direction: column;
}
}
}
.goods-detail-box {
.title {
font-size: 32rpx;
color: #282829;
font-weight: 500;
}
}
}
}
.tab-widget {
position: fixed;
left: 0;
right: 0;
top: 0;
background: white;
height: 88rpx;
z-index: 99;
opacity: 0;
.tab-box {
position: relative;
width: 50%;
height: 88rpx;
font-weight: 400;
font-size: 28rpx;
color: #656566;
.line {
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 66rpx;
height: 6rpx;
background: #FC5B32;
border-radius: 2rpx;
}
}
}
.fixed_btn_wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 100rpx;
background: #FFFFFF;
box-sizing: border-box;
padding:4rpx 48rpx;
.dh_btn {
background: #FC5B32;
border: 1.6rpx solid #FC5B32;
box-shadow: 0 4rpx 12rpx 4rpx #f13c3d1a;
border-radius: 20rpx;
height: 80rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
.grey_btn{
background: #999999;
border: none;
box-shadow: none;
}
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
\ No newline at end of file \ No newline at end of file
<view class="navigation-bar">
<navigation-bar custom navStyle="{{navStyle}}" bindnavbarReady="navbarReady" page-title="商品详情">
<view class="navigation">
<view class="back text-center" bindtap="back">
<mp-icon icon="back" color="#323233" size="{{12}}"></mp-icon>
</view>
<view class="page-title">商品详情</view>
</view>
</navigation-bar>
</view>
<block wx:if="{{goodsFlag}}">
<view class="{{posterUrl==''?'layout':'layout hidden'}} " style="padding-bottom:{{padding_bottom + 20}}px;">
<view class="banner-box">
<swiper class="banner" bindchange="changeBanner">
<block wx:for="{{goodsInfo.goodsDetailImageList}}" wx:key="index">
<swiper-item>
<image mode="aspectFill" webp src="{{item.content}}" bindtap="previewImage" data-current="{{item.content}}" data-item="{{goodsInfo.goodsDetailImageList}}"></image>
</swiper-item>
</block>
</swiper>
<block wx:if="{{goodsInfo.goodsDetailImageList.length > 1}}">
<view class="dot-box x-center">
<block wx:for="{{goodsInfo.goodsDetailImageList}}" wx:key="index">
<view class="dot {{bannerIndex == index ? 'active':''}}">
</view>
</block>
</view>
</block>
</view>
<view class="goods-container">
<view class="container-item goods-box">
<view class="price">
<view class="price-box">
<view class="sale-price">
{{goodsInfo.skuPrice}}
<text>积分</text>
</view>
<view class="market-price">¥{{detailInfo.marketPrice}}</view>
</view>
<view class="count">
<text>剩余 {{detailInfo.remaining}}</text> | <text>销售 {{detailInfo.saleNum}}</text>
</view>
</view>
<view class="goods-title">{{detailInfo.brandName}}{{detailInfo.goodsSkuName}}</view>
</view>
<view class="container-item select-params-box">
<view class="cell" bind:tap="showSkuFun" wx:if="{{activeSku}}" data-type="choose">
<view class="flex">
<view class="title">已选</view>
<view class="content flex_ccc">
<view>{{activeSku}}</view>
</view>
</view>
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon>
</view>
<view class="cell" bind:tap="toShowAddressModal">
<view class="flex">
<view class="title">配送</view>
<view data-is-choose-address class="content flex_ccc">
<view class="address-text">{{contactAddress || '--'}}</view>
</view>
</view>
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon>
</view>
<view class="cell">
<view class="title">运费</view>
<view class="content flex_ccc">
<block wx:if="{{goodsInfo.expressFee}}">{{goodsInfo.expressFee}}元</block>
<block wx:else>免运费(请以提交订单时为准)</block>
</view>
</view>
<view class="cell" wx:if="{{goodsInfo.serviceDesc}}">
<view class="title">服务说明</view>
<view class="content flex_ccc">
<text>{{goodsInfo.serviceDesc}}</text>
</view>
</view>
</view>
<view class="goods-detail-box" wx:if="{{goodsInfo.goodsDescList.length}}">
<view class="title">商品详情</view>
<block wx:for="{{goodsInfo.goodsDescList}}" wx:key="index">
<view class="content">
<block wx:if="{{item.resType == 1}}">
<image webp src="{{item.content}}" mode="widthFix" bindtap="previewImage" data-current="{{item.content}}" data-item="{{goodsInfo.goodsDescList}}" lazy-load></image>
</block>
<block wx:elif="{{item.resType == 2}}">
{{item.content}}
</block>
<block wx:else>
<video src="{{item.content}}" style="height:{{item.height}}px;width:100%"></video>
</block>
</view>
</block>
</view>
</view>
</view>
</block>
<block wx:if="{{navHeight && goodsFlag}}">
<goods-action payText="{{isShowPointStyle?'立即兑换':'立即购买'}}" bindready="goodsActionReady" pay-disabled="{{goodsInfo.activityStatus != 2 }}" stock="{{goodsInfo.goodsStock === 0}}" buyFlag="{{goodsInfo.buyFlag == 2}}" bindclick="goodsActionClick" upgradeSet="{{upgrade==true||goodsInfo.discoverGoodsSource==3||isShowPointStyle}}"></goods-action>
<block wx:if="{{activeSku}}">
<selfSku show="{{showSku}}" showName="showSku" defaultAds="{{contactAddress}}" defaultAddress="{{defaultAddress}}" clickType="{{clickType}}" skuData="{{goodsInfo}}" bindpay="pay" bindjoin="join"></selfSku>
</block>
<address staff="{{staffShop}}" address="{{addressList}}" idIndex="{{defaultAddress.id}}" defaultAddress="{{defaultAddress}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
</block>
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -152,6 +152,7 @@ Page({ ...@@ -152,6 +152,7 @@ Page({
captcha, captcha,
sessionId: this.sessionId sessionId: this.sessionId
}) })
data.headImgUrl = data.logo
if (code == '0') this.customerLoginCallBack(data) if (code == '0') this.customerLoginCallBack(data)
else throw message else throw message
wx.hideLoading() wx.hideLoading()
......
...@@ -21,7 +21,6 @@ Component({ ...@@ -21,7 +21,6 @@ Component({
data: { data: {
count: 0, count: 0,
to: '', to: '',
IMGURL: wx.$imgUrl,
activeTab: '', activeTab: '',
activeSubTab: '', activeSubTab: '',
subTo: '' subTo: ''
...@@ -36,6 +35,7 @@ Component({ ...@@ -36,6 +35,7 @@ Component({
handleFixedTabChange(e) { handleFixedTabChange(e) {
let { value } = e.currentTarget.dataset let { value } = e.currentTarget.dataset
let { activeSubTab } = this.data let { activeSubTab } = this.data
if (value == this.data.activeTab) return
this.setData({ this.setData({
activeTab: value, activeTab: value,
to: `to-${value}` to: `to-${value}`
...@@ -45,6 +45,7 @@ Component({ ...@@ -45,6 +45,7 @@ Component({
handleDynamicTabChange(e) { handleDynamicTabChange(e) {
let { value } = e.currentTarget.dataset let { value } = e.currentTarget.dataset
let { activeTab } = this.data let { activeTab } = this.data
if (value == this.data.activeSubTab) return
this.setData({ this.setData({
activeSubTab: value, activeSubTab: value,
subTo: `to-${value}` subTo: `to-${value}`
......
import homeApi from '~/api/module/home.js' import homeApi from '~/api/module/home.js'
import commonApi from '~/api/module/common.js' import commonApi from '~/api/module/common.js'
import cartApi from '~/api/module/cart.js'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -38,7 +39,8 @@ Page({ ...@@ -38,7 +39,8 @@ Page({
subTab: [], subTab: [],
activeTab: '', activeTab: '',
frontendCategoryId: '', frontendCategoryId: '',
goodsList: [] goodsList: [],
count: 1
}, },
onReady() { onReady() {
...@@ -90,7 +92,7 @@ Page({ ...@@ -90,7 +92,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const userInfo = wx.p.cache.userInfo.getUserInfo() const userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo}) this.setData({userInfo})
wx.p.router.getRouterParams(options).then(params => { wx.p.router.getRouterParams(options).then(params => {
this.setData({loginPageFlag: params?.loginPageFlag}, () => { this.setData({loginPageFlag: params?.loginPageFlag}, () => {
...@@ -106,7 +108,7 @@ Page({ ...@@ -106,7 +108,7 @@ Page({
// 获取积分钱包数据 // 获取积分钱包数据
getPointsWallet() { getPointsWallet() {
let { loginPageFlag } = this.data let { loginPageFlag } = this.data
let userInfo = wx.p.cache.userInfo.getUserInfo() let userInfo = wx.p.storage.get('userInfo')
// 获取当前积分数量 // 获取当前积分数量
commonApi.getPointsSummary({staffPhone: userInfo?.phone, channelSource: userInfo?.channelSource, merchantId: userInfo?.merchantId}).then(r => { commonApi.getPointsSummary({staffPhone: userInfo?.phone, channelSource: userInfo?.channelSource, merchantId: userInfo?.merchantId}).then(r => {
if (r?.code == 0) { if (r?.code == 0) {
...@@ -163,7 +165,7 @@ Page({ ...@@ -163,7 +165,7 @@ Page({
let userInfo = wx.p.storage.get('userInfo') let userInfo = wx.p.storage.get('userInfo')
let params = { let params = {
pageNum, pageNum,
pageSize: 4, pageSize: 10,
goodsSkuName, goodsSkuName,
frontendCategoryId, frontendCategoryId,
businessType: 1 businessType: 1
...@@ -233,7 +235,44 @@ Page({ ...@@ -233,7 +235,44 @@ Page({
}, },
// 加入购物车 // 加入购物车
handleAddToCart(e) { handleAddToCart(e) {
let value = e.detail
let { userInfo } = this.data
const PARAMS = {
goodsId: value.id,
sellQty: 1,
goodsSource: value.goodsSource,
scoreSource: userInfo?.channelSource,
merchantId: userInfo?.merchantId
}
if (value.goodsSource == 1) {
cartApi.addToCart(PARAMS).then(res => {
wx.p.wxApi.showToast('加入购物车成功')
})
} else {
// 获取商品详情
this.getDetail(value)
}
},
getDetail(options) {
homeApi.getGoodsDetailInfo({id: options.id, businessType: 1}).then(res => {
res.goodsSource = options.goodsSource
if (res && res.specificationResponses?.length) {
this.toGetSpecString(res, res.startQty)
}
if (res && res.platformGlGoodsSpecifications?.length) {
let item = res.platformGlGoodsSpecifications[0] || {}
res.redeemPoints = item.retailPrice
res.goodsStock = item.stock
res.specificationData = item.specificationData
this.setData({
activeSku: item.specificationData
})
}
this.setData({
detailInfo: res || {},
showSku: true
})
})
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"good-tab": "./components/good-tab/good-tab", "good-tab": "./components/good-tab/good-tab",
"goods": "/components/goods/goods", "goods": "/components/goods/goods",
"search-box": "./components/SearchBox/SearchBox", "search-box": "./components/SearchBox/SearchBox",
"enable-wallet": "/components/EnableWallet/EnableWallet" "enable-wallet": "/components/EnableWallet/EnableWallet",
"sku": "/components/Sku/index"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"backgroundColor": "#F9F7F7" "backgroundColor": "#F9F7F7"
......
...@@ -154,6 +154,19 @@ page { ...@@ -154,6 +154,19 @@ page {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
.nothing {
text-align: center;
color: #7A8299;
.icon {
margin: 20rpx auto;
width: 320rpx;
height: 300rpx;
}
}
.end {
text-align: center;
color: #858A94;
}
} }
} }
} }
......
...@@ -47,8 +47,19 @@ ...@@ -47,8 +47,19 @@
<search-box placeholder="搜索商品" bindsearch="handleSearch"></search-box> <search-box placeholder="搜索商品" bindsearch="handleSearch"></search-box>
<good-tab tab="{{tab}}" subTab="{{subTab}}" align="left" openScroll bindtabchange="changeTab" activeTab="{{activeTab}}" activeSubTab="{{frontendCategoryId}}"></good-tab> <good-tab tab="{{tab}}" subTab="{{subTab}}" align="left" openScroll bindtabchange="changeTab" activeTab="{{activeTab}}" activeSubTab="{{frontendCategoryId}}"></good-tab>
</view> </view>
<view class="goods-box" wx:if="{{goodsList.length}}"> <view class="goods-box">
<goods list="{{goodsList}}" bindjoin="handleAddToCart"></goods> <block wx:if="{{goodsList.length}}">
<goods list="{{goodsList}}" bindjoin="handleAddToCart"></goods>
<view class="end" wx:if="{{pages == pageNum}}">到底了~</view>
</block>
<block wx:else>
<view class="nothing">
<view class="icon">
<glsx-image webp src="/cart/nothing-icon.png" />
</view>
暂无商品
</view>
</block>
</view> </view>
</view> </view>
</block> </block>
...@@ -59,4 +70,5 @@ ...@@ -59,4 +70,5 @@
</block> </block>
<!-- 开通钱包 --> <!-- 开通钱包 -->
<enable-wallet show="{{showEnableWallet}}" walletObj="{{walletObj}}"></enable-wallet> <enable-wallet show="{{showEnableWallet}}" walletObj="{{walletObj}}"></enable-wallet>
<sku bind:cancelSku="closeSku" bind:getCount="getCount" show="{{showSku}}" goods="{{detailInfo}}" clickType="join"></sku>
<glsx-privacy appletName="积分商城"></glsx-privacy> <glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!