APPlet day04

// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    scene:[],//Top search box below the sence images list
  },
  // 事件处理函数
  bindViewTap() {
  }, 

  onLoad() {
    wx.request({
      url: 'https://api-v2.chuangkit.com/mobile/main/getMainMiniProgramHomeInfo.do',
      success: res=>{
        console.log(res);
        this.setData({
          scene:res.data.body.data.scene.slice(0,8),
        })
      }
    })
  },

  getUserProfile(e) {
  },
  getUserInfo(e) {
  }
})

<view class="container">
  <view class="search">
    <input type="text" 
    placeholder="20000+ 免费模板任你搜索"
    placeholder-style="color:#90EE90"></input>
    <image src="/image/search.png"></image>
  </view>  

  <view class="scene">
    <view wx:for="{{scene}}" wx:key="index">
      <image src="{{item.thumbUrl}}"></image>      
      <text>{{item.name}}</text>
    </view>
  </view>
</view>
.search{
  position: relative;
}

input{
  text-align: center; 
  background-color: #f8f8f8; 
  margin: 30rpx;
  height: 80rpx;
  line-height: 80rpx;
  border-radius: 40rpx;
  font-size: 30rpx;
}

.search image{
  position: absolute;
  width: 30rpx;
  height: 30rpx;
  top: 25rpx;
  left: 130rpx;
}
{
  "entryPagePath": "pages/index/index",
  "pages":[
    "pages/index/index",
    "pages/design/design",
    "pages/mine/mine"
  ],
  "window":{
    "backgroundTextStyle":"light",
    "navigationBarBackgroundColor": "#90EE90",
    "navigationBarTitleText": "创客贴",
    "navigationBarTextStyle":"black"
  },
  "tabBar": {
    "list":[{
      "pagePath":"pages/index/index",
      "text":"Home",
      "iconPath":"/image/index.png",
      "selectedIconPath":"/image/index-active.png"
    },
    {
      "pagePath":"pages/design/design",
      "text":"Design",
      "iconPath":"/image/design.png",
      "selectedIconPath":"/image/design-active.png"
    },
    {
      "pagePath":"pages/mine/mine",
      "text":"User",
      "iconPath":"/image/mine.png",
      "selectedIconPath":"/image/mine-active.png"
    }]
  },
  "style": "v2",
  "sitemapLocation": "sitemap.json"
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值