baolei hace 6 meses
padre
commit
91645007aa
Se han modificado 2 ficheros con 23 adiciones y 3 borrados
  1. 20 0
      pages/index/index.js
  2. 3 3
      pages/index/index.wxml

+ 20 - 0
pages/index/index.js

@@ -24,6 +24,26 @@ Page({
   handleCloseAddCartModal() {
     this.setData({ showAddCartModal: false });
   },
+
+  // 进入今日热门页
+  hotBut: function(){
+    wx.navigateTo({
+      url: '../Mall/hotCommodity/hotCommodity',
+    })
+  },
+  // 进入新品上市页
+  newBut: function(){
+    wx.navigateTo({
+      url: '../Mall/newCommodity/newCommodity',
+    })
+  },
+  // 进入预售页
+  presaleBut: function(){
+    wx.navigateTo({
+      url: '../Mall/presaleCommodity/presaleCommodity',
+    })
+  },
+
   onLoad: async function (options) {
 
     // 生命周期函数--监听页面加载

+ 3 - 3
pages/index/index.wxml

@@ -19,13 +19,13 @@
 
   <view class="hot-bar">
     <view class="hot-A">
-      <image src="/images/index/hot-left.png" class="hot-image"></image>
+      <image src="/images/index/hot-left.png" class="hot-image" bind:tap="hotBut"></image>
     </view>
     <view class="hot-B">
-      <image src="/images/index/hot-middle.png" class="hot-image"></image>
+      <image src="/images/index/hot-middle.png" class="hot-image" bind:tap="newBut"></image>
     </view>
     <view class="hot-C">
-      <image src="/images/index/hot-right.png" class="hot-image"></image>
+      <image src="/images/index/hot-right.png" class="hot-image" bind:tap="presaleBut"></image>
     </view>
   </view>
   <view class="brand-bar">