This commit is contained in:
wwz
2025-02-10 11:25:48 +08:00
parent 5add1f1282
commit ede860cec3
24 changed files with 2536 additions and 17657 deletions

View File

@@ -0,0 +1,216 @@
<template>
<view class="onecontent flex-between">
<view class="onecontentleft">
现有<text style="color: #FC851E;font-size: 24rpx;">
{{bannervo.coupons==null?116:bannervo.coupons}}
</text>
已免单
</view>
<view class="onecontentright flex-start">
<view class="onecontentrightimage">
<view class="swiperPanel" @touchstart="startMove" @touchend="endMove">
<view class="swiperItem" v-for="(item, index) in bannervo.counponsInfo" :key="index"
:style="{transform: itemStyle[index].transform, zIndex: itemStyle[index].zIndex, opacity: itemStyle[index].opacity}">
<view class="children">
<image class="pic" :src="item.logo"></image>
</view>
</view>
</view>
</view>
<view class="onecontentrighttext">
<swiper class="swiper" circular :autoplay="true" :vertical='true' :interval="2000">
<swiper-item class="swiperitem" v-for="(item,index) in bannervo.counponsInfo" :key="index">
{{item.name}}已省{{item.money}}元钱
</swiper-item>
</swiper>
</view>
</view>
<!-- 小内切圆 -->
<view class="after"></view>
</view>
</template>
<script setup>
import {
defineProps
} from 'vue';
const props = defineProps({
bannervo: {
type: Object,
default: () => ({}) //
},
itemStyle: {
type: Array,
default: () => [{
transform: 'scale(' + (1) + ') translate(-' + (0 * 20) + '%,0px)',
zIndex: 9999,
opacity: 1
}] //
}
});
const timersetIntervalnewVal = () => {
this.timersetInterval = setInterval(() => {
this.endMove()
}, 2000);
}
const startMove = () => {
this.slideNote.x = e.changedTouches[0] ? e.changedTouches[0].pageX : 0;
this.slideNote.y = e.changedTouches[0] ? e.changedTouches[0].pageY : 0;
}
const endMove = (e) => {
// this.itemStyless = []
var newList = JSON.parse(JSON.stringify(this.itemStyle))
// console.log(newList)
// if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) {
// 向左滑动
var last = [newList.pop()]
newList = last.concat(newList)
// } else {
// 向右滑动
// newList.push(newList[0])
// newList.splice(0, 1)
// }
this.$emit('changeValue', newList);
this.$forceUpdate();
}
</script>
<style scoped lang="scss">
.onecontent {
position: relative;
margin-top: -34rpx;
padding: 14rpx 28rpx 44rpx 28rpx;
width: 100%;
background: linear-gradient(92deg, #FCECAA 0%, #fff 100%);
border-radius: 40rpx 0rpx 0rpx 0rpx;
.onecontentleft {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 700;
font-size: 24rpx;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
text {
color: #FC851E;
}
}
.onecontentright {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
.onecontentrightimage {
width: 65rpx;
position: relative;
overflow: hidden;
height: 28rpx;
margin-right: 10rpx;
.swiperPanel {
height: 28rpx;
width: 100rpx;
overflow: hidden;
position: relative;
.swiperItem {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
transition: all .5s;
/* 定义一个动画关键帧 */
.children {
height: 100%;
width: 25%;
// margin: 2rpx auto;
/* 应用动画,设置动画时长、循环次数和速度曲线 */
.pic {
height: 100%;
width: 100%;
border-radius: 50%;
// box-shadow: 0 0 10px #333;
}
}
}
}
.onecontentrightimageabsolute {
width: 100%;
left: 0;
top: 0;
position: absolute;
z-index: 9;
height: 28rpx;
}
.onecontentrightimageabsolutetow {
width: 100%;
left: 14rpx;
top: 0;
position: absolute;
z-index: 10;
}
// .onecontentrightswiper {
// border: 50%;
// width: 28rpx;
// height: 28rpx;
// background: red;
// }
}
.onecontentrighttext {
width: 232rpx;
.swiper {
height: 28rpx;
// width: 232rpx;
.swiperitem {
width: 100rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
color: #333333;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
}
}
}
}
.after {
position: absolute;
top: -40rpx;
right: 0rpx;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
z-index: 9999;
}
}
</style>

View File

@@ -0,0 +1,115 @@
<template>
<view class="fourcontent flex-between">
<view class="fourcontent_item flex-start" v-for="(item,index) in menu" :key="index"
@click="viewHistorycategoryss(item,index)"
:class="!item.isChild && viewHistoryindex == index ? 'fourcontent_itemactev':''">
<text>{{item.name}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
props: {
menu: {
type: Array,
default () {
return []
}
},
title: {
type: String,
default: '每日特价'
},
viewHistoryindex: {
type: String,
default: ''
},
},
methods: {
viewHistorycategoryss(item, index) {
console.log(item, index)
uni.$emit('viewHistory', {
item:item,
index:index
});
},
clickdistrict(item) {
switch (item.jumpType) {
case 'absolute':
uni.pro.navigateTo('webview/webview', {
url: item.absUrl
});
break;
case 'relative':
uni.pro.navigateTo(item.absUrl, item);
break;
case 'scan':
if (!uni.utils.pluschooseImage()) {
return false
}
// #ifdef H5
if (this.wxSdk) {
wx.scanQRCode({
needResult: 1, // 默认为0扫描结果由微信处理1则直接返回扫描结果
scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
success: res => {
// 当needResult 为 1 时,扫码返回的结果
console.log(res.resultStr, res)
}
});
} else {
uni.showModal({
title: '注意',
content: '微信sdk初始化失败请重新加载',
success: res => {
window.location.reload();
}
});
}
// #endif
// #ifdef APP || MP-WEIXIN
uni.scanCode({
success: res => {
console.log(res.result, res)
}
});
// #endif
break;
}
}
}
};
</script>
<style scoped lang="scss">
.fourcontent {
padding: 32rpx 28rpx 32rpx 28rpx;
overflow-x: auto;
flex-wrap: nowrap;
.fourcontent_item {
flex-wrap: nowrap;
margin-left: 22rpx;
padding: 4rpx 14rpx;
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
text {
width: max-content;
}
}
.fourcontent_itemactev {
background: #fee06a;
}
.fourcontent_item:nth-child(1) {
margin-left: 0;
}
}
</style>

View File

@@ -0,0 +1,113 @@
<template>
<view class="towcontent flex-between">
<view class="towcontent_item flex-colum" v-for="(item,index) in district" :key="index"
@click="clickdistrict(item,index)">
<image :src="item.coverImg" mode="aspectFill"></image>
<text>{{item.name}}</text>
</view>
</view>
</template>
<script setup>
import {
ref,
defineProps
} from 'vue';
const props = defineProps({
district: Array
});
const clickdistrict = (item) => {
console.log(item, '调试')
switch (item.jumpType) {
case 'absolute':
uni.pro.navigateTo('webview/webview', {
url: item.absUrl
});
break;
case 'scan_applet':
uni.navigateToMiniProgram(JSON.parse(item.value))
break;
case 'relative':
uni.setStorage({
key: 'itemData',
data: item,
});
uni.pro.navigateTo(item.absUrl, item.name);
break;
case 'scan':
if (!uni.utils.pluschooseImage()) {
return false
}
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
uni.scanCode({
success: async (res) => {
let tableCode = getQueryString(decodeURIComponent(res.result), 'code')
uni.cache.set('tableCode', tableCode)
if (tableCode) {
let data = await this.api.productqueryShop({
code: uni.cache.get('tableCode'),
})
if (data.data.shopTableInfo && !data.data.shopTableInfo.choseCount) {
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
tableCode: tableCode,
shopId: data.data.storeInfo.id,
})
} else {
uni.pro.navigateTo('order_food/order_food', {
tableCode: tableCode,
})
}
}
},
fail: (res) => {
console.log(res)
}
});
// #endif
break;
}
}
const getQueryString = (url, name) => { //解码
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
var r = url.substr(1).match(reg)
if (r != null) {
return r[2]
}
return null;
}
</script>
<style scoped lang="scss">
.towcontent {
position: relative;
margin-top: -32rpx;
padding: 32rpx 40rpx;
width: 100%;
background: #F9F9F9;
border-radius: 48rpx 48rpx 0rpx 0rpx;
overflow-x: auto;
flex-wrap: nowrap;
box-sizing: border-box;
.towcontent_item {
width: 25%;
margin-left: 34rpx;
image {
width: 92rpx;
height: 92rpx;
}
text {
margin-top: 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 28rpx;
color: #333333;
white-space: nowrap;
}
}
.towcontent_item:nth-child(1) {
margin-left: 0rpx;
}
}
</style>

