register.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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" :before-upload="storeUpload">
  12. <view slot="addBtn" hover-class="slot-btn__hover" hover-stay-time="150">
  13. <u-image width="475rpx" height="303rpx" src="../../static/sailun/upload_preview.png"></u-image>
  14. </view>
  15. </u-upload>
  16. <view class="u-flex u-row-center" style="color: #787878;margin: 20rpx 0 60rpx 0;">
  17. 点击上传营业执照
  18. </view>
  19. <u-upload :custom-btn="true" max-count="1" class="u-flex u-row-center">
  20. <view slot="addBtn" hover-class="slot-btn__hover" hover-stay-time="150">
  21. <u-image width="475rpx" height="303rpx" src="../../static/sailun/upload_preview.png"></u-image>
  22. </view>
  23. </u-upload>
  24. <view class="u-flex u-row-center" style="color: #787878;margin: 20rpx 0;">
  25. 点击上传门头照
  26. </view>
  27. </view>
  28. </u-card>
  29. <view style="color: #787878;margin-left: 40rpx;">
  30. 注:上传完营业执照请确认和营业执照一致。
  31. </view>
  32. <view style="margin: 30rpx;">
  33. <u-button type="primary" :ripple="true" ripple-bg-color="#99d4ff" @click="nextStep">下一步</u-button>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import axios from 'axios'
  39. export default {
  40. data() {
  41. return {
  42. action: ""
  43. };
  44. },
  45. methods: {
  46. nextStep() {
  47. this.$u.route({
  48. url: 'pages/login/register_2',
  49. })
  50. },
  51. storeUpload(index, list) {
  52. let file = list[0].file.path
  53. console.log(file)
  54. let param = new FormData() // 创建form对象
  55. param.append('file', file) // 通过append向form对象添加数据
  56. param.append('pictype', 'store') // 添加form表单中其他数据
  57. let config = {
  58. headers: {
  59. 'Content-Type': 'multipart/form-data'
  60. }
  61. }
  62. axios.post('/appStoreBasicInfo/storeupload', param, config)
  63. .then(res => {
  64. console.log("上传上去了吗")
  65. console.log(res)
  66. })
  67. .catch(err => {
  68. console.log(err)
  69. })
  70. }
  71. },
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .slot-btn__hover {
  76. background-color: rgb(235, 236, 238);
  77. }
  78. </style>