Commit 72b7be88 by zhangquan

部分联调

1 parent 6d5daea4
<template>
<div class="category-list-ctnr">
<div>
<ownerPreference></ownerPreference>
</div>
<!-- <div class="category-list-ctnr">
<GLTabs ref='GLTabs' class="tabs" v-model="activeName" :tabPaneList="tabPaneList"
@tab-click="handleClick" removeTab="removeTab"></GLTabs>
......@@ -38,19 +41,19 @@
<template v-if="activeName=='2'">
<ownerPreference></ownerPreference>
</template>
</div>
</div> -->
</template>
<script>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import pullDownNav from './components/pullDownNav'
// import pullDownNav from './components/pullDownNav'
import ownerPreference from "views/category/ownerPreference";
export default {
name: 'App',
components: {
pullDownNav,
// pullDownNav,
ownerPreference
},
data() {
......@@ -139,7 +142,7 @@ export default {
}
},
created() {
this.getChannelList()
// this.getChannelList()
},
beforeRouteEnter(to, from, next) {
......
......@@ -9,39 +9,19 @@
@change="changeChannelImg"></glsx-preview>
<div class="text-tip" style="margin: 0;">建议尺寸:120*120</div>
</div>
<div slot="selectBrandSlot">
<el-radio-group v-model="formObj.categoryStyle">
<el-radio :label="0">标准商品-竖向排列
</el-radio>
<el-radio :label="1">标准商品-横向排列
</el-radio>
<el-radio :label="2">种草样式</el-radio>
</el-radio-group>
<div class="category-style">
<el-popover
<div slot="selectBrandSlot" class="mode-slot">
<div class="mode-item" v-for="item in modeList" :key="item.id">
<el-radio v-model="formObj.categoryStyle" :label="item.id">{{item.name}}</el-radio>
<div>
<el-popover
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/vertical.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/vertical.png">
</el-popover>
<el-popover
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/transverse.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/transverse.png">
</el-popover>
<el-popover
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/recommend.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/recommend.png">
</el-popover>
<img :src="require(`@/assets/category/${item.url}.png`)" style="width:300px;height:300px;"/>
<img slot="reference" :src="require(`@/assets/category/${item.url}.png`)">
</el-popover>
</div>
</div>
</div>
</glsx-combi-form>
......@@ -54,7 +34,28 @@
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
const MODE_LIST = [
{
id: 0,
url: 'vertical',
name: '商品-竖向排列'
},
{
id: 1,
url: 'transverse',
name: '商品-横向排列'
},
{
id: 2,
url: 'recommend',
name: '种草样式A'
},
{
id: 3,
url: 'recommend2',
name: '种草样式B'
}
]
export default {
name: 'add',
components: {
......@@ -63,8 +64,10 @@ export default {
data() {
return {
dialogVisible: false,
modeList: MODE_LIST,
formObj: {
id: '',
categoryType: 1,
categoryName: '',
categoryStyle: 0,
videoCoverArr: []
......@@ -107,6 +110,23 @@ export default {
isDisabled: false
},
{
label: '分类归属',
name: 'categoryType',
type: 'radio',
optionList: [
{
label: '配置升级',
id: 1
},
{
label: '车主优选',
id: 2
},
],
optionId: 'id',
optionLabel: 'label'
},
{
label: '分类图标',
name: 'categoryImage',
addHtml: 'videoCoverSlot'
......@@ -126,7 +146,6 @@ export default {
}
},
methods: {
changeChannelImg(val) {
this.$refs.baseInfoRef.$refs.formRef.validateField('coverUrl')
},
......@@ -134,7 +153,6 @@ export default {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if (valid) {
let params = JSON.parse(JSON.stringify(this.formObj))
params.categoryType = 2 //类型 1 配置升级 2 车主优选
params.categoryLevel = 1 //分类等级(1:一级分类,2:二级分类)
params.categoryImage = this.formObj.videoCoverArr[0]
delete params.videoCoverArr
......@@ -156,7 +174,7 @@ export default {
getCaseDetailApi() {
this.$apis.category.batchDetailApi({id: this.$route.query.id}).then(res => {
if (res) {
const attrList = ['id', 'categoryName', 'categoryStyle']
const attrList = ['id', 'categoryName', 'categoryStyle', 'categoryType']
attrList.forEach(key => {
this.formObj[key] = res[key]
})
......@@ -198,9 +216,17 @@ export default {
}
}
}
.mode-slot{
display: flex;
.mode-item{
width: 145px;
img{
width: 103.97px;
height: 86.5px;
}
}
}
.category-style {
img {
width: 104px;
height: 102.6px;
......
......@@ -113,6 +113,13 @@ export default {
prop: 'categoryName'
},
{
label: '分类归属',
prop: 'categoryType',
formatter: cellValue => {
return cellValue.categoryType==1 ? '配置升级' : '车主优选'
}
},
{
label: '分类图标',
addHtml: 'categoryImage',
width: 150
......@@ -147,7 +154,6 @@ export default {
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
params.categoryType = 2
params.categoryLevel = 1
if (this.tableSearchForm.createDate?.length) {
params.beginCreateTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
......
......@@ -616,8 +616,7 @@ export default {
}
if (this.routeInfo.id) params.id = this.routeInfo.id
return params
}
,
},
handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if (valid) {
......
......@@ -12,9 +12,8 @@
<div slot="goodsInfoSlot" class="goods-wrap">
<glsx-combi-form :isInline="false" ref="goodsInfoRef" labelWidth="154px" defaultWidth="432px"
:formObj.sync="formObj" :formData="goodsFormData" :formRules="goodsRule">
<div slot="uploadSlot" class="upload-calss">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList"
@change="changeChannelImg"></glsx-preview>
<div slot="uploadSlot" class="upload-class">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList"></glsx-preview>
<span class="tip">建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内</span>
</div>
</glsx-combi-form>
......@@ -42,7 +41,13 @@
</GLTable>
</template>
</div>
<div slot="propagateCoverSlot" class="propagate-cover-class">
<div class="upload-wrap">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.styleBImgList"></glsx-preview>
<span class="preview" @click="showPreviewDialog=true">预览</span>
</div>
<span class="tip">分类布局选择种草样式B时商品宣传大图,建议720*540,大小2M以内</span>
</div>
<div slot="productVideoSlot">
<el-form-item label="">
<template v-if="!formObj.goodsVideo">
......@@ -70,14 +75,21 @@
</template>
<div class="text-tip2">作为商品详情页顶部展示和详情展示,格式建议mp4,大小不超过20M</div>
</el-form-item>
</div>
<div slot="expressFeeSlot">
<format-input class="expressFee-class" :disabled="disabled" :intDigit="4" :precise="2"
v-model="formObj.expressFee"></format-input>
</div>
</div>
</glsx-combi-form>
</div>
<div style="margin-top: 16px;">
<div class="global-title">物流信息</div>
<div class="container">
<glsx-combi-form :isInline="false" ref="expressInfoRef" labelWidth="154px" defaultWidth="432px"
:formObj.sync="formObj" :formData="expressInfoFormData" :formRules="myRule">
<div slot="expressFeeSlot">
<format-input class="expressFee-class" :disabled="disabled" :intDigit="4" :precise="2"
v-model="formObj.expressFee"></format-input>
</div>
</glsx-combi-form>
</div>
</div>
<GLFooter style="margin-top: 16px;">
<el-button @click="handleCancel">取消</el-button>
<el-button v-if="!disabled" type="primary" @click="handleSave">确定</el-button>
......@@ -92,6 +104,9 @@
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'"/>
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</el-dialog>
<div v-if="showPreviewDialog" class="preview-dialog" @click="showPreviewDialog = false">
<img class="preview-img" src="@/assets/preview.png" alt=""/>
</div>
</div>
</template>
<script>
......@@ -128,7 +143,8 @@ export default {
},
data() {
return {
dialogVisibleImg: false,
showPreviewDialog: false,
dialogVisibleImg:false,
goodsVisible: false,
merchantDialogVisible: false,
disabled: false,
......@@ -166,9 +182,41 @@ export default {
type: 'showTxt'
},
],
expressInfoFormData: [
{
label: '配送方式',
name: 'deliveryType',
type: 'radio',
optionList: [{
confId: 2,
confName: '快递发货'
},{
confId: 1,
confName: '到店核销'
}],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false
},
{
label: '运费/元',
name: 'expressFee',
addHtml: 'expressFeeSlot',
isDisabled: false
},
{
label: '服务说明',
name: 'introduction',
type: 'input',
inputType: 'textarea',
isDisabled: false,
showLimit: true,
maxlength: 200
},
],
formObj: {
source: '2',
method: '2',
goodsSource: 1,
deliveryType: 2,
goodsType: '2',
expressFee: '',
goodsVideo: '',
......@@ -179,6 +227,8 @@ export default {
goodsImage: '',
minSellPrice: '',
retailPrice: '',
styleBImg: '',
styleBImgList: [],
coverList: [],
associationClassifyFirstId: '',
introduction: ''
......@@ -238,8 +288,8 @@ export default {
trigger: 'change'
}],
associationClassifyFirstId: [{required: true, message: '请选择关联商品分类', trigger: 'change'}],
source: [{required: true, message: '请选择来源', trigger: 'change'}],
method: [{required: true, message: '请选择配送方式', trigger: 'change'}],
goodsSource: [{required: true, message: '请选择来源', trigger: 'change'}],
deliveryType: [{required: true, message: '请选择配送方式', trigger: 'change'}],
expressFee: [{required: true, message: '请输入运费', trigger: 'change'}],
},
formData: [
......@@ -254,12 +304,18 @@ export default {
},
{
label: '来源',
name: 'source',
name: 'goodsSource',
type: 'radio',
optionList: [{
confId: '2',
confName: '嘀加智享平台'
}],
optionList: [
{
confId: 1,
confName: '嘀加智享平台'
},
{
confId: 2,
confName: '门店自营'
}
],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false
......@@ -277,24 +333,9 @@ export default {
isDisabled: false
},
{
label: '带货视频',
name: 'tencentcloudMediaId',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'fileName',
isDisabled: false,
isClear: true
},
{
label: '带货描述',
name: 'commerceDescribe',
type: 'input',
inputType: 'textarea',
isDisabled: false,
maxlength: 40,
isHide: false,
showLimit: true
label: '种草样式B宣传图',
name: 'propagateCover',
addHtml: 'propagateCoverSlot'
},
{
label: '销售门店',
......@@ -308,32 +349,25 @@ export default {
addHtml: 'productVideoSlot'
},
{
label: '配送方式',
name: 'method',
type: 'radio',
optionList: [{
confId: '2',
confName: '快递发货'
}],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false
},
{
label: '运费/元',
name: 'expressFee',
addHtml: 'expressFeeSlot',
isDisabled: false
label: '带货视频',
name: 'tencentcloudMediaId',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'fileName',
isDisabled: false,
isClear: true
},
{
label: '服务说明',
name: 'introduction',
label: '带货描述',
name: 'commerceDescribe',
type: 'input',
inputType: 'textarea',
isDisabled: false,
showLimit: true,
maxlength: 200
},
maxlength: 40,
isHide: false,
showLimit: true
}
],
selectedtableParams: {
listName: 'list',
......@@ -365,10 +399,10 @@ export default {
this.posterOptions.isClose = false
const _target = this.goodsFormData.find(item => item.name == 'goodsName')
_target.isDisabled = true
const disabledList = ['associationClassifyFirstId', 'source', 'method', 'introduction']
const disabledList = ['associationClassifyFirstId', 'goodsSource', 'deliveryType', 'introduction']
disabledList.forEach(ele => {
const _disabledTarget = this.formData.find(item => item.name == ele)
_disabledTarget.isDisabled = true
_disabledTarget && (_disabledTarget.isDisabled = true)
})
this.selectedtableParams.tableOption = null
}
......@@ -505,12 +539,12 @@ export default {
getParams() {
let obj = JSON.parse(JSON.stringify(this.formObj))
obj.goodsImage = obj.coverList[0]
obj.styleBImg = obj.styleBImgList[0] || ''
obj.expressFee = obj.expressFee ? Number(Number(obj.expressFee * 10 * 10).toFixed(0)) : 0
delete obj.minSellPrice
delete obj.retailPrice
delete obj.coverList
delete obj.source
delete obj.method
delete obj.styleBImgList
let saleMerchantList = this.saleMerchantList.map(item => {
let {merchantId, merchantName, activityPrice, giveIntegral, originalPrice} = item
activityPrice = activityPrice ? Number(Number(activityPrice * 10 * 10).toFixed(0)) : 0
......@@ -526,6 +560,7 @@ export default {
},
handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
// this.$refs.expressInfoRef
if (valid) {
const params = this.getParams()
this.$apis.goods.addGoodsApi(params).then(res => {
......@@ -560,10 +595,9 @@ export default {
categoryName: res.associationClassifySecondName,
id: res.associationClassifySecondId
}
this.formObj.goodsType = '2'
this.formObj.source = '2',
this.formObj.method = '2',
this.formObj.coverList = [res.goodsImage]
this.formObj.goodsType = '2' //1配置升级, 2车主优选
this.formObj.coverList =res.goodsImage ? [res.goodsImage] : []
this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : []
this.saleMerchantList = res.saleMerchantList?.map(item => {
let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0
let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0
......@@ -600,16 +634,6 @@ export default {
.upload-calss {
display: flex;
.tip {
height: 20px;
line-height: 20px;
align-self: flex-end;
font-weight: 400;
font-size: 14px;
color: #999999;
margin-left: 10px;
}
}
}
......@@ -632,6 +656,23 @@ export default {
height: 80px;
}
}
.propagate-cover-class{
.preview{
color: #5850ff;
font-weight: 400;
font-size: 14px;
line-height: 20px;
align-self: self-end;
margin-left: 10px;
cursor: pointer;
}
.upload-wrap{
display: flex;
}
.tip{
margin: 0;
}
}
}
.upload-img {
......@@ -654,6 +695,15 @@ export default {
}
}
.tip {
height: 20px;
line-height: 20px;
align-self: flex-end;
font-weight: 400;
font-size: 14px;
color: #999999;
margin-left: 10px;
}
.avatar-uploader-desc-word {
font-weight: 400;
......@@ -717,4 +767,22 @@ export default {
color: #999999;
margin-bottom: -35px;
}
.preview-dialog{
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 99;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
.preview-img{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 390px;
height: 720px;
}
}
</style>
......@@ -83,13 +83,24 @@
<img :src="shareData.posterUrl" />
</div>
</div>
<div class="share-content">
<div>
<div class="share-title">小程序码</div>
<el-button type="primary" @click="handleSaveImg(shareData.qrCodeUrl, '小程序码')">保存图片</el-button>
<div class="share-qrcode">
<div class="share-content qrcode-item">
<div>
<div class="share-title">小程序码</div>
<el-button type="primary" @click="handleSaveImg(shareData.qrCodeUrl, '小程序码')">保存图片</el-button>
</div>
<div class="qr-code">
<img :src="shareData.qrCodeUrl" />
</div>
</div>
<div class="qr-code">
<img :src="shareData.qrCodeUrl" />
<div class="share-content qrcode-item">
<div>
<div class="share-title">员工注册码</div>
<el-button type="primary" @click="handleSaveImg(shareData.registerQrCodeUrl, '员工注册码')">保存图片</el-button>
</div>
<div class="qr-code">
<img :src="shareData.registerQrCodeUrl" />
</div>
</div>
</div>
</div>
......@@ -483,6 +494,14 @@ export default {
}
}
}
.share-qrcode{
display: flex;
flex-direction: column;
gap: 10px;
.qrcode-item{
height: 159px;
}
}
.share-footer {
width: 680px;
height: 90px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!