版本迭代

This commit is contained in:
liuye
2023-08-06 16:50:17 +08:00
parent 590fb406cc
commit 5c0b1afe69
63 changed files with 14131 additions and 40 deletions

260
src/view/CopyProduct.vue Normal file
View File

@@ -0,0 +1,260 @@
<template>
<div>
<ai-list class="list">
<ai-title
slot="title"
title="商品模板"
tips="请先在当前浏览器登录“拼多多跨境卖家中心”,期间保持登录状态"
isShowBottomBorder>
</ai-title>
<template slot="content">
<div class="content">
<ai-search-bar>
<template #left>
<el-button type="button" :icon="'el-icon-delete'" :class="'el-button el-button--primary'" @click="remove()">删除</el-button>
<el-button v-if="$store.state.mallName" type="button" :class="'el-button el-button--primary'" @click="toAddTemplate()">{{$store.state.mallName}}添加商品模板</el-button>
<el-button v-if="$store.state.mallName" type="button" :class="'el-button el-button--primary'" @click="addToDraft()">将商品模板添加到{{$store.state.mallName}}草稿箱</el-button>
</template>
<template #right>
<el-button size="small" circle icon="el-icon-refresh-right" @click="getList()"></el-button>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 8px;"
:current.sync="search.current" :size.sync="search.size"
@selection-change="handleSelectionChange"
@getList="getList">
</ai-table>
</div>
</template>
</ai-list>
<el-dialog
title="商品列表"
:visible.sync="dlgShow"
:close-on-click-modal="false"
width="70%"
:before-close="handleClose">
<ai-table
:tableData="productTableData"
:col-configs="productColConfigs"
:total="productPage.total"
:current.sync="productPage.page" :size.sync="productPage.pageSize"
style="margin-top: 8px;"
@selection-change="productHandleSelectionChange"
@getList="getProductList">
</ai-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dlgShow = false"> </el-button>
<el-button type="primary" @click="saveProduct">添加到模板</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {sendChromeAPIMessage} from '@/api/chromeApi'
import {timestampToTime} from '@/utils/date'
import {transform} from '@/utils/product'
import { Message } from 'element-ui'
export default {
name: 'List',
data () {
return {
search: {
current: 1,
size: 10,
productName: '',
mallName: '',
startDate: '',
endDate: ''
},
colConfigs: [
{ type: "selection", width: '70px', align: 'left', fixed: 'left'},
{ prop: 'productSpu', label: 'SPU', align: 'left' },
{ prop: 'productName', label: '商品名称', align: 'left' },
{ prop: 'mallName', label: '来源店铺', align: 'left'},
{ prop: 'createTime', label: '添加时间', width: '180px', fixed: 'right'}
],
tableData: [],
total: 0,
ids: [],
dlgShow: false,
productTableData: [],
productPage: {page: 1, pageSize: 10, total: 0},
productColConfigs: [
{ type: "selection", width: '70px', align: 'left', fixed: 'left'},
{ prop: 'productSpu', label: 'SPU ID', align: 'left' },
{ prop: 'productSkc', label: 'SKC ID', align: 'left' },
{ prop: 'productName', label: '商品名称', align: 'left' },
{ prop: 'createTime', label: '创建时间', align: 'left' }
],
productIds: [],
}
},
created () {
this.getList()
},
methods: {
getList () {
this.$http.post('/api/product/myPage',null,{
params: {
...this.search
}
}).then(res => {
this.tableData = res.data.records
this.total = res.data.total
})
},
remove () {
if (this.ids.length <= 0) {
alert('请选择要删除的商品');
return;
}
this.$confirm('确定要删除?', '温馨提示', {
type: 'warning'
}).then(() => {
this.$http.post('/api/product/delByIds',this.ids
).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
handleSelectionChange(val) {
this.ids = [];
val.forEach(e => {
this.ids.push(e.id);
});
},
// 添加模板
handleClose() {
this.productTableData = []
this.productPage = {page: 1, pageSize: 10, total: 0}
this.dlgShow = false
},
toAddTemplate() {
this.$http.post('/api/malluser/info').then(res => {
if (res.code == 0) {
this.$store.commit('setUserInfo', res.data)
if (res.data.flag != 1) {
Message.error('您的账号未激活或已失效,请激活后使用')
this.$store.commit('setActiveDlgShow', true)
return;
}
this.dlgShow = true
this.getProductList()
}
})
},
getProductList() {
sendChromeAPIMessage({
url: 'bg-visage-mms/product/skc/pageQuery',
needMallId: true,
data: {
...this.productPage
}}).then((res) => {
if (res.errorCode == 1000000) {
this.productPage.total = res.result.total
this.productTableData = res.result.pageItems.map((item) => {
console.log(item.createdAt)
return {
productSpu: item.productId,
productSkc: item.productSkcId,
productName: item.productName,
createTime: timestampToTime(item.createdAt)
};
})
}
});
},
productHandleSelectionChange(val) {
this.productIds = [];
val.forEach(e => {
this.productIds.push(e.productSpu);
});
},
saveProduct() {
if (this.productIds.length <= 0) {
alert('请选择商品');
return;
}
this.productIds.map((productSpu, index) => {
sendChromeAPIMessage({
url: 'bg-visage-mms/product/query',
needMallId: true,
data: {
productEditTaskUid: '',
productId: productSpu
}}).then((res) => {
if (res.errorCode == 1000000) {
let content = transform(res.result)
this.$http.post('/api/product/add', {
mallName: this.$store.state.mallName,
productSpu: res.result.productId,
productName: res.result.productName,
content: content
}).then(res1 => {
if (res1.code == 0) {
Message.success("商品【" + res.result.productName + "】成功添加为商品模板")
if (index == this.productIds.length - 1) {
this.getList()
}
}
})
}
})
})
},
addToDraft() {
if (this.ids.length <= 0) {
alert('请选择商品模板');
return;
}
this.ids.map((id, index) => {
let product = this.tableData.filter((item) => {
return item.id == id
})
setTimeout(() => {
sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/add',
needMallId: true,
data: {
catId: 26117
}}).then((res) => {
if (res.errorCode == 1000000) {
let draftId = res.result.productDraftId
let content = JSON.parse(product[0].content)
content.productDraftId = draftId
sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/save',
needMallId: true,
data: {
...content
}}).then((res) => {
if (res.errorCode == 1000000) {
Message.success("商品【" + product[0].productName + "】成功添加到草稿箱")
}
})
}
})
}, 1000*index)
})
}
}
}
</script>
<style scoped lang="scss">
</style>

206
src/view/ExportSaleData.vue Normal file
View File

