DomData.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /**
  2. *
  3. *
  4. * @param {*} number 第几位
  5. * @param {*} src 名片头像
  6. * @param {*} name 名片名字
  7. * @param {*} qrCodeUrl 小程序codeURL图片
  8. */
  9. import leiDa from "@/components/mpvueEcharts/leiDa.vue"
  10. const wxml = (testResult, totalScores, scoresList, persion) =>
  11. `
  12. <view class="total-score-progress-content">
  13. <u-row>
  14. <u-col span="9">
  15. <view class="demo-layout-bg-purple-light disRowAroundcenter">
  16. <view class="total-score-progress mrr textColor" v-if="`+totalScores+`">总分 </view>
  17. <view class="total-score-progress-width" v-if="`+totalScores+`">
  18. <view class=" marginBottom10 textColor">
  19. `+ testResult == 2? totalScores.toFixed(2) :scoresList[0].tableContext[0].value[0] +` 分
  20. </view>
  21. <view class="total-score-progress-line">
  22. <u-line-progress activeColor="#3FB4C9" height="18" :percentage="`+totalScores+`"
  23. :showText="`+false+`"></u-line-progress>
  24. </view>
  25. </view>
  26. </view>
  27. </u-col>
  28. <u-col span="3">
  29. <view class="demo-layout-bg-purple" v-if="`+totalScores+`">
  30. <image :src="`+persion+`"></image>
  31. </view>
  32. </u-col>
  33. </u-row>
  34. <u-row>
  35. <u-col span="12">
  36. <view class="demo-layout-bg-purple-light disRowAroundcenter">
  37. <view class="total-score-progress-test mrr textColor" v-if="`+improvementSuggestions!= '无'+`"+>
  38. 解读:<span> `+improvementSuggestions+`</span> </view>
  39. </view>
  40. </u-col>
  41. </u-row>
  42. <u-gap height="20"></u-gap>
  43. <u-row>
  44. <u-col span="9">
  45. <view class="demo-layout-bg-purple-light disRowAroundcenter">
  46. <view class="total-score-progress-test mrr textColor" v-if="`+name+`">量表名称:`+name+` </view>
  47. </view>
  48. </u-col>
  49. </u-row>
  50. <u-gap height="20"></u-gap>
  51. <u-row>
  52. <u-col span="12">
  53. <view class="demo-layout-bg-purple-light disRowAroundcenter">
  54. <view class="total-score-progress-test mrr textColor" v-if="`+time+`">测试时间:`+time+` </view>
  55. </view>
  56. </u-col>
  57. </u-row>
  58. <u-row>
  59. <u-col span="12">
  60. <div class="report-tip">
  61. <div class="tip-title">报告阅读说明</div>
  62. <p class="tip-desc">谢谢您的参与,阅读本报告时,请注意以下内容:</p>
  63. <!--<p class="tip-content">测评图表可快速帮您掌握报告内容;</p>-->
  64. <p class="tip-content">本结果仅供参考,不可作为临床诊断的依据;</p>
  65. <p class="tip-content">如结果与你自己或他人感知的有出入,可回忆在测试时是否有事情影响了你,或自己答题时是否有所顾虑;</p>
  66. <p class="tip-content">如对报告有不理解的地方,建议向专业资质人员进行咨询。</p>
  67. </div>
  68. </u-col>
  69. </u-row>
  70. </view>
  71. <view v-for="`+(items,index) in scoresList+`" :key="`+index+`">
  72. <view class="custom-style-list">
  73. <u-row customStyle="margin-bottom: 20rpx;background-color: rgb(232, 241, 242);padding:40rpx 0">
  74. <u-col span="6" v-for="`+(itemTitle,i) in items.colNames+`">
  75. <view class="custom-style-list-left textColor">
  76. `+itemTitle+`
  77. </view>
  78. </u-col>
  79. </u-row>
  80. </view>
  81. <view class="custom-style-list">
  82. <u-row customStyle="margin-bottom: 20rpx;padding:30rpx 0"
  83. v-for="`+(c,p) in testResult == 2 ?items.newTableContext.result : items.tableContext+`" :key="`+p+`"
  84. v-if='`+c.name != undefined+`'>
  85. <u-col span="6">
  86. <view class="custom-style-list-left">
  87. `+c.name+`
  88. </view>
  89. </u-col>
  90. <u-col span="6">
  91. <view class="custom-style-list-right">`+testResult == 2?c.score:c.value[0]+`</view>
  92. </u-col>
  93. </u-row>
  94. </view>
  95. </view>
  96. <leiDa :reference="`+reference+`" :scoreList="`+scoreList+`" :indicator="`+indicator+`" />
  97. <view class="custom-style-list padding20" v-for="(list,j) in symptomDescription" :key="j"
  98. v-if="list.symptom != undefined &&list.symptom != '无' && list.improvementSuggestions != '无' && list.symptom != '无'">
  99. <u-row>
  100. <u-col span="12">
  101. <view class="custom-style-list-left weight">
  102. <view v-if="list.name != '总分' &&list.symptom != '无' ">{{list.name}}:{{list.symptom}} </view>
  103. </view>
  104. </u-col>
  105. </u-row>
  106. <u-row>
  107. <u-col span="12" v-if="list.improvementSuggestions != '无'">
  108. <view class="padding10 textIndent">{{list.improvementSuggestions}}</view>
  109. </u-col>
  110. </u-row>
  111. </view>
  112. `
  113. // `
  114. // <view class="container">
  115. // <image src="`+pic+`" class="pic"/>
  116. // <text class="name">`+ name +`</text>
  117. // <text class="content">`+ c1 +`</text>
  118. // <text class="content">`+ c2 +`</text>
  119. // <view class="bottom">
  120. // <image src="`+pic+`" class="qr"/>
  121. // <text class="msg">扫码一起加入学习吧</text>
  122. // </view>
  123. // </view>
  124. // `
  125. /**
  126. *
  127. *
  128. * @param {*} screenWidth 屏幕宽度
  129. * @param {*} canvasWidth 画布宽度
  130. * @param {*} canvasHeight 画布高度
  131. * @param {*} numberWidth 数字宽度,动态设置
  132. * @return {*}
  133. */
  134. const style = (screenWidth, canvasWidth, canvasHeight) => {
  135. return {
  136. "container": {
  137. width: canvasWidth,
  138. height: canvasHeight,
  139. position: 'relative',
  140. overflow: 'hidden',
  141. backgroundColor: '#ffffff',
  142. },
  143. "name": {
  144. fontSize: 20,
  145. color: '#333',
  146. marginLeft: canvasWidth * 0.08,
  147. width: canvasWidth * 0.84,
  148. height: screenWidth * 0.18,
  149. textAlign: 'center',
  150. },
  151. "content": {
  152. fontSize: 14,
  153. color: '#333',
  154. width: canvasWidth * 0.84,
  155. height: screenWidth * 0.15,
  156. marginLeft: canvasWidth * 0.08,
  157. },
  158. "pic": {
  159. width: canvasWidth * 0.3,
  160. height: screenWidth * 0.28,
  161. marginTop: canvasWidth * 0.1,
  162. marginLeft: canvasWidth * 0.35,
  163. marginBottom: canvasWidth * 0.05,
  164. borderRadius: screenWidth * 0.14,
  165. overflow: 'hidden',
  166. },
  167. "bottom": {
  168. width: canvasWidth,
  169. height: screenWidth * 0.2,
  170. flexDirection: 'row',
  171. justifyContent: 'self-start',
  172. alignItems: 'center',
  173. backgroundColor: '#fafafa',
  174. position: 'absolute',
  175. bottom: 0,
  176. left: 0,
  177. },
  178. "qr": {
  179. width: canvasWidth * 0.14,
  180. height: screenWidth * 0.14,
  181. marginLeft: canvasWidth * 0.04,
  182. marginRight: canvasWidth * 0.04,
  183. },
  184. "msg": {
  185. fontSize: 14,
  186. color: '#a1a1a1',
  187. width: canvasWidth * 0.74,
  188. height: 14,
  189. textAlign: 'left'
  190. },
  191. }
  192. }
  193. module.exports = {
  194. wxml,
  195. style
  196. }