添加用户反馈模块

This commit is contained in:
ghusermoon 2020-11-25 16:25:32 +08:00
parent ee6e4102b6
commit 6945c21f10
6 changed files with 240 additions and 37 deletions

View File

@ -10,7 +10,7 @@ export default {
// #endif
getApp().globalData.im = this.imService
console.log('App Launch');
// console.log('App Launch');
// token
uni.getStorage({
key: "token",
@ -22,10 +22,10 @@ export default {
})
},
onShow: function() {
console.log('App Show');
// console.log('App Show');
},
onHide: function() {
console.log('App Hide');
// console.log('App Hide');
}
};
</script>

View File

@ -13,6 +13,18 @@
}
}
},
{
"path": "pages/login/agreements",
"style": {
"navigationBarTitleText": "",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"titleColor": "#333333"
}
}
}
},
{
"path": "pages/release/tosign",
"style": {
@ -222,6 +234,18 @@
}
}
},
{
"path": "pages/user/feedback",
"style": {
"navigationBarTitleText": "用户反馈",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"titleColor": "#333333"
}
}
}
},
{
"path": "pages/user/complaintDetails",
"style": {

View File

@ -0,0 +1,31 @@
<template>
<view class="agreements">
<rich-text :nodes="nodes"></rich-text>
</view>
</template>
<script>
export default {
data() {
return {
nodes: '<div style="margin-bottom: 1000px;">测试</div><p>789</p>',
}
},
onLoad(option) {
this.setTitle(option.title);
},
methods: {
setTitle(title){
uni.setNavigationBarTitle({
title: title
});
},
}
};
</script>
<style lang="scss" scoped>
.agreements {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
padding: 20rpx 35rpx;
}
</style>

View File

@ -51,6 +51,15 @@
</view>
</view>
</view>
<!-- 服务协议 -->
<!-- <view class="pact">
<view class="pact-container">
<u-checkbox v-model="consentPact" shape="circle" size="30" label-size="26" icon-size="12" active-color="#ff780f">
<text>我已详细阅读并同意</text>
</u-checkbox>
<text class="pact-items" v-for="(item,index) in pactList" :key="index" @click="viewAgreement(index)"> {{ item.text }}</text>
</view>
</view> -->
<!-- denglu QQ weixin -->
<button @click="logins">{{ login }}</button>
<!-- <u-button :custom-style="customStyle" ></u-button> -->
@ -76,14 +85,22 @@ export default {
zhanghaoA: '',
mimaA: '',
url: '',
phone: "",
code: "",
phone: "",
code: "",
state:0,
clickstate:false,
//
timer: null,
is_sendcode: false, // 60s
time_count: 60,
//
timer: null,
is_sendcode: false, // 60s
time_count: 60,
consentPact: false,
pactList: [{
"id": '3',
"text": "《隐私协议》"
},{
"id": '4',
"text": "《使用协议》"
}]
};
},
methods: {
@ -91,14 +108,6 @@ export default {
changetab(num){
this.state = num
},
// checkbox
checkboxChange(e) {
//console.log(e);
},
// checkboxcheckbox-group
checkboxGroupChange(e) {
// console.log(e);
},
mask_u() {
this.show = !this.show;
},
@ -138,6 +147,7 @@ export default {
// console.log(this.$u.trim(this.zhanghaoA));
},
logins() {
// if(!this.consentPact) return false;
//
// console.log(this.zhanghao);
if(this.clickstate==false){
@ -247,7 +257,15 @@ export default {
},
moveHandle(){
return;
}
},
viewAgreement(index) {
this.$u.route({
url: '/pages/login/agreements',
params: {
title: "隐私协议"
}
});
}
},
onLoad() {
let token = uni.getStorageSync('token');
@ -259,7 +277,7 @@ export default {
type: user.role == 2 ? 'tab' : 'to'
});
}
}
},
};
</script>
@ -370,9 +388,14 @@ export default {
display: flex;
align-items: center;
height: 90rpx;
margin-bottom: 160rpx;
line-height: 90rpx;
border-bottom: 1px #fff solid;
&:first-child {
margin-bottom: 160rpx;
}
&:nth-child(2) {
margin-bottom: 80rpx;
}
input {
width: 80%;
margin-left: 30rpx;
@ -409,27 +432,27 @@ export default {
letter-spacing: 2rpx;
}
.pact text {
font-size: 22rpx;
font-weight: 400;
color: rgba(255, 255, 255, 1);
line-height: 36px;
}
.pact_text {
font-size: 22px;
font-weight: 400;
color: rgba(129, 188, 253, 1) !important;
line-height: 36px;
}
//
.pact {
position: relative;
padding-left: 40rpx;
width: 670rpx;
margin: 0 auto 40rpx;
font-size: 26rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
.pact-container {
display: flex;
justify-content: flex-end;
align-items: center;
flex-wrap: wrap;
/deep/ .u-checkbox {
.u-checkbox__label {
margin-right: 0;
}
}
.pact-items {
color: rgba(255, 120, 15, 1);
}
}
}
.u-checkbox-group {

121
pages/user/feedback.vue Normal file
View File

@ -0,0 +1,121 @@
<template>
<view class="write-complaints">
<view class="main-container">
<view class="text-box">
<u-input class="textarea" placeholder="发表您的意见吧,我们会做得更好。 (必填)" v-model="text" type="textarea" :clearable="false" :maxlength="200" />
<span class="text-length">{{ text.length }}/200</span>
</view>
<u-input class="phone" placeholder="请输入手机号方便联系 (非必填)" v-model="phone" type="number" />
</view>
<view class="write-btn" @click="submit">发表意见</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
phone: '',
text: '',
debounce: true,
}
},
onShow() {
this.debounce = true;
},
methods: {
submit() {
if(!this.debounce) return;
if(!this.verifyContent()) return false;
this.debounce = false;
console.log(this.phone);
console.log(this.text);
},
verifyContent() {
if(this.$u.test.isEmpty(this.text)) {
this.$u.toast('内容不可为空');
return false;
}
if(!this.$u.test.isEmpty(this.phone)) {
if(!this.$u.test.mobile(this.phone)) {
this.$u.toast('手机格式错误');
return false;
}
}
return true;
},
writeFeedback() {
if(!this.verifyContent()) return false;
this.$u.api.writeFeedback({
fb_content: this.text,
fb_images: this.imageList,
}).then(res => {
if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
duration: 2000,
callback:() => {
this.$u.route({
type: "navigateBack",
url: '/pageE/more/Complaints',
})
}
})
} else {
this.debounce = true;
this.$u.toast(res.message);
}
})
},
},
}
</script>
<style lang="scss" scoped>
.write-complaints {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
.main-container {
background-color: #ffffff;
.text-box {
padding-bottom: 60rpx;
position: relative;
&::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
height: 3rpx;
width: 750rpx;
background-color: #ECECEC;
}
.text-length {
height: 60rpx;
position: absolute;
right: 40rpx;
bottom: 0;
color: #999;
}
}
/deep/ .textarea {
padding: 0 30rpx !important;
width: 100% !important;
margin-bottom: 10rpx;
}
/deep/ .phone {
padding: 20rpx 30rpx !important;
}
}
.write-btn {
margin: 120rpx auto 0;
width: 690rpx;
height: 98rpx;
background: rgba(255,120,15,1);
border-radius: 46rpx;
font-size: 36rpx;
color: rgba(255,255,255,1);
text-align: center;
line-height: 98rpx;
}
}
</style>

View File

@ -23,6 +23,10 @@
<text>骑手投诉</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="toOthersPage('feedback')">
<text>用户反馈</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="clearCache">
<text>清除缓存</text>
<text>{{ fileSizeString }}</text>