新增意见反馈、帮助中心

This commit is contained in:
gyq 2025-01-08 11:01:34 +08:00
parent 7b0fc90f8c
commit cef6f2be85
13 changed files with 752 additions and 59 deletions

View File

@ -9,4 +9,67 @@ export const selectByUserId = (data) => {
data: data,
method: 'GET'
})
}
/**
* 获取客服微信
*/
export const commonType = (type) => {
return http.request({
url: `/common/type/${type}`,
method: 'GET'
})
}
/**
* 金币明细
*/
export const queryUserMoneyDetails = (data) => {
return http.request({
url: '/moneyDetails/queryUserMoneyDetails',
method: 'GET',
data: data
})
}
/**
* 意见反馈
*/
export const sendMessage = (data) => {
return http.request({
url: '/message/sendMessage',
method: 'POST',
data: data
})
}
/**
* 帮助中心
*/
export const selectHelpList = (data) => {
return http.request({
url: '/helpWord/selectHelpList',
method: 'GET',
data: data
})
}
/**
* 个人中心数据
*/
export const collectVideoSummary = () => {
return http.request({
url: '/courseCollect/collectVideoSummary',
method: 'GET'
})
}
/**
* 金币
*/
export const selectUserMoney = () => {
return http.request({
url: '/moneyDetails/selectUserMoney',
method: 'GET'
})
}

View File

