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");
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();
$offset = $page * $rowCount;
//检索数据库
$param = array();
$param['delete_flg'] = false;
$certificateList = CertificateMst::getList($param,'display_order','desc', $offset, $rowCount);
$allCount = CertificateMst::getListCount($param);
$certificateList = CertificateMst::getList($param,'display_order','desc');
//接口返回数据
$result["allCount"] = $allCount;
$result["page"] = $page;
$result["rowCount"] = $rowCount;
$result["list"] = $certificateList;
$result["certificateList"] = $certificateList;
ErrorLogger::doOutput("Compass...ajax_get_certificates.php....End.", 0);
......
......@@ -45,7 +45,7 @@ if(!empty($tmpList)) {
//接口返回数据
$result["allCount"] = $allCount;
$result["list"] = $certificateList;
$result["certificateList"] = $certificateList;
ErrorLogger::doOutput("Compass...ajax_get_my_certificates.php....End.", 0);
......
......@@ -68,7 +68,7 @@ if(!empty($tmpCircleList)) {
$jsonObj = json_decode($distanceObj); //对JSON格式的字符串进行编码
$distanceArray = get_object_vars($jsonObj);//转换成数组
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");
ErrorLogger::doOutput("Compass...test.php....Start.", 0);
$userMst = UserMst::getById(31);
print_r($userMst);
//管辖区域
$province = $userMst->province;
$city = $userMst->city;
$district = $userMst->district;
//管辖区域内学校数量以及列表
//todo:后面改成从别的系统获取
//每页显示条数
/**
$page = 0;
$rowCount = 20;
$offset = $page * $rowCount;
......@@ -43,6 +42,20 @@ foreach($tmpList as $tmp) {
}
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);
......
......@@ -39,6 +39,7 @@
"pages/familyEventDetail/familyEventDetail",
"pages/manual/manual",
"pages/myCertificate/myCertificate",
"pages/getCertificate/getCertificate",
"pages/myNews/myNews",
"pages/socialEvent/socialEvent",
"pages/joinFamilyEvent/joinFamilyEvent",
......
......@@ -111,6 +111,9 @@ video, live-player, live-pusher, open-data, web-view {
box-sizing: border-box;
padding-right: 5px;
}
.formtable>view>van-cell-group{
flex: 1
}
.formtable .van-cell{
padding: 0;
}
......@@ -250,3 +253,26 @@ video, live-player, live-pusher, open-data, web-view {
.right_listPublicWelfare>view .van-button__text{
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({
data: {
keyword:'',
active:1,
show:0,
showNearCircles:0,
userCircleList:[],
circleList:[]
},
......@@ -68,7 +68,9 @@ Page({
})
}
},
newQuanzi(){
//新建圈子
creatCircle(){
wx.navigateTo({
url: '../newCircle1/newCircle1',
});
......@@ -76,16 +78,18 @@ Page({
title: '我的圈子'
})
},
search(e){
//查找附近的圈子
searchCircleNearby(e){
var that = this;
var config = wx.getStorageSync('config');
var jingweidu = wx.getStorageSync('jingweidu');
var location = wx.getStorageSync('location');
wx: wx.request({
url: app.url + 'ajax_get_nearby_circle_list.php',
data: {
unionId: config.unionId,
latitude: jingweidu.latitude,
longitude: jingweidu.longitude
latitude: location.latitude,
longitude: location.longitude
},
header: { 'content-type': 'application/json' },
method: 'GET',
......@@ -102,18 +106,19 @@ Page({
complete: function (res) { },
})
this.setData({
show:1
showNearCircles:1
})
},
//圈子详细
circleDetails() {
wx.navigateTo({
url: '../circleDetails/circleDetails',
});
wx.setNavigationBarTitle({
title: '测试圈子'
})
},
jinquan(){
//加入圈子
joinCircle(){
var that = this;
var config = wx.getStorageSync('config');
// var location = wx.getStorageSync('location');
......
......@@ -6,7 +6,7 @@
<view bindtap='searchCircle'>搜索</view>
</view>
<view class='newQuanzi'>
<view class='btn_newQuanzi' bindtap='newQuanzi'>
<view class='btn_newQuanzi' bindtap='creatCircle'>
新建圈子<image src='../../img/jia.png'></image>
</view>
<view class='myQuanzi'>
......@@ -23,16 +23,16 @@
<view class='top_conQuanzi'>
<image src='../../img/sanjiao.png'></image>附近志愿者圈子
</view>
<view class='quanziSearch' wx:if="{{show==0}}">
<view class='con_quanziSearch' bindtap='search'>搜索</view>
<view class='quanziSearch' wx:if="{{showNearCircles==0}}">
<view class='con_quanziSearch' bindtap='searchCircleNearby'>搜索</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>
<text></text>{{item.circle_title}}
</view>
<text>(80人)</text>
<van-button type="default" size='mini' bind:click="jinquan">进圈</van-button>
<text>({{item.member_count}}人)</text>
<van-button type="default" size='mini' bind:click="joinCircle">进圈</van-button>
</view>
</view>
</view>
......
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "圈子详情"
}
\ No newline at end of file
......@@ -191,5 +191,11 @@ Page({
});
},
})
},
// 跳到会员
memberChange() {
wx.navigateTo({
url: '../memberChange/memberChange',
})
}
})
\ No newline at end of file
......@@ -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="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}">{{item.title}}</text>
</view>
<view class='conSwiper'>
购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>详情</view>
</view>
<view class='lookHistory'>
<text bindtap='history'>历史观看</text>
</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='left_listPublicWelfare'>
<image src='{{item.front_image}}'></image>
......
/* pages/gongyiClass/gongyiClass.wxss */
.top_gongyiClass{
width: 100%;
height: 150px;
height: 120px;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
border-bottom: 1px solid #ccc;
}
.top_gongyiClass>view{
width: 45%;
......@@ -22,9 +21,11 @@
height: 25px;
line-height: 25px;
border: 1px solid #ccc;
margin-top: 20px;
}
.lookHistory{
width: 100%;
border-top: 1px solid #ccc;
}
.lookHistory>text{
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({
title: '公益课堂'
})
},
// 跳到会员
memberChange(){
wx.navigateTo({
url: '../memberChange/memberChange',
})
}
})
\ No newline at end of file
......@@ -19,12 +19,7 @@
<van-grid-item icon="../../img/4.png" text="区域管理" bindtap="area" wx:if="{{role==4}}" />
</van-grid>
<view class='conSwiper'>
<swiper indicator-dots="true"
autoplay="true" interval="3000" duration="500">
<swiper-item>
<image src='../../img/1.jpg'></image>
</swiper-item>
</swiper>
购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>详情</view>
</view>
<view class='volunteers'>
<view class='topTitle'>
......
......@@ -23,19 +23,6 @@
width: 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{
width: 100%;
height: 30px;
......
......@@ -26,7 +26,7 @@
}
.mineList{
width:100%;
margin-top: 50px;
margin-top: 30px;
}
.con_mineList{
width: 100%;
......
// pages/myCertificate/myCertificate.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
certificateList:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx:wx.request({
url: 'http://compass.koala-online.cn/user/if/ajax_update_user_age.php',
data: '',
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function(res) {
console.log(res)
},
fail: function(res) {},
complete: function(res) {},
})
onLoad: function () {
//获取用户的证书
this.getMyCertificateList();
},
/**
......@@ -41,37 +33,49 @@ Page({
},
/**
* 生命周期函数--监听页面隐藏
* 页面上拉触底事件的处理函数
*/
onHide: function () {
onReachBottom: function () {
},
/**
* 生命周期函数--监听页面卸载
* 用户点击右上角分享
*/
onUnload: function () {
onShareAppMessage: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
//获取用户的证书
getMyCertificateList() {
var that = this;
//获取用户的证书
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_my_certificates.php',
data: {
unionId: config.unionId
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
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) { },
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
//证书申领
getCertificate() {
//获取用户的证书
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-->
<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>
/* 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({
})
//检索学校详情
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_school_detail.php',
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