校内实训第六天

js文件

Page({

 

  /**

   * 页面的初始数据

   */

  data: {

    msg: 'Home',

    id: 'txt',

    motto: 'Hello World',

    userInfo: {},

    index: 9,

    yiyan: {},

    weather: {},

    location:'',

    flag: false,

    hasUserInfo: false,

    imgUrls: [

      'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640',

      'https://images.unsplash.com/photo-1551214012-84f95e060dee?w=640',

      'https://images.unsplash.com/photo-1551446591-142875a901a1?w=640'

    ],

    canIUse: wx.canIUse('button.open-type.getUserInfo'),

    obj: {

      name: "hp",

      index: "0",

      time: "18"

    },

 

  },

 

  finish:function(e){

    var _this=this;

    console.log(e.detail.value);

    _this.setData({

      location:e.detail.value

      });

    _this.getWeather(_this);

  },

  getWeather:function(_this){

    var _this = this;

    wx.request({

      url: 'https://www.tianqiapi.com/api/',

      method: 'get',

      dataType: 'json',

      data: {

        version: 'v1',

        city: _this.data.location,

      },

      header: {

        'content-type': 'application/json'  //默认值

      },

      success(res) {

        console.log(res.data)

        _this.setData({

          weather: res.data,

          flag: true,

        })

      }

    })

  },

 

  /**

   * 生命周期函数--监听页面加载

   */

  onLoad: function (options) {

    var _this=this;

    this.getWeather(_this);

  },

 

  /**

   * 生命周期函数--监听页面初次渲染完成

   */

  onReady: function () {

 

  },

 

  /**

   * 生命周期函数--监听页面显示

   */

  onShow: function () {

 

  },

 

  /**

   * 生命周期函数--监听页面隐藏

   */

  onHide: function () {

   

 

  },

 

  /**

   * 生命周期函数--监听页面卸载

   */

  onUnload: function () {

 

  },

 

  /**

   * 页面相关事件处理函数--监听用户下拉动作

   */

  onPullDownRefresh: function () {

 

  },

 

  /**

   * 页面上拉触底事件的处理函数

   */

  onReachBottom: function () {

 

  },

 

  /**

   * 用户点击右上角分享

   */

  onShareAppMessage: function () {

 

  }

})

 

wxml文件

<view class='nav'>

  <image class='img' src='../../assets/icons/weather.png'></image>

  <input class='ipt' placeholder='请输入城市名,快速查询天气信息' value='' bindconfirm='finish'></input>

</view>

 

<view class='user'>

  <open-data class='userArea' type="userAvatarUrl"></open-data>

<open-data class='userNick' type="userNickName"></open-data>

</view>

 

<view class='map'>

   <view class='l-box'>

      <image class='img' src='../../assets/icons/acmap.png'></image>

      <text class='loc'>{{weather.city}}</text>

   </view>

   <view class='r-box'>

      <text>{{weather.update_time }}更新</text>

   </view>

</view>

 

<view class='info'>

   <view class='tem'>

   {{weather.data[0].tem}}

 

   </view>

   <text class='wea'>{{weather.data[0].wea}}</text>

   <text>空气质量:{{weather.data[0].air_level}}</text>

</view>

 

<view class='out'>

  <scroll-view scroll-x scroll-into-view='item1'>

    <view id='item1' class='item'>

      <view class='inner'>

     <text>{{weather.data[1].day}}</text>

      <text>{{weather.data[1].tem}}</text>

     

      </view>

    </view>

    <view id='item2' class='item'>

      <view class='inner'>

       <view class='inner'>

     <text>{{weather.data[2].day}}</text>

      <text>{{weather.data[2].tem}}</text>

     

      </view>

      </view>

    </view>

    <view class='item'>

      <view class='inner'>

       <view class='inner'>

     <text>{{weather.data[3].day}}</text>

      <text>{{weather.data[3].tem}}</text>

     

      </view>

      </view>

    </view>

    <view class='item'>

      <view class='inner'>

       <view class='inner'>

     <text>{{weather.data[4].day}}</text>

      <text>{{weather.data[4].tem}}</text>

     

      </view>

      </view>

    </view>

  </scroll-view>

</view>

 

wxss文件

page{

  height: 100%;

  background-image: url(https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2701243995,2560695110&fm=26&gp=0.jpg);

  background-size: 100% 100%;

}

.nav{

  display: flex;

  justify-content: center;

}

 

.nav>.ipt{

  width: 90%;

  border-bottom: 2rpx solid rgb(46, 46, 46);

  padding-left: 60rpx;

  align-items: center;

  box-sizing: border-box;

}

 

.nav>.pla{

  font-size: 26rpx;

}

 

.nav>.img{

  width: 40rpx;

  height: 40rpx;

  position: absolute;

  left: 45rpx;

}

/* end nav */

 

/* userinfo */

.user{

  margin: 20rpx 30rpx;

  display: flex;

  align-items: center;

}

.user>.userArea{

  width: 60rpx;

  height: 60rpx;

  border-radius: 50%;

  overflow: hidden;    /* 切掉图片超出的部分 */

  border:1rpx solid rgb(0, 0, 0);

}

.user>.userNick{

  font-size: 28rpx;

  color: rgb(0, 0, 0);

  margin-left: 20rpx;

  font-weight: bold;

}

/* end userinfo */

 

/* location */

.map{

  margin: 0 40rpx;

  display: flex;

  justify-content: space-between;

  align-items: center;

  border-bottom: 1px solid rgb(0, 0, 0);

}

.map .img{

  width: 35rpx;

  height: 35rpx;

}

.map .loc{

  font-size: 54rpx;

  margin-left: 20rpx;

}

.map .l-box{

  display: flex;

  align-items: center;

 

}

.map .r-box{

  display: flex;

  align-items: center;

  color: rgb(0, 0, 0);

}

/* end location */

 

.info{

  height: 600rpx;

  display: flex;

  flex-direction: column;

  justify-content: flex-end;

  align-items: center;

  border-bottom: 1px solid rgb(0, 0, 0);

}

.info .tem{

  height: 400rpx;

  line-height: 400rpx;

  font-size: 55px;

  top:-60px;

  color: rgb(0, 0, 0);

  position: relative;

}

.info .tem text{

  position: absolute;

  right: -65rpx;

  top: -30rpx;

  font-size: 20px;

}

 

.picture{

  height: 90rpx;

  width: 90rpx;

 

}

 

.scroll_v{

  display: flex;

  white-space: nowrap;

}

 

.out {

  /* background: #38B0de; */

  padding: 20px 10px;

  width: 100%;

  white-space: nowrap;

  box-sizing: border-box;

}

 

/*设置行内块*/

 

.out  .item {

  width: 100px;

  height: 80px;

  border: 1px solid #38B0de;

  /* background: white; */

  display: inline-block;

  margin-right: 10px;

}

 

.inner{

  display: flex;

  flex-direction: column;

  justify-content: center;

  align-items: center;

 

}

Python网络爬虫与推荐算法新闻推荐平台:网络爬虫:通过Python实现新浪新闻的爬取,可爬取新闻页面上的标题、文本、图片、视频链接(保留排版) 推荐算法:权重衰减+标签推荐+区域推荐+热点推荐.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
项目描述:建立购物小商城平台. 实现了前台页面系统。 技术描述:通过Spring 主框架来管理Struts2和Hibernate 框架搭建的电商小平台,用MySQL数据库并创建了表有用户表,订单表,商品表,商品分类表,商品内容表,购物车表等来存储数据。用到hibernate….zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值