drugReportPing.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view >
  3. <view class="content">
  4. <view class="ping" >
  5. <view class="title">
  6. 咨询评价
  7. </view>
  8. <view class="doc-box" v-if="report!=null">
  9. <view class="left">
  10. <image :src="report.avatar" mode="aspectFill"></image>
  11. </view>
  12. <view class="right">
  13. <view class="doc-name-box">
  14. <view class="doc-name">
  15. {{report.doctorName}}
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="ping-star">
  21. <text class="label">评分</text>
  22. <view class="star">
  23. <u-rate size="24" active-color="#fcab36" v-model="form.pingStar"></u-rate>
  24. </view>
  25. </view>
  26. <view class="ping-content">
  27. <view class="textarea-box">
  28. <textarea v-model="form.pingContent" placeholder="写入您对医生的评价吧" maxlength="200" />
  29. <view class="num-box">{{ form.pingContent.length }}/200</view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="btn-box">
  35. <view class="btn" @click="submit()">提交评价</view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {pingReport,getDrugReportById} from '@/api/drugReport'
  41. export default {
  42. data() {
  43. return {
  44. report:null,
  45. form:{
  46. reportId:null,
  47. pingStar:0,
  48. pingContent:"",
  49. }
  50. }
  51. },
  52. onLoad(options) {
  53. this.form.reportId=options.reportId;
  54. this.getDrugReportById()
  55. },
  56. methods: {
  57. getDrugReportById(){
  58. var that=this;
  59. var data={reportId:this.form.reportId}
  60. getDrugReportById(data).then(
  61. res => {
  62. if(res.code==200){
  63. this.report=res.data;
  64. }
  65. },
  66. err => {
  67. }
  68. );
  69. },
  70. submit(){
  71. uni.showLoading({
  72. title:"处理中..."
  73. })
  74. pingReport(this.form).then(
  75. res => {
  76. uni.hideLoading()
  77. if(res.code==200){
  78. uni.showToast({
  79. icon:'success',
  80. title: "评价成功",
  81. });
  82. uni.$emit('refreshDrugReportList');
  83. setTimeout(function(){
  84. uni.navigateBack({
  85. delta:1,
  86. })
  87. },2000);
  88. }else{
  89. uni.showToast({
  90. icon:'none',
  91. title: res.msg,
  92. });
  93. }
  94. },
  95. rej => {}
  96. );
  97. },
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .content{
  103. padding: 20rpx 20rpx 140rpx 20rpx;
  104. }
  105. .ping{
  106. margin-bottom:20rpx;
  107. padding: 20rpx;
  108. border-radius: 15rpx;
  109. background: #FFFFFF;
  110. .title{
  111. font-size: 34upx;
  112. font-family: PingFang SC;
  113. font-weight: bold;
  114. color: #0F1826;
  115. }
  116. .doc-box{
  117. margin-top: 30rpx;
  118. display: flex;
  119. align-items: center;
  120. justify-content: flex-start;
  121. .left{
  122. width: 100upx;
  123. height: 100upx;
  124. image{
  125. border-radius: 50%;
  126. width: 100upx;
  127. height: 100upx;
  128. }
  129. }
  130. .right{
  131. display: flex;
  132. flex-direction: column;
  133. justify-content: space-between;
  134. margin-left: 20rpx;
  135. height:120upx;
  136. width: 100%;
  137. .doc-name-box{
  138. display: flex;
  139. align-items: center;
  140. justify-content: flex-start;
  141. position: relative;
  142. .doc-name{
  143. font-size: 32rpx;
  144. }
  145. }
  146. }
  147. }
  148. .ping-star{
  149. padding-top: 30rpx;
  150. .label{
  151. font-size: 32upx;
  152. font-weight: bold;
  153. font-family: PingFang SC;
  154. color: #0F1826;
  155. }
  156. .star{
  157. margin-top: 10rpx;
  158. }
  159. }
  160. .ping-content{
  161. width: 100%;
  162. padding: 30rpx 0rpx;
  163. display: flex;
  164. align-items: center;
  165. justify-content: center;
  166. .textarea-box{
  167. width: 100%;
  168. box-sizing: border-box;
  169. height: 330upx;
  170. background: #f6f6f6;
  171. border-radius: 10upx;
  172. padding: 30upx;
  173. position: relative;
  174. .textarea-place{
  175. font-size: 28upx;
  176. font-family: PingFang SC;
  177. font-weight: 400;
  178. color: #C9CED6;
  179. }
  180. textarea{
  181. width: 100%;
  182. height: 100%;
  183. font-size: 28upx;
  184. font-family: PingFang SC;
  185. font-weight: 400;
  186. color: #000000;
  187. }
  188. .num-box{
  189. position: absolute;
  190. right: 20upx;
  191. bottom: 20upx;
  192. font-size: 24upx;
  193. font-family: PingFang SC;
  194. font-weight: 400;
  195. color: #C9CED6;
  196. z-index: 10;
  197. background: #F5F6FA;
  198. }
  199. }
  200. }
  201. }
  202. .btn-box{
  203. height: 140upx;
  204. z-index: 9999;
  205. width: 100%;
  206. padding: 0rpx 30upx;
  207. position: fixed;
  208. bottom: 0;
  209. left: 0;
  210. box-sizing: border-box;
  211. background-color: #ffffff;
  212. display: flex;
  213. align-items: center;
  214. justify-content: center;
  215. .btn{
  216. width: 100%;
  217. height: 88upx;
  218. line-height: 88upx;
  219. text-align: center;
  220. font-size: 34upx;
  221. font-family: PingFang SC;
  222. font-weight: 400;
  223. color: #FFFFFF;
  224. background: #C39A58;
  225. border-radius: 10upx;
  226. }
  227. }
  228. </style>