View File

@@ -0,0 +1,309 @@
<template>
<!-- #ifndef APP-PLUS || MP-WEIXIN -->
<view class="fivecontent">
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="fivecontent" :style="isFixedTop?`margin-top:${HeighT.heightBar}px`:''">
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="fivecontent" :class="{statusbarmargin:isFixedTop}">
<!-- #endif -->
<view class="fivecontent_item" v-for="(item,index) in 12" :key="index">
<view class="fivecontent_item_nav flex-start">
<image src="@/static/avatar.png" mode="aspectFill"></image>
<view class="fivecontent_item_nav_left">
<view class="fivecontent_item_nav_lefttop flex-between">
<view>
幸运咖啡荣民时代广场店
</view>
<view>
龙首.151m
</view>
</view>
<view class="fivecontent_item_nav_leftlang flex-start">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
mode="aspectFill"></image>
<text>人气连锁品牌</text>
</view>
</view>
</view>
<view class="fivecontent_item_box">
<view class="fivecontent_item_boxitem flex-between">
<image src="@/static/avatar.png" mode=""></image>
<view class="fivecontent_item_boxitemleft flex-colum-start">
<view class="fivecontent_item_boxitemleftone flex-between">
<view>全场饮品任选</view>
<text>已抢15789份</text>
</view>
<view class="fivecontent_item_boxitemlefttow flex-start">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
mode="aspectFill"></image>
<text>人气连锁品牌</text>
</view>
<view class="indexboxitemleftthere flex-colum-start">
<view class="indexboxitemleftthereabsolute">
马上抢
</view>
<view class="indexboxitemlefttheretext flex-start">
<view class="indexboxitemlefttheretextone">
<text>¥</text>
<text>1444</text>
</view>
<view class="indexboxitemlefttheretexttow">
¥111
</view>
</view>
<view class="indexboxitemleftthere_countdown flex-between">
<text class="indexboxitemleftthere_countdowntext">共省4元</text>
<view class="indexboxitemleftthere_countdowntexts">
<uni-countdown :show-day="false" :day="1" :hour="1" :minute="12"
:second="40" color="#FFFFFF" border-color="#00B26A"
splitorColor="#FFFFFF" :font-size="8"></uni-countdown>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isFixedTop: false, //吸顶是否显示
Topdistance: 3000, //吸顶初始距离
keyword: '',
current: 0,
opacity: false,
};
},
onPageScroll(e) {
if (e.scrollTop <= 44) { //搜索导航栏
this.opacity = false
} else {
this.opacity = true
}
if (e.scrollTop >= this.Topdistance) { //类别导航栏
this.isFixedTop = true
} else {
this.isFixedTop = false
}
},
computed: {
HeighT() { //手机类型的尺寸
return this.$store.getters.is_BarHeight
},
},
onLoad() {
setTimeout(() => {
this.GetTop()
}, 1000)
},
onShow() {},
methods: {
GetTop() {
//获取元素距离顶部的距离
this.$u.getRect('.fourcontent').then(res => {
this.Topdistance = res.top - this.HeighT.heightBar
})
},
viewHistory() {
//移动高度=滚动高度 + 距离上面的位置 - 导航条 - 状态栏高度
uni.pageScrollTo({
scrollTop: this.Topdistance + 1,
duration: 300
});
},
}
};
</script>
<style scoped lang="scss">
.fivecontent {
padding: 0 28rpx;
.fivecontent_item {
margin-top: 32rpx;
padding: 24rpx 32rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.fivecontent_item_nav {
image {
width: 60rpx;
height: 60rpx;
border-radius: 8rpx;
}
.fivecontent_item_nav_left {
flex: auto;
margin-left: 12rpx;
.fivecontent_item_nav_lefttop {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
.fivecontent_item_nav_leftlang {
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
text {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
image {
width: 10.82rpx;
height: 14.06rpx;
}
}
}
}
.fivecontent_item_box {
margin-top: 20rpx;
border-top: 2rpx solid #E5E5E5;
padding-top: 14rpx;
.fivecontent_item_boxitem {
image {
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
}
.fivecontent_item_boxitemleft {
margin-left: 24rpx;
flex: auto;
.fivecontent_item_boxitemleftone {
width: 100%;
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
view {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.fivecontent_item_boxitemlefttow {
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
text {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
image {
width: 10.82rpx;
height: 14.06rpx;
}
}
.indexboxitemleftthere {
position: relative;
margin-top: 30rpx;
padding-left: 16rpx;
width: 100%;
height: 88rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat;
background-size: 100% 100%;
.indexboxitemleftthereabsolute {
position: absolute;
top: 14rpx;
right: 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 24rpx;
color: #FFFFFF;
}
.indexboxitemlefttheretext {
.indexboxitemlefttheretextone {
text {
font-family: SourceHanSansCN-Bold, SourceHanSansCN-Bold;
font-weight: normal;
color: #FF5053;
}
text:nth-child(2) {
font-weight: bold;
font-size: 34rpx;
}
text:nth-child(1) {
font-size: 24rpx;
}
}
.indexboxitemlefttheretexttow {
margin-left: 12rpx;
font-size: 20rpx;
font-family: SourceHanSansCN-Regular, SourceHanSansCN-Regular;
font-weight: normal;
color: #999999;
text-decoration: line-through;
}
}
.indexboxitemleftthere_countdown {
width: 100%;
.indexboxitemleftthere_countdowntext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.indexboxitemleftthere_countdowntexts {
font-family: Roboto, Roboto;
font-weight: 400;
color: #333333;
margin-left: 16rpx;
font-size: 22rpx;
}
}
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,58 @@
<template>
<view class="viewswiper">
<up-swiper :list="carousel" keyName="coverImg" @change="e => current = e.current" indicatorStyle="right: 20px" height='242'>
<template #indicator>
<view class="indicator">
<view class="indicator__dot" v-for="(item, index) in carousel" :key="index"
:class="[index === current && 'indicator__dot--active']">
</view>
</view>
</template>
</up-swiper>
</view>
</template>
<script setup>
import { ref,defineProps } from 'vue';
const props = defineProps({
carousel: Array
});
const current = ref(0)
</script>
<style scoped lang="scss">
.viewswiper {
.indicator {
margin-bottom: 46rpx;
@include flex(row);
justify-content: center;
&__dot {
height: 6px;
width: 6px;
border-radius: 100px;
background-color: rgba(255, 255, 255, 0.35);
margin: 0 5px;
transition: background-color 0.3s;
&--active {
background-color: #ffffff;
}
}
}
.indicator-num {
padding: 2px 0;
background-color: rgba(0, 0, 0, 0.35);
border-radius: 100px;
width: 35px;
@include flex;
justify-content: center;
&__text {
color: #FFFFFF;
font-size: 12px;
}
}
}
</style>

View File

@@ -0,0 +1,243 @@
<template>
<view class="therecontent flex-between">
<view class="therecontent_box_item">
<view class="therecontent_box_imge flex-between" @click="jrtoday(0)">
<view class="therecontent_box_imge_text">
{{todayList.name}}
</view>
<view class="therecontent_box_imge_right flex-start">
<view>
{{todayList.date}}
</view>
<up-icon name="arrow-right" color="#666666" size="16"></up-icon>
</view>
</view>
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in todayList.todayList"
:key="index" @click="clickproduct(item)">
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_114,h_136`" mode="aspectFill">
</image>
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone">
<text
style="margin-left: 0;">{{item.productName.length>5?item.productName.substring(0,5)+'...':item.productName}}</text>
</view>
<view class="therecontent_box_itembox_itemviewtow flex-around">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/xia.png" mode="widthFix">
</image>
<view>
{{item.discount || '1'}}
</view>
</view>
<view class="therecontent_box_itembox_itemviewthere ">
<text>{{item.salePrice}}</text>
<text>{{item.originPrice}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="therecontent_box_item">
<view class="therecontent_box_imge flex-between"
style="background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/towcontent_box2.png) no-repeat; background-size: cover;"
@click="jrtoday(1)">
<view class="therecontent_box_imge_text">
{{salesList.name}}
</view>
<view class="therecontent_box_imge_right flex-start">
<view>
{{salesList.date}}
</view>
<up-icon name="arrow-right" color="#666666" size="16"></up-icon>
</view>
</view>
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in salesList.hotList"
:key="index" @click="clickproduct(item)">
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_114,h_136`" mode="aspectFill">
</image>
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone flex-start">
<view class="therecontent_box_itembox_itemviewoneafter">
TOP.{{index + 1}}
</view>
<text>{{ item.productName.length>5?item.productName.substring(0,5)+'...':item.productName }}</text>
</view>
<view class="therecontent_box_itembox_itemviewtowdiscount flex-around">
已抢{{item.realSalesNumber}}
</view>
<view class="therecontent_box_itembox_itemviewthere ">
<text>{{item.salePrice}}</text>
<text>{{item.originPrice}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
defineProps
} from 'vue';
const props = defineProps({
salesList: Object,
todayList: Object
});
const clickproduct = (item) => {
uni.pro.navigateTo('product/index', {
id: item.id
})
}
const jrtoday = (e) => {
if (e == 0) {
uni.pro.navigateTo('index/jtoday')
} else {
uni.pro.navigateTo('index/hotlist')
}
}
</script>
<style scoped lang="scss">
.therecontent {
padding: 0 28rpx;
.therecontent_box_item {
width: 336rpx;
border-radius: 18rpx;
background: #FFFFFF;
height: 396rpx;
.therecontent_box_itembox {
padding: 10rpx 18rpx 24rpx 24rpx;
.therecontent_box_itembox_item {
margin-top: 20rpx;
flex-wrap: nowrap;
image {
width: 114rpx;
height: 136rpx;
border-radius: 10rpx;
}
.therecontent_box_itembox_itemview {
margin-left: 12rpx;
.therecontent_box_itembox_itemviewone {
width: 168rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #333333;
text {
margin-left: 4rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.therecontent_box_itembox_itemviewoneafter {
width: 48rpx;
height: 24rpx;
line-height: 24rpx;
text-align: center;
background: linear-gradient(116deg, #FF9D2B 0%, #FF4805 100%);
border-radius: 4rpx 4rpx 4rpx 4rpx;
font-family: Roboto, Roboto;
font-weight: 500;
font-size: 16rpx;
color: #FFFFFF;
}
}
.therecontent_box_itembox_itemviewtow {
margin-top: 8rpx;
width: 60rpx;
// padding: 4rpx 10rpx;
background: #FFFFFF;
border-radius: 4rpx;
border: 2rpx solid #FF7127;
image {
width: 9.74rpx;
height: 13.51rpx;
}
view {
padding-right: 2rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 16rpx;
color: #FF7127;
}
}
.therecontent_box_itembox_itemviewtowdiscount {
margin-top: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 16rpx;
color: #FF7127;
}
.therecontent_box_itembox_itemviewthere {
// margin-top: 4rpx;
// align-items: flex-end;
display: flex;
align-items: center;
justify-content: center;
text:nth-child(1) {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: Bold;
font-size: 24rpx;
color: #FF7127;
}
text:nth-child(2) {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 16rpx;
color: #999999;
text-decoration-line: line-through;
margin-top: 4rpx;
}
}
}
}
.therecontent_box_itembox_item:nth-child(1) {
margin-top: 0;
}
}
.therecontent_box_imge {
padding: 24rpx 16rpx 6rpx 24rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/towcontent_box1.png) no-repeat;
width: 100%;
height: 70rpx;
background-size: cover;
.therecontent_box_imge_text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
}
.therecontent_box_imge_right {
font-family: Source Han Sans CN, Source Han Sans CN;
// font-weight: 500;
font-size: 24rpx;
color: #666666;
}
}
}
}
</style>

View File

@@ -1,7 +1,124 @@
<template>
<view>
<Nav />
<view class="content">页面内容</view>
<view class="content">
<!-- 轮播图 -->
<swipers :carousel='hometoplist.carousel'></swipers>
<!-- 广告 -->
<advertisement :bannervo='hometoplist.bannerVO' :itemStyle='advertisementStyle'></advertisement>
<!-- 金刚区 -->
<diamond :district='hometoplist.district'></diamond>
<!-- 今日上线 -->
<todaylist :todayList='hometoplist.todayList' :salesList='hometoplist.salesList'></todaylist>
<!-- 类目 -->
<!-- #ifdef MP-WEIXIN -->
<!-- 只有小程序需要加height -->
<up-sticky :offset-top="store.height">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<up-sticky>
<!-- #endif -->
<view class="fourcontent" id="fourcontent">
<view class="flex-between" style="flex-wrap: inherit;">
<view class="fourcontent_item flex-start" v-for="(item,index) in hometoplist.menu"
:key="index" @click="viewHistory(item,index)"
:class="!item.isChild && index ? 'fourcontent_itemactev':''">
<!-- <view class="fourcontent_item flex-start" v-for="(item,index) in hometoplist.menu" :key="index"
@click="viewHistory(item,index)"
:class="!item.isChild && viewHistoryindex == index ? 'fourcontent_itemactev':''"> -->
<text style="margin-right: 10rpx;">{{item.name}}</text>
<up-icon v-if="item.isChild" style="margin-left: 10rpx;" name="arrow-down-fill"
color="#333333" size="12"></up-icon>
</view>
</view>
</view>
</up-sticky>
<!-- 首页抢购区域 -->
<view class="fivecontent">
<view class="fivecontent_item" v-for="(item,index) in homelist" :key="index"
@click="fivecontentclick(item)">
<view class="fivecontent_item_nav flex-start">
<image :src="item.shopImage" mode="aspectFill"></image>
<view class="fivecontent_item_nav_left">
<view class="fivecontent_item_nav_lefttop flex-between">
<view>
{{item.shopName}}
</view>
<view>
{{item.districts}}&nbsp;{{item.distances}}
</view>
</view>
<view class="fivecontent_item_nav_lefttopstart flex-start">
<view class="fivecontent_item_nav_leftlang flex-start"
v-for="(s,index1) in item.shopTag" :key="index1"
:style="{'background':s.backColor,'color':s.backColor}">
<image class="fivecontent_item_nav_leftlangimage" v-if="s.shareImg"
:src="s.shareImg" mode="aspectFill"></image>
<text class="fivecontent_item_nav_leftlangtext">{{s.name}}</text>
</view>
</view>
</view>
</view>
<view class="fivecontent_item_box">
<view class="fivecontent_item_boxitem flex-between">
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_192,h_192`"
mode="aspectFill"></image>
<view class="fivecontent_item_boxitemleft flex-colum-start">
<view class="fivecontent_item_boxitemleftone flex-between"
style="display: flex;justify-content: space-between;align-items: center;">
<view>
{{item.productName.length>7?item.productName.substring(0,7)+'...':item.productName}}
</view>
<text>已抢{{item.realSalesNumber}}</text>
</view>
<view class="flex-start flexstartboxfttow">
<view class="fivecontent_item_boxitemlefttow flex-start"
v-for="(c,index2) in item.proTag" :key="index2"
:style="{'background':c.backColor,'color':c.backColor}">
<image class="fivecontent_item_boxitemlefttowimage" v-if="c.shareImg"
:src="c.shareImg" mode="aspectFill"></image>
<text class="fivecontent_item_boxitemlefttowtext">{{c.name}}</text>
</view>
</view>
<view class="indexboxitemleftthere flex-colum-start">
<view class="indexboxitemleftthereabsolute">
马上抢
</view>
<view class="indexboxitemlefttheretext flex-start">
<view class="fivecontent_item_boxitemlefthere_one flex-start">
<text class="flex_startone">到手</text>
<text class="flex_starttow">¥{{item.salePrice}}</text>
</view>
<view class="fivecontent_item_boxitemlefthere_tow">
{{item.discount || ''}}
</view>
<view class="fivecontent_item_boxitemlefthere_there">
¥{{item.originPrice}}
</view>
</view>
<view class="indexboxitemleftthere_countdown flex-between">
<text class="indexboxitemleftthere_countdowntext">共省{{item.save}}</text>
<view class="indexboxitemleftthere_countdowntexts">
<!-- <uni-countdown @timeup="updateCity" :show-day="false"
:day="item.end_times.d" :hour="item.end_times.h"
:minute="item.end_times.m" :second="item.end_times.s" :indexs='index'
color="#FFFFFF" border-color="#00B26A" splitorColor="#FFFFFF"
:font-size="10"></uni-countdown> -->
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<up-loadmore height='40' :status="form.status" iconSize='16' fontSize='16' />
<!-- </scroll-view> -->
</view>
</view>
</view>
</template>
@@ -9,42 +126,437 @@
import {
ref,
computed,
onMounted
onMounted,
reactive
} from "vue";
import {
onLoad,
onReady,
onShow
onShow,
onPageScroll
} from '@dcloudio/uni-app'
import Nav from '@/components/indexnav.vue';
import swipers from './components/swiper.vue' //引入轮播
import advertisement from './components/advertisement.vue' //广告
import diamond from './components/diamond.vue' //金刚区
import todaylist from './components/todaylist.vue' //今日上线
// import popupad from '@/components/popupad.vue'
// import productlist from './components/productlist.vue'
// import category from '@/components/qiyue-category/qiyue-category.vue';
// import indexs from './indexs.vue';
import Nav from '@/components/indexnav.vue'; //导航栏
import API from "@/common/js/api.js"
import {
useNavbarStore
} from '@/stores/navbarStore';
const store = useNavbarStore();
// 动态更新导航栏配置
store.updateNavbarConfig({
showBack: false,
rightText: '',
showSearch: true,
title: '我的页面',
isTransparent: false,
hasPlaceholder: true
showBack: true, //左边返回键
rightText: '', //右边文字
showSearch: true, //true是标题其他事文字
title: '我的页面',
isTransparent: false,
hasPlaceholder: false //是否要占位符
});
//数据
const hometoplist = reactive({})
// 首页抢购数据
const form = ref({
address: '', //地址
type: '', //品类
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
other: '', //附近1KM 1选中 0不选中
page: 1, //页数
size: 10, //页容量
status: 'loadmore'
})
const homelist = ref([{
endRow: 1,
firstPage: 1,
hasNextPage: false,
hasPreviousPage: false,
isFirstPage: true,
isLastPage: true,
lastPage: 1,
list: [{
discount: 9,
distances: "1.1km",
districts: "未央区",
endTime: 1739059199999,
id: 661,
image: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240612/0c07e1f79a244ed498dfe4a70848c479.jpeg",
originPrice: 200,
proTag: [],
productName: "鸡尾酒套餐",
realSalesNumber: 0,
salePrice: 180,
save: 20,
shopImage: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240612/6f3618a31d2a4b489215647871ae732e.jpg",
shopName: "漫巷咖啡",
shopTag: [],
}],
discount: 9,
distances: "1.1km",
districts: "未央区",
endTime: 1739059199999,
id: 661,
image: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240612/0c07e1f79a244ed498dfe4a70848c479.jpeg",
originPrice: 200,
proTag: [],
productName: "鸡尾酒套餐",
realSalesNumber: 0,
salePrice: 180,
save: 20,
shopImage: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240612/6f3618a31d2a4b489215647871ae732e.jpg",
shopName: "漫巷咖啡",
shopTag: [],
navigateFirstPage: 1,
navigateLastPage: 1,
navigatePages: 8,
navigatepageNums: [1],
nextPage: 0,
pageNum: 1,
pageSize: 10,
pages: 1,
prePage: 0,
size: 1,
startRow: 1,
total: 1,
}])
//计算广告图片的重合尺寸是位移
const getStyle = (e) => {
if (e > hometoplist.bannerVO.counponsInfo.length / 2) {
var right = hometoplist.bannerVO.counponsInfo.length - e
return {
transform: 'scale(' + (1) + ') translate(-' + (right * 20) + '%,0px)',
zIndex: 9999 - right,
opacity: 1
}
} else {
return {
transform: 'scale(' + (1) + ') translate(' + (e * 20) + '%,0px)',
zIndex: 9999 - e,
opacity: 1
}
}
}
const advertisementStyle = ref([{
transform: 'scale(' + (1) + ') translate(-' + (0 * 20) + '%,0px)',
zIndex: 9999,
opacity: 1
}])
// 广告数据
const hometop = async () => {
// try {
let res = await API.homehomePageUp()
console.log(res.data)
Object.assign(hometoplist, res.data)
// hometoplist = Object.assign(res.data)
if (hometoplist.bannerVO.counponsInfo) {
hometoplist.bannerVO.counponsInfo.forEach((item, index) => {
advertisementStyle.value.push(getStyle(index))
})
}
// 计算swiper样式
// } catch (e) {}
}
// 存储每个元素距离顶部的距离
const elementTop = ref(0);
// 存储是否吸顶的状态
const isSticky = ref(true);
// 点击滑动元素
const viewHistory = async (item, index) => {
if (isSticky) {
uni.pageScrollTo({
scrollTop: elementTop.value,
duration: 300
});
}
}
// 滑动
onPageScroll((res) => {
isSticky.value = res.scrollTop > elementTop.value ? true : false
uni.$u.debounce(store.scrollTop = res.scrollTop, 500)
});
onShow(() => {})
onMounted(() => {
hometop()
// 初始化
const query = uni.createSelectorQuery().select('#fourcontent');
query.boundingClientRect((rect) => {
elementTop.value = rect.top - store.height
}).exec();
});
// store.updateNavbarConfig({
// showBack: true,//左边返回键
// rightText: '',//右边文字
// showSearch: true,//true是标题其他事文字
// title: '我的页面',
// isTransparent: false,
// height: 44,
// hasPlaceholder: false//是否要占位符
// });
</script>
<style lang="scss">
.content {
height: 1000vh;
background: #F9F9F9;
.fourcontent {
padding: 32rpx 28rpx;
overflow-x: auto;
flex-wrap: nowrap;
background: #f9f9f9;
.fourcontent_item {
flex-wrap: nowrap;
margin-left: 22rpx;
padding: 11rpx 31rpx;
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
text {
width: max-content;
}
}
.fourcontent_itemactev {
background: #fee06a;
}
.fourcontent_item:nth-child(1) {
margin-left: 0;
}
}
.fivecontent {
padding: 0 28rpx;
height: 100vh;
.fivecontent_item:nth-child(1) {
margin-top: 0;
}
.fivecontent_item {
margin-top: 32rpx;
padding: 24rpx 32rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.fivecontent_item_nav {
image {
width: 60rpx;
height: 60rpx;
border-radius: 8rpx;
}
.fivecontent_item_nav_left {
flex: auto;
margin-left: 12rpx;
.fivecontent_item_nav_lefttop {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
.fivecontent_item_nav_lefttopstart {
margin-top: 8rpx;
.fivecontent_item_nav_leftlang {
margin-left: 12rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
.fivecontent_item_nav_leftlangtext {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_nav_leftlangimage {
width: 10.82rpx;
height: 14.06rpx;
}
}
.fivecontent_item_nav_leftlang:nth-child(1) {
margin-left: 0;
}
}
}
}
.fivecontent_item_box {
margin-top: 20rpx;
border-top: 2rpx solid #E5E5E5;
padding-top: 14rpx;
.fivecontent_item_boxitem {
image {
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
}
.fivecontent_item_boxitemleft {
margin-left: 24rpx;
flex: 1;
.fivecontent_item_boxitemleftone {
width: 100%;
text {
font-family: Source Han Sans CN, Source Han Sans CN;
// font-weight: 700;
font-size: 24rpx;
color: #999999;
}
view {
// width: 300rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; //溢出不换行white-space:nowrap; //溢出不换行
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
}
}
.flexstartboxfttow {
.fivecontent_item_boxitemlefttow {
margin-left: 16rpx;
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
.fivecontent_item_boxitemlefttowtext {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_boxitemlefttowimage {
width: 10.82rpx;
height: 14.06rpx;
}
}
.fivecontent_item_boxitemlefttow:nth-child(1) {
margin-left: 0;
background: #FFD6D7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
}
.indexboxitemleftthere {
position: relative;
margin-top: 30rpx;
padding-left: 16rpx;
width: 100%;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat;
background-size: 100% 100%;
.indexboxitemleftthereabsolute {
position: absolute;
top: 14rpx;
right: 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 24rpx;
color: #FFFFFF;
}
.indexboxitemlefttheretext {
// width: 100%;
margin-top: 12rpx;
display: flex;
justify-content: center;
align-items: center;
.fivecontent_item_boxitemlefthere_one {
display: flex;
justify-content: center;
align-items: center;
.flex_startone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 16rpx;
color: #FF7127;
}
.flex_starttow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #FF7127;
}
}
.fivecontent_item_boxitemlefthere_tow {
margin-left: 4rpx;
padding: 2rpx 10rpx;
border-radius: 4rpx 4rpx 4rpx 4rpx;
border: 2rpx solid #FF7127;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 16rpx;
color: #FF7127;
}
.fivecontent_item_boxitemlefthere_there {
margin-left: 6rpx;
line-height: 24rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #999999;
text-decoration-line: line-through;
}
}
.indexboxitemleftthere_countdown {
width: 100%;
padding-right: 7rpx;
margin-top: 2rpx;
.indexboxitemleftthere_countdowntext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
padding-bottom: 8rpx;
}
.indexboxitemleftthere_countdowntexts {
font-family: Roboto, Roboto;
font-weight: 400;
color: #333333;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 16rpx;
color: #FFFFFF;
}
}
}
}
}
}
}
}
}
</style>

65
pages/index/text.vue Normal file
View File

@@ -0,0 +1,65 @@
<template>
<view>
<Nav />
<view class="content" :style="{ marginTop: `${store.height}px` }">
<!-- 轮播图 -->
<swipers :carousel='hometoplist.carousel'></swipers>
</view>
</view>
</template>
<script setup>
import {
ref,
computed,
onMounted
} from "vue";
import {
onLoad,
onReady,
onShow
} from '@dcloudio/uni-app'
import swipers from './components/swiper.vue' //引入轮播
import popupad from '@/components/popupad.vue'
import diamond from './components/diamond.vue'
import todaylist from './components/todaylist.vue'
import productlist from './components/productlist.vue'
import advertisement from './components/advertisement.vue'
import category from '@/components/qiyue-category/qiyue-category.vue';
import indexs from './indexs.vue';
import Nav from '@/components/indexnav.vue'; //导航栏
import {
useNavbarStore
} from '@/stores/navbarStore';
const store = useNavbarStore();
// 动态更新导航栏配置
store.updateNavbarConfig({
showBack: true, //左边返回键
rightText: '', //右边文字
showSearch: true, //true是标题其他事文字
title: '我的页面',
isTransparent: false,
hasPlaceholder: false //是否要占位符
});
const targetObj = {
a: 1
};
const sourceObj1 = {
b: 2
};
const sourceObj2 = {
c: 3
};
// 将 sourceObj1 和 sourceObj2 的属性复制到 targetObj
const result = Object.assign(targetObj, sourceObj1, sourceObj2);
console.log(result);
</script>
<style lang="scss">
.content {
height: 1000vh;
}
</style>