fillTable.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="wrapper">
  3. <view class="tab-wrapper">
  4. <view class="tab-item">
  5. <view class="itemx">
  6. <view class="item-tit">店铺名称:</view>
  7. <input type="text" v-model="merchant_name" placeholder="请输入店铺名称" />
  8. </view>
  9. <view class="up-wrapper">
  10. 店铺logo
  11. <view class="imgs">
  12. <view class="imgs-item">
  13. <image :src="sfzz" mode="" v-if="yyzz" @click.stop="upImg('yyzz')"></image>
  14. <image src="../../static/img/add.png" mode="" v-if="!yyzz" @click.stop="upImg('yyzz')"></image>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="itemx">
  19. <view class="item-tit">联系电话:</view>
  20. <input type="text" v-model="phone" placeholder="请输入联系电话" />
  21. </view>
  22. <view class="itemx">
  23. <view class="item-tit">营业时间:</view>
  24. <input type="text" v-model="time" placeholder="请输入营业时间" disabled />
  25. </view>
  26. <view class="itemx">
  27. <view class="item-tit">店铺地址:</view>
  28. <input type="text" v-model="area" placeholder="请输入店铺地址" />
  29. </view>
  30. </view>
  31. <view class="btn-tc"></view>
  32. <view class="sub-btn" @click="sub">提交申请</view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import { mapState, mapMutations } from 'vuex';
  38. import { register, verify } from '@/api/login.js';
  39. import { upload, enter } from '@/api/user.js';
  40. export default {
  41. data() {
  42. return {
  43. phone: '',
  44. time:'',//输入营业时间
  45. yyzz: '', //店铺logo
  46. merchant_name: '', //店铺名称
  47. area: '' //店长区域
  48. };
  49. },
  50. onLoad() {
  51. let obj = this;
  52. obj.speed_id = uni.getStorageSync('spread') || '';
  53. if (obj.speed_id == '') {
  54. obj.speed_id = obj.userInfo.spread_uid || '';
  55. }
  56. },
  57. computed: {
  58. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  59. },
  60. watch: {
  61. countDown(i) {
  62. if (i == 0) {
  63. clearInterval(this.time);
  64. }
  65. }
  66. },
  67. methods: {
  68. upImg(item) {
  69. let obj = this;
  70. upload({
  71. filename: ''
  72. })
  73. .then(res => {
  74. console.log(res[0].url);
  75. obj[item] = res[0].url;
  76. })
  77. .catch(err => {
  78. console.log(err);
  79. });
  80. },
  81. //提交
  82. sub() {
  83. let obj = this;
  84. if (obj.phone == '') {
  85. obj.$api.msg('请输入联系方式');
  86. return;
  87. }
  88. if (this.phone.length < 11) {
  89. this.$api.msg('请输入正确的手机号');
  90. return;
  91. }
  92. if (obj.yyzz == '') {
  93. obj.$api.msg('请上传店铺logo');
  94. return;
  95. }
  96. if (obj.area == '') {
  97. obj.$api.msg('请输入店铺地址');
  98. return;
  99. }
  100. let card_id = obj.sfzz + ',' + obj.sfzf;
  101. uni.showLoading({
  102. title: '提交中...',
  103. mask: true
  104. });
  105. enter({
  106. type: 1,
  107. merchant_name: obj.area,
  108. link_user: obj.name,
  109. link_tel: obj.phone,
  110. spread_uid: obj.speed_id,
  111. charter: obj.yyzz,
  112. card_id: card_id
  113. })
  114. .then(res => {
  115. uni.hideLoading();
  116. uni.showToast({
  117. title: '提交成功',
  118. duration: 2000
  119. });
  120. setTimeout(() => {
  121. uni.navigateBack({});
  122. }, 2000);
  123. console.log(res);
  124. })
  125. .catch(err => {
  126. uni.hideLoading();
  127. console.log(err);
  128. });
  129. }
  130. }
  131. };
  132. </script>
  133. <style lang="scss" scoped>
  134. .wrapper {
  135. height: 100%;
  136. }
  137. .tab-wrapper {
  138. padding: 20rpx 30rpx;
  139. background-color: #f2f3f5;
  140. .itemx {
  141. margin: 0 auto;
  142. width: 100%;
  143. background-color: #fff !important;
  144. height: 100rpx;
  145. display: flex;
  146. // width: 690px;
  147. border: 1px #f4f4f4 solid;
  148. .code {
  149. width: 150rpx;
  150. flex-shrink: 0;
  151. text-align: center;
  152. font-size: 28rpx;
  153. font-family: PingFang SC;
  154. font-weight: 500;
  155. color: #ff4c4c;
  156. line-height: 100rpx;
  157. }
  158. .item-tit {
  159. height: 100rpx;
  160. line-height: 100rpx;
  161. padding-left: 30rpx;
  162. width: 310rpx;
  163. font-size: 30rpx;
  164. font-family: PingFang SC;
  165. font-weight: 500;
  166. color: #666666;
  167. flex-shrink: 0;
  168. }
  169. input {
  170. width: 440rpx;
  171. padding-right: 20rpx;
  172. height: 100rpx;
  173. line-height: 100rpx;
  174. font-size: 30rpx;
  175. font-family: PingFang SC;
  176. font-weight: 500;
  177. color: #333333;
  178. }
  179. }
  180. }
  181. .sub-btn {
  182. // position: fixed;
  183. // bottom: 0;
  184. margin: 60rpx auto;
  185. width: 600rpx;
  186. height: 98rpx;
  187. border-radius: 49rpx;
  188. background: linear-gradient(180deg, #fd4646, #ff3535);
  189. font-size: 36rpx;
  190. font-family: PingFang SC;
  191. font-weight: 500;
  192. color: #ffffff;
  193. line-height: 98rpx;
  194. text-align: center;
  195. }
  196. .btn-tc {
  197. height: 98rpx;
  198. }
  199. .up-wrapper {
  200. margin: auto;
  201. padding: 38rpx 21rpx;
  202. width: 690rpx;
  203. // height: 250rpx;
  204. background: #ffffff;
  205. border-radius: 10rpx;
  206. font-size: 28rpx;
  207. font-family: PingFang SC;
  208. font-weight: 500;
  209. color: #333333;
  210. .imgs {
  211. padding: 27rpx 70rpx;
  212. display: flex;
  213. justify-content: space-around;
  214. .imgs-item {
  215. height: 160rpx;
  216. width: 160rpx;
  217. image {
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. }
  223. }
  224. </style>