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

274 lines
6.3 KiB

2 days ago
2 days ago
2 days ago
2 days ago
  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. import util from '@/utils/utils.js'
  79. export default {
  80. data() {
  81. return {
  82. id: null,
  83. form: {
  84. name: '',
  85. phone: '',
  86. company: '',
  87. },
  88. rules: {
  89. 'phone': {
  90. type: 'string',
  91. required: true,
  92. message: '请输入正确的手机号',
  93. validator: (rule, value, callback) => {
  94. return util.verificationPhone(value)
  95. },
  96. },
  97. 'company': {
  98. type: 'string',
  99. required: true,
  100. message: '请填写公司名称~',
  101. },
  102. },
  103. formItemStyle: { padding: 0 },
  104. placeholderStyle: 'color: #BDBDBD; font-size: 28rpx; font-weight: 400;'
  105. }
  106. },
  107. computed: {
  108. disabled() {
  109. const { name, phone, company } = this.form
  110. return !phone || !company
  111. }
  112. },
  113. onLoad(arg) {
  114. const { batchNo } = arg
  115. this.batchNo = batchNo
  116. },
  117. onReady() {
  118. this.$refs.form.setRules(this.rules);
  119. },
  120. methods: {
  121. async onCreateReport() {
  122. try {
  123. await this.$refs.form.validate()
  124. const { name, phone, company } = this.form
  125. const params = {
  126. batchNo: this.batchNo,
  127. name,
  128. phone,
  129. company,
  130. }
  131. await this.$fetch('addReport', params)
  132. uni.redirectTo({
  133. url: `/pages_order/report/index?batchNo=${this.batchNo}`
  134. })
  135. } catch (err) {
  136. }
  137. },
  138. },
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. .status {
  143. width: 100%;
  144. padding: 0 20rpx;
  145. box-sizing: border-box;
  146. &-content {
  147. width: 100%;
  148. padding: 157rpx 0 84rpx 0;
  149. box-sizing: border-box;
  150. column-gap: 18rpx;
  151. font-size: 48rpx;
  152. font-weight: 600;
  153. color: #000000;
  154. border-bottom: 1rpx dashed #E2EAF1;
  155. }
  156. }
  157. .tips {
  158. width: 100%;
  159. padding: 68rpx 24rpx 35rpx 24rpx;
  160. box-sizing: border-box;
  161. &-content {
  162. justify-content: flex-start;
  163. column-gap: 15rpx;
  164. width: 100%;
  165. padding: 13rpx 22rpx;
  166. box-sizing: border-box;
  167. font-size: 22rpx;
  168. line-height: 40rpx;
  169. color: #014FA2;
  170. background: rgba($color: #014FA2, $alpha: 0.16);
  171. border-radius: 11rpx;
  172. .icon {
  173. width: 36rpx;
  174. height: auto;
  175. }
  176. }
  177. }
  178. .form {
  179. padding: 0 18rpx;
  180. &-header {
  181. margin-bottom: 28rpx;
  182. padding: 0 18rpx;
  183. justify-content: flex-start;
  184. column-gap: 7rpx;
  185. font-size: 30rpx;
  186. font-weight: 600;
  187. color: #000000;
  188. .line {
  189. width: 9rpx;
  190. height: 33rpx;
  191. background: #014FA2;
  192. border-radius: 6rpx;
  193. }
  194. }
  195. &-item {
  196. border-bottom: 0.5rpx solid rgba($color: #707070, $alpha: 0.14);
  197. }
  198. }
  199. .row {
  200. justify-content: space-between;
  201. padding: 36rpx 30rpx 22rpx 24rpx;
  202. &-label {
  203. position: relative;
  204. font-size: 30rpx;
  205. color: #000000;
  206. &.is-required:after {
  207. content: '*';
  208. position: absolute;
  209. top: 0;
  210. left: 0;
  211. font-size: 15rpx;
  212. line-height: 42rpx;
  213. color: #FF3838;
  214. }
  215. }
  216. &-content {
  217. /deep/ input {
  218. text-align: right;
  219. }
  220. }
  221. }
  222. .bottom {
  223. position: fixed;
  224. left: 0;
  225. bottom: 0;
  226. width: 100%;
  227. padding: 35rpx 56rpx;
  228. padding-bottom: calc(env(safe-area-inset-bottom) + 35rpx);
  229. background: #FFFFFF;
  230. box-sizing: border-box;
  231. .btn {
  232. width: 100%;
  233. padding: 29rpx 0;
  234. font-size: 30rpx;
  235. line-height: 1.5;
  236. color: #FFFFFF;
  237. background: #014FA2;
  238. border-radius: 50rpx;
  239. &.is-disabled {
  240. background: #999999;
  241. }
  242. }
  243. }
  244. </style>