yyzx-apply.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <view class="add-business-box">
  3. <Navbar title="分公司申请" color="#333"></Navbar>
  4. <view class="content">
  5. <view class="item">
  6. <view class="label">分公司名称</view>
  7. <input type="text" class="input" v-model="data.companyName" placeholder="点击输入分公司名称">
  8. </view>
  9. <view class="item">
  10. <view class="label">联系方式</view>
  11. <input type="text" class="input" v-model="data.companyPhone" placeholder="输入联系电话">
  12. </view>
  13. <view class="item item2 item3">
  14. <view class="label">地址信息</view>
  15. <view class="position" @click="getLocation">{{data.address || '点击定位地址'}}
  16. <IconText :code="`\ue853`" size="12" class="icon" color="#FA402B"></IconText>
  17. </view>
  18. </view>
  19. <view class="item mph">
  20. <view class="label">门牌号</view>
  21. <textarea class="input" v-model="data.house" placeholder-class="placeholder"
  22. placeholder="详细地址,例:8号楼1单元5层501室" cols="30" rows="10"></textarea>
  23. </view>
  24. <view class="item item3 pics">
  25. <view class="label">门头图片</view>
  26. <view class="upload-box">
  27. <MulImgUpload @update="getImgs" :imgs="data.pics" :max="5" :width="66 / 3.75" :height="66 / 3.75"
  28. addColor="#FA402B">
  29. </MulImgUpload>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="bottom">
  34. <view class="btn" v-if="info.status === 1">审核中...</view>
  35. <view class="btn" @click="handleUpdate" v-else-if="info.status === 2" style="background: #00BA66;">
  36. 更新运营中心信息</view>
  37. <view class="btn" @click="handleUpdate" v-else-if="info.status === 3">重新提交申请</view>
  38. <view class="btn" @click="handleConfirm" v-else-if="info.status === 0">提交申请</view>
  39. </view>
  40. <ShowModal ref="rejectTip" title="提示" :content="info.remark" btnText="确认" />
  41. </view>
  42. </template>
  43. <script lang='ts'>
  44. import {
  45. Component,
  46. Prop,
  47. Vue
  48. } from 'vue-property-decorator';
  49. @Component({})
  50. export default class AddBusiness extends Vue {
  51. typeList: any = [];
  52. shopType: any = {};
  53. addressInfo: any = {};
  54. videoImg: string = "";
  55. info: any = {};
  56. data: any = {
  57. companyName: '',
  58. companyPhone: '',
  59. address: '',
  60. house: '',
  61. pics: []
  62. };
  63. onLoad() {
  64. this.getInfo();
  65. }
  66. getInfo() {
  67. return this.$http
  68. .get({
  69. url: this.$api.applyInfo2,
  70. })
  71. .then((res: any) => {
  72. this.info = res;
  73. let data = {
  74. ...this.data
  75. };
  76. for (let key in this.data) {
  77. data[key] = res[key];
  78. }
  79. this.data = data;
  80. if (res.status === 3) {
  81. (this.$refs.rejectTip as any).open();
  82. }
  83. }, (err: any) => {
  84. console.log(err);
  85. });
  86. }
  87. getLocation() {
  88. uni.getLocation({
  89. type: 'wgs84',
  90. success: (res: any) => {
  91. // console.log(res, '经纬度')
  92. if (res.errMsg == 'getLocation:ok') {
  93. uni.chooseLocation({
  94. // 传入你要去的纬度
  95. latitude: this.data.lat || res.latitude,
  96. // 传入你要去的经度
  97. longitude: this.data.lng || res.longitude,
  98. // 传入你要去的地址信息 不填则为空
  99. // 缩放大小
  100. success: (info: any) => {
  101. this.data = {
  102. ...this.data,
  103. lat: info.latitude,
  104. lng: info.longitude,
  105. address: info.address
  106. };
  107. console.log(this.data)
  108. }
  109. });
  110. }
  111. }
  112. });
  113. }
  114. getImgs(pics: any) {
  115. this.data.pics = pics;
  116. }
  117. handleConfirm() {
  118. // console.log(this.data)
  119. uni.showLoading({
  120. title: '加载中...'
  121. });
  122. this.$http
  123. .post({
  124. url: this.$api.applyAdd2,
  125. data: this.data
  126. })
  127. .then((res: any) => {
  128. uni.hideLoading();
  129. uni.showToast({
  130. title: '店铺入驻申请审核中,请稍后...',
  131. icon: 'none'
  132. });
  133. this.getInfo();
  134. }, (err: any) => {
  135. console.log(err);
  136. uni.hideLoading();
  137. });
  138. }
  139. handleUpdate() {
  140. console.log(this.data)
  141. uni.showLoading({
  142. title: '加载中...'
  143. });
  144. this.$http
  145. .put({
  146. url: this.$api.applyUpdate2,
  147. data: {
  148. id: this.info.id,
  149. ...this.data
  150. }
  151. })
  152. .then((res: any) => {
  153. uni.hideLoading();
  154. uni.showToast({
  155. title: '店铺入驻申请审核中,请稍后...',
  156. icon: 'none'
  157. });
  158. this.getInfo();
  159. }, (err: any) => {
  160. console.log(err);
  161. uni.hideLoading();
  162. });
  163. }
  164. }
  165. </script>
  166. <style lang="scss" scoped>
  167. .add-business-box {
  168. .content {
  169. padding-bottom: vw(100);
  170. .item {
  171. height: vw(66);
  172. background: #fff;
  173. margin-top: vw(1);
  174. @include flex-x();
  175. padding: 0 vw(15);
  176. .label {
  177. @include word-vw(14, #333);
  178. text {
  179. @include word-vw(14, #999);
  180. }
  181. }
  182. .input {
  183. width: vw(240);
  184. height: vw(50);
  185. background: #F6F6F6;
  186. border-radius: vw(5);
  187. padding: 0 vw(16);
  188. font-size: vw(14);
  189. box-sizing: border-box;
  190. }
  191. .selector {
  192. @include flex-x();
  193. @include word-vw(15, #999);
  194. .icon {
  195. margin-left: vw(5);
  196. }
  197. }
  198. .position {
  199. @include word-vw(14, #999);
  200. @include flex-x(flex-end);
  201. width: vw(240);
  202. .icon {
  203. margin-left: vw(5);
  204. }
  205. }
  206. }
  207. .item2 {
  208. height: vw(55);
  209. }
  210. .item3 {
  211. margin-top: vw(10);
  212. }
  213. .mph,
  214. .des,
  215. .pics {
  216. height: auto;
  217. padding: vw(15) vw(12);
  218. .label {
  219. align-self: flex-start;
  220. padding-top: vw(3);
  221. text {
  222. font-size: vw(10);
  223. }
  224. }
  225. }
  226. .mph {
  227. .input {
  228. height: vw(66);
  229. padding: vw(12) vw(16);
  230. line-height: vw(21);
  231. }
  232. /deep/ .placeholder {
  233. line-height: vw(21);
  234. }
  235. }
  236. .des {
  237. .input {
  238. height: vw(100);
  239. padding: vw(12) vw(16);
  240. }
  241. }
  242. .master-img {
  243. @include flex-x();
  244. .img {
  245. width: vw(40);
  246. height: vw(40);
  247. background: #ccc;
  248. border-radius: vw(20);
  249. margin-right: vw(5);
  250. }
  251. }
  252. .upload-box {
  253. width: vw(240);
  254. .empty {
  255. width: vw(66);
  256. height: vw(66);
  257. border-radius: vw(5);
  258. @include flex-x(center);
  259. background: #F6F6F6;
  260. }
  261. .video {
  262. width: vw(66);
  263. height: vw(66);
  264. // background: #ccc;
  265. border-radius: vw(5);
  266. }
  267. .img-box {
  268. position: relative;
  269. display: inline-block;
  270. .delete-icon {
  271. position: absolute;
  272. top: vw(-6);
  273. right: vw(-6);
  274. }
  275. }
  276. }
  277. }
  278. .bottom {
  279. width: 100%;
  280. position: fixed;
  281. bottom: 0;
  282. height: vw(70);
  283. background: #fff;
  284. @include flex-x(center);
  285. .btn {
  286. @include flex-x(center);
  287. @include solid-btn(335, 50, #fff, 25);
  288. }
  289. }
  290. }
  291. </style>