<!--
|
* @Author: 小明丶
|
* @Date: 2020-12-29 09:42:04
|
* @LastEditors: 小明丶
|
* @LastEditTime: 2021-01-08 11:17:00
|
* @Description:APP联登主页
|
-->
|
<template>
|
<div class="APP-home">
|
<van-nav-bar
|
right-text="切换商户"
|
@click-right="onClickRight"
|
>
|
<div slot="title">
|
<h4 class="title-span">{{$store.state.userinfo.orgName}}</h4>
|
</div>
|
</van-nav-bar>
|
<div class="producat">
|
<ul class="list">
|
<li
|
class="item"
|
v-for="item in list"
|
:key="item.prodId"
|
@click="goNext(item)"
|
>
|
<img :src="item.icon" alt="商品图" v-if="item.prodId === 30000008"/>
|
<i v-else class="iconfont iconhuabei"></i>
|
<p>{{ item.typeName }}</p>
|
</li>
|
</ul>
|
<div class="no-data" v-if="list.length === 0">
|
<div>
|
<img class="no-data-pic" src="../../assets/imgs/nodata.png" alt="暂无产品">
|
<p>暂无产品</p>
|
</div>
|
</div>
|
</div>
|
<button class="btn" @click="goBack" v-show="hasurl">返回首页</button>
|
</div>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
proList: [],
|
shskHasOpen:false,
|
url:''
|
};
|
},
|
computed:{
|
list(){
|
return this.proList.map(item=>{
|
if(item.prodId == 30000003){
|
item.typeName = '花呗分期'
|
}
|
return item
|
})
|
},
|
hasurl(){
|
console.log(typeof this.url)
|
// if(this.url != 'undefined' && this.url){
|
if(typeof this.url == 'string' && this.url != 'null'){
|
|
return true;
|
}else{
|
return false;
|
}
|
}
|
},
|
created(){
|
this.url = sessionStorage.backUrl;
|
},
|
mounted(){
|
this.$api.prodManagerInit().then(res=>{
|
res.body.prodTypeRespVoList2.forEach(item=>{
|
if (item.prodId == 30000003 || item.prodId == 30000008 ){
|
this.proList.push(item)
|
}
|
})
|
})
|
},
|
methods: {
|
onClickRight() {
|
this.$router.push({
|
path: "/app/changeMer"
|
});
|
},
|
goNext(item) {
|
if(item.prodId == 30000003){
|
this.$router.push({
|
path: "/app/choseVersion",
|
query: {
|
prodId: item.prodId,
|
typeId: item.typeId
|
},
|
});
|
}else{
|
this.$api.prodZfbVersion({prodId:item.prodId}).then(res=>{
|
let list = res.body;
|
for(let i = 0; i < list.length; i++){
|
if(list[i].zfbVersion == 3 && list[i].openStatus == 2){
|
this.$router.push({
|
path:'/app/shskVersionDetail',
|
query:{
|
prodId: item.prodId,
|
typeId: item.typeId,
|
isApp: 1,
|
zfbVersion: 3,
|
title: '商户收款'
|
}
|
})
|
}else if(list[i].zfbVersion == 3 && list[i].openStatus == 0){
|
this.$router.push({
|
path:'/huabei/open',
|
query:{
|
prodId: item.prodId,
|
typeId: item.typeId,
|
isApp: 1,
|
zfbVersion: 3,
|
title: '商户收款'
|
}
|
})
|
}else if(list[i].zfbVersion == 3 && list[i].openStatus == 1){
|
this.$router.push({
|
path:'/huabei/open-result',
|
query:{
|
prodId: item.prodId,
|
typeId: item.typeId,
|
isApp: 1,
|
zfbVersion: 3,
|
title: '商户收款'
|
}
|
})
|
}
|
}
|
})
|
}
|
},
|
goBack(){
|
location.href = sessionStorage.backUrl
|
}
|
},
|
};
|
</script>
|
<style lang="less" scoped>
|
.APP-home {
|
& {
|
min-height: 100vh;
|
background: #fafafa;
|
}
|
.title-span{
|
display: inline-block;
|
width: 200px;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
}
|
.producat {
|
width: 340px;
|
margin: auto;
|
margin-top: 10px;
|
border-radius: 15px;
|
background: #fff;
|
padding: 20px 0;
|
}
|
.list {
|
display: flex;
|
justify-content: space-between;
|
}
|
.item {
|
text-align: center;
|
width: 49%;
|
img {
|
width: 60px;
|
height: 60px;
|
}
|
}
|
.btn {
|
width: 320px;
|
height: 44px;
|
background: #896edb;
|
border-radius: 22px;
|
outline: none;
|
border: 0;
|
position: fixed;
|
bottom: 30px;
|
left: 50%;
|
transform: translateX(-50%);
|
color: #fff;
|
}
|
.no-data{
|
display: flex;
|
justify-content: center;
|
div{
|
text-align: center;
|
}
|
}
|
.no-data-pic{
|
width: 80px;
|
height: 80px;
|
margin-bottom: 10px;
|
}
|
.iconhuabei{
|
font-size: 55px;
|
color: rgb(16, 143, 234);
|
}
|
}
|
</style>
|