@@ -0,0 +1,206 @@
<template>
<ai-list class="list">
<ai-title
slot="title"
title="销售数据"
isShowBottomBorder>
</ai-title>
<template slot="content">
<ai-search-bar>
<template #left>
</template>
<template #right>
<json-excel
:data="list"
:fields="jsonFields"
:before-generate = "startDownload"
name="销售数据.xls"
worksheet="销售统计">
<el-button size="small">导出销售数据</el-button>
</json-excel>
</template>
</ai-search-bar>
<ai-table
:isShowPagination="false"
:tableData="list"
:col-configs="colConfigs"
:total="list.length"
style="margin-top: 8px;"
@getList="() => {}">
</ai-table>
</template>
</ai-list>
</template>
<script>
import {sendChromeAPIMessage} from '@/api/chromeApi'
import JsonExcel from 'vue-json-excel'
import { Message } from 'element-ui'
export default {
name: 'ExportSaleData',
data () {
return {
list: [],
pageSize: 10,
currentPage: 1,
colConfigs: [
{
prop: 'productName',
label: '商品名称',
align: 'left'
},
{
prop: 'productId',
label: 'SPU',
align: 'center'
},
{
prop: 'productSkcId',
label: 'SKC',
align: 'center'
},
{
prop: 'className',
label: 'SKU属性',
align: 'center'
},
{
prop: 'supplierPrice',
label: '申报价格(CNY)',
align: 'center',
format: v => v / 100
},
{
prop: 'isVerifyPrice',
label: '开款核价状态',
align: 'center',
format: v => v ? '核价通过': '核价未通过 / 无法备货'
},
],
jsonFields: {
"商品名称": "productName",
"SPU": "productId",
"SKC": "productSkcId",
"SKU属性": "className",
"申报价格(CNY)": {
"field": "supplierPrice",
callback: (value) => {
return value /100;
}
},
"SKU货号": "skuExtCode",
"开款核价状态": {
"field": "isVerifyPrice",
callback: (value) => {
return value ? '核价通过': '核价未通过 / 无法备货';
}
},
"缺货数量": "lackQuantity",
"建议备货量": "adviceQuantity",
"可售天数": "availableSaleDays",
"库存可售天数": "availableSaleDaysFromInventory",
"仓内库存可售天数": "warehouseAvailableSaleDays",
"近7日用户加购数量": "inCartNumber7d",
"用户累计加购数量": "inCardNumber",
"已订阅待提醒到货": "nomsgSubsCntCntSth",
"销售数据 - 今日": "todaySaleVolume",
"销售数据 - 近7日": "lastSevenDaysSaleVolume",
"销售数据 - 近30天": "lastThirtyDaysSaleVolume",
"库存数据 - 仓内可用库存": "inventoryNumInfo.warehouseInventoryNum",
"库存数据 - 仓内暂不可用库存": "inventoryNumInfo.unavailableWarehouseInventoryNum",
"库存数据 - 已发货库存": "inventoryNumInfo.waitReceiveNum",
"库存数据 - 已下单待发货库存": "inventoryNumInfo.waitDeliveryInventoryNum",
"库存数据 - 待审核备货库存": "inventoryNumInfo.waitApproveInventoryNum",
"VMI备货单数 - 待发货": "vmiOrderInfo.waitDeliveryNum",
"VMI备货单数 - 在途单数": "vmiOrderInfo.transportationNum",
"VMI备货单数 - 发货延迟": "vmiOrderInfo.deliveryDelayNum",
"VMI备货单数 - 到货延迟": "vmiOrderInfo.arrivalDelayNum",
"非VMI备货单数 - 待发货": "notVmiOrderInfo.waitDeliveryNum",
"非VMI备货单数 - 在途单数": "notVmiOrderInfo.transportationNum",
"非VMI备货单数 - 发货延迟": "notVmiOrderInfo.deliveryDelayNum",
"非VMI备货单数 - 到货延迟": "notVmiOrderInfo.arrivalDelayNum",
"备货逻辑": "purchaseConfig"
}
}
},
components: {
JsonExcel
},
created () {
this.$http.post('/api/malluser/info').then(res => {
if (res.code == 0) {
this.$store.commit('setUserInfo', res.data)
if (res.data.flag != 1) {
Message.error('您的账号未激活或已失效,请激活后使用')
this.$store.commit('setActiveDlgShow', true)
return;
} else {
this.getList()
}
}
})
},
methods: {
getList () {
sendChromeAPIMessage({
url: 'marvel-mms/cn/api/kiana/venom/sales/management/list',
needMallId: true,
data: {
pageNo: this.currentPage,
pageSize: this.pageSize,
isLack: 0,
priceAdjustRecentDays: 7
}}).then((res) => {
if (res.errorCode == 1000000) {
// this.list = res.result.subOrderList
for(let i = 0;i < res.result.subOrderList.length; i++) {
let item = res.result.subOrderList[i];
let data = {};
data.productName = item.productName;
data.productId = item.productId;
data.productSkcId = item.productSkcId;
data.purchaseConfig = item.purchaseConfig;
for(let j = 0;j < item.skuQuantityDetailList.length; j++) {
data = {...data, ...item.skuQuantityDetailList[j]}
this.list.push(data);
}
}
if (this.pageSize == res.result.subOrderList.length) {
this.currentPage ++
this.getList()
} else {
Message.success('销售数据加载完成,可进行导出')
}
}
console.log(this.list)
});
},
startDownload() {
this.$http.post('/api/malluser/info').then(res => {
if (res.code == 0) {
this.$store.commit('setUserInfo', res.data)
if (res.data.flag != 1) {
Message.error('您的账号未激活或已失效,请激活后使用')
this.$store.commit('setActiveDlgShow', true)
return;
}
}
})
}
}
}
</script>
<style scoped lang="scss">
</style>

387
src/view/Home.vue Normal file
View File

