From c8030b4fd1215601481d1a00a4b2db689e16a91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=8A=E9=87=8C?= <1227971437@qq.com> Date: Wed, 21 Apr 2021 21:35:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ucenter/ucenter.vue | 27 +++++++- .../database/uni-id-scores.schema.json | 38 +++++++++++ .../database/opendb-feedback.schema.json | 68 +++++++++++++++++++ .../uni-list-item/uni-list-item.vue | 2 +- .../uni-login-page/pages/index/index.vue | 2 +- 5 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 uniCloud-aliyun/database/uni-id-scores.schema.json create mode 100644 uni_modules/opendb-feedback/uniCloud/database/opendb-feedback.schema.json diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index 5886482d..83d31b00 100644 --- a/pages/ucenter/ucenter.vue +++ b/pages/ucenter/ucenter.vue @@ -31,7 +31,10 @@ mapMutations } from 'vuex'; import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'; - import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-check-version'; + import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-check-version'; + + const db = uniCloud.database(); + const dbCollectionName = 'uni-id-scores'; export default { data() { return { @@ -70,7 +73,8 @@ to: '' }, { title: '我的积分', - to: '' + to: '', + event:'getScore' }], [{ title: '问题与反馈', @@ -164,6 +168,25 @@ main.startActivity(intent); } // #endif + }, + /** + * 获取积分信息 + */ + getScore() { + uni.showLoading({ + mask: true + }) + db.collection(dbCollectionName).field('score,balance').get().then((res) => { + const data = res.result.data[0] + console.log(data); + }).catch((err) => { + uni.showModal({ + content: err.message || '请求服务失败', + showCancel: false + }) + }).finally(() => { + uni.hideLoading() + }) } } } diff --git a/uniCloud-aliyun/database/uni-id-scores.schema.json b/uniCloud-aliyun/database/uni-id-scores.schema.json new file mode 100644 index 00000000..69577c85 --- /dev/null +++ b/uniCloud-aliyun/database/uni-id-scores.schema.json @@ -0,0 +1,38 @@ +{ + "bsonType": "object", + "required": ["user_id", "score", "balance"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "user_id": { + "bsonType": "string", + "description": "用户id,参考uni-id-users表" + }, + "score": { + "bsonType": "int", + "description": "本次变化的积分" + }, + "type": { + "bsonType": "int", + "enum": [1, 2], + "description": "积分类型 1:收入 2:支出" + }, + "balance": { + "bsonType": "int", + "description": "变化后的积分余额" + }, + "comment": { + "bsonType": "string", + "description": "备注,说明积分新增、消费的缘由", + "trim": "both" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } + } + } +} diff --git a/uni_modules/opendb-feedback/uniCloud/database/opendb-feedback.schema.json b/uni_modules/opendb-feedback/uniCloud/database/opendb-feedback.schema.json new file mode 100644 index 00000000..0decc34a --- /dev/null +++ b/uni_modules/opendb-feedback/uniCloud/database/opendb-feedback.schema.json @@ -0,0 +1,68 @@ +{ + "bsonType": "object", + "permission": { + "read": "doc.is_reply == false", + "create": true, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "user_id": { + "bsonType": "string", + "description": "留言反馈用户ID\/回复留言用户ID,参考uni-id-users表", + "foreignKey": "uni-id-users._id", + "forceDefaultValue": { + "$env": "uid" + } + }, + "title": { + "description": "反馈标题(用于列表展示)" + }, + "ip": { + "forceDefaultValue": { + "$env": "clientIP" + } + }, + "create_date": { + "bsonType": "timestamp", + "description": "留言时间\/回复留言时间", + "forceDefaultValue": { + "$env": "now" + } + }, + "content": { + "bsonType": "string", + "description": "留言内容\/回复内容", + "trim": "right" + }, + "imgs": { + "bsonType": "array", + "description": "图片列表" + }, + "is_reply": { + "bsonType": "bool", + "description": "是否是回复类型" + }, + "feedback_id": { + "bsonType": "string", + "description": "被回复留言ID" + }, + "contact": { + "bsonType": "string", + "description": "联系人", + "trim": "both" + }, + "mobile": { + "bsonType": "string", + "description": "联系电话", + "trim": "both" + }, + "reply_count": { + "bsonType": "int", + "description": "被回复条数" + } + } +} diff --git a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue index f5d744a7..7f1eced0 100644 --- a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue +++ b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue @@ -370,7 +370,7 @@ $list-item-pd: $uni-spacing-col-lg $uni-spacing-row-lg; /* #endif */ height: $uni-img-size-base; width: $uni-img-size-base; - margin-right: 10px; + marin-right: 10px; } .uni-icon-wrapper { diff --git a/uni_modules/uni-login-page/pages/index/index.vue b/uni_modules/uni-login-page/pages/index/index.vue index d94180d9..0f2a0813 100644 --- a/uni_modules/uni-login-page/pages/index/index.vue +++ b/uni_modules/uni-login-page/pages/index/index.vue @@ -105,7 +105,7 @@ import baseappConfig from '@/baseapp.config.js'; */ uni.showLoading(); uni.navigateTo({ - url: './phone-code?phoneNumber=' + this.formData.phone + '&phoneArea=' + + url: '../phone-code/phone-code?phoneNumber=' + this.formData.phone + '&phoneArea=' + this.currenPhoneArea, success: res => {}, fail: () => {}, -- GitLab