1、报名成功的按钮边框,以及订单详情里的二维码边框展示不全
2.个人中心-我的发布,列表里的按钮位置修改 3.banner上的标题,文字内容无法正常展示 4.订单详情页里的展示内容,间距问题要改
This commit is contained in:
parent
388e11e43a
commit
730079ce49
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
unpackage
|
||||
dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
@ -9,10 +10,10 @@ yarn-error.log*
|
||||
tests/**/coverage/
|
||||
tests/e2e/reports
|
||||
selenium-debug.log
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
.history
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
|
@ -1,42 +1,12 @@
|
||||
<template>
|
||||
<view class="swiper_s">
|
||||
<swiper class="swiper_s" :autoplay="autoplaySwiper" indicator-active-color="#0DAE11" indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent" @change="swiperChange">
|
||||
<swiper class="swiper_s" :autoplay="false" indicator-active-color="#0DAE11" indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent" @change="swiperChange">
|
||||
<swiper-item v-for="(item,index) in list" :key="index">
|
||||
<span class="fnon_tit"><span class="text">{{ item.title?item.title:'' }}</span></span>
|
||||
<view class="fnon_tit">
|
||||
<view class="text">{{ item.title?item.title:'' }}</view>
|
||||
</view>
|
||||
<!-- @click="click(item.url)" 跳转活动链接 -->
|
||||
<image class="swiper-image" v-if="isImageUrl(item.image)" :src="item.image" mode="scaleToFill" lazy-load />
|
||||
<div style="height: 100%;width: 100%;position: relative;" v-else>
|
||||
|
||||
<!-- #ifdef APP -->
|
||||
<MyVideo :item="item" :isPlay="!isShow && videoId == item.id" @onEnded="endVideo(item.id)" />
|
||||
<view v-if="isShow"
|
||||
style="z-index:99;position: absolute;width:100%;height:100%;top:0;left:0;display:flex; justify-content:center; align-items:center;">
|
||||
<image @click.stop="plays(item.id,index)" src="@/static/bofang.png"
|
||||
style="width: 40px;height: 40px;"></image>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<video class="swiper-video" :id="`Video${item.id}`" :src="item.image" :autoplay="true"
|
||||
:controls="true" :show-center-play-btn="false" :enable-progress-gesture="false"
|
||||
@ended="endVideo(item.id)" @loadedmetadata="loadVideo(item.id)" />
|
||||
<cover-view v-if="isShow"
|
||||
style="z-index:99;position: absolute;width:100%;height:100%;top:0;left:0;display:flex; justify-content:center; align-items:center;">
|
||||
<cover-image @click.stop="plays(item.id,index)" src="@/static/bofang.png"
|
||||
style="width: 40px;height: 40px;"></cover-image>
|
||||
</cover-view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<video class="swiper-video" :id="`Video${item.id}`" :src="item.image" :autoplay="true" :controls="false"
|
||||
:show-center-play-btn="false" :enable-progress-gesture="false" @ended="endVideo(item.id)" />
|
||||
<view v-if="isShow"
|
||||
style="z-index:99;position: absolute;width:100%;height:100%;top:0;left:0;display:flex; justify-content:center; align-items:center;">
|
||||
<image @click.stop="plays(item.id,index)" src="@/static/bofang.png"
|
||||
style="width: 40px;height: 40px;"></image>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
<image class="swiper-image" v-if="isImageUrl(item.image)" :src="item.image" mode="scaleToFill" />
|
||||
</swiper-item>
|
||||
|
||||
</swiper>
|
||||
@ -70,7 +40,7 @@
|
||||
data() {
|
||||
return {
|
||||
swiperCurrent: 0, //轮播下标
|
||||
autoplaySwiper: true,
|
||||
autoplaySwiper: false,
|
||||
isShow: true,
|
||||
videoIndex: null,
|
||||
videoId: null,
|
||||
@ -79,43 +49,7 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// #ifdef MP-WEIXIN
|
||||
const regex = /^(http|https):\/\//;
|
||||
this.list.forEach(v => {
|
||||
const bool = regex.test(v.url);
|
||||
if (!bool) {
|
||||
const fs = uni.getFileSystemManager();
|
||||
const res = new Promise((resolve, reject) => {
|
||||
fs.readFile({
|
||||
filePath: v.url, // 相对于static目录的路径
|
||||
encoding: 'base64',
|
||||
success: (res) => {
|
||||
v.url = res.data
|
||||
// 为临时文件生成一个文件名,您可以根据需要自定义文件名
|
||||
const fileName = `temp_video_${Date.now()}.mp4`;
|
||||
// 指定临时文件的完整路径
|
||||
const tempFilePath = `${uni.env.USER_DATA_PATH}/${fileName}`;
|
||||
// 将Base64编码的数据写入临时文件
|
||||
fs.writeFile({
|
||||
filePath: tempFilePath, // 临时文件路径
|
||||
data: v.url, // Base64数据(去掉数据URI部分)
|
||||
encoding: 'base64', // 指定编码格式为base64
|
||||
success: () => {
|
||||
v.url = tempFilePath
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('写入文件失败:', err);
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('读取视频文件失败:', err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
@ -213,7 +147,7 @@
|
||||
bottom: 30rpx;
|
||||
.text {
|
||||
position: relative; /* 确保文字在模糊背景之上 */
|
||||
z-index: 10; /* 确保文字位于最上层 */
|
||||
z-index: 110; /* 确保文字位于最上层,高于伪元素 */
|
||||
}
|
||||
}
|
||||
.fnon_tit::after {
|
||||
@ -223,6 +157,7 @@
|
||||
backdrop-filter: blur(4px); /* 调整模糊程度 */
|
||||
pointer-events: none; /* 确保模糊效果不会干扰点击事件 */
|
||||
border-radius: 36rpx;
|
||||
z-index: 10; /* 确保伪元素在背景和文字之间 */
|
||||
}
|
||||
.dots {
|
||||
position: absolute;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,12 +9,12 @@
|
||||
<image class="head_img" v-if="detail.images.length > 0" :src="detail.images[0]" mode="" ></image>
|
||||
<view style="margin-left: 20rpx;">
|
||||
<view class="flex align-items">
|
||||
<span class="first-name">{{detail.title}}</span>
|
||||
<text class="first-name">{{detail.title}}</text>
|
||||
</view>
|
||||
<view class="first-image flex align-items" style="margin-top: 25rpx;">
|
||||
<image :src="detailAny.user.avatar" mode="" style="width: 36rpx;height: 36rpx;border-radius: 80rpx ;"></image>
|
||||
<span style="color:#9C9C9C;">{{ detailAny.user.nickname }}</span>
|
||||
<span style="color:#9C9C9C;margin-left: 20rpx;">{{ detailAny.join_info.people_number }}人玩过</span>
|
||||
<text style="color:#9C9C9C;">{{ detailAny.user.nickname }}</text>
|
||||
<text style="color:#9C9C9C;margin-left: 20rpx;">{{ detailAny.join_info.people_number }}人玩过</text>
|
||||
</view>
|
||||
<view class="flex align-items" style="margin-top: 20rpx;">
|
||||
¥{{detailAny.totalprice}}
|
||||
@ -22,22 +22,22 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<span class="line"></span>
|
||||
<span class="first-image flex align-items" style="margin-top: 20rpx;">
|
||||
<text class="line"></text>
|
||||
<view class="first-image flex align-items">
|
||||
<image src="../../static/center/Alarm.png" mode="" class="icon-size"></image>
|
||||
<span>{{formattedTime.formattedTime}}</span>
|
||||
</span>
|
||||
<span class="line"></span>
|
||||
<text>{{formattedTime.formattedTime}}</text>
|
||||
</view>
|
||||
<text class="line"></text>
|
||||
|
||||
<span class="first-image flex align-items space-between"
|
||||
<view class="first-image flex align-items space-between"
|
||||
style="width: 100%;"
|
||||
@click.stop="toMap(detail.latitude, detail.longitude, detail.address_detail)">
|
||||
<view class="flex">
|
||||
<image src="/static/center/address.png" mode="" class="icon-size"></image>
|
||||
<span>{{detail.address_detail}}</span>
|
||||
<text>{{detail.address_detail}}</text>
|
||||
</view>
|
||||
<image src="/static/detail/daohang.png" class="icon-size" style="width: 48rpx; height: 48rpx;"></image>
|
||||
</span>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
@ -45,9 +45,9 @@
|
||||
</view>
|
||||
<view class="third flex flex-column" style="justify-content: flex-start;">
|
||||
<view class="third-top flex align-items">
|
||||
<span>核销二维码
|
||||
<view>核销二维码
|
||||
<image class="icons" src="/static/detail/xiangqing.png"></image>
|
||||
</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="third-center">
|
||||
<qrcode-swiper :images="qrimages" @onSwiperChanges="onSwiperChanges"> </qrcode-swiper>
|
||||
@ -57,7 +57,7 @@
|
||||
</l-painter-view>
|
||||
</l-painter> -->
|
||||
<view class="bottom">
|
||||
<span>左右滑动二维码核销({{qrindex}}/{{detailAny.num}})张</span>
|
||||
<text>左右滑动二维码核销({{qrindex}}/{{detailAny.num}})张</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -66,28 +66,28 @@
|
||||
<view class="third flex flex-column" style="justify-content: flex-start;">
|
||||
<view class="third-center">
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 8rpx;" >
|
||||
<span>订单状态</span>
|
||||
<span v-if="detailAny.status == 2 || detailAny.status == 3 || detailAny.status == 4">待核销</span>
|
||||
<text>订单状态</text>
|
||||
<text style="color: #323232;" v-if="detailAny.status == 2 || detailAny.status == 3 || detailAny.status == 4">待核销</text>
|
||||
</view>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 8rpx;" >
|
||||
<span>订单编号</span>
|
||||
<span>{{detailAny.order_no}}</span>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 40rpx;" >
|
||||
<text>订单编号</text>
|
||||
<text style="color: #323232;">{{detailAny.order_no}}</text>
|
||||
</view>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 8rpx;" >
|
||||
<span>创建时间</span>
|
||||
<span>{{ formattime(detailAny.createtime)}}</span>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 40rpx;" >
|
||||
<text>创建时间</text>
|
||||
<text style="color: #323232;">{{ formattime(detailAny.createtime)}}</text>
|
||||
</view>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 8rpx;" >
|
||||
<span>付款金额</span>
|
||||
<span style="color: #FF4810;">¥{{detailAny.totalprice}}</span>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 40rpx;" >
|
||||
<text>付款金额</text>
|
||||
<text style="color: #FF4810;font-weight: 600;">¥{{detailAny.totalprice}}</text>
|
||||
</view>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 8rpx;" >
|
||||
<span>付款方式</span>
|
||||
<span>{{detailAny.pay_type == 'wechat' ? '微信支付' : '余额'}}</span>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 40rpx;" >
|
||||
<text>付款方式</text>
|
||||
<text style="color: #323232;">{{detailAny.pay_type == 'wechat' ? '微信支付' : '余额'}}</text>
|
||||
</view>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 8rpx;" >
|
||||
<span>付款时间</span>
|
||||
<span>{{ formattime(detailAny.createtime)}}</span>
|
||||
<view class="flex w-100 space-between hui align-items" style="margin-top: 40rpx;" >
|
||||
<text>付款时间</text>
|
||||
<text style="color: #323232;">{{ formattime(detailAny.createtime)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -96,7 +96,7 @@
|
||||
<view class="footer flex align-items flex-column" style="justify-content: space-between;" >
|
||||
|
||||
<view class="footer-right flex justify-center align-items" >
|
||||
<span @click="service(detailAny.id)"> 申请售后 </span>
|
||||
<text @click="service(detailAny.id)"> 申请售后 </text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -106,40 +106,40 @@
|
||||
@open="buyOpen" :safeAreaInsetBottom="false" :closeable="true">
|
||||
<view class="popupBox flex justify-start align-items flex-column">
|
||||
<view class="pop-header flex align-items flex-column flex-start">
|
||||
<span class="name white-space">{{detail.title}}</span>
|
||||
<span class="price">
|
||||
<span v-if="detail.feel == 0">¥{{detail.price}}</span>
|
||||
<span v-if="detail.feel == 1">公益</span>
|
||||
</span>
|
||||
<view class="name white-space">{{detail.title}}</view>
|
||||
<view class="price">
|
||||
<text v-if="detail.feel == 0">¥{{detail.price}}</text>
|
||||
<text v-if="detail.feel == 1">公益</text>
|
||||
</view>
|
||||
<!-- <image src="../../static/center/buy.png" mode="" style="width: 168rpx; height: 48rpx;">
|
||||
</image> -->
|
||||
</view>
|
||||
<view class="popup flex-column">
|
||||
<span class="first-image flex align-items" style="margin: 16rpx 0;">
|
||||
<view class="first-image flex align-items" style="margin: 16rpx 0;">
|
||||
<image src="../../static/center/Alarm.png" mode="" class="icon-size"></image>
|
||||
<span>{{formattedTime.formattedTime}} (共计{{formattedTimeList.length}}节)</span>
|
||||
</span>
|
||||
<span class="first-image flex align-items">
|
||||
<text>{{formattedTime.formattedTime}} (共计{{formattedTimeList.length}}节)</text>
|
||||
</view>
|
||||
<view class="first-image flex align-items">
|
||||
<image src="../../static/center/address.png" mode="" class="icon-size"></image>
|
||||
<span>{{detail.address_detail}}</span>
|
||||
</span>
|
||||
<text>{{detail.address_detail}}</text>
|
||||
</view>
|
||||
<!-- <image :src="detail.headimage" mode="" style="width: 200rpx; height: 140rpx;"></image>
|
||||
<view class="popur-right flex flex-column">
|
||||
<span class="name white-space">{{detail.title}}</span>
|
||||
<span class="address">地址:{{detail.address_detail}}</span>
|
||||
<span class="date">开始时间:{{detail.start_time_text}}</span>
|
||||
<span class="time">结束时间:{{detail.end_time_text}}</span>
|
||||
<span class="line-row"></span>
|
||||
<span class="price">
|
||||
<text class="name white-space">{{detail.title}}</text>
|
||||
<text class="address">地址:{{detail.address_detail}}</text>
|
||||
<text class="date">开始时间:{{detail.start_time_text}}</text>
|
||||
<text class="time">结束时间:{{detail.end_time_text}}</text>
|
||||
<text class="line-row"></text>
|
||||
<text class="price">
|
||||
课程价格:
|
||||
<span v-if="detail.feel == 0">¥{{detail.price}}</span>
|
||||
<span v-if="detail.feel == 1">免费</span>
|
||||
</span>
|
||||
<text v-if="detail.feel == 0">¥{{detail.price}}</text>
|
||||
<text v-if="detail.feel == 1">免费</text>
|
||||
</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="popup-footer flex " @click="buy()">
|
||||
<span v-if="type == 1 && detail.feel == 0">立 即 支 付</span>
|
||||
<span v-if="type == 1 && detail.feel == 1">确 认 报 名</span>
|
||||
<text v-if="type == 1 && detail.feel == 0">立 即 支 付</text>
|
||||
<text v-if="type == 1 && detail.feel == 1">确 认 报 名</text>
|
||||
<!-- <image src="../../static/center/price.png" mode="" style="width: 642rpx;height: 80rpx;"></image> -->
|
||||
<u-loading-icon :vertical="true" v-if="uloadingShow"></u-loading-icon>
|
||||
</view>
|
||||
@ -149,18 +149,18 @@
|
||||
<!-- 分享海报 -->
|
||||
<u-overlay :show="overlay" class="pos">
|
||||
<view class="btnList">
|
||||
<span class="save" @click.stop="save()">保 存 海 报</span>
|
||||
<!-- <span class="sharePoster" @click.stop="sharePoster()">
|
||||
<text class="save" @click.stop="save()">保 存 海 报</text>
|
||||
<!-- <text class="sharePoster" @click.stop="sharePoster()">
|
||||
分 享
|
||||
</span> -->
|
||||
</text> -->
|
||||
<button open-type="share" class="no-border-button" plain="true">
|
||||
<span>分 享 发 布</span>
|
||||
<text>分 享 发 布</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- <view class="Poster" style="z-index: 9999;height: 1230rpx;">
|
||||
<span class="posterClose" @click.stop="overlay = false">
|
||||
<text class="posterClose" @click.stop="overlay = false">
|
||||
<image src="../../static/center/close.png" mode="" style="width: 64rpx;height: 64rpx;"></image>
|
||||
</span>
|
||||
</text>
|
||||
|
||||
<image :src="path" mode="widthFix" style="width: 690rpx;height: 1230rpx;"></image>
|
||||
<l-painter isCanvasToTempFilePath ref="painter" @success="path = $event" hidden
|
||||
@ -842,7 +842,6 @@
|
||||
<style lang="scss" scoped>
|
||||
.detail_all{
|
||||
background-color: #f7f7f7;
|
||||
height: 100vh;
|
||||
}
|
||||
.w-100 {
|
||||
width: 100%;
|
||||
@ -937,7 +936,7 @@
|
||||
font-size: 24rpx;
|
||||
color: #7A7A7A;
|
||||
|
||||
span {
|
||||
text {
|
||||
// height: 80rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
@ -970,7 +969,7 @@
|
||||
}
|
||||
|
||||
view {
|
||||
span {
|
||||
text {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
@ -996,7 +995,7 @@
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
|
||||
span{
|
||||
view{
|
||||
position: relative;
|
||||
.icons{
|
||||
width: 37rpx;
|
||||
@ -1015,7 +1014,7 @@
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #7A7A7A;
|
||||
color: #9C9C9C;
|
||||
}
|
||||
.bottom{
|
||||
width: 100%;
|
||||
@ -1038,7 +1037,7 @@
|
||||
width: 630rpx;
|
||||
height: 1rpx;
|
||||
background: #F0F0F0;
|
||||
margin: 19rpx 0;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
|
||||
.icon-size {
|
||||
@ -1059,7 +1058,7 @@
|
||||
background: #323232;
|
||||
border-radius: 148rpx;
|
||||
margin-bottom: 30rpx;
|
||||
span {
|
||||
text {
|
||||
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
@ -1071,7 +1070,7 @@
|
||||
height: 90rpx;
|
||||
background: #E4E4E4;
|
||||
border-radius: 148rpx;
|
||||
span {
|
||||
text {
|
||||
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
@ -1092,7 +1091,7 @@
|
||||
background-position: left bottom;
|
||||
height: 265rpx;
|
||||
|
||||
span {
|
||||
text {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
@ -1118,7 +1117,7 @@
|
||||
color: #FF4810;
|
||||
margin-top: 16rpx;
|
||||
|
||||
span {
|
||||
text {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 800;
|
||||
font-size: 36rpx;
|
||||
@ -1140,7 +1139,7 @@
|
||||
left: 48rpx;
|
||||
bottom: 48rpx;
|
||||
|
||||
span {
|
||||
text {
|
||||
width: 594rpx;
|
||||
height: 100rpx;
|
||||
background: #222222;
|
||||
@ -1159,9 +1158,9 @@
|
||||
.line {
|
||||
width: 642rpx;
|
||||
height: 1rpx;
|
||||
background: #D9D9D9;
|
||||
box-shadow: 1rpx 1rpx 0rpx 0rpx rgba(102, 102, 102, 0.25);
|
||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
background: #F0F0F0;
|
||||
//box-shadow: 1rpx 1rpx 0rpx 0rpx rgba(102, 102, 102, 0.25);
|
||||
//border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
}
|
||||
|
||||
.times {
|
||||
@ -1282,7 +1281,7 @@
|
||||
font-size: 32rpx;
|
||||
color: #4B4B4B;
|
||||
|
||||
span {
|
||||
text {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 800;
|
||||
font-size: 24rpx;
|
||||
@ -1377,7 +1376,7 @@
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
|
||||
span {
|
||||
text {
|
||||
width: 250rpx;
|
||||
height: 80rpx;
|
||||
background: #FFFFFF;
|
||||
@ -1422,7 +1421,7 @@
|
||||
height: 80rpx;
|
||||
line-height: inherit;
|
||||
|
||||
span {
|
||||
text {
|
||||
width: 250rpx;
|
||||
height: 80rpx;
|
||||
background: #FFFFFF;
|
||||
|
@ -141,7 +141,7 @@
|
||||
width: 280rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 198rpx 198rpx 198rpx 198rpx;
|
||||
border: 1rpx solid #323232;
|
||||
border: 1px solid #323232;
|
||||
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
|
@ -1,127 +1,131 @@
|
||||
<template>
|
||||
<view class="carousel-container">
|
||||
<!-- 轮播主体 -->
|
||||
<swiper
|
||||
class="swiper-box"
|
||||
:current="currentIndex"
|
||||
@change="onSwiperChange"
|
||||
circular
|
||||
>
|
||||
<swiper-item v-for="(item, index) in images" :key="index" class="swiper-item">
|
||||
<image :src="item" class="swiper-image" mode="" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<!-- 控制按钮 -->
|
||||
<view class="nav-buttons">
|
||||
<view class="btn prev" @click="switchSlide(-1)">
|
||||
<image style="width: 50rpx;height: 50rpx;" src="/static/detail/left.png"></image>
|
||||
</view>
|
||||
<view class="btn next" @click="switchSlide(1)">
|
||||
<image style="width: 50rpx;height: 50rpx;" src="/static/detail/right.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 自定义指示器 -->
|
||||
<!-- <view class="dots">
|
||||
<view class="carousel-container">
|
||||
<!-- 轮播主体 -->
|
||||
<swiper class="swiper-box" :current="currentIndex" @change="onSwiperChange" circular>
|
||||
<swiper-item v-for="(item, index) in images" :key="index" class="swiper-item">
|
||||
<view style="border: 1px solid #9C9C9C;width: 280rpx;height: 280rpx;margin: 0 auto;border-radius: 8rpx;">
|
||||
<image :src="item" class="swiper-image" mode="aspectFill" />
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<!-- 控制按钮 -->
|
||||
<view class="nav-buttons">
|
||||
<view class="btn prev" @click="switchSlide(-1)">
|
||||
<image style="width: 50rpx;height: 50rpx;" src="/static/detail/left.png"></image>
|
||||
</view>
|
||||
<view class="btn next" @click="switchSlide(1)">
|
||||
<image style="width: 50rpx;height: 50rpx;" src="/static/detail/right.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 自定义指示器 -->
|
||||
<!-- <view class="dots">
|
||||
<text
|
||||
v-for="(dot, idx) in images.length"
|
||||
:key="idx"
|
||||
:class="['dot', { active: currentIndex === idx }]"
|
||||
/>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
images: { type: Array, default: () => [] } // 接收外部图片数组
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentIndex: 0
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 滑动切换回调
|
||||
onSwiperChange(e) {
|
||||
this.currentIndex = e.detail.current;
|
||||
this.$emit('onSwiperChanges', e.detail.current);
|
||||
},
|
||||
// 按钮切换逻辑
|
||||
switchSlide(step) {
|
||||
const total = this.images.length;
|
||||
let newIndex = this.currentIndex + step;
|
||||
|
||||
if (newIndex < 0) newIndex = total - 1; // 循环向前
|
||||
else if (newIndex >= total) newIndex = 0; // 循环向后
|
||||
|
||||
this.currentIndex = newIndex;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.carousel-container {
|
||||
position: relative;
|
||||
height: 400rpx;
|
||||
}
|
||||
|
||||
.swiper-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.swiper-item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.swiper-image {
|
||||
width: 280rpx;
|
||||
height: 280rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #9C9C9C;
|
||||
}
|
||||
|
||||
.nav-buttons {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
// border-radius: 50%;
|
||||
// background: rgba(0,0,0,0.3);
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.dots {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.dot {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(255,255,255,0.5);
|
||||
margin: 0 8rpx;
|
||||
|
||||
&.active {
|
||||
background: #007AFF;
|
||||
transform: scale(1.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
images: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
} // 接收外部图片数组
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentIndex: 0
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 滑动切换回调
|
||||
onSwiperChange(e) {
|
||||
this.currentIndex = e.detail.current;
|
||||
this.$emit('onSwiperChanges', e.detail.current);
|
||||
},
|
||||
// 按钮切换逻辑
|
||||
switchSlide(step) {
|
||||
const total = this.images.length;
|
||||
let newIndex = this.currentIndex + step;
|
||||
|
||||
if (newIndex < 0) newIndex = total - 1; // 循环向前
|
||||
else if (newIndex >= total) newIndex = 0; // 循环向后
|
||||
|
||||
this.currentIndex = newIndex;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.carousel-container {
|
||||
position: relative;
|
||||
height: 350rpx;
|
||||
}
|
||||
|
||||
.swiper-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
text-align: center;
|
||||
padding: 3rpx;
|
||||
}
|
||||
|
||||
.swiper-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 8rpx;
|
||||
|
||||
/* 内边距为边框宽度 */
|
||||
box-sizing: border-box;
|
||||
/* 内边距和边框计入总尺寸 */
|
||||
}
|
||||
|
||||
.nav-buttons {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
// border-radius: 50%;
|
||||
// background: rgba(0,0,0,0.3);
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.dots {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.dot {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
margin: 0 8rpx;
|
||||
|
||||
&.active {
|
||||
background: #007AFF;
|
||||
transform: scale(1.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user