|
@@ -3,10 +3,15 @@
|
|
|
<van-nav-bar class="navBar" title="切换经销商" left-arrow @click-left="onClickLeft" />
|
|
<van-nav-bar class="navBar" title="切换经销商" left-arrow @click-left="onClickLeft" />
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<div class="module">
|
|
<div class="module">
|
|
|
- <div class="box" v-if="userInfo.chainList && userInfo.chainList.length > 0">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="box"
|
|
|
|
|
+ v-if="userInfo.userMultipleChains && userInfo.userMultipleChains.length > 0">
|
|
|
<van-radio-group v-model="userInfo.chainCode" @change="chainChange">
|
|
<van-radio-group v-model="userInfo.chainCode" @change="chainChange">
|
|
|
- <van-radio v-for="value in userInfo.chainList" :key="value.id" :name="value.id">
|
|
|
|
|
- {{ value.name }}
|
|
|
|
|
|
|
+ <van-radio
|
|
|
|
|
+ v-for="value in userInfo.userMultipleChains"
|
|
|
|
|
+ :key="value.chainCode"
|
|
|
|
|
+ :name="value.chainCode">
|
|
|
|
|
+ {{ value.chainName }}
|
|
|
</van-radio>
|
|
</van-radio>
|
|
|
</van-radio-group>
|
|
</van-radio-group>
|
|
|
</div>
|
|
</div>
|
|
@@ -16,7 +21,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import { mapState } from 'vuex';
|
|
import { mapState } from 'vuex';
|
|
|
-import { switchchainIdentity } from '@/api/week';
|
|
|
|
|
|
|
+import { switchChainIdentity } from '@/api/week';
|
|
|
import store from '@/store';
|
|
import store from '@/store';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'changeChain',
|
|
name: 'changeChain',
|
|
@@ -31,12 +36,15 @@ export default {
|
|
|
created() {},
|
|
created() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
chainChange(value) {
|
|
chainChange(value) {
|
|
|
- console.log(value);
|
|
|
|
|
- switchchainIdentity({ chainCode: value }).then((res) => {
|
|
|
|
|
|
|
+ this.toastLoading(0, '切换中,请稍候...', true);
|
|
|
|
|
+ switchChainIdentity({ chainCode: value }).then((res) => {
|
|
|
|
|
+ this.toastLoading().clear();
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
- store.dispatch('user/getUserInfo').then(() => {
|
|
|
|
|
|
|
+ store.dispatch('getUserInfo').then(() => {
|
|
|
this.$toast('切换成功');
|
|
this.$toast('切换成功');
|
|
|
});
|
|
});
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$toast(res.message || '切换失败');
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -65,6 +73,9 @@ export default {
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
padding: 10px;
|
|
padding: 10px;
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
|
|
+ .van-radio {
|
|
|
|
|
+ padding: 8px 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|