普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
3.7 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="问卷测评" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="transparent" />
  4. <view class="main">
  5. <view class="title">
  6. <view class="title-zh">个人营养问卷</view>
  7. <view class="title-en">Personal Nutrition Survey</view>
  8. </view>
  9. <view class="flex desc">
  10. <view class="dot"></view>完成问卷大概需要3~5分钟
  11. </view>
  12. </view>
  13. <view class="footer">
  14. <view class="agreement">
  15. <uv-checkbox-group
  16. v-model="checkboxValue"
  17. shape="circle"
  18. >
  19. <uv-checkbox
  20. size="40rpx"
  21. icon-size="40rpx"
  22. activeColor="#7451DE"
  23. :name="1"
  24. ></uv-checkbox>
  25. </uv-checkbox-group>
  26. <view class="desc">
  27. 我已阅读并同意
  28. <!-- todo: 替换配置项key -->
  29. <text class="highlight" @click="$refs.modal.open('config_agreement', '用户协议')">用户协议</text>
  30. <!-- todo: 替换配置项key -->
  31. <text class="highlight" @click="$refs.modal.open('config_privacy', '隐私协议')">隐私协议</text>
  32. </view>
  33. </view>
  34. <view class="bar">
  35. <button class="btn" @click="onStart">开始答题</button>
  36. </view>
  37. </view>
  38. <agreementModal ref="modal" @confirm="onConfirmAgreement"></agreementModal>
  39. </view>
  40. </template>
  41. <script>
  42. import agreementModal from '@/pages_order/components/agreementModal.vue'
  43. export default {
  44. components: {
  45. agreementModal,
  46. },
  47. data() {
  48. return {
  49. checkboxValue : []
  50. }
  51. },
  52. methods: {
  53. onStart(){
  54. if(!this.checkboxValue.length){
  55. return uni.showToast({
  56. title: '请先同意《用户协议》《隐私协议》',
  57. icon:'none'
  58. })
  59. }
  60. this.$utils.navigateTo('/pages_order/report/test/step?step=0')
  61. },
  62. onConfirmAgreement(confirm) {
  63. if (confirm) {
  64. this.checkboxValue = [1]
  65. } else {
  66. this.checkboxValue = []
  67. }
  68. },
  69. },
  70. }
  71. </script>
  72. <style scoped lang="scss">
  73. .page__view {
  74. width: 100vw;
  75. min-height: 100vh;
  76. background-color: $uni-bg-color;
  77. position: relative;
  78. }
  79. .main {
  80. margin-top: 448rpx;
  81. .title {
  82. text-align: center;
  83. font-family: PingFang SC;
  84. line-height: 1.4;
  85. color: #252545;
  86. &-zh {
  87. font-size: 48rpx;
  88. font-weight: 600;
  89. }
  90. &-en {
  91. font-size: 26rpx;
  92. font-weight: 400;
  93. }
  94. }
  95. .desc {
  96. margin-top: 48rpx;
  97. text-align: center;
  98. font-size: 28rpx;
  99. font-weight: 400;
  100. font-family: PingFang SC;
  101. line-height: 1.4;
  102. color: #989898;
  103. .dot {
  104. display: inline-block;
  105. width: 10rpx;
  106. height: 10rpx;
  107. border-radius: 50%;
  108. background: #989898;
  109. margin-right: 20rpx;
  110. }
  111. }
  112. }
  113. .footer {
  114. position: absolute;
  115. left: 0;
  116. bottom: 0;
  117. width: 100%;
  118. .agreement {
  119. display: flex;
  120. padding: 16rpx 40rpx;
  121. background: #EFEAFF;
  122. /deep/ .uv-checkbox-group {
  123. flex: none;
  124. }
  125. .desc {
  126. flex: 1;
  127. font-family: PingFang SC;
  128. font-size: 24rpx;
  129. font-weight: 400;
  130. line-height: 40rpx;
  131. color: #8B8B8B;
  132. }
  133. .highlight {
  134. color: $uni-color;
  135. }
  136. }
  137. .bar {
  138. padding: 24rpx 40rpx;
  139. box-sizing: border-box;
  140. height: 200rpx;
  141. background: #FFFFFF;
  142. .btn {
  143. padding: 16rpx 0;
  144. font-family: PingFang SC;
  145. font-weight: 600;
  146. font-size: 36rpx;
  147. line-height: 1.2;
  148. color: #FFFFFF;
  149. background-image: linear-gradient(to right, #4B348F, #845CFA);
  150. border-radius: 42rpx;
  151. }
  152. }
  153. }
  154. </style>