Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
Project
Project
Details
Activity
Releases
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
向伟
educationStu
Commits
769055e2
Commit
769055e2
authored
Sep 18, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
23f75e16
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
212 additions
and
28 deletions
+212
-28
index.js
src/api/index.js
+24
-0
learningGardenDetails.vue
src/pages/learningGarden/learningGardenDetails.vue
+82
-2
learningGardenList.vue
src/pages/learningGarden/learningGardenList.vue
+104
-24
request.js
src/utils/request.js
+2
-2
No files found.
src/api/index.js
View file @
769055e2
...
@@ -128,4 +128,28 @@ export function getEduReceiptInfo(data) {
...
@@ -128,4 +128,28 @@ export function getEduReceiptInfo(data) {
method
:
'post'
,
method
:
'post'
,
data
data
})
})
}
/**
* 学习园地列表
* @param {JSON参数} data
*/
export
function
getLearningGardenList
(
data
)
{
return
request
({
url
:
"/AppletIndex/GeLearningGardenPage"
,
method
:
'post'
,
data
})
}
/**
* 学习园地详情
* @param {JSON参数} data
*/
export
function
getLearningGardenDetail
(
data
)
{
return
request
({
url
:
"/AppletIndex/GetLearningGarden"
,
method
:
'post'
,
data
})
}
}
\ No newline at end of file
src/pages/learningGarden/learningGardenDetails.vue
View file @
769055e2
<
template
>
<
template
>
<view
class=
""
>
<view
class=
""
>
<van-toast
id=
"van-toast"
/>
<van-toast
id=
"van-toast"
/>
<view
class=
"detail-con"
>
<view
class=
"title"
>
{{
detailData
.
Title
}}
</view>
<view
class=
"info flex flex_start_center"
>
<image
class=
"headimg"
:src=
"detailData.Ico ? detailData.Ico : logo"
/>
<view
class=
"createname"
>
{{
detailData
.
CreateByName
}}
</view>
<view
class=
"time"
>
{{
detailData
.
CreateTime
}}
</view>
</view>
<view
v-html=
"richtext"
></view>
</view>
<!--
<web-view
:src=
"detailData.LinkUrl"
></web-view>
-->
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
reactive
,
toRefs
,
getCurrentInstance
,
onMounted
}
from
"vue"
;
import
{
reactive
,
toRefs
,
getCurrentInstance
,
onMounted
}
from
"vue"
;
import
{
getLearningGardenDetail
}
from
"../../api/index"
;
export
default
{
export
default
{
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
let
data
=
reactive
({
let
data
=
reactive
({
Account
:
""
,
logo
:
"http://staticfile.oytour.com/new/upload/edu/logo.png"
,
Password
:
""
,
pageTitle
:
"日语学习园地"
,
msg
:
{
Id
:
0
,
},
richtext
:
""
,
detailData
:
{},
});
});
let
methods
=
{
let
methods
=
{
back
()
{
back
()
{
...
@@ -21,6 +37,27 @@ export default {
...
@@ -21,6 +37,27 @@ export default {
url
:
"/pages/index/index"
,
url
:
"/pages/index/index"
,
});
});
},
},
async
getData
()
{
let
res
=
await
getLearningGardenDetail
(
data
.
msg
);
if
(
res
)
{
data
.
detailData
=
res
.
Data
;
let
tempRichtext
=
""
;
tempRichtext
=
data
.
detailData
.
Content
.
replace
(
/<img
[^
>
]
*data-src=
[
'"
]([^
'"
]
+
)[^
>
]
*>/gi
,
(
match
,
capture
)
=>
{
match
=
match
.
replace
(
/data-src/gi
,
"src"
);
match
=
match
.
replace
(
/style=
\"(
.*
)\"
/gi
,
'style="max-width:100% !important"'
);
return
match
;
}
);
data
.
richtext
=
tempRichtext
;
console
.
log
(
45
,
data
.
richtext
);
}
},
getDateStr
(
date
)
{},
};
};
onMounted
(()
=>
{});
onMounted
(()
=>
{});
let
that
=
methods
;
let
that
=
methods
;
...
@@ -29,8 +66,51 @@ export default {
...
@@ -29,8 +66,51 @@ export default {
...
methods
,
...
methods
,
};
};
},
},
onLoad
(
options
)
{
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
this
.
msg
.
Id
=
options
.
Id
;
this
.
getData
();
},
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.detail-con
{
box-sizing
:
border-box
;
padding
:
15
rpx
30
rpx
;
height
:
100vh
;
overflow-y
:
auto
;
}
.title
{
font-size
:
36
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#111111
;
margin
:
15
rpx
0
;
}
.info
{
margin
:
15
rpx
0
;
}
.headimg
{
width
:
40
rpx
;
height
:
40
rpx
;
border-radius
:
50%
;
box-shadow
:
0
rpx
10
rpx
30
rpx
0
rpx
rgba
(
36
,
36
,
36
,
0.2
);
margin-right
:
15
rpx
;
}
.createname
{
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#111111
;
margin-right
:
30
rpx
;
}
.time
{
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#999999
;
}
</
style
>
</
style
>
src/pages/learningGarden/learningGardenList.vue
View file @
769055e2
<
template
>
<
template
>
<view
class=
""
>
<view
class=
""
>
<van-toast
id=
"van-toast"
/>
<van-toast
id=
"van-toast"
/>
<view
class=
"dataList"
>
<view
class=
"list-con"
>
<view
<van-empty
description=
"暂无数据"
v-if=
"dataList.length === 0"
/>
v-for=
"(item, index) in dataList"
<scroll-view
:key=
"index"
:scroll-top=
"0"
class=
"dataList-item"
scroll-y=
"true"
class=
"scroll-box"
@
scrolltolower=
"lower"
v-if=
"dataList.length > 0"
>
>
<view
class=
"left"
>
</view>
<view
<view
class=
"right one_line"
>
v-for=
"(item, index) in dataList"
<view>
{{
item
.
title
}}
</view>
:key=
"index"
<view>
{{
item
.
desc
}}
</view>
class=
"list-item flex flex_between_center"
@
click=
"jumpPage(item.Id)"
>
<image
class=
"left"
:src=
"item.Img"
></image>
<view
class=
"right"
>
<view
class=
"one_line title"
>
{{
item
.
Title
}}
</view>
<view
class=
"one_line digest"
>
{{
item
.
Digest
}}
</view>
</view>
</view>
</view>
</view>
<Loadmore
:state=
"pageState"
/>
</scroll-view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
reactive
,
toRefs
,
getCurrentInstance
,
onMounted
}
from
"vue"
;
import
{
reactive
,
toRefs
,
getCurrentInstance
,
onMounted
}
from
"vue"
;
import
{
getLearningGardenList
}
from
"../../api/index"
;
import
Loadmore
from
"../../components/loadmore.vue"
;
export
default
{
export
default
{
components
:
{
Loadmore
,
},
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
let
data
=
reactive
({
let
data
=
reactive
({
pageTitle
:
"学习园地"
,
pageTitle
:
"日语学习园地"
,
dataList
:
[
msg
:
{
{
PageIndex
:
1
,
img
:
""
,
PageSize
:
10
,
title
:
"日语学习园地的课程名称"
,
rowsPerPage
:
10
,
desc
:
"课程的一些小简介课程的一些小简介课..."
,
Title
:
""
,
},
},
],
dataList
:
[],
pageState
:
"more"
,
pageCount
:
0
,
});
});
let
methods
=
{
let
methods
=
{
back
()
{
back
()
{
uni
.
navigateBack
();
uni
.
navigateBack
();
},
},
jumpPage
()
{
jumpPage
(
id
)
{
uni
.
reLaunch
({
uni
.
navigateTo
({
url
:
"/pages/
index/index"
,
url
:
"/pages/
learningGarden/learningGardenDetails?Id="
+
id
,
});
});
},
},
async
getList
()
{
let
res
=
await
getLearningGardenList
(
data
.
msg
);
if
(
res
)
{
if
(
data
.
msg
.
PageIndex
===
1
)
{
data
.
dataList
=
res
.
Data
.
PageData
;
}
else
{
data
.
dataList
=
[...
res
.
Data
.
PageData
,
...
data
.
dataList
];
}
data
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
data
.
msg
.
pageIndex
>=
res
.
Data
.
PageCount
)
{
data
.
pageState
=
"none"
;
}
else
{
data
.
pageState
=
"more"
;
}
}
},
lower
(
e
)
{
if
(
data
.
msg
.
pageIndex
<
data
.
PageCount
)
{
data
.
pageState
=
"loading"
;
data
.
msg
.
pageIndex
++
;
that
.
getList
();
}
else
{
data
.
pageState
=
"none"
;
}
},
};
};
onMounted
(()
=>
{});
onMounted
(()
=>
{
that
.
getList
();
});
let
that
=
methods
;
let
that
=
methods
;
return
{
return
{
...
toRefs
(
data
),
...
toRefs
(
data
),
...
@@ -50,13 +95,48 @@ export default {
...
@@ -50,13 +95,48 @@ export default {
},
},
onLoad
()
{
onLoad
()
{
uni
.
setNavigationBarTitle
({
uni
.
setNavigationBarTitle
({
title
:
"日语学习园地"
,
title
:
this
.
pageTitle
,
});
});
},
},
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.dataList-item
{
.list-con
{
height
:
calc
(
100vh
-
20
rpx
);
box-sizing
:
border-box
;
padding
:
15
rpx
30
rpx
;
margin-top
:
10
rpx
;
}
.scroll-box
{
height
:
100%
;
width
:
100%
;
}
.list-item
{
margin
:
20
rpx
0
;
}
.left
{
width
:
220
rpx
;
height
:
120
rpx
;
border-radius
:
20
rpx
;
box-shadow
:
0
rpx
10
rpx
30
rpx
0
rpx
rgba
(
36
,
36
,
36
,
0.2
);
}
.right
{
width
:
440
rpx
;
height
:
120
rpx
;
}
.right
.title
{
font-size
:
30
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#111111
;
line-height
:
70
rpx
;
}
.right
.digest
{
font-size
:
24
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#999999
;
line-height
:
30
rpx
;
}
}
</
style
>
</
style
>
src/utils/request.js
View file @
769055e2
//请求教育接口
//请求教育接口
let
host
=
''
let
host
=
''
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
//
host = 'http://192.168.20.17:8017/api'
host
=
'http://192.168.20.17:8017/api'
host
=
'http://192.168.20.24:8300/api'
//
host = 'http://192.168.20.24:8300/api'
}
else
{
}
else
{
host
=
'https://eduapi.oytour.com/api'
host
=
'https://eduapi.oytour.com/api'
}
}
...
...
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