register.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view>
  3. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
  4. <view slot="head">
  5. <view class="u-flex">
  6. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  7. 请按照要求上传您的营业执照和门店照
  8. </view>
  9. </view>
  10. <view slot="body">
  11. <u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center" :action="action" :form-data="licensepicType"
  12. @on-change="getLicensedata">
  13. <view slot="addBtn" hover-class="slot-btn__hover" hover-stay-time="150">
  14. <u-image width="475rpx" height="303rpx" src="../../static/sailun/upload_preview.png"></u-image>
  15. </view>
  16. </u-upload>
  17. <view class="u-flex u-row-center" style="color: #787878;margin: 20rpx 0 60rpx 0;">
  18. 点击上传营业执照
  19. </view>
  20. <u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center" :action="action" :form-data="storepicType"
  21. @on-change="getStoredata">
  22. <view slot="addBtn" hover-class="slot-btn__hover" hover-stay-time="150">
  23. <u-image width="475rpx" height="303rpx" src="../../static/sailun/upload_preview.png"></u-image>
  24. </view>
  25. </u-upload>
  26. <view class="u-flex u-row-center" style="color: #787878;margin: 20rpx 0;">
  27. 点击上传门头照
  28. </view>
  29. </view>
  30. </u-card>
  31. <view style="color: #787878;margin-left: 40rpx;">
  32. 注:上传完营业执照请确认和营业执照一致。
  33. </view>
  34. <view style="margin: 30rpx;">
  35. <u-button type="primary" @click="nextStep" v-if="showLicense&&showStore">下一步</u-button>
  36. <!-- <u-button type="primary" @click="nextStep">下一步</u-button> -->
  37. </view>
  38. <u-modal v-model="modalShow" :content="storecontent" :show-cancel-button="true" confirm-text="同意" cancel-text="不同意" @cancel="cancelModal"></u-modal>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. request
  44. } from '../../common/request/request'
  45. require("promise.prototype.finally").shim()
  46. export default {
  47. data() {
  48. return {
  49. action: "http://b2bcnapi.sailuntire.com/allstell/test/app/sailun/appStoreBasicInfo/storeupload",
  50. licensepicType: {
  51. "pictype": "license"
  52. },
  53. storepicType: {
  54. "pictype": "store"
  55. },
  56. showLicense:false,
  57. showStore:false,
  58. modalShow:false,
  59. storecontent:"此操作需要上传正规的营业执照照片,并确保系统识别出来的信息与营业执照一致,是否同意?"
  60. };
  61. },
  62. mounted() {
  63. this.modalShow=true
  64. },
  65. methods: {
  66. nextStep() {
  67. this.$u.route({
  68. url: 'pages/login/register_2',
  69. })
  70. if(this.licenseDate){
  71. uni.$emit('licenseData',this.licenseDate)
  72. }
  73. uni.$emit('dataUrl',{licenseUrl:this.licenseUrl,storeUrl:this.storeUrl})
  74. },
  75. getLicensedata(res, index, lists, name) {
  76. if (res.statusCode == 200) {
  77. this.$u.toast('上传成功');
  78. uni.hideLoading();
  79. this.licenseUrl = JSON.parse(res.data).data
  80. request({
  81. url: '/sailun/appStoreBasicInfo/licenseAnalyse',
  82. method: 'post',
  83. data: {
  84. "fileBox": this.licenseUrl,
  85. }
  86. }).then(res => {
  87. if (res.data.code == 0) {
  88. this.$u.toast('识别成功');
  89. this.licenseDate = res.data.data.wordsResultQuery
  90. this.showLicense=true
  91. }
  92. if (res.data.code == 500) {
  93. this.$u.toast(res.data.msg);
  94. }
  95. }).catch(err => {
  96. this.$u.toast('识别失败');
  97. }).finally(() => {})
  98. }
  99. },
  100. getStoredata(res, index, lists, name) {
  101. if (res.statusCode == 200) {
  102. this.$u.toast('上传成功');
  103. this.storeUrl = JSON.parse(res.data).data
  104. this.showStore=true
  105. }
  106. },
  107. cancelModal(){
  108. uni.navigateBack({
  109. })
  110. }
  111. },
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .slot-btn__hover {
  116. background-color: rgb(235, 236, 238);
  117. }
  118. </style>