Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
12fa9e8d
Commit
12fa9e8d
authored
Jun 01, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
33c72a74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
370 additions
and
95 deletions
+370
-95
categoryTab.js
src/component/categoryTab/categoryTab.js
+0
-0
categoryTab.wxml
src/component/categoryTab/categoryTab.wxml
+7
-11
categoryTab.wxss
src/component/categoryTab/categoryTab.wxss
+2
-0
index.js
src/config/index.js
+2
-2
my.js
src/pages/my/my.js
+100
-1
my.json
src/pages/my/my.json
+1
-0
my.wxml
src/pages/my/my.wxml
+16
-7
userCenter.js
src/pages/userCenter/userCenter.js
+49
-15
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+14
-12
project.config.json
src/project.config.json
+5
-5
categoryPro.js
src/subPackage/page/pages/categoryPro/categoryPro.js
+58
-31
subPage.js
src/subPackage/page/pages/subPage/subPage.js
+99
-4
subPage.json
src/subPackage/page/pages/subPage/subPage.json
+1
-0
subPage.wxml
src/subPackage/page/pages/subPage/subPage.wxml
+16
-7
No files found.
src/component/categoryTab/categoryTab.js
View file @
12fa9e8d
This diff is collapsed.
Click to expand it.
src/component/categoryTab/categoryTab.wxml
View file @
12fa9e8d
<!--component/tabSort/tabSort.wxml-->
<view class="category-tab-container clear-box">
<view class="category-tab {{categoryTabFixed ? 'fixed' : ''}}">
<view class="scroll-view_H">
<view class="category-tab-item active">鞋子</view>
<view class="category-tab-item">裤子</view>
<view class="category-tab-item">帽子</view>
<view class="category-tab-item">衣服</view>
<view class="category-tab-item">衣服</view>
<view class="category-tab-item">衣服</view>
<view class="category-tab-item">衣服</view>
<view class="category-tab-item">衣服</view>
<view class="category-tab {{categoryTabFixed ? 'fixed' : ''}}" wx:if="{{currentCategoryTab.categorys.length > 1}}">
<view class="scroll-view_H" >
<view class="category-tab-item {{item.actived ? 'active' : ''}}"
wx:for="{{currentCategoryTab.categorys}}" wx:key="*this"
wx:for-index="idx" wx:for-item="item"
data-item="{{item}}" data-index="{{idx}}" bindtap="onTapChangeCategory">{{item.title}}</view>
</view>
</view>
<!-- 商品列表 -->
<view class="product-list" wx:if="{{proData.length}}">
<view class="product-list" wx:if="{{proData.length}}"
style="padding-top: {{currentCategoryTab.categorys.length > 1 ? 0 : '1rpx'}};"
>
<product-list-style-one image-data="{{proData}}" />
</view>
</view>
...
...
src/component/categoryTab/categoryTab.wxss
View file @
12fa9e8d
...
...
@@ -49,4 +49,5 @@
.category-tab-container .product-list{
background: #ffffff;
}
\ No newline at end of file
src/config/index.js
View file @
12fa9e8d
...
...
@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const
PROJECT_ENV
=
'
test
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const
PROJECT_ENV
=
'
dev
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播 //门户 wx833d5ece112fc3fd
...
...
@@ -27,7 +27,7 @@ const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门
//2002 巴黎贝甜 wx21968cb3a486d4ab
//2014 包小姐与鞋先生 wxa00302e2f53dd9c5
const
BRANCH_ID
=
100
2
const
BRANCH_ID
=
100
1
const
isMall
=
true
// const needMock = '' //
...
...
src/pages/my/my.js
View file @
12fa9e8d
...
...
@@ -35,6 +35,7 @@ wxService.page({
contactUsModal
:
false
,
//显示广告
pageInfo
:
null
,
categoryTabFixed
:
false
,
},
/**
* 生命周期函数--监听页面加载
...
...
@@ -63,8 +64,84 @@ wxService.page({
handlerDataOnPage
=
new
utils
.
HandlerDataOnPage
()
renderPage
=
require
(
'../../utils/renderPage'
).
getRenderPage
()
handlerDataOnPage
.
init
(
this
,
'pages'
)
this
.
initPage
(
this
.
data
.
pageId
)
this
.
initPage
(
this
.
data
.
pageId
);
setTimeout
(()
=>
{
this
.
getElementTop
();
// categoryTab
},
500
);
},
// 页面滚动到底部
onReachBottom
(){
if
(
this
.
categoryTabComponent
){
this
.
categoryTabComponent
.
getTagProducts
(
'scrollBottom'
);
}
},
//页面滚动
onPageScroll
(
e
){
if
(
!
this
.
scrollTop
){
return
;
}
let
scrollTop
=
e
.
scrollTop
;
this
.
throttle
(
scoTop
=>
{
if
(
scoTop
>
this
.
scrollTop
){
this
.
data
.
categoryTabFixed
=
true
;
}
else
{
this
.
data
.
categoryTabFixed
=
false
;
}
this
.
setData
({
categoryTabFixed
:
this
.
data
.
categoryTabFixed
});
},
null
,
0
,
scrollTop
);
},
//节流器
throttle
(
fn
,
context
,
delay
,
text
){
clearTimeout
(
fn
.
timeoutId
)
fn
.
timeoutId
=
setTimeout
(
function
()
{
fn
.
call
(
context
,
text
)
},
delay
)
},
//获取元素到顶部的里
getElementTop
(){
wx
.
createSelectorQuery
().
select
(
'.categoryTab'
).
boundingClientRect
(
res
=>
{
if
(
res
){
this
.
scrollTop
=
res
.
top
;
this
.
categoryTabComponent
=
this
.
selectComponent
(
'#categoryTab'
);
}
}).
exec
();
},
//子组件更新成功
loadProductComplete
(
e
){
if
(
e
.
detail
==
'tabChange'
){
let
filterLevel
=
this
.
data
.
pages
.
filter
(
item
=>
item
.
type
==
11
);
if
(
filterLevel
.
length
!=
0
){
let
levelIndex
=
filterLevel
[
0
].
levelIndex
;
this
.
data
.
pages
.
filter
(
item
=>
item
.
levelIndex
>
levelIndex
).
forEach
(
item
=>
{
item
.
pShow
=
false
;
});
this
.
setData
({
pages
:
this
.
data
.
pages
});
}
}
else
{
this
.
data
.
pages
.
forEach
(
item
=>
{
item
.
pShow
=
true
;
});
this
.
setData
({
pages
:
this
.
data
.
pages
})
}
},
/**
* 监听子组件事件
* */
...
...
@@ -255,6 +332,8 @@ wxService.page({
// wx.hideLoading()
})
this
.
handleParaphe
(
products
);
const
render
=
renderPage
.
initPaging
(
filterResult
).
initRenderData
(
products
)
this
.
data
.
render
=
render
const
renderData
=
render
.
next
()
...
...
@@ -286,6 +365,26 @@ wxService.page({
wx
.
hideLoading
();
})
},
//处理段落隐藏和显示
handleParaphe
(
products
){
//把段落增加一个index
products
.
forEach
((
item
,
index
)
=>
{
item
.
levelIndex
=
index
;
item
.
pShow
=
true
;
//默认都显示
});
//查找一下 看看有没有类型是11的
let
filterCategoryTab
=
products
.
filter
(
item
=>
item
.
type
==
11
);
//如果有的话 则把其以下的都隐藏 (目前仅支持一个)
if
(
filterCategoryTab
.
length
!=
0
){
let
levelIndex
=
filterCategoryTab
[
0
].
levelIndex
;
products
.
filter
(
item
=>
item
.
levelIndex
>
levelIndex
).
forEach
(
c
=>
{
c
.
pShow
=
false
;
});
}
},
/**
* 渲染数据(合并之前的数据)
* @param products 数组数据
...
...
src/pages/my/my.json
View file @
12fa9e8d
...
...
@@ -6,6 +6,7 @@
"pic-nav"
:
"/component/picNav/picNav"
,
"bottom"
:
"/component/bottom/bottom"
,
"tab-sort"
:
"/component/tabSort/tabSort"
,
"category-tab"
:
"/component/categoryTab/categoryTab"
,
"announcement"
:
"/component/announcement/announcement"
,
"icon-swiper"
:
"/component/iconSwiper/iconSwiper"
,
"bannerAd"
:
"/component/bannerAd/bannerAd"
,
...
...
src/pages/my/my.wxml
View file @
12fa9e8d
<view class='user-center' style="background: {{pageBackgroundColor == 1? '#eee': '#fff'}};min-height: {{outoHeigth}}px">
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}">
<view wx:if="{{pItem.type == 1
&& pItem.pShow
}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/>
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<view class="" wx:if="{{pItem.type == 2
&& pItem.pShow
}}">
<person-center isVip="{{isVip}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" valueCardNum="{{valueCardNum}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<view class="" wx:if="{{pItem.type == 3
&& pItem.pShow
}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<view class="" wx:if="{{pItem.type == 4
&& pItem.pShow
}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs currHomePageId="{{currHomePageId}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<view class="" wx:if="{{pItem.type == 6
&& pItem.pShow
}}">
<announcement notice="{{pItem.notice}}"/>
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<view class="" wx:if="{{pItem.type == 7
&& pItem.pShow
}}">
<tab-sort currHomePageId="{{currHomePageId}}" category-type="{{pItem.categoryType}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<view class="" wx:if="{{pItem.type == 8
&& pItem.pShow
}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{skuVOList}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<!-- 分类组件 -->
<view class="categoryTab" wx:if="{{pItem.type == 11}}">
<category-tab currHomePageId="{{currHomePageId}}"
categoryTab="{{pItem.categoryTab}}"
categoryTabFixed="{{categoryTabFixed}}" id="categoryTab"
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"
bind:updatePage="updatePage"
bind:loadProductComplete="loadProductComplete"/>
</view>
</block>
</view>
<guide-page-modal show="{{guidePageModalShow}}" />
...
...
src/pages/userCenter/userCenter.js
View file @
12fa9e8d
...
...
@@ -93,14 +93,14 @@ wxService.page({
setTimeout
(()
=>
{
this
.
getElementTop
();
// categoryTab
},
3
00
);
},
5
00
);
},
// 页面滚动到底部
onReachBottom
(){
console
.
log
(
this
.
categoryTabComponent
)
if
(
this
.
categoryTabComponent
){
this
.
categoryTabComponent
.
getTagProducts
(
2
);
this
.
categoryTabComponent
.
getTagProducts
(
'scrollBottom'
);
}
},
...
...
@@ -335,6 +335,7 @@ wxService.page({
this
.
initHomePage
()
},
//初始化首页数据
initHomePage
()
{
wx
.
showLoading
({
title
:
'加载中'
...
...
@@ -380,6 +381,8 @@ wxService.page({
// wx.hideLoading()
})
this
.
handleParaphe
(
products
);
const
render
=
renderPage
.
initPaging
(
filterResult
).
initRenderData
(
products
)
this
.
data
.
render
=
render
const
renderData
=
render
.
next
()
...
...
@@ -417,6 +420,50 @@ wxService.page({
});
})
},
//子组件更新成功
loadProductComplete
(
e
){
if
(
e
.
detail
==
'tabChange'
){
let
filterLevel
=
this
.
data
.
pages
.
filter
(
item
=>
item
.
type
==
11
);
if
(
filterLevel
.
length
!=
0
){
let
levelIndex
=
filterLevel
[
0
].
levelIndex
;
this
.
data
.
pages
.
filter
(
item
=>
item
.
levelIndex
>
levelIndex
).
forEach
(
item
=>
{
item
.
pShow
=
false
;
});
this
.
setData
({
pages
:
this
.
data
.
pages
});
}
}
else
{
this
.
data
.
pages
.
forEach
(
item
=>
{
item
.
pShow
=
true
;
});
this
.
setData
({
pages
:
this
.
data
.
pages
})
}
},
//handleParaphe
//处理段落隐藏和显示
handleParaphe
(
products
){
//把段落增加一个index
products
.
forEach
((
item
,
index
)
=>
{
item
.
levelIndex
=
index
;
item
.
pShow
=
true
;
//默认都显示
});
//查找一下 看看有没有类型是11的
let
filterCategoryTab
=
products
.
filter
(
item
=>
item
.
type
==
11
);
//如果有的话 则把其以下的都隐藏 (目前仅支持一个)
if
(
filterCategoryTab
.
length
!=
0
){
let
levelIndex
=
filterCategoryTab
[
0
].
levelIndex
;
products
.
filter
(
item
=>
item
.
levelIndex
>
levelIndex
).
forEach
(
c
=>
{
c
.
pShow
=
false
;
});
}
},
/**
* 渲染数据(合并之前的数据)
* @param products 数组数据
...
...
@@ -443,19 +490,6 @@ wxService.page({
})
},
// 获取plus购买信息
// getPlusPurchase() {
// wxService.get(`/sale/premium/query`).then(res => {
// if(!res) return false
// const { result, data } = res.data
// if (result == 0) {
// this.setData({
// skuVOList: data
// })
// }
// }).finally(() => {
// })
// },
/**
* 用户点击右上角分享
*/
...
...
src/pages/userCenter/userCenter.wxml
View file @
12fa9e8d
...
...
@@ -3,27 +3,27 @@
<view class='user-center' style="background: {{pageBackgroundColor == 1? '#eee': '#fff'}};min-height: {{outoHeigth}}px">
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<block wx:for="{{pages}}" wx:key="*this" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}">
<view wx:if="{{pItem.type == 1
&& pItem.pShow
}}">
<image-swiper
image-data="{{pItem.rotationchart.images}}"
bind:updatePage="updatePage"
bind:getAuth="_getUserInfo"
currentHasUserInfo="{{currentHasUserInfo}}"/>
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<view class="" wx:if="{{pItem.type == 2
&& pItem.pShow
}}">
<person-center isVip="{{isVip}}" bind:getAuth="_getUserInfo"
currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}"
person-data="{{pItem.customer}}" integral-num="{{integralNum}}"
valueCardNum="{{valueCardNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<view class="" wx:if="{{pItem.type == 3
&& pItem.pShow
}}">
<pic-nav
pic-nav="{{pItem.navigation.images}}"
bind:getAuth="_getUserInfo"
currentHasUserInfo="{{currentHasUserInfo}}"
bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<view class="" wx:if="{{pItem.type == 4
&& pItem.pShow
}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<view class="" wx:if="{{pItem.type == 5}}">
...
...
@@ -31,15 +31,15 @@
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"
tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<view class="" wx:if="{{pItem.type == 6
&& pItem.pShow
}}">
<announcement notice="{{pItem.notice}}"/>
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<view class="" wx:if="{{pItem.type == 7
&& pItem.pShow
}}">
<tab-sort currHomePageId="{{currHomePageId}}" category-type="{{pItem.categoryType}}"
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<view class="" wx:if="{{pItem.type == 8
&& pItem.pShow
}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<view class="" wx:if="{{pItem.type == 9}}">
...
...
@@ -47,12 +47,14 @@
currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<!-- 分类组件 -->
<view class="categoryTab" wx:if="{{pItem.type == 7}}">
<category-tab currHomePageId="{{currHomePageId}}" categoryTab="{{pItem.categoryType}}" categoryTabFixed="{{categoryTabFixed}}"
id="categoryTab"
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
<view class="categoryTab" wx:if="{{pItem.type == 11}}">
<category-tab currHomePageId="{{currHomePageId}}"
categoryTab="{{pItem.categoryTab}}"
categoryTabFixed="{{categoryTabFixed}}" id="categoryTab"
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"
bind:updatePage="updatePage"
bind:loadProductComplete="loadProductComplete"/>
</view>
</block>
</view>
<guide-page-modal show="{{guidePageModalShow}}" />
...
...
src/project.config.json
View file @
12fa9e8d
...
...
@@ -7,6 +7,7 @@
"urlCheck"
:
false
,
"es6"
:
true
,
"postcss"
:
true
,
"preloadBackgroundData"
:
false
,
"minified"
:
true
,
"newFeature"
:
true
,
"coverView"
:
true
,
...
...
@@ -21,13 +22,12 @@
"disablePlugins"
:
[],
"outputPath"
:
""
},
"useCompilerModule"
:
true
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"preloadBackgroundData"
:
false
"useCompilerModule"
:
false
,
"userConfirmedUseCompilerModuleSwitch"
:
false
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.11.0"
,
"appid"
:
"wx
ac09792264c49b5c
"
,
"appid"
:
"wx
c3b64b09b1d3dfc2
"
,
"projectname"
:
"%E5%BE%AE%E5%95%86%E5%9F%8E"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
...
...
@@ -143,7 +143,7 @@
"id"
:
13
,
"name"
:
"subPage"
,
"pathName"
:
"subPackage/page/pages/subPage/subPage"
,
"query"
:
"pageId=7
3
"
,
"query"
:
"pageId=7
2
"
,
"scene"
:
null
},
{
...
...
src/subPackage/page/pages/categoryPro/categoryPro.js
View file @
12fa9e8d
...
...
@@ -18,7 +18,7 @@ wxService.page({
form
:
{
mallCategoryId
:
''
,
sortType
:
''
,
order
:
''
order
:
''
,
},
navTab
:[
{
...
...
@@ -153,7 +153,8 @@ wxService.page({
let
url
=
`/sale/product/mallCategory/listPageProductByMallCategoryIdAndItsSons?pageNo=
${
pageNo
}
&pageSize=
${
pageSize
}
`
;
if
(
this
.
data
.
pageFrom
==
'category'
){
url
=
`/sale/product/buyer/listPageByCategoryId?pageNo=
${
pageNo
}
&pageSize=
${
pageSize
}
`
this
.
data
.
form
.
categoryId
=
this
.
data
.
form
.
mallCategoryId
;
url
=
`/sale/product/buyer/listPageByCategoryId?pageNo=
${
pageNo
}
&pageSize=
${
pageSize
}
`
;
}
wxService
.
post
(
url
,
this
.
data
.
form
).
then
(
res
=>
{
...
...
@@ -230,37 +231,63 @@ wxService.page({
});
let
pageNo
=
this
.
data
.
pageNo
,
pageSize
=
this
.
data
.
pageSize
;
wxService
.
post
(
`/sale/product/listPage?pageSize=
${
pageSize
}
&pageNo=
${
pageNo
}
`
,{
productName
:
""
,
showStockData
:
true
,
categoryIds
:
[],
productTagIds
:
[
this
.
data
.
tagId
],
productStatus
:
2
,
showListUrls
:
true
,
}).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
&&
data
.
content
)
{
wx
.
hideLoading
();
this
.
data
.
proData
=
this
.
data
.
pageNo
==
1
?
[...
data
.
content
]
:
[...
this
.
data
.
proData
,
...
data
.
content
];
this
.
data
.
proData
.
forEach
(
item
=>
{
item
.
indexUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
});
this
.
setData
({
proData
:
this
.
data
.
proData
,
totalPages
:
data
.
totalPages
,
totalElements
:
data
.
totalElements
})
this
.
data
.
form
.
state
=
1
;
if
(
this
.
data
.
form
.
sortType
==
'recommend'
){
this
.
data
.
form
.
order
=
'desc'
;
}
if
(
refresh
){
wx
.
showToast
({
title
:
'数据已刷新'
,
});
wx
.
stopPullDownRefresh
();
}
}).
finally
(()
=>
{
wx
.
hideLoading
()
})
this
.
data
.
form
.
tagId
=
this
.
data
.
tagId
;
this
.
data
.
form
.
categoryId
=
null
;
this
.
data
.
form
.
mallCategoryId
=
null
;
wxService
.
post
(
`/sale/product/buyer/listPageByTagId?pageSize=
${
pageSize
}
&pageNo=
${
pageNo
}
`
,
this
.
data
.
form
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
&&
data
.
content
)
{
wx
.
hideLoading
();
this
.
data
.
proData
=
this
.
data
.
pageNo
==
1
?
[...
data
.
content
]
:
[...
this
.
data
.
proData
,
...
data
.
content
];
this
.
data
.
proData
.
forEach
(
item
=>
{
//营销标签类型 1固定样式 2左下角显示商品当前金额 3左下角显示指定数额
item
.
indexUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultImg
;
//处理商品身上的营销标签数据
item
.
hasPromotionTag
=
item
.
markTagInfo
?
true
:
false
;
let
tagPrice
=
item
.
minSalePrice
;
if
(
item
.
hasPromotionTag
){
item
.
tagPic
=
item
.
markTagInfo
.
tagPicUrl
;
if
(
item
.
markTagInfo
.
tagType
==
2
){
tagPrice
=
item
.
minSalePrice
;
}
else
{
tagPrice
=
item
.
markTagInfo
.
assignPrice
;
}
item
.
tagType
=
item
.
markTagInfo
.
tagType
;
}
//判断价格是否大于1000了
if
(
tagPrice
/
100
>
1000
){
tagPrice
=
parseFloat
(
tagPrice
/
10
/
10
).
toFixed
(
1
);
}
else
{
tagPrice
=
parseFloat
(
tagPrice
/
10
/
10
).
toFixed
(
2
);
}
item
.
tagPrice
=
tagPrice
;
});
this
.
setData
({
proData
:
this
.
data
.
proData
,
totalPages
:
data
.
totalPages
,
totalElements
:
data
.
totalElements
});
}
if
(
refresh
){
wx
.
showToast
({
title
:
'数据已刷新'
,
});
wx
.
stopPullDownRefresh
();
}
}).
finally
(()
=>
{
wx
.
hideLoading
()
})
},
// 切换列表样式
...
...
src/subPackage/page/pages/subPage/subPage.js
View file @
12fa9e8d
...
...
@@ -35,6 +35,7 @@ wxService.page({
skuVOList
:[],
//显示广告
pageInfo
:
null
,
categoryTabFixed
:
false
,
},
/**
* 生命周期函数--监听页面加载
...
...
@@ -65,7 +66,11 @@ wxService.page({
pageId
:
this
.
data
.
pageId
});
this
.
initPage
(
this
.
data
.
pageId
)
this
.
initPage
(
this
.
data
.
pageId
);
setTimeout
(()
=>
{
this
.
getElementTop
();
// categoryTab
},
500
);
}
else
{
let
pageId
=
shareId
;
...
...
@@ -82,6 +87,8 @@ wxService.page({
});
this
.
initPage
(
this
.
data
.
pageId
);
}
//判断是否带m 触点
let
memberId
=
options
.
memberId
;
...
...
@@ -96,8 +103,78 @@ wxService.page({
this
.
generatePointObject
(
tentacleInfo
);
}
},
// 页面滚动到底部
onReachBottom
(){
if
(
this
.
categoryTabComponent
){
this
.
categoryTabComponent
.
getTagProducts
(
'scrollBottom'
);
}
},
//页面滚动
onPageScroll
(
e
){
if
(
!
this
.
scrollTop
){
return
;
}
let
scrollTop
=
e
.
scrollTop
;
this
.
throttle
(
scoTop
=>
{
if
(
scoTop
>
this
.
scrollTop
){
this
.
data
.
categoryTabFixed
=
true
;
}
else
{
this
.
data
.
categoryTabFixed
=
false
;
}
this
.
setData
({
categoryTabFixed
:
this
.
data
.
categoryTabFixed
});
},
null
,
0
,
scrollTop
);
},
//节流器
throttle
(
fn
,
context
,
delay
,
text
){
clearTimeout
(
fn
.
timeoutId
)
fn
.
timeoutId
=
setTimeout
(
function
()
{
fn
.
call
(
context
,
text
)
},
delay
)
},
//获取元素到顶部的里
getElementTop
(){
wx
.
createSelectorQuery
().
select
(
'.categoryTab'
).
boundingClientRect
(
res
=>
{
if
(
res
){
this
.
scrollTop
=
res
.
top
;
this
.
categoryTabComponent
=
this
.
selectComponent
(
'#categoryTab'
);
}
}).
exec
();
},
//子组件更新成功
loadProductComplete
(
e
){
if
(
e
.
detail
==
'tabChange'
){
let
filterLevel
=
this
.
data
.
pages
.
filter
(
item
=>
item
.
type
==
11
);
if
(
filterLevel
.
length
!=
0
){
let
levelIndex
=
filterLevel
[
0
].
levelIndex
;
this
.
data
.
pages
.
filter
(
item
=>
item
.
levelIndex
>
levelIndex
).
forEach
(
item
=>
{
item
.
pShow
=
false
;
});
this
.
setData
({
pages
:
this
.
data
.
pages
});
}
}
else
{
this
.
data
.
pages
.
forEach
(
item
=>
{
item
.
pShow
=
true
;
});
this
.
setData
({
pages
:
this
.
data
.
pages
})
}
},
/**
* 监听子组件事件
* */
...
...
@@ -268,6 +345,8 @@ wxService.page({
}).
filter
(
item
=>
{
// wx.hideLoading()
})
this
.
handleParaphe
(
products
);
const
render
=
renderPage
.
initPaging
(
filterResult
).
initRenderData
(
products
)
this
.
data
.
render
=
render
...
...
@@ -278,7 +357,7 @@ wxService.page({
//是否有tabbar 或 plus
let
tabbar
=
products
.
filter
(
item
=>
item
.
type
==
5
);
let
plus
=
products
.
filter
(
item
=>
item
.
type
==
9
);
if
(
plus
.
length
!=
0
)
{
this
.
setData
({
paddingBottom
:
'96rpx'
,
...
...
@@ -296,13 +375,29 @@ wxService.page({
paddingBottom
:
'0rpx'
})
}
}
}).
finally
(()
=>
{
wx
.
hideLoading
();
})
},
//处理段落隐藏和显示
handleParaphe
(
products
){
//把段落增加一个index
products
.
forEach
((
item
,
index
)
=>
{
item
.
levelIndex
=
index
;
item
.
pShow
=
true
;
//默认都显示
});
//查找一下 看看有没有类型是11的
let
filterCategoryTab
=
products
.
filter
(
item
=>
item
.
type
==
11
);
//如果有的话 则把其以下的都隐藏 (目前仅支持一个)
if
(
filterCategoryTab
.
length
!=
0
){
let
levelIndex
=
filterCategoryTab
[
0
].
levelIndex
;
products
.
filter
(
item
=>
item
.
levelIndex
>
levelIndex
).
forEach
(
c
=>
{
c
.
pShow
=
false
;
});
}
},
/**
* 渲染数据(合并之前的数据)
* @param products 数组数据
...
...
src/subPackage/page/pages/subPage/subPage.json
View file @
12fa9e8d
...
...
@@ -7,6 +7,7 @@
"bottom"
:
"/component/bottom/bottom"
,
"go-guid"
:
"/component/goGuid/goGuid"
,
"tab-sort"
:
"/component/tabSort/tabSort"
,
"category-tab"
:
"/component/categoryTab/categoryTab"
,
"announcement"
:
"/component/announcement/announcement"
,
"icon-swiper"
:
"/component/iconSwiper/iconSwiper"
,
"bannerAd"
:
"/component/bannerAd/bannerAd"
,
...
...
src/subPackage/page/pages/subPage/subPage.wxml
View file @
12fa9e8d
...
...
@@ -3,33 +3,42 @@
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<!-- {{pages}} -->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}">
<view wx:if="{{pItem.type == 1
&& pItem.pShow
}}">
<image-swiper image-data="{{pItem.rotationchart.images}}" bind:updatePage="updatePage" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"/>
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<view class="" wx:if="{{pItem.type == 2
&& pItem.pShow
}}">
<person-center bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" base-user-info="{{baseUserInfo}}" person-data="{{pItem.customer}}" valueCardNum="{{valueCardNum}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<view class="" wx:if="{{pItem.type == 3
&& pItem.pShow
}}">
<pic-nav pic-nav="{{pItem.navigation.images}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<view class="" wx:if="{{pItem.type == 4
&& pItem.pShow
}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs currHomePageId="{{currHomePageId}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<view class="" wx:if="{{pItem.type == 6
&& pItem.pShow
}}">
<announcement notice="{{pItem.notice}}"/>
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<view class="" wx:if="{{pItem.type == 7
&& pItem.pShow
}}">
<tab-sort currHomePageId="{{currHomePageId}}" category-type="{{pItem.categoryType}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<view class="" wx:if="{{pItem.type == 8
&& pItem.pShow
}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{skuVOList}}" plus-bgi="{{pItem.plus}}" currentHasUserInfo="{{currentHasUserInfo}}" bind:updatePage="updatePage"/>
</view>
<!-- 分类组件 -->
<view class="categoryTab" wx:if="{{pItem.type == 11}}">
<category-tab currHomePageId="{{currHomePageId}}"
categoryTab="{{pItem.categoryTab}}"
categoryTabFixed="{{categoryTabFixed}}" id="categoryTab"
bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}"
bind:updatePage="updatePage"
bind:loadProductComplete="loadProductComplete"/>
</view>
</block>
</view>
<guide-page-modal show="{{guidePageModalShow}}" />
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment