初始化项目分支in-dev

This commit is contained in:
Mr_gzy 2025-04-03 11:55:41 +08:00
parent 30325b9ff5
commit 25c0dcef25
2 changed files with 499 additions and 0 deletions

View File

@ -0,0 +1,334 @@
<template>
<view class="page-content flex-col">
<view class="bg-zd" style="height: 526rpx;border-radius: 0 0 100rpx 100rpx;margin-bottom: 20rpx;"
:style="{'padding-top': statusBaeHeight + 60 + 'px'}">
<view class="padding-lr flex justify-between">
<template>
<view class="text-sm tag" :class="{'active-tag': curTag == 0}" @click="changeTag(0)">ALL</view>
<view class="text-sm tag" :class="{'active-tag': curTag == 1}" @click="changeTag(1)">关注品牌</view>
</template>
<template>
<view class="text-sm tag" :class="{'active-tag': queryForm.orderBy == 'popularity'}" @click="changeOrder('popularity')">人气排名</view>
<view class="text-sm tag" :class="{'active-tag': queryForm.orderBy == 'create_time'}" @click="changeOrder('create_time')">最新发布</view>
</template>
</view>
</view>
<view class="flex-1 padding list-container">
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower="changePage">
<view class="activity-item flex" v-for="(it, index) in activeList" :key="index" @click="toDetail(it)">
<view class="left flex flex-col justify-between align-center">
<image :src="it.brandLogo" style="width: 140rpx;height: 140rpx;">
</image>
<text >活动状态</text>
<view v-if="it.stage == 0">未开始</view>
<view v-if="it.stage == 2">已结束</view>
<view v-if="it.stage == 3">已结束</view>
<view v-if="it.stage == 4">活动停止</view>
<view v-if="it.stage == 1" class="margin-bottom-xs" style="color: #9E9E9E;font-size: 24rpx;">招募即将结束</view>
<view v-if="it.stage == 1">
<text style="font-size: 72rpx; color: #DE3C4B;">{{it.remainingDays}}</text>
</view>
</view>
<view class="right">
<view class="title">{{ it.breweryName }}</view>
<!-- <view class="title">{{ it.activityName }}</view> -->
<view class="sub">时间首次扫码开始累计 <text style="color:#DE3C4B">{{it.duration}}天内</text></view>
<view class="sub">目标全系列酒款累积扫码 {{ it.activityTarget}}</view>
<scroll-view v-if="it.beers" scroll-x="true" class="scroll-img">
<view class="beer-box" v-for="(it, index) in it.beers" :key="index" @click="toReview(it)">
<image v-if="it.cover" :src="it.cover" class="cover"></image>
</view>
</scroll-view>
<view class="flex align-center">
<text v-if="it.activityRewardType == 2 || (it.activityRewardType == 1 && it.activityRewardGoods)" class="zeng"></text>
<text v-if="it.activityRewardType == 1 && it.activityRewardGoods" style="color: #0B0E26;font-size: 24rpx;">{{it.activityRewardGoods.goodsName}} * {{it.activityRewardCount}}</text>
<text v-if="it.activityRewardType == 2" style="color: #0B0E26;font-size: 24rpx;">啤酒币 * {{it.activityRewardCount}}</text>
</view>
</view>
</view>
<view class="cu-load" :class="loading?'loading': activeList.length == total ? 'over' :'more'"></view>
</scroll-view>
</view>
<loginPopup ref="loginRef"></loginPopup>
</view>
</template>
<script>
import {
getActivities,
getFavoriteActivities
} from '@/api/bar.js'
import loginPopup from '@/components/loginPopup.vue';
export default {
components: {
loginPopup
},
data() {
return {
statusBaeHeight: 40,
curTag: 0,
activeList: [], //
loading: false,
queryForm: {
pageNum: 1,
pageSize: 5,
orderBy:''
},
total: 0,
};
},
onLoad() {
uni.setTabBarStyle({
backgroundColor: '#ffffff'
})
// setTimeout(() => {
// uni.setNavigationBarColor({
// frontColor: '#000000',
// backgroundColor: '#FFFFFF',
// animation: {
// duration: 400,
// timingFunc: 'easeIn'
// }
// })
// }, 500)
this.statusBaeHeight = uni.getWindowInfo.statusBarHeight
this.getActivitiesFun()
},
methods: {
changeTag(key) {
this.curTag = key
if(key == 0) {
this.queryForm.pageNum = 1
this.activeList = []
this.getActivitiesFun()
}else if(key == 1) {
this.activeList = []
this.queryForm.pageNum = 1
this.getFavoriteActivitiesFun()
}
},
//
changeOrder(key) {
this.queryForm.orderBy = key
if(this.curTag == 0) {
this.queryForm.pageNum = 1
this.activeList = []
this.getActivitiesFun()
} else if(this.curTag == 1) {
this.activeList = []
this.queryForm.pageNum = 1
this.getFavoriteActivitiesFun()
}
},
changePage() {
console.log('翻页')
if (this.activeList.length < this.total) {
if (this.curTag == 1) {
this.queryForm.pageNum++
this.getFavoriteActivitiesFun()
}else {
this.queryForm.pageNum++
this.getActivitiesFun()
}
}
},
toDetail(item) {
if (!uni.getStorageSync('token')) {
this.$refs.loginRef.open()
return
}
uni.navigateTo({
url: "/pagesActivity/activityDetail?id=" + item.id
})
},
//
getFavoriteActivitiesFun() {
// uni.showLoading({
// mask: true
// })
this.loading = true
getFavoriteActivities(this.queryForm).then(res=>{
console.log(res)
this.total = res.total
if(res.rows && res.rows.length > 0) {
let arr = res.rows.map(it => {
it.remainingDays = this.getRemainingDays(it.endDate)
return it
})
arr.forEach(it => {
this.activeList.push(it)
})
}
this.loading = false
// uni.hideLoading()
}).catch(err => {
this.loading = false
// uni.hideLoading()
})
},
//
getActivitiesFun() {
// uni.showLoading({
// mask: true
// })
this.loading = true
getActivities(this.queryForm).then(res => {
this.total = res.total
if(res.rows && res.rows.length > 0) {
let arr = res.rows.map(it => {
it.remainingDays = this.getRemainingDays(it.endDate)
return it
})
arr.forEach(it => {
this.activeList.push(it)
})
}
this.loading = false
// uni.hideLoading()
}).catch(err => {
this.loading = false
// uni.hideLoading()
})
},
//
getRemainingDays(date) {
const targetDate = new Date(date);
const currentDate = new Date();
const timeDiff = targetDate.getTime() - currentDate.getTime();
const remainingDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
return remainingDays;
},
}
}
</script>
<style lang="scss" scoped>
.page-content {
height: 100vh;
.activeTab {
font-size: 64rpx;
border-bottom: 2px solid #303048;
}
.tag {
background-color: transparent;
border-radius: 12rpx;
padding: 12rpx 30rpx;
border: 1px solid #fff;
margin-right: 24rpx;
}
.active-tag {
background-color: #FEE034;
font-weight: bold;
border: 1px solid #FEE034;
}
.list-container {
margin-top: -300rpx;
overflow-y: auto;
// padding-bottom: calc(110rpx + constant(safe-area-inset-bottom));
// padding-bottom: calc(110rpx + env(safe-area-inset-bottom));
.card {
border-radius: 40rpx;
}
.avatar {
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
}
//
.activity-item {
border-radius: 20rpx;
background: #FDFDFD;
box-sizing: border-box;
border: 1px solid #F2F2F2;
width: 702rpx;
margin-bottom: 32rpx;
.left {
padding: 24rpx 20rpx;
border-radius: 20rpx;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #EFEDE9;
width: 180rpx;
margin-top: -10rpx;
margin-bottom: -10rpx;
}
.right {
padding: 20rpx;
flex:1;
.title {
font-family: Source Han Sans;
font-size: 28rpx;
font-weight: bold;
line-height: 30rpx;
color: #0B0E26;
margin-bottom: 20rpx;
}
.sub {
font-family: Source Han Sans;
font-size: 24rpx;
font-weight: 500;
line-height: 30rpx;
color: #0B0E26;
margin-bottom: 16rpx;
}
.scroll-img {
width: 500rpx;
display: flex;
flex-direction: row;
white-space: nowrap;
height: 144rpx;
margin-bottom: 20rpx;
.beer-box {
width: 100rpx;
background: #FFFFFF;
margin-right: 20rpx;
box-sizing: border-box;
display: inline-block;
// &:nth-child(1) {
// margin-left: 32rpx;
// }
.cover {
width: 100rpx;
height: 144rpx;
border-radius: 10rpx;
}
}
}
.zeng {
font-family: Source Han Sans;
font-size: 20rpx;
font-weight: bold;
line-height: normal;
text-align: center;
color: #0B0E26;
padding: 8rpx 12rpx;
border-radius: 10rpx;
background: #FEE034;
margin-right: 20rpx;
}
}
}
}
}
</style>

165
pagesMy/subAccount.vue Normal file
View File

@ -0,0 +1,165 @@
<template>
<view class="page">
<view class="sub-account-btn flex justify-end">
<view class="btns">新增子账号</view>
</view>
<view class="sub-center">
<view class="">
子账户默认可新增一个请确认手机号正确无误
</view>
</view>
<view class="">
<view class="flex align-center sub-titles" style="">
<view class="wt-33">子账号用户名</view>
<view class="wt-33">手机号码</view>
<view class="wt-33">操作</view>
</view>
<view class="" style="padding: 0 32rpx;">
<view class="" style="border-bottom: 1rpx solid #C4C4C4;"></view>
</view>
<view class="">
<view class="flex align-center sub-content" v-for="it in 2">
<view class="wt-33">张三</view>
<view class="wt-33">18654236325</view>
<view class="wt-33 flex align-center">
<view class="con-btns" style="background: #D42E78;">删除</view>
<view class="con-btns" style="background: #FDCA40;margin-left: 6rpx;">修改</view>
</view>
</view>
</view>
</view>
<uni-popup ref="ADRef" type="center" :is-mask-click="false" maskBackgroundColor="rgba(0,0,0,0.7)">
<view class="flex flex-col align-center justify-center" style="width: 630rpx;height: 61vh;">
<swiper class="swiper" style="width: 630rpx;height: 58vh;" circular :autoplay="true"
:indicator-dots="true">
<swiper-item v-for="(item,index) in ADList" :key="index">
<image :src="item.bannerUrl" style="width: 630rpx;height: 50vh;border-radius: 30rpx;"
@click="handleAD(item)">
</image>
</swiper-item>
</swiper>
<text class="cuIcon-roundclose text-white" style="font-size: 68rpx !important;" @click="closeAd"></text>
</view>
</uni-popup>
<!-- 新增底部固定按钮 -->
<view class="fixed-bottom-btn">
<view class="btns">固定按钮</view>
</view>
</view>
</template>
<script>
import {
getBannerList
} from '@/api/bar.js'
import {
listFeaturePage
} from '@/api/platform.js'
export default {
components: {
},
data() {
return {
};
},
onLoad() {
},
onShow() {
},
methods: {
moreClick() {
// uni.navigateTo({
// url: "/pages/activityList/activityList"
// })
uni.navigateTo({
url: "/pagesMy/subAccount"
})
}
}
}
</script>
<style lang="scss" scoped>
/deep/.uni-popup {
z-index: 1025;
}
.page {
height: 100vh;
overflow-y: auto;
font-family: Roboto;
width: 100%;
font-size: 24rpx;
.sub-account-btn {
width: 100%;
padding:42rpx 32rpx 24rpx 32rpx;
.btns {
width: 188rpx;
height: 64rpx;
background: #4E63E0;
font-size: 28rpx;
color: #FFF;
text-align: center;
line-height: 64rpx;
border-radius: 12rpx;
}
}
.sub-center {
padding-left: 32rpx;
color: #606060;
margin-bottom: 50rpx;
}
.sub-titles {
padding:0 32rpx 20rpx 32rpx;
text-align: center;
}
.sub-content{
padding:24rpx 32rpx 0rpx 32rpx;
text-align: center;
font-size: 28rpx;
color: #3D3D3D;
font-weight: 600;
.con-btns{
padding: 16rpx 24rpx;
border-radius: 12rpx;
color: #FFF;
}
}
.wt-33{
width: 33%;
}
/* 新增样式 */
.fixed-bottom-btn {
position: fixed;
bottom: 76rpx;
left: 0;
right: 0;
display: flex;
justify-content: center;
z-index: 1000;
padding:0 64rpx 0 32rpx;
.btns {
width: 100%;
height: 88rpx;
background: #4E63E0;
font-size: 28rpx;
color: #FFF;
text-align: center;
line-height: 88rpx;
border-radius: 12rpx;
}
}
}
</style>