123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- <template>
- <view class="add-business-box">
- <Navbar title="分公司申请" color="#333"></Navbar>
- <view class="content">
- <view class="item">
- <view class="label">分公司名称</view>
- <input type="text" class="input" v-model="data.companyName" placeholder="点击输入分公司名称">
- </view>
- <view class="item">
- <view class="label">联系方式</view>
- <input type="text" class="input" v-model="data.companyPhone" placeholder="输入联系电话">
- </view>
- <view class="item item2 item3">
- <view class="label">地址信息</view>
- <view class="position" @click="getLocation">{{data.address || '点击定位地址'}}
- <IconText :code="`\ue853`" size="12" class="icon" color="#FA402B"></IconText>
- </view>
- </view>
- <view class="item mph">
- <view class="label">门牌号</view>
- <textarea class="input" v-model="data.house" placeholder-class="placeholder"
- placeholder="详细地址,例:8号楼1单元5层501室" cols="30" rows="10"></textarea>
- </view>
- <view class="item item3 pics">
- <view class="label">门头图片</view>
- <view class="upload-box">
- <MulImgUpload @update="getImgs" :imgs="data.pics" :max="5" :width="66 / 3.75" :height="66 / 3.75"
- addColor="#FA402B">
- </MulImgUpload>
- </view>
- </view>
- </view>
- <view class="bottom">
- <view class="btn" v-if="info.status === 1">审核中...</view>
- <view class="btn" @click="handleUpdate" v-else-if="info.status === 2" style="background: #00BA66;">
- 更新运营中心信息</view>
- <view class="btn" @click="handleUpdate" v-else-if="info.status === 3">重新提交申请</view>
- <view class="btn" @click="handleConfirm" v-else-if="info.status === 0">提交申请</view>
- </view>
- <ShowModal ref="rejectTip" title="提示" :content="info.remark" btnText="确认" />
- </view>
- </template>
- <script lang='ts'>
- import {
- Component,
- Prop,
- Vue
- } from 'vue-property-decorator';
- @Component({})
- export default class AddBusiness extends Vue {
- typeList: any = [];
- shopType: any = {};
- addressInfo: any = {};
- videoImg: string = "";
- info: any = {};
- data: any = {
- companyName: '',
- companyPhone: '',
- address: '',
- house: '',
- pics: []
- };
- onLoad() {
- this.getInfo();
- }
- getInfo() {
- return this.$http
- .get({
- url: this.$api.applyInfo2,
- })
- .then((res: any) => {
- this.info = res;
- let data = {
- ...this.data
- };
- for (let key in this.data) {
- data[key] = res[key];
- }
- this.data = data;
- if (res.status === 3) {
- (this.$refs.rejectTip as any).open();
- }
- }, (err: any) => {
- console.log(err);
- });
- }
- getLocation() {
- uni.getLocation({
- type: 'wgs84',
- success: (res: any) => {
- // console.log(res, '经纬度')
- if (res.errMsg == 'getLocation:ok') {
- uni.chooseLocation({
- // 传入你要去的纬度
- latitude: this.data.lat || res.latitude,
- // 传入你要去的经度
- longitude: this.data.lng || res.longitude,
- // 传入你要去的地址信息 不填则为空
- // 缩放大小
- success: (info: any) => {
- this.data = {
- ...this.data,
- lat: info.latitude,
- lng: info.longitude,
- address: info.address
- };
- console.log(this.data)
- }
- });
- }
- }
- });
- }
- getImgs(pics: any) {
- this.data.pics = pics;
- }
- handleConfirm() {
- // console.log(this.data)
- uni.showLoading({
- title: '加载中...'
- });
- this.$http
- .post({
- url: this.$api.applyAdd2,
- data: this.data
- })
- .then((res: any) => {
- uni.hideLoading();
- uni.showToast({
- title: '店铺入驻申请审核中,请稍后...',
- icon: 'none'
- });
- this.getInfo();
- }, (err: any) => {
- console.log(err);
- uni.hideLoading();
- });
- }
- handleUpdate() {
- console.log(this.data)
- uni.showLoading({
- title: '加载中...'
- });
- this.$http
- .put({
- url: this.$api.applyUpdate2,
- data: {
- id: this.info.id,
- ...this.data
- }
- })
- .then((res: any) => {
- uni.hideLoading();
- uni.showToast({
- title: '店铺入驻申请审核中,请稍后...',
- icon: 'none'
- });
- this.getInfo();
- }, (err: any) => {
- console.log(err);
- uni.hideLoading();
- });
- }
- }
- </script>
- <style lang="scss" scoped>
- .add-business-box {
- .content {
- padding-bottom: vw(100);
- .item {
- height: vw(66);
- background: #fff;
- margin-top: vw(1);
- @include flex-x();
- padding: 0 vw(15);
- .label {
- @include word-vw(14, #333);
- text {
- @include word-vw(14, #999);
- }
- }
- .input {
- width: vw(240);
- height: vw(50);
- background: #F6F6F6;
- border-radius: vw(5);
- padding: 0 vw(16);
- font-size: vw(14);
- box-sizing: border-box;
- }
- .selector {
- @include flex-x();
- @include word-vw(15, #999);
- .icon {
- margin-left: vw(5);
- }
- }
- .position {
- @include word-vw(14, #999);
- @include flex-x(flex-end);
- width: vw(240);
- .icon {
- margin-left: vw(5);
- }
- }
- }
- .item2 {
- height: vw(55);
- }
- .item3 {
- margin-top: vw(10);
- }
- .mph,
- .des,
- .pics {
- height: auto;
- padding: vw(15) vw(12);
- .label {
- align-self: flex-start;
- padding-top: vw(3);
- text {
- font-size: vw(10);
- }
- }
- }
- .mph {
- .input {
- height: vw(66);
- padding: vw(12) vw(16);
- line-height: vw(21);
- }
- /deep/ .placeholder {
- line-height: vw(21);
- }
- }
- .des {
- .input {
- height: vw(100);
- padding: vw(12) vw(16);
- }
- }
- .master-img {
- @include flex-x();
- .img {
- width: vw(40);
- height: vw(40);
- background: #ccc;
- border-radius: vw(20);
- margin-right: vw(5);
- }
- }
- .upload-box {
- width: vw(240);
- .empty {
- width: vw(66);
- height: vw(66);
- border-radius: vw(5);
- @include flex-x(center);
- background: #F6F6F6;
- }
- .video {
- width: vw(66);
- height: vw(66);
- // background: #ccc;
- border-radius: vw(5);
- }
- .img-box {
- position: relative;
- display: inline-block;
- .delete-icon {
- position: absolute;
- top: vw(-6);
- right: vw(-6);
- }
- }
- }
- }
- .bottom {
- width: 100%;
- position: fixed;
- bottom: 0;
- height: vw(70);
- background: #fff;
- @include flex-x(center);
- .btn {
- @include flex-x(center);
- @include solid-btn(335, 50, #fff, 25);
- }
- }
- }
- </style>
|