Java教程

程序题答案总结

本文主要是介绍程序题答案总结,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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:'北京市 海淀区'
    })
  }
})
 

这篇关于程序题答案总结的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!