suggestionsFeedback.vue 11 KB

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