123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- <template>
- <view>
- <u-form :model="form">
- <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
- <view slot="head">
- <view class="u-flex">
- <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
- 选择合作品牌
- </view>
- </view>
- <view slot="body">
- <u-form-item prop="cooperation">
- <view style="margin-right: 10rpx;">
- <u-icon name="order" size="36"></u-icon>
- </view>
- <u-input placeholder="点击选择合作品牌" :disabled="true" @click="show = true;" v-model="form.cooperation"></u-input>
- <view class="" slot="right">
- <u-icon name="arrow-right" color="#666666" size="36"></u-icon>
- </view>
- </u-form-item>
- </view>
- </u-card>
- <u-popup mode="bottom" v-model="show">
- <view class="u-flex u-row-between u-padding-left-40 u-padding-right-40" style="height: 90rpx;" @click="show = false;">
- <view style="padding: 16rpx;font-size:30rpx">
- 取消
- </view>
- <view style="padding: 16rpx;color:#0095FF;font-size:30rpx" @click="getCooperation">
- 确认
- </view>
- </view>
- <u-line color="#e4e7ed"></u-line>
- <view class="content">
- <scroll-view scroll-y="true" style="height: 300rpx;">
- <view class="u-flex u-row-center">
- <u-checkbox-group :wrap="true" @change="checkboxGroupChange">
- <u-checkbox v-model="item.checked" v-for="(item, index) in brandList" :key="index" :name="item.name" shape="circle">{{item.name}}</u-checkbox>
- </u-checkbox-group>
- </view>
- </scroll-view>
- </view>
- </u-popup>
- <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
- <view slot="head">
- <view class="u-flex">
- <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
- 已选合作品牌
- </view>
- </view>
- <view slot="body">
- <view class="u-flex u-flex-wrap u-row-around">
- <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
- <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
- <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
- <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
- </view>
- </view>
- </u-card>
- <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
- <view slot="head">
- <view class="u-flex">
- <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
- 赛轮合作品牌签约任务
- </view>
- </view>
- <view slot="body">
- <u-form-item>
- <view style="margin-right: 10rpx;">
- <u-icon name="account" size="36"></u-icon>
- </view>
- <view class="">
- 某某代理商
- </view>
- </u-form-item>
- <u-form-item prop="lists">
- <view style="margin-right: 10rpx;">
- <u-icon name="order" size="36"></u-icon>
- </view>
- <u-input placeholder="点击选择签约任务" :disabled="true" @click="show = true;"></u-input>
- <view class="" slot="right">
- <u-icon name="arrow-right" color="#666666" size="36"></u-icon>
- </view>
- </u-form-item>
- </view>
- </u-card>
- <u-form-item prop="protocol" :border-bottom="false">
- <view style="margin:0 30rpx;">
- <u-checkbox-group>
- <u-checkbox v-model="form.protocol">同意《用户协议》及《隐私政策》</u-checkbox>
- </u-checkbox-group>
- </view>
- </u-form-item>
- </u-form>
- <view style="margin:0 30rpx;">
- <u-button @click="nextStep" type="primary" @tap="$u.debounce(submit, 2000,immediate = true)" :loading="loading"
- :ripple="true" ripple-bg-color="#99d4ff">确认注册</u-button>
- </view>
- </view>
- </template>
- <script>
- import {
- request
- } from '../../common/request/request'
- require("promise.prototype.finally").shim()
- export default {
- data() {
- return {
- show: false,
- loading: false,
- form: {
- cooperation: '',
- protocol: false
- },
- form2: {},
- formData: [],
- dataUrl: [],
- agentList: [],
- brandList: [], //品牌
- nameList:""
- }
- },
- created() {
- uni.$on('formData', (data) => {
- this.formData = data
- })
- uni.$on('dataUrl', (data) => {
- this.dataUrl = data
- })
- this.getAgentArea()
- },
- methods: {
- getAgentArea() {
- request({
- url: '/sailun/appStoreBasicInfo/getAgentArea',
- method: 'post',
- data: {
- // "area": this.formData.district,
- // "city": this.formData.city,
- // "province": this.formData.province,
- "area": "市北区",
- "city": "青岛市",
- "province": "山东省",
- "spart": "10",
- "vkorg": "8100",
- "vtweg": "10"
- },
- }).then(res => {
- if (res.data.code == 0) {
- this.agentList = res.data.Data.data
- // 从经销商里里面抽取品牌
- const list = this.agentList.map((item, index) => {
- return item.brandList;
- }).join(",").split(',')
- //去重
- const list2 = [...new Set(list)]
- //根据复选框的数据结构重组数组
- this.brandList = list2.reduce((res, item) => {
- res.push({
- name: item,
- checked: false,
- disabled: false
- })
- return res;
- }, []);
- }
- if (res.data.code == 500) {
- this.$u.toast(res.data.msg);
- }
- }).catch(err => {
- console.log(err)
- }).finally(() => {
- })
- },
- checkboxGroupChange(e) {
- this.cooperations = e
- },
- getCooperation() {
- if (this.cooperations != null) {
- this.form.cooperation = this.cooperations.toString();
- let coopList = this.form.cooperation.split(",")
-
- let a=this.agentList.forEach((item,index, array)=>
- {
- for (let i = 0; i < array[index].brandList.length; i++) {
- for (let j = 0; j < coopList.length; j++) {
- if(coopList[j] == array[index].brandList[i]){
- this.nameList+=array[index].name+','
- }
- }
- }
- })
- this.nameList=[...new Set(this.nameList.split(',').filter(item => item))]
- this.show = false
- } else {
- console.log("至少选择一项")
- }
- },
- submit() {
- let data = {
- // "addressInfo": this.formData.addressInfo,
- "brandAgentLvQueryList": [{
- "agent_id": "string",
- "brand": "string",
- "brandCode": "string",
- "kunnr": "string",
- "lvCount": "string",
- "showLv": "string",
- "spart": "string",
- "vkorg": "string",
- "vtweg": "string"
- }],
- "city": "string",
- "contactName": "string",
- "district": "string",
- "jd": "string",
- "licenseUrl": "string",
- "mobileCode": "string",
- "province": "string",
- "storeImageUrl": "string",
- "storeName": "string",
- "storePhone": "string",
- "version": 0,
- "wd": "string"
- }
- console.log(data)
- request({
- url: '/sailun/appStoreBasicInfo/storeReg',
- method: 'post',
- data: data
- }).then(res => {
- console.log(res)
- if (res.data.code == 0) {
- this.loading = true
- setTimeout(() => {
- this.$u.route({
- url: 'pages/login/index',
- type: "reLaunch"
- })
- this.loading = false
- }, 2000)
- }
- if (res.data.code == 500) {
- this.$u.toast(res.data.msg);
- }
- }).catch(err => {
- console.log(err)
- }).finally(() => {
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- padding: 24rpx;
- text-align: center;
- .u-checkbox[data-v-54acf820] {
- display: flex;
- justify-content: center;
- }
- }
- </style>
|