Commit fb0e65ea authored by 俞嘉婷's avatar 俞嘉婷

feat: 活动详情长图

parent 3a6e0bfa
......@@ -3,7 +3,8 @@
"pages/index/index",
"pages/logs/logs",
"pages/my/my",
"pages/activity/activity"
"pages/activity/activity",
"pages/activityDetail/activityDetail"
],
"window": {
"navigationBarTextStyle": "black",
......
// pages/activity/activity.ts
import { ComponentWithStore } from "mobx-miniprogram-bindings";
import { store } from "../../store/store";
import { _asyncThrottle } from "../../utils/util";
ComponentWithStore({
storeBindings: {
......@@ -15,31 +16,18 @@ ComponentWithStore({
* 页面的初始数据
*/
data: {
banner: [
"https://yun.duiba.com.cn/polaris/%E5%9B%BE%E5%B1%82%20541.3c7ff6d4bed9f88be00c52551b05b54d94d1fd95.png",
"//yun.duiba.com.cn/polaris/%E5%96%9D%E9%B2%9C%E5%A5%B6.5815326bdfc25045c0a8ee71beb10c13b0147acd.png",
"//yun.duiba.com.cn/polaris/%E9%B2%9C%E7%89%9B%E5%A5%B6.fd352be87520d04261ba36348022c36836e4c819.png"
],
prodList: [
{
img: "//yun.duiba.com.cn/polaris/%E5%96%9D%E9%B2%9C%E5%A5%B6.5815326bdfc25045c0a8ee71beb10c13b0147acd.png",
introduce: "更多的鲜活营养,更好喝的鲜甜口感,更优质的牧场奶源,更安全的品质保障",
prompt: "200g加赠50g",
logo: "//yun.duiba.com.cn/polaris/%E5%96%9D%E9%B2%9C%E5%A5%B6logo.bbf9439b1063adc9690344c58db26a1fa2d746f8.png",
},
{
img: "//yun.duiba.com.cn/polaris/%E9%B2%9C%E7%89%9B%E5%A5%B6.fd352be87520d04261ba36348022c36836e4c819.png",
introduce: "更多的鲜活营养,更好喝的鲜甜口感,更优质的牧场奶源,更安全的品质保障更多的鲜活营养,更好喝的鲜甜口感,更优质的牧场奶源,更安全的品质保障",
prompt: "200毫升",
logo: "//yun.duiba.com.cn/polaris/%E9%B2%9C%E7%89%9B%E5%A5%B6logo.7ee8ec3fc21f699756f54512835ffd8d50a18bed.png",
},
]
},
created() {
store.updateActivity();
},
methods: {
// 跳转活动详情页
jumpDetailPage: _asyncThrottle(async function (e) {
const item = e.currentTarget.dataset.item
wx.navigateTo({ url: `/pages/activityDetail/activityDetail?url=${item.img}` })
}),
onShareAppMessage() {
return {
title: '自定义转发标题',
......
......@@ -7,7 +7,7 @@
</swiper>
<view class="act_prod_list">
<view class="act_prod_item" wx:for="{{activityInfo.productList}}" wx:for-index="idx" wx:key="{{idx}}">
<view class="act_prod_item" wx:for="{{activityInfo.productList}}" wx:for-index="idx" wx:key="idx">
<view class="prod_item_prompt">{{item.name}}</view>
<view class="prod_item_introduce">{{item.content}}</view>
<image class="prod_item_img" src="{{item.img}}" mode="aspectFit" lazy-load/>
......@@ -17,6 +17,8 @@
hover-class="common_view_hover"
hover-start-time="0"
hover-stay-time="0"
bindtap="jumpDetailPage"
data-item="{{item}}"
/>
</view>
</view>
......
{
"usingComponents": {},
"backgroundColor": "#FAFFEE"
}
\ No newline at end of file
/* pages/activity/activity.wxss */
.prod_detail {
width: 750rpx;
min-height: 100vh;
position: absolute;
overflow-y: auto;
.prod_img {
width: 100%;
height: auto;
}
}
\ No newline at end of file
// pages/activity/activity.ts
import { ComponentWithStore } from "mobx-miniprogram-bindings";
import { store } from "../../store/store";
ComponentWithStore({
/**
* 页面的初始数据
*/
data: {
imgUrl: ''
},
methods: {
onShow() {
this.setData({
imgUrl: this.options.imgUrl,
})
},
onShareAppMessage() {
return {
title: '自定义转发标题',
path: '/page/index/index?id=123',
}
}
},
})
<!-- pages/activityDetail/activityDetail.wxml -->
<view class="prod_detail">
<image class="prod_img" src="{{imgUrl}}" mode="aspectFit" lazy-load />
</view>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment