Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
a2b32744
提交
a2b32744
authored
9月 26, 2019
作者:
何喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加我要提问
上级
0c3096ea
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
330 行增加
和
3 行删除
+330
-3
app.json
learnOnline/app.json
+1
-0
my.js
learnOnline/pages/learnSystem/my/my.js
+6
-0
my.wxml
learnOnline/pages/learnSystem/my/my.wxml
+3
-3
question.js
learnOnline/pages/learnSystem/question/question.js
+170
-0
question.json
learnOnline/pages/learnSystem/question/question.json
+4
-0
question.wxml
learnOnline/pages/learnSystem/question/question.wxml
+32
-0
question.wxss
learnOnline/pages/learnSystem/question/question.wxss
+100
-0
util.js
learnOnline/utils/util.js
+14
-0
没有找到文件。
learnOnline/app.json
浏览文件 @
a2b32744
{
{
"pages"
:
[
"pages"
:
[
"pages/index/index"
,
"pages/index/index"
,
"pages/learnSystem/question/question"
,
"pages/outSite/outSite"
,
"pages/outSite/outSite"
,
"pages/videoPlayer/show"
,
"pages/videoPlayer/show"
,
"pages/learnSystem/home/home"
,
"pages/learnSystem/home/home"
,
...
...
learnOnline/pages/learnSystem/my/my.js
浏览文件 @
a2b32744
...
@@ -11,6 +11,12 @@ Page({
...
@@ -11,6 +11,12 @@ Page({
goMyDiscuss
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/learnSystem/myDiscuss/myDiscuss'
})
},
goMyDiscuss
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/learnSystem/myDiscuss/myDiscuss'
})
},
/* 我的学分 */
/* 我的学分 */
goMyScore
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/learnSystem/myScore/myScore'
})
},
goMyScore
:
function
()
{
wx
.
navigateTo
({
url
:
'/pages/learnSystem/myScore/myScore'
})
},
// 我要提问
question
:
function
(){
wx
.
navigateTo
({
url
:
'/pages/learnSystem/question/question'
})
},
/* 退出系统 */
/* 退出系统 */
outSystem
:
function
()
{
outSystem
:
function
()
{
...
...
learnOnline/pages/learnSystem/my/my.wxml
浏览文件 @
a2b32744
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
<image class='img' src='../icons/my/out-system.png' mode='aspectFit'></image>
<image class='img' src='../icons/my/out-system.png' mode='aspectFit'></image>
<view class='text'>退出系统</view>
<view class='text'>退出系统</view>
</view>
</view>
<view class='item'>
<view class='item'
bindtap='question'
>
<image class='img' src='../icons/my/my-
waiting
.png' mode='aspectFit'></image>
<image class='img' src='../icons/my/my-
discuss
.png' mode='aspectFit'></image>
<view class='text'>
敬请期待
</view>
<view class='text'>
我要提问
</view>
</view>
</view>
</view>
</view>
<!-- 增加 关联公众号组件 - 模拟器上不显示,真机没问题 -->
<!-- 增加 关联公众号组件 - 模拟器上不显示,真机没问题 -->
...
...
learnOnline/pages/learnSystem/question/question.js
0 → 100644
浏览文件 @
a2b32744
// pages/learnSystem/question/question.js
const
util
=
require
(
'../../../utils/util.js'
)
Page
({
/**
* 页面的初始数据
*/
data
:
{
title
:
''
,
contents
:
''
,
type_id
:
''
,
list
:[
{
name
:
'全部'
,
value
:
'0'
},
{
name
:
'教务'
,
value
:
'1'
},
{
name
:
'技术'
,
value
:
'2'
},
],
objUrl
:
{},
imgUrl
:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
// 标题输入
titleInput
:
function
(
e
){
this
.
setData
({
title
:
e
.
detail
.
value
})
},
// 内容输入
contentsInput
:
function
(
e
){
this
.
setData
({
contents
:
e
.
detail
.
value
})
},
// 问题类型
radioChange
:
function
(
e
)
{
this
.
setData
({
type_id
:
e
.
detail
.
value
})
},
// 选择图片
chooseFile
:
function
(){
const
that
=
this
;
wx
.
chooseImage
({
count
:
9
,
sizeType
:
[
'original'
,
'compressed'
],
sourceType
:
[
'album'
,
'camera'
],
success
(
res
)
{
// tempFilePath可以作为img标签的src属性显示图片
const
tempFiles
=
res
.
tempFiles
;
let
obj
=
{};
for
(
let
i
=
0
;
i
<
tempFiles
.
length
;
i
++
){
obj
[
tempFiles
[
i
].
path
]
=
tempFiles
[
i
].
size
;
}
let
_objUrl
=
that
.
data
.
objUrl
;
Object
.
assign
(
_objUrl
,
obj
);
console
.
log
(
'res'
,
Object
.
keys
(
_objUrl
));
that
.
setData
({
imgUrl
:
Object
.
keys
(
_objUrl
),
objUrl
:
_objUrl
})
}
})
},
// 删除照片
deleteImg
:
function
(
e
){
let
_url
=
e
.
target
.
dataset
.
url
;
let
_objUrl
=
this
.
data
.
objUrl
;
delete
_objUrl
[
_url
]
this
.
setData
({
imgUrl
:
Object
.
keys
(
_objUrl
),
objUrl
:
_objUrl
})
},
// 上传数据
submit
:
function
(){
if
(
!
this
.
data
.
title
){
util
.
showTips
({
title
:
'请输入标题'
})
return
;
}
if
(
!
this
.
data
.
contents
){
util
.
showTips
({
title
:
'请输入详细描述'
})
return
;
}
if
(
!
this
.
data
.
type_id
){
util
.
showTips
({
title
:
'请选择问题类型'
})
return
;
}
const
that
=
this
;
util
.
requestApi
({
url
:
util
.
config
.
URL_PATH1
+
'/v2/feedback/commit'
,
data
:
{
title
:
that
.
data
.
title
,
contents
:
that
.
data
.
contents
,
type_id
:
that
.
data
.
type_id
,
attachments
:
JSON
.
stringify
([{
name
:
''
,
url
:
''
}])
},
method
:
'POST'
,
callback
:
function
(
res
)
{
util
.
showTips
({
title
:
'提交成功'
,
icon
:
'success'
,
duration
:
3000
})
that
.
setData
({
title
:
''
,
contents
:
''
,
type_id
:
''
})
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
}
})
\ No newline at end of file
learnOnline/pages/learnSystem/question/question.json
0 → 100644
浏览文件 @
a2b32744
{
"usingComponents"
:
{}
}
\ No newline at end of file
learnOnline/pages/learnSystem/question/question.wxml
0 → 100644
浏览文件 @
a2b32744
<!--pages/learnSystem/question/question.wxml-->
<!-- 我要提问页面 -->
<view >
<view class="form-input">
<view class="title">标题</view>
<input class="input" value="{{title}}" type="text" maxlength="25" cursor-spacing="10" focus="true" placeholder="请输入标题" placeholder-class="input-placeholder" bindinput="titleInput"/>
</view>
<view class="list">
<textarea placeholder="详细描述" placeholder-class="input-placeholder" value="{{contents}}" bindinput="contentsInput" />
</view>
<view class="form-input">
<view class="title">问题类型</view>
<radio-group class="input " bindchange="radioChange">
<label class="radio-list" wx:for="{{list}}" wx:for-item="item" wx:key="{{item.value}}">
<radio value="{{item.value}}" /><text >{{item.name}}</text>
</label>
</radio-group>
</view>
<!-- <view class="form-file"> -->
<!-- <view class="input-file preview" wx:for="{{imgUrl}}" wx:for-item="item" wx:key="{{item}}">
<view class="delete" bindtap="deleteImg"><icon type="cancel" size="23" data-url="{{item}}"/></view>
<image mode="aspectFit" src="{{item}}"/>
</view>
<view class="input-file upload" bindtap="chooseFile">
<view class="input-placeholder title">上传图片(可选)</view>
<view class="icon">+</view>
</view>
</view> -->
<button class="submit" type="primary" bindtap="submit">提交</button>
</view>
learnOnline/pages/learnSystem/question/question.wxss
0 → 100644
浏览文件 @
a2b32744
/* pages/learnSystem/question/question.wxss */
page{
background-color: rgba(178, 178, 178, .1);
}
.form-input{
width: 750rpx;
height: 88rpx;
position: relative;
font-size: 34rpx;
line-height: 88rpx;
margin-top: 40rpx;
background-color: #fff;
}
.form-input .title{
position: absolute;
left: 30rpx;
top: 0;
height: 88rpx;
width: 140rpx;
line-height: 88rpx;
}
.form-input .input{
padding-left: 170rpx;
line-height: 88rpx;
height: 88rpx;
background-color: #fff;
font-size: 34rpx;
}
.form-input radio-group.input{
padding-left: 190rpx;
}
.form-input .radio-list{
width: 170rpx;
display: inline-block;
}
.form-input .radio-list radio{
transform: scale(.5);
}
.list{
margin-top: 40rpx;
background-color: #fff;
padding: 12rpx 30rpx;
width: 690rpx;
}
.input-placeholder{
font-size: 30rpx;
}
.form-file{
margin: 30rpx 30rpx 100rpx;
width: 750rpx;
overflow: hidden;
}
.form-file .title{
text-align: center;
}
.input-file{
width: 200rpx;
height: 200rpx;
float: left;
margin-top: 20rpx;
}
/* .input-file:first-child{
margin-left: 30rpx;
} */
.form-file .input-file .title{
margin-top: 40rpx;
font-size: 26rpx;
}
.form-file .icon{
font-size: 120rpx;
text-align: center;
font-weight: 500;
line-height: .5;
color: #b2b2b2;
}
.preview{
margin-right: 20rpx;
position: relative;
}
.preview .delete{
position: absolute;
right: -10rpx;
top: -10rpx;
}
.preview image{
display: block;
width: 200rpx;
height: 200rpx;
background-color: #fff;
}
.input-file.upload{
background-color: #fff;
}
.submit{
display: block;
margin: 100rpx auto;
width: 680rpx;
}
\ No newline at end of file
learnOnline/utils/util.js
浏览文件 @
a2b32744
...
@@ -230,6 +230,19 @@ const sendformid = (formId) => {
...
@@ -230,6 +230,19 @@ const sendformid = (formId) => {
})
})
}
}
// 消息提示
const
showTips
=
(
obj
)
=>
{
wx
.
showToast
({
title
:
obj
.
title
,
icon
:
obj
.
icon
||
'none'
,
image
:
obj
.
image
||
''
,
duration
:
obj
.
duration
||
2000
,
mask
:
false
,
success
:
(
result
)
=>
{},
fail
:
()
=>
{},
complete
:
()
=>
{}
});
}
/**
/**
* localStorage 中存放的 各种值
* localStorage 中存放的 各种值
* userSession - 调用 login 获取对应的 sessionKey openId等值
* userSession - 调用 login 获取对应的 sessionKey openId等值
...
@@ -244,5 +257,6 @@ module.exports = {
...
@@ -244,5 +257,6 @@ module.exports = {
requestApi
:
requestApi
,
requestApi
:
requestApi
,
durationToTimeString
:
durationToTimeString
,
durationToTimeString
:
durationToTimeString
,
sendformid
:
sendformid
,
sendformid
:
sendformid
,
showTips
:
showTips
,
LoginAgainAndJumpPage
:
LoginAgainAndJumpPage
LoginAgainAndJumpPage
:
LoginAgainAndJumpPage
};
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论