123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <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="brandShow = 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="brandShow">
- <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" @click="brandShow=false">
- 取消
- </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" style="display: flex;justify-content: center">
- <u-checkbox v-model="item.checked" v-for="(item, index) in agentList" :key="index" :name="item.brand" shape="circle">
- <view class="u-flex u-row-left" style="width: 150rpx;">
- {{item.brand}}
- </view>
- </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"
- v-for="(item, index) in checkedAgentlist" :key="index">
- <view slot="head">
- <view class="u-flex">
- <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
- {{item.brand}}合作品牌签约任务
- </view>
- </view>
- <view slot="body">
- <u-form-item>
- <view style="margin-right: 10rpx;">
- <u-icon name="account" size="36"></u-icon>
- </view>
- <view class="">
- {{item.name}}
- </view>
- </u-form-item>
- <u-form-item prop="tasklist">
- <view style="margin-right: 10rpx;">
- <u-icon name="order" size="36"></u-icon>
- </view>
- <u-radio-group v-model="item.taskNum">
- <u-radio v-for="(i, index) in tasknameList" :key="index" :name="i.task" :disabled="i.taskdisabled">
- {{i.task}}
- </u-radio>
- </u-radio-group>
- </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 {
- brandShow: false,
- loading: false,
- form: {
- cooperation: '',
- protocol: false,
- },
- formData: '',
- dataUrl: '',
- agentList: [], //经销商信息
- checkedAgentlist: [],
- taskList: [],
- tasknameList: [],
- brandAgentLvQueryList: []
- }
- },
- created() {
- uni.$on('formData', (data) => {
- this.formData =data.formData
- this.dataUrl=data.dataUrl
- })
- },
- mounted() {
- this.getAgentArea()
- this.getTasknum()
- },
- methods: {
- getAgentArea() {
- request({
- url: '/sailun/appStoreBasicInfo/getAgentArea',
- method: 'post',
- data: {
- "area": this.formData.district,
- "city": this.formData.city,
- "province": this.formData.province,
- "spart": "10",
- "vkorg": "8100",
- "vtweg": "10"
- }
- }).then(res => {
- if (res.data.code == 0) {
- this.agentList = res.data.Data.data
- this.agentList = this.agentList.reduce((res, item, index, array) => {
- for (let i = 0; i < array[index].brandList.length; i++) {
- res.push({
- brand: array[index].brandList[i],
- brandCode: array[index].brandList[i],
- name: item.name,
- kunnr: item.kunnr,
- agent_id: item.kunnr,
- taskNum: "",
- checked: false,
- disabled: false,
- })
- }
- return res;
- }, []);
- }
- if (res.data.code == 500) {
- this.$u.toast(res.data.msg);
- }
- return this.agentList
- }).catch(err => {
- console.log(err)
- }).finally(() => {
- })
- },
- getTasknum() {
- request({
- url: '/sailun/appStoreBasicInfo/enum',
- method: 'get',
- data: {},
- }).then(res => {
- if (res.data.code == 0) {
- this.taskList = res.data.data
- this.tasknameList = this.taskList.reduce((res, item) => {
- res.push({
- task: item.signLv,
- taskdisabled: 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();
- this.checkedAgentlist = this.agentList.filter(item => this.cooperations.indexOf(item.brand) > -1)
- this.brandShow = false
- } else {
- console.log("至少选择一项")
- }
- },
- getTaskconfirm(e) {
- this.form.tasklist = e[0].label;
- },
- submit() {
- this.brandAgentLvQueryList = this.checkedAgentlist.reduce((res, item) => {
- res.push({
- agent_id: item.agent_id,
- agent_name:item.name,
- brand: item.brand,
- brandCode: item.brandCode,
- kunnr: item.kunnr,
- lvCount: parseInt(item.taskNum.substring(2)).toString(),
- showLv: item.taskNum,
- spart: "10",
- vkorg: "8100",
- vtweg: "10"
- })
- return res;
- }, []);
- let data = {
- "brandAgentLvQueryList":this.brandAgentLvQueryList,
- "city":this.formData.city,
- "contactName":this.formData.name,
- "district":this.formData.district,
- "jd":this.formData.longitude,
- "licenseUrl":this.dataUrl.licenseUrl,
- "mobileCode":this.formData.code,
- "province":this.formData.province,
- "storeImageUrl":this.dataUrl.storeUrl,
- "storeName":this.formData.store,
- "storePhone":this.formData.phone,
- "version":1.00,
- "wd":this.formData.latitude,
- }
- 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
- this.$u.toast(res.data.msg);
- setTimeout(() => {
- this.$u.route({
- url: 'pages/login/index',
- })
- }, 2000)
- }
- if (res.data.code == 500) {
- this.$u.toast(res.data.msg);
- }
- }).catch(err => {
- console.log(err)
- }).finally(() => {
- this.loading = false
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- padding: 24rpx;
- text-align: center;
- .u-checkbox[data-v-54acf820] {
- display: flex;
- justify-content: center;
- }
- }
- </style>
|