美文网首页
微信小程序 页面跳转

微信小程序 页面跳转

作者: 曹锦花 | 来源:发表于2019-07-14 16:52 被阅读0次

    App.json中配置页面信息

    {
      "pages": [
        "pages/index/index",
        "pages/select/select",
        "pages/function/function",
        "pages/check/checkFun/checkFun",
        "pages/check/checkSync/checkSync"
      ],
      "window": {
        "backgroundTextStyle": "light",
        "navigationBarBackgroundColor": "#fff",
        "navigationBarTitleText": "登录",
        "navigationBarTextStyle": "black"
      },
      "sitemapLocation": "sitemap.json"
    }
    

    按钮的点击事件 bindtap 实现页面跳转

    _______________index.wxml
      <view class="page__bd page__bd_spacing">
        <button class="weui-btn" type="primary" class='btn' bindtap="login">登录</button>
      </view>
    _____________index.js中定义login方法
      login(){
        wx.navigateTo({
          url: '../function/function'
        })
      }
    

    表格 日期控件

    ________________wxml
    <view class="page">
      <!-- <view class="info">
        <text>查询单号</text>
        <input placeholder-class="phcolor" placeholder="系统单号或po单号,可空"></input>
      </view> -->
      <view class="weui-cell weui-cell_input">
        <view class="weui-cell__hd">
          <view class="weui-label">查询单号</view>
        </view>
        <view class="weui-cell__bd">
          <input class="weui-input" placeholder="系统单号或po单号,可空" />
        </view>
      </view>
      <view class="weui-cell weui-cell_input weui-cell_vcode">
        <view class="weui-cell__hd">
          <view class="weui-label">出库日期</view>
        </view>
        <view class="weui-cell__bd">
          <picker mode="date" value="{{date}}" bindchange="bindDateChange">
            <view class="weui-input">{{date}}</view>
          </picker>
        </view>
        <view class="weui-cell__ft">
          <view class="weui-vcode-btn">查询</view>
        </view>
      </view>
      <view class="table">
        <view class="tr">
          <view class="th th1">出库单号</view>
          <view class="th th2">发往</view>
          <view class="th th2">SKU数量</view>
          <view class="th th2">罐数</view>
          <view class="th th2">箱数</view>
        </view>
        <view class="tr" wx:for="{{5}}">
          <view class="td td1">2018/02/12</view>
          <view class="td td2">11:30</view>
          <view class="td td2">2018/02/12</view>
          <view class="td td2">11:30</view>
          <view class="td td2">本次对海煞造成了100000点伤害</view>
        </view>
      </view>
        <view class="footer">
          <button class="weui-btn btn1">创建出库单</button>
          <button class="weui-btn btn2">开始扫描</button>
        </view>
    </view>
    _________________wxss
    /* pages/depotTask/depotList/depotList.wxss */
    .history-table-wrap{
      position: absolute;
      width: 668rpx;
      height: 578rpx;
      left: 50%;
      margin-left: -334rpx;
      top: 70rpx;
      overflow-y: scroll;
      overflow-x: hidden;
    }
    /* 表格代码   */
    .table{
      border:1px solid #dadada;
      border-right:0;
      border-bottom: 0;
      width: 98%;
      margin-left: 1%;
    }
    .tr{
      width:100%;
      display: flex;
      justify-content: space-between;
    }
    .th,.td{
      padding: 10px;
      border-bottom: 1px solid #dadada;
      border-right: 1px solid #dadada;
      text-align: center;
      width: 100%;
    }
    .th1,.th2,.td1,.td2{
      width: 40%;
    }
    .th{
      font-weight: 800;
      background-color: #b66242;
      font-size: 28rpx;
      color: #330e0e;
    }
    .td{
      font-size: 20rpx;
      color: #ec9480;
    }
    .btn1{
      background: #2b85e4
    }
    
    .footer{
      /* position: fixed; */
      width: 100%;
      left: 0px;
      bottom: 0;
      display: flex;
    }
    .btn2{
      background: #2b85e4
    }
    .footer .weui-btn {
      width: 40%;
      margin:15rpx 5%;
      color:#fff;
      border-radius: 25px;
    }
    ________________js
    var util=require("../../../utils/util.js")
    Page({
      data: {
        date: ""
      },
      onLoad: function () {
        var TIME = util.formatTime(new Date());
        this.setData({
          date: TIME,
        });    
      },
      bindDateChange: function (e) {
        this.setData({
          date: e.detail.value
        })
    
        console.log(this.data.date)
      },
    })
    

    相关文章

      网友评论

          本文标题:微信小程序 页面跳转

          本文链接:https://www.haomeiwen.com/subject/cccikctx.html