Commit 4fb63f60 by biao

1111

parent bac032f6
......@@ -194,6 +194,8 @@ CREATE TABLE IF NOT EXISTS circle_member_dat(
circle_id int8 NOT NULL DEFAULT '0',
user_id int8 NOT NULL DEFAULT '0',
name varchar(64),
header_img varchar(64),
is_owner tinyint(1) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
......@@ -201,6 +203,19 @@ Create INDEX circle_member_dat_circle_id_idx ON circle_member_dat(circle_id);
Create INDEX circle_member_dat_user_id_idx ON circle_member_dat(user_id);
##----user_login_dat create
DROP TABLE IF EXISTS user_login_dat;
CREATE TABLE IF NOT EXISTS user_login_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
openid varchar(64) NOT NULL,
seesion_key text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX user_login_dat_openid_idx ON user_login_dat(openid);
##----user_mst create
DROP TABLE IF EXISTS user_mst;
......
......@@ -8,6 +8,7 @@ http://compass.koala-online.cn/manager
用户端开发地址
http://compass.koala-online.cn/user/if
https://compass.koala-online.cn/user/if/test.php
//腾讯lbs
......
<?php
/**
* 获取汉字拼音以及首字母
* $Id: Pinyin.inc 81458 2020-01-31 11:24:20Z dongw $
* @author wangk
* @access public
* @package jp.mkpoint.handler
*/
class Pinyin {
private $_outEncoding = "GB2312";
public function getPinyin($str,$pix=' ',$code = 'gb2312'){
$_DataKey = "a|ai|an|ang|ao|ba|bai|ban|bang|bao|bei|ben|beng|bi|bian|biao|bie|bin|bing|bo|bu|ca|cai|can|cang|cao|ce|ceng|cha" . "|chai|chan|chang|chao|che|chen|cheng|chi|chong|chou|chu|chuai|chuan|chuang|chui|chun|chuo|ci|cong|cou|cu|" . "cuan|cui|cun|cuo|da|dai|dan|dang|dao|de|deng|di|dian|diao|die|ding|diu|dong|dou|du|duan|dui|dun|duo|e|en|er" . "|fa|fan|fang|fei|fen|feng|fo|fou|fu|ga|gai|gan|gang|gao|ge|gei|gen|geng|gong|gou|gu|gua|guai|guan|guang|gui" . "|gun|guo|ha|hai|han|hang|hao|he|hei|hen|heng|hong|hou|hu|hua|huai|huan|huang|hui|hun|huo|ji|jia|jian|jiang" . "|jiao|jie|jin|jing|jiong|jiu|ju|juan|jue|jun|ka|kai|kan|kang|kao|ke|ken|keng|kong|kou|ku|kua|kuai|kuan|kuang" . "|kui|kun|kuo|la|lai|lan|lang|lao|le|lei|leng|li|lia|lian|liang|liao|lie|lin|ling|liu|long|lou|lu|lv|luan|lue" . "|lun|luo|ma|mai|man|mang|mao|me|mei|men|meng|mi|mian|miao|mie|min|ming|miu|mo|mou|mu|na|nai|nan|nang|nao|ne" . "|nei|nen|neng|ni|nian|niang|niao|nie|nin|ning|niu|nong|nu|nv|nuan|nue|nuo|o|ou|pa|pai|pan|pang|pao|pei|pen" . "|peng|pi|pian|piao|pie|pin|ping|po|pu|qi|qia|qian|qiang|qiao|qie|qin|qing|qiong|qiu|qu|quan|que|qun|ran|rang" . "|rao|re|ren|reng|ri|rong|rou|ru|ruan|rui|run|ruo|sa|sai|san|sang|sao|se|sen|seng|sha|shai|shan|shang|shao|" . "she|shen|sheng|shi|shou|shu|shua|shuai|shuan|shuang|shui|shun|shuo|si|song|sou|su|suan|sui|sun|suo|ta|tai|" . "tan|tang|tao|te|teng|ti|tian|tiao|tie|ting|tong|tou|tu|tuan|tui|tun|tuo|wa|wai|wan|wang|wei|wen|weng|wo|wu" . "|xi|xia|xian|xiang|xiao|xie|xin|xing|xiong|xiu|xu|xuan|xue|xun|ya|yan|yang|yao|ye|yi|yin|ying|yo|yong|you" . "|yu|yuan|yue|yun|za|zai|zan|zang|zao|ze|zei|zen|zeng|zha|zhai|zhan|zhang|zhao|zhe|zhen|zheng|zhi|zhong|" . "zhou|zhu|zhua|zhuai|zhuan|zhuang|zhui|zhun|zhuo|zi|zong|zou|zu|zuan|zui|zun|zuo";
$_DataValue = "-20319|-20317|-20304|-20295|-20292|-20283|-20265|-20257|-20242|-20230|-20051|-20036|-20032|-20026|-20002|-19990" . "|-19986|-19982|-19976|-19805|-19784|-19775|-19774|-19763|-19756|-19751|-19746|-19741|-19739|-19728|-19725" . "|-19715|-19540|-19531|-19525|-19515|-19500|-19484|-19479|-19467|-19289|-19288|-19281|-19275|-19270|-19263" . "|-19261|-19249|-19243|-19242|-19238|-19235|-19227|-19224|-19218|-19212|-19038|-19023|-19018|-19006|-19003" . "|-18996|-18977|-18961|-18952|-18783|-18774|-18773|-18763|-18756|-18741|-18735|-18731|-18722|-18710|-18697" . "|-18696|-18526|-18518|-18501|-18490|-18478|-18463|-18448|-18447|-18446|-18239|-18237|-18231|-18220|-18211" . "|-18201|-18184|-18183|-18181|-18012|-17997|-17988|-17970|-17964|-17961|-17950|-17947|-17931|-17928|-17922" . "|-17759|-17752|-17733|-17730|-17721|-17703|-17701|-17697|-17692|-17683|-17676|-17496|-17487|-17482|-17468" . "|-17454|-17433|-17427|-17417|-17202|-17185|-16983|-16970|-16942|-16915|-16733|-16708|-16706|-16689|-16664" . "|-16657|-16647|-16474|-16470|-16465|-16459|-16452|-16448|-16433|-16429|-16427|-16423|-16419|-16412|-16407" . "|-16403|-16401|-16393|-16220|-16216|-16212|-16205|-16202|-16187|-16180|-16171|-16169|-16158|-16155|-15959" . "|-15958|-15944|-15933|-15920|-15915|-15903|-15889|-15878|-15707|-15701|-15681|-15667|-15661|-15659|-15652" . "|-15640|-15631|-15625|-15454|-15448|-15436|-15435|-15419|-15416|-15408|-15394|-15385|-15377|-15375|-15369" . "|-15363|-15362|-15183|-15180|-15165|-15158|-15153|-15150|-15149|-15144|-15143|-15141|-15140|-15139|-15128" . "|-15121|-15119|-15117|-15110|-15109|-14941|-14937|-14933|-14930|-14929|-14928|-14926|-14922|-14921|-14914" . "|-14908|-14902|-14894|-14889|-14882|-14873|-14871|-14857|-14678|-14674|-14670|-14668|-14663|-14654|-14645" . "|-14630|-14594|-14429|-14407|-14399|-14384|-14379|-14368|-14355|-14353|-14345|-14170|-14159|-14151|-14149" . "|-14145|-14140|-14137|-14135|-14125|-14123|-14122|-14112|-14109|-14099|-14097|-14094|-14092|-14090|-14087" . "|-14083|-13917|-13914|-13910|-13907|-13906|-13905|-13896|-13894|-13878|-13870|-13859|-13847|-13831|-13658" . "|-13611|-13601|-13406|-13404|-13400|-13398|-13395|-13391|-13387|-13383|-13367|-13359|-13356|-13343|-13340" . "|-13329|-13326|-13318|-13147|-13138|-13120|-13107|-13096|-13095|-13091|-13076|-13068|-13063|-13060|-12888" . "|-12875|-12871|-12860|-12858|-12852|-12849|-12838|-12831|-12829|-12812|-12802|-12607|-12597|-12594|-12585" . "|-12556|-12359|-12346|-12320|-12300|-12120|-12099|-12089|-12074|-12067|-12058|-12039|-11867|-11861|-11847" . "|-11831|-11798|-11781|-11604|-11589|-11536|-11358|-11340|-11339|-11324|-11303|-11097|-11077|-11067|-11055" . "|-11052|-11045|-11041|-11038|-11024|-11020|-11019|-11018|-11014|-10838|-10832|-10815|-10800|-10790|-10780" . "|-10764|-10587|-10544|-10533|-10519|-10331|-10329|-10328|-10322|-10315|-10309|-10307|-10296|-10281|-10274" . "|-10270|-10262|-10260|-10256|-10254";
$_TDataKey = explode ( '|', $_DataKey );
$_TDataValue = explode ( '|', $_DataValue );
$data = (PHP_VERSION >= '5.0') ? array_combine ( $_TDataKey, $_TDataValue ) : $this->_Array_Combine( $_TDataKey, $_TDataValue );
arsort ( $data );
reset ( $data );
$str = $this->safe_encoding ( $str );
$_Res = '';
for($i = 0; $i < strlen ( $str ); $i ++) {
$_P = ord ( substr ( $str, $i, 1 ) );
if ($_P > 160) {
$_Q = ord ( substr ( $str, ++ $i, 1 ) );
$_P = $_P * 256 + $_Q - 65536;
}
$_Res .= $this->_Pinyin ( $_P, $data ).$pix;
}
return preg_replace ( "/[^a-z0-9".$pix."]*/", '', $_Res );
}
private function _Pinyin($_Num, $_Data) {
if ($_Num > 0 && $_Num < 160)
return chr ( $_Num );
elseif ($_Num < - 20319 || $_Num > - 10247)
return '';
else {
foreach ( $_Data as $k => $v ) {
if ($v <= $_Num)
break;
}
return $k;
}
}
public function getFirstChar($str=''){
if( !$str ) return null;
$fchar=ord($str{0});
if($fchar>=ord("A") and $fchar<=ord("z") )return strtoupper($str{0});
$s= $this->safe_encoding($str);
$asc=ord($s{0})*256+ord($s{1})-65536;
if($asc>=-20319 and $asc<=-20284)return "A";
if($asc>=-20283 and $asc<=-19776)return "B";
if($asc>=-19775 and $asc<=-19219)return "C";
if($asc>=-19218 and $asc<=-18711)return "D";
if($asc>=-18710 and $asc<=-18527)return "E";
if($asc>=-18526 and $asc<=-18240)return "F";
if($asc>=-18239 and $asc<=-17923)return "G";
if($asc>=-17922 and $asc<=-17418)return "H";
if($asc>=-17417 and $asc<=-16475)return "J";
if($asc>=-16474 and $asc<=-16213)return "K";
if($asc>=-16212 and $asc<=-15641)return "L";
if($asc>=-15640 and $asc<=-15166)return "M";
if($asc>=-15165 and $asc<=-14923)return "N";
if($asc>=-14922 and $asc<=-14915)return "O";
if($asc>=-14914 and $asc<=-14631)return "P";
if($asc>=-14630 and $asc<=-14150)return "Q";
if($asc>=-14149 and $asc<=-14091)return "R";
if($asc>=-14090 and $asc<=-13319)return "S";
if($asc>=-13318 and $asc<=-12839)return "T";
if($asc>=-12838 and $asc<=-12557)return "W";
if($asc>=-12556 and $asc<=-11848)return "X";
if($asc>=-11847 and $asc<=-11056)return "Y";
if($asc>=-11055 and $asc<=-10247)return "Z";
return null;
}
function safe_encoding($string) {
$encoding="UTF-8";
for($i=0;$i<strlen($string);$i++) {
if(ord($string{$i})<128) continue;
if((ord($string{$i})&224)==224) { //第一个字节判断通过
$char=$string{++$i};
if((ord($char)&128)==128) { //第二个字节判断通过
$char=$string{++$i};
if((ord($char)&128)==128) {
$encoding="UTF-8";
break;
}
}
}
if((ord($string{$i})&192)==192) { //第一个字节判断通过
$char=$string{++$i};
if((ord($char)&128)==128) { //第二个字节判断通过
$encoding="GB2312";
break;
}
}
}
if(strtoupper($encoding)==strtoupper($this->_outEncoding))
return $string;
else
return iconv($encoding,$this->_outEncoding,$string);
}
private function _Array_Combine($_Arr1, $_Arr2){
for($i = 0; $i < count ( $_Arr1 ); $i ++)
$_Res [$_Arr1 [$i]] = $_Arr2 [$i];
return $_Res;
}
}
\ No newline at end of file
......@@ -11,6 +11,8 @@ class CircleMemberDat extends CompassDynamicData
var $circle_id;
var $user_id;
var $name;
var $header_img;
var $is_owner;
var $delete_flg;
/**
......@@ -26,6 +28,8 @@ class CircleMemberDat extends CompassDynamicData
$this->circle_id = $record["circle_id"];
$this->user_id = $record["user_id"];
$this->name = $record["name"];
$this->header_img = $record["header_img"];
$this->is_owner = $record["is_owner"];
$this->delete_flg = $record["delete_flg"];
}
......@@ -93,6 +97,8 @@ class CircleMemberDat extends CompassDynamicData
ParamUtil::copyObj2Array($v_param, $this, "circle_id");
ParamUtil::copyObj2Array($v_param, $this, "user_id");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "name");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "header_img");
ParamUtil::copyObj2Array($v_param, $this, "is_owner");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
......
<?php
/**
* UserLoginDat Entity
* $Id: UserLoginDat.inc,v 1.1 2020/2/27 14:40:01 Exp $
* @author zb
* @package jp.compass.entity
* @access public
*/
class UserLoginDat extends CompassDynamicData
{
var $openid;
var $seesion_key;
var $delete_flg;
/**
* 构造实现。user_mst创建实例。
*
* @access public
* @param mixed user_mst
*/
function constructor($record)
{
parent::constructor($record);
$this->openid = $record["openid"];
$this->seesion_key = $record["seesion_key"];
$this->delete_flg = $record["delete_flg"];
}
/**
* 根据条件,获取数据列表。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getList($w_param = null, $orderkey = null, $direction = "ASC", $offset = null, $limit = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
return CompassDBHandler::getList("UserLoginDat", "user_mst", $w_param, $orderkey, $direction, $offset, $limit);
}
/**
* 根据条件,获取数据列表的件数。
* 条件与DBManager的doSelect相同。
* @access public
* @static
* @param array 检索条件
* @return array Entity的队列
*/
public static function getListCount($w_param = null)
{
if ($w_param == null) {
$w_param = array();
$w_param["delete_flg"] = "false";
}
$db = CompassDBManager::getInstance();
$result = $db->doSelect("user_mst", $w_param, null, null, null, null, "count(*) as count");
return $result[0]["count"];
}
/**
* 获得此类指定ID的实例。
*/
public static function getById($id)
{
// delete_flg
$param = array();
$param["delete_flg"] = false;
return CompassDBHandler::getById("UserLoginDat", "user_mst", $id, $param);
}
// -- 这里开始Dynamic ---
/**
* 将此实例写入DB。
* DynamicData共用的保存方法。
* @access public
* @return int 写入实例的ID
*/
public function save()
{
$v_param = array();
ParamUtil::copyObj2Array($v_param, $this, "openid");
ParamUtil::copyObj2Array($v_param, $this, "seesion_key");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存
parent::_save("user_mst", $v_param);
}
}
\ No newline at end of file
......@@ -67,6 +67,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/CourseParentCateg
// Action
require_once(COMPASS_LIB_ROOT . "/cn/compass/action/TemplateAction.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/action/Pinyin.inc");
// Handler
require_once(COMPASS_LIB_ROOT . "/cn/compass/handler/AccountHandler.inc");
......
......@@ -40,8 +40,8 @@ define("MEMCACHE_VERSION", 1);
// 微信认证相关【公众号】
define("WECHAT_APP_ID","wxeef50c5d0ef117d1");
define("WECHAT_APP_SECRET","48dd0dfd509d1438aa4950d7dcdbee9e");
define("WECHAT_APP_ID","wxbfe83497ed67d237");
define("WECHAT_APP_SECRET","42284e961dd50e78e354d15a292b0ec9");
define("WECHAT_AUTH_TOKEN","COMPASS");
define("WECHAT_PAY_MCHID","1371137902");
define("WECHAT_PAY_KEY","a1b2c3defghijKlmnopqrstuvwx4y5z6");
......
......@@ -60,6 +60,8 @@ $circleMemberDat = new CircleMemberDat();
$circleMemberDat->circle_id = $circleDat->id;
$circleMemberDat->user_id = $userMst->id;
$circleMemberDat->name = $userMst->name;
$circleMemberDat->user_id = $userMst->id;
$circleMemberDat->name = $userMst->name;
$circleMemberDat->save();
//圈子成员数+1
$circleDat->member_count++;
......
......@@ -75,7 +75,6 @@ $circleDat->district = $district;
$circleDat->owner_id = $userMst->id;
$circleDat->save();
//返回创建的圈子
$param = array();
$param['owner_id'] = $userMst->id;
......@@ -88,6 +87,8 @@ if(!empty($circleList)) {
$circleMemberDat->circle_id = $circleDat->id;
$circleMemberDat->user_id = $userMst->id;
$circleMemberDat->name = $userMst->name;
$circleMemberDat->header_img = $userMst->header_img;
$circleMemberDat->is_owner = true;
$circleMemberDat->save();
//返回数据
......@@ -96,6 +97,8 @@ if(!empty($circleList)) {
responseOK($result);
}
$result["message"] = "系统错误!";
responseNG($result);
......
......@@ -59,6 +59,14 @@ if(!empty($_FILES['frontImage']['tmp_name'])){
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg
$circleDat->front_image = $url;
$circleDat->save();
//自动发布一条公告!
$circleNoticeDat = new CircleNoticeDat();
$circleNoticeDat->circle_id = $circleDat->id;
$circleNoticeDat->title = $circleDat->title . "圈子成立公告";
$circleNoticeDat->comment = $circleDat->comment;
$circleNoticeDat->image = $circleDat->front_image;
$circleNoticeDat->save();
}
//处理上传图片【图片】
......
......@@ -37,6 +37,12 @@ if(empty($circleDat)) {
responseNG($result);
}
//图片分割为数组
if(!empty($circleDat->images)) {
$tmpArr = explode("|",$circleDat->images);
$circleDat->images = array_filter($tmpArr);
}
$isOwner = false;
if($circleDat->owner_id == $userMst->id) {
$isOwner = true;
......
......@@ -8,6 +8,7 @@ ErrorLogger::doOutput("Compass...ajax_get_circle_member_list.php....Start.", 0);
//获取参数
$unionId = ParamUtil::getRequestString("unionId");
$circleId = ParamUtil::getRequestNumber("circleId", 0);//圈子id
$name = ParamUtil::getRequestString("name");//圈子id
$result = array();
......@@ -36,14 +37,41 @@ if(empty($circleDat)) {
responseNG($result);
}
//获取圈子成员数量
$param = array();
$param['circle_id'] = $circleDat->id;
$param['delete_flg'] = false;
$memberCount = CircleMemberDat::getListCount($param);
//获取圈子成员列表
$memberList = array();
$param = array();
$param['circle_id'] = $circleDat->id;
if(!empty($name)) {
$param['name_ALT'] = "%" . $name . "%";
}
$param['delete_flg'] = false;
$memberList = CircleMemberDat::getList($param, "name", "asc");
$tmpList = CircleMemberDat::getList($param, "is_owner desc, name", "asc");
//圈主
$memberList["圈主(1)"] = $tmpList[0];
$tmpMemberList = array_pop($tmpList);
//根据拼音首字母分组
$pinyin = new Pinyin();
$tmpOrderList = array();
foreach($tmpMemberList as $tmpMember) {
//获取拼音首字母
$firstChar = $pinyin->getFirstChar($tmpMember->name);
//是否已经存在key
if (array_key_exists($firstChar,$tmpOrderList)){
}
}
//组装返回数据
$result["memberCount"] = count($memberList);
$result["memberCount"] = $memberCount;
$result["memberList"] = $memberList;
ErrorLogger::doOutput("Compass...ajax_get_circle_member_list.php....End.", 0);
......
......@@ -41,7 +41,7 @@ if(!empty($tmpUserCircleList)) {
//获取圈子名称
$tmpCircle = CircleDat::getById($tmp->circle_id);
if(!empty($tmpCircle)) {
$userCircleList[] = array("circle_id"=>$tmpCircle->id, "circle_title"=>$tmpCircle->title);
$userCircleList[] = array("circle_id"=>$tmpCircle->id, "circle_title"=>$tmpCircle->title, "front_image"=>$tmpCircle->front_image);
}
}
}
......
<?php
// 【区域管理】获取指定学校的志愿者活动列表
require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_get_school_detail.php....Start.", 0);
//获取参数
$schoolNo = ParamUtil::getRequestString("schoolNo");
$originalSource = ParamUtil::getRequestNumber("originalSource", 0);
//参数检查
if(empty($schoolNo) || empty($originalSource)) {
$result["message"] = "参数错误!";
responseNG($result);
}
$result = array();
//查询学校是否存在
//todo 以后改为 从家校或者家园系统查询
$param = array();
$param['school_no'] = $schoolNo;
$param['original_source'] = $originalSource;
$param['delete_flg'] = false;
$schoolList = SchoolMst::getList($param,'id','desc', 0, 1);
if(empty($schoolList)) {
$result["message"] = "参数错误!";
responseNG($result);
}
$schoolMst = $schoolList[0];
//查询该学校的志愿者人数
$memberCount = 0;
$sql = "select count(*) as member_count from user_mst where delete_flg = false and school_no='{$schoolNo}' and original_source='{$originalSource}'";
$db = &CompassDBManager::getInstance();
$tmpList = $db->executeQuery($sql);
if(!empty($tmpList)) {
$memberCount = $tmpList[0]['member_count'];
}
//查询该校能力分汇总
$abilityPoint = 0;
$sql = "select sum(ability_point) as ability_point from user_mst where delete_flg = false and school_no='{$schoolNo}' and original_source='{$originalSource}'";
$db = &CompassDBManager::getInstance();
$tmpList = $db->executeQuery($sql);
if(!empty($tmpList)) {
$abilityPoint = $tmpList[0]['ability_point'];
}
//查询该学校的志愿者活动列表
$volunteerEventList = array();
$param = array();
$param['school_no'] = $schoolNo;
$param['original_source'] = $originalSource;
$param['status_NOT'] = "NEW";
$param['status_NOT'] = "NG";
$param['delete_flg'] = false;
$tmpVolunteerEventList = VolunteerEventDat::getList($param,'id','desc');
//加工返回的数据
//设置状态和招募范围
foreach($tmpVolunteerEventList as $tmp) {
$tmp->status_title = "征集中";
$tmp->scope = "校内";
if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士";
}
$volunteerEventList[] = $tmp;
}
//接口返回数据
$result["schoolTitle"] = $schoolMst->title;
$result["memberCount"] = $memberCount;
$result["abilityPoint"] = $abilityPoint;
$result["volunteerEventList"] = $volunteerEventList;
ErrorLogger::doOutput("Compass...ajax_get_school_detail.php....End.", 0);
//返回结果
responseOK($result);
function responseNG($result) {
$result = array("status"=>"NG", "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
......@@ -69,6 +69,8 @@ if($circleDat->need_check) {
$circleMemberDat->circle_id = $circleDat->id;
$circleMemberDat->user_id = $userMst->id;
$circleMemberDat->name = $userMst->name;
$circleMemberDat->header_img = $userMst->header_img;
$circleMemberDat->is_owner = false;
$circleMemberDat->save();
//圈子成员数+1
$circleDat->member_count++;
......
......@@ -5,8 +5,14 @@ require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...test.php....Start.", 0);
$userMst = UserMst::getById(31);
$pinyin = new Pinyin();
echo $pinyin->getFirstChar("湖北武汉")."<br/>";
echo $pinyin->getPinyin("北上广")."<br/>";
echo $pinyin->getPinyin("火影")."<br/>";
echo $pinyin->getFirstChar("获得")."<br/>";
echo $pinyin->getFirstChar("TOM")."<br/>";
$userMst = UserMst::getById(31);
//管辖区域
$province = $userMst->province;
......@@ -82,7 +88,7 @@ foreach($tmpList as $tmp) {
}
}
*/
$param = array();
$param['delete_flg'] = false;
......@@ -94,6 +100,7 @@ foreach($tmpList as $tmp) {
}
*/
ErrorLogger::doOutput("Compass...test.php....End.", 0);
......
......@@ -2,16 +2,53 @@
App({
url: 'https://www.koala-online.cn/compass/if/',
onLaunch: function () {
var that = this;
//调用wx用户登陆
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
this.checkUser(res.code, null);
wx.showToast({
title: '123'+res,
})
wx.request({
url: that.url + 'ajax_check_user_registed.php',
data: {
code: res.code
},
header: {
'content-type': 'application/json' // 默认值
},
success(res) {
//保存返回的openId和unionId
let config = {
openId: res.data.result.openId,
unionId: res.data.result.unionId,
registed: res.data.result.registed
};
// wx.showToast({
// title: "unionId=" + res.data.result.unionId,
// icon: 'success',
// duration: 2000
// });
wx.setStorage({
key: 'config',
data: config,
});
},
fail: function (res) {
wx.showToast({
title: "失败111",
icon: 'success',
duration: 2000
});
},
complete: function (res) {
},
})
}
})
var config = wx.getStorageSync('config');
var that = this;
//获取并保存用户的经纬度信息
wx.getLocation({
type: 'wgs84',
......@@ -21,7 +58,7 @@ App({
longitude: res.longitude
};
wx.setStorage({
key: 'location',
key:'location',
data: location,
})
}
......@@ -30,42 +67,7 @@ App({
//判断用户是否已经注册
checkUser:function(code,openid){
wx.request({
url: this.url + 'ajax_check_user_registed.php',
data: {
openId: openid,
code: code
},
header: {
'content-type': 'application/json' // 默认值
},
success(res) {
//保存返回的openId和unionId
let config = {
openId: res.data.result.openId,
unionId: res.data.result.unionId,
registed: res.data.result.registed
};
wx.showToast({
title: "unionId=" + res.data.result.unionId,
icon: 'success',
duration: 2000
});
wx.setStorage({
key: 'config',
data: config,
});
},
fail: function (res) {
wx.showToast({
title: "失败",
icon: 'success',
duration: 2000
});
},
complete: function (res) {
},
})
},
globalData: {
userInfo: null
......
......@@ -61,6 +61,13 @@ video, live-player, live-pusher, open-data, web-view {
align-items: center;
flex-wrap: wrap;
}
.activelist>text{
display: block;
width: 80%;
height: 1px;
background: #f0f0f0;
margin: 0 auto;
}
.activeLine{
display: block;
width: 80%;
......@@ -252,8 +259,8 @@ video, live-player, live-pusher, open-data, web-view {
margin: 0 auto;
}
.left_listPublicWelfare{
width: 30%;
height: 80px;
width: 120px;
height: 67px;
border-radius: 5px;
overflow: hidden;
position: relative;
......@@ -263,14 +270,19 @@ video, live-player, live-pusher, open-data, web-view {
height: 100%;
}
.right_listPublicWelfare{
width: 60%;
height: 80px;
flex: 1;
height: 67px;
font-size: 12px;
color: #000;
box-sizing: border-box;
padding-left: 30px;
}
.right_listPublicWelfare>text{
display: block;
height: 18px;
font-size: 12px;
overflow:hidden;
text-overflow:ellipsis;
}
.right_listPublicWelfare .activeTitle{
font-size: 13px;
......@@ -278,14 +290,14 @@ video, live-player, live-pusher, open-data, web-view {
color: #000;
}
.right_listPublicWelfare>view{
height: 35px;
height: 30px;
display: flex;
align-items: center;
}
.right_listPublicWelfare>view>image{
width: 15px;
height: 15px;
margin-left: 10px;
/* margin-left: 10px; */
}
.right_listPublicWelfare>view{
color: #666;
......
......@@ -109,9 +109,10 @@ Page({
},
//圈子详细
circleDetails() {
circleDetails(e) {
let circleId = e.currentTarget.dataset['index']
wx.navigateTo({
url: '../circleDetails/circleDetails',
url: '../circleDetails/circleDetails?circleId=' + circleId,
});
},
......
......@@ -20,7 +20,7 @@
<image src='{{item.front_image}}'></image>
<text>{{item.circle_title}}</text>
</view>
<text bindtap="circleDetails" style='display:block;width:50px;height:30px;border:1px solid #ccc;text-align:center;line-height:30px;border-radius:8px'>进入</text>
<text bindtap="circleDetails" style='display:block;width:50px;height:20px;text-align:center;line-height:20px;border-radius:15px;font-size:12px;background:#0D76ED;color:#fff' data-index="{{item.circle_id}}">进入</text>
</view>
</view>
</view>
......
......@@ -105,7 +105,6 @@ page{
.myQuanzilist>view>view>image{
width: 30px;
height: 30px;
border: 1px solid #ccc;
border-radius: 50%;
margin-right: 5px;
}
......
......@@ -16,6 +16,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
circleId: options.circleId,
})
//获取圈子信息
this.circleinfo()
},
......@@ -44,14 +48,14 @@ Page({
//跳转到圈子成员
circleMembers(){
wx.navigateTo({
url: '../circleMembers/circleMembers',
url: '../circleMembers/circleMembers?circleId=' + this.data.circleId,
});
},
//圈子公告
circleNews(){
wx.navigateTo({
url: '../circleNotice/circleNotice',
url: '../circleNotice/circleNotice' + this.data.circleId,
})
},
......@@ -63,8 +67,7 @@ Page({
url: app.url + 'ajax_get_circle_info.php',
data: {
unionId: config.unionId,
circleId:7,
userId:7
circleId:that.data.circleId
},
header: { 'content-type': 'application/json' },
method: 'GET',
......@@ -73,10 +76,11 @@ Page({
console.log(res)
if (res.statusCode == 200) {
if (res.data.status == "OK") {
}
if(res.data.result.isOwner==true){
that.setData({
isOwner: res.data.result.isOwner,
circleDat: res.data.result.circleDat,
noticeDat: res.data.result.noticeDat
})
}
}
},
......@@ -88,14 +92,14 @@ Page({
//发布活动
newCircleEvent(){
wx.navigateTo({
url: '../newCircleEvent/newCircleEvent',
url: '../newCircleEvent/newCircleEvent' + this.data.circleId,
})
},
//活动管理
circleEvents(){
wx.navigateTo({
url: '../circleEvents/circleEvents',
url: '../circleEvents/circleEvents' + this.data.circleId,
})
}
})
\ No newline at end of file
......@@ -14,8 +14,8 @@
<image src='../../img/sanjiao.png'></image>圈子公告
</view>
<view class='con_circleGonggao'>
<text>测试公告测试公告测试公告测试公告!!</text>
<image src='../../img/1.jpg'></image>
<text>{{noticeDat.title}}</text>
<image src='{{noticeDat.image}}'></image>
</view>
</view>
<view class='circleGonggao'>
......@@ -23,9 +23,9 @@
<image src='../../img/sanjiao.png'></image>圈子简介
</view>
<view class='con_circleGonggao'>
<text>本圈子是双方都觉得发表回复大规划的法规和纠纷的更多更好发动机工会经费的后果和豆腐干不发货的股份的回复电话发的护肤方法</text>
<image src='../../img/1.jpg'></image>
<text>{{circleDat.comment}}</text>
<image wx:for="{{circleDat.images}}" src='{{item}}'></image>
</view>
</view>
<view class='activefabu' bindtap='newCircleEvent'>活动发布</view>
<view class='activefabu' bindtap='newCircleEvent' wx:if="{{isOwner}}">活动发布</view>
</view>
......@@ -32,7 +32,6 @@
.con_circleGonggao>image{
display: block;
width: 90%;
height: 100px;
margin: 10px auto;
}
.activefabu{
......
......@@ -7,7 +7,8 @@ Page({
* 页面的初始数据
*/
data: {
value:'',
circleId: 0,
name:'',
memberList:[]
},
......@@ -15,7 +16,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.peoplelist()
this.setData({
circleId: options.circleId
})
this.getMemberList()
},
/**
......@@ -33,58 +37,36 @@ Page({
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
onChange(event) {
// event.detail 为当前输入的值
console.log(event.detail);
//获取输入的值
onInutName(e) {
this.setData({
name: e.detail.value
})
},
//邀请成员
inviteCircleMember(){
wx.navigateTo({
url: '../inviteCircleMember/inviteCircleMember',
})
},
// 成员列表
peoplelist(){
getMemberList(){
var that = this;
var config = wx.getStorageSync('config');
// var location = wx.getStorageSync('location');
wx: wx.request({
wx.request({
url: app.url + 'ajax_get_circle_member_list.php',
data: {
unionId: config.unionId,
circleId: 7
circleId: that.data.circleId,
name:that.data.name
},
header: { 'content-type': 'application/json' },
method: 'GET',
......
......@@ -6,14 +6,14 @@
<view class='search'>
<van-cell-group>
<van-field
value="{{ value }}"
value="{{ name }}"
placeholder="请输入用户名"
border="{{ false }}"
bind:change="onChange"
border="{{false}}"
bind:change="onInutName"
/>
</van-cell-group>
</view>
<van-button type="default" size='small'>搜索</van-button>
<van-button type="default" size='small' bindtap="getMemberList">搜索</van-button>
</view>
<view class='peopleList'>
<view class='con_peopleList'>
......
......@@ -8,6 +8,7 @@ Page({
data: {
parentCategorys:[],
tabIndex:0,
erjiTab:0,
subCategory1:[],
subCategory2: [],
......@@ -122,10 +123,12 @@ Page({
let index = e.currentTarget.dataset['index']
if (this.data.tabIndex==0) {
this.setData({
erjiTab:index,
subId: this.data.subCategory1[index].id
})
} else {
this.setData({
erjiTab: index,
subId: this.data.subCategory2[index].id
})
}
......
<!--pages/gongyiClass/gongyiClass.wxml-->
<view class='gongyiClass'>
<view class='top_gongyiClass'>
<view wx:for="{{parentCategorys}}" wx:key="{{index}}" bindtap='parentTab' data-index='{{index}}' style='background:{{tabIndex==index?"#ccc":"#fff"}};color:{{tabIndex==index?"#fff":"#000"}}'>
{{item.title}}
<view style='border-bottom:1px solid #f0f0f0;height:46px'>
<view wx:for="{{parentCategorys}}" wx:key="{{index}}" bindtap='parentTab' data-index='{{index}}' class='{{tabIndex==index?"firstTab":""}}'>
{{item.title}}<view></view>
</view>
</view>
<view>
<text wx:for="{{subCategory1}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}" class='{{erjiTab==index?"firstTab":""}}'>{{item.title}}</text>
<text wx:for="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}" class='{{erjiTab==index?"firstTab":""}}'>{{item.title}}</text>
</view>
<text wx:for="{{subCategory1}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==0}}">{{item.title}}</text>
<text wx:for="{{subCategory2}}" bindtap='subTab' data-index='{{index}}' wx:key="{{index}}" wx:if="{{tabIndex==1}}">{{item.title}}</text>
</view>
<view class='conSwiper'>
购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>详情</view>
<image src='../../img/dongNews.png'></image>购买中国志愿者会员,公益视频免费看!<view bindtap='memberChange'>查看</view>
</view>
<view class='lookHistory'>
<text bindtap='history'>历史观看</text>
<view><view class='leftLine'></view>全部<view class='rightLine'></view></view>
<text bindtap='history'>历史</text>
</view>
<scroll-view scroll-y="true" style='height:660rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'>
......@@ -28,6 +33,7 @@
</view>
<text>主讲教师:{{item.teacher}}</text>
</view>
<text></text>
</view>
</scroll-view>
......
/* pages/gongyiClass/gongyiClass.wxss */
.top_gongyiClass{
width: 100%;
height: 120px;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.top_gongyiClass>view{
width: 45%;
height: 50px;
width: 100%;
display: flex;
flex-wrap: wrap;
}
.top_gongyiClass>view>view{
height: 36px;
text-align: center;
line-height: 50px;
line-height: 30px;
font-size: 14px;
border: 1px solid #ccc;
margin-top: 10px;
padding: 0 20px;
}
.top_gongyiClass>text{
padding: 3px;
font-size: 14px;
.top_gongyiClass>view>view>view{
width: 40px;
height: 6px;
margin: 0 auto;
border-radius: 30px;
}
.firstTab{
color: #ff3535;
}
.firstTab>view{
background: #ff9696;
}
.top_gongyiClass>view>text{
display: block;
padding: 3px 20px;
font-size: 13px;
height: 25px;
line-height: 25px;
border: 1px solid #ccc;
margin-top: 20px;
margin-top: 5px;
}
.lookHistory{
width: 100%;
border-top: 1px solid #ccc;
position: relative;
margin-bottom: 20px;
}
.lookHistory>view{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
color: #000;
}
.leftLine{
width: 22%;
height: 2px;
background: linear-gradient(to left, #599eff, #fff);
margin-right: 10px;
}
.rightLine{
width: 22%;
height: 2px;
background: linear-gradient(to right, #599eff, #fff);
margin-left: 10px;
}
.lookHistory>text{
position: absolute;
right: 10px;
top: 0;
bottom: 0;
margin: auto;
display: block;
height: 40px;
line-height: 40px;
text-align: right;
font-size: 12px;
box-sizing: border-box;
padding-right: 10px;
color: rgb(23, 173, 18);
color: #599eff;
}
\ No newline at end of file
......@@ -14,7 +14,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.10.0",
"appid": "wxeef50c5d0ef117d1",
"appid": "wxbfe83497ed67d237",
"projectname": "Compass",
"debugOptions": {
"hidedInDevtools": []
......
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