当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
2 Star 0 Fork 0

cooltea521/ShopTemplate
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
GoodLists3.html 4.04 KB
一键复制 编辑 原始数据 按行查看 历史
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Title</title>
<link rel="stylesheet" href="https://unpkg.com/vonic@2.0.0-beta.11/dist/vonic.min.css">
<link rel="stylesheet" href="css/shop.css">
<!-- 依赖库 axios/vue/vue-router -->
<script src="https://unpkg.com/axios@0.15.3/dist/axios.min.js"></script>
<script src="https://unpkg.com/vue@2.2.6/dist/vue.min.js"></script>
<script src="https://unpkg.com/vue-router@2.2.1/dist/vue-router.min.js"></script>
<!-- vonic 核心文件 -->
<script src="https://unpkg.com/vonic@2.0.0-beta.11/dist/vonic.min.js"></script>
<script src="js/vue-shop.js"></script>
</head>
<body>
<div id="myapp" class="page has-navbar">
<von-header theme="light">
<span slot="title">产品列表</span>
</von-header>
<scroll class="page-content" :on-refresh="onRefresh"
:on-infinite="onInfinite"
style="padding-top: 44px;">
<small-card :list="goodslist" :on-open="openpage" img-position="right"></small-card>
<div v-if="infiniteCount >= 3" slot="infinite" class="text-center">没有更多数据</div>
</scroll>
</div>
<script>
var _goodsList=[
{"id":973,"tag":['简单','美观','包邮'],"thumb":"images/goods.jpg","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
{"id":972,"tag":['简单','美观','包邮'],"thumb":"","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
{"id":90,"tag":['简单','美观','包邮'],"thumb":"images/goods.jpg","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
{"id":97,"tag":['简单','美观','包邮'],"thumb":"images/goods.jpg","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
{"id":93,"tag":['简单','美观','包邮'],"thumb":"","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
{"id":73,"tag":['简单','美观','包邮'],"thumb":"images/goods.jpg","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
{"id":3,"tag":['简单','美观','包邮'],"thumb":"images/goods.jpg","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
{"id":9,"tag":['简单','美观','包邮'],"thumb":"images/goods.jpg","name":"北欧丝绒收纳袋束口袋 抽绳衣物收纳包 旅行内衣整理袋小布袋60g","price":"28.00","market_price":"30.00","sale":1505,},
];
var vm = new Vue({
el:'#myapp',
data(){
return{
items:[],
goodslist:[],
infiniteCount: 0
}
},
created(){
this.goodslist = _goodsList;
},
methods: {
onRefresh: function (done) {
var self = this
setTimeout(function () {
self.goodslist=_goodsList;
self.infiniteCount =0;
done();
}, 1500)
},
onInfinite: function (done) {
if(this.infiniteCount <=3){
for (var i = 0; i < 5; i++) {
this.goodslist.push(_goodsList[i]);
}
this.infiniteCount++;
}else{
return false;
}
done();
},
openpage:function(e){
alert(e)
}
}
});
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/cooltea521/ShopTemplate.git
git@gitee.com:cooltea521/ShopTemplate.git
cooltea521
ShopTemplate
ShopTemplate
master

搜索帮助