| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <view class="page">
- <view class="content">
- <view style="padding: 30rpx 0;">
- <text>请选择您要反馈的问题类型:</text>
- </view>
- <radio-group class="block" @change="RadioChange">
- <view class="radioBox">
- <view class="radioItem" :class="data.feedbackType==item.feedbackType?'checkBorder':'defalutBorder'" v-for="(item,index) in typeList" :key="index">
- <label class="flex" >
- <view class="">
- <radio style="transform: scale(.7);" class="round blue" :class="data.feedbackType===item.feedbackType?'checked':''" :checked="data.feedbackType==item.feedbackType?true:false"
- :value="item.feedbackType"></radio>
- </view>
- <view class="text-left padding-left-20 flex" style="flex-direction: column;justify-content: center;">
- {{item.title}}
- </view>
- </label>
- </view>
- </view>
- </radio-group>
- <view class="area">
- <view >
- <textarea @input="input" :value="data.content" maxlength="120" placeholder="请描述您的问题,以便我们尽快为您处理"></textarea>
- <view class="text-right text-df text-gray padding-bottom-10">
- {{data.content.length}} / 120
- </view>
- </view>
- <view class="imgArea">
- <view class="padding-bottom-20">
- <text class="">请提供相关问题的截图或照片(最多四张)</text>
- </view>
- <view class="cu-form-group" style="padding: 20rpx 0 0 0;">
- <view class="grid col-4 grid-square flex-sub">
- <view class="bg-img" v-for="(item,index) in imgList" :key="index" @click="viewImage(index)" >
- <image :src="imgList[index]" mode="aspectFill"></image>
- <view class="cu-tag bg-red" style="padding: 6rpx;" @click.stop="DelImg(index)" >
- <text class='cuIcon-close' ></text>
- </view>
- </view>
- <view class="solids" @click="chooseImage" v-if="imgList.length<4">
- <text class='cuIcon-add ' style="font-size: 60rpx;color: #c9c9c9;"></text>
- </view>
- </view>
- </view>
- <!-- <u-upload @on-choose-complete="chooseImage" :auto-upload="false" width="194" height="194" :action="action" max-count="4" :file-list="fileList" ></u-upload> -->
- </view>
-
- </view>
- <view class="bg-white" style="height: 150rpx;">
-
- </view>
- </view>
- <view @click="submit" class=" footer-fixed cu-btn base-bg-color flex " style="padding: 45rpx;" :style="{marginBottom:safeAreaBottom}">
- 提交反馈
- </view>
- </view>
- </template>
- <script>
- var app = getApp();
- export default {
- data() {
- return {
- //图片回显
- imgList:[],
- data:{
- name:'',
-
- content:'',
- images:'',
- feedbackType:"0",
- },
- //选择项列表
- typeList:[
- {
- title:'功能异常:功能故障或不可用',
- feedbackType:'0'
- },
- {
- title:'产品建议:用的不爽,我有建议',
- feedbackType:'1'
- },
- {
- title:'安全密码:密码,故障等',
- feedbackType:'2'
- },
- {
- title:'其他问题',
- feedbackType:'3'
- },
- ],
- }
- },
- computed: {
- //ios底部安全区域
- safeAreaBottom() {
- let info = uni.getSystemInfoSync()
- let safe = 20
- if (
- info &&
- ['devtools', 'ios'].includes(info.platform) &&
- info.statusBarHeight > safe
- ) {
- return info.statusBarHeight - safe+'px'
- }
- return 0
- }
- },
- methods: {
- //选择反馈类型
- RadioChange(e){
- this.data.feedbackType=e.detail.value
- },
- /**输入问题描述
- * @param {Object} e
- */
- input(e){
- this.data.content=e.detail.value
- },
- submit(){
- this.data.agnecyId=this.$cache.get('agencyId')
- if (this.$cache.get('loginType')==this.$loginType.STAFF) {
- let userInfo=getApp().globalData.userInfo
- this.data.openId=userInfo.openId
- this.data.name=userInfo.realName
- this.data.phone=userInfo.phone
- }else if(this.$cache.get('loginType')==this.$loginType.ENTERPRISE){
- this.data.name=this.$cache.get('enterpriseName')
- }
- this.data.images=this.imgList.join(',')
- if (this.$isEmpty(this.data.content)) {
- uni.showToast({
- title:"问题描述不能为空",
- icon:"none"
- })
- return
- }
- if (this.data.content.length<3) {
- uni.showToast({
- title:"问题描述不能少于三个字",
- icon:"none"
- })
- return
- }
- if (this.$isEmpty(this.data.images)) {
- uni.showToast({
- title:"请提供相关截图",
- icon:"none"
- })
- return
- }
- this.$api.feedback.submit(this.data).then(res=>{
- if (res.success) {
- this.$showModel('提交成功,感谢您的反馈!',false).then(res=>{
- uni.navigateBack({
- delta:1
- })
- })
- }
- })
- },
- /**
- * 上传问题截图
- */
- chooseImage() {
- let that=this
- uni.chooseImage({
- count: 4-this.imgList.length,
- sizeType: ['original', 'compressed'],
- sourceType: ['album'],
- success: (res) => {
- const tempFilePaths = res.tempFilePaths;
- for (let index in tempFilePaths) {
- that.$api.uploadFile.submit(tempFilePaths[index]).then(res=>{
- that.imgList.push(res.data.link)
- })
- }
- }
- });
- },
- /*预览图片*/
- viewImage(index) {
- uni.previewImage({
- urls: this.imgList,
- current: index
- });
- },
- /*删除图片*/
- DelImg(index) {
- uni.showModal({
- title: '提示',
- content: '确定要删除这张照片吗?',
- cancelText: '取消',
- confirmText: '确定',
- success: res => {
- if (res.confirm) {
- this.imgList.splice(index, 1)
- }
- }
- })
- },
- }
- }
- </script>
- <style lang="scss">
- .page{
- background-color: #FFFFFF;
- min-height: 100vh;
- }
- view{
- box-sizing: border-box;
- }
-
- .commit{
- color: #fff;
- font-size: 28upx;
- text-align: center;
- line-height: 88upx;
- margin: 0 20upx;
- width: 690upx;
- height:88upx;
- background:$base-color;
- border-radius:25px;
- margin-bottom: 50upx;
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
-
- }
- .content{
- margin: 0 26rpx;
- .radioBox{
- padding-top: 10rpx;
- .radioItem{
- padding: 18rpx;
- margin-bottom: 15rpx;
- border-radius: 10rpx;
- }
- .defalutBorder{
- border: 1rpx solid #d1d1d1;
- }
- .checkBorder{
- border: 1rpx solid $base-color;
- color: $base-color;
- }
-
- }
- .area{
- margin-top: 20rpx;
- padding: 20rpx;
- border-radius: 12rpx;
- border: 1rpx solid #d1d1d1;
-
- textarea{
- width: 100%;
- line-height: 50rpx;
- }
- .imgArea{
- border-top: 1rpx solid #d1d1d1;
- padding-top: 30rpx;
- }
-
- }
- }
-
- </style>
|