Browse Source

Merge branch 'pink' of http://39.105.160.25:10880/sifu-gogs/delivery-customer into pink

LiShiwei 2 years ago
parent
commit
84ccc99aa6

+ 17 - 5
app.json

@@ -1,9 +1,8 @@
 {
   "pages": [
-    "pages/search/index",
     "pages/index/index",
-    "pages/logs/logs"
-    
+    "pages/search/index",
+    "pages/me/me"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -11,10 +10,23 @@
     "navigationBarTitleText": "外卖小程序",
     "navigationBarTextStyle": "black"
   },
+  "tabBar": {
+    "color": "#CBCBCB",
+    "selectedColor": "#F9872C",
+    "list": [{
+      "pagePath": "pages/index/index",
+      "text": "首页",
+      "iconPath": "/images/icon/index.png",
+      "selectedIconPath": "/images/icon/index-select.png"
+    }, {
+      "pagePath": "pages/me/me",
+      "text": "我的",
+      "iconPath": "/images/icon/me.png",
+      "selectedIconPath": "/images/icon/me-select .png"
+    }]
+  },
   "usingComponents": {
     "van-button": "@vant/weapp/button"
-   
-
   },
   "sitemapLocation": "sitemap.json"
 }

BIN
images/icon/index-select.png


BIN
images/icon/index.png


BIN
images/icon/me-select .png


BIN
images/icon/me.png


BIN
images/image/active.png


BIN
images/image/food1.png


BIN
images/image/food2.png


BIN
images/image/swiper1-index.png


BIN
images/image/time.png


+ 11 - 18
pages/index/index.js

@@ -1,23 +1,16 @@
-// index.js
-// 获取应用实例
-const app = getApp()
-
 Page({
   data: {
-  
+    value: '',
   },
-  // 事件处理函数
-  bindViewTap() {
-    wx.navigateTo({
-      url: '../logs/logs'
-    })
+  onChange(e) {
+    this.setData({
+      value: e.detail,
+    });
   },
-  onLoad() {
-    if (wx.getUserProfile) {
-      this.setData({
-        canIUseGetUserProfile: true
-      })
-    }
+  onSearch() {
+    Toast('搜索' + this.data.value);
   },
-
-})
+  onClick() {
+    Toast('搜索' + this.data.value);
+  },
+});

+ 4 - 1
pages/index/index.json

@@ -1,5 +1,8 @@
 {
   "usingComponents": {
-    "van-button": "@vant/weapp/button"
+    "van-button": "@vant/weapp/button",
+    "van-search": "@vant/weapp/search/index",
+    "van-row": "@vant/weapp/row/index",
+    "van-col": "@vant/weapp/col/index"
   }
 }

+ 19 - 0
pages/index/index.wxml

@@ -0,0 +1,19 @@
+<view class="index">
+  <!-- 搜索栏 -->
+  <van-search value="{{ value }}" placeholder="请输入商家名称" use-action-slot bind:change="onChange" bind:search="onSearch">
+    <view slot="action" bind:tap="onClick">搜索</view>
+  </van-search>
+
+  <!-- 主页轮播图 -->
+  <swiper class="swiper" indicator-dots indicator-color="#CBCBCB" indicator-active-color="#F9872C" autoplay interval="2000" circular>
+    <swiper-item>
+      <image src="/images/image/swiper1-index.png"></image>
+    </swiper-item>
+
+    <swiper-item>
+      <image src="/images/image/swiper1-index.png"></image>
+    </swiper-item>
+  </swiper>
+
+<!-- 商品标签页 -->
+</view>

+ 13 - 0
pages/index/index.wxss

@@ -0,0 +1,13 @@
+/* 轮播图样式 */
+.swiper {
+  height: 270rpx ;
+  margin: 20rpx;
+  border-radius: 10px;
+}
+
+/* 轮播图图片样式 */
+.swiper image {
+  width: 100%;
+  height: 100%;
+}
+

+ 0 - 18
pages/logs/logs.js

@@ -1,18 +0,0 @@
-// logs.js
-const util = require('../../utils/util.js')
-
-Page({
-  data: {
-    logs: []
-  },
-  onLoad() {
-    this.setData({
-      logs: (wx.getStorageSync('logs') || []).map(log => {
-        return {
-          date: util.formatTime(new Date(log)),
-          timeStamp: log
-        }
-      })
-    })
-  }
-})

+ 0 - 4
pages/logs/logs.json

@@ -1,4 +0,0 @@
-{
-  "navigationBarTitleText": "查看启动日志",
-  "usingComponents": {}
-}

+ 0 - 6
pages/logs/logs.wxml

@@ -1,6 +0,0 @@
-<!--logs.wxml-->
-<view class="container log-list">
-  <block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
-    <text class="log-item">{{index + 1}}. {{log.date}}</text>
-  </block>
-</view>

+ 0 - 8
pages/logs/logs.wxss

@@ -1,8 +0,0 @@
-.log-list {
-  display: flex;
-  flex-direction: column;
-  padding: 40rpx;
-}
-.log-item {
-  margin: 10rpx;
-}

+ 66 - 0
pages/me/me.js

@@ -0,0 +1,66 @@
+// pages/me/me.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/me/me.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
pages/me/me.wxml

@@ -0,0 +1,2 @@
+<!--pages/me/me.wxml-->
+<text>pages/me/me.wxml</text>

+ 1 - 0
pages/me/me.wxss

@@ -0,0 +1 @@
+/* pages/me/me.wxss */

+ 7 - 0
project.private.config.json

@@ -21,6 +21,13 @@
           "query": "",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/index/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }