Commit 6bb6c556 by 李伟康

修复BUG

1 parent 6974b695
......@@ -136,7 +136,7 @@ module.exports = {
},
//申请售后待审核的订单取消售后
cancelOrder(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.cancel',{
return api.fetch('scrm.api.shopmall.weapp.orderRefund.cancel', {
orderCode
})
},
......@@ -159,4 +159,25 @@ module.exports = {
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
......@@ -7,124 +7,105 @@ Page({
*/
data: {
tagIndex: 0,
tabList: []
tabList: [],
goodsList: []
},
search(e) {
pageNum: 1,
total: 0,
async search(e) {
let value = e.detail
let {
goodsList
goodsList,
tagIndex
} = 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', {
value,
goodsList,
notIntercept: true
})
this.setData({
searchVal:''
searchVal: ''
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// this.getZoneInfo()
this.getClassifyList()
this.getMerchantClassify()
this.getGoodsList()
},
getClassifyList(tagIndex) {
async getMerchantClassify() {
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 = [{
zoneName: '全部',
id: '',
zoneImg : `mall/default-banner.png`
zoneImg: `mall/default-banner.png`
}]
let classifyList = []
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
}
}
})
res.list.map(e => {
let tab = {
zoneName: e.classifyName,
id: e.id,
zoneImg: `mall/${e.classifyName}.png`
}
if (!defaultClassify.includes(e.classifyName)) tab.zoneImg = `mall/default-banner.png`
classifyList.push(obj)
tabList.push(tab)
}
})
this.setData({
classifyList,
tabList,
flag: true
})
if (tagIndex) this.changeData(tagIndex)
this.getGoodsList()
})
},
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()
})
wx.hideLoading()
} catch (error) {
wx.p.wxApi.showToast(error)
}
},
getGoodsList(zoneId) {
getGoodsList(callBack) {
wx.hideLoading()
const {
tagIndex
} = this.data
if (tagIndex != 0) return
wx.p.wxApi.showLoading('加载中...')
let params = {}
if (zoneId) params.zoneId = zoneId
let params = {
pageSize: callBack ? 99999 : 10,
pageNum: callBack ? 1 : this.pageNum
}
wx.p.api.shopmallApi.getGoodsList(params).then(({
list
list,
total
}) => {
if (callBack) callBack(list)
else {
let {
goodsList
} = this.data
this.setData({
goodsList: list,
goodsList: goodsList.concat(list),
goodsFlag: true
})
this.total = total
}
wx.hideLoading()
})
},
/**
......@@ -142,26 +123,46 @@ Page({
tabList,
tagIndex
} = this.data
this.setData({
goodsList: [],
goodsFlag: false
})
if (tabList.length == 0) return
this.getClassifyList(tagIndex)
this.changeData(tagIndex)
},
changeData(index) {
this.setData({
tagIndex: index,
goodsList: [],
goodsFlag: false,
nothing: false
})
this.pageNum = 1
const {
classifyList,
tabList
} = this.data
if (tabList[index].id) {
classifyList.map(i => {
if (i.id == tabList[index].id) this.setData({
goodsList: i.goodsData,
goodsFlag: true
if (tabList[index].id) this.getMerchantClassifyGoods(tabList[index].id)
else this.getGoodsList()
},
async getMerchantClassifyGoods(id) {
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() {
wx.p.router.go('/packageMall/pages/shoppingCart/shoppingCart')
......@@ -174,12 +175,30 @@ Page({
tagIndex
} = this.data
if (index == tagIndex) return
this.setData({
tagIndex: index,
goodsList: [],
goodsFlag: false
})
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({
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
......
......@@ -3,7 +3,7 @@
<search-box search-type="2" bindsearch="search" model:value="{{searchVal}}"></search-box>
<block wx:if="{{flag}}">
<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">
<block wx:if='{{goodsFlag}}'>
<view class="box">
......@@ -24,6 +24,9 @@
<goods item="{{item}}"></goods>
</view>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底啦!!</view>
</block>
</block>
<block wx:else>
<view class="list-nothing flex">
......
......@@ -26,6 +26,11 @@ Page({
2: 'sliver_title',
3: 'card_title',
},
dateClass: {
1: 'gold_date',
2: 'sliver_date',
3: 'card_date',
}
},
/**
......@@ -79,6 +84,9 @@ Page({
if (res.data && res.data.validitDate) {
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) {
flag = true
identity = 3
......
......@@ -12,6 +12,7 @@ page {
height: 360rpx;
margin: 32rpx 20rpx 0;
position: relative;
&-bg {
width: 100%;
height: 100%;
......@@ -50,6 +51,32 @@ page {
background-clip: text !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 {
......@@ -342,76 +369,3 @@ page {
color: #0A0D14;
letter-spacing: 0;
}
\ 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
......@@ -59,6 +59,9 @@
<glsx-image src="equity/version/1_0_0/{{vipType[identity]}}.png"></glsx-image>
</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 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!