register.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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" @on-remove="licenseRemove">
  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" @on-remove="storeRemove">
  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: 0 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. Analyse:"正在识别,请稍等"
  61. };
  62. },
  63. created() {
  64. uni.getSystemInfo({
  65. success:res=>{
  66. this.SystemInfo=res
  67. }
  68. });
  69. if(this.SystemInfo.platform=='ios'){
  70. uni.showModal({
  71. title: "温馨提示",
  72. content: "此操作需要上传正规的营业执照照片,并确保系统识别出来的信息与营业执照一致,是否同意?",
  73. cancelText: "不同意",
  74. confirmText: "同意",
  75. success:res=> {
  76. if (res.cancel) {
  77. uni.navigateBack({})
  78. }
  79. }
  80. })
  81. }else{
  82. this.modalShow=true
  83. }
  84. },
  85. methods: {
  86. nextStep() {
  87. if(this.Analyse!="success"){
  88. this.$u.toast(this.Analyse);
  89. return
  90. }
  91. this.$u.route({
  92. url: 'pages/login/register_2',
  93. })
  94. if(this.licenseDate){
  95. uni.$emit('licenseData',this.licenseDate)
  96. }
  97. uni.$emit('dataUrl',{licenseUrl:this.licenseUrl,storeUrl:this.storeUrl})
  98. },
  99. getLicensedata(res, index, lists, name) {
  100. if (res.statusCode == 200) {
  101. this.$u.toast('上传成功');
  102. this.showLicense=true
  103. uni.hideLoading();
  104. this.licenseUrl = JSON.parse(res.data).data
  105. request({
  106. url: '/sailun/appStoreBasicInfo/licenseAnalyse',
  107. method: 'post',
  108. data: {
  109. "fileBox": this.licenseUrl,
  110. }
  111. }).then(res => {
  112. if (res.data.code == 0) {
  113. this.$u.toast('识别成功');
  114. this.licenseDate = res.data.data.wordsResultQuery
  115. this.Analyse=res.data.msg
  116. }
  117. if (res.data.code == 500) {
  118. this.$u.toast(res.data.msg);
  119. this.Analyse=res.data.msg
  120. }
  121. }).catch(err => {
  122. this.$u.toast('识别失败');
  123. }).finally(() => {})
  124. }
  125. },
  126. getStoredata(res, index, lists, name) {
  127. if (res.statusCode == 200) {
  128. this.$u.toast('上传成功');
  129. this.storeUrl = JSON.parse(res.data).data
  130. this.showStore=true
  131. }
  132. },
  133. cancelModal(){
  134. uni.navigateBack({
  135. })
  136. },
  137. licenseRemove(){
  138. this.showLicense=false
  139. this.Analyse="正在识别,请稍等"
  140. },
  141. storeRemove(){
  142. this.showStore=false
  143. }
  144. },
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .slot-btn__hover {
  149. background-color: rgb(235, 236, 238);
  150. }
  151. </style>