Merge branch 'label' of https://gitee.com/three-make-money/temu-plugin into label
This commit is contained in:
118117
node_modules/vue-plugin-hiprint/dist/vue-plugin-hiprint.js
generated
vendored
118117
node_modules/vue-plugin-hiprint/dist/vue-plugin-hiprint.js
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import {genAnti} from "@/api/genAnti";
|
import { genAnti } from "@/api/genAnti";
|
||||||
|
import { Message } from 'element-ui'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向Chrome发送消息
|
* 向Chrome发送消息
|
||||||
@@ -20,9 +21,16 @@ export async function sendChromeAPIMessage(message) {
|
|||||||
if (message.anti) {
|
if (message.anti) {
|
||||||
message.anti = await genAnti.a()
|
message.anti = await genAnti.a()
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
chrome.runtime.sendMessage(message, resolve)
|
// chrome.runtime.sendMessage(message, resolve)
|
||||||
|
chrome.runtime.sendMessage(message, res => {
|
||||||
|
if (res.error_code === 40001) {
|
||||||
|
Message.error('请先登录拼多多跨境卖家中心')
|
||||||
|
}
|
||||||
|
resolve(res)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,4 +172,4 @@ export async function sendXcAPIMessage(message) {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
chrome.runtime.sendMessage(message, resolve)
|
chrome.runtime.sendMessage(message, resolve)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,64 +20,15 @@
|
|||||||
<div @click="tabIndex = 0, currIndex = 0, getPriceList(1)" :class="[tabIndex === 0 ? 'active' : '']">
|
<div @click="tabIndex = 0, currIndex = 0, getPriceList(1)" :class="[tabIndex === 0 ? 'active' : '']">
|
||||||
<span>金币充值</span>
|
<span>金币充值</span>
|
||||||
</div>
|
</div>
|
||||||
<div @click="tabIndex = 1, currIndex = 0" :class="[tabIndex === 1 ? 'active' : '']">
|
<div @click="tabIndex = 1, currIndex = 0, getPriceList(0)" :class="[tabIndex === 1 ? 'active' : '']">
|
||||||
<span>基础功能</span>
|
<span>年度会员</span>
|
||||||
</div>
|
</div>
|
||||||
<div @click="tabIndex = 2, currIndex = 0, getPriceList(2)" :class="[tabIndex === 2 ? 'active' : '']">
|
<div @click="tabIndex = 2, currIndex = 0, getPriceList(2)" :class="[tabIndex === 2 ? 'active' : '']">
|
||||||
<span>高级功能</span>
|
<span>高级功能</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content" v-if="tabIndex === 1">
|
|
||||||
<div class="title">金币充值</div>
|
|
||||||
<div class="tab-content__item--wrapper">
|
|
||||||
<el-form :model="form" label-position="top" ref="form" label-width="100px" class="form" style="width: 100%;">
|
|
||||||
<el-form-item
|
|
||||||
prop="mallName"
|
|
||||||
label="当前绑定店铺"
|
|
||||||
style="width: 100%;"
|
|
||||||
: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"
|
|
||||||
style="width: 100%;"
|
|
||||||
: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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="tab-content" v-if="tabIndex === 0">
|
<div class="tab-content" v-if="tabIndex === 0">
|
||||||
<div class="title">基础功能</div>
|
<div class="title">金币充值</div>
|
||||||
<div class="tab-content__item--wrapper">
|
|
||||||
<div
|
|
||||||
class="tab-content__item"
|
|
||||||
:class="[currIndex === i ? 'active' : '']"
|
|
||||||
v-for="(price, i) in priceList"
|
|
||||||
:key="i"
|
|
||||||
@click="currIndex = i, getQrcode(price)">
|
|
||||||
<h3>{{ price.remark }}</h3>
|
|
||||||
<div class="price">
|
|
||||||
<i>¥</i>
|
|
||||||
<span>{{ price.price }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="original-price">
|
|
||||||
<i>¥</i>
|
|
||||||
<span>{{ price.originPrice }}</span>
|
|
||||||
</div>
|
|
||||||
<p>{{ price.coin }}金币</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="tab-content" v-if="tabIndex === 2">
|
|
||||||
<div class="title">标签合成</div>
|
|
||||||
<div class="tab-content__item--wrapper">
|
<div class="tab-content__item--wrapper">
|
||||||
<div
|
<div
|
||||||
class="tab-content__item"
|
class="tab-content__item"
|
||||||
@@ -98,9 +49,55 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-content" v-if="tabIndex === 1">
|
||||||
|
<div class="title">年度会员</div>
|
||||||
|
<div class="tab-content__item--wrapper">
|
||||||
|
<div
|
||||||
|
class="tab-content__item"
|
||||||
|
:class="[currIndex === i ? 'active' : '']"
|
||||||
|
v-for="(price, i) in priceList"
|
||||||
|
:key="i"
|
||||||
|
@click="currIndex = i, getQrcode(price)">
|
||||||
|
<h3>{{ price.title }}</h3>
|
||||||
|
<div class="price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.price }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="original-price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.originPrice }}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <p>{{ price.coin }}条/每年</p> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content" v-if="tabIndex === 2">
|
||||||
|
<div class="title">标签合成</div>
|
||||||
|
<div class="tab-content__item--wrapper">
|
||||||
|
<div
|
||||||
|
class="tab-content__item"
|
||||||
|
:class="[currIndex === i ? 'active' : (Number(labelInfo.level) >= Number(price.type) ? 'disabled' : '')]"
|
||||||
|
:data-level="price.type"
|
||||||
|
:data-index="labelInfo.level"
|
||||||
|
v-for="(price, i) in priceList"
|
||||||
|
:key="i"
|
||||||
|
@click="getQrcode(price, i)">
|
||||||
|
<h3>{{ price.remark }}</h3>
|
||||||
|
<div class="price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.price }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="original-price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.originPrice }}</span>
|
||||||
|
</div>
|
||||||
|
<p>{{ price.coin }}条/每年</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="title" v-if="tabIndex !== 1">支付方式</div>
|
<div class="title">支付方式</div>
|
||||||
<div class="bottom" v-if="tabIndex !== 1">
|
<div class="bottom">
|
||||||
<div class="bottom-left">
|
<div class="bottom-left">
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<vue-qr v-if="qrcode" :text="qrcode" :size="110" :margin="0" :logoSrc="wechatLogo"/>
|
<vue-qr v-if="qrcode" :text="qrcode" :size="110" :margin="0" :logoSrc="wechatLogo"/>
|
||||||
@@ -123,15 +120,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom" v-else>
|
|
||||||
<div class="bottom-left">
|
|
||||||
</div>
|
|
||||||
<div class="bottom-right">
|
|
||||||
<div class="pay-btn">
|
|
||||||
<el-button round size="mini" type="warning" @click="onConfirm">确定</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -140,6 +128,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import VueQr from 'vue-qr'
|
import VueQr from 'vue-qr'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
VueQr
|
VueQr
|
||||||
@@ -163,8 +152,10 @@
|
|||||||
computed: {
|
computed: {
|
||||||
wechatLogo: () => require(`../assets/wechat_logo.png`),
|
wechatLogo: () => require(`../assets/wechat_logo.png`),
|
||||||
|
|
||||||
|
...mapState(['labelInfo']),
|
||||||
|
|
||||||
currGoods () {
|
currGoods () {
|
||||||
if (!this.priceList.length || this.tabIndex === 1) {
|
if (!this.priceList.length) {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,13 +173,29 @@
|
|||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.priceList = res.data.records
|
this.priceList = res.data.records
|
||||||
if (res.data.records.length) {
|
if (res.data.records.length) {
|
||||||
this.getQrcode(res.data.records[0])
|
if (this.tabIndex !== 2) {
|
||||||
|
this.getQrcode(res.data.records[0])
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < res.data.records.length; i++) {
|
||||||
|
if (res.data.records[i].type > this.labelInfo.level) {
|
||||||
|
this.getQrcode(res.data.records[i], i)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getQrcode(item) {
|
getQrcode(item, index) {
|
||||||
|
if (this.tabIndex === 2 && item.type <= this.labelInfo.level) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.tabIndex === 2) {
|
||||||
|
this.currIndex = index
|
||||||
|
}
|
||||||
this.$http.post(`/api/order/createOrder`, null, {
|
this.$http.post(`/api/order/createOrder`, null, {
|
||||||
params: {
|
params: {
|
||||||
priceConfigId: item.id
|
priceConfigId: item.id
|
||||||
@@ -203,45 +210,20 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
show () {
|
|
||||||
|
show(i) {
|
||||||
|
this.currIndex = 0
|
||||||
|
this.tabIndex = {
|
||||||
|
'0': 1,
|
||||||
|
'1': 0,
|
||||||
|
'2': 2
|
||||||
|
}[i]
|
||||||
|
this.getPriceList(i)
|
||||||
this.isShow = true
|
this.isShow = true
|
||||||
},
|
},
|
||||||
|
|
||||||
hide () {
|
hide () {
|
||||||
this.isShow = false
|
this.isShow = false
|
||||||
},
|
|
||||||
|
|
||||||
onConfirm () {
|
|
||||||
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.isShow = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -280,7 +262,7 @@
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
z-index: 11;
|
z-index: 11;
|
||||||
min-width: 840px;
|
min-width: 916px;
|
||||||
// height: 620px;
|
// height: 620px;
|
||||||
padding: 40px 40px;
|
padding: 40px 40px;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
@@ -421,6 +403,11 @@
|
|||||||
background: linear-gradient(33deg, #ffd1c5 -10%, #ffd1c5 21%, #ffe8e5 85%);
|
background: linear-gradient(33deg, #ffd1c5 -10%, #ffd1c5 21%, #ffe8e5 85%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
cursor: no-drop;
|
||||||
|
background: #f4f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,17 +181,41 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
<ai-dialog :visible.sync="isShowTemplate" title="模板库" width="960" customFooter>
|
<ai-dialog :visible.sync="isShowTemplate" title="模板库" width="1060px" customFooter>
|
||||||
<ai-table
|
<div class="templateList-wrapper" v-infinite-scroll="getTemplateList" :infinite-scroll-distance="20">
|
||||||
|
<div class="templateList">
|
||||||
|
<div class="templateList-item" v-for="(item, index) in templateList" :key="index">
|
||||||
|
<!-- <img :src="item.previewUrl" /> -->
|
||||||
|
<el-image
|
||||||
|
style="height: 180px;"
|
||||||
|
fit="contain"
|
||||||
|
:src="item.previewUrl"
|
||||||
|
:preview-src-list="[item.previewUrl]">
|
||||||
|
</el-image>
|
||||||
|
<h2>{{ item.name }}</h2>
|
||||||
|
<el-button type="warning" size="mini" @click="updateTempate(item)">使用模板</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <ai-table
|
||||||
:tableData="templateList"
|
:tableData="templateList"
|
||||||
:col-configs="templateColConfigs"
|
:col-configs="templateColConfigs"
|
||||||
:total="templateTotal"
|
:total="templateTotal"
|
||||||
:current.sync="searchTemplate.current"
|
:current.sync="searchTemplate.current"
|
||||||
:size.sync="searchTemplate.size"
|
:size.sync="searchTemplate.size"
|
||||||
style="margin-top: 8px;"
|
height="480"
|
||||||
height="400"
|
|
||||||
@getList="getTemplateList"
|
@getList="getTemplateList"
|
||||||
v-loading="templateLoading">
|
v-loading="templateLoading">
|
||||||
|
<el-table-column slot="img" label="预览图" align="center">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-image
|
||||||
|
style="width: 200px; height: 200px"
|
||||||
|
fit="contain"
|
||||||
|
:src="row.previewUrl"
|
||||||
|
:preview-src-list="[row.previewUrl]">
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column slot="options" label="操作" align="center" width="200">
|
<el-table-column slot="options" label="操作" align="center" width="200">
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
@@ -200,9 +224,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table> -->
|
||||||
<div class="dialog-footer" slot="footer">
|
<div class="dialog-footer" slot="footer">
|
||||||
<el-button @click="isShowImage = false">取消</el-button>
|
<el-button @click="isShowTemplate = false">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
</div>
|
</div>
|
||||||
@@ -311,7 +335,7 @@
|
|||||||
},
|
},
|
||||||
searchTemplate: {
|
searchTemplate: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10,
|
size: 8,
|
||||||
type: 1
|
type: 1
|
||||||
},
|
},
|
||||||
templateTotal: 0,
|
templateTotal: 0,
|
||||||
@@ -319,9 +343,11 @@
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
templateColConfigs: [
|
templateColConfigs: [
|
||||||
{ prop: 'name', label: '模板名称', align: 'left' }
|
{ prop: 'name', label: '模板名称', align: 'left' },
|
||||||
|
{ slot: 'img'}
|
||||||
],
|
],
|
||||||
templateLoading: false
|
templateLoading: false,
|
||||||
|
hasMore: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -421,12 +447,23 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
getTemplateList() {
|
getTemplateList() {
|
||||||
|
if (!this.hasMore) return
|
||||||
|
if (this.templateLoading) return
|
||||||
|
this.templateLoading = true
|
||||||
this.$http.post(`/api/templateRecommend/getRecommendPage`, null, {
|
this.$http.post(`/api/templateRecommend/getRecommendPage`, null, {
|
||||||
params: this.searchTemplate
|
params: this.searchTemplate
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.templateList = res.data.records
|
this.templateList = [...this.templateList, ...res.data.records]
|
||||||
this.templateTotal = res.data.total
|
this.templateTotal = res.data.total
|
||||||
|
|
||||||
|
if (res.data.records.length < this.searchTemplate.size) {
|
||||||
|
this.hasMore = false
|
||||||
|
} else {
|
||||||
|
this.searchTemplate.current = this.searchTemplate.current + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
this.templateLoading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -459,7 +496,8 @@
|
|||||||
top: 58.5,
|
top: 58.5,
|
||||||
src: src,
|
src: src,
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100
|
height: 100,
|
||||||
|
fit: 'contain'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const el = this.hiprintTemplate.printPanels[0].printElements.at(-1)
|
const el = this.hiprintTemplate.printPanels[0].printElements.at(-1)
|
||||||
@@ -622,8 +660,12 @@
|
|||||||
this.isShowPreview = true
|
this.isShowPreview = true
|
||||||
},
|
},
|
||||||
|
|
||||||
getHtml() {
|
getHtml(template, printData) {
|
||||||
return this.elementToString(this.hiprintTemplate.getHtml(this.printData))
|
this.hiprintTemplate = newHiprintPrintTemplate('temulables')
|
||||||
|
|
||||||
|
this.hiprintTemplate.update(template)
|
||||||
|
const html = this.elementToString(this.hiprintTemplate.getHtml(printData))
|
||||||
|
return html
|
||||||
},
|
},
|
||||||
|
|
||||||
clearPaper() {
|
clearPaper() {
|
||||||
@@ -846,5 +888,49 @@
|
|||||||
.print-viewer {
|
.print-viewer {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.templateList-wrapper {
|
||||||
|
padding-right: 10px;
|
||||||
|
|
||||||
|
.templateList {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.templateList-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
width: 24%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
margin-right: 1.333%;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-top: 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(4n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export const customProvider = function () {
|
|||||||
$(`body>#codewrapper-${elId}`).remove()
|
$(`body>#codewrapper-${elId}`).remove()
|
||||||
|
|
||||||
const resizeObserver = new ResizeObserver(() => {
|
const resizeObserver = new ResizeObserver(() => {
|
||||||
JsBarcode('#' + elId, printData.labelCode, {
|
JsBarcode('#' + elId, printData.labelCode, {
|
||||||
format: "CODE128B",
|
format: "CODE128B",
|
||||||
width: 2,
|
width: 2,
|
||||||
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
|
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
|
||||||
@@ -117,8 +117,11 @@ export const customProvider = function () {
|
|||||||
{
|
{
|
||||||
tid: 'providerModule1.image',
|
tid: 'providerModule1.image',
|
||||||
title: '图片',
|
title: '图片',
|
||||||
data: 'https://foruda.gitee.com/avatar/1677050350324030848/5400665_ccsimple_1591166830.png!avatar200',
|
type: 'image',
|
||||||
type: 'image'
|
options: {
|
||||||
|
contain: 'contain',
|
||||||
|
src: 'http://lyshunong.oss-cn-beijing.aliyuncs.com/image/material/a6e14259412606502e49f1abd866039.png',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -57,7 +57,7 @@ export default new Vuex.Store({
|
|||||||
state.showTemuAlert = flag
|
state.showTemuAlert = flag
|
||||||
},
|
},
|
||||||
setLabelInfo(state, info) {
|
setLabelInfo(state, info) {
|
||||||
state.info = info
|
state.labelInfo = info
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ export default new Vuex.Store({
|
|||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// this.getLabelInfo()
|
store.dispatch('getLabelInfo')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -78,7 +78,11 @@ export default new Vuex.Store({
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
request.post('/api/userExtend/getLabelDetail').then(res => {
|
request.post('/api/userExtend/getLabelDetail').then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
store.commit('setLabelInfo', res.data)
|
const isExpires = new Date().getTime() > new Date(res.data.expireTime).getTime() || res.data.skuUsed > res.data.skuTotal
|
||||||
|
store.commit('setLabelInfo', {
|
||||||
|
...res.data,
|
||||||
|
isExpires
|
||||||
|
})
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="admin-right">
|
<div class="admin-right">
|
||||||
<el-tooltip class="item" effect="dark" content="金币信息" placement="top">
|
<el-tooltip class="item" effect="dark" content="金币信息" placement="top">
|
||||||
<div class="left" @click="toActive">
|
<div class="left" @click="openMember(1)">
|
||||||
<div :style="{marginLeft: '0px'}">{{ $store.state.userInfo.coin }}</div>
|
<div :style="{marginLeft: '0px'}">{{ $store.state.userInfo.coin }}</div>
|
||||||
<span style="margin-right: 10px;"><img src="../assets/coin.png" width="30"/></span>
|
<span style="margin-right: 10px;"><img src="../assets/coin.png" width="30"/></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<el-button type="button" :class="'el-button el-button--primary'" @click="sign">签到</el-button>
|
<el-button type="button" :class="'el-button el-button--primary'" @click="sign">签到</el-button>
|
||||||
<!--<el-button type="button" :class="'el-button el-button--primary'" @click="openFolder">打开文件夹</el-button>-->
|
<!--<el-button type="button" :class="'el-button el-button--primary'" @click="openFolder">打开文件夹</el-button>-->
|
||||||
<el-tooltip class="item" effect="dark" content="用户激活" placement="top">
|
<el-tooltip class="item" effect="dark" content="用户激活" placement="top">
|
||||||
<div class="left" @click="toActive">
|
<div class="left" @click="openMember(0)">
|
||||||
<span>会员信息:</span>
|
<span>会员信息:</span>
|
||||||
<div :style="{marginLeft: '10px', color: $store.state.userInfo.flag == 1? 'green': 'red'}">{{ getStateInfo }}</div>
|
<div :style="{marginLeft: '10px', color: $store.state.userInfo.flag == 1? 'green': 'red'}">{{ getStateInfo }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
<template slot="title">
|
<template slot="title">
|
||||||
<div slot="title" style="display: inline-block; ">
|
<div slot="title" style="display: inline-block; ">
|
||||||
<span>标签管理</span>
|
<span>标签管理</span>
|
||||||
<el-button type="text" style="margin-left: 57px; padding: 0;" @click.stop="openMember">开通</el-button>
|
<el-button type="text" style="margin-left: 57px; padding: 0;" @click.stop="openMember(2)">开通</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item index="/labelsTemplate">模板管理</el-menu-item>
|
<el-menu-item index="/labelsTemplate">模板管理</el-menu-item>
|
||||||
@@ -252,11 +252,6 @@
|
|||||||
<div id="kefu" @click="gotoKefu">
|
<div id="kefu" @click="gotoKefu">
|
||||||
<label slot="reference" class="topBtn" title="联系客服"></label>
|
<label slot="reference" class="topBtn" title="联系客服"></label>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog
|
|
||||||
title="开通标签会员"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
width="1200">
|
|
||||||
</el-dialog>
|
|
||||||
<LablesMember ref="LablesMember"></LablesMember>
|
<LablesMember ref="LablesMember"></LablesMember>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -338,8 +333,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
openMember() {
|
openMember(index) {
|
||||||
this.$refs.LablesMember.show()
|
this.$refs.LablesMember.show(index)
|
||||||
},
|
},
|
||||||
|
|
||||||
handleClose() {
|
handleClose() {
|
||||||
|
|||||||
@@ -187,9 +187,9 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
},
|
},
|
||||||
async syncProduct(mallId, mallName) {
|
async syncProduct(mallId, mallName) {
|
||||||
let res = await sendChromeAPIMessage({url: 'bg-visage-mms/product/skc/pageQuery',
|
let res = await sendChromeAPIMessage({url: 'bg-visage-mms/product/skc/pageQuery',
|
||||||
anti:true,
|
anti:true,
|
||||||
needMallId: true,
|
needMallId: true,
|
||||||
mallId: mallId,
|
mallId: mallId,
|
||||||
data: {
|
data: {
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
@@ -250,9 +250,9 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
let start = now.getTime()
|
let start = now.getTime()
|
||||||
let end = start + 86400*1000 - 1000
|
let end = start + 86400*1000 - 1000
|
||||||
|
|
||||||
let res = await sendChromeAPIMessage({url: 'bgSongbird-api/supplier/deliverGoods/management/pageQueryDeliveryBatch',
|
let res = await sendChromeAPIMessage({url: 'bgSongbird-api/supplier/deliverGoods/management/pageQueryDeliveryBatch',
|
||||||
anti:true,
|
anti:true,
|
||||||
needMallId: true,
|
needMallId: true,
|
||||||
mallId: mallId,
|
mallId: mallId,
|
||||||
data: {
|
data: {
|
||||||
pageNo: this.pageNo,
|
pageNo: this.pageNo,
|
||||||
@@ -290,12 +290,12 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
...temp,
|
...temp,
|
||||||
sku: item2.productSkuId,
|
sku: item2.productSkuId,
|
||||||
num: item2.skuNum
|
num: item2.skuNum
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.deliveryOrderList.push(temp)
|
this.deliveryOrderList.push(temp)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.result.list.length == this.pageSize) {
|
if (res.result.list.length == this.pageSize) {
|
||||||
this.pageNo ++
|
this.pageNo ++
|
||||||
await this.syncDeliveryOrder(mallId, mallName)
|
await this.syncDeliveryOrder(mallId, mallName)
|
||||||
@@ -357,5 +357,5 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div class="left">
|
<div class="left">
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<el-radio-group v-model="addType" @click="lableList = [], search.productSkuId = '', search.productSkcId = ''">
|
<el-radio-group v-model="addType" @click="lableList = [], search.productSkuId = '', search.productSkcId = ''">
|
||||||
<el-radio-button label="1">按备货单打印</el-radio-button>
|
<el-radio-button label="1">按发货单打印</el-radio-button>
|
||||||
<el-radio-button label="2">按SKC打印</el-radio-button>
|
<el-radio-button label="2">按SKC打印</el-radio-button>
|
||||||
<el-radio-button label="3">按SKU打印</el-radio-button>
|
<el-radio-button label="3">按SKU打印</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
toPrint(row) {
|
toPrint(row) {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
if (this.addType === '1') {
|
if (this.addType === '1') {
|
||||||
this.$http.post(`/api/template/getPage?productSkuId=${row.productSkuId}`).then(res => {
|
this.$http.post(`/api/template/myTemplate?productSkuId=${row.productSkuId}`).then(res => {
|
||||||
if (!res.data.records.length) {
|
if (!res.data.records.length) {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
return this.$message.error('该SKU未配置模板')
|
return this.$message.error('该SKU未配置模板')
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
getList () {
|
getList () {
|
||||||
this.$http.post('/api/templateSku/getPage', null, {
|
this.$http.post('/api/templateSku/getMySkuPage', null, {
|
||||||
params: this.search
|
params: this.search
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
|
|||||||
@@ -442,6 +442,7 @@
|
|||||||
await this.requestSKUList(true)
|
await this.requestSKUList(true)
|
||||||
await this.$sleepSync(500)
|
await this.$sleepSync(500)
|
||||||
}
|
}
|
||||||
|
this.isLoading = false
|
||||||
},
|
},
|
||||||
|
|
||||||
requestSKUList(flag) {
|
requestSKUList(flag) {
|
||||||
@@ -482,6 +483,8 @@
|
|||||||
} else {
|
} else {
|
||||||
!flag && (this.isLoading = false)
|
!flag && (this.isLoading = false)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -499,7 +502,7 @@
|
|||||||
|
|
||||||
getList () {
|
getList () {
|
||||||
this.pageShow = true
|
this.pageShow = true
|
||||||
this.$http.post(`/api/templateSku/getPage`, null, {
|
this.$http.post(`/api/templateSku/getMySkuPage`, null, {
|
||||||
params: {
|
params: {
|
||||||
...this.search,
|
...this.search,
|
||||||
templateId: this.id
|
templateId: this.id
|
||||||
@@ -531,6 +534,8 @@
|
|||||||
this.getList()
|
this.getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.btnLoading = false
|
||||||
|
}).catch(() => {
|
||||||
this.btnLoading = false
|
this.btnLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
slot="title"
|
slot="title"
|
||||||
title="模板管理"
|
title="模板管理"
|
||||||
isShowBottomBorder>
|
isShowBottomBorder>
|
||||||
|
<template #rightBtn>
|
||||||
|
<div class="tips" slot="rightBtn" :class="[$store.state.labelInfo.isExpires ? 'active' : '']">
|
||||||
|
<p>有效期:{{ $store.state.labelInfo.expireTime }}</p>
|
||||||
|
<p>已使用SKU数:{{ $store.state.labelInfo.skuUsed }}/{{ $store.state.labelInfo.skuTotal }}</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</ai-title>
|
</ai-title>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
@@ -46,7 +52,7 @@
|
|||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-button type="button" :class="'el-button el-button--primary'" @click="toAdd('')">添加</el-button>
|
<el-button type="button" class="el-button el-button--primary" @click="toAdd('')">添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-table
|
<ai-table
|
||||||
@@ -58,30 +64,37 @@
|
|||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
@getList="getList"
|
@getList="getList"
|
||||||
:loading="isLoading">
|
:loading="isLoading">
|
||||||
<el-table-column slot="options" label="操作" align="center" fixed="right" width="220px">
|
<el-table-column slot="options" label="操作" align="center" fixed="right" width="240px">
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text" @click="toAddSku(row.id)">管理SKU</el-button>
|
<el-button type="text" @click="toAddSku(row.id)">管理SKU</el-button>
|
||||||
|
<!-- <el-button type="text" @click="savePDF(row.id)">保存PDF</el-button> -->
|
||||||
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
||||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
|
<Print ref="printRef" :isPrint="true"></Print>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Print from '@/components/print/Print'
|
||||||
export default {
|
export default {
|
||||||
name: 'PringTemplate',
|
name: 'PringTemplate',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Print
|
||||||
|
},
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{ prop: 'name', label: '模板名称', align: 'left' },
|
{ prop: 'name', label: '模板名称', align: 'left' },
|
||||||
{ prop: 'skuTotal', label: '绑定SKU数量', align: 'center' },
|
{ prop: 'skuTotal', label: '绑定SKU数量', align: 'center' },
|
||||||
{ prop: 'createTime', label: '创建时间', align: 'center' },
|
{ prop: 'createTime', label: '创建时间', align: 'center' }
|
||||||
],
|
],
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@@ -105,13 +118,31 @@
|
|||||||
this.$router.push(`/addLabelsTemplate?id=${id}`)
|
this.$router.push(`/addLabelsTemplate?id=${id}`)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
savePDF (id) {
|
||||||
|
this.isLoading = true
|
||||||
|
|
||||||
|
this.$http.post(`/api/template/detail?id=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
const template = JSON.parse(res.data.content)
|
||||||
|
|
||||||
|
this.$http.post(`/api/templateSku/getMySkuPage?size=-1&templateId=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
const html = this.$refs.printRef.toPrint(template, res.data.records)
|
||||||
|
console.log(html)
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
toAddSku (id) {
|
toAddSku (id) {
|
||||||
this.$router.push(`/skuManage?id=${id}`)
|
this.$router.push(`/skuManage?id=${id}`)
|
||||||
},
|
},
|
||||||
|
|
||||||
getList () {
|
getList () {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
this.$http.post('/api/template/getPage', null, {
|
this.$http.post('/api/template/myTemplate', null, {
|
||||||
params: {
|
params: {
|
||||||
...this.search
|
...this.search
|
||||||
}
|
}
|
||||||
@@ -151,5 +182,24 @@
|
|||||||
.search-item {
|
.search-item {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: green;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user