今天对微信开发者工具的基本框架进行了了解和学习,对基本的执行情况进行了学习,知道了它的大致结构,该如何去写,这里应该写什么内容,并且掺杂跳转页面,进度条,滚动条等小的方面学习了一下
{
"pages": [
"pages/index/index",
"pages/logs/logs",
"mypage/mypage/mypage"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "微信",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
},
"tabBar": {
"color": "#000",
"selectedColor": "#56abe4",
"backgroundColor": "#fff",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/latest.png",
"selectedIconPath": "images/lastest_on.png"
},
{
"pagePath": "pages/logs/logs",
"text": "账单",
"iconPath": "images/hotest.png",
"selectedIconPath": "images/hotest_on.png"
},
{
"pagePath": "pages/mypage/mypage",
"text": "个人中心",
"iconPath": "images/hotest.png",
"selectedIconPath": "images/hotest_on.png"
}
]
},
"networkTimeout": {
"request": 10000,
"connectSocket": 1000,
"uploadFile": 1000,
"downloadFile": 10000
},
"debug": true,
"style": "v2",
"sitemapLocation": "sitemap.json"
}
mypage。js
Page({
data:{
mytext:‘my first text‘
},
onLoad:function(opt){
console.log(‘执行onLoad‘);
this.anyfunction();
},
anyfunction:function(){
console.log(‘执行anyfunction‘);
this.setData(
{
mytext:200
}
);
}
})
mypage.wxml
<view class="container">
<text>Hellow wechat app</text>
<button type="default" bindtap="anyfunction">测试</<button></button>
<text>{{mytext}}</text>
</view>