register.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. {{$t('register.tips')}}
  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" :show-tips="false">
  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. {{$t('register.uplicense')}}
  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. {{$t('register.uppicture')}}
  28. </view>
  29. </view>
  30. </u-card>
  31. <view style="color: #787878;margin: 0 40rpx;">
  32. {{$t('register.tips2')}}
  33. </view>
  34. <view style="margin: 30rpx;">
  35. <u-button type="primary" @click="nextStep" v-if="showLicense&&showStore">{{$t('register.nextstep')}}</u-button>
  36. <!-- <u-button type="primary" @click="nextStep">下一步</u-button> -->
  37. </view>
  38. <u-modal v-model="modalShow" :title="this.$t('register.tipstitle')" :content="storecontent" :show-cancel-button="true"
  39. :confirm-text="this.$t('register.tipsconfirmText')" :cancel-text="this.$t('register.tipscancelText')" @cancel="cancelModal"></u-modal>
  40. </view>
  41. </template>
  42. <script>
  43. import {
  44. request
  45. } from '../../common/request/request'
  46. require("promise.prototype.finally").shim()
  47. export default {
  48. data() {
  49. return {
  50. action: "http://b2bcnapi.sailuntire.com/allstell/test/app/sailun/appStoreBasicInfo/storeupload",
  51. licensepicType: {
  52. "pictype": "license"
  53. },
  54. storepicType: {
  55. "pictype": "store"
  56. },
  57. showLicense: false,
  58. showStore: false,
  59. modalShow: false,
  60. storecontent: this.$t('register.tipscontent'),
  61. Analyse: this.$t('register.Analyse'),
  62. appStoreBusinessLicenseDto: ''
  63. };
  64. },
  65. created() {
  66. uni.getSystemInfo({
  67. success: res => {
  68. this.SystemInfo = res
  69. }
  70. });
  71. if (this.SystemInfo.platform == 'ios') {
  72. uni.showModal({
  73. title: this.$t('register.tipstitle'),
  74. content: this.$t('register.tipscontent'),
  75. cancelText: this.$t('register.tipscancelText'),
  76. confirmText: this.$t('register.tipsconfirmText'),
  77. success: res => {
  78. if (res.cancel) {
  79. uni.navigateBack({})
  80. }
  81. }
  82. })
  83. } else {
  84. this.modalShow = true
  85. }
  86. },
  87. methods: {
  88. nextStep() {
  89. if (this.Analyse != "success") {
  90. this.$u.toast(this.Analyse);
  91. return
  92. }
  93. this.$u.route({
  94. url: 'pages/login/register_2',
  95. })
  96. if (this.licenseDate) {
  97. uni.$emit('licenseData', this.licenseDate)
  98. }
  99. this.appStoreBusinessLicenseDto = {
  100. "address": this.licenseDate.site.words,
  101. "businessLicense": this.licenseDate.business.words,
  102. "businessScope": this.licenseDate.business.words,
  103. "capital": this.licenseDate.registered.words,
  104. "composing": this.licenseDate.certificate.words,
  105. "createTime": "",
  106. "creditCode": this.licenseDate.credit.words,
  107. "identityNumber": this.licenseDate.credit.words,
  108. "indate": this.licenseDate.validity.words,
  109. "legalPerson": this.licenseDate.person.words,
  110. "nameStatus": "",
  111. "organization": this.licenseDate.company.words,
  112. "recognition": "",
  113. "registerDate": this.licenseDate.establishment.words,
  114. "status": "",
  115. "storeId": 0,
  116. "type": this.licenseDate.type.words
  117. }
  118. uni.$emit('dataUrl', {
  119. licenseUrl: this.licenseUrl,
  120. storeUrl: this.storeUrl,
  121. appStoreBusinessLicenseDto: this.appStoreBusinessLicenseDto
  122. })
  123. },
  124. getLicensedata(res, index, lists, name) {
  125. if (res.statusCode == 200) {
  126. this.$u.toast(this.$t('register.sucupload'));
  127. this.showLicense = true
  128. uni.hideLoading();
  129. this.licenseUrl = JSON.parse(res.data).data
  130. request({
  131. url: '/sailun/appStoreBasicInfo/licenseAnalyse',
  132. method: 'post',
  133. data: {
  134. "fileBox": this.licenseUrl,
  135. }
  136. }).then(res => {
  137. if (res.data.code == 0) {
  138. this.$u.toast(this.$t('register.sucAnalyse'));
  139. this.licenseDate = res.data.data.wordsResultQuery
  140. this.Analyse = res.data.msg
  141. }
  142. if (res.data.code == 500) {
  143. this.$u.toast(res.data.msg);
  144. this.Analyse = res.data.msg
  145. }
  146. }).catch(err => {
  147. this.$u.toast(this.$t('register.errAnalyse'));
  148. this.Analyse = this.$t('register.errAnalyse')
  149. }).finally(() => {})
  150. }
  151. },
  152. getStoredata(res, index, lists, name) {
  153. if (res.statusCode == 200) {
  154. this.$u.toast(this.$t('register.sucupload'));
  155. this.storeUrl = JSON.parse(res.data).data
  156. this.showStore = true
  157. }
  158. },
  159. cancelModal() {
  160. uni.navigateBack({})
  161. },
  162. licenseRemove() {
  163. this.$u.toast(this.$t('register.delupload'));
  164. this.showLicense = false
  165. this.Analyse = this.$t('register.Analyse')
  166. },
  167. storeRemove() {
  168. this.showStore = false
  169. }
  170. },
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .slot-btn__hover {
  175. background-color: rgb(235, 236, 238);
  176. }
  177. </style>