郑柏铃 12 ore în urmă
părinte
comite
a96d76ee35

+ 1 - 1
16.小程序/components/header/header.wxss

@@ -1,7 +1,7 @@
 /* components/header/header.wxss */
 .head {
   width: 100vw;
-  height: 50px;
+  height: 100px;
   display: flex;
   align-items: center;
   justify-content: center;

+ 2 - 0
16.小程序/pages/home/home.js

@@ -30,11 +30,13 @@ Page({
     wx.showToast({
       title: 'hi',
     })
+    wx.setStorageSync('token', '哈哈哈')
   },
   showMsg() {
     wx.showToast({
       title: 'Msg',
     })
+    console.log(wx.getStorageSync('token'))
   },
   showWord1() {
     console.log("红色")

+ 21 - 2
16.小程序/pages/list/list.js

@@ -5,9 +5,28 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    userName:"",
+    passWord:"",
+    background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
+    indicatorDots: true,
+    vertical: false,
+    autoplay: true,
+    interval: 2000,
+    duration: 500
+  },
+  getName(e) {
+    this.setData({
+      userName: e.detail.value
+    })
+  },
+  getWord(e) {
+    this.setData({
+      passWord: e.detail.value
+    })
+  },
+  formSubmit(e) {
+    console.log(e,'e')
   },
-
   /**
    * 生命周期函数--监听页面加载
    */

+ 42 - 2
16.小程序/pages/list/list.wxml

@@ -1,6 +1,46 @@
 <!--pages/list/list.wxml-->
-<text>pages/list/list.wxml</text>
+<!-- <text>pages/list/list.wxml</text> -->
 <!-- 引入 -->
 <!-- <import src="../home/home"/>
 <template is="hi" data="{{week:'二'}}" /> -->
-<!-- <include src="../home/home"></include> -->
+<!-- <include src="../home/home"></include> -->
+<view class="list">
+  <form bindsubmit="formSubmit">
+    <view>
+      <label>用户名</label>
+      <input type="text" name="userName" value="{{userName}}" placeholder="请输入用户名" bindinput="getName" />
+    </view>
+    <view>
+      <label>密码</label>
+      <input type="text" name="passWord" value="{{passWord}}" placeholder="请输入密码" bindinput="getWord" />
+    </view>
+    <button formType="submit">提交</button>
+  </form>
+  <view class="page-body">
+    <view class="page-section page-section-spacing swiper">
+      <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
+        <block wx:for="{{background}}" wx:key="*this">
+          <swiper-item>
+            <view class="swiper-item {{item}}"></view>
+          </swiper-item>
+        </block>
+      </swiper>
+    </view>
+  </view>
+  <!-- 横滚 -->
+  <view class="page-section-spacing">
+    <scroll-view class="scroll-view_H" scroll-x="true" bindscroll="scroll" style="width: 100%">
+      <view id="demo1" class="scroll-view-item_H demo-text-1"></view>
+      <view id="demo2" class="scroll-view-item_H demo-text-2"></view>
+      <view id="demo3" class="scroll-view-item_H demo-text-3"></view>
+    </scroll-view>
+  </view>
+  <!-- 纵滚 -->
+  <view class="page-section-spacing">
+    <scroll-view scroll-y="true" style="height: 300rpx;" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">
+      <view id="demo1" class="scroll-view-item demo-text-1"></view>
+      <view id="demo2" class="scroll-view-item demo-text-2"></view>
+      <view id="demo3" class="scroll-view-item demo-text-3"></view>
+    </scroll-view>
+  </view>
+</view>

+ 30 - 1
16.小程序/pages/list/list.wxss

@@ -1 +1,30 @@
-/* pages/list/list.wxss */
+/* pages/list/list.wxss */
+.demo-text-1 {
+  width: 100vw;
+  height: 200rpx;
+  background: #00f;
+}
+.demo-text-2 {
+  width: 100vw;
+  height: 200rpx;
+  background: #f0f;
+}
+.demo-text-3 {
+  width: 100vw;
+  height: 200rpx;
+  background: #0ff;
+}
+.page-section-spacing{
+  margin-top: 60rpx;
+}
+.scroll-view_H{
+  white-space: nowrap;
+}
+.scroll-view-item{
+  height: 300rpx;
+}
+.scroll-view-item_H{
+  display: inline-block;
+  width: 100%;
+  height: 300rpx;
+}

+ 1 - 0
16.小程序/utils/request.js

@@ -0,0 +1 @@
+// 封装request.js