diff --git a/pages.json b/pages.json index 1356235..800fc87 100644 --- a/pages.json +++ b/pages.json @@ -73,5 +73,27 @@ "navigationBarTitleText": "海南旅游", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" + }, + "tabBar": { + "color": "#333333", + "selectedColor": "#FE9903", + "borderStyle": "black", + "backgroundColor": "#ffffff", + "list": [{ + "pagePath": "pages/index/index", + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/home-active.png", + "text": "首页" + },{ + "pagePath": "pages/discover/discover", + "iconPath": "static/tabbar/order.png", + "selectedIconPath": "static/tabbar/order-active.png", + "text": "发现" + },{ + "pagePath": "pages/recommList/index", + "iconPath": "static/tabbar/order.png", + "selectedIconPath": "static/tabbar/order-active.png", + "text": "推荐" + }] } } diff --git a/pages/index/index.vue b/pages/index/index.vue index e5df537..0437ac7 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -78,14 +78,22 @@ - + + + + 推荐 + + 更多 + + - - - + + + @@ -103,6 +111,7 @@ data() { return { banner_current: 0, + recomm_list: [], tab_list: [{ name: '推荐', list: [] @@ -122,11 +131,49 @@ name: '酒店', list: [] }], - current: 0 + current: 0, + list: [ + { + price: 35, + title: '北国风光,千里冰封,万里雪飘', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg', + }, + { + price: 75, + title: '望长城内外,惟余莽莽', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg', + }, + { + price: 385, + title: '大河上下,顿失滔滔', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg', + }, + { + price: 784, + title: '欲与天公试比高', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/zzpic23369_s.jpg', + }, + { + price: 7891, + title: '须晴日,看红装素裹,分外妖娆', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2130_s.jpg', + }, + { + price: 2341, + shop: '李白杜甫白居易旗舰店', + title: '江山如此多娇,引无数英雄竞折腰', + image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg', + } + ] } }, onLoad() { - // this.addRandomData(); + this.addRandomData(); }, methods: { addRandomData() { @@ -135,7 +182,7 @@ // 先转成字符串再转成对象,避免数组对象引用导致数据混乱 let item = JSON.parse(JSON.stringify(this.list[index])) item.id = this.$u.guid(); - this.flowList.push(item); + this.recomm_list.push(item); } }, tabChange(current){ diff --git a/pages/recommList/index.vue b/pages/recommList/index.vue index 89697d9..a0bf48c 100644 --- a/pages/recommList/index.vue +++ b/pages/recommList/index.vue @@ -6,7 +6,12 @@ - 1111 + + + + 正在加载 + + @@ -38,14 +43,62 @@ }], current: 0, windowHeight: 0, - isRefresher: false // scroll-view下拉刷新状态,当前默认没有触发 + isRefresher: false, // scroll-view下拉刷新状态,当前默认没有触发 + list: [ + { + price: 35, + title: '北国风光,千里冰封,万里雪飘', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg', + }, + { + price: 75, + title: '望长城内外,惟余莽莽', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg', + }, + { + price: 385, + title: '大河上下,顿失滔滔', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg', + }, + { + price: 784, + title: '欲与天公试比高', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/zzpic23369_s.jpg', + }, + { + price: 7891, + title: '须晴日,看红装素裹,分外妖娆', + shop: '李白杜甫白居易旗舰店', + image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2130_s.jpg', + }, + { + price: 2341, + shop: '李白杜甫白居易旗舰店', + title: '江山如此多娇,引无数英雄竞折腰', + image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg', + } + ] } }, onLoad(){ this.windowHeight = getApp().globalData.windowHeight; + this.addRandomData(); }, methods: { - tabChange(){ + addRandomData() { + for(let i = 0; i < 10; i++) { + let index = this.$u.random(0, this.list.length - 1); + // 先转成字符串再转成对象,避免数组对象引用导致数据混乱 + let item = JSON.parse(JSON.stringify(this.list[index])) + item.id = this.$u.guid(); + this.tab_list[0].list.push(item); + } + }, + tabChange(current){ this.current = current; }, // 滑块下标值变化 @@ -87,5 +140,7 @@ .com{ width: 100%; height: 100%; + box-sizing: border-box; + padding: 0rpx 32rpx; } diff --git a/static/tabbar/home-active.png b/static/tabbar/home-active.png new file mode 100644 index 0000000..686041d Binary files /dev/null and b/static/tabbar/home-active.png differ diff --git a/static/tabbar/home.png b/static/tabbar/home.png new file mode 100644 index 0000000..cd6b2b7 Binary files /dev/null and b/static/tabbar/home.png differ diff --git a/static/tabbar/my-active.png b/static/tabbar/my-active.png new file mode 100644 index 0000000..1a40d3f Binary files /dev/null and b/static/tabbar/my-active.png differ diff --git a/static/tabbar/my.png b/static/tabbar/my.png new file mode 100644 index 0000000..709df15 Binary files /dev/null and b/static/tabbar/my.png differ diff --git a/static/tabbar/order-active.png b/static/tabbar/order-active.png new file mode 100644 index 0000000..1bf9a84 Binary files /dev/null and b/static/tabbar/order-active.png differ diff --git a/static/tabbar/order.png b/static/tabbar/order.png new file mode 100644 index 0000000..900476f Binary files /dev/null and b/static/tabbar/order.png differ