Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
train_vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
train
train_vue
Commits
e44af9bb
Commit
e44af9bb
authored
Feb 16, 2022
by
不吃草的咩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接接口
parent
22ab5288
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
140 additions
and
65 deletions
+140
-65
config/mp-sdk.js
config/mp-sdk.js
+2
-1
mp-sdk/components/app-nav-li/app-nav-li.scss
mp-sdk/components/app-nav-li/app-nav-li.scss
+17
-1
mp-sdk/components/app-nav-li/app-nav-li.wxml
mp-sdk/components/app-nav-li/app-nav-li.wxml
+2
-2
pages/document/coursedetails/coursedetails.js
pages/document/coursedetails/coursedetails.js
+6
-3
pages/document/subsign/subsign.js
pages/document/subsign/subsign.js
+40
-21
pages/home/home.js
pages/home/home.js
+19
-9
pages/home/home.wxml
pages/home/home.wxml
+1
-1
pages/my/home.js
pages/my/home.js
+35
-18
pages/signup/signup.js
pages/signup/signup.js
+17
-8
pages/signup/signup.wxml
pages/signup/signup.wxml
+1
-1
No files found.
config/mp-sdk.js
View file @
e44af9bb
...
@@ -12,7 +12,8 @@ export const colorUISdk = new ColorUISdk({
...
@@ -12,7 +12,8 @@ export const colorUISdk = new ColorUISdk({
},
},
//开发环境
//开发环境
dev
:
{
dev
:
{
url
:
'
http://jbzhang.censoft.com.cn/
'
url
:
'
http://192.168.15.249:8050/
'
// url:'http://jbzhang.censoft.com.cn/'
},
},
//本地环境
//本地环境
host
:
{
host
:
{
...
...
mp-sdk/components/app-nav-li/app-nav-li.scss
View file @
e44af9bb
...
@@ -15,6 +15,14 @@
...
@@ -15,6 +15,14 @@
display
:
inline-block
;
display
:
inline-block
;
padding-bottom
:
20rpx
;
padding-bottom
:
20rpx
;
font-size
:
34rpx
;
font-size
:
34rpx
;
height
:
60rpx
;
line-height
:
60rpx
;
display
:
-
webkit-box
;
-webkit-line-clamp
:
1
;
overflow
:hidden
;
text-overflow
:ellipsis
;
-webkit-box-orient
:vertical
;
word-break
:break-all
;
&
:
:
after
{
&
:
:
after
{
content
:
''
;
content
:
''
;
position
:
absolute
;
position
:
absolute
;
...
@@ -28,7 +36,15 @@
...
@@ -28,7 +36,15 @@
.doc-name
{
.doc-name
{
position
:
relative
;
position
:
relative
;
display
:
block
;
display
:
block
;
padding-top
:
20rpx
;
padding-top
:
10rpx
;
height
:
60rpx
;
line-height
:
60rpx
;
display
:
-
webkit-box
;
-webkit-line-clamp
:
1
;
overflow
:hidden
;
text-overflow
:ellipsis
;
-webkit-box-orient
:vertical
;
word-break
:break-all
;
&
:
:
after
{
&
:
:
after
{
content
:
''
;
content
:
''
;
position
:
absolute
;
position
:
absolute
;
...
...
mp-sdk/components/app-nav-li/app-nav-li.wxml
View file @
e44af9bb
<view class="doc-card">
<view class="doc-card">
<navigator url="{{navurl}}" class="flex radius doc-card-navigator {{'bg-'+colorName+'-gradient'}}">
<navigator url="{{navurl}}" class="flex radius doc-card-navigator {{'bg-'+colorName+'-gradient'}}">
<view class="flex-sub p-4 doc-text">
<view class="flex-sub p-4 doc-text">
<view class="doc-title">{{ data.
titl
e }}</view>
<view class="doc-title">{{ data.
courseNam
e }}</view>
<view class="text-lg text-Abc text-lighter doc-name">{{ data.
name
}}</view>
<view class="text-lg text-Abc text-lighter doc-name">{{ data.
remark
}}</view>
</view>
</view>
<view class="mt-2 mr-1 pt-4 pr-4 pl-2 doc-icon">
<view class="mt-2 mr-1 pt-4 pr-4 pl-2 doc-icon">
<text class="icon-xl text-xl {{data.icon}}"/>
<text class="icon-xl text-xl {{data.icon}}"/>
...
...
pages/document/coursedetails/coursedetails.js
View file @
e44af9bb
...
@@ -8,6 +8,7 @@ Page({
...
@@ -8,6 +8,7 @@ Page({
*/
*/
data
:
{
data
:
{
course
:{
course
:{
id
:
''
,
name
:
''
,
name
:
''
,
note
:
''
,
note
:
''
,
price
:
''
price
:
''
...
@@ -29,7 +30,7 @@ Page({
...
@@ -29,7 +30,7 @@ Page({
},
2000
)
},
2000
)
}
else
{
}
else
{
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
`/pages/document/subsign/subsign?price=
${
this
.
data
.
course
.
price
}
&name=
${
this
.
data
.
course
.
name
}
`
,
url
:
`/pages/document/subsign/subsign?price=
${
this
.
data
.
course
.
price
}
&name=
${
this
.
data
.
course
.
name
}
&id=
${
this
.
data
.
course
.
id
}
`
,
})
})
}
}
...
@@ -38,11 +39,13 @@ Page({
...
@@ -38,11 +39,13 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
const
{
name
,
note
,
price
}
=
options
;
console
.
log
(
options
);
const
{
name
,
note
,
price
,
id
}
=
options
;
this
.
setData
({
this
.
setData
({
[
"
course.name
"
]:
name
==
'
null
'
?
''
:
name
,
[
"
course.name
"
]:
name
==
'
null
'
?
''
:
name
,
[
"
course.note
"
]:
note
==
'
null
'
?
'
暂无介绍
'
:
note
,
[
"
course.note
"
]:
note
==
'
null
'
?
'
暂无介绍
'
:
note
,
[
"
course.price
"
]:
price
==
'
null
'
?
''
:
price
[
"
course.price
"
]:
price
==
'
null
'
?
''
:
price
,
[
"
course.id
"
]:
id
})
})
},
},
...
...
pages/document/subsign/subsign.js
View file @
e44af9bb
...
@@ -57,7 +57,7 @@ Page({
...
@@ -57,7 +57,7 @@ Page({
'
专科
'
,
'
专科
'
,
'
本科
'
,
'
研究生及以上
'
'
本科
'
,
'
研究生及以上
'
],
],
columnsHomework
:[
'
电工作业
'
,
'
焊接与热切割作业
'
,
'
高处作业
'
,
'
制冷与空调作业
'
,
'
金属与非金属矿山作业
'
,
'
危险化学品作业
'
],
columnsHomework
:[],
// columnsHomework:[
// columnsHomework:[
// {text:'电工作业',index:1},
// {text:'电工作业',index:1},
// {text:'焊接与热切割作业',index:2},
// {text:'焊接与热切割作业',index:2},
...
@@ -66,7 +66,7 @@ Page({
...
@@ -66,7 +66,7 @@ Page({
// {text:'金属与非金属矿山作业',index:5},
// {text:'金属与非金属矿山作业',index:5},
// {text:'危险化学品作业',index:6},
// {text:'危险化学品作业',index:6},
// ],
// ],
columnsZige
:[
'
职业资格
'
],
columnsZige
:[],
columnsPeixun
:[
'
新办
'
,
'
复审
'
,
'
换证
'
]
columnsPeixun
:[
'
新办
'
,
'
复审
'
,
'
换证
'
]
// columnsPeixun:[
// columnsPeixun:[
// {text:'新办',index:1},
// {text:'新办',index:1},
...
@@ -116,22 +116,30 @@ Page({
...
@@ -116,22 +116,30 @@ Page({
onConfirmHomework
(
event
){
onConfirmHomework
(
event
){
const
{
picker
,
value
,
index
}
=
event
.
detail
;
const
{
picker
,
value
,
index
}
=
event
.
detail
;
console
.
log
(
event
.
detail
);
//根据选中状态,请求下面列表,动态生成列表项
//根据选中状态,请求下面列表,动态生成列表项
app
.
colorUISdk
.
request
({
app
.
colorUISdk
.
request
({
url
:
'
wxcourse/list
'
,
url
:
'
dictionary/listByPar3
'
,
method
:
'
GET
'
,
method
:
'
GET
'
,
data
:
{
data
:
{
a
:
'
xx
'
parentKey
:
value
.
constantKey
}
}
}).
then
(
res
=>
{
}).
then
(
res
=>
{
this
.
setData
({
courseData
:
res
.
data
.
records
})
console
.
log
(
res
);
if
(
res
.
code
==
0
){
let
col
=
res
.
dictionary
.
map
((
a
)
=>
{
return
a
.
fieldKey
;
});
this
.
setData
({
columnsZige
:
col
})
}
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
})
})
this
.
setData
({
this
.
setData
({
[
"
fromDate.homework
"
]:
value
,[
"
popup.homeworkText
"
]:
value
,
[
"
fromDate.homework
"
]:
value
.
text
,[
"
popup.homeworkText
"
]:
value
.
text
,
isShowHomework
:
false
,
isShowHomework
:
false
,
}
}
)
)
},
},
...
@@ -216,28 +224,39 @@ Page({
...
@@ -216,28 +224,39 @@ Page({
this
.
setData
({
this
.
setData
({
[
"
fromDate.price
"
]:
options
.
price
,
[
"
fromDate.price
"
]:
options
.
price
,
phone
:
app
.
phone
,
phone
:
app
.
phone
,
[
"
fromDate.phone
"
]:
app
.
phone
[
"
fromDate.phone
"
]:
app
.
phone
,
})
});
},
//获取课程类型,动态生成列表
app
.
colorUISdk
.
request
({
/**
url
:
'
dictionary/listByPar2
'
,
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
//获取作业类别列表
app
.
colorUISdk
.
request
({
url
:
'
wxcourse/list
'
,
method
:
'
GET
'
,
method
:
'
GET
'
,
data
:
{
data
:
{
a
:
'
xx
'
courseId
:
options
.
id
}
}
}).
then
(
res
=>
{
}).
then
(
res
=>
{
this
.
setData
({
courseData
:
res
.
data
.
records
})
console
.
log
(
res
);
if
(
res
.
code
==
0
){
let
col
=
res
.
dictionary
.
map
((
a
)
=>
{
return
{
text
:
a
.
fieldKey
,
constantKey
:
a
.
constantKey
}
});
this
.
setData
({
columnsHomework
:
col
});
console
.
log
(
this
.
data
.
columnsHomework
)
}
// this.setData({courseData: res.data.records})
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
})
})
},
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
...
...
pages/home/home.js
View file @
e44af9bb
...
@@ -3,8 +3,8 @@ Page({
...
@@ -3,8 +3,8 @@ Page({
data
:
{
data
:
{
diyige
:{
icon
:
'
cicon-avatar
'
,
name
:
'
通信企业协会
'
,
title
:
'
机构介绍
'
},
diyige
:{
icon
:
'
cicon-avatar
'
,
name
:
'
通信企业协会
'
,
title
:
'
机构介绍
'
},
jgDetail
:[
jgDetail
:[
{
icon
:
'
cicon-avatar
'
,
name
:
'
qyDetail
'
,
titl
e
:
'
机构介绍
'
,
params
:{
type
:
'
1
'
,
name
:
'
23
'
}},
{
icon
:
'
cicon-avatar
'
,
remark
:
'
机构的介绍
'
,
courseNam
e
:
'
机构介绍
'
,
params
:{
type
:
'
1
'
,
name
:
'
23
'
}},
{
icon
:
'
cicon-avatar
'
,
name
:
'
qyDetail
'
,
titl
e
:
'
报名指南
'
,
params
:{
type
:
'
0
'
,
name
:
'
23
'
}}
{
icon
:
'
cicon-avatar
'
,
remark
:
'
你不知道的报名指南
'
,
courseNam
e
:
'
报名指南
'
,
params
:{
type
:
'
0
'
,
name
:
'
23
'
}}
],
],
scrollTop
:
0
,
scrollTop
:
0
,
swiperList
:
[
swiperList
:
[
...
@@ -23,7 +23,7 @@ Page({
...
@@ -23,7 +23,7 @@ Page({
navData
:
[{
navData
:
[{
title
:
'
课程报名
'
,
title
:
'
课程报名
'
,
sub
:
[
sub
:
[
{
icon
:
'
cicon-set
'
,
name
:
'
signup
'
,
titl
e
:
'
在线报名
'
,
isTab
:
true
},
{
icon
:
'
cicon-set
'
,
remark
:
'
signup
'
,
courseNam
e
:
'
在线报名
'
,
isTab
:
true
},
// { icon: 'cicon-set', name: 'system', title: '系统' },
// { icon: 'cicon-set', name: 'system', title: '系统' },
// { icon: 'cicon-paint', name: 'theme', title: '主题' },
// { icon: 'cicon-paint', name: 'theme', title: '主题' },
// { icon: 'cicon-topbar', name: 'navbar', title: '导航栏' },
// { icon: 'cicon-topbar', name: 'navbar', title: '导航栏' },
...
@@ -95,15 +95,25 @@ Page({
...
@@ -95,15 +95,25 @@ Page({
},
},
onReady
:
function
()
{
onReady
:
function
()
{
app
.
colorUISdk
.
request
({
app
.
colorUISdk
.
request
({
url
:
'
wx
course/list
'
,
url
:
'
info
course/list
'
,
method
:
'
GET
'
,
method
:
'
GET
'
,
data
:
{
data
:
{}
a
:
'
xx
'
}).
then
(({
data
})
=>
{
if
(
data
.
records
.
length
==
0
){
wx
.
showToast
({
title
:
'
课程列表为空
'
,
icon
:
'
none
'
})
}
else
{
this
.
setData
({
courseData
:
data
.
records
})
}
}
}).
then
(
res
=>
{
this
.
setData
({
courseData
:
res
.
data
.
records
})
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
);
wx
.
showToast
({
title
:
'
网络故障,请稍后再试
'
,
icon
:
'
none
'
})
})
})
}
}
})
})
pages/home/home.wxml
View file @
e44af9bb
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<block wx:for="{{courseData}}" wx:for-index="id" wx:key="course_index">
<block wx:for="{{courseData}}" wx:for-index="id" wx:key="course_index">
<view class="ui-item p-3" >
<view class="ui-item p-3" >
<app-nav-li data="{{item}}" navurl="/pages/document/coursedetails/coursedetails?price={{item.
price}}&name={{item.name}}¬e={{item.note
}}"/>
<app-nav-li data="{{item}}" navurl="/pages/document/coursedetails/coursedetails?price={{item.
cost}}&name={{item.courseName}}¬e={{item.remark}}&id={{item.id
}}"/>
</view>
</view>
</block>
</block>
</view>
</view>
...
...
pages/my/home.js
View file @
e44af9bb
...
@@ -10,9 +10,13 @@ Page({
...
@@ -10,9 +10,13 @@ Page({
// wx.navigateTo({
// wx.navigateTo({
// url: e.currentTarget.dataset.url
// url: e.currentTarget.dataset.url
// })
// })
this
.
setData
({
let
token
=
wx
.
getStorageSync
(
'
token
'
);
show
:
true
if
(
token
==
''
){
})
this
.
setData
({
show
:
true
})
};
},
},
randomWord
(
randomFlag
,
min
,
max
){
randomWord
(
randomFlag
,
min
,
max
){
let
str
=
""
,
let
str
=
""
,
...
@@ -32,21 +36,34 @@ Page({
...
@@ -32,21 +36,34 @@ Page({
//如果返回成功手机号,就随机生成一串字符串存进去
//如果返回成功手机号,就随机生成一串字符串存进去
if
(
e
.
detail
.
code
!==
undefined
){
if
(
e
.
detail
.
code
!==
undefined
){
console
.
log
(
e
.
detail
);
console
.
log
(
e
.
detail
);
// let random = Math.random().toString(36).substr(2);
app
.
colorUISdk
.
request
({
let
random
=
this
.
randomWord
(
false
,
43
);
url
:
`wx/gt?code=
${
e
.
detail
.
code
}
`
,
try
{
method
:
'
POST
'
wx
.
setStorageSync
(
'
token
'
,
random
);
}).
then
(({
data
})
=>
{
Toast
.
success
(
'
登录成功
'
);
console
.
log
(
data
);
this
.
setData
({
if
(
data
.
errcode
==
0
){
show
:
false
,
let
random
=
this
.
randomWord
(
false
,
43
);
title
:
13520051245
// let random = Math.random().toString(36).substr(2);
})
try
{
}
catch
(
e
)
{
wx
.
setStorageSync
(
'
token
'
,
random
+
data
.
phone_info
.
phoneNumber
);
wx
.
showToast
({
app
.
phone
=
data
.
phone_info
.
phoneNumber
;
title
:
'
数据存储失败!
'
,
Toast
.
success
(
'
登录成功
'
);
icon
:
'
none
'
this
.
setData
({
})
show
:
false
,
}
title
:
data
.
phone_info
.
phoneNumber
,
})
}
catch
(
e
)
{
wx
.
showToast
({
title
:
'
数据存储失败!
'
,
icon
:
'
none
'
})
}
}
this
.
setData
({
courseData
:
res
.
data
.
records
})
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
else
{
}
else
{
wx
.
showToast
({
wx
.
showToast
({
title
:
'
授权失败,请您重新登录!
'
,
title
:
'
授权失败,请您重新登录!
'
,
...
...
pages/signup/signup.js
View file @
e44af9bb
...
@@ -64,17 +64,26 @@ Page({
...
@@ -64,17 +64,26 @@ Page({
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
app
.
colorUISdk
.
request
({
app
.
colorUISdk
.
request
({
url
:
'
wx
course/list
'
,
url
:
'
info
course/list
'
,
method
:
'
GET
'
,
method
:
'
GET
'
,
data
:
{
data
:
{}
a
:
'
xx
'
}).
then
(({
data
})
=>
{
if
(
data
.
records
.
length
==
0
){
wx
.
showToast
({
title
:
'
课程列表为空
'
,
icon
:
'
none
'
})
}
else
{
this
.
setData
({
courseData
:
data
.
records
})
}
}
}).
then
(
res
=>
{
this
.
setData
({
courseData
:
res
.
data
.
records
});
console
.
log
(
res
.
data
.
records
)
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
);
});
wx
.
showToast
({
title
:
'
网络故障,请稍后再试
'
,
icon
:
'
none
'
})
})
app
.
information
=
{};
app
.
information
=
{};
},
},
...
...
pages/signup/signup.wxml
View file @
e44af9bb
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<view class="ui-grid ui-cols-2">
<view class="ui-grid ui-cols-2">
<block wx:for="{{courseData}}" wx:for-index="id" wx:key="course_index">
<block wx:for="{{courseData}}" wx:for-index="id" wx:key="course_index">
<view class="ui-item p-3">
<view class="ui-item p-3">
<app-nav-li data="{{item}}" navurl="/pages/document/subsign/subsign?price={{item.
price}}&name={{item.name
}}"/>
<app-nav-li data="{{item}}" navurl="/pages/document/subsign/subsign?price={{item.
cost}}&name={{item.courseName}}&id={{item.id
}}"/>
</view>
</view>
</block>
</block>
</view>
</view>
...
...
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