suggestionsFeedback.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <template>
  2. <view class="suggestions-feedback">
  3. <scroll-view scroll-y="true" class="scroll-Y" >
  4. <view class="score">
  5. <text class="row-name">* 评分</text>
  6. <view class="star-list">
  7. <view class="star" v-for="(item,index) in starList" @click="changeStat(index)" :key="index">
  8. <image v-if="score>index" class="activedStar" src="/static/activedStar.png" mode="scaleToFill">
  9. </image>
  10. <image v-if="index>=score" class="unActivedStar" src="/static/unActivedStar.png" mode="scaleToFill">
  11. </image>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="fallback-type" @click="selectFallbackType">
  16. <text class="row-name">* 反馈类型</text>
  17. <view class="row-value">
  18. <picker @change="bindPickerChange" :value="index" :range="fallbackTypelist">
  19. <view class="uni-input">{{selectedFeedbackType}}</view>
  20. </picker>
  21. </view>
  22. <image class="icon-more" src="/static/images/icon-more.png"></image>
  23. </view>
  24. <view class="rich-text">
  25. <view class="richTextAreaTopbar">
  26. <text class="areaType">* 描述</text>
  27. <text class="placeholder" v-if="!ifTextAreaFocus">请输入</text>
  28. </view>
  29. <textarea class="text-area" @focus="ifTextAreaFocus=true" v-model="decDetail" />
  30. </view>
  31. <uploadImage @changeFilePaths="uploadImgFunc" :isMultiple="true" :filePaths="imgList"></uploadImage>
  32. <view class="btn-confirm" @click="commitFeedback">
  33. <text class="btn-text">确定</text>
  34. </view>
  35. </scroll-view>
  36. <tm-modal v-if="showModal">
  37. <view class="modalContent">
  38. <view class="inner">
  39. <image class="normalTipIcon" src="/static/normalTipIcon.png" ></image>
  40. <view class="tipText">
  41. 我们已经收到您的意见和反馈,感谢您对康程智医的信任与支持,我们将尽快处理并与 您联系
  42. </view>
  43. <view class="comfirmBtn" @click="goback">确定</view>
  44. </view>
  45. </view>
  46. </tm-modal>
  47. </view>
  48. </template>
  49. <script>
  50. import uploadImage from '../../components/tm-upload-img/tm-upload-img.vue'
  51. export default {
  52. data() {
  53. return {
  54. starList: new Array(5),
  55. score: 0,
  56. position:'',
  57. phoneNum:'',
  58. decDetail:'',
  59. ifTextAreaFocus:false,
  60. fallbackTypelist: [],
  61. index: 0,
  62. selectedFeedbackType:'',
  63. imgList:[],
  64. showModal:false
  65. };
  66. },
  67. components:{
  68. uploadImage:uploadImage
  69. },
  70. onLoad(){
  71. // console.log(window.location.host);
  72. },
  73. mounted() {
  74. this.getAllFeedbackList();
  75. },
  76. methods: {
  77. changeStat(index) {
  78. this.score = index+1; //设置星级等级
  79. },
  80. selectFallbackType() {
  81. // uni.navigateTo({
  82. // url: '/pages/fallbackTypeSelect/fallbackTypeSelect'
  83. // });
  84. },
  85. getAllFeedbackList(){
  86. this.$store.dispatch({
  87. type: 'suggestionsFeedback/commActions',
  88. payload: {
  89. key: 'getFeedbackTypeList',
  90. data: {
  91. }
  92. }
  93. }).then((data) => {
  94. this.fallbackTypelist = data;
  95. this.selectedFeedbackType = data[0];
  96. });
  97. },
  98. /**
  99. * @param {{
  100. files
  101. index,
  102. }} fileInfo
  103. files:文件集合
  104. index:当前编辑的下标
  105. */
  106. uploadImgFunc({files}){
  107. if(this.imgList.length<3){
  108. this.imgList = files;
  109. }else{
  110. uni.showModal({
  111. title: '错误提示',
  112. content: '最多上传3张',
  113. showCancel: false
  114. });
  115. }
  116. },
  117. bindPickerChange: function(e) {
  118. this.selectedFeedbackType = this.fallbackTypelist[e.target.value];
  119. },
  120. commitFeedback(){
  121. const data = {
  122. "score":this.score, // 评价分数
  123. "feedbackType":this.selectedFeedbackType, //评价类型
  124. "feedbackDesc":this.decDetail,//描述
  125. "imgUrl1": this.imgList[0]?this.imgList[0]:'', // 图片url1
  126. "imgUrl2": this.imgList[1]?this.imgList[1]:'',//
  127. "imgUrl3": this.imgList[2]?this.imgList[2]:'',//
  128. "position":this.position, // 职位
  129. "phoneNum":this.phoneNum
  130. }
  131. // console.log({'表单数据':data});
  132. let tipAlertStr="";
  133. if(this.score==0)tipAlertStr="请完善评分!";
  134. if(this.selectedFeedbackType=='')tipAlertStr="请选择反馈类型!";
  135. if(this.decDetail.length==0)tipAlertStr="请填写反馈内容!";
  136. // if(this.position.length==0)tipAlertStr="请填职位信息!";
  137. // if(this.phoneNum.length==0)tipAlertStr="请填写手机号码!";
  138. if(tipAlertStr.length>0){
  139. uni.showModal({
  140. title: '错误提示',
  141. content: tipAlertStr,
  142. showCancel: false
  143. });
  144. return;
  145. }
  146. this.$store.dispatch({
  147. type: 'suggestionsFeedback/commActions',
  148. payload: {
  149. key: 'feedback',
  150. data: {
  151. ...data
  152. }
  153. }
  154. }).then((data) => {
  155. // console.log({'表单提交接口返回':data});
  156. if(data){
  157. this.showModal = true;
  158. }
  159. });
  160. },
  161. goback(){
  162. uni.navigateBack({
  163. delta:1
  164. });
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="less">
  170. .suggestions-feedback {
  171. position: relative;
  172. padding-top: 15rpx;
  173. height: 100vh;
  174. background: #F5F6FA;
  175. .scroll-Y {
  176. padding-bottom:81.25rpx;
  177. }
  178. .modalContent {
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. width: 100vw;
  183. height: 100vh;
  184. .inner {
  185. // position: relative;
  186. display: flex;
  187. flex-direction: column;
  188. // justify-content: center;
  189. align-items: center;
  190. width: 562.5rpx;
  191. height: 361.25rpx;
  192. margin: 0 auto;
  193. top:50%;
  194. padding-top: 50rpx;
  195. background: #FFFFFF;
  196. border-radius: 15rpx;
  197. .normalTipIcon {
  198. width: 80rpx;
  199. height:80rpx;
  200. margin-bottom: 28.75rpx;
  201. }
  202. .tipText {
  203. width: 427.5rpx;
  204. font-size: 22.5rpx;
  205. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  206. font-weight: 400;
  207. color: #292C33;
  208. line-height: 31.25rpx;
  209. margin-bottom: 39.37rpx;
  210. }
  211. .comfirmBtn {
  212. width: 100%;
  213. height: 75rpx;
  214. line-height: 75rpx;
  215. text-align: center;
  216. font-size: 22.5rpx;
  217. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  218. font-weight: 400;
  219. color: #FFFFFF;
  220. background: #3377FF;
  221. }
  222. }
  223. }
  224. .score {
  225. display: flex;
  226. flex-direction: row;
  227. height: 112.5rpx;
  228. justify-content: flex-start;
  229. align-items: center;
  230. padding: 0 25rpx;
  231. background: #FFFFFF;
  232. .row-name {
  233. font-size: 22.5rpx;
  234. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  235. font-weight: 400;
  236. color: #525866;
  237. margin-right: 164.37rpx;
  238. }
  239. .star-list {
  240. display: flex;
  241. flex-direction: row;
  242. .star {
  243. position: relative;
  244. width: 50rpx;
  245. height: 50rpx;
  246. margin-right: 25rpx;
  247. .activedStar,
  248. .unActivedStar {
  249. position: absolute;
  250. left: 0;
  251. top: 0;
  252. width: 50rpx;
  253. height: 50rpx;
  254. }
  255. &:last-child {
  256. margin-right: 0;
  257. }
  258. }
  259. }
  260. }
  261. .fallback-type {
  262. position: relative;
  263. display: flex;
  264. flex-direction: row;
  265. height: 87.5rpx;
  266. justify-content: flex-start;
  267. align-items: center;
  268. padding: 0 25rpx;
  269. margin-top: 15rpx;
  270. background: #FFFFFF;
  271. .row-name {
  272. font-size: 22.5rpx;
  273. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  274. font-weight: 400;
  275. color: #525866;
  276. margin-right: 119.37rpx;
  277. }
  278. .row-value {
  279. font-size: 22.5rpx;
  280. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  281. font-weight: 400;
  282. color: #292C33;
  283. }
  284. .icon-more {
  285. position: absolute;
  286. width: 12.37rpx;
  287. height: 21.21rpx;
  288. right: 33.12rpx;
  289. }
  290. }
  291. .rich-text {
  292. margin-top: 15rpx;
  293. padding-left: 25rpx;
  294. padding-right: 25rpx;
  295. background: #FFFFFF;
  296. .richTextAreaTopbar {
  297. display: flex;
  298. flex-direction: row;
  299. height:87.5rpx;
  300. padding-top: 32.5rpx;
  301. .areaType {
  302. font-size: 22.5rpx;
  303. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  304. font-weight: 400;
  305. color: #525866;
  306. margin-right: 164.37rpx;
  307. }
  308. .placeholder {
  309. font-size: 22.5rpx;
  310. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  311. font-weight: 400;
  312. color: #B8BECC;
  313. }
  314. }
  315. .text-area {
  316. width:100%;
  317. height:262.5rpx;
  318. font-size: 22.5rpx;
  319. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  320. font-weight: 400;
  321. color: #525866;
  322. // border:1px solid red;
  323. }
  324. // .selectedImgContainer {
  325. // margin-bottom: 25rpx;
  326. // .selectedImg {
  327. // width: 125rpx;
  328. // height: 125rpx;
  329. // margin-right: 25rpx;
  330. // &:last-child {
  331. // margin-right: 0;
  332. // }
  333. // }
  334. // }
  335. // .uploadImgArea {
  336. // position: relative;
  337. // display: flex;
  338. // flex-direction: row;
  339. // justify-content: flex-start;
  340. // align-items: center;
  341. // height:87.5rpx;
  342. // border-top:1px solid #DADEE6;
  343. // .labelName {
  344. // position: absolute;
  345. // left:0;
  346. // font-size: 22.5rpx;
  347. // font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  348. // font-weight: 400;
  349. // color: #525866;
  350. // }
  351. // .activeArea {
  352. // position: absolute;
  353. // left:225rpx;
  354. // font-size: 22.5rpx;
  355. // font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  356. // font-weight: 400;
  357. // color: #B8BECC;
  358. // }
  359. // .imgIcon {
  360. // position: absolute;
  361. // left:663.75rpx;
  362. // width: 30rpx;
  363. // height: 30rpx;
  364. // }
  365. // }
  366. }
  367. .bottomForm {
  368. padding-left: 25rpx;
  369. margin-top: 15rpx;
  370. background-color: #FFFFFF;
  371. .jobTitle {
  372. display: flex;
  373. flex-direction: row;
  374. justify-content: flex-start;
  375. align-items: center;
  376. height:87.5rpx;
  377. border-bottom: 1px solid #DADEE6;
  378. .label {
  379. font-size: 22.5rpx;
  380. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  381. font-weight: 400;
  382. color: #525866;
  383. }
  384. .inputArea {
  385. text-align: center;
  386. font-size: 22.5rpx;
  387. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  388. font-weight: 400;
  389. color: #292C33;
  390. }
  391. &:last-child {
  392. border:none;
  393. }
  394. }
  395. }
  396. .btn-confirm {
  397. position: fixed;
  398. bottom: 0;
  399. width: 100%;
  400. height: 75rpx;
  401. line-height: 75rpx;
  402. text-align: center;
  403. font-size: 22.5rpx;
  404. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  405. font-weight: 400;
  406. color: #FFFFFF;
  407. background: #3377FF;
  408. }
  409. }
  410. </style>