Commit 09e79fbf by 匡雅琴

省钱接口联调

1 parent 3a557c27
Component({
data: {},
properties: {},
methods: {}
properties: {
list: {
type: Array,
value: []
}
},
methods: {
selectStrategy(e) {
console.log(e);
const {id} = e.currentTarget.dataset
this.triggerEvent('selectStrategy', {id})
}
}
})
\ No newline at end of file
......@@ -4,13 +4,13 @@
<view class="text">省钱攻略</view>
</view>
<view class="img-box">
<view class="img-item-box">
<glsx-image webp src="home/saving_1.png" class="saving-img"></glsx-image>
<view class="viewer">9520人浏览</view>
<view wx:for="{{list}}" wx:key="index" class="img-item-box" data-id="{{item.id}}" bind:tap="selectStrategy">
<image webp src="{{item.strategyImg}}" class="saving-img"></image>
<view class="viewer">{{item.viewAmount}}人浏览</view>
</view>
<view class="img-item-box">
<!-- <view class="img-item-box">
<glsx-image webp src="home/saving_2.png" class="saving-img"></glsx-image>
<view class="viewer">9520人浏览</view>
</view>
</view> -->
</view>
</view>
\ No newline at end of file
......@@ -4,6 +4,7 @@ Page({
},
onLoad(options) {
console.log(options);
this.getStrategyDetail(options.id);
},
getStrategyDetail(id) {
......
{}
\ No newline at end of file
{
"usingComponents": {
"mp-html": "../../../components/mp-html/index"
}
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
<view class="strategy-detail-title">{{strategyDetailObj.strategyName}}</view>
<view class="strategy-detail-view">{{strategyDetailObj.viewAmount}}人浏览</view>
<image webp src="{{item.strategyImg}}" class="strategy-img"></image>
<view class="">{{strategyDetailObj.content}}</view>
<mp-html content="{{strategyDetailObj.content}}"></mp-html>
</view>
\ No newline at end of file
const navStyle = "background-color: transparent;";
Page({
data: {
navStyle,
noticeContent: true,
noticeContent: '卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡',
bannerList: [{
bannerImg: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/home/banner_test.png'
}],
codeList: [{
title: '官方',
desc: '福利群',
tip: '优惠资讯,先人一步',
url: 'fuliq'
}, {
title: '专属',
desc: '福利官',
tip: '超多福利,不容错过',
url: 'fulig'
}],
showModal:false,
urlName:''
noticeContent:
"卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡",
bannerList: [
{
bannerImg:
"https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/home/banner_test.png",
},
],
codeList: [
{
title: "官方",
desc: "福利群",
tip: "优惠资讯,先人一步",
url: "fuliq",
},
{
title: "专属",
desc: "福利官",
tip: "超多福利,不容错过",
url: "fulig",
},
],
showModal: false,
urlName: "",
strategyList: [],
},
navbarReady(e) {
let {
height
} = e.detail;
let { height } = e.detail;
this.setData({
navBarHeight: height,
user_box_style: `padding-top:${height + 20}px`
})
user_box_style: `padding-top:${height + 20}px`,
});
},
// 处理滚动事件
onPageScroll(e) {
const { navBarHeight } = this.data
const { navBarHeight } = this.data;
this.setData({
navStyle: e.scrollTop >= navBarHeight-50 ? '' : navStyle,
navStyle: e.scrollTop >= navBarHeight - 50 ? "" : navStyle,
});
},
onLoad() {
this.getStrategyList();
},
// 获取省钱攻略
getStrategyList() {
wx.p.api.strategyApi
.getStrategyList({
pageNum: 1,
pageSize: 100,
mainFlag: 1,
})
.then((res) => {
console.log(res);
this.setData({
strategyList: res.list,
});
});
},
onLoad(options) {
selectStrategy(e) {
const { id } = e.detail;
wx.p.router.go("/packageStrategy/pages/strategyDetail/index", {
id,
});
},
toShowQrCode(e){
const {url} = e.currentTarget.dataset
toShowQrCode(e) {
const { url } = e.currentTarget.dataset;
this.setData({
urlName:url,
showModal:true
})
urlName: url,
showModal: true,
});
},
closeModal(){
closeModal() {
this.setData({
showModal:false,
urlName:''
})
showModal: false,
urlName: "",
});
},
})
\ No newline at end of file
});
......@@ -44,7 +44,7 @@
</block>
</view>
<!-- 省钱攻略 -->
<MoneySavingTips></MoneySavingTips>
<MoneySavingTips list="{{strategyList}}" bind:selectStrategy="selectStrategy"></MoneySavingTips>
</view>
<!-- 弹框 -->
<view wx:if="{{showModal}}" class="modal_widget">
......
......@@ -19,8 +19,8 @@
color: #333333;
}
&-bottom {
display: flex;
justify-content: space-between;
// display: flex;
// justify-content: space-between;
margin-top: 14rpx;
.tag {
width: 128rpx;
......@@ -36,7 +36,7 @@
font-weight: 400;
font-size: 24rpx;
color: #999999;
text-align: right;
// text-align: right;
line-height: 36rpx;
}
}
......
......@@ -4,7 +4,7 @@
<view class="strategy-detail">
<text class="strategy-detail-title">{{item.strategyName}}</text>
<view class="strategy-detail-bottom">
<view class="tag">{{item.tagName}}</view>
<!-- <view class="tag">{{item.tagName}}</view> -->
<view class="viewer">{{item.viewAmount}}人浏览</view>
</view>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!