项目 | 解释 | 备注 |
---|---|---|
ML | 结构 | 标记语言 |
ss | 样式表 | Style Sheets |
js | 逻辑 | 主语言 |
json | 配置 | Object Notation 对象简谱 |
navigationBar 导航栏
//app.json
{
"pages":[
"page/convenience/convenience",
"pages/order/order",
"pages/my/my"
],
"window":{
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": "便利墙",
"navigationBarTextStyle":"white",
"enablePullDownRefresh": true,
"backgroundColor": "#0094ff"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
字符串,数字,对象
text不换行,view换行
ml
<text>{{ShouHouDiZhi}}</text>
<view>{{WenTiFanKui}}</view>
<view>{{YiWan}}</view>
<view>{{person.name}}</view>
<view id="item-{{id}}"> </view>
js
Page({
data: {
ShouHouDiZhi:"收货地址",
WenTiFanKui:"问题反馈",
YiWan:10000,
person:{
age:18,
height:150,
weight:45,
name:"小玉"
},
id: 0
}
})
复选框
<view>
<text>签收状态:</text>
<checkbox checked="{{false}}"></checkbox>
</view>
三元
<view hidden="{{flag ? true : false}}"> Hidden </view>
<view>
<view
wx:key="id"
wx:for="{{list}}"
wx:for-item="item"
wx:for-index="index">
{{index}}--{{item.name}}
</view>
</view>
<view>
<block
wx:key="id"
wx:for="{{list}}"
wx:for-item="item"
wx:for-index="index">
{{index}}--{{item.name}}
</block>
</view>
<view>
<view
wx:key="age"
wx:for="{{person}}"
wx:for-item="value"
wx:for-index="key">
{{key}} {{value}}
</view>
</view>
<view>
<view></view>
<view wx:if="{{true}}">显示</view>
<view wx:if="{{false}}">隐藏</view>
<view wx:if="{{false}}">1</view>
<view wx:elif="{{false}}">2</view>
<view wx:else>3</view>
</view>
<view hidden>hidden1</view>
<view hidden="{{false}}">频繁</view>
<view wx:if="{{true}}"> wx:if </view>
<view hidden>hidden</view>
<view hidden style="display:flex;">display覆盖</view>
Page({
data: {
QianShouZhuangTai:"签收状态:",
NoYiQianShou:false,
YesYiQianShou:true,
list:[
{
id:0,
name:"小0"
},
{
id:1,
name:"小1"
},
{
id:2,
name:"小2"
}
]
}
})
改page名称
page json "navigationBarTitleText": "便利墙",