调整Home.vue页面布局和功能

This commit is contained in:
aixianling
2024-11-06 09:31:58 +08:00
parent 191edd1eb4
commit b1d1f60f96

View File

@@ -38,13 +38,13 @@
<div class="admin-main">
<el-scrollbar class="left">
<el-menu
:default-active="activePath"
:collapse-transition="true"
unique-opened
background-color="#545c64"
router
text-color="#fff"
:collapse="isCollapse">
:default-active="activePath"
:collapse-transition="true"
unique-opened
background-color="#545c64"
router
text-color="#fff"
:collapse="isCollapse">
<el-menu-item index="/welcome">
<i class="el-icon-monitor"></i>
<span slot="title">工作台</span>
@@ -231,18 +231,18 @@
</div>
</div>
<el-dialog
title="激活充值"
:visible="$store.state.activeDlgShow"
:close-on-click-modal="false"
width="1200"
:before-close="handleClose">
title="激活充值"
:visible="$store.state.activeDlgShow"
:close-on-click-modal="false"
width="1200"
:before-close="handleClose">
<ai-payment/>
</el-dialog>
<el-dialog
title="温馨提示"
:visible="$store.state.showSheinAlert"
:close-on-click-modal="false"
width="1200">
title="温馨提示"
:visible="$store.state.showSheinAlert"
:close-on-click-modal="false"
width="1200">
<span style="font-size: large">1检查SHEIN商家后台是否登录如没登录请先登录之后再刷新助手<br></span>
<span style="font-size: large">2如果SHEIN商家后台已经登录仍然弹出当前窗口则需要SHEIN进行二次授权二次授权可在菜单商品管理->商品列表任意选择一个商品库存一栏点击修改在新打开的页面中可看到正在鉴权的字样即可完成二次授权</span>
<span slot="footer" class="dialog-footer">
@@ -250,10 +250,10 @@
</span>
</el-dialog>
<el-dialog
title="温馨提示"
:visible="$store.state.showTemuAlert"
:close-on-click-modal="false"
width="1200">
title="温馨提示"
:visible="$store.state.showTemuAlert"
:close-on-click-modal="false"
width="1200">
<span style="font-size: large">请先打开卖家中心结算数据->售后管理页面进行二次授权<a target="_blank" style="text-decoration: underline" href="https://seller.kuajingmaihuo.com/main/aftersales/information">去打开</a><br></span>
<span slot="footer" class="dialog-footer">
<el-button @click="closeTemuAlert"> </el-button>
@@ -267,128 +267,128 @@
</template>
<script>
import {mapMutations, mapState} from 'vuex'
import AiPayment from "@/components/AiPayment.vue";
import LablesMember from '@/components/LablesMember'
import {sendAliexpressAPIMessage, sendGoodcangAPIMessage} from "@/api/chromeApi";
import {mapMutations, mapState} from 'vuex'
import AiPayment from "@/components/AiPayment.vue";
import LablesMember from '@/components/LablesMember'
import {sendAliexpressAPIMessage, sendGoodcangAPIMessage} from "@/api/chromeApi";
export default {
components: {AiPayment, LablesMember},
data() {
return {
isCollapse: false,
activePath: '/home',
form: {
mallId: this.$store.state.mallId,
mallName: this.$store.state.mallName,
code: ''
},
version: '',
vipType: ["体验会员", "月会员", "半年会员", "年会员", "多店通用年会员"]
export default {
components: {AiPayment, LablesMember},
data() {
return {
isCollapse: false,
activePath: '/home',
form: {
mallId: this.$store.state.mallId,
mallName: this.$store.state.mallName,
code: ''
},
version: '',
vipType: ["体验会员", "月会员", "半年会员", "年会员", "多店通用年会员"]
}
},
computed: {
freeLogo: () => require("../assets/free.png"),
getStateInfo() {
if (this.$store.state.userInfo.flag == 0) {
return '未激活';
} else if (this.$store.state.userInfo.flag == 1) {
if (this.$store.state.userInfo.type != 4) {
return `(${this.$store.state.userInfo.mallName})` + this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')';
} else {
return this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')'
}
} else {
return '已过期';
}
},
computed: {
freeLogo: () => require("../assets/free.png"),
getStateInfo() {
if (this.$store.state.userInfo.flag == 0) {
return '未激活';
} else if (this.$store.state.userInfo.flag == 1) {
if (this.$store.state.userInfo.type != 4) {
return `(${this.$store.state.userInfo.mallName})` + this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')';
} else {
return this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')'
}
} else {
return '已过期';
}
},
...mapState(['mallName', 'mallList', 'userInfo']),
isAdmin: v => ['18571466720'].includes(v.userInfo.phone),
},
watch: {
$route(v) {
if (v.meta && v.meta.activeMenu) {
this.activePath = v.meta.activeMenu
} else {
this.activePath = v.fullPath
}
}
},
created() {
const devVersion = require('../manifest.development.json').version
const prodVersion = require('../manifest.production.json').version
this.version = process.env.NODE_ENV === 'production' ? prodVersion : devVersion
if (this.$route.meta && this.$route.meta.activeMenu) {
this.activePath = this.$route.meta.activeMenu
watch: {
$route(v) {
if (v.meta && v.meta.activeMenu) {
this.activePath = v.meta.activeMenu
} else {
this.activePath = this.$route.fullPath
this.activePath = v.fullPath
}
}
},
created() {
const devVersion = require('../manifest.development.json').version
const prodVersion = require('../manifest.production.json').version
this.version = process.env.NODE_ENV === 'production' ? prodVersion : devVersion
if (this.$route.meta && this.$route.meta.activeMenu) {
this.activePath = this.$route.meta.activeMenu
} else {
this.activePath = this.$route.fullPath
}
// this.testGoodcang()
},
methods: {
...mapMutations(['setActiveDlgShow']),
handleClick(e) {
if (e === 'logout') {
this.$store.dispatch('SignOut', false)
} else if (e === 'pwd') {
this.$router.push('changePwd')
} else if (e === 'message') {
this.$router.push('message')
} else if (e === 'coin') {
this.$router.push('coinFlow')
}
// this.testGoodcang()
},
methods: {
...mapMutations(['setActiveDlgShow']),
handleClick(e) {
if (e === 'logout') {
this.$store.dispatch('SignOut', false)
} else if (e === 'pwd') {
this.$router.push('changePwd')
} else if (e === 'message') {
this.$router.push('message')
} else if (e === 'coin') {
this.$router.push('coinFlow')
}
},
openMember(index) {
this.$refs.LablesMember.show(index)
},
openMember(index) {
this.$refs.LablesMember.show(index)
},
handleClose() {
this.form.mallId = "";
this.form.mallName = "";
this.form.code = "";
this.setActiveDlgShow(false)
},
toActive() {
this.setActiveDlgShow(true)
},
getMessage(type) {
return `你使用的是“${this.vipType[type]}”兑换券,确定兑换?`;
},
active() {
this.$refs.form.validate((valid) => {
if (valid) {
this.$http.post(`/api/coupon/getDetail`, null, {
params: {
code: this.form.code
}
}).then(res => {
if (res.code == 0) {
let msg = this.getMessage(res.data.type);
this.$confirm(msg, '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info'
}).then(() => {
this.$http.post(`/api/order/upgradeByCode`, null, {
params: {
...this.form
}
}).then(res => {
if (res.code == 0) {
this.$message.success('激活成功')
this.$store.dispatch('getUserInfo')
this.setActiveDlgShow(false)
}
})
handleClose() {
this.form.mallId = "";
this.form.mallName = "";
this.form.code = "";
this.setActiveDlgShow(false)
},
toActive() {
this.setActiveDlgShow(true)
},
getMessage(type) {
return `你使用的是“${this.vipType[type]}”兑换券,确定兑换?`;
},
active() {
this.$refs.form.validate((valid) => {
if (valid) {
this.$http.post(`/api/coupon/getDetail`, null, {
params: {
code: this.form.code
}
}).then(res => {
if (res.code == 0) {
let msg = this.getMessage(res.data.type);
this.$confirm(msg, '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info'
}).then(() => {
this.$http.post(`/api/order/upgradeByCode`, null, {
params: {
...this.form
}
}).then(res => {
if (res.code == 0) {
this.$message.success('激活成功')
this.$store.dispatch('getUserInfo')
this.setActiveDlgShow(false)
}
})
}
});
})
}
});
}
})