index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="cmain">
  3. <view class="item">
  4. <card v-model="item.pic" pic="../../static/images/sfz1.png"></card>
  5. </view>
  6. <view class="title">上传您的身份证头像面</view>
  7. <view class="item">
  8. <card v-model="item.pic" pic="../../static/images/sfz2.png"></card>
  9. </view>
  10. <view class="title">上传您的身份证国徽面</view>
  11. <button class="btn">人脸认证</button>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. item: {}
  19. };
  20. },
  21. onLoad(e) {},
  22. methods: {
  23. save() {
  24. let rule = [
  25. { name: 'typeCode', checkType: 'notnull', errorMsg: '请输入编码' },
  26. { name: 'typeName', checkType: 'notnull', errorMsg: '请输入名称' },
  27. { name: 'status', checkType: 'notnull', errorMsg: '请选择状态' }
  28. ];
  29. if (!this.verify.check(this.item, rule)) {
  30. uni.showModal({ content: this.verify.error, showCancel: false });
  31. return false;
  32. }
  33. this.http.request({
  34. url: '/project/projectType',
  35. method: this.item.id ? 'PUT' : 'POST',
  36. data: this.item,
  37. success: res => {
  38. uni.showToast({ title: '操作成功' });
  39. setTimeout(() => {
  40. uni.$emit('ctype');
  41. uni.navigateBack();
  42. }, 1000);
  43. }
  44. });
  45. }
  46. }
  47. };
  48. </script>
  49. <style lang="scss">
  50. .item {
  51. text-align: center;
  52. padding: 20px;
  53. background-color: #f7f8fa;
  54. border-radius: 15px;
  55. image {
  56. width: 100%;
  57. border-radius: 5px;
  58. }
  59. }
  60. .title {
  61. padding: 20px;
  62. text-align: center;
  63. font-weight: bold;
  64. color: $font-c;
  65. font-size: 17px;
  66. }
  67. .btn{
  68. margin-top: 20px;
  69. }
  70. </style>