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
7de55db2
Commit
7de55db2
authored
Mar 13, 2020
by
shijiuyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bac032f6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
11 deletions
+68
-11
classDetails.js
src/wx/pages/classDetails/classDetails.js
+42
-3
index.js
src/wx/pages/index/index.js
+20
-8
register.js
src/wx/pages/register/register.js
+6
-0
No files found.
src/wx/pages/classDetails/classDetails.js
View file @
7de55db2
...
@@ -82,13 +82,14 @@ Page({
...
@@ -82,13 +82,14 @@ Page({
success
:
function
(
resp
)
{
success
:
function
(
resp
)
{
console
.
log
(
resp
)
console
.
log
(
resp
)
if
(
resp
.
data
.
status
==
'OK'
){
if
(
resp
.
data
.
status
==
'OK'
){
if
(
resp
.
data
.
haveBuy
&&!
resp
.
data
.
is_free
||
resp
.
data
.
is_free
){
if
(
resp
.
data
.
result
.
courseMediaDat
.
haveBuy
&&
!
resp
.
data
.
result
.
courseMediaDat
.
is_free
||
resp
.
data
.
result
.
courseMediaDat
.
is_free
){
that
.
setData
({
that
.
setData
({
play
:
1
,
play
:
1
,
playUrl
:
resp
.
data
.
result
.
courseMediaDat
.
media
playUrl
:
resp
.
data
.
result
.
courseMediaDat
.
media
})
})
}
else
{
}
else
{
that
.
setData
({
that
.
setData
({
playUrl
:
resp
.
data
.
result
.
courseMediaDat
.
media
,
fufeiPage
:
1
,
fufeiPage
:
1
,
money
:
resp
.
data
.
result
.
courseMediaDat
.
price
money
:
resp
.
data
.
result
.
courseMediaDat
.
price
})
})
...
@@ -192,8 +193,45 @@ Page({
...
@@ -192,8 +193,45 @@ Page({
})
})
},
},
surefufei
(){
surefufei
(){
this
.
setData
({
var
that
=
this
;
fufeiPage
:
0
wx
.
getStorage
({
key
:
'config'
,
success
:
function
(
res
)
{
if
(
res
){
wx
.
request
({
url
:
app
.
url
+
'ajax_buy_course_media.php'
,
data
:
{
unionId
:
res
.
data
.
unionId
,
openId
:
res
.
data
.
openId
,
mediaId
:
that
.
data
.
mediaId
},
success
:
function
(
resp
){
console
.
log
(
resp
)
if
(
resp
.
data
.
status
==
'OK'
){
var
result
=
JSON
.
parse
(
resp
.
data
.
result
);
wx
.
requestPayment
({
timeStamp
:
result
.
timeStamp
,
nonceStr
:
result
.
nonceStr
,
package
:
result
.
package
,
signType
:
'MD5'
,
paySign
:
result
.
paySign
,
success
(
res
)
{
that
.
setData
({
fufeiPage
:
0
,
play
:
1
})
})
},
fail
(
res
)
{
}
})
}
}
})
}
},
})
// this.setData({
// fufeiPage: 0
// })
}
}
})
})
\ No newline at end of file
src/wx/pages/index/index.js
View file @
7de55db2
...
@@ -29,10 +29,17 @@ Page({
...
@@ -29,10 +29,17 @@ Page({
var
that
=
this
;
var
that
=
this
;
//获取用户当前的经纬度信息并调用接口判断用户身份
//获取用户当前的经纬度信息并调用接口判断用户身份
var
config
=
wx
.
getStorageSync
(
'config'
);
var
config
=
wx
.
getStorageSync
(
'config'
);
var
location
=
wx
.
getStorageSync
(
'location'
);
setTimeout
(
function
(){
var
latitude
=
location
.
latitude
;
wx
.
getStorage
({
var
longitude
=
location
.
longitude
;
key
:
'location'
,
wx
:
wx
.
request
({
success
:
function
(
resp
)
{
var
location
=
resp
.
data
;
var
latitude
=
resp
.
data
.
latitude
;
var
longitude
=
resp
.
data
.
longitude
;
wx
.
showToast
({
title
:
config
.
unionId
,
})
wx
.
request
({
url
:
app
.
url
+
'ajax_get_user_role.php'
,
url
:
app
.
url
+
'ajax_get_user_role.php'
,
data
:
{
data
:
{
unionId
:
config
.
unionId
,
unionId
:
config
.
unionId
,
...
@@ -44,8 +51,9 @@ Page({
...
@@ -44,8 +51,9 @@ Page({
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
.
statusCode
==
200
)
{
if
(
res
.
statusCode
==
200
)
{
//保存用户当前的省市区县信息
//保存用户当前的省市区县信息
location
.
province
=
res
.
data
.
result
.
province
location
.
province
=
res
.
data
.
result
.
province
location
.
city
=
res
.
data
.
result
.
city
location
.
city
=
res
.
data
.
result
.
city
location
.
district
=
res
.
data
.
result
.
district
location
.
district
=
res
.
data
.
result
.
district
...
@@ -61,7 +69,7 @@ Page({
...
@@ -61,7 +69,7 @@ Page({
})
})
//未注册用户的话。跳转到社会人士注册页面
//未注册用户的话。跳转到社会人士注册页面
if
(
res
.
data
.
status
==
"REGIST"
)
{
if
(
res
.
data
.
status
==
"REGIST"
)
{
//页面跳转
//页面跳转
wx
.
redirectTo
({
wx
.
redirectTo
({
url
:
'../socialUserRegister/socialUserRegister'
,
url
:
'../socialUserRegister/socialUserRegister'
,
...
@@ -69,11 +77,11 @@ Page({
...
@@ -69,11 +77,11 @@ Page({
}
}
that
.
setData
({
that
.
setData
({
roleTitle
:
res
.
data
.
result
.
name
,
roleTitle
:
res
.
data
.
result
.
name
,
role
:
res
.
data
.
result
.
role
,
role
:
res
.
data
.
result
.
role
,
childAge
:
res
.
data
.
result
.
childAge
childAge
:
res
.
data
.
result
.
childAge
})
})
//菜单控制[亲子活动]
//菜单控制[亲子活动]
if
(
res
.
data
.
result
.
role
==
1
||
res
.
data
.
result
.
childAge
==
1
)
{
if
(
res
.
data
.
result
.
role
==
1
||
res
.
data
.
result
.
childAge
==
1
)
{
that
.
setData
({
that
.
setData
({
showFamily
:
true
showFamily
:
true
})
})
...
@@ -97,6 +105,10 @@ Page({
...
@@ -97,6 +105,10 @@ Page({
complete
:
function
(
res
)
{
},
complete
:
function
(
res
)
{
},
})
})
},
},
})
},
1000
);
},
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
...
...
src/wx/pages/register/register.js
View file @
7de55db2
...
@@ -32,6 +32,8 @@ Page({
...
@@ -32,6 +32,8 @@ Page({
onShow
:
function
()
{
onShow
:
function
()
{
//如果用户已经注册则跳转到首页
//如果用户已经注册则跳转到首页
var
config
=
wx
.
getStorageSync
(
'config'
);
var
config
=
wx
.
getStorageSync
(
'config'
);
setTimeout
(
function
(){
if
(
config
.
registed
==
true
)
{
if
(
config
.
registed
==
true
)
{
//跳转到首页
//跳转到首页
wx
.
switchTab
({
wx
.
switchTab
({
...
@@ -39,6 +41,10 @@ Page({
...
@@ -39,6 +41,10 @@ Page({
});
});
}
}
},
},
200
)
},
/**
/**
* 用户点击右上角分享
* 用户点击右上角分享
...
...
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