위 챗 애플 릿 개발 사례 상세 설명

"애플 릿"IDE+데모 해독:https://github.com/gavinkwoe/weapp-ide-crack.git
자원 집계:https://github.com/Aufree/awesome-wechat-weapp
공식 간이 강 좌·MINA:http://wxopen.notedown.cn/
Hello 애플 릿-비공 식:http://www.helloxcx.com
위 챗 응용 번호 개발 튜 토리 얼:https://my.oschina.net/wwnick/blog/750055
자원 은 네트워크 에서 왔 습 니 다.가 져 가 셔 도 감사 하지 않 습 니 다!
간단하게 해 봤 는데 호호~:
업무 처리

//index.js
//      
var app = getApp()
Page({
 data: {
  motto: 'Hello World',
  userInfo: {name:'  ',
        desc:"       !
!!", avatarUrl:"http://img2.3lian.com/2014/gif/10/9/25.jpg"} }, // bindViewTap: function() { wx.navigateTo({ url: '../logs/logs' }) }, onLoad: function () { console.log('onLoad') var that = this // app.getUserInfo(function(userInfo){ // that.setData({ userInfo:userInfo }) that.update() }) } })
wxml:레이아웃 만 들 기

<!--index.wxml-->
<view class="container">
 <view bindtap="bindViewTap" class="userinfo">
  <image class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image>
  <text class="userinfo-name">{{userInfo.name}}</text>
  <text class="userinfo-desc">{{userInfo.desc}}</text>

 </view>
 <view class="usermotto">
  <text class="user-motto">{{motto}}</text>
 </view>
</view>

wxss:스타일 설정

/**index.wxss**/
.userinfo {
 display: flex;
 flex-direction: column;
 align-items: center;
}

.userinfo-avatar {
 width: 128rpx;
 height: 128rpx;
 margin: 20rpx;
 border-radius: 50%;
}

.userinfo-name {
 color: #aaa;
 font-size: 30rpx;
 margin: 30rpx;
}

.userinfo-desc {
 color: #f00;
 font-size: 50rpx;
 line-height: 70rpx;
}

.usermotto {
 margin-top: 200px;
}

프레젠테이션 캡 처

애플 릿 구성 요소 데모 데모 캡 처

이상 은 위 챗 애플 릿 의 간단 한 인 스 턴 스 입 니 다.위 챗 개발 을 시작 한 친구 들 에 게 도움 이 되 기 를 바 랍 니 다.본 사이트 에 대한 지원 에 감 사 드 립 니 다!

좋은 웹페이지 즐겨찾기