register.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. </view>
  39. </template>
  40. <script>
  41. import {
  42. request
  43. } from '../../common/request/request'
  44. require("promise.prototype.finally").shim()
  45. export default {
  46. data() {
  47. return {
  48. action: "http://b2bcnapi.sailuntire.com/allstell/test/app/sailun/appStoreBasicInfo/storeupload",
  49. licensepicType: {
  50. "pictype": "license"
  51. },
  52. storepicType: {
  53. "pictype": "store"
  54. },
  55. showLicense:false,
  56. showStore:false,
  57. };
  58. },
  59. methods: {
  60. nextStep() {
  61. this.$u.route({
  62. url: 'pages/login/register_2',
  63. })
  64. if(this.licenseDate){
  65. uni.$emit('licenseData',this.licenseDate)
  66. }
  67. uni.$emit('dataUrl',{licenseUrl:this.licenseUrl,storeUrl:this.storeUrl})
  68. },
  69. getLicensedata(res, index, lists, name) {
  70. if (res.statusCode == 200) {
  71. this.$u.toast('上传成功');
  72. uni.hideLoading();
  73. this.licenseUrl = JSON.parse(res.data).data
  74. request({
  75. url: '/sailun/appStoreBasicInfo/licenseAnalyse',
  76. method: 'post',
  77. data: {
  78. "fileBox": this.licenseUrl,
  79. }
  80. }).then(res => {
  81. if (res.data.code == 0) {
  82. this.$u.toast('识别成功');
  83. this.licenseDate = res.data.data.wordsResultQuery
  84. this.showLicense=true
  85. }
  86. if (res.data.code == 500) {
  87. this.$refs.uToast.show({
  88. title: res.data.msg,
  89. })
  90. }
  91. }).catch(err => {
  92. this.$u.toast('识别失败');
  93. }).finally(() => {})
  94. }
  95. },
  96. getStoredata(res, index, lists, name) {
  97. if (res.statusCode == 200) {
  98. this.$u.toast('上传成功');
  99. this.storeUrl = JSON.parse(res.data).data
  100. this.showStore=true
  101. }
  102. }
  103. },
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .slot-btn__hover {
  108. background-color: rgb(235, 236, 238);
  109. }
  110. </style>