|
@@ -1,73 +1,120 @@
|
|
|
<template>
|
|
|
<view class="feedback-wrapper">
|
|
|
|
|
|
- <view class="input-box">
|
|
|
- <textarea type="text" placeholder="请输入您要反馈的内容" v-model="con" />
|
|
|
+ <view>
|
|
|
+ <textarea type="text" placeholder="请输入您要反馈的内容" v-model="param.content" />
|
|
|
</view>
|
|
|
- <view class="input-box">
|
|
|
+ <view class="flex-col">
|
|
|
<text class="info" selectable="false" space="false" decode="false">
|
|
|
上传图片
|
|
|
</text>
|
|
|
- <u-upload action="http://www.example.com/upload" :file-list="[
|
|
|
- ]" max-count="1"></u-upload>
|
|
|
+ <view v-if="param.imgUrl">
|
|
|
+ <view class="qr-cord-box ">
|
|
|
+ <uni-badge class="uni-badge-left-margin" text="X" absolute="rightTop" size="small" @click="clickBadge">
|
|
|
+ <image class="image" :src="param.imgUrl" ></image>
|
|
|
+ </uni-badge>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <view class="qr-cord-box flex-col">
|
|
|
+ <image class="add-file-image " src="../../../static/images/addFile.png" @click="uploadQrCord"></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="sub_btn" @click="subMit">
|
|
|
- <button class='modifyBnt' formType="submit">保存</button>
|
|
|
-
|
|
|
+ <button class='modifyBnt' >提交</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { serviceFeedBack, feedBackPost } from '@/api/kefu.js'
|
|
|
+ import {saveFilecontent} from '@/api/groupon.js'
|
|
|
export default {
|
|
|
name: 'feedback',
|
|
|
data () {
|
|
|
return {
|
|
|
- name: '',
|
|
|
- phone: '',
|
|
|
- con: '',
|
|
|
+ fileList1: [],
|
|
|
+ param:{
|
|
|
+ type:1,
|
|
|
+ content:'',
|
|
|
+ imgUrl:''
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
onLoad () {
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 上传微信二维码
|
|
|
+ */
|
|
|
+ uploadQrCord(){
|
|
|
+ let _this = this;
|
|
|
+ this.$util.uploadImageOne({
|
|
|
+ name: "file"
|
|
|
+ }, function(res) {
|
|
|
+ console.log("上传文件成功+++++++++++++++++++",res.data.link)
|
|
|
+ _this.param.imgUrl = res.data.link
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ clickBadge(){
|
|
|
+ this.param.imgUrl ='';
|
|
|
+ console.log("点击了XX")
|
|
|
+ },
|
|
|
|
|
|
subMit () {
|
|
|
- if (!this.name) {
|
|
|
+ if (!this.param.content) {
|
|
|
return this.$util.Tips({
|
|
|
- title: this.$t(`请输入姓名`)
|
|
|
+ title: this.$t(`请输入建议内容`)
|
|
|
})
|
|
|
}
|
|
|
- if (!this.phone || !(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.phone))) {
|
|
|
- return this.$util.Tips({
|
|
|
- title: this.$t(`请输入正确的手机号码`)
|
|
|
- })
|
|
|
- }
|
|
|
- if (!this.con) {
|
|
|
- return this.$util.Tips({
|
|
|
- title: this.$t(`请填写内容`)
|
|
|
- })
|
|
|
- }
|
|
|
- feedBackPost({
|
|
|
- rela_name: this.name,
|
|
|
- phone: this.phone,
|
|
|
- content: this.con
|
|
|
- }).then(res => {
|
|
|
- this.$util.Tips({
|
|
|
- title: res.msg,
|
|
|
- icon: 'success'
|
|
|
- }, {
|
|
|
- tab: 3
|
|
|
- })
|
|
|
- }).catch(function (res) {
|
|
|
- that.$util.Tips({ title: res });
|
|
|
- });
|
|
|
+
|
|
|
+ saveFilecontent(this.param).then(res => {
|
|
|
+ uni.$u.toast(res.msg)
|
|
|
+ setTimeout(()=>{
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
+ },2000)
|
|
|
+ }).catch(err =>{
|
|
|
+ uni.$u.toast(err)
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
+
|
|
|
+ @import '../../../static/css/common.css';
|
|
|
+
|
|
|
+ .qr-cord-box{
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ border: 1px solid rgba(238, 238, 238, 1);
|
|
|
+ .image{
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ }
|
|
|
+ .add-file-image{
|
|
|
+ width: 100rpx;
|
|
|
+ height: 100rpx;
|
|
|
+ margin-left: 50rpx;
|
|
|
+ margin-top: 50rpx;
|
|
|
+ }
|
|
|
+ text{
|
|
|
+ overflow-wrap: break-word;
|
|
|
+ color: rgba(153, 153, 153, 1);
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: NaN;
|
|
|
+ text-align: center;
|
|
|
+ white-space: nowrap;
|
|
|
+ line-height: 40rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.feedback-wrapper{
|
|
|
background: #fff;
|
|
|
margin-top: 20rpx;
|