Commit 09e79fbf by 匡雅琴

省钱接口联调

1 parent 3a557c27
Component({ Component({
data: {}, data: {},
properties: {}, properties: {
methods: {} 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 \ No newline at end of file
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<view class="text">省钱攻略</view> <view class="text">省钱攻略</view>
</view> </view>
<view class="img-box"> <view class="img-box">
<view class="img-item-box"> <view wx:for="{{list}}" wx:key="index" class="img-item-box" data-id="{{item.id}}" bind:tap="selectStrategy">
<glsx-image webp src="home/saving_1.png" class="saving-img"></glsx-image> <image webp src="{{item.strategyImg}}" class="saving-img"></image>
<view class="viewer">9520人浏览</view> <view class="viewer">{{item.viewAmount}}人浏览</view>
</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> <glsx-image webp src="home/saving_2.png" class="saving-img"></glsx-image>
<view class="viewer">9520人浏览</view> <view class="viewer">9520人浏览</view>
</view> </view> -->
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,7 @@ Page({ ...@@ -4,6 +4,7 @@ Page({
}, },
onLoad(options) { onLoad(options) {
console.log(options);
this.getStrategyDetail(options.id); this.getStrategyDetail(options.id);
}, },
getStrategyDetail(id) { getStrategyDetail(id) {
......
{}
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"mp-html": "../../../components/mp-html/index"
}
}
\ No newline at end of file \ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
<view class="strategy-detail-title">{{strategyDetailObj.strategyName}}</view> <view class="strategy-detail-title">{{strategyDetailObj.strategyName}}</view>
<view class="strategy-detail-view">{{strategyDetailObj.viewAmount}}人浏览</view> <view class="strategy-detail-view">{{strategyDetailObj.viewAmount}}人浏览</view>
<image webp src="{{item.strategyImg}}" class="strategy-img"></image> <image webp src="{{item.strategyImg}}" class="strategy-img"></image>
<view class="">{{strategyDetailObj.content}}</view> <mp-html content="{{strategyDetailObj.content}}"></mp-html>
</view> </view>
\ No newline at end of file \ No newline at end of file
const navStyle = "background-color: transparent;"; const navStyle = "background-color: transparent;";
Page({ Page({
data: { data: {
navStyle, navStyle,
noticeContent: true, noticeContent: true,
noticeContent: '卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡', noticeContent:
bannerList: [{ "卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡卡",
bannerImg: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/home/banner_test.png' bannerList: [
}], {
codeList: [{ bannerImg:
title: '官方', "https://img02.glsx.com.cn/weapp/resource/miniprogram/wuye/home/banner_test.png",
desc: '福利群', },
tip: '优惠资讯,先人一步', ],
url: 'fuliq' codeList: [
}, { {
title: '专属', title: "官方",
desc: '福利官', desc: "福利群",
tip: '超多福利,不容错过', tip: "优惠资讯,先人一步",
url: 'fulig' url: "fuliq",
}], },
showModal:false, {
urlName:'' title: "专属",
desc: "福利官",
tip: "超多福利,不容错过",
url: "fulig",
},
],
showModal: false,
urlName: "",
strategyList: [],
}, },
navbarReady(e) { navbarReady(e) {
let { let { height } = e.detail;
height
} = e.detail;
this.setData({ this.setData({
navBarHeight: height, navBarHeight: height,
user_box_style: `padding-top:${height + 20}px` user_box_style: `padding-top:${height + 20}px`,
}) });
}, },
// 处理滚动事件 // 处理滚动事件
onPageScroll(e) { onPageScroll(e) {
const { navBarHeight } = this.data const { navBarHeight } = this.data;
this.setData({ 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({ this.setData({
urlName:url, urlName: url,
showModal:true showModal: true,
}) });
}, },
closeModal(){ closeModal() {
this.setData({ this.setData({
showModal:false, showModal: false,
urlName:'' urlName: "",
}) });
}, },
})
\ No newline at end of file \ No newline at end of file
});
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</block> </block>
</view> </view>
<!-- 省钱攻略 --> <!-- 省钱攻略 -->
<MoneySavingTips></MoneySavingTips> <MoneySavingTips list="{{strategyList}}" bind:selectStrategy="selectStrategy"></MoneySavingTips>
</view> </view>
<!-- 弹框 --> <!-- 弹框 -->
<view wx:if="{{showModal}}" class="modal_widget"> <view wx:if="{{showModal}}" class="modal_widget">
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
color: #333333; color: #333333;
} }
&-bottom { &-bottom {
display: flex; // display: flex;
justify-content: space-between; // justify-content: space-between;
margin-top: 14rpx; margin-top: 14rpx;
.tag { .tag {
width: 128rpx; width: 128rpx;
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
text-align: right; // text-align: right;
line-height: 36rpx; line-height: 36rpx;
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<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="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!