Commit 6d06c32b by biao

1

parent 8029f398
// pages/getCertificate/getCertificate.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
certificateList:[],
name:'',//收件人姓名
mobile: '',//收件人手机
address: '',//详细收件地址
inpShow: false,
certificateId:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
//获取全部的证书
this.getCertificateList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
//获取全部的证书
getCertificateList() {
var that = this;
//获取用户的证书
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_certificates.php',
data: {
unionId: config.unionId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
that.setData({
certificateList: res.data.result.certificateList
})
},
fail: function (res) { },
complete: function (res) { },
})
},
//证书申领
applyCertificate(e) {
let certificateId = e.currentTarget.dataset['index'];
this.setData({
inpShow: true,
certificateId: certificateId
})
},
// 输入姓名
changeName(event){
this.setData({
name: event.detail.value
})
},
// 输入手机号
changeMobile(event) {
this.setData({
mobile: event.detail.value
})
},
// 输入详细地址
changeAddress(event) {
this.setData({
address: event.detail.value
})
},
sureApplyCertificate() {
var that = this;
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_apply_certificate.php',
data: {
unionId: config.unionId,
certificateId: that.data.certificateId,
name: that.data.name,
mobile: that.data.mobile,
address: that.data.address
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
that.setData({
inpShow:false
})
wx.showToast({
title: res.data.result.message,
icon: 'success',
duration: 2000
});
//跳转到我的证书
wx.navigateTo({
url: '../myCertificate/myCertificate'
})
},
fail: function (res) { },
complete: function (res) { },
})
},
backApplyCertificate(){
this.setData({
inpShow:false
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "证书申领"
}
\ No newline at end of file
<!--pages/myCertificate/myCertificate.wxml-->
<view class='myCertificate'>
<view style='font-size:12px;color:#666;float:right;padding-right:15px;'>
</view>
<view class="certificateItem" wx:for="{{certificateList}}">
<image src='{{item.front_image}}'></image>
<view class="getRow">
<text>{{item.title}}</text>
<van-button type="default" size='mini' bindtap="applyCertificate" data-index='{{item.id}}'>申领</van-button>
</view>
</view>
</view>
<!--添加底部弹出对话框开始-->
<view class='bot_myCertificate' wx:if="{{inpShow==true}}">
<view class='con_bot_myCertificate'>
<input placeholder='请输入姓名' value='{{name}}' bindinput='changeName'></input>
<input placeholder='请输入手机号' value='{{mobile}}' bindinput='changeMobile'></input>
<input placeholder='请输入收件地址' value='{{address}}' bindinput='changeAddress'></input>
<view class='btnBot'>
<view bindtap='backApplyCertificate'>取消</view>
<view style='background:#00C56B;' bindtap='sureApplyCertificate'>确定</view>
</view>
</view>
</view>
<!--添加底部弹出对话框结束-->
\ No newline at end of file
/* pages/myCertificate/myCertificate.wxss */
page{
width: 100%;
height: 100%;
}
.certificateItem{
margin-top: 10px;
width: 90%;
margin: 0 auto;
display: flex;
flex-direction:column;
justify-content : space-between;
align-items:center;
font-size: 14px;
border-bottom: 1px solid #F0F0F0;
}
.certificateItem>image{
width:100%;
}
.getRow{
margin-top: 10px;
width: 100%;
display: flex;
flex-direction:row;
justify-content : space-between;
align-items:center;
}
.getRow>text{
width:100%;
height:35px;
line-height: 35px;
text-align: left;
}
.bot_myCertificate{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5)
}
.con_bot_myCertificate{
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 80%;
height: 150px;
background: #fff;
border-radius: 15px 15px 0 0;
}
.con_bot_myCertificate>input{
width: 80%;
height: 25px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px auto;
font-size: 12px;
box-sizing: border-box;
padding-left: 15px;
}
.btnBot{
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 80%;
height: 25px;
display: flex;
justify-content: space-between;
}
.btnBot>view{
flex: 1;
height: 25px;
text-align: center;
line-height: 25px;
font-size: 12px;
}
\ No newline at end of file
...@@ -6,27 +6,27 @@ require_once ("../user_include.inc"); ...@@ -6,27 +6,27 @@ require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_get_certificates.php....Start.", 0); ErrorLogger::doOutput("Compass...ajax_get_certificates.php....Start.", 0);
//获取参数 //获取参数
$page = ParamUtil::getRequestNumber("page", 0); $unionId = ParamUtil::getRequestString("unionId");
//每页显示条数 //判断用户是否存在
$rowCount = 10; $param = array();
$param['unionid'] = $unionId;
$param['delete_flg'] = false;
$userList = UserMst::getList($param,'id','desc', 0, 1);
if(empty($userList)) {
$result["message"] = "用户不存在!";
responseNG($result);
}
$result = array(); $result = array();
$offset = $page * $rowCount;
//检索数据库 //检索数据库
$param = array(); $param = array();
$param['delete_flg'] = false; $param['delete_flg'] = false;
$certificateList = CertificateMst::getList($param,'display_order','desc', $offset, $rowCount); $certificateList = CertificateMst::getList($param,'display_order','desc');
$allCount = CertificateMst::getListCount($param);
//接口返回数据 //接口返回数据
$result["allCount"] = $allCount; $result["certificateList"] = $certificateList;
$result["page"] = $page;
$result["rowCount"] = $rowCount;
$result["list"] = $certificateList;
ErrorLogger::doOutput("Compass...ajax_get_certificates.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_certificates.php....End.", 0);
......
...@@ -45,7 +45,7 @@ if(!empty($tmpList)) { ...@@ -45,7 +45,7 @@ if(!empty($tmpList)) {
//接口返回数据 //接口返回数据
$result["allCount"] = $allCount; $result["allCount"] = $allCount;
$result["list"] = $certificateList; $result["certificateList"] = $certificateList;
ErrorLogger::doOutput("Compass...ajax_get_my_certificates.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_my_certificates.php....End.", 0);
......
...@@ -68,7 +68,7 @@ if(!empty($tmpCircleList)) { ...@@ -68,7 +68,7 @@ if(!empty($tmpCircleList)) {
$jsonObj = json_decode($distanceObj); //对JSON格式的字符串进行编码 $jsonObj = json_decode($distanceObj); //对JSON格式的字符串进行编码
$distanceArray = get_object_vars($jsonObj);//转换成数组 $distanceArray = get_object_vars($jsonObj);//转换成数组
if($distanceArray['status'] == "0" && $distanceArray['result']->elements[0]->distance <= 3000) { if($distanceArray['status'] == "0" && $distanceArray['result']->elements[0]->distance <= 3000) {
$circleList[] = array("circle_id"=>$tmp->id, "circle_title"=>$tmp->title); $circleList[] = array("circle_id"=>$tmp->id, "circle_title"=>$tmp->title, "member_count"=>$tmp->member_count, "front_image"=>$tmp->front_image);
} }
} }
} }
......
...@@ -6,16 +6,15 @@ require_once ("../user_include.inc"); ...@@ -6,16 +6,15 @@ require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...test.php....Start.", 0); ErrorLogger::doOutput("Compass...test.php....Start.", 0);
$userMst = UserMst::getById(31); $userMst = UserMst::getById(31);
print_r($userMst);
//管辖区域 //管辖区域
$province = $userMst->province; $province = $userMst->province;
$city = $userMst->city; $city = $userMst->city;
$district = $userMst->district; $district = $userMst->district;
//管辖区域内学校数量以及列表 /**
//todo:后面改成从别的系统获取
//每页显示条数
$page = 0; $page = 0;
$rowCount = 20; $rowCount = 20;
$offset = $page * $rowCount; $offset = $page * $rowCount;
...@@ -43,6 +42,20 @@ foreach($tmpList as $tmp) { ...@@ -43,6 +42,20 @@ foreach($tmpList as $tmp) {
} }
print_r($tmpList); print_r($tmpList);
*/
$param = array();
$param['delete_flg'] = false;
$tmpList = CircleDat::getList($param, 'id', 'asc');
foreach($tmpList as $tmp) {
$tmp->province = "江苏省";
$tmp->city = "南京市";
$tmp->district = "建邺区";
$tmp->save();
}
print_r($tmpList);
ErrorLogger::doOutput("Compass...test.php....End.", 0); ErrorLogger::doOutput("Compass...test.php....End.", 0);
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
"pages/familyEventDetail/familyEventDetail", "pages/familyEventDetail/familyEventDetail",
"pages/manual/manual", "pages/manual/manual",
"pages/myCertificate/myCertificate", "pages/myCertificate/myCertificate",
"pages/getCertificate/getCertificate",
"pages/myNews/myNews", "pages/myNews/myNews",
"pages/socialEvent/socialEvent", "pages/socialEvent/socialEvent",
"pages/joinFamilyEvent/joinFamilyEvent", "pages/joinFamilyEvent/joinFamilyEvent",
......
...@@ -111,6 +111,9 @@ video, live-player, live-pusher, open-data, web-view { ...@@ -111,6 +111,9 @@ video, live-player, live-pusher, open-data, web-view {
box-sizing: border-box; box-sizing: border-box;
padding-right: 5px; padding-right: 5px;
} }
.formtable>view>van-cell-group{
flex: 1
}
.formtable .van-cell{ .formtable .van-cell{
padding: 0; padding: 0;
} }
...@@ -250,3 +253,26 @@ video, live-player, live-pusher, open-data, web-view { ...@@ -250,3 +253,26 @@ video, live-player, live-pusher, open-data, web-view {
.right_listPublicWelfare>view .van-button__text{ .right_listPublicWelfare>view .van-button__text{
color: #666; color: #666;
} }
.conSwiper{
width: 90%;
height: 40px;
margin: 20px auto;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
background: #f6f6f6;
border-radius: 15px;
box-sizing: border-box;
padding: 0 10px;
}
.conSwiper>view{
width: 60px;
height: 25px;
background: #698FBB;
color: #fff;
font-size: 12px;
line-height: 25px;
text-align: center;
border-radius: 5px;
}
\ No newline at end of file
...@@ -9,7 +9,7 @@ Page({ ...@@ -9,7 +9,7 @@ Page({
data: { data: {
keyword:'', keyword:'',
active:1, active:1,
show:0, showNearCircles:0,
userCircleList:[], userCircleList:[],
circleList:[] circleList:[]
}, },
...@@ -68,7 +68,9 @@ Page({ ...@@ -68,7 +68,9 @@ Page({
}) })
} }
}, },
newQuanzi(){
//新建圈子
creatCircle(){
wx.navigateTo({ wx.navigateTo({
url: '../newCircle1/newCircle1', url: '../newCircle1/newCircle1',
}); });
...@@ -76,16 +78,18 @@ Page({ ...@@ -76,16 +78,18 @@ Page({
title: '我的圈子' title: '我的圈子'
}) })
}, },
search(e){
//查找附近的圈子
searchCircleNearby(e){
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var jingweidu = wx.getStorageSync('jingweidu'); var location = wx.getStorageSync('location');
wx: wx.request({ wx: wx.request({
url: app.url + 'ajax_get_nearby_circle_list.php', url: app.url + 'ajax_get_nearby_circle_list.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
latitude: jingweidu.latitude, latitude: location.latitude,
longitude: jingweidu.longitude longitude: location.longitude
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
...@@ -102,18 +106,19 @@ Page({ ...@@ -102,18 +106,19 @@ Page({
complete: function (res) { }, complete: function (res) { },
}) })
this.setData({ this.setData({
show:1 showNearCircles:1
}) })
}, },
//圈子详细
circleDetails() { circleDetails() {
wx.navigateTo({ wx.navigateTo({
url: '../circleDetails/circleDetails', url: '../circleDetails/circleDetails',
}); });
wx.setNavigationBarTitle({
title: '测试圈子'
})
}, },
jinquan(){
//加入圈子
joinCircle(){
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
// var location = wx.getStorageSync('location'); // var location = wx.getStorageSync('location');
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view bindtap='searchCircle'>搜索</view> <view bindtap='searchCircle'>搜索</view>
</view> </view>
<view class='newQuanzi'> <view class='newQuanzi'>
<view class='btn_newQuanzi' bindtap='newQuanzi'> <view class='btn_newQuanzi' bindtap='creatCircle'>
新建圈子<image src='../../img/jia.png'></image> 新建圈子<image src='../../img/jia.png'></image>
</view> </view>
<view class='myQuanzi'> <view class='myQuanzi'>
...@@ -23,16 +23,16 @@ ...@@ -23,16 +23,16 @@
<view class='top_conQuanzi'> <view class='top_conQuanzi'>
<image src='../../img/sanjiao.png'></image>附近志愿者圈子 <image src='../../img/sanjiao.png'></image>附近志愿者圈子
</view> </view>
<view class='quanziSearch' wx:if="{{show==0}}"> <view class='quanziSearch' wx:if="{{showNearCircles==0}}">
<view class='con_quanziSearch' bindtap='search'>搜索</view> <view class='con_quanziSearch' bindtap='searchCircleNearby'>搜索</view>
</view> </view>
<view class='con_conQuanzi' wx:if="{{show==1}}"> <view class='con_conQuanzi' wx:if="{{showNearCircles==1}}">
<view class='quanziList' wx:for="{{circleList}}" wx:key="{{index}}"> <view class='quanziList' wx:for="{{circleList}}" wx:key="{{index}}">
<view> <view>
<text></text>{{item.circle_title}} <text></text>{{item.circle_title}}
</view> </view>
<text>(80人)</text> <text>({{item.member_count}}人)</text>
<van-button type="default" size='mini' bind:click="jinquan">进圈</van-button> <van-button type="default" size='mini' bind:click="joinCircle">进圈</van-button>
</view> </view>
</view> </view>
</view> </view>
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "圈子详情"
} }
\ No newline at end of file
...@@ -191,5 +191,11 @@ Page({ ...@@ -191,5 +191,11 @@ Page({
}); });
}, },
}) })
},
// 跳到会员
memberChange() {
wx.navigateTo({
url: '../memberChange/memberChange',
})
} }
}) })
\ No newline at end of file
...@@ -7,11 +7,14 @@ ...@@ -7,11 +7,14 @@
<text wx:for="{{subCategory1}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}">{{item.title}}</text> <text wx:for="{{subCategory1}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}">{{item.title}}</text>
<text wx:for="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}">{{item.title}}</text> <text wx:for="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}">{{item.title}}</text>
</view> </view>
<view class='conSwiper'>
购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>详情</view>
</view>
<view class='lookHistory'> <view class='lookHistory'>
<text bindtap='history'>历史观看</text> <text bindtap='history'>历史观看</text>
</view> </view>
<scroll-view scroll-y="true" style='height:750rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'> <scroll-view scroll-y="true" style='height:660rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'>
<view class='activelist' bindtap='classDetails' wx:for="{{list}}" data-index="{{list[index].id}}"> <view class='activelist' bindtap='classDetails' wx:for="{{list}}" data-index="{{list[index].id}}">
<view class='left_listPublicWelfare'> <view class='left_listPublicWelfare'>
<image src='{{item.front_image}}'></image> <image src='{{item.front_image}}'></image>
......
/* pages/gongyiClass/gongyiClass.wxss */ /* pages/gongyiClass/gongyiClass.wxss */
.top_gongyiClass{ .top_gongyiClass{
width: 100%; width: 100%;
height: 150px; height: 120px;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
flex-wrap: wrap; flex-wrap: wrap;
border-bottom: 1px solid #ccc;
} }
.top_gongyiClass>view{ .top_gongyiClass>view{
width: 45%; width: 45%;
...@@ -22,9 +21,11 @@ ...@@ -22,9 +21,11 @@
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
border: 1px solid #ccc; border: 1px solid #ccc;
margin-top: 20px;
} }
.lookHistory{ .lookHistory{
width: 100%; width: 100%;
border-top: 1px solid #ccc;
} }
.lookHistory>text{ .lookHistory>text{
display: block; display: block;
......
// pages/getCertificate/getCertificate.js
import Notify from '../../dist/notify/notify';
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
certificateList:[],
name:'',//收件人姓名
mobile: '',//收件人手机
address: '',//详细收件地址
inpShow: false,
certificateId:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
//获取全部的证书
this.getCertificateList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
//获取全部的证书
getCertificateList() {
var that = this;
//获取用户的证书
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_certificates.php',
data: {
unionId: config.unionId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
that.setData({
certificateList: res.data.result.certificateList
})
},
fail: function (res) { },
complete: function (res) { },
})
},
//证书申领
applyCertificate(e) {
let certificateId = e.currentTarget.dataset['index'];
this.setData({
inpShow: true,
certificateId: certificateId
})
},
// 输入姓名
changeName(event){
this.setData({
name: event.detail.value
})
},
// 输入手机号
changeMobile(event) {
this.setData({
mobile: event.detail.value
})
},
// 输入详细地址
changeAddress(event) {
this.setData({
address: event.detail.value
})
},
//提交申请
sureApplyCertificate() {
var that = this;
if (that.data.name == null || that.data.name.trim() == "") {
Notify('请输入姓名')
return
}
if (that.data.mobile == null || that.data.name.mobile() == "") {
Notify('请输入手机号码')
return
}
if (that.address.mobile == null || that.data.address.mobile() == "") {
Notify('请输入收件地址')
return
}
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_apply_certificate.php',
data: {
unionId: config.unionId,
certificateId: that.data.certificateId,
name: that.data.name,
mobile: that.data.mobile,
address: that.data.address
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
that.setData({
inpShow:false
})
wx.showToast({
title: res.data.result.message,
icon: 'success',
duration: 2000
});
//跳转到我的证书
wx.navigateTo({
url: '../myCertificate/myCertificate'
})
},
fail: function (res) { },
complete: function (res) { },
})
},
backApplyCertificate(){
this.setData({
inpShow:false
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "证书申领"
}
\ No newline at end of file
<!--pages/myCertificate/myCertificate.wxml-->
<view class='myCertificate'>
<view style='font-size:12px;color:#666;float:right;padding-right:15px;'>
</view>
<view class="certificateItem" wx:for="{{certificateList}}">
<image src='{{item.front_image}}'></image>
<view class="getRow">
<text>{{item.title}}</text>
<van-button type="default" size='mini' bindtap="applyCertificate" data-index='{{item.id}}'>申领</van-button>
</view>
</view>
</view>
<!--添加底部弹出对话框开始-->
<view class='bot_myCertificate' wx:if="{{inpShow==true}}">
<view class='con_bot_myCertificate'>
<input placeholder='请输入姓名' value='{{name}}' bindinput='changeName'></input>
<input placeholder='请输入手机号' value='{{mobile}}' bindinput='changeMobile'></input>
<input placeholder='请输入收件地址' value='{{address}}' bindinput='changeAddress'></input>
<view class='btnBot'>
<view bindtap='backApplyCertificate'>取消</view>
<view style='background:#00C56B;' bindtap='sureApplyCertificate'>确定</view>
</view>
</view>
</view>
<!--添加底部弹出对话框结束-->
<van-notify id="van-notify" />
\ No newline at end of file
/* pages/myCertificate/myCertificate.wxss */
page{
width: 100%;
height: 100%;
}
.certificateItem{
margin-top: 10px;
width: 90%;
margin: 0 auto;
display: flex;
flex-direction:column;
justify-content : space-between;
align-items:center;
font-size: 14px;
border-bottom: 1px solid #F0F0F0;
}
.certificateItem>image{
width:100%;
}
.getRow{
margin-top: 10px;
width: 100%;
display: flex;
flex-direction:row;
justify-content : space-between;
align-items:center;
}
.getRow>text{
width:100%;
height:35px;
line-height: 35px;
text-align: left;
}
.bot_myCertificate{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5)
}
.con_bot_myCertificate{
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 80%;
height: 150px;
background: #fff;
border-radius: 15px 15px 0 0;
}
.con_bot_myCertificate>input{
width: 80%;
height: 25px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px auto;
font-size: 12px;
box-sizing: border-box;
padding-left: 15px;
}
.btnBot{
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 80%;
height: 25px;
display: flex;
justify-content: space-between;
}
.btnBot>view{
flex: 1;
height: 25px;
text-align: center;
line-height: 25px;
font-size: 12px;
}
\ No newline at end of file
...@@ -277,5 +277,10 @@ Page({ ...@@ -277,5 +277,10 @@ Page({
title: '公益课堂' title: '公益课堂'
}) })
}, },
// 跳到会员
memberChange(){
wx.navigateTo({
url: '../memberChange/memberChange',
})
}
}) })
\ No newline at end of file
...@@ -19,12 +19,7 @@ ...@@ -19,12 +19,7 @@
<van-grid-item icon="../../img/4.png" text="区域管理" bindtap="area" wx:if="{{role==4}}" /> <van-grid-item icon="../../img/4.png" text="区域管理" bindtap="area" wx:if="{{role==4}}" />
</van-grid> </van-grid>
<view class='conSwiper'> <view class='conSwiper'>
<swiper indicator-dots="true" 购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>详情</view>
autoplay="true" interval="3000" duration="500">
<swiper-item>
<image src='../../img/1.jpg'></image>
</swiper-item>
</swiper>
</view> </view>
<view class='volunteers'> <view class='volunteers'>
<view class='topTitle'> <view class='topTitle'>
......
...@@ -23,19 +23,6 @@ ...@@ -23,19 +23,6 @@
width: 1.6em!important; width: 1.6em!important;
height: 1.6em!important; height: 1.6em!important;
} }
.conSwiper{
width: 90%;
height: 60px;
margin: 20px auto;
}
.conSwiper>swiper{
width: 100%;
height: 100%;
}
.conSwiper>swiper image{
width: 100%;
height: 100%;
}
.topTitle{ .topTitle{
width: 100%; width: 100%;
height: 30px; height: 30px;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
} }
.mineList{ .mineList{
width:100%; width:100%;
margin-top: 50px; margin-top: 30px;
} }
.con_mineList{ .con_mineList{
width: 100%; width: 100%;
......
// pages/myCertificate/myCertificate.js // pages/myCertificate/myCertificate.js
var app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
certificateList:[]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function () {
wx:wx.request({ //获取用户的证书
url: 'http://compass.koala-online.cn/user/if/ajax_update_user_age.php', this.getMyCertificateList();
data: '',
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function(res) {
console.log(res)
},
fail: function(res) {},
complete: function(res) {},
})
}, },
/** /**
...@@ -41,37 +33,49 @@ Page({ ...@@ -41,37 +33,49 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 页面上拉触底事件的处理函数
*/ */
onHide: function () { onReachBottom: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 用户点击右上角分享
*/ */
onUnload: function () { onShareAppMessage: function () {
}, },
/** //获取用户的证书
* 页面相关事件处理函数--监听用户下拉动作 getMyCertificateList() {
*/ var that = this;
onPullDownRefresh: function () { //获取用户的证书
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_my_certificates.php',
data: {
unionId: config.unionId
}, },
header: { 'content-type': 'application/json' },
/** method: 'GET',
* 页面上拉触底事件的处理函数 dataType: 'json',
*/ success: function (res) {
onReachBottom: function () { that.setData({
certificateList: res.data.result.certificateList
})
},
fail: function (res) { },
complete: function (res) { },
})
}, },
/** //证书申领
* 用户点击右上角分享 getCertificate() {
*/ //获取用户的证书
onShareAppMessage: function () { wx.navigateTo({
url: '../getCertificate/getCertificate'
})
return;
} }
}) })
\ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "我的证书"
} }
\ No newline at end of file
<!--pages/myCertificate/myCertificate.wxml--> <!--pages/myCertificate/myCertificate.wxml-->
<view class='myCertificate'> <view class='myCertificate'>
<view style='font-size:12px;color:#666;float:right;padding-right:15px;'>
<van-button type="default" size='normal' bindtap="getCertificate">申领证书</van-button>
</view>
<view class="certificateItem" wx:for="{{certificateList}}">
<image src='{{item.front_image}}'></image>
<text>{{item.title}}[{{item.status}}]</text>
</view>
</view> </view>
/* pages/myCertificate/myCertificate.wxss */ /* pages/myCertificate/myCertificate.wxss */
.certificateItem{
margin-top: 10px;
width: 90%;
margin: 0 auto;
display: flex;
flex-direction:column;
justify-content : space-between;
align-items:center;
text-align: center;
font-size: 14px;
border-bottom: 1px solid #F0F0F0;
}
.certificateItem>image{
width:100%;
}
.certificateItem>text{
width:100%;
height:35px;
line-height: 35px;
text-align: left;
}
\ No newline at end of file
...@@ -27,7 +27,6 @@ Page({ ...@@ -27,7 +27,6 @@ Page({
}) })
//检索学校详情 //检索学校详情
var config = wx.getStorageSync('config');
wx.request({ wx.request({
url: app.url + 'ajax_get_school_detail.php', url: app.url + 'ajax_get_school_detail.php',
data: { data: {
......
File added
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