<scroll-view scroll-y="true"> <view class="specialPrice"> <block wx:for="{{authorGoodsList}}"> <view class="goodsList"> <image class="goodsPic" src='{{item.imageUrl}}' data-gomygoodsid='{{item.id}}' bindtap='goToDetail'></image> <view class="goodsInfo"> <view class="swa"> <view class="goodsTitle">{{item.goodsName}}</view> <view class="del" data-goodsid='{{item.id}}' bindtap='delMyGoods'> <label class="ico-moon icon-delete my_icon" data-goodsid='{{item.id}}'></label> </view> </view> <view class="price"> <text class="newPrice">¥{{item.newPrice}}</text> <text class="oldPrice">¥{{item.oldPrice}}</text> </view> <view class="status"> 商品状态:{{item.status}} </view> <view class="goodsTime">日期:{{item.createTime}}</view> </view> </view> </block> </view> </scroll-view>
时间: 2023-12-06 15:40:52 浏览: 153
这是一个小程序的 WXML 代码,使用了微信小程序的组件,其中包括一个滚动视图(scroll-view),用于实现垂直方向的滚动效果;一个视图(view),用于包裹所有商品列表;一个块(block),用于循环渲染每一个商品信息;一个图片(image),用于展示商品图片,并且通过绑定点击事件(bindtap)实现了跳转到商品详情页的功能;一个视图(view),用于包裹商品标题和删除按钮;一个视图(view),用于展示商品价格信息;一个视图(view),用于展示商品状态信息;一个视图(view),用于展示商品创建日期。
相关问题
<scroll-view class="scroll-wrapper" scroll-x scroll-with-animation="true" scroll-into-view="item{{currentTab < 4 ? 0 : currentTab - 3}}"> <view class="navigate-item" id="item{{index}}" wx:for="{{tabList}}" wx:key="index" data-index="{{index}}" bindtap="tabNav"> <view class="names {{currentTab === index ? 'active' : ''}}">{{item.name}}</view> <view class="currtline {{currentTab === index ? 'active' : ''}}" wx:if="{{currentTab === index}}"></view> </view> </scroll-view> <swiper indicator-dots="{{false}}" bindchange="handleSwiper" current="{{currentTab}}"> <block wx:for="{{tabList}}" wx:key="index"> <swiper-item style="overflow: scroll;"> <view class="tab_title">tab{{currentTab+1}}内容</view> <scroll-view scroll-y refresher-enabled refresher-background="#F6F7F8" refresher-triggered="{{isRefresh}}" bindrefresherrefresh="refresherpulling" bindscrolltolower="handleTolower"> <view class="swiper-item" wx:for="{{20}}" wx:key="index">第{{index + 1}}条数据~</view> </scroll-view> </swiper-item> </block> </swiper> 将这段微信小程序代码转化成vue框架下的代码
<template>
<div>
<scroll-view class="scroll-wrapper" scroll-x scroll-with-animation="true" :scroll-into-view="`item${currentTab < 4 ? 0 : currentTab - 3}`">
<view class="navigate-item" :id="`item${index}`" v-for="(item, index) in tabList" :key="index" :data-index="index" @tap="tabNav">
<view class="names" :class="{ active: currentTab === index }">{{item.name}}</view>
<view class="currtline" :class="{ active: currentTab === index }" v-if="currentTab === index"></view>
</view>
</scroll-view>
<swiper :indicator-dots="false" @change="handleSwiper" :current="currentTab">
<swiper-item v-for="(item, index) in tabList" :key="index" style="overflow: scroll;">
<view class="tab_title">tab{{currentTab+1}}内容</view>
<scroll-view scroll-y refresher-enabled refresher-background="#F6F7F8" :refresher-triggered="isRefresh" @refresherrefresh="refresherpulling" @scrolltolower="handleTolower">
<view class="swiper-item" v-for="(item, index) in 20" :key="index">第{{index + 1}}条数据~</view>
</scroll-view>
</swiper-item>
</swiper>
</div>
</template>
<script>
export default {
data() {
return {
currentTab: 0,
isRefresh: false,
tabList: [{ name: 'tab1' }, { name: 'tab2' }, { name: 'tab3' }, { name: 'tab4' }, { name: 'tab5' }]
}
},
methods: {
tabNav(e) {
this.currentTab = e.currentTarget.dataset.index
},
handleSwiper(e) {
this.currentTab = e.detail.current
},
refresherpulling() {
// 下拉刷新
},
handleTolower() {
// 上拉加载更多
}
}
}
</script>
<scroll-view class="container" scroll-y="true" wx:if="{{hidden==false}}"> <block wx:for="{{orderList}}" wx:key=""> <view class="orderList"> <view class="order-title"> <view class="order-title-restaurantName"> {{item.canteen}}</view> <view class="order-title-state" wx:if="{{item.type==0}}">堂食</view> <view class="order-title-state" wx:else>打包</view> </view> <view class="order-content"> <image class="order-content-restaurantImg" src="https://www.zzyqzs.com/static/upload/image/20220301/1646118325920051.jpg"></image> <view class="order-content-info"> <view class="order-content-info-price">¥ {{item.money}}</view> <view class="order-content-info-date"> {{item.date}}</view> <view class="order-content-info-howToDistribute"> 由 山东农业大学 提供服务</view> </view> </view> <view class="order-footer"> <view class="order-footer-orderAgain" bindtap="sel1" data-dorderuid="{{item.id}}">评论</view> <view class="order-footer-orderAgain" bindtap="sel" data-dorderuid="{{item.d_id}}">查看详情</view> <view class="order-footer-orderAgain" bindtap="zl" data-canteen="{{item.canteen}}">再来一单</view> </view> </view> </block> </scroll-view>
这是一个小程序的代码,其中使用了微信小程序的组件和指令。其中使用了一个scroll-view组件来实现滚动视图的效果,wx:if指令用于控制是否显示该组件。在scroll-view中使用了一个block和wx:for指令来循环渲染订单列表,使用了{{}}绑定数据。每个订单项包括餐厅名称、订单类型、订单内容等,并且每个订单项都有一个订单底部操作栏,可进行评论、查看详情、再来一单等操作。
阅读全文