CfAppraise.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view class="cf-appraise">
  3. <pub-loading-view :loaded="loaded" height="100%">
  4. <view class="cf-appraise-section" v-if="info">
  5. <view class="cf-appraise-top-section">
  6. <view class="cf-appraise-top">
  7. <view class="cf-appraise-top-title">“中医用药一件事”满意度调查</view>
  8. <view class="cf-appraise-top-comprehensive">
  9. <view class="appraise-star-title">综合评价</view>
  10. <view class="cf-appraise-top-comprehensive-item" :class="info.comprehensiveVal==0?'is-active':''"
  11. @click="onClickComprehensive(0)">
  12. <text class="iconfont">&#xe687;</text>差评
  13. </view>
  14. <view class="cf-appraise-top-comprehensive-item" :class="info.comprehensiveVal==1?'is-active':''"
  15. @click="onClickComprehensive(1)">
  16. <text class="iconfont">&#xe698;</text>中评
  17. </view>
  18. <view class="cf-appraise-top-comprehensive-item" :class="info.comprehensiveVal==2?'is-active':''"
  19. @click="onClickComprehensive(2)">
  20. <text class="iconfont">&#xe696;</text>好评
  21. </view>
  22. </view>
  23. <CfAppraiseStar :isEdit="isEdit" title="就医效果" :starText="starText[0]" v-model:starval="info.starVal[0]" />
  24. <CfAppraiseStar :isEdit="isEdit" title="开方医生" :starText="starText[1]" v-model:starval="info.starVal[1]" />
  25. <CfAppraiseStar :isEdit="isEdit" title="煎药质量" :starText="starText[2]" v-model:starval="info.starVal[2]" />
  26. <CfAppraiseStar :isEdit="isEdit" title="物流服务" :starText="starText[3]" v-model:starval="info.starVal[3]" />
  27. </view>
  28. <view class="cf-appraise-view" v-if="isEdit">
  29. <view class="cf-appraise-view-text">{{info.text}}</view>
  30. <view class="cf-appraise-view-imgs">
  31. <image mode="heightFix" :src="item" v-for="(item,index) in info.imgList" :item="index" />
  32. </view>
  33. </view>
  34. <view class="cf-appraise-edit" v-else>
  35. <view class="cf-appraise-edit-tips">
  36. 展开说说您对“中医用药一件事”的想法吧...
  37. </view>
  38. <!-- 最多三张 -->
  39. <view class="cf-appraise-edit-add">
  40. <text class="iconfont">&#xe69f;</text>
  41. </view>
  42. </view>
  43. <view class="cf-appraise-anonymous">
  44. <text class="iconfont" :class="info.anonymous?'is-active':''">&#xe699;</text>匿名评价
  45. </view>
  46. </view>
  47. <view class="cf-appraise-btn pub-button is-bg large" v-if="!isEdit" @click="onApply">提交评价</view>
  48. </view>
  49. </pub-loading-view>
  50. </view>
  51. </template>
  52. <script lang="ts" setup>
  53. import { ref, PropType, onMounted } from 'vue'
  54. import dlg from '@/lib/dlg.ts'
  55. import CfAppraiseStar from './CfAppraiseStar.vue'
  56. import testBgUrl from '/static/image/no-data.png'//to del
  57. const loaded = ref(false)
  58. const isEdit = ref(false)
  59. const starText = [['', '非常差', '差', '一般', '好', '完全康复'],
  60. ['', '非常差', '差', '一般', '好', '非常好'],
  61. ['', '非常差', '差', '一般', '好', '非常好'],
  62. ['', '非常差', '差', '一般', '好', '非常好']]
  63. const info = ref()
  64. const infoNew = ref({
  65. starVal: [0, 0, 0, 0],
  66. comprehensiveVal: 0,
  67. text: '',
  68. imgList: [
  69. ],
  70. anonymous: true
  71. })
  72. const info2 = ref({
  73. starVal: [5, 4, 3, 2],
  74. comprehensiveVal: 2,
  75. text: '中药材资源是中医药的物质基础,其质量事关临床用药的安全性与有效性,其科学评价是中药产业现代化、标准化以及国际化的前提条件。 中药材的性状特征、药效成分以及分子标记为迄今三类质量评价方法的主要依据 ',
  76. imgList: [
  77. testBgUrl, testBgUrl, testBgUrl
  78. ],
  79. anonymous: true
  80. })
  81. const onClickComprehensive = (val : number) => {
  82. info.value.comprehensiveVal = val
  83. }
  84. const getInfo = async () => {
  85. loaded.value = true;
  86. // todo 有值取值,没值初始化
  87. info.value = infoNew.value
  88. // isEdit.value = true
  89. // info.value = info2.value
  90. loaded.value = false;
  91. }
  92. const onApply = () => {
  93. console.log("info.value", info.value)
  94. dlg.success('操作成功')
  95. }
  96. onMounted(() => {
  97. getInfo()
  98. })
  99. </script>
  100. <style lang="scss" scoped>
  101. .cf-appraise {
  102. padding: 0 $page-row-spacing;
  103. height: 100%;
  104. .cf-appraise-section {
  105. height: 100%;
  106. position: relative;
  107. display: flex;
  108. flex-direction: column;
  109. .cf-appraise-top-section {
  110. flex: 1;
  111. box-sizing: border-box;
  112. overflow-y: auto;
  113. .cf-appraise-top {
  114. background: #fff;
  115. padding: $uni-spacing-col-s3 $page-row-spacing;
  116. border-radius: 8rpx;
  117. .cf-appraise-top-title {
  118. font-size: $uni-font-size-xl;
  119. line-height: $uni-line-height-xl;
  120. font-weight: 600;
  121. }
  122. .cf-appraise-top-comprehensive {
  123. @include flex;
  124. margin-top: 40rpx;
  125. .cf-appraise-top-comprehensive-item {
  126. margin-left: 48rpx;
  127. @include flex;
  128. color: $uni-text-color-light;
  129. .iconfont {
  130. font-size: 48rpx;
  131. margin-right: 8rpx;
  132. background: linear-gradient(180deg, #B3B5B9 0%, #899AB9 100%);
  133. background-clip: text;
  134. text-fill-color: transparent;
  135. -webkit-background-clip: text;
  136. -webkit-text-fill-color: transparent;
  137. }
  138. &:nth-child(2) {
  139. margin-left: 32rpx;
  140. }
  141. &.is-active {
  142. color: $uni-text-color;
  143. .iconfont {
  144. background: linear-gradient(180deg, #FFBD48 0%, $uni-color-orange 100%);
  145. background-clip: text;
  146. text-fill-color: transparent;
  147. -webkit-background-clip: text;
  148. -webkit-text-fill-color: transparent;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. .cf-appraise-view {
  155. background: #fff;
  156. padding: $uni-spacing-col-s2 $uni-spacing-row-s3 $uni-spacing-col-s4;
  157. border-radius: 8rpx;
  158. margin-top: 24rpx;
  159. .cf-appraise-view-imgs {
  160. margin-top: 16rpx;
  161. image {
  162. width: 200rpx;
  163. height: 200rpx;
  164. border-radius: 8rpx;
  165. &+image {
  166. margin-left: 16rpx;
  167. }
  168. }
  169. }
  170. }
  171. .cf-appraise-edit {
  172. background: #fff;
  173. padding: $uni-spacing-col-s4 $uni-spacing-row-s4;
  174. border-radius: 8rpx;
  175. margin-top: 24rpx;
  176. color: $uni-text-color-grey;
  177. .cf-appraise-edit-add {
  178. margin-top: 16rpx;
  179. width: 200rpx;
  180. height: 200rpx;
  181. border-radius: 8rpx;
  182. background: linear-gradient(0deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), #1E92F0;
  183. @include flex-center;
  184. .iconfont {
  185. font-size: 76rpx;
  186. color: $uni-color-primary;
  187. }
  188. }
  189. }
  190. .cf-appraise-anonymous {
  191. margin: $uni-spacing-col-s4 0 $uni-spacing-col-s4 $uni-spacing-row-s4;
  192. @include flex;
  193. // font-size: $uni-font-size-sm;
  194. // line-height: $uni-line-height-lg;
  195. .iconfont {
  196. margin-right: 16rpx;
  197. font-size: 40rpx;
  198. background: linear-gradient(180deg, #B3B5B9 0%, #899AB9 100%);
  199. background-clip: text;
  200. text-fill-color: transparent;
  201. -webkit-background-clip: text;
  202. -webkit-text-fill-color: transparent;
  203. &.is-active {
  204. background: linear-gradient(180deg, #46ACFF 0%, $uni-color-primary 100%);
  205. background-clip: text;
  206. text-fill-color: transparent;
  207. -webkit-background-clip: text;
  208. -webkit-text-fill-color: transparent;
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. </style>