diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..514e032 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/uni_modules/ diff --git a/App.vue b/App.vue index 99f6e28..36ae508 100644 --- a/App.vue +++ b/App.vue @@ -12,6 +12,9 @@ } - diff --git a/manifest.json b/manifest.json index e4ff80b..a0f0664 100644 --- a/manifest.json +++ b/manifest.json @@ -1,72 +1,72 @@ -{ - "name" : "word-pratice", - "appid" : "__UNI__7D81F71", - "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", - "transformPx" : false, - /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 - }, - /* 模块配置 */ - "modules" : {}, - /* 应用发布信息 */ - "distribute" : { - /* android打包配置 */ - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - /* ios打包配置 */ - "ios" : {}, - /* SDK配置 */ - "sdkConfigs" : {} - } - }, - /* 快应用特有相关 */ - "quickapp" : {}, - /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "", - "setting" : { - "urlCheck" : false - }, - "usingComponents" : true - }, - "mp-alipay" : { - "usingComponents" : true - }, - "mp-baidu" : { - "usingComponents" : true - }, - "mp-toutiao" : { - "usingComponents" : true - }, - "uniStatistics" : { - "enable" : false - }, - "vueVersion" : "2" -} +{ + "name" : "word-pratice", + "appid" : "__UNI__7D81F71", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : {}, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios" : {}, + /* SDK配置 */ + "sdkConfigs" : {} + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "", + "setting" : { + "urlCheck" : false + }, + "usingComponents" : true + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "2" +} diff --git a/pages.json b/pages.json index b85d12b..e2cdd65 100644 --- a/pages.json +++ b/pages.json @@ -3,7 +3,7 @@ { "path": "pages/home/index", "style": { - "navigationBarTitleText": "单词学习APP" + "navigationBarTitleText": "单词学习宝典" } } ,{ @@ -14,7 +14,17 @@ "enablePullDownRefresh": false } - } + }, + { + "path":"pages/answer-detail/answer-detail", + "style" : + { + "navigationBarTitleText": "请选择单词正确的中文含义", + "enablePullDownRefresh": false, + "backgroundColor":"#f6f8fa", + "navigationBarBackgroundColor":"#FFFFFF" + } + } ], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/pages/answer-detail/answer-detail.vue b/pages/answer-detail/answer-detail.vue new file mode 100644 index 0000000..b762cb7 --- /dev/null +++ b/pages/answer-detail/answer-detail.vue @@ -0,0 +1,272 @@ + + + + + diff --git a/pages/home/index.vue b/pages/home/index.vue index 692b64e..ac3c333 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -1,8 +1,9 @@ @@ -11,42 +12,73 @@ export default { data() { return { - title: '测试提交成功' + wordDivArray:[{ + id:'1', + text:'一级词汇难度' + },{ + id:'2', + text:'二级词汇难度' + },{ + id:'3', + text:'三级词汇难度' + },{ + id:'4', + text:'四级词汇难度' + },{ + id:'5', + text:'五级词汇难度' + },{ + id:'6', + text:'六级词汇难度' + },{ + id:'7', + text:'七级词汇难度' + }] } }, onLoad() { }, methods: { - + navgateToAnswer(id){ + uni.navigateTo({ + url:"../answer-detail/answer-detail?wordId="+id, + }) + // console.log('触发') + } } } - diff --git a/pages/recitation/index.vue b/pages/recitation/index.vue index 8183fd0..2e676dd 100644 --- a/pages/recitation/index.vue +++ b/pages/recitation/index.vue @@ -1,22 +1,22 @@ - - - - - + + + + + diff --git a/uniCloud-aliyun/cloudfunctions/createQuestionItem/index.js b/uniCloud-aliyun/cloudfunctions/createQuestionItem/index.js new file mode 100644 index 0000000..2eaeee1 --- /dev/null +++ b/uniCloud-aliyun/cloudfunctions/createQuestionItem/index.js @@ -0,0 +1,40 @@ +'use strict'; +const db = uniCloud.database(); +exports.main = async (event, context) => { + // 创建数据库 + const collection = db.collection('questionList'); + // 添加示例数据 + const res = await collection.add({ + "wordData": { + "level": 1, + "wordName": "apple", + "phonetic": "abdc", + "pronunciation": "url:xx", + "options": [ + { + "itemId": "A", + "itemContent": "苹果", + "right": true + }, + { + "itemId": "B", + "itemContent": "香蕉" + }, + { + "itemId": "C", + "itemContent": "橙子" + }, + { + "itemId": "D", + "itemContent": "柠檬" + } + ] + } +}) + //event为客户端上传的参数 + event = '测试数据' + console.log('后端接口测试数据 : ', event) + + //返回数据给客户端 + return event +}; diff --git a/uniCloud-aliyun/cloudfunctions/provideQuestion/index.js b/uniCloud-aliyun/cloudfunctions/provideQuestion/index.js new file mode 100644 index 0000000..377755d --- /dev/null +++ b/uniCloud-aliyun/cloudfunctions/provideQuestion/index.js @@ -0,0 +1,22 @@ +'use strict'; +const db = uniCloud.database(); +exports.main = async (event, context) => { + //event为客户端上传的参数 + // const count = await db.collection('questionList').count() + // 根据level字段返回不同的数据 + let res = await db.collection('questionList').where({ + wordData:{ + level:event.level + } + }).limit(1).get() + let data = res.data + console.log('入参:页码+难度', event,res) + + // let res + //返回数据给客户端 + return { + code: 200, + msg: 'success', + data + } +}; diff --git a/uniCloud-aliyun/database/JQL查询.jql b/uniCloud-aliyun/database/JQL查询.jql index 465356a..539336f 100644 --- a/uniCloud-aliyun/database/JQL查询.jql +++ b/uniCloud-aliyun/database/JQL查询.jql @@ -1,12 +1,12 @@ -// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理 -// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法 -// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码 -// 如果文档中存在多条JQL语句,只有最后一条语句生效 -// 如果混写了普通js,最后一条语句需是数据库操作语句 -// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission -// 不支持clientDB的action -// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database?id=limit -// 详细JQL语法,请参考 https://uniapp.dcloud.net.cn/uniCloud/clientdb?id=jsquery - -// 下面示例查询uni-id-users表的所有数据 -db.collection('uni-id-users').get(); +// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理 +// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法 +// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码 +// 如果文档中存在多条JQL语句,只有最后一条语句生效 +// 如果混写了普通js,最后一条语句需是数据库操作语句 +// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission +// 不支持clientDB的action +// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database?id=limit +// 详细JQL语法,请参考 https://uniapp.dcloud.net.cn/uniCloud/clientdb?id=jsquery + +// 下面示例查询uni-id-users表的所有数据 +db.collection('uni-id-users').get();