Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Compass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zong
Compass
Commits
3139a14e
Commit
3139a14e
authored
Mar 08, 2020
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e9cffd77
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
48 deletions
+18
-48
ajax_check_user_registed.php
src/user/if/ajax_check_user_registed.php
+2
-0
app.js
src/wx/app.js
+15
-47
1.jpg
src/wx/img/1.jpg
+0
-0
2.jpg
src/wx/img/2.jpg
+0
-0
socialUserRegister.wxml
src/wx/pages/socialUserRegister/socialUserRegister.wxml
+1
-1
No files found.
src/user/if/ajax_check_user_registed.php
View file @
3139a14e
...
...
@@ -40,10 +40,12 @@ if(!empty($jsCode)) {
$tmpUserMst
=
UserMst
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
if
(
empty
(
$tmpUserMst
))
{
$result
[
"openId"
]
=
$openId
;
$result
[
"unionId"
]
=
$unionId
;
$result
[
"message"
]
=
"未注册!"
;
responseOK
(
$result
);
}
else
{
$result
[
"openId"
]
=
$openId
;
$result
[
"unionId"
]
=
$unionId
;
$result
[
"message"
]
=
"已注册!"
;
responseNG
(
$result
);
}
...
...
src/wx/app.js
View file @
3139a14e
...
...
@@ -2,7 +2,14 @@
App
({
url
:
'https://www.koala-online.cn/compass/if/'
,
onLaunch
:
function
()
{
this
.
checkUser
();
//调用wx用户登陆
wx
.
login
({
success
:
res
=>
{
// 发送 res.code 到后台换取 openId, sessionKey, unionId
this
.
checkUserRegisted
(
res
.
code
,
null
);
}
})
var
config
=
wx
.
getStorageSync
(
'config'
);
var
that
=
this
;
//获取用户的经纬度信息
...
...
@@ -47,41 +54,6 @@ App({
})
}
})
// 展示本地存储能力
var
logs
=
wx
.
getStorageSync
(
'logs'
)
||
[]
logs
.
unshift
(
Date
.
now
())
wx
.
setStorageSync
(
'logs'
,
logs
)
// var config = wx.getStorageSync('config');
// if(!config){
// wx.login({
// success: res => {
// // 发送 res.code 到后台换取 openId, sessionKey, unionId
// this.checkUser(res.code, null);
// console.log(res,11)
// }
// })
// }else{
// this.checkUser(null, res.openId);
// console.log(res.openId,22)
// }
// wx.getStorage({
// key: 'config',
// success: function(res) {
// console.log('res')
// if(!res){
// wx.login({
// success: res => {
// // 发送 res.code 到后台换取 openId, sessionKey, unionId
// this.checkUser(res.code,null);
// }
// })
// }else{
// this.checkUser(null,res.openId);
// }
// },
// })
// 登录
// 获取用户信息
wx
.
getSetting
({
...
...
@@ -104,7 +76,9 @@ App({
}
})
},
checkUser
:
function
(
code
,
openid
){
//判断用户是否已经注册
checkUserRegisted
:
function
(
code
,
openid
){
wx
.
request
({
url
:
this
.
url
+
'ajax_check_user_registed.php'
,
data
:
{
...
...
@@ -115,17 +89,11 @@ App({
'content-type'
:
'application/json'
// 默认值
},
success
(
res
)
{
console
.
log
(
res
,
'成功调用checkUser方法'
)
// if(res.data.result.message=="未注册")
if
(
res
.
data
.
status
==
'OK'
){
wx
.
showModal
({
title
:
'提示'
,
content
:
'成功调用checkUser方法'
,
})
let
config
=
{
openId
:
res
.
result
.
openId
,
unionId
:
res
.
result
.
unionId
,
zhuce
:
res
.
data
.
result
.
message
//保存返回的openId和unionId
let
config
=
{
openId
:
res
.
data
.
result
.
openId
,
unionId
:
res
.
data
.
result
.
unionId
,
};
wx
.
setStorage
({
key
:
'config'
,
...
...
src/wx/img/1.jpg
View replaced file @
e9cffd77
View file @
3139a14e
20.2 KB
|
W:
|
H:
50 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/wx/img/2.jpg
View replaced file @
e9cffd77
View file @
3139a14e
36.7 KB
|
W:
|
H:
38.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/wx/pages/socialUserRegister/socialUserRegister.wxml
View file @
3139a14e
<!--pages/jigouRegistered/jigouRegistered.wxml-->
<view class='jigouRegistered'>
<image src='../../img/
1
.jpg'></image>
<image src='../../img/
2
.jpg'></image>
<view class='formtable'>
<view>
<text>姓名:</text>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment