Commit 6bb6c556 by 李伟康

修复BUG

1 parent 6974b695
...@@ -136,7 +136,7 @@ module.exports = { ...@@ -136,7 +136,7 @@ module.exports = {
}, },
//申请售后待审核的订单取消售后 //申请售后待审核的订单取消售后
cancelOrder(orderCode) { cancelOrder(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.cancel',{ return api.fetch('scrm.api.shopmall.weapp.orderRefund.cancel', {
orderCode orderCode
}) })
}, },
...@@ -159,4 +159,25 @@ module.exports = { ...@@ -159,4 +159,25 @@ module.exports = {
orderCode orderCode
}) })
}, },
/**分类列表
*
*/
getMerchantClassify(data) {
return api.post({
method: `scrm.api.shopmall.classify.page.curMerchant`,
pageSize: 9999,
currentPage: 1,
...data
})
},
/**分类商品 */
getMerchantClassifyGoods(data) {
return api.post({
method: `scrm.api.shopmall.classify.getById`,
pageSize: 10,
currentPage: 1,
...data
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,124 +7,105 @@ Page({ ...@@ -7,124 +7,105 @@ Page({
*/ */
data: { data: {
tagIndex: 0, tagIndex: 0,
tabList: [] tabList: [],
goodsList: []
}, },
search(e) { pageNum: 1,
total: 0,
async search(e) {
let value = e.detail let value = e.detail
let { let {
goodsList goodsList,
tagIndex
} = this.data } = this.data
if (tagIndex == 0) {
if (this.goodsStorageList) this.jumpSearch(this.goodsStorageList, value)
else if (goodsList.length < this.total) {
this.getGoodsList(res => {
this.goodsStorageList = res
this.jumpSearch(res, value)
})
}
} else this.jumpSearch(goodsList, value)
},
jumpSearch(goodsList, value) {
wx.p.router.go('/packageMall/pages/search/search', { wx.p.router.go('/packageMall/pages/search/search', {
value, value,
goodsList, goodsList,
notIntercept: true notIntercept: true
}) })
this.setData({ this.setData({
searchVal:'' searchVal: ''
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// this.getZoneInfo() this.getMerchantClassify()
this.getClassifyList() this.getGoodsList()
}, },
getClassifyList(tagIndex) { async getMerchantClassify() {
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
wx.p.api.homeApi.getClassifyList().then(data => { try {
const {
merchantId
} = wx.p.storage.get('merchant_info'),
res = await wx.p.api.shopmallApi.getMerchantClassify({
merchantId
})
console.log(res)
let tabList = [{ let tabList = [{
zoneName: '全部', zoneName: '全部',
id: '', id: '',
zoneImg : `mall/default-banner.png` zoneImg: `mall/default-banner.png`
}] }]
let classifyList = [] res.list.map(e => {
data.map(e => {
e.goodsList &&
e.goodsList.length &&
e.goodsList.map(i => {
i &&
i.length &&
i.map(c => {
c.goods.goodsStatistics = c.goodsStatistics
c.goods.id = c.goodsId
})
})
if (e.goodsList && e.goodsList.length) {
e.count = 0
// 处理数据
let [arr, obj] = [
[], {}
]
e.goodsList.forEach((val, id) => {
if (val instanceof Array) {
val.forEach((item, index) => {
arr.push(item.goods)
})
obj = {
goodsData: arr,
id: e.id,
}
} else {
val.classifyName = e.classifyName
arr.push(val)
obj = {
activityData: arr,
id: e.id
}
}
})
let tab = { let tab = {
zoneName: e.classifyName, zoneName: e.classifyName,
id: e.id, id: e.id,
zoneImg: `mall/${e.classifyName}.png` zoneImg: `mall/${e.classifyName}.png`
} }
if (!defaultClassify.includes(e.classifyName)) tab.zoneImg = `mall/default-banner.png` if (!defaultClassify.includes(e.classifyName)) tab.zoneImg = `mall/default-banner.png`
classifyList.push(obj)
tabList.push(tab) tabList.push(tab)
}
}) })
this.setData({ this.setData({
classifyList,
tabList, tabList,
flag: true flag: true
}) })
if (tagIndex) this.changeData(tagIndex) wx.hideLoading()
this.getGoodsList() } catch (error) {
}) wx.p.wxApi.showToast(error)
}, }
getZoneInfo() {
wx.p.api.discoveryApi.getZoneInfo(2).then(data => {
let tabList = [{
zoneName: '门店自营',
id: '',
zoneImg: `mall/default-banner.png`
}]
data.map(e => tabList.push(e))
this.setData({
tabList,
flag: true
})
this.getGoodsList()
})
}, },
getGoodsList(zoneId) { getGoodsList(callBack) {
wx.hideLoading() wx.hideLoading()
const { const {
tagIndex tagIndex
} = this.data } = this.data
if (tagIndex != 0) return if (tagIndex != 0) return
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
let params = {} let params = {
if (zoneId) params.zoneId = zoneId pageSize: callBack ? 99999 : 10,
pageNum: callBack ? 1 : this.pageNum
}
wx.p.api.shopmallApi.getGoodsList(params).then(({ wx.p.api.shopmallApi.getGoodsList(params).then(({
list list,
total
}) => { }) => {
if (callBack) callBack(list)
else {
let {
goodsList
} = this.data
this.setData({ this.setData({
goodsList: list, goodsList: goodsList.concat(list),
goodsFlag: true goodsFlag: true
}) })
this.total = total
}
wx.hideLoading() wx.hideLoading()
}) })
}, },
/** /**
...@@ -142,26 +123,46 @@ Page({ ...@@ -142,26 +123,46 @@ Page({
tabList, tabList,
tagIndex tagIndex
} = this.data } = this.data
this.setData({
goodsList: [],
goodsFlag: false
})
if (tabList.length == 0) return if (tabList.length == 0) return
this.getClassifyList(tagIndex) this.changeData(tagIndex)
}, },
changeData(index) { changeData(index) {
this.setData({
tagIndex: index,
goodsList: [],
goodsFlag: false,
nothing: false
})
this.pageNum = 1
const { const {
classifyList,
tabList tabList
} = this.data } = this.data
if (tabList[index].id) { if (tabList[index].id) this.getMerchantClassifyGoods(tabList[index].id)
classifyList.map(i => { else this.getGoodsList()
if (i.id == tabList[index].id) this.setData({ },
goodsList: i.goodsData, async getMerchantClassifyGoods(id) {
goodsFlag: true wx.p.wxApi.showLoading('加载中...')
try {
const {
goodsRefList
} = await wx.p.api.shopmallApi.getMerchantClassifyGoods({
id
}) })
let goodsList = []
if (goodsRefList && goodsRefList.length) {
goodsRefList.map(e => {
e.goods.goodsStatistics = e.goodsStatistics
goodsList.push(e.goods)
})
}
this.setData({
goodsList,
goodsFlag: true
}) })
} else this.getGoodsList() wx.hideLoading()
} catch (error) {
}
}, },
goShoppingCart() { goShoppingCart() {
wx.p.router.go('/packageMall/pages/shoppingCart/shoppingCart') wx.p.router.go('/packageMall/pages/shoppingCart/shoppingCart')
...@@ -174,12 +175,30 @@ Page({ ...@@ -174,12 +175,30 @@ Page({
tagIndex tagIndex
} = this.data } = this.data
if (index == tagIndex) return if (index == tagIndex) return
this.setData({
tagIndex: index,
goodsList: [],
goodsFlag: false
})
this.changeData(index) this.changeData(index)
this.goodsStorageList = null
},
viewScrollTolower() {
const {
tagIndex
} = this.data
if (tagIndex == 0) {
let {
pageNum,
total
} = this
wx.p.util.onReachBottom({
pageNum,
total,
_this: this
}, () => {
this.pageNum++
this.getGoodsList()
})
}
},
onTabItemTap(e){
this.goodsStorageList = null
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
...@@ -192,7 +211,6 @@ Page({ ...@@ -192,7 +211,6 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
}, },
/** /**
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<search-box search-type="2" bindsearch="search" model:value="{{searchVal}}"></search-box> <search-box search-type="2" bindsearch="search" model:value="{{searchVal}}"></search-box>
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
<block wx:if="{{tabList.length}}"> <block wx:if="{{tabList.length}}">
<tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="{{52 + navHeight}}" bindclick="tabclick"> <tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="{{52 + navHeight}}" bindclick="tabclick" bindviewScrollTolower="viewScrollTolower">
<view class="tab-view-box" slot="content"> <view class="tab-view-box" slot="content">
<block wx:if='{{goodsFlag}}'> <block wx:if='{{goodsFlag}}'>
<view class="box"> <view class="box">
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
<goods item="{{item}}"></goods> <goods item="{{item}}"></goods>
</view> </view>
</block> </block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底啦!!</view>
</block>
</block> </block>
<block wx:else> <block wx:else>
<view class="list-nothing flex"> <view class="list-nothing flex">
......
...@@ -26,6 +26,11 @@ Page({ ...@@ -26,6 +26,11 @@ Page({
2: 'sliver_title', 2: 'sliver_title',
3: 'card_title', 3: 'card_title',
}, },
dateClass: {
1: 'gold_date',
2: 'sliver_date',
3: 'card_date',
}
}, },
/** /**
...@@ -79,6 +84,9 @@ Page({ ...@@ -79,6 +84,9 @@ Page({
if (res.data && res.data.validitDate) { if (res.data && res.data.validitDate) {
res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd') res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd')
} }
if (res.data && res.data.endTime) {
res.data.endTime = new Date(res.data.endTime).format('yyyy.MM.dd')
}
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
flag = true flag = true
identity = 3 identity = 3
......
...@@ -12,6 +12,7 @@ page { ...@@ -12,6 +12,7 @@ page {
height: 360rpx; height: 360rpx;
margin: 32rpx 20rpx 0; margin: 32rpx 20rpx 0;
position: relative; position: relative;
&-bg { &-bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -50,6 +51,32 @@ page { ...@@ -50,6 +51,32 @@ page {
background-clip: text !important; background-clip: text !important;
color: transparent !important; color: transparent !important;
} }
.card_date {
position: absolute;
left: 40rpx;
bottom: 40rpx;
background: linear-gradient(125deg, #F0EED7 100%, #F2EAAB 100%) !important;
-webkit-background-clip: text !important;
background-clip: text !important;
color: transparent !important;
font-weight: 400;
font-size: 20rpx;
}
.sliver_date {
background: linear-gradient(125deg, #C99113 100%, #A9790B 100%) !important;
-webkit-background-clip: text !important;
background-clip: text !important;
color: transparent !important;
}
.gold_date {
background: linear-gradient(125deg, #645E54 100%, #29271E 100%) !important;
-webkit-background-clip: text !important;
background-clip: text !important;
color: transparent !important;
}
} }
.navigation-bar { .navigation-bar {
...@@ -342,76 +369,3 @@ page { ...@@ -342,76 +369,3 @@ page {
color: #0A0D14; color: #0A0D14;
letter-spacing: 0; letter-spacing: 0;
} }
\ No newline at end of file \ No newline at end of file
.dev-box {
background-color: #fff;
padding-top: 28rpx;
.title {
margin-bottom: 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #0A0D14;
text-indent: 32rpx;
}
.scroll-box {
overflow-x: scroll;
padding-bottom: 24rpx;
&::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.item {
font-size: 26rpx;
color: #0A0D14;
margin-left: 20rpx;
.dev-img {
width: 120rpx;
height: 120rpx;
margin-right: 12rpx;
flex-shrink: 0;
}
.dev-content {
max-width: 184rpx;
flex-shrink: 0;
}
&:first-of-type {
padding-left: 12rpx;
}
}
}
}
.dev-box {
.title .edit {
font-size: 24rpx;
font-weight: normal;
color: #858A94;
display: flex;
align-items: center;
margin-left: auto;
}
.icon-mine-arrow {
transform: translateY(8rpx);
margin-left: 6rpx;
}
}
.sprite-icon {
background-image: url(https://img02.glsx.com.cn/weapp/resource/dj-shopmall-test/sprite-1650770528010.png) !important;
background-size: 376rpx 364rpx !important;
}
.car-info .icon-mine-arrow {
transform: translateY(4rpx) !important;
margin-left: 6rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
<glsx-image src="equity/version/1_0_0/{{vipType[identity]}}.png"></glsx-image> <glsx-image src="equity/version/1_0_0/{{vipType[identity]}}.png"></glsx-image>
</view> </view>
<view class="vip-name {{titleClass[identity]}}">{{identity==1?vipInfo.goldName:identity==2?vipInfo.silverName:memberInfo.equityName}}</view> <view class="vip-name {{titleClass[identity]}}">{{identity==1?vipInfo.goldName:identity==2?vipInfo.silverName:memberInfo.equityName}}</view>
<view wx:if="{{vipInfo.cardNo&&identity==3}}" class="card_date {{dateClass[identity]}}">{{vipInfo.time}} 到期</view>
<view wx:elif="{{vipInfo.cardNo&&identity<3}}" class="card_date {{dateClass[identity]}}">{{vipInfo.endTime}} 到期</view>
<view wx:elif="{{!vipInfo.cardNo}}" class="card_date {{dateClass[identity]}}"> {{vipInfo.renewDay}}天后到期</view>
</view> </view>
<!-- <view class="goUseBox" bindtap="goInterests"> <!-- <view class="goUseBox" bindtap="goInterests">
去使用 去使用
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!