@@ -0,0 +1,387 @@
<template>
<div class="admin">
<div class="admin-top">
<div class="logo">
<!-- <img src="../../assets/images/logo.png" /> -->
<div>
<h1>TEMU助手</h1>
</div>
</div>
<div class="admin-right">
<div class="left" @click="toActive">
<span>{{ $store.state.userInfo.name + "(" + $store.state.userInfo.phone + ")" }}</span>
<div :style="{marginLeft: '10px', color: $store.state.userInfo.flag == 1? 'green': 'red'}">({{ getStateInfo }})</div>
</div>
<el-dropdown @command="onMallChange" v-if="mallName">
<div class="userinfo">
<span>{{ mallName }}</span>
<img src="../assets/images/bottom.png" />
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(item, index) in mallList"
:command="item"
:key="index">
{{ item.mallName }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<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">
<el-menu-item index="/welcome">
<i class="el-icon-monitor"></i>
<span slot="title">工作台</span>
</el-menu-item>
<el-menu-item index="/normalSendGoods">
<i class="el-icon-shopping-cart-2"></i>
<span slot="title">普通备货单</span>
</el-menu-item>
<el-menu-item index="/copyProduct">
<i class="el-icon-document-copy"></i>
<span slot="title">商品复制</span>
</el-menu-item>
<el-menu-item index="/saleData">
<i class="el-icon-s-data"></i>
<span slot="title">销售数据</span>
</el-menu-item>
<el-menu-item index="/learning">
<i class="el-icon-s-data"></i>
<span slot="title">学习园地</span>
</el-menu-item>
<!-- <el-menu-item index="/statistics">
<i class="el-icon-s-data"></i>
<span slot="title">数据统计</span>
</el-menu-item> -->
</el-menu>
<div style="position: absolute; bottom: 20px; padding-left: 20px; ">
<div style="cursor: pointer; font-size: 16px;" @click="$store.commit('SignOut', true)">
<i class="el-icon-back" style="color: white; margin-right: 5px;"></i>
<span style="color: white">退出</span>
</div>
</div>
</el-scrollbar>
<div class="container">
<transition name="fade-transform" mode="out-in">
<keep-alive include="NormalSendGoods">
<router-view class="container-app"></router-view>
</keep-alive>
</transition>
</div>
</div>
<el-dialog
title="用户激活"
:visible="$store.state.activeDlgShow"
:close-on-click-modal="false"
width="30%"
:before-close="handleClose">
<el-form :model="form" label-position="top" ref="form" label-width="100px" class="form">
<el-form-item
prop="mallName"
label="当前绑定账号"
:rules="[{ required: true, message: '请先登录拼多多跨境卖家中心', trigger: 'blur' }]">
<el-input readonly placeholder="请先登录拼多多跨境卖家中心" v-model="form.mallName"></el-input>
</el-form-item>
<el-form-item
prop="mallId"
v-show="false"
:rules="[{ message: '请输入商城ID', trigger: 'blur' }]">
<el-input placeholder="请输入商城ID" v-model="form.mallId"></el-input>
</el-form-item>
<el-form-item
prop="code"
label="激活码"
:rules="[{ required: true, message: '请输入激活码', trigger: 'blur' }]">
<el-input placeholder="请输入激活码" v-model="form.code"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="$store.commit('setActiveDlgShow', false)"> </el-button>
<el-button type="primary" @click="active"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data () {
return {
isCollapse: false,
activePath: '/home',
form: {
mallId: this.$store.state.mallId,
mallName: this.$store.state.mallName,
code: ''
},
vipType: ["体验会员","月会员","半年会员","年会员","年会员多店通用"]
}
},
computed: {
getStateInfo() {
if (this.$store.state.userInfo.flag == 0) {
return '未激活';
} else if (this.$store.state.userInfo.flag == 1) {
return this.vipType[this.$store.state.userInfo.type] + '/有效期至' + this.$store.state.userInfo.expireTime;
} else {
return '已过期';
}
},
...mapState(['mallName', 'mallList'])
},
watch: {
$route (v) {
this.activePath = v.fullPath
}
},
created () {
this.activePath = this.$route.fullPath
},
methods: {
onMallChange (e) {
this.$store.commit('setMallName', e.mallName)
this.$store.commit('setMallId', e.mallId)
location.reload()
},
handleClose() {
this.form.mallId = "";
this.form.mallName = "";
this.form.code = "";
this.$store.commit('setActiveDlgShow', false)
},
toActive() {
this.$store.commit('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.$store.commit('setActiveDlgShow', false)
}
})
})
}
});
}
})
}
}
}
</script>
<style lang="scss" scoped>
.admin {
width: 100%;
height: 100vh;
overflow: hidden;
background: #f4f4f4;
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all .4s;
}
.fade-transform-enter {
opacity: 0;
transform: translateX(-20px);
}
.fade-transform-leave-to {
opacity: 0;
transform: translateX(20px);
}
.admin-main {
display: flex;
align-items: center;
height: calc(100% - 64px);
overflow: hidden;
border-top: 1px solid rgba(0,0,0,0.15);
.container {
flex: 1;
height: 100%;
overflow: hidden;
.container-app {
width: 100%;
height: 100%;
overflow-y: auto;
}
}
.left {
width: 246px;
height: 100%;
background: #545c64;
img {
width: 16px;
height: 16px;
margin-right: 10px;
opacity: 0.8;
}
}
}
.admin-top {
display: flex;
align-items: center;
justify-content: space-between;
height: 64px;
padding: 0 24px 0 36px;
// box-shadow: 0px 1px 0px 0px rgba(128, 128, 128, 0.1);
background: #fff;
.logo {
display: flex;
align-items: center;
cursor: pointer;
&:hover {
opacity: 0.6;
}
img {
width: 42px;
height: 42px;
margin-right: 12px;
}
h1 {
line-height: 25px;
color: #1F2635;
font-size: 18px;
font-weight: 600;
}
p {
margin-top: 1px;
line-height: 17px;
font-size: 12px;
font-weight: 400;
color: #A5A9BC;
}
}
.admin-middle {
display: flex;
align-items: center;
height: 64px;
span {
position: relative;
margin-right: 60px;
height: 64px;
line-height: 64px;
font-size: 16px;
color: #1F2635;
cursor: pointer;
transition: all ease 0.5s;
&.active::after {
position: absolute;
left: 50%;
bottom: 9px;
z-index: 1;
width: 52px;
height: 4px;
background: #00A971;
transform: translateX(-50%);
content: ' ';
}
&.active, &:hover {
color: #1FBAD6;
}
&:last-child {
margin-right: 0;
}
}
}
.admin-right {
display: flex;
align-items: center;
height: 100%;
.left {
display: flex;
align-items: center;
cursor: pointer;
transition: all ease 0.3s;
&:hover {
opacity: 0.5;
}
}
.userinfo {
display: flex;
justify-content: center;
align-items: center;
height: 56px;
margin-left: 20px;
cursor: pointer;
transition: all ease 0.3s;
&:hover {
opacity: 0.5;
}
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
}
span {
margin-right: 8px;
color: #1F2635;
font-size: 14px;
}
}
}
}
}
</style>

97
src/view/Learning.vue Normal file
View File

