oil-station/gasStation-uni/pagesHome/Activity/index.vue

248 lines
4.9 KiB
Vue
Raw Normal View History

2023-11-27 09:24:16 +08:00
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">本站活动</view>
<view class="my-icons"></view>
</view>
<view class="mub">
2023-12-18 15:19:34 +08:00
<view class="mub-box" v-for="(item,index) in activityList" :key="index">
<view class="right-box" v-if="index != 0">
2023-12-18 17:32:37 +08:00
最新活动
2023-12-14 15:26:00 +08:00
</view>
2023-12-18 15:19:34 +08:00
<view class="right-box" v-if="index == 0">
最新活动
</view>
2023-12-18 11:10:15 +08:00
<view class="box-img" @click="intoOtherPage(item.name)">
2023-12-05 11:16:58 +08:00
<image src="../../static/imgs/xfyl.png" v-if="item.name == '消费有礼活动'"></image>
<image src="../../static/imgs/zkyx.png" v-if="item.name == '折扣营销活动'"></image>
<image src="../../static/imgs/mjyh.png" v-if="item.name == '满减营销活动'"></image>
<image src="../../static/imgs/xryl.png" v-if="item.name == '新人有礼活动'"></image>
<image src="../../static/imgs/yqyl.png" v-if="item.name == '推荐有礼活动'"></image>
2023-12-09 13:21:01 +08:00
<image src="../../static/imgs/chongzhi.png" v-if="item.name == '储值卡充值活动'"></image>
2023-11-27 09:24:16 +08:00
</view>
<view class="box-size">
2023-11-30 17:30:54 +08:00
<view class="box-s-title">{{item.name || "活动标题"}}</view>
2023-12-18 15:19:34 +08:00
<view class="box-s-size">{{item.des || "内容"}}</view>
<!-- <view class="dis-box">
2023-12-18 11:10:15 +08:00
<view class="dian"></view>
<view class="h_size">适用用户普通会员银牌会员V2</view>
</view>
<view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
<view class="h_size">享受优惠满送一百万 送一元</view>
</view>-->
2023-11-27 09:24:16 +08:00
</view>
<view class="box-bottom">
<view class="">活动时间</view>
2024-01-02 12:45:39 +08:00
<view>{{item.time || ''}}</view>
2023-11-27 09:24:16 +08:00
</view>
</view>
</view>
<!-- 顶部区域 -->
</view>
</view>
</template>
<script>
2023-11-30 10:56:05 +08:00
import request from '../../utils/request'
2023-11-27 09:24:16 +08:00
export default {
data() {
return {
2024-01-04 12:12:36 +08:00
query: {
storeId: ''
},
2023-11-27 09:24:16 +08:00
title: '',
2023-11-30 17:30:54 +08:00
activityList: [],
2023-11-30 10:56:05 +08:00
}
},
2023-11-27 09:24:16 +08:00
components: {
2023-11-30 17:30:54 +08:00
},
onShow() {
2024-01-04 12:12:36 +08:00
this.query.storeId = uni.getStorageSync("storeId");
2023-11-30 17:30:54 +08:00
this.getData();
2023-11-27 09:24:16 +08:00
},
methods: {
2023-12-05 11:16:58 +08:00
intoOtherPage(name) {
2023-11-30 10:56:05 +08:00
uni.navigateTo({
2023-12-05 11:16:58 +08:00
url: '/pagesHome/activeIn/index?name=' + name
2023-11-30 10:56:05 +08:00
})
},
getData() {
2023-12-13 18:19:52 +08:00
uni.showLoading({
title: '加载中'
});
2023-11-30 10:56:05 +08:00
request({
2023-11-30 17:30:54 +08:00
url: 'business/marketingActivity/activeExchange/applet',
2023-11-30 10:56:05 +08:00
method: 'get',
2024-01-04 12:12:36 +08:00
params: this.query
2023-11-30 10:56:05 +08:00
}).then(res => {
console.log(res);
2023-12-05 11:21:21 +08:00
if (res.code == 200) {
this.activityList = res.data
uni.hideLoading();
}
2023-11-30 10:56:05 +08:00
})
},
2023-11-27 09:24:16 +08:00
getactvity(url) {
if (url) {
console.log('跳转中');
} else {
uni.showToast({
title: "此活动暂无跳转地址",
icon: 'error'
})
}
},
getlist() {
},
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
2023-12-14 15:26:00 +08:00
z-index: 999999999;
2023-11-27 09:24:16 +08:00
}
.mub {
background: #f4f5f6;
box-sizing: border-box;
padding: 15px;
}
.mub-box {
width: 100%;
border-radius: 8px;
box-sizing: border-box;
overflow: hidden;
background-color: #ffffff;
border-radius: 8px;
margin-bottom: 10px;
2023-12-14 15:26:00 +08:00
position: relative;
}
.right-box {
position: absolute;
top: 10px;
right: 0px;
width: 70px;
height: 25px;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
background-color: #f82614;
border-radius: 8px 0px 0px 8px;
2023-11-27 09:24:16 +08:00
}
.box-img {
width: 100%;
height: 150px;
background-color: cornflowerblue;
image {
width: 100%;
height: 100%;
}
}
.box-size {
width: 100%;
box-sizing: border-box;
padding: 10px;
}
.box-bottom {
width: 100%;
height: 40px;
box-sizing: border-box;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid #f4f5f6;
font-size: 14px;
2023-12-18 11:10:15 +08:00
color: #666666;
2023-11-27 09:24:16 +08:00
}
.box-s-title {
font-size: 17px;
font-weight: bold;
2023-12-18 11:10:15 +08:00
margin: 5px auto;
2023-11-27 09:24:16 +08:00
}
.box-s-size {
font-size: 14px;
2023-12-18 11:10:15 +08:00
color: #777777;
2023-12-14 15:26:00 +08:00
box-sizing: border-box;
2023-12-18 11:10:15 +08:00
// padding: 5px;
// background-color: #f4f5f6;
2023-12-14 15:26:00 +08:00
border-radius: 8px;
margin: 5px auto;
2023-11-27 09:24:16 +08:00
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
2023-12-18 09:22:30 +08:00
z-index: 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
2023-11-27 09:24:16 +08:00
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
2023-12-18 11:10:15 +08:00
.dian {
width: 6px;
height: 6px;
background: #2F72F7;
border-radius: 50%;
margin-right: 5px;
}
.dis-box {
display: flex;
align-items: center;
}
.h_size {
font-size: 14px;
font-weight: 400;
color: #777777;
}
2023-12-18 15:19:34 +08:00
</style>