Commit babd881b by 匡雅琴

页面细节添加

1 parent 09e79fbf
...@@ -7,14 +7,30 @@ Page({ ...@@ -7,14 +7,30 @@ Page({
*/ */
data: { data: {
recreationMenu, recreationMenu,
foodMenu foodMenu,
strategyList: []
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad() {
this.getStrategyList();
},
// 获取省钱攻略
getStrategyList() {
wx.p.api.strategyApi
.getStrategyList({
pageNum: 1,
pageSize: 100
})
.then((res) => {
console.log(res);
this.setData({
strategyList: res.list,
});
});
}, },
/** /**
......
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
</view> </view>
<menu-box menuList="{{foodMenu}}"></menu-box> <menu-box menuList="{{foodMenu}}"></menu-box>
</view> </view>
<money-saving-tips></money-saving-tips>
\ No newline at end of file \ No newline at end of file
<money-saving-tips list="{{strategyList}}"></money-saving-tips>
\ No newline at end of file \ No newline at end of file
import {foodMenuList,funMenuList,carMenuList} from './constant/constant' import {
Page({
data: {
foodMenuList, foodMenuList,
funMenuList, funMenuList,
carMenuList carMenuList
}, } from './constant/constant'
Page({
data: {
foodMenuList,
funMenuList,
carMenuList,
commodityList: [],
pageParam: {
appearance: 1,
pageSize: 0,
pageCount: 10
},
loadingMore: false,
loadOver: false,
},
properties: {}, properties: {},
...@@ -15,7 +29,80 @@ data: { ...@@ -15,7 +29,80 @@ data: {
}, },
onShow() { onShow() {
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
user_box_style: `padding-top:${height + 20}px`
})
}, },
// 获取附近优惠数据
toGetCommodity(lat, lng, page) {
let {
pageParam,
loadingMore,
commodityList,
loadOver
} = this.data
let para = {
lat,
lng,
...pageParam
}
if (loadOver) {
return
}
if (page) {
para.pageSize = 0
}
equityApi.lasteCommodity(para).then(res => {
if (!res) {
this.setData({
loadOver: true
})
return
}
let tempArr = []
res.forEach(item => {
if (item.couponsGoodsList) {
tempArr.push(item)
}
})
if (loadingMore) {
commodityList = commodityList.concat(tempArr)
}
this.setData({
commodityList: loadingMore ? commodityList : tempArr,
loadingMore: false,
loadOver: false
})
})
},
onReachBottom() {
if (this.data.unauthorized) {
return
}
if (!this.data.commodityList.length) {
return
}
let { pageParam } = this.data
pageParam.pageSize++
this.setData(
{
pageParam,
loadingMore: true
},
() => {
let { currentAddress } = this.data
const { lat, lng } = currentAddress.location
this.toGetCommodity(lat, lng)
}
)
},
}) })
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"onReachBottomDistance": 10, "onReachBottomDistance": 10,
"usingComponents": { "usingComponents": {
"main-title": "../../../components/MainTitle/MainTitle", "main-title": "../../../components/MainTitle/MainTitle",
"menu-box": "./components/MenuBox/MenuBox" "menu-box": "./components/MenuBox/MenuBox",
"gl-icon": "glsx-applet-component/GLIcon/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,29 +8,69 @@ ...@@ -8,29 +8,69 @@
.save-money-box { .save-money-box {
padding-top: 84px; padding-top: 84px;
.save-money-box-content { .save-money-box-content {
padding: 30rpx; padding: 30rpx;
background: #f8f8f8; background: #f8f8f8;
} }
.save-money-img { .save-money-img {
width: 690rpx; width: 690rpx;
height: 268rpx; height: 268rpx;
} }
.save-money-order-box {
position: relative;
}
.save-money-order-img { .save-money-order-img {
width: 690rpx; width: 690rpx;
height: 432rpx; height: 432rpx;
margin-top: 6rpx;
}
.save-money-order-text-box {
position: absolute;
top: 48rpx;
right: 22rpx;
width: 152rpx;
height: 68rpx;
background: #FCE9CB;
border: 1rpx solid #6B2A0B;
border-radius: 34rpx;
font-weight: 400;
font-size: 30rpx;
color: #6B2A0B;
text-align: center;
line-height: 68rpx;
} }
.title-box { .title-box {
margin: 30rpx 0 20rpx 0; margin: 30rpx 0 20rpx 0;
.near-title { .near-title {
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
color: #333333; color: #333333;
} }
.near-subTitle { .near-subTitle {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
.more-text {
display: flex;
font-weight: 400;
font-size: 22rpx;
color: #666666;
align-items: flex-end;
}
} }
} }
.flex {
display: flex;
justify-content: space-between;
}
\ No newline at end of file \ No newline at end of file
<view class="navigation-bar"> <view class="navigation-bar">
<navigation-bar bindnavbarReady="navbarReady" page-title="省钱专区">省钱专区</navigation-bar> <navigation-bar bindnavbarReady="navbarReady" page-title="省钱专区">省钱专区</navigation-bar>
</view> </view>
<view class="save-money-box"> <view class="save-money-box">
<view class="save-money-box-content" hover-class="none" hover-stop-propagation="false"> <view class="save-money-box-content" hover-class="none" hover-stop-propagation="false">
<glsx-image webp src="home/homelife_bg.png" class="save-money-img"></glsx-image> <glsx-image webp src="home/homelife_bg.png" class="save-money-img"></glsx-image>
<glsx-image webp src="savemoney/save_order.png" class="save-money-order-img"></glsx-image> <view class="save-money-order-box">
<view class="title-box"> <glsx-image webp src="savemoney/save_order.png" class="save-money-order-img"></glsx-image>
<main-title title="吃喝省"></main-title> <view class="save-money-order-text-box">去下单</view>
</view>
<menu-box menuList="{{foodMenuList}}"></menu-box>
<view class="title-box">
<main-title title="娱乐省"></main-title>
</view>
<menu-box menuList="{{funMenuList}}"></menu-box>
<view class="title-box">
<main-title title="用车省"></main-title>
</view>
<menu-box menuList="{{carMenuList}}"></menu-box>
<view class="title-box">
<view class="near-title">附近优惠</view>
<view class="near-subTitle">为您精选附近热销商品</view>
</view>
</view> </view>
<view class="title-box flex">
<main-title title="吃喝省"></main-title>
<view class="more-text">更多 <gl-icon iconName="{{'gl-icon-the-arrow'}}" fontSize="26" color="#666666"></gl-icon></view>
</view>
<menu-box menuList="{{foodMenuList}}"></menu-box>
<view class="title-box flex">
<main-title title="娱乐省"></main-title>
<view class="more-text">更多 <gl-icon iconName="{{'gl-icon-the-arrow'}}" fontSize="26" color="#666666"></gl-icon></view>
</view>
<menu-box menuList="{{funMenuList}}"></menu-box>
<view class="title-box flex">
<main-title title="用车省"></main-title>
<view class="more-text">更多 <gl-icon iconName="{{'gl-icon-the-arrow'}}" fontSize="26" color="#666666"></gl-icon></view>
</view>
<menu-box menuList="{{carMenuList}}"></menu-box>
<view class="title-box">
<view class="near-title">附近优惠</view>
<view class="near-subTitle">为您精选附近热销商品</view>
<view wx:if="{{commodityList.length}}" class="commodity_list_widget">
<block wx:for="{{commodityList}}" wx:key="index">
<commodityItem address="{{currentAddress}}" businessInfo="{{item}}" />
</block>
</view>
<view wx:if="{{unauthorized}}" class="reLocation_wrap flex_cc">
<image webp class="loca_icon" webp src="{{IMGURL}}equity/location_icon.png?v={{img_version}}" />
<view bind:tap="relocation" class="loca_text">定位一下,发现附近优惠</view>
</view>
<view style="height:400rpx"></view>
</view>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -83,4 +83,10 @@ Page({ ...@@ -83,4 +83,10 @@ Page({
urlName: "", urlName: "",
}); });
}, },
toHomeLife() {
wx.p.router.go("/packageIndex/pages/homeLife/index");
},
toCarLife() {
wx.p.router.go("/packageIndex/pages/carLife/index");
},
}); });
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
</block> </block>
<!-- 家生活/车生活 --> <!-- 家生活/车生活 -->
<view class="menu_wrap flex_scb"> <view class="menu_wrap flex_scb">
<glsx-image class="cover" webp src="home/family_menu_banner.png"></glsx-image> <glsx-image class="cover" webp src="home/family_menu_banner.png" bind:tap="toHomeLife"></glsx-image>
<glsx-image class="cover" webp src="home/car_menu_banner.png"></glsx-image> <glsx-image class="cover" webp src="home/car_menu_banner.png" bind:tap="toCarLife"></glsx-image>
</view> </view>
<!-- 轮播图 --> <!-- 轮播图 -->
<view class="banner-box" wx:if="{{bannerList.length > 0}}"> <view class="banner-box" wx:if="{{bannerList.length > 0}}">
......
...@@ -14,6 +14,16 @@ Page({ ...@@ -14,6 +14,16 @@ Page({
onLoad(options) { onLoad(options) {
this.getStrategyList(); this.getStrategyList();
}, },
navbarReady(e) {
let {
height
} = e.detail
this.setData({
user_box_style: `padding-top:${height + 20}px`
})
},
getStrategyList() { getStrategyList() {
wx.p.api.strategyApi.getStrategyList({ wx.p.api.strategyApi.getStrategyList({
pageNum: 1, pageNum: 1,
......
{ {
"navigationStyle": "custom",
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/select/index.wxss */ /* pages/tab/select/index.wxss */
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
background: #ffffff;
}
.strategy-box { .strategy-box {
padding: 30rpx; padding: 30rpx;
background: #F8F8F8; background: #F8F8F8;
......
<view class="strategy-box"> <view class="navigation-bar">
<navigation-bar bindnavbarReady="navbarReady" page-title="攻略专区">攻略专区</navigation-bar>
</view>
<view class="strategy-box" style="{{user_box_style}}">
<view class="strategy-item" wx:for="{{strategyList}}" wx:key="index" data-item="{{item}}" bind:tap="selectStrategy"> <view class="strategy-item" wx:for="{{strategyList}}" wx:key="index" data-item="{{item}}" bind:tap="selectStrategy">
<image webp src="{{item.strategyImg}}" class="strategy-img"></image> <image webp src="{{item.strategyImg}}" class="strategy-img"></image>
<view class="strategy-detail"> <view class="strategy-detail">
<text class="strategy-detail-title">{{item.strategyName}}</text> <text class="strategy-detail-title">{{item.strategyName}}</text>
<view class="strategy-detail-bottom"> <view class="strategy-detail-bottom">
<!-- <view class="tag">{{item.tagName}}</view> -->
<view class="viewer">{{item.viewAmount}}人浏览</view> <view class="viewer">{{item.viewAmount}}人浏览</view>
</view> </view>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!