diff --git a/src/api/system/feedback.js b/src/api/system/feedback.js new file mode 100644 index 0000000..75eff87 --- /dev/null +++ b/src/api/system/feedback.js @@ -0,0 +1,21 @@ +import request from '@/utils/request' +import upload from '@/utils/upload' + +// 提交意见反馈(H5/小程序端) +export function submitFeedback(data) { + return request({ + url: '/system/feedback/submit', + method: 'post', + data + }) +} + +// 上传反馈截图 +export function uploadFeedbackImage(filePath) { + return upload({ + url: '/file/upload', + filePath, + name: 'file', + formData: {} + }) +} diff --git a/src/pages.json b/src/pages.json index 5e9a58c..17a20af 100644 --- a/src/pages.json +++ b/src/pages.json @@ -187,6 +187,12 @@ "navigationBarTitleText": "常见问题" } }, + { + "path": "feedback/index", + "style": { + "navigationBarTitleText": "意见反馈" + } + }, { "path": "about/index", "style": { diff --git a/src/pages/mine.vue b/src/pages/mine.vue index 1dfb6b7..885ffc1 100644 --- a/src/pages/mine.vue +++ b/src/pages/mine.vue @@ -37,12 +37,22 @@ 交流社区 + + + + 联系客服 + @@ -53,7 +63,7 @@ - 给个好评 + 支持我们 @@ -134,6 +144,9 @@ const userStore = useUserStore() const name = userStore.name; const userId = computed(() => userStore.userId || ''); const version = config.appInfo.version; +const communityWechat = 'intc126'; +const servicePhone = '17753252359'; +const officialSite = config.appInfo.site_url; const popup = ref(null); function handleToInfo() { @@ -182,35 +195,73 @@ function handleAbout() { }); }; function handleJiaoLiuQun() { - uni.showToast({ - title: 'intc126', - mask: false, - icon: "none", - duration: 5000 + uni.showModal({ + title: '加入交流群', + content: `复制微信号 ${communityWechat},添加后备注“智聪网络科技”,获取使用交流、问题答疑和功能更新。`, + confirmText: '复制微信号', + cancelText: '稍后再说', + success: (res) => { + if (res.confirm) { + copyText(communityWechat, '微信号已复制'); + } + } }); }; function handleBuilding() { - uni.showToast({ - title: '谢谢反馈~', - mask: false, - icon: "none", - duration: 1000 + uni.navigateTo({ + url: '/pages_mine/pages/feedback/index' }); } function handleService() { - uni.showToast({ - title: '请电联或加客服微信:17753252359', - mask: false, - icon: "none", - duration: 5000 + uni.showActionSheet({ + itemList: ['拨打客服电话', '复制客服微信', '查看关于我们'], + success: ({ tapIndex }) => { + if (tapIndex === 0) { + uni.makePhoneCall({ phoneNumber: servicePhone }); + } else if (tapIndex === 1) { + copyText(servicePhone, '客服微信已复制'); + } else if (tapIndex === 2) { + handleAbout(); + } + } }); } +function handleContact() { + // 微信小程序端由 open-type="contact" 直接打开原生客服会话 +} function handleUs() { - uni.showToast({ - title: '谢谢点赞!', - mask: false, - icon: "none", - duration: 1000 + uni.showActionSheet({ + itemList: ['推荐给朋友', '复制官网链接', '意见反馈'], + success: ({ tapIndex }) => { + if (tapIndex === 0) { + uni.showModal({ + title: '感谢支持', + content: '如果觉得好用,可以点击右上角“···”分享给朋友,也欢迎把官网链接发给需要的人。', + confirmText: '复制官网', + cancelText: '知道了', + success: (res) => { + if (res.confirm) { + copyText(officialSite, '官网链接已复制'); + } + } + }); + } else if (tapIndex === 1) { + copyText(officialSite, '官网链接已复制'); + } else if (tapIndex === 2) { + handleBuilding(); + } + } + }); +} +function copyText(data, title = '复制成功') { + uni.setClipboardData({ + data, + success: () => { + uni.showToast({ + title, + icon: 'none' + }); + } }); } @@ -403,6 +454,18 @@ page { font-size: 24rpx; } } + + .action-button { + padding: 0; + margin: 0; + border: 0; + background: transparent; + line-height: 1; + + &::after { + border: none; + } + } } .menu-section { diff --git a/src/pages_mine/pages/feedback/index.vue b/src/pages_mine/pages/feedback/index.vue new file mode 100644 index 0000000..95ef8c2 --- /dev/null +++ b/src/pages_mine/pages/feedback/index.vue @@ -0,0 +1,413 @@ +