Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
hmd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6bb6c556
authored
Jul 25, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复BUG
1 parent
6974b695
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
183 additions
and
176 deletions
api/module/shopmall.js
pages/tab/mall/index.js
pages/tab/mall/index.wxml
pages/tab/mine/index.js
pages/tab/mine/index.scss
pages/tab/mine/index.wxml
api/module/shopmall.js
View file @
6bb6c55
...
@@ -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
})
})
},
},
...
@@ -152,11 +152,32 @@ module.exports = {
...
@@ -152,11 +152,32 @@ module.exports = {
return
api
.
fetch
(
'scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds'
)
return
api
.
fetch
(
'scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds'
)
},
},
/** 确认收货 */
/** 确认收货 */
confirmReceipt
(
orderCode
)
{
confirmReceipt
(
orderCode
)
{
return
api
.
post
({
return
api
.
post
({
method
:
`scrm.api.shopmall.weapp.order.confirmReceipt`
,
method
:
`scrm.api.shopmall.weapp.order.confirmReceipt`
,
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
pages/tab/mall/index.js
View file @
6bb6c55
...
@@ -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
.
get
Classify
List
()
this
.
get
Goods
List
()
},
},
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
=>
{
let
tab
=
{
e
.
goodsList
&&
zoneName
:
e
.
classifyName
,
e
.
goodsList
.
length
&&
id
:
e
.
id
,
e
.
goodsList
.
map
(
i
=>
{
zoneImg
:
`mall/
${
e
.
classifyName
}
.png`
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
=
{
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
)
}
}
if
(
!
defaultClassify
.
includes
(
e
.
classifyName
))
tab
.
zoneImg
=
`mall/default-banner.png`
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
})
=>
{
})
=>
{
this
.
setData
({
if
(
callBack
)
callBack
(
list
)
goodsList
:
list
,
else
{
goodsFlag
:
true
let
{
})
goodsList
}
=
this
.
data
this
.
setData
({
goodsList
:
goodsList
.
concat
(
list
),
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
()
{
},
},
/**
/**
...
...
pages/tab/mall/index.wxml
View file @
6bb6c55
...
@@ -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">
...
...
pages/tab/mine/index.js
View file @
6bb6c55
...
@@ -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
...
...
pages/tab/mine/index.scss
View file @
6bb6c55
...
@@ -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%
;
...
@@ -41,7 +42,7 @@ page {
...
@@ -41,7 +42,7 @@ page {
-webkit-background-clip
:
text
!
important
;
-webkit-background-clip
:
text
!
important
;
background-clip
:
text
!
important
;
background-clip
:
text
!
important
;
color
:
transparent
!
important
;
color
:
transparent
!
important
;
}
}
.sliver_title
{
.sliver_title
{
...
@@ -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
{
...
@@ -341,77 +368,4 @@ page {
...
@@ -341,77 +368,4 @@ page {
font-size
:
24rpx
;
font-size
:
24rpx
;
color
:
#0A0D14
;
color
:
#0A0D14
;
letter-spacing
:
0
;
letter-spacing
:
0
;
}
.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
pages/tab/mine/index.wxml
View file @
6bb6c55
...
@@ -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">
去使用
去使用
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment