123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <template>
- <view class="content">
- <view class="popup-content">
-
- <view class="">
- <view class="box-pack-between ft32 flex-center popup-content-title">
- <text @click="close">关闭</text>
- <text style="color: #003A9B;" @click="confirm">确认</text>
- </view>
- <view class="ft22 tips cate border-b">
- <view class="">
- Tip:请根据小程序自身的功能,正确选择服务类目。
- </view>
- 餐饮行业选择服务类型是:餐饮 > 餐饮服务场所/餐饮服务管理企业,商业服务 > 公关/推广/市场调查
- </view>
-
- </view>
-
- <view class="flex">
- <scroll-view scroll-y class="popup-content-scroll">
- <view @click="bindProv" :data-title="item.name" :data-code="item.id" :class="item.id==Prov_code?'act':''"
- class="popup-content-scroll-li flex-center" v-for="(item,index) of Prov_arr" :key='index'>
- {{item.name}}
- </view>
- </scroll-view>
-
- <scroll-view scroll-y class="popup-content-scroll">
- <block v-if="City_arr.length>0">
- <view @click="bindCity" :data-innername="item.inner_name" :data-title="item.name"
- :class="item.id==City_code?'act':''" :data-code="item.id"
- class="popup-content-scroll-li flex-center " v-for="(item,index) of City_arr" :key='index'>
- {{item.name}}
- </view>
- </block>
- <view v-else class="City popup-content-scroll-li flex-center">
- 请选择
- </view>
- </scroll-view>
-
- <scroll-view scroll-y class="popup-content-scroll">
- <!-- <block v-if="Dist_arr.length>0">
- <view @click="bindDist" :data-title="item.city_name" :class="item.cityid==Dist_code?'act':''" :data-code="item.cityid"
- class="popup-content-scroll-li flex-center" v-for="(item,index) of Dist_arr" :key='index'>
- {{item.city_name}}
- </view>
- </block> -->
- <block v-if="innername">
- <view class="City popup-content-scroll-li flex-center ft26">
- {{innername}}
- </view>
- <view class="home-img" @click="uploadFile" data-type='1'>
- <image :src="URL+xcx_logo" class="home-img-icon"></image>
- </view>
- </block>
- </scroll-view>
-
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'uniScroll',
- props: {
- Prov_arr: {
- type: Array,
- default () {
- return []
- }
- },
- type: {
- type: Number,
- default: 1,
- },
- },
- inject: ['popup'],
- data() {
- return {
-
- City_arr: [],
- Dist_arr: [],
- Prov_code: "",
- City_code: "",
- Dist_code: "",
- Prov_title1: "",
- City_title1: "",
- Dist_title1: "",
- Prov_title: "",
- City_title: "",
- Dist_title: "",
- innername:"",
- xcx_logo:"",
- URL: getApp().globalData.URL,
- }
- },
- onLoad() {
- },
- methods: {
- uploadFile(e) {
- uni.chooseImage({
- success: (res) => {
- res.tempFilePaths.forEach((v, i) => {
- console.log(v)
- this.Upload({
- url: "setting/upload",
- data: {
- url: v,
- admin_id: uni.getStorageSync("admin_id"),
- }
- }).then(res => {
- console.log(res, "res")
- this.xcx_logo = res.src;
- }).catch({});
- })
- }
- });
- },
-
- // 商户地址省
- bindProv(e) {
- this.Prov_code = e.currentTarget.dataset.code;
- this.Prov_title1 = e.currentTarget.dataset.title;
- this.Dist_arr = [];
- this.Dist_code = "";
- this.City_code = "";
- this.City();
- },
-
- // 商户地址市
- bindCity(e) {
- console.log(e)
- let {code,title,innername }=e.currentTarget.dataset;
- this.City_code = code;
- this.City_title1 = title;
- this.innername=innername;
- this.Dist_code = "";
- // this.wechat_secondcode();
- },
-
- // 商户地址区
- bindDist(e) {
-
- this.Dist_title1 = e.currentTarget.dataset.title;
- this.Dist_code = e.currentTarget.dataset.code;
-
- },
-
- close(e) {
- this.popup.close();
- // this.$refs.popup.close();
- },
- confirm(e) {
- let info;
- if (!this.City_code||!this.Prov_code) {
- uni.showToast({
- title: "请选择",
- icon: "none"
- })
- return
- }
- info = {
- code1: this.Prov_code,
- code2: this.City_code,
- // Dist_code: this.Dist_code,
- Prov_title: this.Prov_title1,
- City_title: this.City_title1,
- special_license_pic :this.xcx_logo,
- zzzs_name :this.innername,
- // Dist_title: this.Dist_title1,
- }
- this.$emit('select', info)
- this.popup.close();
- },
- City(e) {
- this.request({
- url: "setting/wechat_secondcategory",
- data: {
- id: this.Prov_code,
- },
- }).then(res => {
- console.log(res, "res")
- if (res.code =="200") {
- this.City_arr = res.data;
- }
- }).catch((res) => {
- // this.City_arr = [];
- });
- },
-
- wechat_secondcode(){
- this.request({
- url: "setting/wechat_secondcode",
- data: {
- id: this.City_code,
- },
- }).then(res => {
- console.log(res, "res")
- if (res.code === '200') {
-
- }
- }).catch((res) => {
-
- });
- },
-
- Dist(e) {
-
- this.Dist_arr = res.data;
-
- return
- this.request({
- url: "setting/getcity",
- data: {
- cityid: this.City_code,
- },
- }).then(res => {
- console.log(res, "res")
- if (res.code === '200') {
- this.Dist_arr = res.data;
- }
- }).catch((res) => {
- this.Dist_arr = [];
- });
- },
-
-
- }
- }
- </script>
- <style>
- page .act {
- color: #007AFF;
- }
- .popup-content {
- width: 100%;
- background: #fff;
- padding: 0rpx 40rpx;
- }
- .popup-content-title {
- border-bottom: 1rpx solid #F1F1F1;
- padding: 10rpx 0rpx;
- }
- .popup-content-scroll {
- height: 590rpx;
- width: 33%;
- text-align: center;
- }
- .popup-content-scroll-li {
- padding: 8rpx 0;
- }
- .home-img-icon {
- border: 1rpx solid #ccc;
- width: 200rpx;
- height: 200rpx;
- }
- </style>
|