首页
This commit is contained in:
216
pages/index/components/advertisement.vue
Normal file
216
pages/index/components/advertisement.vue
Normal 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>
|
||||
115
pages/index/components/category.vue
Normal file
115
pages/index/components/category.vue
Normal 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>
|
||||
113
pages/index/components/diamond.vue
Normal file
113
pages/index/components/diamond.vue
Normal 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>
|
||||
309
pages/index/components/productlist.vue
Normal file
309
pages/index/components/productlist.vue
Normal 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>
|
||||
58
pages/index/components/swiper.vue
Normal file
58
pages/index/components/swiper.vue
Normal 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>
|
||||
243
pages/index/components/todaylist.vue
Normal file
243
pages/index/components/todaylist.vue
Normal 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>
|
||||
Reference in New Issue
Block a user