Commit f5975d6f by liimin

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas/mini-program/…

…points-mall into SAAS+V4.56.0-0908
2 parents ef1c62c9 6cbc98aa
...@@ -27,7 +27,6 @@ Component({ ...@@ -27,7 +27,6 @@ Component({
currentIndex: 0, currentIndex: 0,
goodsNumber: 1, goodsNumber: 1,
showJfModal: false, showJfModal: false,
jfCount: 0,
detailInfo: {} detailInfo: {}
}, },
...@@ -35,13 +34,6 @@ Component({ ...@@ -35,13 +34,6 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
computeJf(num) {
let {detailInfo, jfCount} = this.data
jfCount = NP.times(detailInfo.redeemPoints || 0, num)
this.setData({
jfCount
})
},
cancel() { cancel() {
this.setData({ this.setData({
show: false show: false
...@@ -50,6 +42,9 @@ Component({ ...@@ -50,6 +42,9 @@ Component({
}, },
setDefaultSku(detailInfo) { setDefaultSku(detailInfo) {
let specificationDetailList = detailInfo.platformGlGoodsSpecifications && detailInfo.platformGlGoodsSpecifications[0] let specificationDetailList = detailInfo.platformGlGoodsSpecifications && detailInfo.platformGlGoodsSpecifications[0]
if (detailInfo?.specificationData) {
specificationDetailList = detailInfo?.platformGlGoodsSpecifications?.find(val => val.specificationData == detailInfo.specificationData)
}
let defaultGoods = specificationDetailList?.specificationData.split('&') let defaultGoods = specificationDetailList?.specificationData.split('&')
detailInfo.platformGlGoodsSpecificationList?.map(e => { detailInfo.platformGlGoodsSpecificationList?.map(e => {
defaultGoods.map(i => { defaultGoods.map(i => {
...@@ -62,7 +57,9 @@ Component({ ...@@ -62,7 +57,9 @@ Component({
}) })
}) })
this.setData({ this.setData({
detailInfo detailInfo,
['detailInfo.goodsStock']: specificationDetailList?.stock || detailInfo.goodsStock, // 多规格商品库存在每个规格组中
goodsNumber: detailInfo?.sellQty || 1
}) })
}, },
// 选择规格 // 选择规格
...@@ -99,7 +96,6 @@ Component({ ...@@ -99,7 +96,6 @@ Component({
}, },
changeCount(e) { changeCount(e) {
this.triggerEvent('getCount', e.detail) this.triggerEvent('getCount', e.detail)
this.computeJf(e.detail)
this.setData({ this.setData({
goodsNumber: e.detail goodsNumber: e.detail
}) })
...@@ -118,9 +114,14 @@ Component({ ...@@ -118,9 +114,14 @@ Component({
toCreatedOrder() { toCreatedOrder() {
let { clickType, remain, detailInfo, defaultAddress, goodsNumber } = this.data let { clickType, remain, detailInfo, defaultAddress, goodsNumber } = this.data
const userInfo = wx.p.storage.get('userInfo') const userInfo = wx.p.storage.get('userInfo')
if (!['pay', 'join'].includes(clickType)) { if (!['pay', 'join', 'change'].includes(clickType)) {
return this.cancel() return this.cancel()
} }
if (clickType == 'change') {
this.cancel()
return this.triggerEvent('changeSku', {specificationData: detailInfo.specificationData, sellQty: goodsNumber || detailInfo.startQty})
}
console.log(detailInfo)
if (!detailInfo.goodsStock) return if (!detailInfo.goodsStock) return
detailInfo.sellQty = goodsNumber || detailInfo.sellQty detailInfo.sellQty = goodsNumber || detailInfo.sellQty
detailInfo?.platformGlGoodsSpecifications?.forEach(val => { detailInfo?.platformGlGoodsSpecifications?.forEach(val => {
...@@ -148,7 +149,6 @@ Component({ ...@@ -148,7 +149,6 @@ Component({
if(!defaultAddress.receiveName){ if(!defaultAddress.receiveName){
return wx.p.wxApi.showToast('请选择收货地址') return wx.p.wxApi.showToast('请选择收货地址')
} }
console.log(detailInfo, '22222222')
// 跳转到确认订单 // 跳转到确认订单
let query = { let query = {
defaultAddress, defaultAddress,
......
...@@ -45,17 +45,17 @@ ...@@ -45,17 +45,17 @@
<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 || 1}}" catchchange="changeCount"></stepper> <stepper count="{{goodsNumber}}" max="{{detailInfo.goodsStock}}" catchchange="changeCount"></stepper>
</view> </view>
</view> </view>
</view> </view>
<view class="textarea-box" wx:if="{{clickType != 'join'}}"> <view class="textarea-box" wx:if="{{clickType != 'join' && clickType != 'change'}}">
<view class="title">订单备注</view> <view class="title">订单备注</view>
<view class="pannel"> <view class="pannel">
<textarea bindinput="intRemain" maxlength="100" class="textArea" placeholder="请输入备注信息(选填)" placeholder-class="textarea-placeholder"></textarea> <textarea bindinput="intRemain" maxlength="100" class="textArea" placeholder="请输入备注信息(选填)" placeholder-class="textarea-placeholder"></textarea>
</view> </view>
</view> </view>
<view bind:tap="toShowAddressModal" class="adress-box flex_scb" wx:if="{{clickType != 'join'}}"> <view bind:tap="toShowAddressModal" class="adress-box flex_scb" wx:if="{{clickType != 'join' && clickType != 'change'}}">
<view class="title">收货地址</view> <view class="title">收货地址</view>
<view class="right flex_scb"> <view class="right flex_scb">
<view class="content {{defaultAds?'':'emptyText'}}">{{defaultAds || '请选择'}}</view> <view class="content {{defaultAds?'':'emptyText'}}">{{defaultAds || '请选择'}}</view>
......
...@@ -27,7 +27,6 @@ Page({ ...@@ -27,7 +27,6 @@ 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') let userInfo = wx.p.storage.get('userInfo')
console.log(params, '2222')
this.setData({ this.setData({
goodsInfo: params, goodsInfo: params,
userInfo userInfo
...@@ -69,7 +68,7 @@ Page({ ...@@ -69,7 +68,7 @@ Page({
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
homeApi.createOrder(params).then(res => { homeApi.createOrder(params).then(res => {
wx.hideLoading() wx.hideLoading()
wx.p.router.redirectTo('/packageIndex/pages/exchangeSuccess/index') wx.p.router.reLaunch('/packageIndex/pages/exchangeSuccess/index')
}) })
} }
}, },
...@@ -127,12 +126,46 @@ Page({ ...@@ -127,12 +126,46 @@ Page({
}) })
}, },
checkOut() { checkOut() {
let { money, walletObj } = this.data let { money, walletObj, contactInfo } = this.data
if (money > walletObj?.currentScore) return // 积分不足 if (money > walletObj?.currentScore) return // 积分不足
if (!Object.keys(contactInfo)?.length) return wx.p.wxApi.showToast('请选择收货地址')
this.setData({ this.setData({
showModal: true showModal: true
}) })
}, },
// 多规格商品更换规格
handleChangeSku(e) {
let { target, index } = e.currentTarget.dataset
// 获取商品详情
this.getGoodsDetail(target, index)
},
getGoodsDetail(target, index) {
homeApi.getGoodsDetailInfo({id: target.id || target.goodsId, businessType: 1}).then(res => {
res.specificationData = target.specificationData
res?.platformGoodsResources?.forEach(item => {
if (item.resType == 1) item.imgUrl = item.content
})
if (res.goodsSource == 2) {
res.imageResponses = res?.platformGoodsResources?.filter(val => val.bizType == 1)
res.goodsDescList = res?.platformGoodsResources?.filter(val => val.bizType == 2)
}
res.sellQty = target.sellQty
this.setData({
selectInfo: res || {},
showSku: true,
selectSkuIndex: index
})
})
},
changeSku(e) {
let {selectSkuIndex} = this.data
this.setData({
[`goodsInfo.goodsList[${selectSkuIndex}].specificationData`]: e.detail.specificationData,
[`goodsInfo.goodsList[${selectSkuIndex}].sellQty`]: e.detail.sellQty
}, () => {
this.getMoney(this.data.goodsInfo)
})
},
goodsActionReady(e) { goodsActionReady(e) {
this.setData({ this.setData({
padding_bottom: e.detail padding_bottom: e.detail
...@@ -148,7 +181,7 @@ Page({ ...@@ -148,7 +181,7 @@ Page({
let { goodsInfo } = this.data let { goodsInfo } = this.data
mineApi.getCustomerAddressList().then(res => { mineApi.getCustomerAddressList().then(res => {
let obj = {} let obj = {}
res?.forEach(val => { res?.forEach((val, index) => {
if ((!goodsInfo?.defaultAddress && val.isDefault == 1) || if ((!goodsInfo?.defaultAddress && val.isDefault == 1) ||
(goodsInfo?.defaultAddress?.id == val.id)) { (goodsInfo?.defaultAddress?.id == val.id)) {
obj = { obj = {
...@@ -157,6 +190,14 @@ Page({ ...@@ -157,6 +190,14 @@ Page({
contactPhone: val.receiveMobile, contactPhone: val.receiveMobile,
contactAddress: `${val.provinceName}${val.cityName}${val.countyName}${val.address}` contactAddress: `${val.provinceName}${val.cityName}${val.countyName}${val.address}`
} }
} else {
let data = res[0]
obj = {
...data,
contactName: data.receiveName,
contactPhone: data.receiveMobile,
contactAddress: `${data.provinceName}${data.cityName}${data.countyName}${data.address}`
}
} }
}) })
this.setData({ this.setData({
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"navigationBarTitleText": "确认订单", "navigationBarTitleText": "确认订单",
"usingComponents": { "usingComponents": {
"stepper": "/components/Stepper/Stepper", "stepper": "/components/Stepper/Stepper",
"address":"/components/Adress/index" "address":"/components/Adress/index",
"sku": "/components/Sku/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -40,8 +40,9 @@ ...@@ -40,8 +40,9 @@
<view class="text-hide"> <view class="text-hide">
{{item.goodsSkuName}} {{item.goodsSkuName}}
</view> </view>
<view class="specificationData-text"> <view wx:if="{{item.specificationData}}" class="specificationData-text" bindtap="handleChangeSku" data-target="{{item}}" data-index="{{index}}">
<view class="text-hide description">{{item.specificationData || ''}}</view> <view class="text-hide description">{{item.specificationData}}</view>
<mp-icon icon="back" class="change-icon" color="#6E6E7A" size="{{8}}"></mp-icon>
</view> </view>
</view> </view>
<view class="price-box"> <view class="price-box">
...@@ -96,6 +97,7 @@ ...@@ -96,6 +97,7 @@
</goods-action> </goods-action>
</block> </block>
<address address="{{addressList}}" defaultAddress="{{contactInfo}}" bind:getAddress="getAddress" show="{{showAddress}}"></address> <address address="{{addressList}}" defaultAddress="{{contactInfo}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
<sku bind:cancelSku="closeSku" wx:if="{{showSku}}" show="{{showSku}}" goods="{{selectInfo}}" bindchangeSku="changeSku" clickType="change"></sku>
<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>{{walletObj.currentScore}}</text>积分</view> <view>您当前总积分为<text>{{walletObj.currentScore}}</text>积分</view>
......
...@@ -93,6 +93,9 @@ ...@@ -93,6 +93,9 @@
.box .item .content .goods-info .text { .box .item .content .goods-info .text {
flex-shrink: 0; flex-shrink: 0;
width: calc(100% - 180rpx); width: calc(100% - 180rpx);
display: flex;
flex-direction: column;
justify-content: space-between;
} }
.box .item .content .goods-info .text .price-box { .box .item .content .goods-info .text .price-box {
...@@ -165,7 +168,7 @@ ...@@ -165,7 +168,7 @@
color: #6E6E7A; color: #6E6E7A;
} }
.text .specificationData-text .select { .text .specificationData-text .change-icon {
margin-left: 8rpx; margin-left: 8rpx;
transform: rotate(-90deg); transform: rotate(-90deg);
} }
......
...@@ -20,6 +20,11 @@ Page({ ...@@ -20,6 +20,11 @@ Page({
}) })
}, },
back() {
clearInterval(this.timer)
wx.p.router.switchTab("/pages/tab/index/index")
},
countdown() { countdown() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
let { count } = this.data let { count } = this.data
...@@ -64,7 +69,7 @@ Page({ ...@@ -64,7 +69,7 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
clearInterval(this.timer)
}, },
/** /**
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/exchangeSuccess/index.wxss */ /* packageIndex/pages/exchangeSuccess/index.wxss */
.back {
margin-left: 40rpx;
}
.container { .container {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
......
<!--packageIndex/pages/exchangeSuccess/index.wxml--> <!--packageIndex/pages/exchangeSuccess/index.wxml-->
<view class="container"> <view class="container">
<navigation-bar custom bindnavbarReady="navbarReady">
<view class="navigation">
<view class="back" bindtap="back">
<mp-icon icon="back" color="#2C2C2C" size="{{12}}"></mp-icon>
</view>
</view>
</navigation-bar>
<view class="icon"> <view class="icon">
<glsx-image src="/status/success.png"></glsx-image> <glsx-image src="/status/success.png"></glsx-image>
</view> </view>
......
...@@ -185,7 +185,7 @@ Page({ ...@@ -185,7 +185,7 @@ Page({
detailInfo: res || {}, detailInfo: res || {},
eventFlag: true, eventFlag: true,
activeSku: res.specificationData, activeSku: res.specificationData,
goodsStock: res.goodsStock goodsStock: res.goodsStock || 0
}) })
}) })
}, },
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</view> </view>
<view class="text"> <view class="text">
<view class="text-hide">{{item.goodsSkuName}}</view> <view class="text-hide">{{item.goodsSkuName}}</view>
<view class="specification" wx:if="{{item.specificationData}}">{{item.specificationData}}</view> <view class="specification text-hide" wx:if="{{item.specificationData}}">{{item.specificationData}}</view>
<view class="price-box" wx:if="{{!item.flag}}"> <view class="price-box" wx:if="{{!item.flag}}">
<view class="price"> <view class="price">
{{item.redeemPoints || 0}} {{item.redeemPoints || 0}}
......
...@@ -101,6 +101,11 @@ Page({ ...@@ -101,6 +101,11 @@ Page({
// 获取积分商城配置 // 获取积分商城配置
getHomeData() { getHomeData() {
homeApi.getHomeConfigData({miniType: 1}).then(res => { homeApi.getHomeConfigData({miniType: 1}).then(res => {
res?.specialEvents?.forEach(item => {
item?.specialEventGoodsList?.forEach(val => {
val.id = val.goodsId
})
})
this.setData({ this.setData({
bannerUrl: res?.mallBannerList[0]?.bannerUrl, bannerUrl: res?.mallBannerList[0]?.bannerUrl,
specialSaleArr: res.specialEvents specialSaleArr: res.specialEvents
...@@ -180,7 +185,7 @@ Page({ ...@@ -180,7 +185,7 @@ Page({
params.merchantNo = userInfo?.merchantId params.merchantNo = userInfo?.merchantId
} else if (activeTab) { // 积分区间 } else if (activeTab) { // 积分区间
params.storeStart = activeTab == 2 ? 0 : activeTab == 3 ? 100 : activeTab == 4 ? 200 : '' params.storeStart = activeTab == 2 ? 0 : activeTab == 3 ? 100 : activeTab == 4 ? 200 : ''
params.storeEnd = activeTab == 2 ? 100 : activeTab == 3 ? 200 : activeTab == 4 ? 300 : '' params.storeEnd = activeTab == 2 ? 99 : activeTab == 3 ? 200 : activeTab == 4 ? 300 : ''
} }
homeApi.getGoodsStockroomList(params).then(res => { homeApi.getGoodsStockroomList(params).then(res => {
this.setData({ this.setData({
...@@ -221,6 +226,7 @@ Page({ ...@@ -221,6 +226,7 @@ Page({
handleSearch(e) { handleSearch(e) {
this.setData({ this.setData({
goodsSkuName: e.detail, goodsSkuName: e.detail,
goodsList: [],
pageNum: 1 pageNum: 1
}, () => { }, () => {
this.getGoodsList() this.getGoodsList()
...@@ -232,6 +238,7 @@ Page({ ...@@ -232,6 +238,7 @@ Page({
this.setData({ this.setData({
activeTab: e.detail.activeTab, activeTab: e.detail.activeTab,
frontendCategoryId: e.detail?.activeSubTab, frontendCategoryId: e.detail?.activeSubTab,
goodsList: [],
pageNum: 1 pageNum: 1
}, () => { }, () => {
this.getGoodsList() this.getGoodsList()
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
font-weight: 700; font-weight: 700;
} }
} }
.arrow-icon {
margin-left: 10rpx;
}
} }
.layout { .layout {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!