Commit 63695f4f by 匡雅琴

攻略专区静态页开发

1 parent c9510e86
project.private.config.json
project.config.json
miniprogram_npm
node_modules
......@@ -4,7 +4,7 @@
"pages/tab/equity/index",
"pages/tab/mall/index",
"pages/tab/mine/index",
"pages/tab/select/index",
"pages/tab/strategy/index",
"pages/webView/webView",
"pages/Login/Login"
],
......@@ -41,7 +41,7 @@
"selectedIconPath": "assets/images/strategy_active.png"
},
{
"pagePath": "pages/tab/select/index",
"pagePath": "pages/tab/strategy/index",
"text": "攻略",
"iconPath": "assets/images/select.png",
"selectedIconPath": "assets/images/select_active.png"
......
/* pages/tab/select/index.wxss */
\ No newline at end of file
<!--pages/tab/select/index.wxml-->
<text>pages/tab/select/index.wxml</text>
const strategyList = [
{
url: '1.png',
name: '4A级景点门票特惠,等你来!',
tagName: '游玩攻略',
viewer: 100000
},
{
url: '1.png',
name: '营养美食,开启健康生活的首选!',
tagName: '美食特惠',
viewer: 9600
},
{
url: '1.png',
name: '最新院线佳片,精彩不断!',
tagName: '观影娱乐',
viewer: 9600
}
]
export {
strategyList
}
\ No newline at end of file
// pages/tab/select/index.js
import { strategyList } from './constant/constant'
Page({
/**
* 页面的初始数据
*/
data: {
strategyList
},
/**
......
/* pages/tab/select/index.wxss */
.strategy-box {
padding: 30rpx;
.strategy-item {
width: 690rpx;
background: #FFFFFF;
border-radius: 8rpx;
margin-bottom: 30rpx;
.strategy-img {
height: 388rpx;
}
.strategy-detail {
height: 140rpx;
padding: 20rpx;
&-title {
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
&-bottom {
display: flex;
justify-content: space-between;
margin-top: 14rpx;
.tag {
width: 128rpx;
height: 36rpx;
background: #3772ec;
font-size: 24rpx;
color: #ffffff;
line-height: 36rpx;
text-align: center;
}
.viewer {
font-weight: 400;
font-size: 24rpx;
color: #999999;
text-align: right;
line-height: 36rpx;
}
}
}
}
}
<view class="strategy-box">
<view class="strategy-item" wx:for="{{strategyList}}" wx:key="index" data-item="{{item}}" bind:tap="selectStrategy">
<glsx-image webp src="strategy/{{item.url}}" class="strategy-img"></glsx-image>
<view class="strategy-detail">
<text class="strategy-detail-title">
{{item.name}}
</text>
<view class="strategy-detail-bottom">
<view class="tag">
{{item.tagName}}
</view>
<view class="viewer">
{{item.viewer}}人浏览
</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!