@@ -0,0 +1,97 @@
<template>
<ai-list class="Learning">
<ai-title
slot="title"
title="学习园地"
isShowBottomBorder>
</ai-title>
<template slot="content">
<ai-search-bar>
<template #left>
<el-radio-group v-model="search.categoryId">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="学院">我的收藏</el-radio-button>
<el-radio-button :label="item.id" :key="item.id" v-for="item in cateList">{{ item.name }}</el-radio-button>
</el-radio-group>
</template>
<template #right>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
:current.sync="search.current"
:size.sync="search.size"
style="margin-top: 8px;"
@getList="getList">
<el-table-column slot="options" label="操作" align="center" fixed="right" width="90px">
<template v-slot="{row}">
<div class="table-options">
<el-button type="text">收藏</el-button>
<el-button type="text" @click="toDetail(row.url)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
export default {
name: 'Learning',
data () {
return {
colConfigs: [
{ prop: 'title', label: '标题', align: 'left' },
{ prop: 'subPurchaseOrderSn', label: '是否收藏', align: 'center' },
],
tableData: [],
total: 0,
search: {
current: 1,
size: 10,
categoryId: ''
},
cateList: []
}
},
created () {
this.getCateList()
this.getList()
},
methods: {
toDetail (url) {
window.open(url)
},
getCateList () {
this.$http.post('/api/learningCategory/page?size=50').then(res => {
if (res.code === 0) {
this.cateList = res.data.records
}
})
},
getList () {
this.$http.post('/api/learning/pluginPage', null, {
params: {
...this.search
}
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,336 @@
<template>
<div>
<ai-list class="list">
<ai-title
slot="title"
title="普通备货单"
tips="请先在当前浏览器登录“拼多多跨境卖家中心”,期间保持登录状态"
isShowBottomBorder>
</ai-title>
<template slot="content">
<ai-search-bar>
<template #left>
<el-button type="button" :icon="isBegin? 'el-icon-loading': ''" :class="isBegin ? 'el-button el-button--danger': 'el-button el-button--primary'" @click="beginRob()">{{isBegin ? '结束抢仓': '开始抢仓'}}</el-button>
</template>
<template #right>
<el-button size="small" circle icon="el-icon-refresh-right" @click="getList()"></el-button>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
:isShowPagination="false"
style="margin-top: 8px;"
@selection-change="handleSelectionChange"
@getList="getList">
<el-table-column slot="productName" width="400px" label="商品信息" show-overflow-tooltip align="left">
<template slot-scope="scope">
<div>
<div class="order-manage_productInfo__1pD83">
<img :src="scope.row.productSkcPicture">
<div>备货母单号: {{ scope.row.originalPurchaseOrderSn }}</div>
<div>{{ scope.row.productName }}</div>
<div>SKC: {{ scope.row.productSkcId }}</div>
<div>货号: {{ scope.row.productSn }}</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column slot="robInfo" label="抢仓信息" show-overflow-tooltip align="left">
<template slot-scope="scope">
<div data-testid="beast-core-box" style="margin-right: 2px;">
已抢仓 <div style="color: red; display: inline;">{{ scope.row.robTotal }}</div>
</div>
</template>
</el-table-column>
<el-table-column slot="status" label="状态" show-overflow-tooltip align="left">
<template slot-scope="scope">
<div data-testid="beast-core-box" class="outerWrapper-1-3-1 outerWrapper dot-module__dot___M-RuH " style="margin-right: 2px;">
<div class="dot-module__circle___2l2UV" style="background-color: var(--pc-dot-warn-bg-color,#ff6800);"></div>待发货
</div>
</template>
</el-table-column>
<el-table-column slot="className" label="SKU信息" width="400px" show-overflow-tooltip align="left">
<template slot-scope="scope">
<div class="order-manage_skuInfo__FW-Nd" v-for="(item, index) in scope.row.detailList">
<div>
<div data-testid="beast-core-box" class="outerWrapper-1-3-1 outerWrapper-d18-1-3-20 index-module__image-preview___2fiZX">
<div class="index-module__img___p3B1N" :style="getStyle(item.thumbUrlList[0])"></div>
</div>
</div>
<div class="order-manage_contentInfo__1Cjd6" style="max-width: 150px;">
<div class="order-manage_title__1VTO5">属性{{ item.className }}下单数量{{ item.purchaseQuantity }}</div>
<div>SKU ID {{ item.productSkuId }}</div>
<div class="order-manage_productSku__XP_ke">SKU 货号 {{ item.extCode }}</div>
</div>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</div>
</template>
<script>
import {sendChromeAPIMessage, sendChromeNotification} from '@/api/chromeApi'
import { Message } from 'element-ui'
export default {
name: 'NormalSendGoods',
data () {
return {
colConfigs: [
{ type: "selection", width: '70px', align: 'left', fixed: 'left'},
{ prop: 'subPurchaseOrderSn', label: '备货单号', width: '150px', align: 'left', fixed: 'left' },
{ slot: 'productName', fixed: 'left'},
{ slot: 'className'},
{ slot: 'robInfo'},
{ slot: 'status' }
],
tableData: [],
total: 0,
ids: [],
isBegin: false,
timer: null
}
},
created () {
this.getList()
},
activated () {
this.getList()
},
methods: {
getList () {
sendChromeAPIMessage({
url: 'oms/bg/venom/api/supplier/purchase/manager/querySubOrderList',
needMallId: true,
data: {
"pageNo": 1,
"pageSize": 100,
"urgencyType": 0,
"isCustomGoods": false,
"statusList": [
1
]
}}).then((res) => {
if (res.errorCode == 1000000) {
res.result.subOrderForSupplierList = res.result.subOrderForSupplierList.filter((item) => {
return item.isCanJoinDeliverPlatform;
})
this.tableData = res.result.subOrderForSupplierList.map((item) => {
return {
robTotal: 0,
subPurchaseOrderSn: item.subPurchaseOrderSn,
originalPurchaseOrderSn: item.originalPurchaseOrderSn,
productName: item.productName,
productSn: item.productSn,
productSkcId: item.productSkcId,
productSkcPicture: item.productSkcPicture,
status: item.status,
detailList: item.skuQuantityDetailList
};
})
} else {
Message.error("【拼多多】" + res.error_msg)
}
})
},
handleSelectionChange(val) {
this.ids = [];
val.forEach(e => {
this.ids.push(e.subPurchaseOrderSn);
});
},
getStyle(url) {
return "background-image: url(" + url + "); width: 72px; height: 72px; cursor: pointer; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.14);";
},
beginRob() {
if (this.isBegin) {
this.isBegin = false;
for (let i = 0;i < this.timer.length; i++) {
clearInterval(this.timer[i].timer);
}
return;
}
this.$http.post('/api/malluser/info').then(res => {
if (res.code == 0) {
this.$store.commit('setUserInfo', res.data)
if (res.data.flag != 1) {
Message.error('您的账号未激活或已失效,请激活后使用')
this.$store.commit('setActiveDlgShow', true)
return;
}
if (res.data.type != 4 && this.$store.state.mallId != this.$store.state.userInfo.mallId) {
Message.error('您当前登录的TEMU账号与会员绑定账号不一致')
return;
}
if (this.ids.length <= 0) {
Message.error('请选择抢仓商品');
return;
}
this.isBegin = true;
this.timer = [];
for (let i = 0;i < this.ids.length; i++) {
let t = setInterval(this.robFunc(this.ids[i]), 1000);
this.timer.push({id: this.ids[i], timer: t})
}
let _this = this;
let tt = setInterval(function() {
if (_this.ids.length == 0) {
_this.isBegin = false;
clearInterval(tt);
}
}, 1000)
} else {
console.log("获取用户信息失败")
}
});
},
robFunc(sn) {
let _this = this;
return function() {
_this.rob(sn);
}
},
rob(sn) {
sendChromeAPIMessage({
url: 'oms/bg/venom/api/supplier/purchase/manager/joinDeliveryGoodsOrderPlatform',
needMallId: true,
data: {
"subPurchaseOrderSn": sn
}}).then((res) => {
if (res.errorCode == 1000000) {
for (let i = 0;i < this.ids.length; i++) {
if (this.ids[i] == sn) {
this.ids.splice(i, 1)
break;
}
}
let t = this.timer.filter((item) => {
return item.id == sn;
})
if (t.length > 0) {
clearInterval(t[0].timer)
}
for (let j = 0; j < this.tableData.length; j++) {
if (this.tableData[j].subPurchaseOrderSn == sn) {
this.sendSms(this.tableData[j].productName);
this.sendNotification(this.tableData[j].productName);
this.tableData.splice(j, 1);
break;
}
}
} else {
for (let j = 0; j < this.tableData.length; j++) {
if (this.tableData[j].subPurchaseOrderSn == sn) {
this.tableData[j].robTotal ++;
break;
}
}
}
})
},
sendSms(productName) {
this.$http.post(`/api/sms/sendSuccessSms`, null, {
params: {
productName: productName
}
}).then(res => {
console.log(res)
})
},
sendNotification(productName) {
sendChromeNotification({productName: productName})
}
}
}
</script>
<style scoped lang="scss">
.order-manage_productInfo__1pD83>img {
left: 0;
position: absolute;
top: 0;
width: 60px;
}
.order-manage_productInfo__1pD83 {
min-height: 60px;
padding-left: 70px;
position: relative;
}
.order-manage_productInfo__1pD83>div:nth-child(2) {
color: rgba(0,0,0,.8);
}
.outerWrapper {
margin: 4px 4px 0px 0px;
}
.dot-module__dot___M-RuH .dot-module__circle___2l2UV {
flex-shrink: 0;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
.dot-module__dot___M-RuH {
display: inline-flex;
align-items: center;
}
.index-module__image-preview___2fiZX .index-module__img___p3B1N {
width: 60px;
height: 60px;
background-repeat: no-repeat;
background-size: cover;
background-color: #f5f5f5;
font-size: 12px;
display: flex;
justify-content: center;
align-items: center;
color: var(--bc-Table-emptyTextColor);
position: relative;
}
.order-manage_skuInfo__FW-Nd, .order-manage_skuInfo__FW-Nd .order-manage_contentInfo__1Cjd6 {
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
}
.order-manage_skuInfo__FW-Nd .order-manage_contentInfo__1Cjd6 {
-webkit-flex-direction: column;
-moz-box-orient: vertical;
-moz-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
color: rgba(0,0,0,.4);
-webkit-flex: 1 0 auto;
-moz-box-flex: 1;
-ms-flex: 1 0 auto;
flex: 1 0 auto;
}
.order-manage_skuInfo__FW-Nd .order-manage_contentInfo__1Cjd6 .order-manage_title__1VTO5 {
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
color: rgba(0,0,0,.8);
}
</style>

69
src/view/Statistics.vue Normal file
View File

@@ -0,0 +1,69 @@
<template>
<ai-list class="list">
<ai-title
slot="title"
title="数据统计"
isShowBottomBorder>
</ai-title>
<template slot="content">
<ai-card title="数据统计">
<div id="chart1"></div>
</ai-card>
</template>
</ai-list>
</template>
<script>
import { Line } from '@antv/g2plot'
import {sendChromeAPIMessage} from '@/api/chromeApi'
export default {
name: 'ExportSaleData',
data () {
return {
}
},
mounted () {
this.$nextTick(() => {
this.initChart1()
})
},
methods: {
initChart1 () {
const data = [
{ year: '1991', value: 3 },
{ year: '1992', value: 4 },
{ year: '1993', value: 3.5 },
{ year: '1994', value: 5 },
{ year: '1995', value: 4.9 },
{ year: '1996', value: 6 },
{ year: '1997', value: 7 },
{ year: '1998', value: 9 },
{ year: '1999', value: 13 }
]
const line = new Line('chart1', {
data,
xField: 'year',
yField: 'value',
});
line.render();
}
}
}
</script>
<style scoped lang="scss">
.list {
::v-deep .ai-list__content .ai-list__content--right-wrapper {
border-radius: 0;
padding: 0!important;
box-shadow: none;
background: transparent;
}
}
</style>

247
src/view/Welcome.vue Normal file
View File

@@ -0,0 +1,247 @@
<template>
<div class="admin-home" v-loading="isLoading">
<ai-card hideTitle>
<div class="content">
<p>TEMU助手是为致力于拼多多跨境卖家中心通过自动化的方式提高TEMU运营管理效率</p>
<p>在使用卖家中心过程中有觉得不方便之处或者重复劳动力的地方可与我们沟通我们竭尽全力为大家打造实用的智能化工具</p>
<p>欢迎大家扫描下方二维码与我们沟通交流获取最新智能化研发进展一起经营跨境电商让中国货走向全世界</p>
</div>
</ai-card>
<div class="middle">
<ai-card title="通知公告">
<div class="list">
<div class="item" v-for="(item, index) in noticeList" :key="index" @click="info = item, isShow = true">
<div class="left">
<el-tag size="small" effect="dark" :type="item.level === '0' ? '' : 'danger'">{{ item.level === '0' ? '一般' : '重要' }}</el-tag>
<h2 :title="item.title">{{ item.title }}</h2>
</div>
<span>{{ item.createTime }}</span>
<!-- <img src="../assets/images/right-b.png" /> -->
</div>
<AiEmpty v-if="!noticeList.length"></AiEmpty>
</div>
</ai-card>
<ai-card title="更新记录">
<div class="list">
<div class="item" v-for="(item, index) in changeLogList" :key="index" @click="info = item, isShow = true">
<div class="left">
<el-tag v-if="version !== item.varsion" size="small" effect="dark" type="danger">新版本</el-tag>
<h2 :title="item.title">{{ item.title }}</h2>
</div>
<span>{{ item.createTime }}</span>
</div>
<AiEmpty v-if="!changeLogList.length"></AiEmpty>
</div>
</ai-card>
</div>
<ai-card title="常用工具" v-if="false">
<div class="">
dsad
</div>
</ai-card>
<AiDialog
title="详情"
:visible.sync="isShow"
:close-on-click-modal="false"
customFooter
:show-close="!isImportant"
width="690">
<div class="news">
<h2>{{ info.title }}</h2>
<p>{{ info.content }}</p>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="read" type="primary" v-if="!info.varsion">{{ isImportant ? '我已阅读' : '关闭' }}{{ info.version }}</el-button>
<el-button @click="download" type="primary" style="width: 140px" v-if="info.varsion && info.varsion !== version">下载新版本</el-button>
</div>
</AiDialog>
</div>
</template>
<script>
export default {
name: 'AdminHome',
data () {
return {
noticeList: [],
isLoading: false,
isShow: false,
info: {},
changeLogList: [],
isImportant: false,
version: ''
}
},
created () {
const devVersion = require('../manifest.development.json').version
const prodVersion = require('../manifest.production.json').version
this.version = process.env.NODE_ENV === 'production' ? prodVersion : devVersion
console.log(this.version)
this.getNoticeList()
this.getChangelog()
this.getMyNewestNotice()
},
methods: {
getNoticeList () {
this.$http.post('/api/notice/page?size=20').then(res => {
if (res.code === 0) {
this.noticeList = res.data.records
}
})
},
download () {
const link = document.createElement('a')
link.style.display = 'none'
link.href = this.info.downloadUrl
link.setAttribute('target', '_blank')
link.setAttribute('download', `TEMU助手-${this.info.varsion}.zip`)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
},
read () {
if (this.isImportant) {
this.$http.post('/api/notice/read').then(res => {
if (res.code === 0) {
this.isImportant = false
this.isShow = false
}
})
} else {
this.isShow = false
}
},
getMyNewestNotice () {
this.$http.post('/api/notice/getMyNewestNotice').then(res => {
if (res.code === 0) {
if (res.data) {
this.isImportant = true
this.info = res.data
this.isShow = true
}
}
})
},
getChangelog () {
this.$http.post('/api/changelog/page?size=100').then(res => {
if (res.code === 0) {
this.changeLogList = res.data.records
}
})
}
}
}
</script>
<style lang="scss" scoped>
.admin-home {
padding: 20px 20px;
.news {
min-height: 250px;
h2 {
margin-bottom: 20px;
text-align: center;
font-size: 18px;
font-weight: 600;
color: #000;
}
span {
display: block;
margin-bottom: 20px;
text-align: right;
color: #999;
}
p {
line-height: 1.5;
margin-bottom: 14px;
color: #333;
font-size: 15px;
text-indent: 2em;
}
}
.content {
p {
line-height: 1.3;
margin-bottom: 14px;
color: #333;
font-size: 14px;
&:last-child {
margin-bottom: 0;
}
}
}
.list {
overflow: auto;
padding-bottom: 20px;
.item {
display: flex;
align-items: center;
justify-content: space-between;
height: 49px;
cursor: pointer;
color: #1f2635;
transition: all .3s ease-in-out;
border-bottom: 1px solid #f4f4f4;
.left, .right {
display: flex;
align-items: center;
}
.left {
max-width: 70%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
h2 {
font-size: 16px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.el-tag {
margin-right: 10px;
}
}
& > span {
color: #999;
}
&:hover {
color: #1FBAD6;
}
}
}
.middle {
display: flex;
height: 400px;
& > section {
flex: 1;
&:first-child {
margin-right: 20px;
}
}
}
}
</style>

347
src/view/login/Login.vue Normal file
View File

@@ -0,0 +1,347 @@
<template>
<div class="login">
<div class="body">
<div class="middle">
<div class="right">
<div class="tab">
<h2 class="active" @click="currIndex = 0">登录</h2>
</div>
<el-form :model="form" label-position="top" ref="form" label-width="100px" class="form">
<el-form-item
prop="mobile"
:rules="[{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: phoneReg, trigger: 'blur' }]">
<el-input maxlength="11" placeholder="请输入手机号" v-model="form.mobile" @keyup.enter.native="login"></el-input>
</el-form-item>
<el-form-item
prop="password"
:rules="[{ required: true, message: '请输入密码', trigger: 'blur' }]">
<el-input placeholder="请输入密码" v-model="form.password" type="password" @keyup.enter.native="login"></el-input>
</el-form-item>
<el-button type="primary" style="width: 100%" @click="login" :loading="btnLoading">立即登录</el-button>
</el-form>
<div class="login-footer">
<div class="left">
<span>没有账号</span>
<i class="hover" @click="$router.push('/register')">立即注册</i>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
form: {
mobile: '',
password: ''
},
phoneReg: (rule, value, callback) => {
if (/^1[0-9]{10,10}$/.test(value)) {
return callback()
}
callback(new Error('手机号格式错误'))
},
timer: null,
time: 60,
isSend: false,
isStart: false,
isLoading: false,
currIndex: 0,
btnLoading: false,
loginType: '0'
}
},
mounted () {
},
methods: {
login () {
this.$refs.form.validate((valid) => {
if (valid) {
this.btnLoading = true
this.$http.post(`/api/mobile/token`, this.form, {
params: {
...this.form
},
headers: {
Authorization: 'Basic YXBwOmFwcA=='
}
}).then(res => {
if (res.access_token) {
this.$store.commit('setToken', `${res.token_type} ${res.access_token}`)
this.$message.success('登录成功')
this.$store.dispatch('getUserInfo')
setTimeout(() => {
this.$router.push('/')
}, 800)
}
this.btnLoading = false
}).catch(() => {
this.btnLoading = false
})
} else {
console.log('error submit!!')
return false;
}
})
},
getCode () {
if (this.isSend) {
return this.$message.error('验证码已发送')
}
this.$refs.form.validateField('loginname', e => {
if (!e) {
this.isSend = true
this.btnLoading = true
this.$http.post(`/api/sms/getRegSmsCode?phone=${this.form.phone}`, {}, {
withoutToken: true
}).then(res => {
if (res.code === 0) {
this.$message.success('验证码发送成功')
this.isStart = true
this.timer = setInterval(() => {
if (this.time === 0) {
this.isSend = false
this.isStart = false
this.time = 60
clearInterval(this.timer)
return false
}
this.time = this.time - 1
}, 1000)
}
this.btnLoading = false
this.isSend = false
}).catch(() => {
this.isSend = false
this.btnLoading = false
})
}
})
},
onChange (e) {
this.$emit('change', e)
}
}
}
</script>
<style lang="scss" scoped>
.login {
display: flex;
flex-direction: column;
height: 100vh;
.body {
position: relative;
flex: 1;
width: 100%;
background-color: #cdc8c8;
// background: url(../../assets/images/login/login.png) no-repeat;
background-size: 100% 100%;
.middle {
position: absolute;
display: flex;
justify-content: flex-end;
top: 50%;
left: 50%;
z-index: 11;
width: 1280px;
transform: translate(-50%, -50%);
& > .left {
padding-top: 42px;
font-family: MicrosoftYaHei;
p {
line-height: 24px;
margin-top: 12px;
margin-bottom: 13px;
font-size: 18px;
color: #fff;
}
span {
color: #fff;
}
}
& > .right {
width: 500px;
padding: 63px 40px 42px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
background: #fff;
border-radius: 16px;
backdrop-filter: blur(6px);
overflow: hidden;
.tab {
display: flex;
position: relative;
align-items: center;
margin-bottom: 36px;
padding-bottom: 17px;
border-bottom: 1px solid #DCDFE6;
&::after {
position: absolute;
bottom: -1px;
left: 0;
z-index: 1;
width: 81px;
height: 2px;
background: #1FBAD6;
content: ' ';
transition: all ease-in-out 0.3s;
}
&.tab-active:after {
transform: translateX(138px);
}
h2 {
width: 81px;
line-height: 24px;
font-size: 20px;
text-align: center;
font-family: SJsuqian;
color: #000000;
cursor: pointer;
user-select: none;
transition: all ease 0.4s;
&.active, &:hover {
color: #1FBAD6;
}
&:first-child {
margin-right: 58px;
}
}
}
.login-type {
font-size: 14px;
font-family: SJsuqian;
text-align: center;
color: #54657D;
cursor: pointer;
transition: all ease-in-out 0.4s;
&:hover {
color: #1FBAD6;
}
}
.login-footer {
display: flex;
align-items: center;
justify-content: center;
margin-top: 21px;
margin-bottom: 38px;
div {
display: flex;
align-items: center;
span {
font-family: SJsuqian;
color: #54657D;
}
i {
font-family: SJsuqian;
color: #1FBAD6;
}
}
}
}
}
::v-deep .el-form {
.el-input__inner {
height: 48px;
border-color: #DCDFE6;
background-color: transparent;
&:focus, &:hover {
border-color: #1FBAD6;
}
&::placeholder {
color: #666666;
}
}
.el-form-item.is-error .el-input__inner, .el-form-item.is-error .el-input__inner:focus, .el-form-item.is-error .el-textarea__inner, .el-form-item.is-error .el-textarea__inner:focus {
border-color: #F56C6C;
}
.el-form-item {
margin-bottom: 20px;
}
.el-button {
height: 48px;
margin-top: 28px;
font-size: 16px;
}
.code-item {
display: flex;
align-items: center;
justify-content: space-between;
span {
width: 110px;
height: 48px;
line-height: 48px;
text-align: center;
font-size: 14px;
color: #333;
cursor: pointer;
user-select: none;
border-radius: 4px;
transition: all cubic-bezier(0.215, 0.61, 0.355, 1) 0.3s;
border: 1px solid #DCDFE6;
&:hover {
border-color: #1FBAD6;
}
}
.el-form-item {
width: 300px;
}
}
}
.copyright {
position: fixed;
bottom: 24px;
left: 50%;
font-size: 14px;
font-weight: 400;
color: #fff;
letter-spacing: 1px;
transform: translateX(-50%);
}
}
}
</style>

367
src/view/login/Register.vue Normal file
View File

@@ -0,0 +1,367 @@
<template>
<div class="login">
<div class="body">
<div class="middle">
<div class="right">
<div class="tab">
<h2 class="active" @click="currIndex = 0">注册</h2>
</div>
<el-form :model="form" label-position="top" ref="form" label-width="100px" class="form">
<el-form-item
prop="name"
:rules="[{ required: true, message: '请输入姓名', trigger: 'blur' }]">
<el-input placeholder="请输入姓名" v-model="form.name"></el-input>
</el-form-item>
<el-form-item
prop="phone"
:rules="[{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: phoneReg, trigger: 'blur' }]">
<el-input maxlength="11" placeholder="请输入手机号" v-model="form.phone"></el-input>
</el-form-item>
<el-form-item
prop="password"
:rules="[{ required: true, message: '请输入密码', trigger: 'blur' }]">
<el-input placeholder="请输入密码" type="password" v-model="form.password"></el-input>
</el-form-item>
<el-form-item
prop="repassword"
:rules="[{ required: true, message: '请再次输入密码', trigger: 'blur' }]">
<el-input placeholder="请再次输入密码" type="password" v-model="form.repassword"></el-input>
</el-form-item>
<el-form-item label="" prop="code" :rules="[{ required: true, message: '请输入验证码', trigger: 'blur' }]">
<div class="code-item">
<el-input style="width: 300px;" maxlength="4" placeholder="请输入验证码" v-model="form.code"></el-input>
<span @click="getCode" :loading="btnLoading">{{ isStart ? time + ' S' : '发送验证码' }}</span>
</div>
</el-form-item>
<el-button type="primary" style="width: 100%" @click="login" :loading="btnLoading">立即注册</el-button>
</el-form>
<div class="login-footer">
<div class="left">
<span>有账号</span>
<i class="hover" @click="$router.back()">返回登录</i>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
form: {
name: '',
password: '',
repassword: '',
code: '',
phone: ''
},
phoneReg: (rule, value, callback) => {
if (/^1[0-9]{10,10}$/.test(value)) {
return callback()
}
callback(new Error('手机号格式错误'))
},
timer: null,
time: 60,
isSend: false,
isStart: false,
isLoading: false,
currIndex: 0,
btnLoading: false,
loginType: '0'
}
},
mounted () {
},
methods: {
login () {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.form.password != this.form.repassword) {
this.$message.success('两次密码输入不一致');
return;
}
this.btnLoading = true
this.$http.post(`/api/malluser/reg`, {
...this.form
}, {
headers: {
Authorization: 'Basic cGM6cGM='
}
}).then(res => {
if (res.code === 0) {
this.$message.success('注册成功')
setTimeout(() => {
this.$router.replace('/login')
}, 500)
}
this.btnLoading = false
}).catch(() => {
this.btnLoading = false
})
} else {
console.log('error submit!!')
return false;
}
})
},
getCode () {
if (this.isSend) {
return this.$message.error('验证码已发送')
}
this.$refs.form.validateField('phone', e => {
if (!e) {
this.isSend = true
this.btnLoading = true
this.$http.post(`/api/sms/getRegSmsCode?phone=${this.form.phone}`, {}, {
withoutToken: true
}).then(res => {
if (res.code === 0) {
this.$message.success('验证码发送成功')
this.isStart = true
this.timer = setInterval(() => {
if (this.time === 0) {
this.isSend = false
this.isStart = false
this.time = 60
clearInterval(this.timer)
return false
}
this.time = this.time - 1
}, 1000)
}
this.btnLoading = false
this.isSend = false
}).catch(() => {
this.isSend = false
this.btnLoading = false
})
}
})
},
onChange (e) {
this.$emit('change', e)
}
}
}
</script>
<style lang="scss" scoped>
.login {
display: flex;
flex-direction: column;
height: 100vh;
.body {
position: relative;
flex: 1;
width: 100%;
background-color: #cdc8c8;
// background: url(../../assets/images/login/login.png) no-repeat;
background-size: 100% 100%;
.middle {
position: absolute;
display: flex;
justify-content: flex-end;
top: 50%;
left: 50%;
z-index: 11;
width: 1280px;
transform: translate(-50%, -50%);
& > .left {
padding-top: 42px;
font-family: MicrosoftYaHei;
p {
line-height: 24px;
margin-top: 12px;
margin-bottom: 13px;
font-size: 18px;
color: #fff;
}
span {
color: #fff;
}
}
& > .right {
width: 500px;
padding: 63px 40px 42px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
background: #fff;
border-radius: 16px;
backdrop-filter: blur(6px);
overflow: hidden;
.tab {
display: flex;
position: relative;
align-items: center;
margin-bottom: 36px;
padding-bottom: 17px;
border-bottom: 1px solid #DCDFE6;
&::after {
position: absolute;
bottom: -1px;
left: 0;
z-index: 1;
width: 81px;
height: 2px;
background: #1FBAD6;
content: ' ';
transition: all ease-in-out 0.3s;
}
&.tab-active:after {
transform: translateX(138px);
}
h2 {
width: 81px;
line-height: 24px;
text-align: center;
font-size: 20px;
font-family: SJsuqian;
color: #000000;
cursor: pointer;
user-select: none;
transition: all ease 0.4s;
&.active, &:hover {
color: #1FBAD6;
}
&:first-child {
margin-right: 58px;
}
}
}
.login-type {
font-size: 14px;
font-family: SJsuqian;
text-align: center;
color: #54657D;
cursor: pointer;
transition: all ease-in-out 0.4s;
&:hover {
color: #1FBAD6;
}
}
.login-footer {
display: flex;
align-items: center;
justify-content: center;
margin-top: 21px;
margin-bottom: 38px;
div {
display: flex;
align-items: center;
span {
font-family: SJsuqian;
color: #54657D;
}
i {
font-family: SJsuqian;
color: #1FBAD6;
}
}
}
}
}
::v-deep .el-form {
.el-input__inner {
height: 48px;
border-color: #DCDFE6;
background-color: transparent;
&:focus, &:hover {
border-color: #1FBAD6;
}
&::placeholder {
color: #666666;
}
}
.el-form-item.is-error .el-input__inner, .el-form-item.is-error .el-input__inner:focus, .el-form-item.is-error .el-textarea__inner, .el-form-item.is-error .el-textarea__inner:focus {
border-color: #F56C6C;
}
.el-form-item {
margin-bottom: 20px;
}
.el-button {
height: 48px;
margin-top: 28px;
font-size: 16px;
}
.code-item {
display: flex;
align-items: center;
justify-content: space-between;
span {
width: 110px;
height: 48px;
line-height: 48px;
text-align: center;
font-size: 14px;
color: #333;
cursor: pointer;
user-select: none;
border-radius: 4px;
transition: all cubic-bezier(0.215, 0.61, 0.355, 1) 0.3s;
border: 1px solid #DCDFE6;
&:hover {
border-color: #1FBAD6;
}
}
.el-form-item {
width: 300px;
}
}
}
.copyright {
position: fixed;
bottom: 24px;
left: 50%;
font-size: 14px;
font-weight: 400;
color: #fff;
letter-spacing: 1px;
transform: translateX(-50%);
}
}
}
</style>

