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

430 lines
12 KiB
Vue
Raw Normal View History

2023-11-30 10:56:05 +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>
2023-12-05 11:16:58 +08:00
<view class="my-text">{{title||"详情页"}}</view>
2023-11-30 10:56:05 +08:00
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
2023-12-05 11:16:58 +08:00
<view style="text-align: center;">
<image src="../../static/imgs/xfyl.png" v-if="title == '消费有礼活动'"></image>
<image src="../../static/imgs/zkyx.png" v-if="title == '折扣营销活动'"></image>
<image src="../../static/imgs/mjyh.png" v-if="title == '满减营销活动'"></image>
<image src="../../static/imgs/xryl.png" v-if="title == '新人有礼活动'"></image>
<image src="../../static/imgs/yqyl.png" v-if="title == '推荐有礼活动'"></image>
2023-12-18 15:19:34 +08:00
<image src="../../static/imgs/chongzhi.png" v-if="title == '储值卡充值活动'"></image>
2023-12-05 11:16:58 +08:00
</view>
<view class="center-box" v-for="(item,index) in datas" :key="index" v-if="title == '消费有礼活动'">
<view class=" title-box">活动介绍</view>
<view class="h_size">{{item.activeDescribe || ""}}</view>
<view class="box-bottom">
<view class="">活动时间</view>
<view>{{item.time}}</view>
</view>
2023-12-18 11:10:15 +08:00
<view class="title-box">参与油品</view>
<view class="w_box">
<view class="w_oil" v-for="(item,index) in item.oilName" :key="index">{{item}}</view>
</view>
<view class="h_bottom">
<view class="dis-box">
<view class="dian"></view>
<view class="h_size">参与会员{{item.adaptUserType}}</view>
</view>
<view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
<view class="h_size">获得折扣赠送{{item.points}}积分</view>
</view>
</view>
</view>
<view class="center-box" v-for="(item,index) in datas" :key="index" v-if="title == '折扣营销活动'">
<view class=" title-box">活动介绍</view>
<view class="h_size">{{item.discountActiveDescribe || ""}}</view>
<view class="box-bottom">
<view class="">活动时间</view>
<view>{{item.time}}</view>
</view>
<view class="title-box">参与油品</view>
<view class="w_box">
<view class="w_oil" v-for="(item,index) in item.oilName" :key="index">{{item}}</view>
</view>
<view class="h_bottom">
<view class="dis-box">
<view class="dian"></view>
<view class="h_size">参与会员{{item.adaptUserType}}</view>
</view>
<!-- <view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
<view class="h_size">获得折扣赠送{{item.points}}积分</view>
</view> -->
</view>
</view>
<view class="center-box" v-for="(item,index) in datas" :key="index" v-if="title == '满减营销活动'">
<view class=" title-box">活动介绍</view>
<view class="h_size">{{item.fullminusActiveDescribe || ""}}</view>
<view class="box-bottom">
<view class="">活动时间</view>
<view>{{item.time}}</view>
</view>
<view class="title-box">参与油品</view>
<view class="w_box">
<view class="w_oil" v-for="(item,index) in item.oilName" :key="index">{{item}}</view>
</view>
<view class="h_bottom">
<view class="dis-box">
<view class="dian"></view>
<view class="h_size">参与会员{{item.adaptUserType}}</view>
</view>
<!-- <view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
<view class="h_size">获得折扣赠送10积分</view>
</view> -->
</view>
</view>
<view class="center-box" v-for="(item,index) in datas" :key="index" v-if="title == '储值卡充值活动'">
<view class=" title-box">活动介绍</view>
<view class="h_size">{{item.discountActiveDescribe || ""}}</view>
<view class="box-bottom">
<view class="">活动时间{{item.time}}</view>
</view>
<!-- <view class="title-box">参与油品</view>
2023-12-18 11:10:15 +08:00
<view class="w_box">
<view class="w_oil" v-for="(item,index) in 3" :key="index">#95</view>
</view> -->
<view class="h_bottom">
<view class="dis-box">
<view class="dian"></view>
<view class="h_size">参与会员{{item.adaptUserType}}</view>
</view>
<view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
<view class="h_size">获得折扣赠送{{item.points}}积分</view>
</view>
<view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
<view class="h_size">获得折扣赠送{{item.growaValue}}成长值</view>
</view>
</view>
</view>
<view class="center-box" v-if="title == '新人有礼活动'">
<view class=" title-box">活动介绍</view>
<view class="h_size">{{datas.newlywedsActiveDescribe || ""}}</view>
<view class="box-bottom">
<view class="">活动时间</view>
2024-01-02 12:45:39 +08:00
<view>{{datas.time || ''}}</view>
2023-12-05 11:16:58 +08:00
</view>
<!-- <view class="title-box">参与油品</view> -->
<!-- <view class="w_box">
<view class="w_oil" v-for="(item,index) in 3" :key="index">#95</view>
</view> -->
2023-12-18 11:10:15 +08:00
<view class="h_bottom">
<!-- <view class="dis-box">
<view class="dian"></view>
<view class="h_size">参与会员普通会员银牌会员V2</view>
</view> -->
<view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
2024-01-02 12:45:39 +08:00
<view class="h_size">赠送{{datas.point || ''}}积分</view>
</view>
2023-12-18 11:10:15 +08:00
<view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
2024-01-02 12:45:39 +08:00
<view class="h_size">赠送{{datas.growValue || ''}}成长值</view>
</view>
</view>
</view>
<view class="center-box" v-if="title == '推荐有礼活动'">
<view class=" title-box">活动介绍</view>
<view class="h_size">{{datas.recommendActiveDescribeIn || ""}}</view>
<view class="h_size">{{datas.recommendActiveDescribeOut || ""}}</view>
<view class="box-bottom">
<view class="">活动时间{{datas.time}}</view>
</view>
<!-- <view class="title-box">参与油品</view>
<view class="w_box">
<view class="w_oil" v-for="(item,index) in 3" :key="index">#95</view>
</view> -->
<view class="h_bottom">
<!-- <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>
2024-01-02 12:45:39 +08:00
<view class="h_size">赠送{{datas.point || ''}}积分</view>
2023-12-18 11:10:15 +08:00
</view>
<view class="dis-box">
<view class="dian" style="background: #FA5E03;"></view>
2024-01-02 12:45:39 +08:00
<view class="h_size">赠送{{datas.growValue || ''}}成长值</view>
2023-12-18 11:10:15 +08:00
</view>
2023-12-05 11:16:58 +08:00
</view>
2023-11-30 10:56:05 +08:00
</view>
2023-12-21 17:48:13 +08:00
<view class="anniu" @click="goTopup()">
2023-12-18 17:54:43 +08:00
去参与
</view>
2023-12-18 11:10:15 +08:00
<!-- <view class="g-box" v-for="(item,index) in datas" :key="index" v-if="title == '消费有礼活动'">
<text>{{item.activeDescribe || ""}}</text>
</view>
<view class="g-box" v-for="(item,index) in datas" :key="index" v-if="title == '折扣营销活动'">
<text>{{item.discountActiveDescribe || ""}}</text>
</view>
<view class="g-box" v-for="(item,index) in datas" :key="index" v-if="title == '满减营销活动'">
<text>{{item.fullminusActiveDescribe || ""}}</text>
</view>
<view class="g-box" v-for="(item,index) in datas" :key="index" v-if="title == '储值卡充值活动'">
<text>{{item.discountActiveDescribe || ""}}</text>
</view>
<view class="g-box" v-if="title == '新人有礼活动'">
<text>{{datas.newlywedsActiveDescribe || ""}}</text>
</view>
<view class="g-box" v-if="title == '推荐有礼活动'">
<text>{{datas.recommendActiveDescribeIn || ""}}</text>
<text>{{datas.recommendActiveDescribeOut || ""}}</text>
</view> -->
2023-11-30 10:56:05 +08:00
</view>
</view>
</template>
<script>
import request from '../../utils/request'
export default {
data() {
return {
oilName: [],
2023-11-30 10:56:05 +08:00
title: '',
datas: [],
}
},
components: {
},
2023-12-05 11:16:58 +08:00
onLoad(option) {
this.title = option.name
2024-01-02 09:18:45 +08:00
console.log(option.name);
2023-12-05 11:16:58 +08:00
this.getData(option.name);
2023-11-30 10:56:05 +08:00
},
methods: {
2023-12-21 17:48:13 +08:00
goTopup() {
2024-01-02 09:18:45 +08:00
// pagesMy/invite/invite
if (this.title == '推荐有礼活动') {
uni.navigateTo({
url: '/pagesMy/invite/invite'
})
}
2023-12-21 17:48:13 +08:00
uni.navigateTo({
url: '/pagesHome/oilRecharge/oilRecharge'
})
},
2023-12-05 11:16:58 +08:00
getData(name) {
2023-12-05 11:21:21 +08:00
uni.showLoading({
2023-12-06 18:00:48 +08:00
//title: '加载中'
2023-12-05 11:21:21 +08:00
});
2023-12-05 11:16:58 +08:00
if (name == '消费有礼活动') {
request({
url: '/business/marketingActivity/activeConsumption/appletList',
method: 'get',
}).then(res => {
2023-12-05 11:21:21 +08:00
if (res.code == 200) {
this.datas = res.data,
uni.hideLoading();
2023-12-05 11:21:21 +08:00
}
2023-12-05 11:16:58 +08:00
})
}
if (name == '折扣营销活动') {
request({
url: '/business/marketingActivity/activeDiscount/appletList',
method: 'get',
}).then(res => {
2023-12-05 11:21:21 +08:00
if (res.code == 200) {
this.datas = res.data
uni.hideLoading();
}
2023-12-05 11:16:58 +08:00
})
}
if (name == '推荐有礼活动') {
request({
url: '/business/marketingActivity/activeRecommend/applet',
method: 'get',
}).then(res => {
2023-12-05 11:21:21 +08:00
if (res.code == 200) {
this.datas = res.data
uni.hideLoading();
}
2023-12-05 11:16:58 +08:00
})
}
if (name == '新人有礼活动') {
request({
url: '/business/marketingActivity/activeNewlyweds/applet',
method: 'get',
}).then(res => {
2023-12-05 11:21:21 +08:00
if (res.code == 200) {
this.datas = res.data
uni.hideLoading();
}
2023-12-05 11:16:58 +08:00
})
}
if (name == '满减营销活动') {
request({
url: '/business/marketingActivity/activeFullminus/appletList',
method: 'get',
}).then(res => {
2023-12-05 11:21:21 +08:00
if (res.code == 200) {
this.datas = res.data
uni.hideLoading();
}
2023-12-05 11:16:58 +08:00
})
}
2023-12-18 11:10:15 +08:00
if (name == '储值卡充值活动') {
request({
url: '/business/marketingActivity/cardValue/appletList',
method: 'get',
}).then(res => {
if (res.code == 200) {
this.datas = res.data
uni.hideLoading();
}
})
}
2023-12-05 11:16:58 +08:00
2023-11-30 10:56:05 +08:00
},
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
2023-12-18 11:10:15 +08:00
background: #f4f5f6;
2023-12-05 11:16:58 +08:00
height: 100vh;
}
image {
width: 95%;
height: 160px;
border-radius: 8px;
2023-11-30 10:56:05 +08:00
}
.container {
width: 100%;
2023-12-05 11:16:58 +08:00
2023-12-18 11:10:15 +08:00
background: #f4f5f6;
2023-11-30 10:56:05 +08:00
box-sizing: border-box;
padding-top: 88px;
2023-12-05 11:16:58 +08:00
padding-bottom: 20px;
2023-11-30 10:56:05 +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;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
2023-12-05 11:16:58 +08:00
.center-box {
border-radius: 8px;
2023-12-18 11:10:15 +08:00
background: #ffffff;
2023-12-05 11:16:58 +08:00
margin: 10px auto;
box-sizing: border-box;
padding: 10px;
width: 95%;
}
.title-box {
font-size: 18px;
font-weight: bold;
2023-12-18 11:10:15 +08:00
margin: 10px auto;
2023-12-05 11:16:58 +08:00
}
.g-box {
box-sizing: border-box;
width: 100%;
padding: 4px 0px;
font-size: 14px;
color: #333333;
}
2023-12-18 11:10:15 +08:00
.w_box {
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
}
.h_size {
font-size: 14px;
font-weight: 400;
color: #777777;
}
.w_oil {
border-radius: 4px 4px 4px 4px;
box-sizing: border-box;
padding: 5px 10px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
border: 1px solid #2F72F7;
color: #2F72F7;
}
.h_bottom {
width: 100%;
background: #F4F4F4;
border-radius: 4px;
box-sizing: border-box;
padding: 10px 5px;
margin: 10px auto;
}
.dian {
width: 6px;
height: 6px;
background: #2F72F7;
border-radius: 50%;
margin-right: 5px;
}
.dis-box {
display: flex;
align-items: center;
}
2023-12-18 17:54:43 +08:00
.anniu {
2023-12-19 09:31:53 +08:00
width: 90%;
2023-12-18 17:54:43 +08:00
height: 42px;
display: flex;
align-items: center;
justify-content: center;
color: white;
background: #2F72F7;
border-radius: 8px;
position: fixed;
2023-12-19 09:31:53 +08:00
bottom: 20px;
left: 50%;
transform: translate(-50%, -50%);
2023-12-18 17:54:43 +08:00
}
2023-12-21 17:48:13 +08:00
</style>