Commit 4a1704f6 by biao

1

parent 3139a14e
...@@ -39,11 +39,13 @@ if(!empty($jsCode)) { ...@@ -39,11 +39,13 @@ if(!empty($jsCode)) {
$param['delete_flg'] = false; $param['delete_flg'] = false;
$tmpUserMst = UserMst::getList($param,'id','desc', 0, 1); $tmpUserMst = UserMst::getList($param,'id','desc', 0, 1);
if(empty($tmpUserMst)) { if(empty($tmpUserMst)) {
$result["registed"] = false;
$result["openId"] = $openId; $result["openId"] = $openId;
$result["unionId"] = $unionId; $result["unionId"] = $unionId;
$result["message"] = "未注册!"; $result["message"] = "未注册!";
responseOK($result); responseOK($result);
} else { } else {
$result["registed"] = true;
$result["openId"] = $openId; $result["openId"] = $openId;
$result["unionId"] = $unionId; $result["unionId"] = $unionId;
$result["message"] = "已注册!"; $result["message"] = "已注册!";
...@@ -60,9 +62,11 @@ if(!empty($jsCode)) { ...@@ -60,9 +62,11 @@ if(!empty($jsCode)) {
$param['delete_flg'] = false; $param['delete_flg'] = false;
$tmpUserMst = UserMst::getList($param,'id','desc', 0, 1); $tmpUserMst = UserMst::getList($param,'id','desc', 0, 1);
if(empty($tmpUserMst)) { if(empty($tmpUserMst)) {
$result["registed"] = false;
$result["message"] = "未注册!"; $result["message"] = "未注册!";
responseOK($result); responseOK($result);
} else { } else {
$result["registed"] = true;
$result["message"] = "已注册!"; $result["message"] = "已注册!";
responseNG($result); responseNG($result);
} }
......
...@@ -44,6 +44,7 @@ $courseTitle = ""; ...@@ -44,6 +44,7 @@ $courseTitle = "";
$teacherName = ""; $teacherName = "";
$teacherProfile = ""; $teacherProfile = "";
$frontImage = ""; $frontImage = "";
$courseComment = "";
$courseMediaList = array(); $courseMediaList = array();
//单个视频 //单个视频
if($courseMediaDat->course_id == 0) { if($courseMediaDat->course_id == 0) {
...@@ -52,13 +53,15 @@ if($courseMediaDat->course_id == 0) { ...@@ -52,13 +53,15 @@ if($courseMediaDat->course_id == 0) {
$teacherName = $courseMediaDat->teacher; $teacherName = $courseMediaDat->teacher;
$teacherProfile = $courseMediaDat->teacher_profile; $teacherProfile = $courseMediaDat->teacher_profile;
$frontImage = $courseMediaDat->front_image; $frontImage = $courseMediaDat->front_image;
$courseComment = $courseMediaDat->comment;
} else { } else {
//合集视频 //合集视频
$courseMst = CourseMst::getById($courseMediaDat->course_id); $courseMst = CourseMst::getById($courseMediaDat->course_id);
$courseTitle = $courseMst->title; $courseTitle = $courseMst->title;
$teacherName = $courseMst->teacher; $teacherName = $courseMst->teacher_name;
$teacherProfile = $courseMst->teacher_profile; $teacherProfile = $courseMst->teacher_profile;
$frontImage = $courseMst->front_image; $frontImage = $courseMst->front_image;
$courseComment = $courseMst->comment;
$param = array(); $param = array();
$param['course_id'] = $courseMediaDat->course_id; $param['course_id'] = $courseMediaDat->course_id;
...@@ -70,8 +73,7 @@ if($courseMediaDat->course_id == 0) { ...@@ -70,8 +73,7 @@ if($courseMediaDat->course_id == 0) {
if(!$tmp->is_free) { if(!$tmp->is_free) {
//收费课程的情况下,判断用户是否已经购买本课程 //收费课程的情况下,判断用户是否已经购买本课程
$param = array(); $param = array();
$param['user_id'] = $$userMst->id; $param['user_id'] = $userMst->id;
$param['course_id'] = $courseId;
$param['media_id'] = $tmp->id; $param['media_id'] = $tmp->id;
$param['is_free'] = false; $param['is_free'] = false;
$param['status'] = 'SUCCESS'; $param['status'] = 'SUCCESS';
...@@ -90,7 +92,8 @@ if($courseMediaDat->course_id == 0) { ...@@ -90,7 +92,8 @@ if($courseMediaDat->course_id == 0) {
$result["courseTitle"] = $courseTitle; $result["courseTitle"] = $courseTitle;
$result["teacherName"] = $teacherName; $result["teacherName"] = $teacherName;
$result["teacherProfile"] = $teacherProfile; $result["teacherProfile"] = $teacherProfile;
$result["frontImage"] = $teacherProfile; $result["frontImage"] = $frontImage;
$result["courseComment"] = $courseComment;
$result["mediaCount"] = count($courseMediaList); $result["mediaCount"] = count($courseMediaList);
$result["mediaList"] = $courseMediaList; $result["mediaList"] = $courseMediaList;
......
<?php
// 获取领导注册qr信息
require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_get_qr_info.php....Start.", 0);
//获取参数
$qrId = ParamUtil::getRequestString("qrId");
$result = array();
//参数检查
if(empty($qrId)) {
$result["message"] = "参数错误!";
responseNG1($result);
}
//判断qr是否存在
$governmentQrDat = GovernmentQrDat::getById($qrId);
if(empty($governmentQrDat)) {
$result["message"] = "参数错误!";
responseNG($result);
}
$result["qrDat"] = $governmentQrDat;
ErrorLogger::doOutput("Compass...ajax_get_qr_info.php....End.", 0);
//返回结果
responseOK($result);
function responseNG1($result) {
$result = array("status"=>"NG", "result"=>$result);
print json_encode($result);
exit;
}
function responseNG2($result) {
$result = array("status"=>"REGIST", "result"=>$result);
print json_encode($result);
exit;
}
function responseOK($result) {
$result = array("status"=>"OK", "result"=>$result);
print json_encode($result);
exit;
}
?>
\ No newline at end of file
...@@ -31,6 +31,7 @@ if(empty($userList)) { ...@@ -31,6 +31,7 @@ if(empty($userList)) {
$userMst = $userList[0]; $userMst = $userList[0];
//接口返回数据 //接口返回数据
$result["name"] = $userMst->name;
$result["role"] = $userMst->role; $result["role"] = $userMst->role;
$result["isMember"] = $userMst->is_member; $result["isMember"] = $userMst->is_member;
$result["childAge"] = $userMst->child_age; $result["childAge"] = $userMst->child_age;
......
...@@ -7,6 +7,7 @@ ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....Start.", 0); ...@@ -7,6 +7,7 @@ ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....Start.", 0);
$openId = ParamUtil::getRequestString("openId"); $openId = ParamUtil::getRequestString("openId");
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$qrId = ParamUtil::getRequestNumber("qrId", 0); $qrId = ParamUtil::getRequestNumber("qrId", 0);
$headerImg = ParamUtil::getRequestString("headerImg");
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....openId=" . $openId, 0); ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....openId=" . $openId, 0);
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....unionId=" . $unionId, 0); ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....unionId=" . $unionId, 0);
...@@ -54,13 +55,19 @@ if(date("Y-m-d")> $governmentQrDat->limit_date) { ...@@ -54,13 +55,19 @@ if(date("Y-m-d")> $governmentQrDat->limit_date) {
$userMst = new UserMst(); $userMst = new UserMst();
$userMst->openid = $openId; $userMst->openid = $openId;
$userMst->unionid = $unionId; $userMst->unionid = $unionId;
$userMst->name = "教育局领导";//4:教育局领导
$userMst->role = 4;//4:教育局领导 $userMst->role = 4;//4:教育局领导
$userMst->header_img = $headerImg;
$userMst->government_id = $governmentQrDat->government_id; $userMst->government_id = $governmentQrDat->government_id;
$userMst->province = $governmentQrDat->province; $userMst->province = $governmentQrDat->province;
$userMst->city = $governmentQrDat->city; $userMst->city = $governmentQrDat->city;
$userMst->district = $governmentQrDat->district; $userMst->district = $governmentQrDat->district;
$userMst->save(); $userMst->save();
//减少使用次数
$governmentQrDat->use_count++;
$governmentQrDat->save();
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....End.", 0);
......
...@@ -8,7 +8,8 @@ ErrorLogger::doOutput("Compass...ajax_social_user_register1.php....Start.", 0); ...@@ -8,7 +8,8 @@ ErrorLogger::doOutput("Compass...ajax_social_user_register1.php....Start.", 0);
$name = ParamUtil::getRequestString("name");//用户填写的用户名称 $name = ParamUtil::getRequestString("name");//用户填写的用户名称
$mobile = ParamUtil::getRequestNumber("mobile"); $mobile = ParamUtil::getRequestNumber("mobile");
$legalPerson = ParamUtil::getRequestString("legalPerson"); $legalPerson = ParamUtil::getRequestString("legalPerson");
$organizationContact = ParamUtil::getRequestNumber("organizationContact"); $organizationContact = ParamUtil::getRequestString("organizationContact");
$headerImg = ParamUtil::getRequestString("headerImg");
$openId = ParamUtil::getRequestString("openId"); $openId = ParamUtil::getRequestString("openId");
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$longitude = ParamUtil::getRequestString("longitude");//用户位置的经度 $longitude = ParamUtil::getRequestString("longitude");//用户位置的经度
...@@ -55,8 +56,6 @@ if($lbsArray['status'] == "0" && $resultObj->ad_info->nation_code==156) { ...@@ -55,8 +56,6 @@ if($lbsArray['status'] == "0" && $resultObj->ad_info->nation_code==156) {
//用户数据插入 //用户数据插入
$userMst = new UserMst(); $userMst = new UserMst();
$userMst->school_no = $schoolNo;
$userMst->class_no = $classNo;
if(empty($legalPerson)) { if(empty($legalPerson)) {
$userMst->role = 5; //社会用户[非机构] $userMst->role = 5; //社会用户[非机构]
} else { } else {
...@@ -74,6 +73,7 @@ $userMst->openid = $openId; ...@@ -74,6 +73,7 @@ $userMst->openid = $openId;
$userMst->unionid = $unionId; $userMst->unionid = $unionId;
$userMst->name = $name; $userMst->name = $name;
$userMst->mobile = $mobile; $userMst->mobile = $mobile;
$userMst->header_img = $headerImg;
$userMst->legal_person = $legalPerson; $userMst->legal_person = $legalPerson;
$userMst->organization_contact = $organizationContact; $userMst->organization_contact = $organizationContact;
$userMst->save(); $userMst->save();
......
...@@ -7,23 +7,15 @@ ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....Start.", 0); ...@@ -7,23 +7,15 @@ ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....Start.", 0);
//获取参数 //获取参数
$openId = ParamUtil::getRequestString("openId"); $openId = ParamUtil::getRequestString("openId");
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$role = ParamUtil::getRequestNumber("role");
$schoolNo = ParamUtil::getRequestString("schoolNo"); //$openId = $_POST['openId'];
$classNo = ParamUtil::getRequestString("classNo"); //$unionId = $_POST['unionId'];
$schoolOwner = ParamUtil::getRequestBoolean("schoolOwner", false);
$classOwner = ParamUtil::getRequestBoolean("classOwner", false);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....openId=" . $openId, 0); ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....openId=" . $openId, 0);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....unionId=" . $unionId, 0); ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....unionId=" . $unionId, 0);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....schoolNo=" . $schoolNo, 0);
ErrorLogger::doOutput("Compass...ajax_social_user_register2.php....classNo=" . $classNo, 0);
//参数验证 //参数验证
if(empty($name) || empty($openId) || empty($unionId) || empty($schoolNo)) { if(empty($openId) || empty($unionId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
if(role<>1 && role<>2 && role<>3) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG($result);
} }
......
...@@ -9,6 +9,7 @@ $name = ParamUtil::getRequestString("name");//用户微信昵称 ...@@ -9,6 +9,7 @@ $name = ParamUtil::getRequestString("name");//用户微信昵称
$openId = ParamUtil::getRequestString("openId"); $openId = ParamUtil::getRequestString("openId");
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$role = ParamUtil::getRequestNumber("role"); $role = ParamUtil::getRequestNumber("role");
$headerImg = ParamUtil::getRequestString("headerImg");
$schoolNo = ParamUtil::getRequestString("schoolNo"); $schoolNo = ParamUtil::getRequestString("schoolNo");
$classNo = ParamUtil::getRequestString("classNo"); $classNo = ParamUtil::getRequestString("classNo");
$schoolOwner = ParamUtil::getRequestBoolean("schoolOwner", false); $schoolOwner = ParamUtil::getRequestBoolean("schoolOwner", false);
...@@ -25,7 +26,7 @@ if(empty($name) || empty($openId) || empty($unionId) || empty($schoolNo)) { ...@@ -25,7 +26,7 @@ if(empty($name) || empty($openId) || empty($unionId) || empty($schoolNo)) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG($result);
} }
if(role<>1 && role<>2 && role<>3) { if($role<>1 && $role<>2 && $role<>3) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG($result);
} }
...@@ -58,8 +59,8 @@ if($role == 1) { ...@@ -58,8 +59,8 @@ if($role == 1) {
} else { } else {
$userMst->child_age = 0; //不设定 $userMst->child_age = 0; //不设定
} }
$userMst->school_owner = $schoolOwner $userMst->school_owner = $schoolOwner;
$userMst->class_owner = $classOwner $userMst->class_owner = $classOwner;
$userMst->save(); $userMst->save();
ErrorLogger::doOutput("Compass...ajax_user_register.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_user_register.php....End.", 0);
......
...@@ -6,79 +6,30 @@ App({ ...@@ -6,79 +6,30 @@ App({
wx.login({ wx.login({
success: res => { success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId // 发送 res.code 到后台换取 openId, sessionKey, unionId
this.checkUserRegisted(res.code, null); this.checkUser(res.code, null);
} }
}) })
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var that = this; var that = this;
//获取用户的经纬度信息 //获取并保存用户的经纬度信息
wx.getLocation({ wx.getLocation({
type: 'wgs84', type: 'wgs84',
success: function (res) { success: function (res) {
// console.log(res); let location={
var latitude = res.latitude;
var longitude = res.longitude;
let jingweidu={
latitude: res.latitude, latitude: res.latitude,
longitude: res.longitude longitude: res.longitude
}; };
wx.setStorage({ wx.setStorage({
key: 'jingweidu',
data: jingweidu,
})
wx: wx.request({
url: that.url + 'ajax_get_user_role.php',
data: {
unionId: config.unionId,
latitude: latitude,
longitude: longitude
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
let location = {
province: res.data.result.province,
city: res.data.result.city,
district: res.data.result.district
}
wx.setStorage({
key: 'location', key: 'location',
data: location, data: location,
}) })
},
fail: function (res) { },
complete: function (res) { },
})
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
} }
}) })
}, },
//判断用户是否已经注册 //判断用户是否已经注册
checkUserRegisted:function(code,openid){ checkUser:function(code,openid){
wx.request({ wx.request({
url: this.url + 'ajax_check_user_registed.php', url: this.url + 'ajax_check_user_registed.php',
data: { data: {
...@@ -89,17 +40,17 @@ App({ ...@@ -89,17 +40,17 @@ App({
'content-type': 'application/json' // 默认值 'content-type': 'application/json' // 默认值
}, },
success(res) { success(res) {
if (res.data.status=='OK'){
//保存返回的openId和unionId //保存返回的openId和unionId
let config = { let config = {
openId: res.data.result.openId, openId: res.data.result.openId,
unionId: res.data.result.unionId, unionId: res.data.result.unionId,
registed: res.data.result.registed
}; };
wx.setStorage({ wx.setStorage({
key: 'config', key: 'config',
data: config, data: config,
}) });
}
} }
}) })
}, },
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
"pages/volunteersRank3/volunteersRank3", "pages/volunteersRank3/volunteersRank3",
"pages/volunteersRank4/volunteersRank4", "pages/volunteersRank4/volunteersRank4",
"pages/volunteers/volunteers", "pages/volunteers/volunteers",
"pages/stuRegistered/stuRegistered",
"pages/schoolDetails/schoolDetails", "pages/schoolDetails/schoolDetails",
"pages/area/area", "pages/area/area",
"pages/practice/practice", "pages/practice/practice",
......
...@@ -6,17 +6,13 @@ Page({ ...@@ -6,17 +6,13 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
type:1, age:1
active:1
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({
type: options.type
})
}, },
/** /**
...@@ -34,86 +30,54 @@ Page({ ...@@ -34,86 +30,54 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
complete(e){
if (e.detail.errMsg == 'getUserInfo:ok') { //选择年龄段
wx.setStorage({ selectAge(e) {
key: "userInfo", let age = e.currentTarget.dataset['index']
data: e.detail.userInfo this.setData({
}) age: age
// getApp().globalData.showDialog = this.data.type
wx.switchTab({
url: '../index/index'
}) })
},
//提交年龄段
updateAge(e){
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
wx: wx.request({ wx.request({
url: app.url + 'ajax_update_user_age.php', url: app.url + 'ajax_update_user_age.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
age: that.data.active age: that.data.age
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
console.log(res) wx.showToast({
title: '选择成功!',
icon: 'success',
duration: 2000
});
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}, },
fail: function (res) { }, fail: function (res) {
complete: function (res) { },
})
} else {
wx.showToast({ wx.showToast({
title: '注册失败', title: '系统错误!',
icon: 'none', icon: 'success',
duration: 3000, duration: 2000
mask: true, });
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}
}, },
threetosix(){ complete: function (res) { },
this.setData({
active:1
}) })
}, },
seven(){
this.setData({
active:2
})
}
}) })
\ No newline at end of file
<!--pages/ageChange/ageChange.wxml--> <!--pages/ageChange/ageChange.wxml-->
<view class='ageChange'> <view class='ageChange'>
<image src='../../img/1.jpg'></image> <image src='../../img/2.jpg'></image>
<text>请选择您的孩子的年龄段</text> <text>请选择您的孩子的年龄段</text>
<view style="background:{{active==1?'#3AAB69':'#fff'}}" bindtap='threetosix'>3~6岁</view> <view style="background:{{age==1?'#3AAB69':'#fff'}}" bindtap='selectAge' data-index="1">3~6岁</view>
<view style="background:{{active==2?'#3AAB69':'#fff'}}" bindtap='seven'>7岁以上</view> <view style="background:{{age==2?'#3AAB69':'#fff'}}" bindtap='selectAge' data-index="2">7岁以上</view>
<view class='button' style='border:none'><van-button type="default" style="margin:0 auto" open-type="getUserInfo" bind:getuserinfo="complete">注册</van-button></view> <view class='button' style='border:none'>
<van-button type="default" style="margin:0 auto" bindtap="updateAge">提交</van-button>
</view>
</view> </view>
// pages/childActive/childActive.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/childActive/childActive.wxml-->
<text>pages/childActive/childActive.wxml</text>
/* pages/childActive/childActive.wxss */
\ No newline at end of file
<!--pages/log/log.wxml--> <!--pages/log/log.wxml-->
<view class='quanzi'> <view class='quanzi'>
<view class='topQuanzi'> <view class='topQuanzi'>
<image src='../../img/search.png'></image>
<input class="input" name="keyword" placeholder="请输入圈子名称" bindinput ="keywordInput"/> <input class="input" name="keyword" placeholder="请输入圈子名称" bindinput ="keywordInput"/>
<van-button type="default" size='small' bindtap='searchCircle'>搜索</van-button> <view bindtap='searchCircle'>搜索</view>
</view> </view>
<view class='newQuanzi'> <view class='newQuanzi'>
<view class='btn_newQuanzi' bindtap='newQuanzi'> <view class='btn_newQuanzi' bindtap='newQuanzi'>
......
/* pages/log/log.wxss */ /* pages/log/log.wxss */
.topQuanzi{ .topQuanzi{
width: 100%; width: 94%;
height: 50px; height: 40px;
background: #ccc;
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
margin: 0 auto;
background: #f6f6f6;
border-radius: 30px;
} }
.topQuanzi>view{ .topQuanzi>image{
width: 120px; width: 25px;
height: 30px; height: 25px;
border: 1px solid #666; margin: 0 10px;
border-radius: 15px;
overflow: hidden;
margin-left: 20px;
line-height: 30px;
text-align: center;
font-size: 12px;
} }
.topQuanzi>view .van-cell{ .topQuanzi>input{
padding: 3px 10px; flex: 1;
height: 40px;
line-height: 40px;
font-size: 14px;
} }
.topQuanzi button{ .topQuanzi>view{
margin-right: 20px; width: 90px;
height: 40px;
text-align: center;
line-height: 40px;
font-size: 14px;
background: #0D76ED;
border-radius: 0 30px 30px 0;
color: #fff;
} }
.newQuanzi{ .newQuanzi{
width: 100%; width: 100%;
......
...@@ -11,6 +11,7 @@ Page({ ...@@ -11,6 +11,7 @@ Page({
teacherName: '', teacherName: '',
teacherProfile: '', teacherProfile: '',
frontImage: '', frontImage: '',
courseComment: '',
mediaCount: '', mediaCount: '',
mediaList: [], mediaList: [],
show1:false, show1:false,
...@@ -48,19 +49,6 @@ Page({ ...@@ -48,19 +49,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function (options) {
},
/**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
...@@ -107,7 +95,6 @@ Page({ ...@@ -107,7 +95,6 @@ Page({
classDetails(){ classDetails(){
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
// var location = wx.getStorageSync('location');
wx: wx.request({ wx: wx.request({
url: app.url + 'ajax_get_course_detail.php', url: app.url + 'ajax_get_course_detail.php',
data: { data: {
...@@ -125,6 +112,7 @@ Page({ ...@@ -125,6 +112,7 @@ Page({
teacherName: res.data.result.teacherName, teacherName: res.data.result.teacherName,
teacherProfile: res.data.result.teacherProfile, teacherProfile: res.data.result.teacherProfile,
frontImage: res.data.result.frontImage, frontImage: res.data.result.frontImage,
courseComment: res.data.result.courseComment,
mediaCount: res.data.result.mediaCount, mediaCount: res.data.result.mediaCount,
mediaList: res.data.result.mediaList mediaList: res.data.result.mediaList
}) })
......
...@@ -10,32 +10,19 @@ ...@@ -10,32 +10,19 @@
</view> </view>
</view> </view>
</view> </view>
<!--
<view class='kechengjianjie'> <view class='kechengjianjie'>
课程简介:梵蒂冈多过过付付付付付付付付付多付多过多过付多过付 课程简介:{{courseComment}}
</view> </view>
-->
<view class='classfenji'> <view class='classfenji'>
<view class='top_classfenji'> <view class='top_classfenji'>
<image src='../../img/sanjiao.png'></image>课程分集({{mediaCount}}) <image src='../../img/sanjiao.png'></image>课程分集({{mediaCount}})
</view> </view>
<view class='bot_classfenji'> <view class='bot_classfenji'>
<view> <view wx:for="{{mediaList}}" >
<text bindtap='videoplay'>《三招叫你提升数学》</text> <text bindtap='videoplay'>{{item.title}}</text>
<view bindtap='cliLearn' data-index="1">学习<image src='../../img/suo.png' class='suo' wx:if="{{show1}}"></image></view> <view bindtap='cliLearn' data-index="{{item.id}}">学习<image src='../../img/suo.png' class='suo' wx:if="{{show1}}"></image></view>
</view>
<view>
<text>《五招叫你提升英语》</text>
<view bindtap='cliLearn' data-index="2">学习<image src='../../img/suo.png' class='suo' wx:if="{{show2}}"></image></view>
</view>
<view>
<text>《六招叫你提升生物》</text>
<view bindtap='cliLearn' data-index="3">学习<image src='../../img/suo.png' class='suo' wx:if="{{show3}}"></image></view>
</view>
<view>
<text>《如何考前毫无压力》</text>
<view bindtap='cliLearn' data-index="4">学习<image src='../../img/suo.png' class='suo' wx:if="{{show4}}"></image></view>
</view> </view>
</view> </view>
</view> </view>
<view class='play' wx:if="{{play==1}}"> <view class='play' wx:if="{{play==1}}">
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
<scroll-view scroll-y="true" style='height:750rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'> <scroll-view scroll-y="true" style='height:750rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'>
<view class='activelist' bindtap='classDetails' wx:for="{{list}}" wx:key="{{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>
</view> </view>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<image src='../../img/kefu.png'></image> <image src='../../img/kefu.png'></image>
<text>{{item.view_count}}</text> <text>{{item.view_count}}</text>
</view> </view>
<text>主讲教师:{{item.teacher_name}}</text> <text>主讲教师:{{item.teacher}}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
......
...@@ -10,7 +10,7 @@ Page({ ...@@ -10,7 +10,7 @@ Page({
active: 0, active: 0,
isLogin:false, isLogin:false,
role:0, role:0,
chileAge:0, childAge:0,
roleTitle:'', roleTitle:'',
showFamily: false, showFamily: false,
...@@ -27,23 +27,11 @@ Page({ ...@@ -27,23 +27,11 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
var that=this; var that=this;
if (this.data.role == 4){
this.setData({
roleTitle:'教育局领导'
})
} else {
this.setData({
roleTitle:'志愿者'
})
};
var config = wx.getStorageSync('config');
//获取用户当前的经纬度信息并调用接口判断用户身份 //获取用户当前的经纬度信息并调用接口判断用户身份
wx.getLocation({ var config = wx.getStorageSync('config');
type: 'wgs84', var location = wx.getStorageSync('location');
success: function (res) { var latitude = location.latitude;
// console.log(res); var longitude = location.longitude;
var latitude = res.latitude;
var longitude = res.longitude;
wx: wx.request({ wx: wx.request({
url: app.url + 'ajax_get_user_role.php', url: app.url + 'ajax_get_user_role.php',
data: { data: {
...@@ -60,40 +48,34 @@ Page({ ...@@ -60,40 +48,34 @@ Page({
//未注册用户的话。跳转到社会人士注册页面 //未注册用户的话。跳转到社会人士注册页面
if (res.data.status =="REGIST") { if (res.data.status =="REGIST") {
//页面跳转 //页面跳转
wx.navigateTo({ wx.redirectTo({
url: '../socialUserRegister/socialUserRegister', url: '../socialUserRegister/socialUserRegister',
}); });
} }
that.setData({ that.setData({
roleTitle: res.data.result.name,
role:res.data.result.role, role:res.data.result.role,
chileAge: res.data.result.chileAge childAge: res.data.result.childAge
}) })
//菜单控制[亲子活动] //菜单控制[亲子活动]
if (res.data.result.role == 1 || res.data.result.chileAge==1) { if (res.data.result.role == 1 || res.data.result.childAge==1) {
that.setData({ that.setData({
showFamily: true showFamily: true
}) })
} }
//菜单控制[社会实践] //菜单控制[社会实践]
if (res.data.result.role == 2 || res.data.result.chileAge == 2) { if (res.data.result.role == 2 || res.data.result.childAge == 2) {
that.setData({ that.setData({
showSocial: true showSocial: true
}) })
} }
//菜单控制[消息]
if (res.data.result.role == 4) {
that.setData({
showNews: false
})
}
} }
}, },
fail: function (res) { }, fail: function (res) { },
complete: function (res) { }, complete: function (res) { },
}) })
}
}) //获取首页数据
var location = wx.getStorageSync('location');
wx: wx.request({ wx: wx.request({
url: app.url + 'ajax_get_top_dat.php', url: app.url + 'ajax_get_top_dat.php',
data: { data: {
......
// pages/leaderRegistered/leaderRegistered.js // pages/leaderRegistered/leaderRegistered.js
var app = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
value1:'', qrId:'',
value2:'', leaderTitle:'',
type:1
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this;
this.setData({ this.setData({
type: options.type qrId: options.qrId,
}) })
wx:wx.request({ //获取qr信息
url: 'https://www.koala-online.cn/compass/if/ajax_leader_user_register.php', wx.request({
data: '', url: 'https://www.koala-online.cn/compass/if/ajax_get_qr_info.php',
header: { 'content-type': 'application/json'}, data: {
qrId: this.data.qrId,
},
header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function(res) { success: function (res) {
console.log(res) var province = res.data.result.qrDat.province
var city = res.data.result.qrDat.city
var district = res.data.result.qrDat.district
that.setData({
leaderTitle: province + city + district,
})
}, },
fail: function(res) {}, fail: function (res) { },
complete: function(res) {}, complete: function (res) { },
}) })
}, },
...@@ -35,7 +46,14 @@ Page({ ...@@ -35,7 +46,14 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
//如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config');
if (config.registed == true) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
}, },
/** /**
...@@ -46,48 +64,49 @@ Page({ ...@@ -46,48 +64,49 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 用户点击右上角分享
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onShareAppMessage: function () {
}, },
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
//提交注册
regist(){
var config = wx.getStorageSync('config');
// 获取用户信息
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
app.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
wx.request({
url: 'https://www.koala-online.cn/compass/if/ajax_leader_user_register.php',
data: {
unionId: config.unionId,
openId: config.openId,
headerImg: app.globalData.userInfo.avatarUrl,
qrId: this.data.qrId,
}, },
header: { 'content-type': 'application/json' },
/** method: 'GET',
* 用户点击右上角分享 dataType: 'json',
*/ success: function (res) {
onShareAppMessage: function () { //跳转到年龄选择
wx.navigateTo({
url: '../ageChange/ageChange',
});
}, },
onChange(event) { fail: function (res) { },
// event.detail 为当前输入的值 complete: function (res) { },
this.setData({
value1: event.detail
}) })
}, }
zhuce(){
wx.redirectTo({
url: '../ageChange/ageChange?type=' + this.data.type
}) })
} }
}) })
\ No newline at end of file
<!--pages/leaderRegistered/leaderRegistered.wxml--> <!--pages/leaderRegistered/leaderRegistered.wxml-->
<view class='leaderRegistered'> <view class='leaderRegistered'>
<image src='../../img/1.jpg'></image> <image src='../../img/2.jpg'></image>
<view class='title_leaderRegistered'><text>xxx领导:</text>欢迎来到志愿者平台!</view> <view class='title_leaderRegistered'><text>{{leaderTitle}}领导:</text>欢迎来到志愿者平台!</view>
<view class='con_leaderRegistered'> <view class='con_leaderRegistered'>
<!-- <view>
<text>姓名:</text>
<van-cell-group>
<van-field
value="{{ value1 }}"
placeholder="请输入姓名"
bind:change="onChange"
border="{{false}}"
/>
</van-cell-group>
</view> </view>
<view> <view style='display:flex;justify-content: center;margin-top:100px;' class='button'>
<text>手机:</text> <van-button type="default" open-type="getUserInfo" bind:getuserinfo="regist">注册</van-button></view>
<van-cell-group>
<van-field
value="{{ value2 }}"
placeholder="请输入手机号"
bind:change="onChange"
border="{{false}}"
/>
</van-cell-group>
</view> -->
</view>
<view style='display:flex;justify-content: center;margin-top:100px;' class='button'><van-button type="default" bind:click="zhuce">下一步</van-button></view>
</view> </view>
...@@ -17,7 +17,7 @@ Page({ ...@@ -17,7 +17,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
wx: wx.request({ wx.request({
url: app.url + 'ajax_get_my_top_dat.php', url: app.url + 'ajax_get_my_top_dat.php',
data: { data: {
unionId: config.unionId unionId: config.unionId
...@@ -54,52 +54,12 @@ Page({ ...@@ -54,52 +54,12 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
onChange(event) {
// event.detail 的值为当前选中项的索引
this.setData({ active: event.detail });
if (event.detail == 0) {
wx.redirectTo({
url: '../index/index'
})
}else if(event.detail == 1) {
wx.redirectTo({
url: '../circle/circle'
})
}
},
activeManagement(){ activeManagement(){
wx:wx.navigateTo({ wx:wx.navigateTo({
url: '../activeManagement/activeManagement', url: '../activeManagement/activeManagement',
......
...@@ -39,8 +39,3 @@ ...@@ -39,8 +39,3 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <van-tabbar active="{{ active }}" bind:change="onChange">
<van-tabbar-item>首页</van-tabbar-item>
<van-tabbar-item><view class='circle'>圈子</view></van-tabbar-item>
<van-tabbar-item>我的</van-tabbar-item>
</van-tabbar> -->
...@@ -87,8 +87,12 @@ Page({ ...@@ -87,8 +87,12 @@ Page({
//消息详细页面 //消息详细页面
newsDetail(e){ newsDetail(e){
let messageId = e.currentTarget.dataset['index']
wx.navigateTo({ wx.navigateTo({
url: '../myNewsDetail/myNewsDetail', url: '../myNewsDetail/myNewsDetail?messageId=' + messageId,
})
wx.setNavigationBarTitle({
title: '消息详情'
}) })
} }
}) })
\ No newline at end of file
<!--pages/myNews/myNews.wxml--> <!--pages/myNews/myNews.wxml-->
<view class="myNews"> <view class="myNews">
<view bindtap='newsDetail' wx:for="{{messageList}}" wx:if="{{!item.is_read}}" class="newsUnread" data-index="{{item.id}}"> <view bindtap='newsDetail' wx:for="{{messageList}}" wx:if="{{!item.is_read}}" class="newsUnread" data-index="{{item.id}}" wx:key="{{index}}">
{{item.title}} <image src='../../img/unread.png'></image>{{item.title}}
</view> </view>
<view bindtap='newsDetail' wx:for="{{messageList}}" wx:if="{{item.is_read}}" class="newsReaded" data-index="{{item.id}}"> <view bindtap='newsDetail' wx:for="{{messageList}}" wx:if="{{item.is_read}}" class="newsReaded" data-index="{{item.id}}" wx:key="{{index}}">
{{item.title}} <image src='../../img/readed.png'></image>{{item.title}}
</view> </view>
</view> </view>
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
padding: 2px; padding: 2px;
font-weight: bold; font-weight: bold;
border-bottom: 1rpx solid #F0F0F0; border-bottom: 1rpx solid #F0F0F0;
display: flex;
align-items: center;
}
.newsUnread>image{
width: 30px;
height: 18px;
margin-right: 8px;
} }
.newsReaded{ .newsReaded{
...@@ -20,4 +27,11 @@ ...@@ -20,4 +27,11 @@
padding: 2px; padding: 2px;
font-weight: normal; font-weight: normal;
border-bottom: 1rpx solid #F0F0F0; border-bottom: 1rpx solid #F0F0F0;
display: flex;
align-items: center;
}
.newsReaded>image{
width: 30px;
height: 18px;
margin-right: 8px;
} }
// pages/familyUser/familyUser.js // pages/familyUser/familyUser.js 家校/家园用户注册
var app = getApp(); var app = getApp();
Page({ Page({
...@@ -6,7 +6,11 @@ Page({ ...@@ -6,7 +6,11 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
type:1 role: '',
schoolNo:'',
classNo: '',
schoolOwner: '',
classOwner: '',
}, },
/** /**
...@@ -14,113 +18,95 @@ Page({ ...@@ -14,113 +18,95 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
type: options.type role: options.role,
}) schoolNo: options.schoolNo,
var config = wx.getStorageSync('config'); classNo: options.classNo,
if (!config) { schoolOwner: options.schoolOwner,
wx.login({ classOwner: options.classOwner
success: res => { });
// 发送 res.code 到后台换取 openId, sessionKey, unionId
app.checkUser(res.code, null);
console.log(res.code, 55)
}
})
} else {
app.checkUser(null, res.openId);
console.log(res.openId, 66)
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
//如果用户已经注册则跳转到首页
}, var config = wx.getStorageSync('config');
if (config.registed == true) {
/** //跳转到首页
* 生命周期函数--监听页面隐藏 wx.switchTab({
*/ url: '../index/index',
onHide: function () { });
}
}, },
/** /**
* 生命周期函数--监听页面卸载 * 用户点击右上角分享
*/ */
onUnload: function () { onShareAppMessage: function () {
}, },
/** //家校/家园用户注册
* 页面相关事件处理函数--监听用户下拉动作 regist(e){
*/ var that = this;
onPullDownRefresh: function () {
}, // 获取用户信息
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
app.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
/** //获取本地存储的openId和unionId
* 页面上拉触底事件的处理函数 var config = wx.getStorageSync('config');
*/
onReachBottom: function () {
wx.request({
url: app.url + 'ajax_user_register.php',
data: {
unionId: config.unionId,
openId: config.openId,
role: that.data.role,
name: app.globalData.userInfo.nickName,
headerImg: app.globalData.userInfo.avatarUrl,
schoolNo: that.data.schoolNo,
classNo: that.data.classNo,
schoolOwner: that.data.schoolOwner,
classOwner: that.data.classOwner
}, },
header: { 'content-type': 'application/json' },
/** method: 'GET',
* 用户点击右上角分享 dataType: 'json',
*/ success: function (res) {
onShareAppMessage: function () { wx.showToast({
title: res.data.result.message,
icon: 'success',
duration: 2000
});
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}, },
jihuo(e){ fail: function (res) {
if(this.data.type==3){
if (e.detail.errMsg == 'getUserInfo:ok') {
wx.setStorage({
key: "userInfo",
data: e.detail.userInfo
})
wx.switchTab({
url: '../index/index?type=' + this.data.type,
})
} else {
wx.showToast({ wx.showToast({
title: '注册失败', title: res.data.result.message,
icon: 'none', icon: 'success',
duration: 3000, duration: 2000
mask: true, });
success: function (res) { }, //跳转到首页
fail: function (res) { },
complete: function (res) { },
})
}
}else if(this.data.type==4){
if (e.detail.errMsg == 'getUserInfo:ok') {
wx.setStorage({
key: "userInfo",
data: e.detail.userInfo
})
wx.switchTab({ wx.switchTab({
url: '../index/index?type=' + this.data.type, url: '../index/index',
}) });
} else { },
wx.showToast({
title: '注册失败',
icon: 'none',
duration: 3000,
mask: true,
success: function (res) { },
fail: function (res) { },
complete: function (res) { }, complete: function (res) { },
}) })
} }
} })
} }
}) })
\ No newline at end of file
<!--pages/familyUser/familyUser.wxml--> <!--pages/familyUser/familyUser.wxml-->
<view class='familyUser'> <view class='familyUser'>
<image src='../../img/1.jpg'></image> <image src='../../img/2.jpg'></image>
<text>欢迎来到志愿者平台!</text> <text>欢迎来到志愿者平台!</text>
<view style='display:flex;justify-content: center;margin-top:100px;' class='button'><van-button type="default" open-type="getUserInfo" bind:getuserinfo="jihuo">进入首页</van-button></view> <view style='display:flex;justify-content: center;margin-top:100px;' class='button'>
<van-button type="default" open-type="getUserInfo" bind:getuserinfo="regist">进入首页</van-button>
</view>
</view> </view>
/* pages/familyUser/familyUser.wxss */ /* pages/familyUser/familyUser.wxss */
.familyUser>image{ .familyUser>image{
display: block; display: block;
margin-top: 20px;
width: 100px; width: 100px;
height: 100px; height: 100px;
border-radius: 50%; border-radius: 50%;
......
<!--pages/searchCircle/searchCircle.wxml--> <!--pages/searchCircle/searchCircle.wxml-->
<view class='searchCircle'> <view class='searchCircle'>
<view class='top_searchCircle'> <view class='top_searchCircle'>
<image src='../../img/search.png'></image>
<input placeholder='输入圈子名称' focus="true" value='{{keyword}}' bindinput="changeInput"></input> <input placeholder='输入圈子名称' focus="true" value='{{keyword}}' bindinput="changeInput"></input>
<text bindtap='searchCircle'>搜索</text> <view bindtap='searchCircle'>搜索</view>
</view> </view>
<scroll-view scroll-y="true" style='height:750rpx;bottom:10rpx;' bindscrolltolower='loadMore'> <scroll-view scroll-y="true" style='height:750rpx;bottom:10rpx;' bindscrolltolower='loadMore'>
<view class='circleItem' bindtap='cicleDetails' wx:for="{{circleList}}" > <view class='circleItem' bindtap='cicleDetails' wx:for="{{circleList}}" >
......
/* pages/searchCircle/searchCircle.wxss */ /* pages/searchCircle/searchCircle.wxss */
.top_searchCircle{ .top_searchCircle{
width: 100%; width: 94%;
height: 50px; height: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
background: #f6f6f6; background: #f6f6f6;
border-radius: 30px;
margin: 0 auto;
}
.top_searchCircle>image{
width: 25px;
height: 25px;
margin: 0 10px;
} }
.top_searchCircle>input{ .top_searchCircle>input{
flex: 1; flex: 1;
height: 25px; height: 40px;
border: 1px solid #ccc;
border-radius: 5px; border-radius: 5px;
margin: 0 10px;
box-sizing: border-box; box-sizing: border-box;
padding-left: 10px; padding-left: 10px;
font-size: 12px; font-size: 14px;
}
.top_searchCircle>view{
width: 90px;
height: 40px;
text-align: center;
line-height: 40px;
font-size: 14px;
background: #0D76ED;
border-radius: 0 30px 30px 0;
color: #fff;
} }
.circleItem{ .circleItem{
display: flex; display: flex;
......
...@@ -7,19 +7,20 @@ Page({ ...@@ -7,19 +7,20 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
value1:'', name:'',
value2: '', mobile: '',
value3: '', isOrganization: false,
value4: '', organizationTitle: '',
checked: false, legalPerson: '',
show:0, organizationContact: '',
showRule:false,//弹出机构认证须知
fileList: [], fileList: [],
fileList1: [], fileList1: [],
fileList2: [], fileList2: [],
fileList3: [], fileList3: [],
uploadPic: false,//展示上传素材部分
upload:0, upload:0,
type:1,
uploadPic:0,
cli:0, cli:0,
content:'', content:'',
legalPersonImgage1:'', legalPersonImgage1:'',
...@@ -34,29 +35,22 @@ Page({ ...@@ -34,29 +35,22 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var that=this
wx.getLocation({
type: 'wgs84',
success: function (res) {
// console.log(res);
var latitude = res.latitude
var longitude = res.longitude
that.setData({
latitude: latitude,
longitude: longitude
})
}
})
this.setData({
type: options.type
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
//如果用户已经注册则跳转到首页
var config = wx.getStorageSync('config');
if (config.registed == true) {
//跳转到首页
wx.switchTab({
url: '../index/index',
});
}
//获取机构注册说明文本
var x=this; var x=this;
wx.request({ wx.request({
url: app.url + 'ajax_get_organization_rule_text.php', url: app.url + 'ajax_get_organization_rule_text.php',
...@@ -78,145 +72,206 @@ Page({ ...@@ -78,145 +72,206 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
}, },
/** //获取用户的输入值[姓名]
* 生命周期函数--监听页面卸载 onChangeName(e) {
*/ // event.detail 为当前输入的值
onUnload: function () { this.setData({
name:e.detail
}, })
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
}, },
/** //获取用户的输入值[法人姓名]
* 页面上拉触底事件的处理函数 onChangeLegalPerson(e) {
*/ // event.detail 为当前输入的值
onReachBottom: function () { this.setData({
name: e.detail
})
}, },
/** //获取用户的输入值[手机号码]
* 用户点击右上角分享 onChangeMobile(e) {
*/
onShareAppMessage: function () {
},
onChange(event) {
// event.detail 为当前输入的值 // event.detail 为当前输入的值
this.setData({ this.setData({
value1:event.detail mobile: e.detail
}) })
}, },
onChangerideo(event) {
//机构认证checkbox勾选或者取消勾选
onChangeIsOrganization(event) {
this.setData({ this.setData({
checked: event.detail isOrganization: event.detail
}); });
if(this.data.checked==false){ if (this.data.isOrganization==false){
//隐藏图片上传区
this.setData({ this.setData({
uploadPic:0 uploadPic:0
}) })
} }
if(this.data.cli==1){ if(this.data.cli==1){
if (this.data.checked == true) { if (this.data.isOrganization == true) {
this.setData({ this.setData({
uploadPic: 1 uploadPic: 1
}) })
} }
} }
}, },
surejigou(){
//获取用户的输入值[机构名称]
onChangeOrganizationTitle(e) {
// event.detail 为当前输入的值
this.setData({ this.setData({
show:1, organizationTitle: e.detail
checked:true
}) })
}, },
sure(){
//获取用户的输入值[法人姓名]
onChangeLegalPerson(e) {
// event.detail 为当前输入的值
this.setData({ this.setData({
show:0, legalPerson: e.detail
upload:1
}) })
}, },
zhuce(e){
if(this.data.checked==true){ //获取用户的输入值[法人手机]
var config = wx.getStorageSync('config'); onChangeOrganizationContact(e) {
// event.detail 为当前输入的值
this.setData({
organizationContact: e.detail
})
},
surejigou(){
this.setData({
show:1,
checked:true
})
},
//提交注册资料
regist(e){
var that = this; var that = this;
wx.login({ //姓名必须输入
success: res => { if (that.data.name == null || that.data.name.trim()=="") {
// 发送 res.code 到后台换取 openId, sessionKey, unionId Notify('请输入姓名')
app.checkUser(res.code, null); return
if (config.zhuce == "未注册!") { }
this.surejigou()
//手机号码必须输入
if (that.data.mobile == null || that.data.mobile.trim() == "") {
Notify('请输入手机号码')
return
}
var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!myreg.test(that.data.mobile)) {
Notify("手机格式错误");
return false;
}
var config = wx.getStorageSync('config');
var location = wx.getStorageSync('location');
// 获取用户信息
wx.getUserInfo({ wx.getUserInfo({
success: function (res) { success: res => {
console.log(res.userInfo.nickName) // 可以将 res 发送给后台解码出 unionId
wx: wx.request({ app.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
//机构注册
if (that.data.isOrganization == true) {
//机构名称必须输入
if (that.data.organizationTitle == null || that.data.organizationTitle.trim() == "") {
Notify('请输入机构名称')
return
}
//法人行密名必须输入
if (that.data.legalPerson == null || that.data.legalPerson.trim() == "") {
Notify('请输法人姓名')
return
}
//法人行密名必须输入
if (that.data.organizationContact == null || that.data.organizationContact.trim() == "") {
Notify('请输法人手机')
return
}
wx.request({
url: app.url + 'ajax_social_user_register1.php', url: app.url + 'ajax_social_user_register1.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
openId: config.openId, openId: config.openId,
name: res.userInfo.nickName, name: that.data.name,
mobile: '13124619413', mobile: that.data.mobile,
legalPerson: 'jia', legalPerson: that.data.legalPerson,
organizationContact: '13124619413', organizationContact: that.data.organizationContact,
longitude: that.data.longitude, headerImg: app.globalData.userInfo.avatarUrl,
latitude: that.data.latitude longitude: location.longitude,
latitude: location.latitude
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
console.log(res, '成功') wx.showToast({
title: res.data.result.message,
icon: 'success',
duration: 2000
});
//注册成功以后,弹出机构认证对话框
that.setData({
showRule: true,
uploadPic: 1
})
}, },
fail: function (res) { fail: function (res) {
console.log(res, '失败') console.log(res, '失败')
}, },
complete: function (res) { }, complete: function (res) { },
}) })
} }
})
} else { //普通用户注册
if (e.detail.errMsg == 'getUserInfo:ok') { if (that.data.isOrganization == false) {
wx.setStorage({ wx.request({
key: "userInfo", url: app.url + 'ajax_social_user_register1.php',
data: e.detail.userInfo data: {
}) unionId: config.unionId,
console.log(e) openId: config.openId,
wx.redirectTo({ name: that.data.name,
url: '../ageChange/ageChange?type=' + this.data.type mobile: that.data.mobile,
}) headerImg: app.globalData.userInfo.avatarUrl,
} else { longitude: location.longitude,
latitude: location.latitude
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
wx.showToast({ wx.showToast({
title: '注册失败', title: res.data.result.message,
icon: 'none', icon: 'success',
duration: 3000, duration: 2000
mask: true, });
success: function (res) { }, //跳转到年龄选择
fail: function (res) { }, wx.navigateTo({
url: '../ageChange/ageChange',
});
},
fail: function (res) {
console.log(res, '失败')
},
complete: function (res) { }, complete: function (res) { },
}) })
} }
} }
}
}) })
}else{
Notify('请选择机构认证')
}
}, },
//上传的图片[法人身份证1]
delete(event) { delete(event) {
const { index, name } = event.detail; const { index, name } = event.detail;
const fileList = this.data[`fileList`]; const fileList = this.data[`fileList`];
...@@ -231,6 +286,7 @@ Page({ ...@@ -231,6 +286,7 @@ Page({
legalPersonImgage1:file[0].path legalPersonImgage1:file[0].path
}); });
}, },
//上传的图片[法人身份证2]
delete1(event) { delete1(event) {
const { index, name } = event.detail; const { index, name } = event.detail;
const fileList1 = this.data[`fileList1`]; const fileList1 = this.data[`fileList1`];
...@@ -246,6 +302,8 @@ Page({ ...@@ -246,6 +302,8 @@ Page({
legalPersonImgage2:file[0].path legalPersonImgage2:file[0].path
}); });
}, },
//上传的图片[营业执照]
delete2(event) { delete2(event) {
const { index, name } = event.detail; const { index, name } = event.detail;
const fileList2 = this.data[`fileList2`]; const fileList2 = this.data[`fileList2`];
...@@ -261,6 +319,8 @@ Page({ ...@@ -261,6 +319,8 @@ Page({
licensenImgage: file[0].path licensenImgage: file[0].path
}); });
}, },
//上传的图片[其他]
delete3(event) { delete3(event) {
const { index, name } = event.detail; const { index, name } = event.detail;
const fileList3 = this.data[`fileList3`]; const fileList3 = this.data[`fileList3`];
...@@ -276,35 +336,122 @@ Page({ ...@@ -276,35 +336,122 @@ Page({
otherImgage: file[0].path otherImgage: file[0].path
}); });
}, },
upload(){
// 同意认证机构
agree() {
this.setData({ this.setData({
upload:0, showRule: false,
uploadPic:1, upload: true
cli:1
}) })
},
//机构注册上传各种证明
upload(){
var config = wx.getStorageSync('config');
var that = this; var that = this;
wx:wx.request({ //循环上传图片
url: app.url +'ajax_social_user_register2.php', var uploadLegalPersonImgage1Complete = true;
data: { if (that.data.legalPersonImgage1 != null && that.data.legalPersonImgage1 != "") {
unionId: '123', uploadLegalPersonImgage1Complete = false;
openId: '123', wx.uploadFile({
legalPersonImgage1: that.data.legalPersonImgage1, url: app.url + 'ajax_social_user_register2.php?unionId=' + config.unionId + "&openId=" + config.openId,
legalPersonImgage2: that.data.legalPersonImgage2, filePath: that.data.legalPersonImgage1,
licensenImgage: that.data.licensenImgage, name: 'legalPersonImgage1',
otherImgage: that.data.otherImgage header: { 'content-type': 'multipart/form-data' },
}, success: function (res) {
header: { 'content-type': 'application/json'}, },
method: 'GET', fail: function (res) {
dataType: 'json', console.log(res, '上传失败')
success: function(res) { },
console.log(res,'上传成功') complete: function (res) {
uploadLegalPersonImgage1Complete = true;
},
})
}
//身份证反面
var uploadLegalPersonImgage2Complete = true;
if (that.data.legalPersonImgage2 != null && that.data.legalPersonImgage2 != "") {
uploadLegalPersonImgage2Complete = false;
wx.uploadFile({
url: app.url + 'ajax_social_user_register2.php?unionId=' + config.unionId + "&openId=" + config.openId,
filePath: that.data.legalPersonImgage2,
name: 'legalPersonImgage2',
header: { 'content-type': 'multipart/form-data' },
success: function (res) {
},
fail: function (res) {
console.log(res, '上传失败')
},
complete: function (res) {
uploadLegalPersonImgage2Complete = true;
},
})
}
//营业执照
var uploadLicensenImgageComplete = true;
if (that.data.licensenImgage != null && that.data.licensenImgage != "") {
uploadLicensenImgageComplete = false;
wx.uploadFile({
url: app.url + 'ajax_social_user_register2.php?unionId=' + config.unionId + "&openId=" + config.openId,
filePath: that.data.licensenImgage,
name: 'licensenImgage',
header: { 'content-type': 'multipart/form-data' },
success: function (res) {
}, },
fail: function(res) { fail: function (res) {
console.log(res,'上传失败') console.log(res, '上传失败')
},
complete: function (res) {
uploadLicensenImgageComplete = true;
}, },
complete: function(res) {},
}) })
}
//其他图片
var uploadOtherImgageComplete = true;
if (that.data.otherImgage != null && that.data.otherImgage != "") {
uploadOtherImgageComplete = false;
wx.uploadFile({
url: app.url + 'ajax_social_user_register2.php?unionId=' + config.unionId + "&openId=" + config.openId,
filePath: that.data.otherImgage,
name: 'otherImgage',
header: { 'content-type': 'multipart/form-data' },
success: function (res) {
},
fail: function (res) {
console.log(res, '上传失败')
},
complete: function (res) {
uploadOtherImgageComplete = true;
}, },
})
}
//等待所有上传完成
var a = setInterval(function () {
//循环执行代码
if (uploadLegalPersonImgage1Complete && uploadLegalPersonImgage2Complete && uploadLicensenImgageComplete && uploadOtherImgageComplete) {
//跳转到首页
wx.showToast({
title: '上传成功,请等待审核!',
icon: 'success',
duration: 2000
});
clearInterval(a)
//跳转到年龄选择
wx.navigateTo({
url: '../ageChange/ageChange',
});
}
}, 1000) //循环时间 这里是1秒
},
//判断上传的图片类型
beforeRead(event) { beforeRead(event) {
const { file, callback } = event.detail; const { file, callback } = event.detail;
if (file[0].path.indexOf('jpg') < 0) { if (file[0].path.indexOf('jpg') < 0) {
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<text>姓名:</text> <text>姓名:</text>
<van-cell-group> <van-cell-group>
<van-field <van-field
value="{{ value1 }}" value="{{ name }}"
placeholder="请输入姓名" placeholder="请输入姓名"
bind:change="onChange" bind:change="onChangeName"
border="{{false}}" border="{{false}}"
/> />
</van-cell-group> </van-cell-group>
...@@ -17,41 +17,52 @@ ...@@ -17,41 +17,52 @@
<text>手机:</text> <text>手机:</text>
<van-cell-group> <van-cell-group>
<van-field <van-field
value="{{ value2 }}" value="{{ mobile }}"
placeholder="请输入手机号" placeholder="请输入手机号"
bind:change="onChange" bind:change="onChangeMobile"
border="{{false}}" border="{{false}}"
/> />
</van-cell-group> </van-cell-group>
</view> </view>
<view style='justify-content: flex-end;font-size:12px;width:280px;padding-right:30px'> <view style='justify-content: flex-end;font-size:12px;width:280px;padding-right:30px'>
<van-checkbox value="{{ checked }}" shape="square" bind:change="onChangerideo" icon-size="16px"> <van-checkbox value="{{ isOrganization }}" shape="square" bind:change="onChangeIsOrganization" icon-size="16px">
</van-checkbox> </van-checkbox>
<text style='width:60px;color:rgb(101,201,243);'>认证机构</text> <text style='width:60px;color:rgb(101,201,243);'>认证机构</text>
</view> </view>
<view wx:if="{{checked==true}}"> <view wx:if="{{isOrganization==true}}">
<text>机构名称:</text> <text>机构名称:</text>
<van-cell-group> <van-cell-group>
<van-field <van-field
value="{{ value3 }}" value="{{ organizationTitle }}"
placeholder="请输入机构名称" placeholder="请输入机构名称"
bind:change="onChange" bind:change="onChangeOrganizationTitle"
border="{{false}}" border="{{false}}"
/> />
</van-cell-group> </van-cell-group>
</view> </view>
<view style='margin-bottom:5px' wx:if="{{checked==true}}"> <view style='margin-bottom:5px' wx:if="{{isOrganization==true}}">
<text>法人姓名:</text> <text>法人姓名:</text>
<van-cell-group> <van-cell-group>
<van-field <van-field
value="{{ value4 }}" value="{{ legalPerson }}"
placeholder="请输入法人姓名" placeholder="请输入法人姓名"
bind:change="onChange" bind:change="onChangeLegalPerson"
border="{{false}}" border="{{false}}"
/> />
</van-cell-group> </van-cell-group>
</view> </view>
<view class='uploadPic' wx:if="{{uploadPic==1}}"> <view style='margin-bottom:5px' wx:if="{{isOrganization==true}}">
<text>法人手机:</text>
<van-cell-group>
<van-field
value="{{ organizationContact }}"
placeholder="请输入法人手机"
bind:change="onChangeOrganizationContact"
border="{{false}}"
/>
</van-cell-group>
</view>
<view class='uploadPic' wx:if="{{uploadPic==true}}">
<view> <view>
<text>身份证:</text><image src='{{legalPersonImgage1}}'></image><image src='{{legalPersonImgage2}}'></image> <text>身份证:</text><image src='{{legalPersonImgage1}}'></image><image src='{{legalPersonImgage2}}'></image>
</view> </view>
...@@ -63,15 +74,17 @@ ...@@ -63,15 +74,17 @@
</view> </view>
</view> </view>
<view class='button'><van-button type="default" style="margin:0 auto" open-type="getUserInfo" bind:getuserinfo="zhuce">注册</van-button></view> <view class='button'>
<van-button type="default" style="margin:0 auto" open-type="getUserInfo" bind:getuserinfo="regist">注册</van-button>
</view>
</view> </view>
<view class='surejigou' wx:if="{{show==1}}"> <view class='surejigou' wx:if="{{showRule==true}}">
<view class='conSurejigou'> <view class='conSurejigou'>
<text>认证机构</text> <text>认证机构</text>
<view class='content'> <view class='content'>
{{content}} {{content}}
</view> </view>
<view class='btnagreen button'><van-button type="default" style="margin:0 auto" bind:click="sure">同意</van-button></view> <view class='btnagreen button'><van-button type="default" style="margin:0 auto" bind:click="agree">同意</van-button></view>
</view> </view>
</view> </view>
<view class='upload' wx:if="{{upload==1}}"> <view class='upload' wx:if="{{upload==1}}">
......
// pages/stuRegistered/stuRegistered.js
Page({
/**
* 页面的初始数据
*/
data: {
value: '',
value1: '',
value2: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
onChange(event) {
// event.detail 为当前输入的值
console.log(event.detail);
},
zhuce(e){
if (e.detail.errMsg == 'getUserInfo:ok') {
wx.setStorage({
key: "userInfo",
data: e.detail.userInfo
})
wx.redirectTo({
url: '../index/index',
})
} else {
wx.showToast({
title: '注册失败',
icon: 'none',
duration: 3000,
mask: true,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/stuRegistered/stuRegistered.wxml-->
<view class='stuRegistered'>
<image src='../../img/1.jpg'></image>
<view class='formtable'>
<view>
<text>姓名:</text>
<van-cell-group>
<van-field
value="{{ value }}"
placeholder="请输入用户名"
bind:change="onChange"
border="{{false}}"
/>
</van-cell-group>
</view>
<view>
<text>手机号:</text>
<van-cell-group>
<van-field
value="{{ value1 }}"
placeholder="请输入联系方式"
bind:change="onChange"
border="{{false}}"
/>
</van-cell-group>
</view>
<view>
<text>身份编号:</text>
<van-cell-group>
<van-field
value="{{ value2 }}"
placeholder="请输入身份证件号"
bind:change="onChange"
border="{{false}}"
/>
</van-cell-group>
</view>
<view class='button'><van-button type="default" style="margin:0 auto" open-type="getUserInfo" bind:getuserinfo="zhuce">注册</van-button></view>
</view>
</view>
/* pages/stuRegistered/stuRegistered.wxss */
.stuRegistered{
width: 100%;
}
.stuRegistered>image{
width: 100%;
height: 100px;
margin-bottom: 50px;
}
...@@ -31,13 +31,43 @@ ...@@ -31,13 +31,43 @@
"current": -1, "current": -1,
"list": [] "list": []
}, },
"plugin": {
"current": -1,
"list": []
},
"game": { "game": {
"currentL": -1, "currentL": -1,
"list": [] "list": []
}, },
"miniprogram": { "gamePlugin": {
"current": -1, "current": -1,
"list": [] "list": []
},
"miniprogram": {
"current": -1,
"list": [
{
"id": -1,
"name": "家校家园用户",
"pathName": "pages/register/register",
"query": "role=1&schoolNo=00001&classNo=00001&schoolOwner=0&classOwner=0",
"scene": null
},
{
"id": -1,
"name": "社会人士",
"pathName": "pages/socialUserRegister/socialUserRegister",
"query": "",
"scene": null
},
{
"id": -1,
"name": "领导注册",
"pathName": "pages/leaderRegister/leaderRegister",
"query": "qrId=1",
"scene": null
}
]
} }
} }
} }
\ No newline at end of file
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