evaluateCompalin.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <!-- 投诉评价 -->
  2. <template>
  3. <view class="pageBg">
  4. <view class="content">
  5. <view class="topBack" :style="{marginTop:phoneHeight + 'px'}">
  6. <image src="../../static/icon_back@2x(1).png" style="width:48rpx ;height: 48rpx;margin-left: 36rpx;margin-top: 18rpx;"
  7. @tap="back"></image>
  8. </view>
  9. <view class="topImg">
  10. <image src="../../static/complain_icon_complain@2x.png" style="width: 100%;height: 100%;"></image>
  11. </view>
  12. <view class="topTitle">
  13. 投诉评价
  14. </view>
  15. <view class="main">
  16. <image src="../../static/appraise_bgimage@2x.png" style="width: 100%;height: 100%;"></image>
  17. <image src="../../static/appraise_icon_appraise@2x.png" class="mainImg"></image>
  18. <view class="fa">发表评价</view>
  19. <view class="star">
  20. <uni-rate :value="starNum" style="margin-top: 10rpx;margin-left: 80rpx;" @change="changeRate()"></uni-rate>
  21. </view>
  22. <image src="../../static/guarantee_icon_content@2x.png" class="contentImg"></image>
  23. <view class="contentTitle">
  24. 评价内容
  25. </view>
  26. <view class="textContent">
  27. <textarea placeholder="请填写评价" style="width: 95%;height: 96%;margin-left: 10rpx;margin-top: 10rpx;" v-model="textRea"
  28. cursor-spacing="120" maxlength="300"></textarea>
  29. </view>
  30. </view>
  31. </view>
  32. <button class="submit" :class="{active:starNum && textRea}" @tap="submit">提交</button>
  33. </view>
  34. </template>
  35. <script>
  36. import uniRate from '@/components/uni-rate/uni-rate.vue'
  37. export default {
  38. data() {
  39. return {
  40. isLoading: false,
  41. textRea: '', //评价内容
  42. starNum: 0, //星星数量
  43. phoneHeight: 0, //手机状态栏的高度
  44. isShow: false,
  45. imgData: [],
  46. id: ''
  47. }
  48. },
  49. components: {
  50. uniRate
  51. },
  52. created() {
  53. // 获取状态栏的高度
  54. this.phoneHeight = uni.getSystemInfoSync().statusBarHeight
  55. },
  56. onLoad(option) {
  57. this.id = option.id
  58. },
  59. methods: {
  60. // 选择评分
  61. changeRate(e) {
  62. this.starNum = e.value.toFixed(1)
  63. },
  64. // 提交
  65. submit() {
  66. if (!this.textRea || !this.starNum) {
  67. return
  68. } else {
  69. uni.showLoading({
  70. mask: true,
  71. title: '加载中'
  72. })
  73. this.http.httpRequest('/wxapplet/owneradvice/edit', 'post', {
  74. adviceId: Number(this.id),
  75. score: this.starNum,
  76. ownerEvalu: this.textRea
  77. }).then((res) => {
  78. // 判断请求是否成功 0 成功
  79. if (res.code == 0) {
  80. uni.setStorageSync('rateType', 0)
  81. this.textRea = ''
  82. this.starNum = 0
  83. uni.redirectTo({
  84. url: "../onlineRpair/evalueSuccess"
  85. })
  86. uni.hideLoading()
  87. } else {
  88. uni.hideLoading()
  89. uni.showToast({
  90. title: res.msg,
  91. "icon": 'none'
  92. })
  93. }
  94. }).catch(() => {
  95. uni.hideLoading()
  96. })
  97. }
  98. },
  99. // 返回上一层
  100. back() {
  101. uni.navigateBack({
  102. delta: 1
  103. })
  104. }
  105. },
  106. }
  107. </script>
  108. <style scoped>
  109. .submit {
  110. width: 702rpx;
  111. height: 90rpx;
  112. background: rgba(244, 244, 244, 1);
  113. opacity: 1;
  114. border-radius: 18rpx;
  115. font-size: 32rpx;
  116. font-family: PingFang SC;
  117. font-weight: bold;
  118. color: rgba(204, 204, 204, 1);
  119. position: absolute;
  120. bottom: 56rpx;
  121. left: 26rpx;
  122. text-align: center;
  123. line-height: 90rpx;
  124. }
  125. .textContent {
  126. width: 646rpx;
  127. height: 168rpx;
  128. background: rgba(246, 250, 255, 1);
  129. border: 2rpx solid rgba(197, 224, 255, 1);
  130. opacity: 1;
  131. border-radius: 6rpx;
  132. position: absolute;
  133. left: 24rpx;
  134. bottom: 180rpx;
  135. }
  136. .contentImg {
  137. width: 33rpx;
  138. height: 40rpx;
  139. position: absolute;
  140. bottom: 460rpx;
  141. left: 330rpx;
  142. }
  143. .contentTitle {
  144. width: 116rpx;
  145. height: 40rpx;
  146. font-size: 28rpx;
  147. font-family: PingFang SC;
  148. font-weight: bold;
  149. color: rgba(41, 138, 253, 1);
  150. position: absolute;
  151. bottom: 388rpx;
  152. left: 290rpx;
  153. }
  154. .star {
  155. width: 386rpx;
  156. height: 49rpx;
  157. display: flex;
  158. justify-content: space-between;
  159. position: absolute;
  160. left: 156rpx;
  161. top: 194rpx;
  162. }
  163. .starImg {
  164. width: 51rpx;
  165. height: 49rpx;
  166. }
  167. .fa {
  168. width: 116rpx;
  169. height: 40rpx;
  170. font-size: 28rpx;
  171. font-family: PingFang SC;
  172. font-weight: bold;
  173. color: rgba(41, 138, 253, 1);
  174. position: absolute;
  175. top: 114rpx;
  176. left: 288rpx;
  177. }
  178. .mainImg {
  179. width: 40rpx;
  180. height: 46rpx;
  181. position: absolute;
  182. top: 40rpx;
  183. left: 326rpx;
  184. }
  185. .main {
  186. width: 692rpx;
  187. height: 844rpx;
  188. margin: 0 auto;
  189. margin-top: 24rpx;
  190. position: relative;
  191. }
  192. .topTitle {
  193. width: 128rpx;
  194. height: 44rpx;
  195. font-size: 32rpx;
  196. font-family: PingFang SC;
  197. font-weight: 400;
  198. color: rgba(255, 255, 255, 1);
  199. margin: 0 auto;
  200. margin-top: 26rpx;
  201. }
  202. .topImg {
  203. width: 122rpx;
  204. height: 122rpx;
  205. margin: 0 auto;
  206. margin-top: 4rpx;
  207. }
  208. .pageBg {
  209. width: 100%;
  210. height: 100vh;
  211. background: linear-gradient(180deg, rgba(205, 227, 255, 1) 0%, rgba(133, 188, 255, 1) 100%);
  212. opacity: 1;
  213. }
  214. .content {
  215. width: 100%;
  216. position: absolute;
  217. top: 0;
  218. }
  219. .active {
  220. color: rgba(255, 255, 255, 1);
  221. background: rgba(41, 138, 253, 1);
  222. opacity: 1;
  223. }
  224. </style>