1.红绿黄三色滑块题
{{item==1?'active':''}}
id="1"
{{item==2?'active':''}}
id="2"
{{item}}
bandchange
e.currentTarget.id
e.detail.current
2.比较大小题
index.js全写
Page({
data:{
num1:0,
num2:0,
result:""
},
numValue:function(e){
this[e.currentTarget.id]=Number(e.detail.value)
},
compare:function(e){
var str='两数相等'
if(this.num1>this.num2){
str='第一个数大'
}else if(this.num1<this.num2){
str='第二个数大'
}
this.setData({
result:str
})
}
})
3.王五做运动的题
value="{{name}}"
radio-group
wx:for="{{gender}}"
checked="{{item.checked}}"
wx:for="{{sports}}"
wx:key
check="{{item.checked}}"
{{item.zm}}
4. 参加婚礼到场人数
bindsubmit
bindchange
{{picker.arr}}
{{picker.arr[picker.index]}}
submit
'picker.index':
e.detail.value.name
e.detail.value.phone
wx.showToast
wx.showToast
5.轮播图
<scroll-view class="content-info" scroll-y>
<swiper class="content-info-slide" indicator-color="rgba(255,255,255,5)" indicator-color="#fff" indicator-dots circular autoplay>
<swiper-item>
<image src="/images/1.png"/>
</swiper-item>
<swiper-item>
<image src="/images/1.png"/>
</swiper-item>
<swiper-item>
<image src="/images/1.png"/>
</swiper-item>
</swiper>
6.底部标签
"tabBar": {
"color": "#FF000000",
"selectedColor": "#ff4c91",
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "images/invite.png",
"selectedIconPath": "images/invite.png",
"text": "邀请函"
},
{
"pagePath": "pages/picture/picture",
"iconPath": "images/marry.png",
"selectedIconPath": "images/marry.png",
"text": "照片"
},
{
"pagePath": "pagesideoideo",
"iconPath": "imagesideo.png",
"selectedIconPath": "imagesideo.png",
"text": "美好时光"
},
{
"pagePath": "pages/map/map",
"iconPath": "images/map.png",
"selectedIconPath": "images/map.png",
"text": "婚礼地点"
},
{
"pagePath": "pages/guest/guest",
"iconPath": "images/guest.png",
"selectedIconPath": "images/guest.png",
"text": "宾客信息"
}
]
},
7.map
//index.js
const app = getApp()
// 获取应用实例
Page({
data: {
latitude:40.06021, longitude: 116.3433,
markers: [{
iconPath:'/images/navi.png',
id:0,
latitude:40.06021,
longitude: 116.3433,
width:50,
height:50
}]
},
markertap: function() {
wx.openLocation({
latitude:this.data.latitude,
longitude:this.data.longitude,
name:'xx大酒店',
address:'北京市 海淀区'
})
}
})