8.13.展示每张壁纸的专属信息

1.定义响应式变量

    const currentInfo = ref(null);

2.给这个变量每个图片赋对应的值

	onLoad((e) => {
		currentId.value = e.id;
		currentIndex.value = classList.value.findIndex(item => item._id == currentId.value);
		currentInfo.value = classList.value[currentIndex.value];
		console.log(currentIndex.value);
	})

	const swipperChange = (e) => {
		currentIndex.value = e.detail.current;
		currentInfo.value = classList.value[currentIndex.value];
		console.log(e);
	}

3.渲染页面

		<uni-popup ref="infoPopup" type="bottom">
			<view class="infoPopup">
				<view class="popHeader">
					<view></view>
					<view class="title">壁纸信息</view>
					<view class="close" @click="clickInfoClose">
						<uni-icons type="closeempty" size="18" color="#999"></uni-icons>
					</view>
				</view>
				<scroll-view scroll-y>
					<view class="content">
						<view class="row">
							<view class="label">壁纸ID:</view>
							<text selectable class="value">{{currentInfo._id}}</text>
						</view>
						<!-- 						<view class="row">
							<view class="label">分类:</view>
							<text selectable class="value class">明星美女</text>
						</view> -->

						<view class="row">
							<view class="label">发布者:</view>
							<text selectable class="value">{{currentInfo.nickname}}</text>
						</view>

						<view class="row">
							<view class="label">评分:</view>
							<view class="value roteBox">
								<uni-rate readonly touchable :value="currentInfo.score" size="16" />
								<text class="score">{{currentInfo.score}}</text>
							</view>
						</view>

						<view class="row">
							<view class="label">摘要:</view>
							<text selectable class="value">{{currentInfo.description}}
							</text>
						</view>

						<view class="row">
							<view class="label">标签:</view>
							<view class="value tabs">
								<view class="tab" v-for=" tab in currentInfo.tabs">{{tab}}</view>
							</view>
						</view>

						<view class="copyright">
							声明:如有侵权请如我联系,会妥善处理
						</view>

					</view>

				</scroll-view>
			</view>
		</uni-popup>

4效果

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值