This commit is contained in:
张慢慢
2021-05-24 13:56:00 +08:00
commit a7995d90bc
208 changed files with 13143 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
/*
* 本时生活
*/
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
isUser : false, //用户登录状态
indexArr : '', //商品列表
page : '', //下一页
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
if(app.globalData.isUser){
this.setData({
isUser: app.globalData.isUser
})
}
wx.$api.index.redwine().then(res=>{
this.setData({
indexArr : res.data.data,
page : res.data.page
})
})
},
/**
* 处理未登录时的转跳
*/
userNav(e){
let pageUrl = e.currentTarget.dataset.url
if(this.data.isUser){
wx.navigateTo({
url: pageUrl
})
}else{
// 去登录
wx.navigateTo({
url: "/pages/login/login?way=activity"
})
}
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "产品活动"
}

View File

@@ -0,0 +1,7 @@
<!-- 商品活动列表 -->
<view class="activityTitle">
<image src="/static/icon/activity_icon.png"></image>商品列表
</view>
<view class="activityList" bindtap="userNav" data-url="/pages/activityInfo/activityInfo?id={{item.id}}" wx:for="{{indexArr}}" wx:key="indexArr">
<image src="{{item.cover_path}}" mode="scaleToFill"></image>
</view>

View File

@@ -0,0 +1,36 @@
/* 活动列表 */
.activityTitle {
background: #000;
color: #fff;
border-radius: 40rpx 14rpx 14rpx 40rpx;
margin: 20rpx 24rpx 0;
padding: 10rpx;
width: 190rpx;
box-sizing: border-box;
display: flex;
font-size: 28rpx;
}
.activityTitle image {
width: 40rpx;
height: 40rpx;
margin-right: 5rpx;
}
.activityList {
width: calc(100% - 40rpx);
margin: 30rpx 20rpx;
box-sizing: border-box;
position: relative;
padding-top: 40%;
}
/* 5:2 */
.activityList image {
border-radius: 10rpx;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}