咖啡饮品提交

This commit is contained in:
duan
2025-03-11 14:56:37 +08:00
parent c1917c5fa3
commit d4240c4012
28 changed files with 1666 additions and 286 deletions

View File

@@ -1,4 +1,264 @@
<template>
2
<view class="content">
<view class="onecontent">
<image class="onecontentimage" :src="datas.toplist.coverImg" mode="aspectFill"></image>
<!-- 小内切圆 -->
<view class="after"></view>
<view class="onecontentabsolute">
</view>
</view>
<view class="twocontent" v-for="(item, index) in datas.list" :key="index" @click="clickproduct(item)">
<view class="df twoBox">
<view class="df ">
<image :src="item.logo" style="width: 50rpx;height: 50rpx;margin-right: 10rpx;" mode="">
</image>
<view class="">
{{ item.shopName }}
</view>
</view>
<view class="">
{{ item.distance }}m
</view>
</view>
<view class="df" style=" justify-content: space-between; flex-wrap: wrap; padding: 30rpx 0rpx;">
<image :src="item.coverImg" style="width: 192rpx;height: 192rpx;" mode=""></image>
<view style="margin-left: 24rpx; flex: auto;">
<view class="df" style="justify-content: space-between; flex-wrap: wrap;">
<view style="font-weight: 500; font-size: 28rpx; color: #333333;">{{ item.name }}</view>
<view style=" font-weight: 400; font-size: 24rpx; color: #999999;">已抢{{ item.saleNum
}}
</view>
</view>
<view class="indexboxitemleftthere " style="">
<view class="df" style="align-items: normal;">
<view class="df">
<text
style=" font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 500; font-size: 16rpx; color: #FF7127;">
到手
</text>
<text
style="font-weight: 500; font-size: 24rpx; color: #FF7127;">{{item.salePrice}}</text>
<view style=" 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;">
{{item.discount}}
</view>
<text style=" margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #999999;
text-decoration-line: line-through;">{{item.originPrice}}</text>
</view>
<view style=" position: absolute;
top: 16rpx;
right: 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 24rpx;
color: #FFFFFF;">
马上抢
</view>
</view>
<view class="df" style="justify-content: space-between;">
<view
style="font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 400; font-size: 24rpx; color: #999999; padding-bottom: 8rpx;">
共省{{item.originPrice-item.salePrice}}
</view>
<view
style=" font-family: Source Han Sans CN, Source Han Sans CN; font-weight: bold; font-size: 16rpx;margin-right: 12rpx; color: #FFFFFF;">
<uni-countdown :show-day="false" :hour="convertMilliseconds(item.endTime).hours"
:minute="convertMilliseconds(item.endTime).minutes"
:second="convertMilliseconds(item.endTime).seconds" :indexs='index' color="#FFFFFF"
border-color="#00B26A" splitorColor="#FFFFFF" :font-size="7"></uni-countdown>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup></script>
<script setup>
import {
onLoad
} from '@dcloudio/uni-app';
import {
APIhome,
userdict
} from "@/common/api/index/index.js"
import {
reactive
} from 'vue';
let datas = reactive({
titlename: '咖啡',
opacitys: false,
toplist: "",
list: []
})
onLoad(() => {
getList()
})
function clickproduct(item) {
uni.pro.navigateTo('product/index', {
id: item.id
})
}
async function getList() {
let ele = await userdict({
type: "group"
})
datas.toplist = ele
let res = await APIhome({
lng: uni.cache.get('getLocationstorage').lng,
lat: uni.cache.get('getLocationstorage').lat,
address: uni.cache.get('getLocationstorage').address, //地址
categoryId: 1,
orderType: 0,
name: '',
page: 1, //页数
size: 10, //页容量
distanceType: ''
})
datas.list = res.records
}
function convertMilliseconds(milliseconds) {
// 计算天数
const days = Math.floor(milliseconds / 86400000);
// 计算剩余的毫秒数
milliseconds %= 86400000;
// 计算小时数
const hours = Math.floor(milliseconds / 3600000);
// 计算剩余的毫秒数
milliseconds %= 3600000;
// 计算分钟数
const minutes = Math.floor(milliseconds / 60000);
// 计算剩余的毫秒数
milliseconds %= 60000;
// 计算秒数
const seconds = Math.floor(milliseconds / 1000);
return {
days,
hours,
minutes,
seconds
};
}
</script>
<style scoped lang="scss">
page {
background-color: #f9f9f9;
}
.content {
.onecontent {
width: 100%;
height: 492rpx;
position: relative;
.onecontentimage {
position: absolute;
width: 100%;
height: 100%;
top: 0;
}
.after {
position: absolute;
bottom: 32rpx;
right: 0;
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);
}
.onecontentabsolute {
position: absolute;
width: 100%;
padding: 0 52rpx;
bottom: 64rpx;
.onecontentabsoluteitem {
padding: 8rpx 16rpx;
background: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
image {
width: 24.16rpx;
height: 29.31rpx;
}
input {
padding: 0 16rpx;
flex: auto;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.onecontentabsoluteitembotton {
width: 120rpx;
height: 56rpx;
line-height: 56rpx;
text-align: center;
background: linear-gradient(109deg, #FF9D84 0%, #FFFFFF 100%);
border-radius: 28rpx 28rpx 28rpx 28rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 24rpx;
color: #333333;
}
}
}
}
.twocontent {
padding: 20rpx 40rpx;
.twoBox {
background-color: #fff;
justify-content: space-between;
padding: 30rpx 0rpx;
border-bottom: 1rpx solid #ccc;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
}
.indexboxitemleftthere {
position: relative;
margin-top: 30rpx;
padding: 16rpx 0;
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%;
}
.df {
display: flex;
align-items: center;
}
}
</style>

View File

@@ -1,7 +1,5 @@
<template>
<view class="content">
<!-- 占位符导航栏 -->
<navseat :opacity='opacity' :title='titlename' :titleshow='true'></navseat>
<view class="onecontent">
<view class="onecontentabsolute"></view>
</view>
@@ -16,19 +14,18 @@
<view class="towcontentoneboxswiper">
<swiper class="swiper" circular :autoplay='true' :vertical='true' display-multiple-items="4"
:interval="'3000'">
<swiper-item class="swiperitem" v-for="(item,index) in orderfindWiningUserlist"
<swiper-item class="swiperitem" v-for="(item, index) in orderfindWiningUserlist"
:key="index">
<view class="swiper-item">{{item.userName}}* 免单{{item.orderAmount}}元订单号{{item.orderNo}}
<view class="swiper-item">{{ item.userName }}* 免单{{ item.orderAmount }}元订单号{{ item.orderNo }}
</view>
</swiper-item>
</swiper>
</view>
</view>
</view>
<view class="towcontentoness">
<view class="towcontentonebox_box">
订单数{{total}}
订单数10
</view>
<view class="towcontentonebox">
<view class="towcontentoneboxswiper">
@@ -43,36 +40,19 @@
金额
</view>
</view>
<view class="swiperitem" v-for="(item,index) in ordermineWinnerList" :key="index">
<view class="swiperitem" v-for="(item, index) in ordermineWinnerList" :key="index">
<view class="swiper-item" style="margin-top: 32rpx;">
<view class="swiper_itemone">
{{item.isRefund == true ? '已免单':'待免单'}}
{{ item.isRefund == true ? '已免单' : '待免单' }}
</view>
<view class="swiper_itemtow">
{{item.orderNo}}
{{ item.orderNo }}
</view>
<view class="swiper_itemthere">
{{item.orderAmount}}
{{ item.orderAmount }}
</view>
</view>
</view>
<!-- <swiper class="swiper" circular :autoplay='true' :vertical='true' interval="3000"
display-multiple-items="4">
<swiper-item class="swiperitem" v-for="(item,index) in orderfindWiningUserlist"
:key="index">
<view class="swiper-item">
<view class="swiper_itemone">
{{item.orderAmount}}
</view>
<view class="swiper_itemtow">
{{item.orderNo}}
</view>
<view class="swiper_itemthere">
{{item.isRefund == true ? '已免单':'待免单'}}
</view>
</view>
</swiper-item>
</swiper> -->
</view>
</view>
</view>
@@ -83,295 +63,266 @@
</view>
</template>
<script>
import {
forEach
} from 'lodash';
import navseat from '@/components/navseat.vue'
export default {
components: {
navseat
},
data() {
return {
titlename: '',
opacity: false,
orderfindWiningUserlist: [],
ordermineWinnerList: [],
form: {
address: '', //地址
type: '', //品类
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
other: '', //附近1KM 1选中 0不选中
page: 1, //页数
size: 10, //页容量
status: 'loadmore'
},
total:0
};
},
onLoad(e) {
this.orderfindWiningUser()
this.ordermineWinnerEvent()
let _this = this
uni.getStorage({
key: 'itemData',
success: function(res) {
_this.titlename = res.data.name
}
});
},
onReachBottom() {
this.ordermineWinnerEvent()
},
onPageScroll(e) {
if (e.scrollTop <= 44) { //搜索导航栏
this.opacity = false
} else {
this.opacity = true
}
},
methods: {
<script setup>
import {
reactive,
ref
} from 'vue';
let orderfindWiningUserlist = ref([{
userName: "王*",
orderAmount: 12,
orderNo: 213504512353548688546
}, {
userName: "赵*",
orderAmount: 48,
orderNo: 65481188834105643623210
}, {
userName: "钱*",
orderAmount: 91,
orderNo: 5891051346764518249444
}, {
userName: "孙*",
orderAmount: 84,
orderNo: 688472546798742575342
}, {
userName: "王",
orderAmount: 73,
orderNo: 597344582826533594131
}, {
userName: "郑*",
orderAmount: 98,
orderNo: 469867684658481051627
}, {
userName: "凯*",
orderAmount: 95,
orderNo: 895961781634536230631
},
cut(str, firstStr, lastStr) {
let start = str.indexOf(firstStr);
let end = str.lastIndexOf(lastStr);
return str.slice(start, end + 1); //slice方法截取的部分不包括第二参数所在位置
},
async ordermineWinnerEvent() {
let res = await this.api.ordermineWinner({
userId: uni.getStorageSync('userInfo').id,
page: this.form.page,
size: this.form.size
})
if(res.code ==0){
this.total = res.data.total
if(this.form.page==1){
this.ordermineWinnerList = res.data.list
}else{
this.ordermineWinnerList.push(...res.data.list)
}
this.form.page = ++this.form.page;
}
},
async orderfindWiningUser() {
let res = await this.api.orderfindWiningUser()
this.orderfindWiningUserlist = res.data.map((i) => {
i.userName = i.userName.slice(0, 1)
return i
})
}
}
};
])
let ordermineWinnerList = ref([{
isRefund: true,
orderNo: 895961781634536230631,
orderAmount: "95"
},
{
isRefund: true,
orderAmount: 74,
orderNo: 222674526516892311380
},
{
isRefund: false,
orderAmount: 23,
orderNo: 862674526546892311380
},
])
</script>
<style scoped lang="scss">
page {
background: #F9F9F9;
page {
background: #F9F9F9;
}
.content {
.onecontent {
width: 100%;
height: 684.19rpx;
position: relative;
background: linear-gradient(96deg, #F9F2D9 0%, #FBE1DA 100%);
.onecontentabsolute {
position: absolute;
top: 0;
height: 534.19rpx;
width: 100%;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/mrmd.png) no-repeat;
background-size: 100% 100%;
}
}
.content {
.onecontent {
width: 100%;
height: 684.19rpx;
position: relative;
background: linear-gradient(96deg, #F9F2D9 0%, #FBE1DA 100%);
.towcontent {
position: relative;
padding: 0 28rpx;
width: 100%;
margin-top: -100rpx;
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(249, 242, 217, 0.77) 10%, #F5DFDF 100%);
.onecontentabsolute {
.towcontentone {
position: relative;
width: 100%;
background: linear-gradient(180deg, rgba(255, 241, 204, 0.77) 0%, rgba(255, 255, 255, 0.56) 40%, #FFFFFF 100%);
border-radius: 30rpx 30rpx 30rpx 30rpx;
border: 2rpx solid #FFFFFF;
padding: 32rpx 24rpx;
.towcontentoneimage {
position: absolute;
top: 0;
height: 534.19rpx;
top: -30rpx;
left: 50%;
transform: translatex(-50%);
width: 118rpx;
height: 46rpx;
}
.towcontentonebox {
width: 100%;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/mrmd.png) no-repeat;
background-size: 100% 100%;
.towcontentoneboximage {
width: 171.63rpx;
height: 37.24rpx;
}
.towcontentoneboxswiper {
width: 100%;
padding-top: 24rpx;
overflow: hidden;
.swiper {
height: 242rpx;
.swiperitem {
height: 40rpx;
.swiper-item {
display: block;
height: 40rpx;
text-align: left;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
}
}
}
}
.towcontent {
position: relative;
padding: 0 28rpx;
.towcontentoness {
margin-top: 48rpx;
width: 100%;
margin-top: -100rpx;
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(249, 242, 217, 0.77) 10%, #F5DFDF 100%);
background: rgba(255, 255, 255, 0.96);
border-radius: 30rpx 30rpx 30rpx 30rpx;
padding: 38rpx 48rpx;
.towcontentone {
position: relative;
width: 100%;
background: linear-gradient(180deg, rgba(255, 241, 204, 0.77) 0%, rgba(255, 255, 255, 0.56) 40%, #FFFFFF 100%);
.towcontentonebox_box {
margin: 0 auto;
text-align: center;
width: 262rpx;
height: 58rpx;
line-height: 58rpx;
background: #FFA436;
border-radius: 30rpx 30rpx 30rpx 30rpx;
border: 2rpx solid #FFFFFF;
padding: 32rpx 24rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
}
.towcontentoneimage {
position: absolute;
top: -30rpx;
left: 50%;
transform: translatex(-50%);
width: 118rpx;
height: 46rpx;
.towcontentonebox {
width: 100%;
.towcontentoneboximage {
width: 171.63rpx;
height: 37.24rpx;
}
.towcontentonebox {
width: 100%;
.swiper-item {
display: flex;
justify-content: space-between;
align-items: center;
.towcontentoneboximage {
width: 171.63rpx;
height: 37.24rpx;
.swiper_itemone {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.towcontentoneboxswiper {
width: 100%;
padding-top: 24rpx;
overflow: hidden;
.swiper_itemtow {
width: auto;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.swiper {
height: 242rpx;
.swiper_itemthere {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.swiperitem {
height: 40rpx;
.towcontentoneboxswiper {
width: 100%;
// height: 242rpx;
padding-top: 24rpx;
overflow: hidden;
.swiper-item {
display: block;
height: 40rpx;
text-align: left;
.swiper {
height: 230rpx;
.swiperitem {
height: 40rpx;
.swiper-item {
display: flex;
justify-content: space-between;
align-items: center;
.swiper_itemone {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.swiper_itemtow {
width: auto;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.swiper_itemthere {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
}
}
}
}
.towcontentoness {
margin-top: 48rpx;
width: 100%;
background: rgba(255, 255, 255, 0.96);
border-radius: 30rpx 30rpx 30rpx 30rpx;
padding: 38rpx 48rpx;
.towcontentonebox_box {
margin: 0 auto;
text-align: center;
width: 262rpx;
height: 58rpx;
line-height: 58rpx;
background: #FFA436;
border-radius: 30rpx 30rpx 30rpx 30rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
}
.towcontentonebox {
width: 100%;
.towcontentoneboximage {
width: 171.63rpx;
height: 37.24rpx;
}
.swiper-item {
display: flex;
justify-content: space-between;
align-items: center;
.swiper_itemone {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.swiper_itemtow {
width: auto;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.swiper_itemthere {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.towcontentoneboxswiper {
width: 100%;
// height: 242rpx;
padding-top: 24rpx;
overflow: hidden;
.swiper {
height: 230rpx;
.swiperitem {
height: 40rpx;
.swiper-item {
display: flex;
justify-content: space-between;
align-items: center;
.swiper_itemone {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.swiper_itemtow {
width: auto;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.swiper_itemthere {
width: 25%;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
}
}
}
}
}
.towcontenttow {
margin-top: 32rpx;
padding-bottom: 144rpx;
text-align: center;
width: 100%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.towcontenttow {
margin-top: 32rpx;
padding-bottom: 144rpx;
text-align: center;
width: 100%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
}
</style>

View File

@@ -23,11 +23,11 @@
color="#333333" size="12"></up-icon>
</view>
</view>
<!-- <view class="componentsclass" v-if="showproductlist">
<view class="componentsclass" v-if="showproductlist">
<AreaSelect v-if="viewHistoryindex == 0" @updateValue="openproductlist" />
<grouping v-if="viewHistoryindex == 1 || viewHistoryindex == 2 || viewHistoryindex == 3"
@grouping="openproductlist" />
</view> -->
</view>
</view>
<!-- 首页抢购区域 -->