From d81902ab7172e654ba9c950cd342c7e1e96e60ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com> Date: Wed, 29 Mar 2023 21:45:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=88=91=E7=9A=84=E8=AF=84?= =?UTF-8?q?=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/appraise/group.vue | 205 ++++++++++ src/components/appraise/section.vue | 86 +++++ src/core/apis.js | 8 + src/core/models/user.js | 42 ++ src/pages.json | 6 + src/pages/member/appraise.vue | 99 +++++ src/pages/member/member.vue | 2 +- src/uni_modules/uni-rate/changelog.md | 25 ++ .../uni-rate/components/uni-rate/uni-rate.vue | 360 ++++++++++++++++++ src/uni_modules/uni-rate/package.json | 88 +++++ src/uni_modules/uni-rate/readme.md | 12 + 11 files changed, 932 insertions(+), 1 deletion(-) create mode 100644 src/components/appraise/group.vue create mode 100644 src/components/appraise/section.vue create mode 100644 src/pages/member/appraise.vue create mode 100644 src/uni_modules/uni-rate/changelog.md create mode 100644 src/uni_modules/uni-rate/components/uni-rate/uni-rate.vue create mode 100644 src/uni_modules/uni-rate/package.json create mode 100644 src/uni_modules/uni-rate/readme.md diff --git a/src/components/appraise/group.vue b/src/components/appraise/group.vue new file mode 100644 index 0000000..b00521e --- /dev/null +++ b/src/components/appraise/group.vue @@ -0,0 +1,205 @@ + + + + + \ No newline at end of file diff --git a/src/components/appraise/section.vue b/src/components/appraise/section.vue new file mode 100644 index 0000000..a52c7f4 --- /dev/null +++ b/src/components/appraise/section.vue @@ -0,0 +1,86 @@ + + + + + \ No newline at end of file diff --git a/src/core/apis.js b/src/core/apis.js index 883d4b7..4f5e791 100644 --- a/src/core/apis.js +++ b/src/core/apis.js @@ -72,6 +72,14 @@ const apis = { showLoading: true, auth: true, } + }, + appraise: { + count: { + url: "/wxapp/index/mysevaluation", + }, + list: { + url: "/wxapp/index/seemyevaluation", + } } }, service: { diff --git a/src/core/models/user.js b/src/core/models/user.js index 3f0e9a7..f4effa0 100644 --- a/src/core/models/user.js +++ b/src/core/models/user.js @@ -298,5 +298,47 @@ export default { return reject(response.msg); }).catch(e => { }); }); + }, + appraise: { + count() { + return new Promise((resolve, reject) => { + prototype.$request({ + api: "user.appraise.count", + }).then(response => { + if (response.code == 1) { + return resolve(response.data); + } + return reject(response.msg); + }).catch(e => { }); + }); + }, + list() { + return new Promise((resolve, reject) => { + prototype.$request({ + api: "user.appraise.list", + data: data + }).then(response => { + if (response.code == 1) { + let list = []; + response.data.forEach((data) => { + list.push({ + id: data.id, + avatar: data.u_avatar, + nickname: data.u_name, + createTime: data.time, + tags: data.msg.split(","), + area: "-", + worker: data.wid, + grade: data.score, + images: data.img, + content: data.desc, + }); + }); + return resolve(list); + } + return reject(response.msg); + }).catch(e => { }); + }); + } } } diff --git a/src/pages.json b/src/pages.json index a6285f8..2e09afc 100644 --- a/src/pages.json +++ b/src/pages.json @@ -73,6 +73,12 @@ "navigationBarTitleText": "设置" } }, + { + "path": "pages/member/appraise", + "style": { + "navigationBarTitleText": "我的评价" + } + }, { "path": "pages/get/index", "style": { diff --git a/src/pages/member/appraise.vue b/src/pages/member/appraise.vue new file mode 100644 index 0000000..0de66fa --- /dev/null +++ b/src/pages/member/appraise.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file diff --git a/src/pages/member/member.vue b/src/pages/member/member.vue index 23c09c8..9e319f6 100644 --- a/src/pages/member/member.vue +++ b/src/pages/member/member.vue @@ -87,7 +87,7 @@ 设置服务信息 - + 我的评价 diff --git a/src/uni_modules/uni-rate/changelog.md b/src/uni_modules/uni-rate/changelog.md new file mode 100644 index 0000000..8a98a61 --- /dev/null +++ b/src/uni_modules/uni-rate/changelog.md @@ -0,0 +1,25 @@ +## 1.3.1(2022-02-25) +- 修复 条件判断 `NaN` 错误的 bug +## 1.3.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-rate](https://uniapp.dcloud.io/component/uniui/uni-rate) +## 1.2.2(2021-09-10) +- 优化 默认值修改为 0 颗星 +## 1.2.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.2.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.2(2021-05-12) +- 新增 组件示例地址 +## 1.1.1(2021-04-21) +- 修复 布局变化后 uni-rate 星星计算不准确的 bug +- 优化 添加依赖 uni-icons, 导入 uni-rate 自动下载依赖 +## 1.1.0(2021-04-16) +- 修复 uni-rate 属性 margin 值为 string 组件失效的 bug + +## 1.0.9(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 + +## 1.0.8(2021-02-05) +- 调整为uni_modules目录规范 +- 支持 pc 端 diff --git a/src/uni_modules/uni-rate/components/uni-rate/uni-rate.vue b/src/uni_modules/uni-rate/components/uni-rate/uni-rate.vue new file mode 100644 index 0000000..63ac1f2 --- /dev/null +++ b/src/uni_modules/uni-rate/components/uni-rate/uni-rate.vue @@ -0,0 +1,360 @@ + + + + + diff --git a/src/uni_modules/uni-rate/package.json b/src/uni_modules/uni-rate/package.json new file mode 100644 index 0000000..64e8e33 --- /dev/null +++ b/src/uni_modules/uni-rate/package.json @@ -0,0 +1,88 @@ +{ + "id": "uni-rate", + "displayName": "uni-rate 评分", + "version": "1.3.1", + "description": "Rate 评分组件,可自定义评分星星图标的大小、间隔、评分数。", + "keywords": [ + "uni-ui", + "uniui", + "评分" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/src/uni_modules/uni-rate/readme.md b/src/uni_modules/uni-rate/readme.md new file mode 100644 index 0000000..eae7b5c --- /dev/null +++ b/src/uni_modules/uni-rate/readme.md @@ -0,0 +1,12 @@ + + +## Rate 评分 +> **组件名:uni-rate** +> 代码块: `uRate` +> 关联组件:`uni-icons` + + +评分组件,多用于购买商品后,对商品进行评价等场景 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-rate) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file