This commit is contained in:
lSun 2025-01-02 20:42:29 +08:00
parent af354773ad
commit 6ed9d77dc1
12 changed files with 147 additions and 84 deletions

View File

@ -173,6 +173,18 @@
{ {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/code/index",
"style": {
"navigationBarTitleText": "个人二维码"
}
},
{
"path": "pages/weeklyMenu/index",
"style": {
"navigationBarTitleText": "一周菜谱"
}
} }
], ],
"tabBar": { "tabBar": {

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="page"> <view class="work-container">
<!-- 标题 --> <!-- 标题 -->
<view class="title">出示二维码支付</view> <view class="title">出示二维码支付</view>
@ -7,13 +7,16 @@
<view class="subtitle">冯武鹏</view> <view class="subtitle">冯武鹏</view>
<!-- 二维码 --> <!-- 二维码 -->
<image class="qr-code" src="https://example.com/qr-code.png" mode="aspectFill"></image> <image class="qr-code" src="/static/images/code.png" mode="aspectFill"></image>
<!-- 有效期 --> <!-- 有效期 -->
<view class="valid-time">有效时间15分钟</view> <view class="valid-time">有效时间15分钟</view>
<!-- 刷新按钮 --> <!-- 刷新按钮 -->
<u-button class="refresh-button" type="primary" @click="refreshQrCode">刷新二维码</u-button> <!-- <u-button class="refresh-button" type="primary" @click="refreshQrCode">刷新二维码</u-button> -->
<view class="action-btn">
<button @click="refreshQrCode" class="login-btn cu-btn block bg-blue lg round">刷新二维码</button>
</view>
</view> </view>
</template> </template>
@ -21,57 +24,76 @@
export default { export default {
data() { data() {
return { return {
qrCodeUrl: 'https://example.com/qr-code.png' // URL qrCodeUrl: '/static/images/code.png' // URL
}; };
}, },
methods: { methods: {
refreshQrCode() { refreshQrCode() {
// //
this.qrCodeUrl = `https://example.com/qr-code-${Math.random()}.png`; this.qrCodeUrl = `/static/images/code.png`;
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>
.page { page {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; box-sizing: border-box;
padding: 20px; background-color: #F9FBFF;
background-color: #f0f8ff; /* 背景颜色 */ min-height: 100%;
height: auto;
}
.work-container {
background-color: #FFFFFF;
text-align: center;
} }
.title { .title {
font-size: 24px; font-size: 22px;
color: #333; color: #333;
margin-bottom: 10px; margin-bottom: 10px;
font-weight: 600;
} }
.subtitle { .subtitle {
font-size: 18px; font-size: 18px;
color: #666; color: #333;
margin-bottom: 20px; margin-bottom: 20px;
font-weight: 600;
} }
.qr-code { .qr-code {
width: 300px; /* 二维码宽度 */ width: 200px;
height: 300px; /* 二维码高度 */ /* 二维码宽度 */
height: 200px;
/* 二维码高度 */
margin-bottom: 20px; margin-bottom: 20px;
} }
.valid-time { .valid-time {
font-size: 16px; font-size: 16px;
color: #666; color: #666;
margin-bottom: 40px; margin-bottom: 100px;
} }
.refresh-button { .refresh-button {
width: 100%; width: 100%;
max-width: 300px; max-width: 300px;
height: 50px; height: 35px;
border-radius: 25px; border-radius: 25px;
background-color: #e97c3d; /* 按钮背景颜色 */ background-color: #e97c3d;
color: #fff; /* 按钮文字颜色 */ /* 按钮背景颜色 */
color: #fff;
/* 按钮文字颜色 */
}
.login-btn {
height: 35px;
margin-left: 30rpx;
margin-right: 30rpx;
background-color: #e97c3d;
} }
</style> </style>

View File

@ -6,16 +6,12 @@
</view> </view>
<!-- 轮播图 --> <!-- 轮播图 -->
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content"> <u-swiper :list="bannerList" @change="handleSwiperChange" :autoplay="true" :interval="3000"></u-swiper>
<swiper class="swiper-box" :current="swiperDotIndex" :autoplay="true" :interval="3000" <!-- 指示器 -->
@change="changeSwiper"> <view class="external-indicator">
<swiper-item v-for="(item, index) in data" :key="index"> <view v-for="(item, index) in bannerList" :key="index" class="indicator-dot"
<view class="swiper-item" @click="clickBannerItem(item)"> :class="{ 'active': index === current }"></view>
<image :src="item.image" mode="aspectFill" :draggable="false" />
</view> </view>
</swiper-item>
</swiper>
</uni-swiper-dot>
<!-- 功能按钮区 --> <!-- 功能按钮区 -->
<view class="function-area"> <view class="function-area">
@ -68,16 +64,17 @@
return { return {
current: 0, current: 0,
swiperDotIndex: 0, swiperDotIndex: 0,
data: [{ bannerList: [
image: '/static/images/banner/banner01.jpg' '/static/images/banner/banner01.jpg',
}, '/static/images/banner/banner1.jpg',
{ '/static/images/banner/01.jpg',
image: '/static/images/banner/banner02.jpg' '/static/images/banner/banner4.jpg',
}, ],
{ list5: [
image: '/static/images/banner/banner03.jpg' 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
} 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
] 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
],
} }
}, },
methods: { methods: {
@ -102,6 +99,10 @@
url: '/pages/code/index' url: '/pages/code/index'
}) })
}, },
handleSwiperChange(e) {
this.current = e.current; //
}
},
goToRemainingSum() { goToRemainingSum() {
// / // /
uni.navigateTo({ uni.navigateTo({
@ -113,6 +114,31 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.external-indicator {
display: flex;
justify-content: center;
margin-top: 10px;
/* 与轮播图之间的间距 */
}
.indicator-dot {
width: 24px;
/* 长方形宽度 */
height: 4px;
/* 长方形高度 */
background-color: rgba(15, 39, 75, 0.5);
/* 默认颜色 */
margin: 0 5px;
transition: all 0.3s ease-in-out;
/* 添加过渡效果 */
border-radius: 4px 4px 4px 4px;
}
.active {
background: #0F274B;
/* 选中时的颜色 */
}
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
page { page {
display: flex; display: flex;
@ -147,7 +173,7 @@
.function-area { .function-area {
margin-top: 30rpx; margin-top: 30rpx;
border-radius: 12rpx; border-radius: 16rpx;
padding: 0rpx; padding: 0rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -228,6 +254,7 @@
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
margin-bottom: -60rpx; margin-bottom: -60rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -253,6 +280,7 @@
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
margin-bottom: -60rpx; margin-bottom: -60rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -272,6 +300,7 @@
display: flex; display: flex;
align-items: baseline; align-items: baseline;
margin-left: -50rpx; margin-left: -50rpx;
.currency { .currency {
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;

BIN
static/images/banner/01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 KiB

BIN
static/images/banner/02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 KiB

BIN
static/images/banner/03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
static/images/banner/04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

BIN
static/images/code.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB