Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nyx
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
发现
nyx
Commits
70def8c0
Commit
70def8c0
authored
Aug 14, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp, 主流程
1. 为竞答创建新的问题。
parent
6d602742
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
128 行增加
和
53 行删除
+128
-53
增值产品-小程序及app/nyx-master/app.json
+2
-2
增值产品-小程序及app/nyx-master/pages/member/quiz-post/quiz-edit/quiz-edit.js
+82
-25
增值产品-小程序及app/nyx-master/pages/member/quiz-post/quiz-edit/quiz-edit.wxml
+29
-23
增值产品-小程序及app/nyx-master/pages/member/quiz-post/quiz-edit/quiz-edit.wxss
+15
-3
没有找到文件。
增值产品-小程序及app/nyx-master/app.json
查看文件 @
70def8c0
{
{
...
...
@@ -4,7 +4,7 @@
"pages/my/my-members/my-members"
,
"pages/member/activity-post/activity-submit/activity-submit"
,
"pages/member/activity-post/activity-edit/activity-edit"
,
"pages/member/quiz-post/quiz-edit/quiz-edit"
,
"pages/member/quiz-post/quiz-edit/quiz-edit"
,
"pages/mall/order/order"
,
"pages/member/schedule/schedule"
,
"pages/member/activity-post/activity-post"
,
...
...
增值产品-小程序及app/nyx-master/pages/member/quiz-post/quiz-edit/quiz-edit.js
查看文件 @
70def8c0
// pa
ges/member/quiz-post/quiz-edit/quiz-edit.js
// pa
ges/member/quiz-post/quiz-edit/quiz-edit.js
...
...
@@ -8,17 +8,7 @@ var util = require('./../../../../utils/util.js')
Page
({
data
:
{
quizInfo
:
{
questionId
:
"qid_001"
,
questionName
:
"今天一起去看流星雨"
,
answer
:
"2"
,
choiceString
:
[
"仙女座"
,
"英仙座"
,
"猎户座"
,
"狮子座"
,
]
},
quizList
:
[],
//阿里云 OSS相关参数
accessid
:
""
,
...
...
@@ -33,16 +23,48 @@ Page({
onLoad
:
function
()
{
var
that
=
this
;
var
_this
=
this
;
wx
.
getSystemInfo
({
success
:
function
(
res
)
{
var
a
=
res
.
windowHeight
;
that
.
setData
({
_this
.
setData
({
scrollTop
:
a
-
200
})
}
})
var
quizInfo_1
=
{
questionId
:
"qid_001"
,
questionName
:
"叁年间2020年最受欢迎的活动是?"
,
answer
:
"B"
,
choiceString
:
[
"Tunight盲品活动"
,
"'奥地利'「月选酒」套装, 一天不到700支"
,
"周年庆,烧烤海鲜自助"
,
"Royi·叁年间的酒市集"
,
]
}
var
quizInfo_2
=
{
questionId
:
"qid_001"
,
questionName
:
"与勃艮第( Burgundy)的黑比诺( Pinot Noir )相比,新西兰的黑比诺葡萄酒具有什么特点? "
,
answer
:
"D"
,
choiceString
:
[
"酸度更高,酒体更饱满"
,
"酸度较低,酒体更饱满"
,
"果香更加浓郁"
,
"B 和 C "
,
]
}
var
quizList
=
[]
quizList
.
push
(
quizInfo_1
)
quizList
.
push
(
quizInfo_2
)
_this
.
setData
({
quizList
:
quizList
})
},
onReady
:
function
(
e
)
{
var
_this
=
this
;
...
...
@@ -77,24 +99,27 @@ Page({
app
.
globalData
.
postData
.
photoTag
=
e
.
detail
.
value
},
addList
:
function
(){
addList
:
function
(
e
){
var
_this
=
this
;
var
quizInfo
=
_this
.
data
.
quizInfo
;
var
newData
=
"白羊座"
;
quizInfo
.
choiceString
.
push
(
newData
);
//实质是添加lists数组内容,使for循环多一次
var
dataId
=
e
.
currentTarget
.
dataset
.
id
var
quizList
=
_this
.
data
.
quizList
;
var
newData
=
"索诺玛( Sonoma)"
;
quizList
[
dataId
].
choiceString
.
push
(
newData
);
//实质是添加lists数组内容,使for循环多一次
this
.
setData
({
quiz
Info
:
quizInfo
,
quiz
List
:
quizList
,
})
},
delList
:
function
(
e
)
{
var
_this
=
this
;
var
dataId
=
e
.
currentTarget
.
dataset
.
id
var
quizInfo
=
_this
.
data
.
quizInfo
;
quizInfo
.
choiceString
.
splice
(
dataId
,
1
);
var
idxId
=
e
.
currentTarget
.
id
;
var
subId
=
e
.
currentTarget
.
dataset
.
id
var
quizList
=
_this
.
data
.
quizList
;
quizList
[
idxId
].
choiceString
.
splice
(
subId
,
1
);;
//实质是添加lists数组内容,使for循环多一次
this
.
setData
({
quizInfo
:
quizInfo
,
})
quizList
:
quizList
,
})
},
switchTab
()
{
...
...
@@ -106,6 +131,38 @@ Page({
});
},
addMore
:
function
(){
var
_this
=
this
;
var
quizList
=
_this
.
data
.
quizList
;
var
quizInfo
=
{
questionName
:
"新西兰的优质黑比诺( Pinot Noir )产区有?"
,
answer
:
""
,
choiceString
:
[
"中奥塔哥( Central Otago )"
,
]
}
quizList
.
push
(
quizInfo
);
//实质是添加lists数组内容,使for循环多一次
this
.
setData
({
quizList
:
quizList
,
})
},
// start of aliyun oss
// Date Flow
// 提交oss和数据库
...
...
增值产品-小程序及app/nyx-master/pages/member/quiz-post/quiz-edit/quiz-edit.wxml
查看文件 @
70def8c0
<!--
/page/member/quiz-post/quiz-edit/quiz-edit 添加分类的标签,以及自定义标签 -->
<!--
/page/member/quiz-post/quiz-edit/quiz-edit 添加分类的标签,以及自定义标签 -->
...
...
@@ -24,21 +24,35 @@
</view>
</view>
<view class="weui-cells__title">#添加
题目
</view>
<view class="weui-cells__title">#添加
问题
</view>
<block wx:for="{{quizList}}" wx:for-item="quizInfo" wx:for-index="idx" wx:key="{{idx}}">
<view class='table'>
<!-- 题目所在行 -->
<view class='table_header'>
<view class="th-question" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>问题{{idx+1}}</view>
</view>
<view class='th-question' style='width:70%;'>
<view class="table_Text_class">{{quizInfo.questionName}}</view>
</view>
<view class="th-question" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>
</view>
</view>
</view>
<!-- 答案所在行 -->
<view class='table_header'>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>
问题
</view>
<view class='centerclass cell_label'>
答案
</view>
</view>
<view class='th' style='width:70%;'>
<view class="cell_label centerclass">{{quizInfo.
questionName
}}</view>
<view class="cell_label centerclass">{{quizInfo.
answer
}}</view>
</view>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>
<view class='centerclass cell_label'>
</view>
</view>
</view>
...
...
@@ -60,7 +74,7 @@
<!-- start 删除新行按钮 -->
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label' bindtap='delList' data-id="{{index}}">
<view class='centerclass cell_label' bindtap='delList'
id="{{idx}}"
data-id="{{index}}">
<image src="../../../../icon/del.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
</view>
...
...
@@ -71,29 +85,20 @@
<!-- start 添加新行按钮 -->
<view class='table_header'>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label' bindtap='addList'>
<view class='centerclass cell_label' bindtap='addList'
data-id="{{idx}}"
>
<image src="../../../../icon/add.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
</view>
</view>
<!-- end 添加新行按钮 -->
</view>
<!-- 答案所在行 -->
<view class='table_header'>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>答案</view>
</view>
<view class='th' style='width:70%;'>
<view class="cell_label centerclass">{{quizInfo.answer}}</view>
</view>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>
</view>
</view>
</view>
<view class="weui-cells__title"></view>
</block>
</view>
<block>
<button type="default" bindtap="addMore">新增一题</button>
</block>
</view>
\ No newline at end of file
增值产品-小程序及app/nyx-master/pages/member/quiz-post/quiz-edit/quiz-edit.wxss
查看文件 @
70def8c0
page{
page{
...
...
@@ -31,6 +31,19 @@ page{
display: inline-flex;
}
.th-question {
display: flex;
flex-direction: column;
width: 70%;
height: 140rpx;
background: rgba(241, 252, 255, 1);
border-right: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
justify-content: center;
align-items: center;
overflow-x: auto;
}
.th {
display: flex;
flex-direction: column;
...
...
@@ -78,10 +91,9 @@ page{
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgb
a(55, 134, 244, 1
);
color: rgb
(152, 18, 8
);
width: 100%;
word-break: normal;
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
}
.table_Text_last_class{
display: flex;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论