@ -28,7 +28,7 @@
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
},
{
"path": "pages/task/index",
"style": {
@ -43,13 +43,47 @@
"enablePullDownRefresh": true
}
}, {
"path": "pages/watching_history/watching_history"
"path": "pages/watching_history/watching_history",
"style": {
"enablePullDownRefresh": true
}
}, {
"path": "pages/me/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
}, {
"path": "pages/me/contact",
"style": {
"navigationBarTitleText": "联系客服"
}
}, {
"path": "pages/me/gold_record",
"style": {
"navigationBarTitleText": "金币明细",
"enablePullDownRefresh": true
}
}, {
"path": "pages/me/feedback",
"style": {
"navigationBarTitleText": "意见反馈"
}
}, {
"path": "pages/me/help_center",
"style": {
"navigationBarTitleText": "帮助中心"
}
}, {
"path": "pages/me/setting",
"style": {
"navigationBarTitleText": "设置"
}
}, {
"path": "pages/me/help_center_detail",
"style": {
"navigationBarTitleText": ""
}
}, {
"path": "pages/login/login",
"style": {

View File

@ -53,12 +53,15 @@ import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
async function selectByUserIdAjax() {
try {
const res1 = await selectByUserId({ page: 1, limit: 6, classify: 3 });
const res2 = await selectByUserId({ page: 1, limit: 6, classify: 6 });
const res2 = await selectByUserId({ page: 1, limit: 6, classify: 1 });
data.list1 = res1.records;
data.list2 = res2.records;
} catch (error) {
console.log(error);
}
setTimeout(() => {
uni.stopPullDownRefresh();
}, 500);
}
const data = reactive({

View File

@ -137,6 +137,8 @@
uni.setStorageSync('invitationCode', res.user.invitationCode)
uni.setStorageSync('sex', res.user.sex)
uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('userInfo', res.user)
//
if (res.user.qdCode) {
uni.setStorageSync('qdCode', res.user.qdCode)

74
pages/me/contact.vue Normal file
View File

@ -0,0 +1,74 @@
<template>
<view class="container">
<view class="card">
<view class="title">
<view class="t1">添加客服微信咨询</view>
<view class="t2">{{ info.wx }}</view>
</view>
<view class="content">
<image class="img" :src="info.qrcode" mode="widthFix" @click="checkQrcode"></image>
</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { commonType } from '@/api/me/me.js';
const info = ref({});
async function commonTypeAjax() {
try {
const res1 = await commonType(205);
const res2 = await commonType(207);
info.value.wx = res2.value;
info.value.qrcode = res1.value;
} catch (error) {
console.log(error);
}
}
//
function checkQrcode() {
uni.previewImage({
urls: [info.value.qrcode]
});
}
onLoad(() => {
commonTypeAjax();
});
</script>
<style scoped lang="scss">
page {
background: #f5f5f5;
}
.container {
padding: 28upx;
}
.card {
padding: 28upx;
border-radius: 20upx;
background-color: #fff;
.title {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.t1 {
color: #555;
}
}
.content {
display: flex;
justify-content: center;
padding-top: 28upx;
.img {
width: 100%;
display: block;
}
}
}
</style>

124
pages/me/feedback.vue Normal file
View File

@ -0,0 +1,124 @@
<template>
<view class="container">
<view class="card">
<view class="title-wrap">
<view class="title">问题和意见</view>
<view class="right" @click="showSheet = true">快速键入</view>
</view>
<view class="ipt-wrap">
<up-textarea v-model="form.content" placeholder="请详细描述你的问题和意见..." count></up-textarea>
</view>
</view>
<view class="card">
<view class="title-wrap">
<view class="title">QQ/邮箱</view>
</view>
<view class="ipt-wrap">
<up-input v-model="form.contact" placeholder="方便我们联系你 " count></up-input>
</view>
</view>
<view class="btn">
<up-button color="#ff7581" :loading="loaing" loading-text="提交中..." @click="confirmHandle">提交</up-button>
</view>
<up-action-sheet
:actions="list"
:show="showSheet"
cancelText="取消"
closeOnClickAction
closeOnClickOverlay
@close="showSheet = false"
@select="selectSheet"
></up-action-sheet>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { sendMessage } from '@/api/me/me.js';
const list = ref([
{
name: '界面显示错乱'
},
{
name: '启动缓慢,卡出翔了'
},
{
name: 'UI无法直视丑哭了'
},
{
name: '偶发性崩溃'
}
]);
const showSheet = ref(false);
const loaing = ref(false);
const form = reactive({
content: '',
contact: ''
});
function selectSheet(e) {
if (!form.content.length) {
form.content = e.name;
} else {
form.content += `${e.name}`;
}
}
//
async function confirmHandle() {
try {
if (!form.content) {
uni.showToast({
title: '请输入内容',
icon: 'none'
});
return;
}
if (!form.contact) {
uni.showToast({
title: '请输入联系方式',
icon: 'none'
});
return;
}
loaing.value = true;
await sendMessage({
content: JSON.stringify({ score: 5, ...form }),
state: 2,
title: form.contact
});
uni.showToast({
title: '提交成功',
icon: 'none',
mask: true
});
setTimeout(() => {
uni.navigateBack();
}, 1000);
} catch (error) {
console.log(error);
}
loaing.value = false;
}
</script>
<style scoped lang="scss">
.container {
padding: 0 20upx;
font-size: 28upx;
}
.card {
margin-bottom: 28upx;
.title-wrap {
padding: 28upx 0;
color: #999;
display: flex;
justify-content: space-between;
}
}
.btn {
padding: 28upx 0;
}
</style>

89
pages/me/gold_record.vue Normal file
View File

@ -0,0 +1,89 @@
<template>
<view class="container">
<view class="list">
<view class="item" v-for="item in listData.list" :key="item.id">
<view class="row">类型{{ item.title }}</view>
<view class="row">内容{{ item.content }}</view>
<view class="row">时间{{ item.createTime }}</view>
<view class="btm">+{{ item.money }}</view>
</view>
</view>
<emprty-card v-if="!listData.list.length && listData.status == 'nomore'" />
<up-loadmore :status="listData.status" />
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
import { queryUserMoneyDetails } from '@/api/me/me.js';
const listData = reactive({
list: [],
page: 1,
size: 10,
status: 'loading'
});
async function getList() {
try {
const res = await queryUserMoneyDetails({
page: listData.page,
limit: listData.size,
moneyType: 2,
viewType: 2
});
if (listData.page == 1) {
listData.list = res.records;
} else {
listData.list.push(...res.records);
}
if (res.currPage >= res.totalPage) {
listData.status = 'nomore';
}
} catch (error) {
console.log(error);
}
setTimeout(() => {
uni.stopPullDownRefresh();
}, 500);
}
//
onPullDownRefresh(() => {
listData.page = 1;
listData.status = 'loading';
getList();
});
onLoad((e) => {
getList();
});
</script>
<style scoped lang="scss">
page {
background: #f5f5f5;
}
.container {
padding: 28upx;
}
.list {
.item {
padding: 28upx;
border-radius: 20upx;
margin-bottom: 28upx;
background: #fff;
.row {
margin-bottom: 4px;
font-size: 28upx;
}
.btm {
display: flex;
justify-content: flex-end;
color: rgb(253, 100, 22);
font-weight: bold;
}
}
}
</style>

88
pages/me/help_center.vue Normal file
View File

@ -0,0 +1,88 @@
<template>
<view class="container">
<up-collapse accordion>
<up-collapse-item :title="item.helpClassifyName" :name="item.helpClassifyId" v-for="item in list" :key="item.helpClassifyId">
<view class="row-wrap">
<view class="u-collapse-content row" v-for="val in item.helpWordList" :key="val.helpWordId" @click="toHelpDetal(val)">
{{ val.helpWordTitle }}
</view>
</view>
</up-collapse-item>
</up-collapse>
<view class="footer-wrap">
<view class="footer">
<view class="item" @click="linkTo('/pages/me/contact')">
<up-icon name="email" size="24" />
联系客服
</view>
<view class="item" @click="linkTo('/pages/me/feedback')">
<up-icon name="edit-pen" size="24" />
意见反馈
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { selectHelpList } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js';
//
const list = ref([]);
async function selectHelpListAjax() {
try {
const res = await selectHelpList({ types: 1 });
list.value = res;
} catch (error) {
console.log(error);
}
}
function toHelpDetal(item) {
uni.setStorageSync('helpDetail', item);
linkTo('/pages/me/help_center_detail');
}
onLoad(() => {
selectHelpListAjax();
});
</script>
<style scoped lang="scss">
.footer-wrap {
padding: 28upx;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 99;
.footer {
background-color: #f5f5f5;
height: 108upx;
display: flex;
border-radius: 20upx;
.item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
position: relative;
&:first-child {
&::after {
content: '';
height: 20upx;
border-right: 1upx solid #999;
position: absolute;
right: 0;
top: 50%;
margin-top: -10upx;
}
}
}
}
}
</style>

View File

@ -0,0 +1,27 @@
<template>
<view class="container">
<rich-text :nodes="content.helpWordContent"></rich-text>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const content = ref('');
onLoad(() => {
content.value = uni.getStorageSync('helpDetail');
const regex = new RegExp('img', 'gi');
content.value.helpWordContent = content.value.helpWordContent.replace(regex, `img style="width:100%;"`);
uni.setNavigationBarTitle({
title: content.value.helpWordTitle
});
});
</script>
<style scoped lang="scss">
.container {
padding: 28upx;
}
</style>

View File

@ -11,27 +11,29 @@
<view class="quick-menu">
<image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit"></image>
<image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit"></image>
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit"></image>
<navigator hover-class="none" url="/pages/me/contact">
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit"></image>
</navigator>
</view>
</view>
<view class="top">
<image class="avatar" src="/static/default_avatar.png" mode="aspectFill"></image>
<image class="avatar" :src="userInfo.avatar || '/static/default_avatar.png'" mode="aspectFill"></image>
<view class="info-wrap">
<view class="name">159****3331</view>
<view class="name">{{ userInfo.phone || '请登录' }}</view>
</view>
</view>
<view class="btm">
<view class="item">
<navigator class="item" hover-class="none" url="/pages/watching_history/watching_history?type=2">
<view class="title">我的喜欢</view>
<view class="num">0</view>
</view>
<view class="item">
<view class="num">{{ likeData.likeCount }}</view>
</navigator>
<navigator class="item" hover-class="none" url="/pages/watching_history/watching_history?type=1">
<view class="title">我的追剧</view>
<view class="num">0</view>
</view>
<view class="num">{{ likeData.collectCount }}</view>
</navigator>
<view class="item">
<view class="title">我的红包</view>
<view class="num">0</view>
<view class="num">{{ amount || 0 }}</view>
</view>
</view>
</view>
@ -39,47 +41,44 @@
<view class="gold-wrap">
<view class="left">
<image class="icon" src="/static/me/gold_icon.png" mode="aspectFit"></image>
<view class="num">123133.00</view>
<view class="num">{{ gold }}</view>
</view>
<view class="btn">金币明细</view>
</view>
<view class="title-wrap">
<view class="t">观看历史</view>
<up-icon name="arrow-right"></up-icon>
<navigator hover-class="none" url="/pages/me/gold_record">
<view class="btn">金币明细</view>
</navigator>
</view>
<navigator class="title-wrap" hover-class="none" url="/pages/watching_history/watching_history?type=3">
<view class="a">
<view class="t">观看历史</view>
<up-icon name="arrow-right"></up-icon>
</view>
</navigator>
<view class="history-list">
<view class="item">
<image class="cover" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
<view class="name">我在八零年代当后妈</view>
<view class="t">看到8集</view>
</view>
<view class="item">
<image class="cover" src="https://img2.baidu.com/it/u=3352094756,2708106394&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422" mode="aspectFill"></image>
<view class="name">姜小姐的反击</view>
<view class="t">看到12集</view>
</view>
<view class="item">
<image class="cover" src="https://q0.itc.cn/images01/20240806/a14af4ece3354215be6294f3d2c264a4.jpeg" mode="aspectFill"></image>
<view class="name">霸道载誉归来</view>
<view class="t">看到3集</view>
<view class="item" v-for="item in recordThree" :key="item.id">
<image class="cover" :src="item.titleImg" mode="aspectFill"></image>
<view class="name">{{ item.title }}</view>
<view class="t">看到{{ item.courseDetailsName }}</view>
</view>
</view>
<view class="empty" style="padding-bottom: 20px" v-if="!recordThree.length">
<emprty-card></emprty-card>
</view>
</view>
<view class="card-wrap">
<view class="menu-list">
<view class="item">
<view class="item" @click="toTask">
<image class="icon" src="/static/me/menu_icon1.png" mode="aspectFit"></image>
<view class="name">任务中心</view>
</view>
<view class="item">
<view class="item" @click="linkTo('/pages/me/setting')">
<image class="icon" src="/static/me/menu_icon2.png" mode="aspectFit"></image>
<view class="name">设置中心</view>
</view>
<view class="item">
<view class="item" @click="linkTo('/pages/me/feedback', true)">
<image class="icon" src="/static/me/menu_icon3.png" mode="aspectFit"></image>
<view class="name">意见反馈</view>
</view>
<view class="item">
<view class="item" @click="linkTo('/pages/me/help_center')">
<image class="icon" src="/static/me/menu_icon4.png" mode="aspectFit"></image>
<view class="name">帮助中心</view>
</view>
@ -105,7 +104,66 @@
</view>
</template>
<script setup></script>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js';
const userInfo = ref({});
//
const recordThree = ref([]);
async function selectByUserIdAjax() {
try {
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 });
recordThree.value = res.records;
} catch (error) {
console.log(error);
}
}
//
const likeData = reactive({
likeCount: 0,
collectCount: 0
});
async function collectVideoSummaryAjax() {
try {
const res = await collectVideoSummary();
likeData.likeCount = res.likeCount;
likeData.collectCount = res.collectCount;
} catch (error) {
console.log(error);
}
}
//
const gold = ref(0);
const amount = ref(0);
async function selectUserMoneyAjax() {
try {
const res = await selectUserMoney();
gold.value = res.money;
amount.value = res.amount;
} catch (error) {
console.log(error);
}
}
//
function toTask() {
uni.switchTab({
url: '/pages/task/index'
});
}
onLoad(() => {
userInfo.value = uni.getStorageSync('userInfo');
selectByUserIdAjax();
collectVideoSummaryAjax();
selectUserMoneyAjax();
});
</script>
<style scoped lang="scss">
$bgColor: #f5f7ff;
@ -173,7 +231,7 @@ page {
flex: 1;
display: flex;
flex-direction: column;
font-size: 28upx;
font-size: 32upx;
}
}
.btm {
@ -190,6 +248,8 @@ page {
}
.num {
font-weight: bold;
display: flex;
justify-content: center;
}
}
}
@ -247,19 +307,23 @@ page {
}
.title-wrap {
padding: 28upx;
display: flex;
align-items: center;
justify-content: space-between;
.t {
font-size: 28upx;
.a {
display: flex;
align-items: center;
justify-content: space-between;
.t {
font-size: 28upx;
}
}
}
.history-list {
padding: 0 28upx 28upx;
display: flex;
gap: 28upx;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 1fr;
grid-column-gap: 28upx;
grid-row-gap: 28upx;
.item {
flex: 1;
.cover {
width: 100%;
height: 280upx;

77
pages/me/setting.vue Normal file
View File

@ -0,0 +1,77 @@
<template>
<view class="container">
<view class="list">
<view class="item">
<view class="title">修改手机号</view>
<up-icon name="arrow-right" />
</view>
<view class="item" @click="linkTo('/pages/me/help_center')">
<view class="title">帮助中心</view>
<up-icon name="arrow-right" />
</view>
<view class="item" @click="linkTo('/pages/me/feedback')">
<view class="title">意见反馈</view>
<up-icon name="arrow-right" />
</view>
<view class="item">
<view class="title">用户协议</view>
<up-icon name="arrow-right" />
</view>
<view class="item">
<view class="title">隐私协议</view>
<up-icon name="arrow-right" />
</view>
<view class="item" @click="logout">
<view class="title">退出登录</view>
<up-icon name="arrow-right" />
</view>
</view>
<view class="version">1.1.14</view>
</view>
</template>
<script setup>
import { linkTo } from '@/utils/app.js';
// 退
function logout() {
uni.showModal({
title: '注意',
content: '确定要退出登录吗?',
success: (res) => {
if (res.confirm) {
uni.clearStorageSync();
uni.reLaunch({
url: '/pages/login/login'
});
}
}
});
}
</script>
<style scoped lang="scss">
.container {
font-size: 28upx;
color: #555;
}
.list {
padding-bottom: 120upx;
.item {
padding: 32upx 28upx;
border-bottom: 1upx solid #efefef;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.version {
width: 100%;
height: 120upx;
display: flex;
justify-content: center;
position: fixed;
bottom: 0;
left: 0;
color: #999;
}
</style>

View File

@ -26,7 +26,7 @@
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId } from '@/api/me/me.js';
@ -36,6 +36,10 @@ const typeList = ref([
type: 1,
label: '我的追剧'
},
{
type: 2,
label: '我的喜欢'
},
{
type: 3,
label: '最近观看'
@ -57,15 +61,29 @@ async function selectByUserIdAjax() {
limit: listData.size,
classify: type.value
});
listData.list = res.records;
if (listData.page == 1) {
listData.list = res.records;
} else {
listData.list.push(...res.records);
}
if (res.currPage >= res.totalPage) {
listData.status = 'nomore';
}
} catch (error) {
console.log(error);
}
setTimeout(() => {
uni.stopPullDownRefresh();
}, 500);
}
//
onPullDownRefresh(() => {
listData.page = 1;
listData.status = 'loading';
selectByUserIdAjax();
});
onReachBottom(() => {
listData.page++;
selectByUserIdAjax();

View File

@ -1,31 +1,31 @@
export function openApp(url){
export function openApp(url) {
// #ifdef H5
window.location.href='com.hnsiyao.duanju://'
window.location.href = 'com.hnsiyao.duanju://'
// #endif
}
export function isAndroid(){
export function isAndroid() {
const systemInfo = uni.getSystemInfoSync();
const isA=systemInfo.platform === 'android'
const isA = systemInfo.platform === 'android'
// isAndroid=()=>{
// return isA
// }
return isA
}
export function isIos(){
export function isIos() {
const systemInfo = uni.getSystemInfoSync();
const isIOS = /iOS/.test(systemInfo.platform);
isIos=()=>{
isIos = () => {
return isIOS
}
return isIOS
}
export function isH5Android(){
const token=uni.getStorageSync('token');
export function isH5Android() {
const token = uni.getStorageSync('token');
console.log(isAndroid());
if(isAndroid()&&token){
if (isAndroid() && token) {
uni.removeStorageSync('token')
uni.navigateTo({
url:'/pages/login/appEq'
url: '/pages/login/appEq'
})
}
}
@ -40,3 +40,33 @@ export function returnIsSafari() {
return false;
}
}
/**
* 路由跳转
*/
export function linkTo(path, isLogin = false) {
if (isLogin) {
let token = uni.getStorageSync('token')
if (!token) {
uni.showModal({
title: '注意',
content: '您还未登录,请登录后使用!',
success: res => {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
}
})
} else {
uni.navigateTo({
url: path
})
}
} else {
uni.navigateTo({
url: path
})
}
}