pingOrder.vue 5.6 KB

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