apply.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <view class="cn">
  4. <u-steps :list="numList" :current="current"></u-steps>
  5. <view class="info">
  6. <view class="form_group hr">
  7. <view class="lable">商铺名称</view>
  8. <input type="text" placeholder="请输入商铺名称" v-model="item.name" />
  9. </view>
  10. <view class="form_group hr">
  11. <view class="lable">商铺地址</view>
  12. <input type="text" placeholder="请输入商铺地址" v-model="item.addres" />
  13. </view>
  14. <view class="form_group hr">
  15. <view class="lable">老板名称</view>
  16. <input type="text" placeholder="请输入老板名称" v-model="item.bossName" />
  17. </view>
  18. <view class="form_group hr">
  19. <view class="lable">老板电话</view>
  20. <input type="number" placeholder="请输入老板电话" v-model="item.bossPhone" />
  21. </view>
  22. <view class="form_group hr">
  23. <view class="lable">商铺简介</view>
  24. <textarea placeholder="请输入商铺简介" v-model="item.briefContent" />
  25. </view>
  26. </view>
  27. <button class="btn" @click="up()">申请开通</button>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. numList: [{ name: '申请开通' }, { name: '资料审核' }, { name: '商家入驻' }],
  36. current: 0,
  37. item: {}
  38. };
  39. },
  40. methods: {
  41. up() {
  42. let rule = [
  43. { name: 'name', checkType: 'notnull', errorMsg: '请输入商铺名称' },
  44. { name: 'addres', checkType: 'notnull', errorMsg: '请输入商铺地址' },
  45. { name: 'bossName', checkType: 'notnull', errorMsg: '请输入老板名称' },
  46. { name: 'bossPhone', checkType: 'notnull', errorMsg: '请输入老板电话' }
  47. ];
  48. if (!this.$verify.check(this.item, rule)) {
  49. uni.showModal({ content: this.$verify.error, showCancel: false });
  50. return;
  51. }
  52. this.$http.request({
  53. method: 'POST',
  54. url: this.$http.urls.shopApply,
  55. data: this.item,
  56. success: res => {
  57. uni.showToast({ title: '提交成功' });
  58. setTimeout(() => {
  59. uni.navigateBack();
  60. }, 700);
  61. }
  62. });
  63. }
  64. }
  65. };
  66. </script>
  67. <style lang="scss">
  68. .steps {
  69. text-align: center;
  70. margin-top: 20px;
  71. }
  72. .cn {
  73. padding: 15px;
  74. .info {
  75. background-color: white;
  76. border-radius: 5px;
  77. margin-top: 10px;
  78. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  79. }
  80. .btn {
  81. margin-top: 25px;
  82. }
  83. }
  84. </style>