資源簡介
【實例簡介】
部分代碼:
checkedID : null
},
check:function(e){
let id = e.currentTarget.dataset.id;
if (this.data.checkedID !== id){
this.setData({
checkedID : id
})
}
},
save:function(){
let id = this.data.checkedID;
let wishList = this.data.wishList;
let i = wishList.findIndex(function(item,index,arr){
return item.id == id;
})
if (i >= 0){
app.setWishes(wishList[i].wishes,true);
wx.navigateBack()
}else{
console.error(`no item with id ${id} in wishList`)
}
},
onLoad:function(opt){
app.getUserInfo(function(userInfo){
console.log(userInfo.nickName)
})
let that = this;
util.request({
path:'lists',
relation:opt.relation,
sex:opt.sex
},function(wishList){
that.setData({
wishList : wishList
})
})
}
})
more.wxml:
<view class="container">
<scroll-view scroll-y="true">
<!-- <form bindsubmit="save"> -->
<!-- <radio-group name="select-more"> -->
<block wx:for="{{wishList}}" wx:key="{{item}}">
<view class="item {{checkedID === item.id ? 'on' : ''}}" bindtap="check" data-id="{{item.id}}" >
<!-- <radio value="{{item.id}}" hidden id="{{item.id}}"/> -->
<!-- <label class="label" for="{{item.id}}" bindtap="check" data-id="{{item.id}}"> -->
<view class="state">
<view class="circle {{itemIndex == item ? 'on' : ''}}"></view>
</view>
<view class="sentence">
{{item.wishes}}
</view>
<!-- </label> -->
</view>
</block>
<!-- </radio-group> -->
<!-- </form> -->
</scroll-view>
<button class="save" hover-class="save-hover" bindtap="save">確定</button>
</view>
有源碼,完整文檔,和部分截圖。
代碼片段和文件信息
-----------?---------??----------?-----??----
?????文件???????2357??2017-02-01?22:44??祝福小程序\app.js
?????文件????????525??2019-12-22?13:45??祝福小程序\app.json
?????文件????????551??2017-02-01?22:44??祝福小程序\app.wxss
?????文件???????2181??2017-02-01?22:44??祝福小程序\images\colleague.png
?????文件???????2415??2017-02-01?22:44??祝福小程序\images\elder.png
?????文件???????2247??2017-02-01?22:44??祝福小程序\images\ex.png
?????文件???????1476??2017-02-01?22:44??祝福小程序\images\female.png
?????文件???????2178??2017-02-01?22:44??祝福小程序\images\friend.png
?????文件???????1495??2017-02-01?22:44??祝福小程序\images\indicator.png
?????文件???????2783??2017-02-01?22:44??祝福小程序\images\leader.png
?????文件???????1830??2017-02-01?22:44??祝福小程序\images\lover.png
?????文件???????2087??2017-02-01?22:44??祝福小程序\images\male.png
?????文件???????5658??2017-02-01?22:44??祝福小程序\images\share-tips.png
?????文件???????4091??2017-02-01?22:44??祝福小程序\images\tap.png
?????文件???????2510??2017-02-01?22:44??祝福小程序\images\teacher.png
?????文件?????137045??2017-02-01?22:44??祝福小程序\images\wishes-panel.png
?????文件???????2520??2017-02-01?22:44??祝福小程序\images\younger.png
?????文件???????1798??2019-12-22?16:28??祝福小程序\pages\create\create.js
?????文件???????2770??2017-02-01?22:44??祝福小程序\pages\create\create.wxm
?????文件???????1672??2017-02-01?22:44??祝福小程序\pages\create\create.wxss
?????文件???????2597??2017-02-01?22:44??祝福小程序\pages\custom\custom.js
?????文件???????3063??2017-02-01?22:44??祝福小程序\pages\custom\custom.wxm
?????文件???????5122??2017-02-01?22:44??祝福小程序\pages\custom\custom.wxss
?????文件???????1273??2017-02-01?22:44??祝福小程序\pages\more\more.js
?????文件????????961??2017-02-01?22:44??祝福小程序\pages\more\more.wxm
?????文件???????1336??2017-02-01?22:44??祝福小程序\pages\more\more.wxss
?????文件???????3843??2017-02-01?22:44??祝福小程序\pages\preview\preview.js
?????文件???????2638??2019-12-19?22:12??祝福小程序\pages\preview\preview.wxm
?????文件???????3026??2017-02-01?22:44??祝福小程序\pages\preview\preview.wxss
?????文件????????721??2019-12-22?13:29??祝福小程序\project.config.json
............此處省略14個文件信息
- 上一篇:Authorware作業1
- 下一篇:autojs 秒換復活甲
評論
共有 條評論