Commit 0836c0c1 authored by 石盼盼's avatar 石盼盼

Merge branch 'shipanpan' into 'master'

所有徽章接口对接,所有徽章页面

See merge request !17
parents 0bd41f81 fb858ca5
......@@ -17,6 +17,7 @@
"pages/index/classDetail/classDetail",
"pages/index/performance/performance",
"pages/index/evaluation/evaluation",
"pages/index/badgelist/badgelist",
"pages/team/teamDetail/teamDetail"
],
"tabBar":{
......
const app = getApp()
import { Base } from '../../../utils/base.js';
const base = new Base()
Page({
data: {
list: [],
selectlist:[]
},
onLoad: function (options) {
this.getList()
},
getList() {
wx.showLoading({
title: '加载中...',
})
let params = {
url: 'badges/all',
callback: (data) => {
console.log(data)
wx.hideLoading()
this.setData({
list: data
})
// for (let i = 0; i < this.data.list.length; i++) {
// console.log(this.data.list)
// }
}
}
base.newRequest(params)
},
chooseOne: function(e){
let index = e.currentTarget.dataset.index
console.log(index)
if(this.data.selectlist.length<=2){
// if(this.data.selectlist.length>1){
// // for( var i=0 ;i<this.data.selectlist.length;i++){
// // if(index == this.data.selectlist[i]){
// // console.log(11111,index)
// // }
// // else{
// // this.data.selectlist.push(index)
// // console.log(this.data.selectlist,22222)
// // }
// // }
// }else{
// this.data.selectlist.push(index)
// }
this.data.selectlist.push(index);
this.setData({
selectlist: this.data.selectlist
})
}
console.log(this.data.selectlist)
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "我的徽章"
}
\ No newline at end of file
<view>
<view class="tip">提示:最多选择三个徽章</view>
<view class="top">
<view class="title">运动大满贯</view>
<view class="imgbox flex-h flex-vc flex-hw">
<view wx:for="{{list}}" wx:key='index' wx:for-item='item_a' data-index="{{index}}" bindtap="chooseOne" >
<!-- <view wx:for="{{selectlist}}" wx:key='index' wx:for-item='selectlistOne'></view> -->
<image wx:if="{{selectlist==item_a.id}}" class="bigimg" src="{{item_a.icon.active}}" ></image>
<image wx:else class="bigimg" src="{{item_a.icon}}"></image>
</view>
</view>
</view>
</view>
<view class="button">
<view class="apply" bindtap="goapplyResult">保存</view>
</view>
\ No newline at end of file
page{
background: #F7F8FA;
}
.tip{
width: 750rpx;
height: 53rpx;
background: #FFF2DD;
padding-left: 30rpx;
color: #7F5C37;
font-size: 24rpx;
line-height: 53rpx;
}
.title {
padding-left: 52rpx;
height: 100rpx;
line-height: 100rpx;
position: relative;
font-size: 30rpx;
font-weight: bold;
color: #1A1A1A;
}
.title::before {
position: absolute;
left: 30rpx;
top: 35rpx;
content: '';
width: 8rpx;
height: 30rpx;
background: #FFC600;
border-radius: 4rpx;
}
.imgbox {
width: 690rpx;
margin: 0 auto;
padding: 60rpx 0 10rpx 0;
background: #fff;
border-radius: 15rpx;
}
.imgbox view{
margin-left:26rpx;
}
.bigimg {
width: 150rpx;
height: 150rpx;
border-radius: 50%;
margin: 0 28rpx 50rpx 28rpx;
}
.bigimg:nth-child(3n-1) {
margin: 0 64rpx 50rpx 64rpx;
}
/* 按钮样式 */
.button{
width: 750rpx;
height: 118rpx;
padding: 18rpx 68rpx 20rpx;
position: fixed;
bottom: 0;
}
.button .apply{
width: 620rpx;
height: 80rpx;
border:none;
background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%);
border-radius: 40rpx;
color: #000000;
font-size: 30rpx;
text-align: center;
line-height: 80rpx;
}
\ No newline at end of file
......@@ -41,5 +41,10 @@ Page({
currentValue: event.detail.value,
});
},
gobadgelist:function(){
wx.navigateTo({
url: '../../index/badgelist/badgelist',
})
}
})
\ No newline at end of file
......@@ -18,6 +18,7 @@
</view>
<view class="badge">
<view class="title">颁发徽章</view>
<image src="/images/add.png" bindtap="gobadgelist"></image>
</view>
</view>
<view class="button">
......
......@@ -62,6 +62,10 @@ page {
padding: 50rpx 30rpx;
margin-bottom: 50rpx;
}
.badge image{
width: 130rpx;
height: 130rpx;
}
.txt{
color: #1A1A1A;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment