风险测评小程序前端代码仓库
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.

261 lines
6.0 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="支付" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="status">
  5. <view class="flex status-content">
  6. <uv-icon name="checkmark-circle-fill" color="#014FA2" size="48rpx"></uv-icon>
  7. <view>支付成功</view>
  8. </view>
  9. </view>
  10. <view class="tips">
  11. <view class="flex tips-content">
  12. <!-- <uv-icon name="error-circle" color="#014FA2" size="36rpx"></uv-icon> -->
  13. <image class="icon" src="@/pages_order/static/report/icon-info.png" mode="widthFix"></image>
  14. <view>请如实填写以下信息方可获取答题情况生成风险测评报告</view>
  15. </view>
  16. </view>
  17. <view class="form">
  18. <view class="flex form-header">
  19. <view class="line"></view>
  20. <view>基本信息</view>
  21. </view>
  22. <uv-form
  23. ref="form"
  24. :model="form"
  25. :rules="rules"
  26. errorType="toast"
  27. >
  28. <view class="form-item">
  29. <uv-form-item prop="name" :customStyle="formItemStyle">
  30. <view class="flex row">
  31. <view class="row-label">姓名</view>
  32. <view class="row-content">
  33. <input
  34. v-model="form.name"
  35. placeholder="请输入您的姓名"
  36. :placeholderStyle="placeholderStyle"
  37. />
  38. </view>
  39. </view>
  40. </uv-form-item>
  41. </view>
  42. <view class="form-item">
  43. <uv-form-item prop="phone" :customStyle="formItemStyle">
  44. <view class="flex row">
  45. <view class="row-label">手机号码</view>
  46. <view class="row-content">
  47. <input
  48. v-model="form.phone"
  49. placeholder="请输入您的手机号"
  50. :placeholderStyle="placeholderStyle"
  51. />
  52. </view>
  53. </view>
  54. </uv-form-item>
  55. </view>
  56. <view class="form-item">
  57. <uv-form-item prop="company" :customStyle="formItemStyle">
  58. <view class="flex row">
  59. <view class="row-label is-required">公司名称</view>
  60. <view class="row-content">
  61. <input
  62. v-model="form.company"
  63. placeholder="请选输入公司全称"
  64. :placeholderStyle="placeholderStyle"
  65. />
  66. </view>
  67. </view>
  68. </uv-form-item>
  69. </view>
  70. </uv-form>
  71. </view>
  72. <view class="bottom">
  73. <button :class="['btn', disabled ? 'is-disabled' : '']" @click="onCreateReport">生成报告</button>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. id: null,
  82. form: {
  83. name: '',
  84. phone: '',
  85. company: '',
  86. },
  87. rules: {
  88. 'company': {
  89. type: 'string',
  90. required: true,
  91. message: '请填写公司名称~',
  92. },
  93. },
  94. formItemStyle: { padding: 0 },
  95. placeholderStyle: 'color: #BDBDBD; font-size: 28rpx; font-weight: 400;'
  96. }
  97. },
  98. computed: {
  99. disabled() {
  100. const { name, phone, company } = this.form
  101. return !company
  102. }
  103. },
  104. onLoad(arg) {
  105. const { batchNo } = arg
  106. this.batchNo = batchNo
  107. },
  108. methods: {
  109. async onCreateReport() {
  110. try {
  111. await this.$refs.form.validate()
  112. const { name, phone, company } = this.form
  113. const params = {
  114. batchNo: this.batchNo,
  115. name,
  116. phone,
  117. company,
  118. }
  119. await this.$fetch('addReport', params)
  120. uni.redirectTo({
  121. url: `/pages_order/report/index?batchNo=${this.batchNo}`
  122. })
  123. } catch (err) {
  124. }
  125. },
  126. },
  127. }
  128. </script>
  129. <style scoped lang="scss">
  130. .status {
  131. width: 100%;
  132. padding: 0 20rpx;
  133. box-sizing: border-box;
  134. &-content {
  135. width: 100%;
  136. padding: 157rpx 0 84rpx 0;
  137. box-sizing: border-box;
  138. column-gap: 18rpx;
  139. font-size: 48rpx;
  140. font-weight: 600;
  141. color: #000000;
  142. border-bottom: 1rpx dashed #E2EAF1;
  143. }
  144. }
  145. .tips {
  146. width: 100%;
  147. padding: 68rpx 24rpx 35rpx 24rpx;
  148. box-sizing: border-box;
  149. &-content {
  150. justify-content: flex-start;
  151. column-gap: 15rpx;
  152. width: 100%;
  153. padding: 13rpx 22rpx;
  154. box-sizing: border-box;
  155. font-size: 22rpx;
  156. line-height: 40rpx;
  157. color: #014FA2;
  158. background: rgba($color: #014FA2, $alpha: 0.16);
  159. border-radius: 11rpx;
  160. .icon {
  161. width: 36rpx;
  162. height: auto;
  163. }
  164. }
  165. }
  166. .form {
  167. padding: 0 18rpx;
  168. &-header {
  169. margin-bottom: 28rpx;
  170. padding: 0 18rpx;
  171. justify-content: flex-start;
  172. column-gap: 7rpx;
  173. font-size: 30rpx;
  174. font-weight: 600;
  175. color: #000000;
  176. .line {
  177. width: 9rpx;
  178. height: 33rpx;
  179. background: #014FA2;
  180. border-radius: 6rpx;
  181. }
  182. }
  183. &-item {
  184. border-bottom: 0.5rpx solid rgba($color: #707070, $alpha: 0.14);
  185. }
  186. }
  187. .row {
  188. justify-content: space-between;
  189. padding: 36rpx 30rpx 22rpx 24rpx;
  190. &-label {
  191. position: relative;
  192. font-size: 30rpx;
  193. color: #000000;
  194. &.is-required:after {
  195. content: '*';
  196. position: absolute;
  197. top: 0;
  198. left: 0;
  199. font-size: 15rpx;
  200. line-height: 42rpx;
  201. color: #FF3838;
  202. }
  203. }
  204. &-content {
  205. /deep/ input {
  206. text-align: right;
  207. }
  208. }
  209. }
  210. .bottom {
  211. position: fixed;
  212. left: 0;
  213. bottom: 0;
  214. width: 100%;
  215. padding: 35rpx 56rpx;
  216. padding-bottom: calc(env(safe-area-inset-bottom) + 35rpx);
  217. background: #FFFFFF;
  218. box-sizing: border-box;
  219. .btn {
  220. width: 100%;
  221. padding: 29rpx 0;
  222. font-size: 30rpx;
  223. line-height: 1.5;
  224. color: #FFFFFF;
  225. background: #014FA2;
  226. border-radius: 50rpx;
  227. &.is-disabled {
  228. background: #999999;
  229. }
  230. }
  231. }
  232. </style>