Commit 4a1704f6 by biao

1

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