위 챗 애플 릿 개발 사례 상세 설명
자원 집계: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;
}
프레젠테이션 캡 처애플 릿 구성 요소 데모 데모 캡 처
이상 은 위 챗 애플 릿 의 간단 한 인 스 턴 스 입 니 다.위 챗 개발 을 시작 한 친구 들 에 게 도움 이 되 기 를 바 랍 니 다.본 사이트 에 대한 지원 에 감 사 드 립 니 다!
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
콩짜개 검색 - 위 챗 공공 플랫폼 접속 (wechatpy)위의 글 은 위 챗 공공 플랫폼 을 어떻게 연결 하 는 지 소 개 했 지만 그 안의 검증 코드 는 우리 가 스스로 실현 한 것 이다.그러나 지금 우 리 는 더 좋 은 선택 이 생 겼 다.위 챗 (WeChat) 퍼 블...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.