56
src/view/popup.vue Normal file
View File

@@ -0,0 +1,56 @@
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
import { sendChromeAPIMessage } from '@/api/chromeApi'
import { Message } from 'element-ui'
export default {
data () {
return {
component: 'Home'
}
},
created () {
if (!this.$store.state.token) {
this.$router.push('/login')
} else {
this.$store.dispatch('getUserInfo');
sendChromeAPIMessage({url: 'bg/quiet/api/mms/userInfo', needMallId: false, data: {}}).then((res) => {
if (res.errorCode == 1000000) {
if (res.result.companyList[0].malInfoList.length == 1) {
this.$store.commit('setMallId', `${res.result.companyList[0].malInfoList[0].mallId}`)
this.$store.commit('setMallName', `${res.result.companyList[0].malInfoList[0].mallName}`)
} else {
if (!this.$store.state.mallId) {
this.$store.commit('setMallId', `${res.result.companyList[0].malInfoList[0].mallId}`)
this.$store.commit('setMallName', `${res.result.companyList[0].malInfoList[0].mallName}`)
} else {
let temp = res.result.companyList[0].malInfoList.filter(item => {
return item.mallId == this.$store.state.mallId
})
if (temp.length == 0) {
this.$store.commit('setMallId', `${res.result.companyList[0].malInfoList[0].mallId}`)
this.$store.commit('setMallName', `${res.result.companyList[0].malInfoList[0].mallName}`)
}
}
}
this.$store.commit('setMallList', res.result.companyList[0].malInfoList)
} else {
Message.error("【拼多多】" + res.error_msg)
}
})
}
},
methods: {
}
}
</script>
<style>
@import '../assets/css/index.scss';
</style>