123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- <template>
- <view class="suggestions-feedback">
- <scroll-view scroll-y="true" class="scroll-Y" >
- <view class="score">
- <text class="row-name">* 评分</text>
- <view class="star-list">
- <view class="star" v-for="(item,index) in starList" @click="changeStat(index)" :key="index">
- <image v-if="score>index" class="activedStar" src="/static/activedStar.png" mode="scaleToFill">
- </image>
- <image v-if="index>=score" class="unActivedStar" src="/static/unActivedStar.png" mode="scaleToFill">
- </image>
- </view>
- </view>
- </view>
- <view class="fallback-type" @click="selectFallbackType">
- <text class="row-name">* 反馈类型</text>
- <view class="row-value">
- <picker @change="bindPickerChange" :value="index" :range="fallbackTypelist">
- <view class="uni-input">{{selectedFeedbackType}}</view>
- </picker>
- </view>
- <image class="icon-more" src="/static/images/icon-more.png"></image>
- </view>
- <view class="rich-text">
- <view class="richTextAreaTopbar">
- <text class="areaType">* 描述</text>
- <text class="placeholder" v-if="!ifTextAreaFocus">请输入</text>
- </view>
-
- <textarea class="text-area" @focus="ifTextAreaFocus=true" v-model="decDetail" />
-
- </view>
- <uploadImage @changeFilePaths="uploadImgFunc" :isMultiple="true" :filePaths="imgList"></uploadImage>
- <view class="btn-confirm" @click="commitFeedback">
- <text class="btn-text">确定</text>
- </view>
- </scroll-view>
- <tm-modal v-if="showModal">
- <view class="modalContent">
- <view class="inner">
- <image class="normalTipIcon" src="/static/normalTipIcon.png" ></image>
- <view class="tipText">
- 我们已经收到您的意见和反馈,感谢您对康程智医的信任与支持,我们将尽快处理并与 您联系
- </view>
- <view class="comfirmBtn" @click="goback">确定</view>
- </view>
- </view>
- </tm-modal>
- </view>
- </template>
- <script>
- import uploadImage from '../../components/tm-upload-img/tm-upload-img.vue'
- export default {
- data() {
- return {
- starList: new Array(5),
- score: 0,
- position:'',
- phoneNum:'',
- decDetail:'',
- ifTextAreaFocus:false,
- fallbackTypelist: [],
- index: 0,
- selectedFeedbackType:'',
- imgList:[],
- showModal:false
- };
- },
- components:{
- uploadImage:uploadImage
- },
- onLoad(){
- // console.log(window.location.host);
- },
- mounted() {
- this.getAllFeedbackList();
-
- },
- methods: {
- changeStat(index) {
- this.score = index+1; //设置星级等级
- },
- selectFallbackType() {
- // uni.navigateTo({
- // url: '/pages/fallbackTypeSelect/fallbackTypeSelect'
- // });
- },
- getAllFeedbackList(){
- this.$store.dispatch({
- type: 'suggestionsFeedback/commActions',
- payload: {
- key: 'getFeedbackTypeList',
- data: {
-
- }
- }
- }).then((data) => {
- this.fallbackTypelist = data;
- this.selectedFeedbackType = data[0];
- });
- },
-
- /**
- * @param {{
- files
- index,
- }} fileInfo
- files:文件集合
- index:当前编辑的下标
- */
- uploadImgFunc({files}){
- if(this.imgList.length<3){
- this.imgList = files;
- }else{
- uni.showModal({
- title: '错误提示',
- content: '最多上传3张',
- showCancel: false
- });
- }
- },
- bindPickerChange: function(e) {
- this.selectedFeedbackType = this.fallbackTypelist[e.target.value];
- },
- commitFeedback(){
- const data = {
- "score":this.score, // 评价分数
- "feedbackType":this.selectedFeedbackType, //评价类型
- "feedbackDesc":this.decDetail,//描述
- "imgUrl1": this.imgList[0]?this.imgList[0]:'', // 图片url1
- "imgUrl2": this.imgList[1]?this.imgList[1]:'',//
- "imgUrl3": this.imgList[2]?this.imgList[2]:'',//
- "position":this.position, // 职位
- "phoneNum":this.phoneNum
- }
- // console.log({'表单数据':data});
- let tipAlertStr="";
-
- if(this.score==0)tipAlertStr="请完善评分!";
- if(this.selectedFeedbackType=='')tipAlertStr="请选择反馈类型!";
- if(this.decDetail.length==0)tipAlertStr="请填写反馈内容!";
- // if(this.position.length==0)tipAlertStr="请填职位信息!";
- // if(this.phoneNum.length==0)tipAlertStr="请填写手机号码!";
-
- if(tipAlertStr.length>0){
- uni.showModal({
- title: '错误提示',
- content: tipAlertStr,
- showCancel: false
- });
- return;
- }
-
- this.$store.dispatch({
- type: 'suggestionsFeedback/commActions',
- payload: {
- key: 'feedback',
- data: {
- ...data
- }
- }
- }).then((data) => {
- // console.log({'表单提交接口返回':data});
- if(data){
- this.showModal = true;
- }
- });
- },
- goback(){
- uni.navigateBack({
- delta:1
- });
- }
- }
- }
- </script>
- <style lang="less">
- .suggestions-feedback {
- position: relative;
- padding-top: 15rpx;
- height: 100vh;
- background: #F5F6FA;
- .scroll-Y {
- padding-bottom:81.25rpx;
- }
- .modalContent {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100vw;
- height: 100vh;
- .inner {
- // position: relative;
- display: flex;
- flex-direction: column;
- // justify-content: center;
- align-items: center;
- width: 562.5rpx;
- height: 361.25rpx;
- margin: 0 auto;
- top:50%;
- padding-top: 50rpx;
- background: #FFFFFF;
- border-radius: 15rpx;
- .normalTipIcon {
- width: 80rpx;
- height:80rpx;
- margin-bottom: 28.75rpx;
- }
- .tipText {
- width: 427.5rpx;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- line-height: 31.25rpx;
- margin-bottom: 39.37rpx;
- }
- .comfirmBtn {
- width: 100%;
- height: 75rpx;
- line-height: 75rpx;
- text-align: center;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- background: #3377FF;
- }
- }
- }
- .score {
- display: flex;
- flex-direction: row;
- height: 112.5rpx;
- justify-content: flex-start;
- align-items: center;
- padding: 0 25rpx;
- background: #FFFFFF;
- .row-name {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- margin-right: 164.37rpx;
- }
- .star-list {
- display: flex;
- flex-direction: row;
- .star {
- position: relative;
- width: 50rpx;
- height: 50rpx;
- margin-right: 25rpx;
- .activedStar,
- .unActivedStar {
- position: absolute;
- left: 0;
- top: 0;
- width: 50rpx;
- height: 50rpx;
- }
- &:last-child {
- margin-right: 0;
- }
- }
- }
- }
- .fallback-type {
- position: relative;
- display: flex;
- flex-direction: row;
- height: 87.5rpx;
- justify-content: flex-start;
- align-items: center;
- padding: 0 25rpx;
- margin-top: 15rpx;
- background: #FFFFFF;
- .row-name {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- margin-right: 119.37rpx;
- }
- .row-value {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- }
- .icon-more {
- position: absolute;
- width: 12.37rpx;
- height: 21.21rpx;
- right: 33.12rpx;
- }
- }
- .rich-text {
- margin-top: 15rpx;
- padding-left: 25rpx;
- padding-right: 25rpx;
- background: #FFFFFF;
- .richTextAreaTopbar {
- display: flex;
- flex-direction: row;
- height:87.5rpx;
- padding-top: 32.5rpx;
- .areaType {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- margin-right: 164.37rpx;
- }
- .placeholder {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #B8BECC;
- }
- }
-
- .text-area {
- width:100%;
- height:262.5rpx;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- // border:1px solid red;
- }
- // .selectedImgContainer {
- // margin-bottom: 25rpx;
- // .selectedImg {
- // width: 125rpx;
- // height: 125rpx;
- // margin-right: 25rpx;
- // &:last-child {
- // margin-right: 0;
- // }
- // }
- // }
- // .uploadImgArea {
- // position: relative;
- // display: flex;
- // flex-direction: row;
- // justify-content: flex-start;
- // align-items: center;
- // height:87.5rpx;
- // border-top:1px solid #DADEE6;
- // .labelName {
- // position: absolute;
- // left:0;
- // font-size: 22.5rpx;
- // font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- // font-weight: 400;
- // color: #525866;
- // }
- // .activeArea {
- // position: absolute;
- // left:225rpx;
- // font-size: 22.5rpx;
- // font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- // font-weight: 400;
- // color: #B8BECC;
- // }
- // .imgIcon {
- // position: absolute;
- // left:663.75rpx;
- // width: 30rpx;
- // height: 30rpx;
- // }
- // }
- }
- .bottomForm {
- padding-left: 25rpx;
- margin-top: 15rpx;
- background-color: #FFFFFF;
- .jobTitle {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- height:87.5rpx;
- border-bottom: 1px solid #DADEE6;
- .label {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #525866;
- }
- .inputArea {
- text-align: center;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- }
- &:last-child {
- border:none;
- }
- }
- }
- .btn-confirm {
- position: fixed;
- bottom: 0;
- width: 100%;
- height: 75rpx;
- line-height: 75rpx;
- text-align: center;
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- background: #3377FF;
- }
- }
- </style>
|