Compare commits

...

10 Commits

Author SHA1 Message Date
wtq
dda30518ec '!' 2026-03-31 14:06:09 +08:00
wtq
91b26f2cd2 '!' 2026-03-18 11:46:05 +08:00
wtq
1b59b491c5 '!' 2026-03-10 14:49:25 +08:00
wtq
7d3d78bce2 '!' 2026-02-05 09:46:21 +08:00
wtq
3ed584e339 '!' 2026-02-04 11:05:32 +08:00
wtq
4e59aec9f5 '!' 2026-02-04 10:41:06 +08:00
wtq
3d1e6d762d '!' 2026-02-02 14:36:41 +08:00
wtq
1b2b9edd84 '!' 2026-01-28 17:49:25 +08:00
wtq
3c8eb7e2b3 '!' 2026-01-28 15:30:38 +08:00
wtq
cab510eca5 '!' 2026-01-28 14:12:29 +08:00
11 changed files with 452 additions and 155 deletions

View File

@@ -339,9 +339,40 @@ export default {
})
},
// 重塑图片尺寸
remodelingImg(img,file) {
// remodelingImg(img,file) {
// this.$nextTick(()=>{
// const canvas = document.getElementById('resizedCanvas');
// const ctx = canvas.getContext('2d');
// // 设置canvas的宽度和高度
// canvas.width = this.imgWidth !== -1 ? this.imgWidth : img.width; // 新宽度
// canvas.height = this.imgHeight !== -1 ? this.imgHeight : img.height; // 新高度
// // 绘制图片到canvas上
// ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
// // 将canvas的内容转换回图片
// const resizedImg = canvas.toDataURL(file.raw.type, 1); // 第二个参数是图片质量
// const fileName = file.name; // 文件的名字
// const newFile = base64ToFile(resizedImg, fileName); // base64 转 file
// this.tailorContent['tailorImg'] = {raw:newFile,size:newFile.size,url:this.dataUrlToBlob(newFile)}
// console.log(newFile,'重塑图片数据',this.tailorContent)
// // if(this.tailorContent.size)
// // 显示修改后的图片
// // document.getElementById('resizedCanvas').style.display = 'block';
// })
// },
// 重塑图片尺寸 及压缩图片 callback
remodelingImg(img,file,flag) {
this.$nextTick(()=>{
if(!flag){
const canvas = document.getElementById('resizedCanvas');
const ctx = canvas.getContext('2d');
@@ -359,13 +390,74 @@ export default {
const newFile = base64ToFile(resizedImg, fileName); // base64 转 file
this.tailorContent['tailorImg'] = {raw:newFile,size:newFile.size}
const isLt2M = this.imgSize !== -1 ? newFile.size < this.imgSize * 1024 * 1024 : false
// console.log('img,1111111111','flag',flag)
if(!isLt2M && this.imgSize !== -1){
this.remodelingImg(img,file,true)
}else{
this.tailorContent['tailorImg'] = {raw:newFile,size:newFile.size}
}
}else{
const canvas = document.getElementById('resizedCanvas');
const ctx = canvas.getContext('2d');
// 设置canvas的宽度和高度
canvas.width = this.imgWidth !== -1 ? this.imgWidth : img.width; // 新宽度
canvas.height = this.imgHeight !== -1 ? this.imgHeight : img.height; // 新高度
// 绘制图片到canvas上
// console.log('img','canvas',canvas,'ctx',ctx)
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
this.canvasCompress(canvas,(imageBlob) => {
// const imageUrl = URL.createObjectURL(imageBlob)
const imageFile = new File([imageBlob],'压缩图片' + (new Date().getTime()), {
type: imageBlob.type,
lastModified: new Date().getTime()
});
this.tailorContent['tailorImg'] = {raw:imageFile,size:imageBlob.size}
// console.log(imageBlob,'压缩后的图片信息',imageFile)
// callback && callback(blob); // 满足大小要求返回Blob对象
},0.9)
}
// 显示修改后的图片
// document.getElementById('resizedCanvas').style.display = 'block';
})
},
// canvas 图片压缩 quality 初始质量
canvasCompress(canvas,callback,quality = 0.9){
let that = this
canvas.toBlob(function (blob) {
if (blob.size > 1024 * 1024) { // 如果大于1MB尝试降低质量或尺寸
quality -= 0.1; // 降低质量
if(quality<0.3){
// // maxWidth /= 2; // 减小尺寸的一半
// // maxHeight /= 2; // 减小尺寸的一半
// // width /= 2; // 重新计算宽度和高度
// // height /= 2; // 重新计算宽度和高度
// canvas.width = width;
// canvas.height = height;
// // ctx.drawImage(img, 0, 0, width, height);
// canvas.toBlob(function (newBlob) {
// console.log('递归调用直到满足大小要求11111111111',blob)
// callback && callback(newBlob); // 递归调用直到满足大小要求
// }, 'image/jpeg', quality);
that.$message({
message: `无法压缩图片请修改`,
type: 'warning',
center: true,
})
}else{
that.canvasCompress(canvas,callback,quality)
}
}else{
// const imageUrl = URL.createObjectURL(blob)
// console.log('newBlob,,,,blob,,,满足大小要求返回Blob对象,,9',blob,'imageUrl',imageUrl)
callback && callback(blob); // 满足大小要求返回Blob对象
}
},'image/jpeg', quality)
},
// 重塑图片 确认
sureImg(){
this.onChange(this.tailorContent.tailorImg) // 上传图片
@@ -407,7 +499,7 @@ export default {
},
// pdf转base64
fileToBase64(file){
console.log('file',file)
// console.log('file',file)
var reader = new FileReader();
let that = this
reader.onloadend = function() {
@@ -460,7 +552,7 @@ export default {
imgWidth:img.width,
imgHeight:img.height
}
this.remodelingImg(img,file) // 重塑图片尺寸
this.remodelingImg(img,file,false) // 重塑图片尺寸
// this.$refs.imgUpload.clearFiles()
return
}
@@ -470,7 +562,8 @@ export default {
if (!isLt2M && this.imgSize !== -1) {
// 压缩文件
this.$confirm(`您上传的图片大于${this.imgSize}M即将进行压缩是否继续`, '提示').then((res) => {
this.compressedPicture(file)
this.dialogVisible2 = true // 打开弹框
this.remodelingImg(img,file,true)
}).catch((err) => {
this.$message({
message: `图片大小不能超过${this.imgSize}M`,
@@ -601,6 +694,69 @@ export default {
})
})
},
// compressImage(file) {
// return new Promise((resolve, reject) => {
// const reader = new FileReader();
// reader.readAsDataURL(file.raw);
// reader.onload = function (event) {
// const img = new Image();
// img.src = event.target.result;
// img.onload = function () {
// const canvas = document.createElement('resizedCanvas');
// const ctx = canvas.getContext('2d');
// let quality = 0.7; // 初始质量设置
// // let maxWidth = this.imgWidth !== -1 ? this.imgWidth : 800; // 最大宽度限制
// // let maxHeight = this.imgHeight !== -1 ? this.imgHeight : 800; // 最大高度限制
// let width = img.width;
// let height = img.height;
// // 检查宽度和高度是否超过限制,如果超过则调整尺寸
// // if (width > height) {
// // if (width > maxWidth) {
// // height *= maxWidth / width;
// // width = maxWidth;
// // }
// // } else {
// // if (height > maxHeight) {
// // width *= maxHeight / height;
// // height = maxHeight;
// // }
// // }
// canvas.width = width;
// canvas.height = height;
// ctx.drawImage(img, 0, 0, width, height);
// // 将canvas转换为Blob对象并检查大小
// canvas.toBlob(function (blob) {
// if (blob.size > 1024 * 1024) { // 如果大于1MB尝试降低质量或尺寸
// quality -= 0.1; // 降低质量
// if (quality < 0.3) { // 如果质量过低,减小尺寸比例
// // maxWidth /= 2; // 减小尺寸的一半
// // maxHeight /= 2; // 减小尺寸的一半
// // width /= 2; // 重新计算宽度和高度
// // height /= 2; // 重新计算宽度和高度
// canvas.width = width;
// canvas.height = height;
// ctx.drawImage(img, 0, 0, width, height);
// canvas.toBlob(function (newBlob) {
// resolve(newBlob); // 递归调用直到满足大小要求
// }, 'image/jpeg', quality);
// } else { // 如果可以降低质量,则再次尝试压缩
// canvas.toBlob(function (newBlob) {
// resolve(newBlob); // 递归调用直到满足大小要求
// }, 'image/jpeg', quality);
// }
// } else {
// console.log('newBlob,,,,blob',blob)
// resolve(blob); // 满足大小要求返回Blob对象
// }
// }, 'image/jpeg', quality); // 设置压缩格式和质量
// };
// };
// reader.onerror = reject; // 文件读取错误处理
// });
// },
// 压缩图片
compressedPicture(file) {
let that = this
@@ -626,14 +782,13 @@ export default {
},
// 图片宽高是否符合要求
async widthOrHeight(file, fn) {
// let that = this
if (this.imgWidth !== -1 || this.imgHeight !== -1) {
let reader = new FileReader()
reader.readAsDataURL(file.raw)
reader.onload = (e) => {
let img = new Image()
img.src = e.target.result
img.onload = () => {
let reader = new FileReader()
reader.readAsDataURL(file.raw)
reader.onload = (e) => {
let img = new Image()
img.src = e.target.result
img.onload = () => {
if(this.imgWidth !== -1 || this.imgHeight !== -1){
let flag = true
if (this.imgWidth !== -1 && this.imgHeight !== -1) {
flag = this.imgWidth === img.width && this.imgHeight === img.height
@@ -643,10 +798,10 @@ export default {
flag = this.imgWidth === img.height
}
fn && fn(flag,img)
}else{
fn && fn(true,img)
}
}
} else {
fn && fn(true)
}
},
// 文件格式

View File

@@ -67,6 +67,14 @@
@click="sumitSearch"
style="width: 100px;"
>查找</el-button>
<br>
<div v-if="isShowFilter" style="margin-top: 20px;">
<el-switch
v-model="isFilterStoreSku"
active-text="门店商品"
inactive-text="平台商品">
</el-switch>
</div>
</div>
<div class="del">
<el-button
@@ -146,6 +154,9 @@
<!-- {{item.prefix && '[' + item.prefix + ']'}}{{item.name}} {{item.skus[0].specQuality}}{{item.skus[0].specUnit}}/{{item.unit}} -->
{{computedName(item, item.skus[0])}}
</div>
<div v-if="isFilterStoreSku" style="width: 20%;">{{ '' + (item.skus[0].price / 100).toFixed(2) }}</div>
<div class="sku-id">{{item.skus[0].id}}</div>
<div
v-if="!reqApi"
@@ -236,7 +247,7 @@ import { computedName } from '@/utils'
/* eslint-disable */
export default {
name: 'DiaPickSkus',
props: ['diaSkuShow', 'catLevel1', 'catLevel2', 'type', 'max', 'reqApi', 'type','skuNameList'],
props: ['diaSkuShow', 'catLevel1', 'catLevel2', 'type', 'max', 'reqApi', 'type','skuNameList','storeList'],
data() {
return {
catProps: {
@@ -254,7 +265,8 @@ export default {
vendFactor:null,
pricePercentage:null, // 活动折扣
isExd: false,
orginalVendorFac:null
orginalVendorFac:null,
isFilterStoreSku:false
}
},
created() {
@@ -278,6 +290,11 @@ export default {
})
return catData
},
isShowFilter(){
let flag = false
if(this.storeList && this.storeList.length === 1) flag = true
return flag
}
},
watch:{
vendFactor(val){
@@ -286,6 +303,9 @@ export default {
this.setActPriceByVendor()
}
},
isFilterStoreSku(val){
if(val) this.getGoods()
}
},
methods: {
/**
@@ -361,7 +381,16 @@ export default {
if (+this.categoryID !== -1) json.categoryID = +this.categoryID[this.categoryID.length - 1]
if (+this.categoryID === -1 && !this.keyword && !this.nameID && !this.skuID) json.pageSize = 50
json.status = -1
// if(this.isFilterStoreSku) json.storeIDs = JSON.stringify(this.storeList)
let url = `v2/sku/GetSkuNamesNew`
if(this.isFilterStoreSku){
url = `v2/store/sku/GetStoresSkus`
json.storeIDs = JSON.stringify(this.storeList)
json.isFocus = true
}
if (this.reqApi) {
url = `v2/store/sku/GetStoresSkus`
json.storeIDs = JSON.stringify([102919])

View File

@@ -629,6 +629,7 @@
:diaSkuShow="diaSkuShow"
:catLevel1="catLevel1"
:catLevel2="catLevel2"
:storeList="storeList"
@confirmSkus="confirmSkus"
@handleClose="handleClose"
></DiaSkusPick>

View File

@@ -327,12 +327,19 @@
<el-button
type="success"
size="mini"
@click="dealCheck (2,row)"
@click="dealCheck (2,row,false)"
>批准</el-button>
<el-button
type="warning"
size="mini"
@click="dealCheck (2,row,true)"
style="margin-left: 10px;"
>批准并可售</el-button>
<el-button
type="danger"
size="mini"
@click="dealCheck(-1, row)"
style="margin-left: 10px;"
>拒绝</el-button>
</el-button-group>
</div>
@@ -645,7 +652,7 @@ export default {
this.selects = val;
},
// 处理
dealCheck(handleType, row) {
dealCheck(handleType, row,flag) {
const { storeID, nameID, unitPrice, originPrice } = row;
// -1拒绝 1批准 2预审核
if (handleType === -1) {
@@ -702,20 +709,23 @@ export default {
const auditPrice = Math.floor(value * 100);
const { storeID, nameID } = row;
// 修改可售参数
let skuName = await getStoreSku(storeID, nameID, true);
// console.log(row,'skuName,9999999999999',skuName.skus)
let skus = skuName.skus.map(sku => { return {
skuID:sku.id,
isSale:1
} })
let arr = [];
arr.push({
NameID:nameID,
skus
});
// 修改可售参数 row.type 关注操作
let skuName = null
let arr = []
if(flag){
skuName = await getStoreSku(storeID, nameID, row.type === 2 ? false : true);
let skus = skuName.skus.map(sku => { return {
skuID:sku.id,
isSale:1
} })
arr.push({
NameID:nameID,
skus
});
}
// 批转的参数
// 批准的参数
let payload = JSON.stringify([
{
storeID,
@@ -752,29 +762,32 @@ export default {
payload
});
updateStoreSkus(storeID, arr,(res) => {
if (res.code === "0") {
if(flag){
updateStoreSkus(storeID, arr,(res) => {
if (res.code === "0") {
this.$message({
message: "[改价] 成功",
type: "success",
center: true
});
this.getStoreCheckList();
}else{
this.$message({
message: "[改价] 成功",
message: "[改价] 成功,可售失败",
type: "success",
center: true
});
this.getStoreCheckList();
}else{
this.$message({
message: "[改价] 成功,可售失败",
type: "success",
center: true
});
this.getStoreCheckList();
}
})
// this.$message({
// message: "[改价] 成功",
// type: "success",
// center: true
// });
// this.getStoreCheckList();
}
})
}else{
this.$message({
message: "[改价] 成功",
type: "success",
center: true
});
this.getStoreCheckList();
}
});
hideLoad();
} else {
@@ -785,24 +798,34 @@ export default {
isContinueWhenError: false,
payload
});
updateStoreSkus(storeID, arr,(res) => {
if (res.code === "0") {
if(flag){
updateStoreSkus(storeID, arr,(res) => {
if (res.code === "0") {
this.$message({
message: "[改价] 成功",
type: "success",
center: true
});
this.getStoreCheckList();
}else{
this.$message({
message: "[改价] 成功",
message: "[改价] 成功,可售失败",
type: "success",
center: true
});
this.getStoreCheckList();
}else{
this.$message({
message: "[改价] 成功,可售失败",
type: "success",
center: true
});
this.getStoreCheckList();
}
})
}
})
}else{
this.$message({
message: "[改价] 成功",
type: "success",
center: true
});
this.getStoreCheckList();
}
// this.$message({
// message: "[改价] 成功",
// type: "success",

View File

@@ -1353,6 +1353,8 @@ export default {
json["商品名称"] = skuName.name;
json["京西skuID"] = sku.id;
json["可售状态"] = sku.storeSkuStatus;
json['重量'] = sku.specQuality
json['单位'] = sku.specUnit
// json["Upc"] = skuName.Upc;
json["全国中位价(单位:元)"] = skuName.realMidUnitPrice / 100;
json["skuName价格(单位:元)"] = skuName.unitPrice / 100;

View File

@@ -856,6 +856,7 @@ export default {
changePriceType: 0, // 价格审核 0不审核 1审核 2禁止修改
packageSetting: 0, // 包装费
packageSwitch: 1, // 允许物料购买 0允许 1禁用
deliverySelf:0, // 是否允许自提 默认不允许
freightMarkup: 0, // 三方运单的配送费
cityCode: null, // 510100,
districtCode: null, // 510105,
@@ -1388,6 +1389,7 @@ export default {
this.storeInfo = JSON.parse(res.data.data)
if(this.storeInfo.openTime2) this.isShowOpenTime = true
this.storeInfo.packageSwitch = 1
this.storeInfo.deliverySelf = 0
this.storeInfo.printerVendorID = printerVendorID
this.storeInfo.printerSN = printerSN
this.storeInfo.printerKey = printerKey
@@ -1556,6 +1558,7 @@ export default {
this.storeInfo.packageSetting = Number(this.storeInfo.packageSetting) * 100
this.storeInfo.freightMarkup = Number(this.storeInfo.freightMarkup) * 100
this.storeInfo.packageSwitch = 1
this.storeInfo.deliverySelf = 0
let json = JSON.parse(JSON.stringify(this.storeInfo))
if (json.hasOwnProperty('idExpire') && !json.idExpire) json.idExpire = ''
if (json.hasOwnProperty('licenceExpire') && !json.licenceExpire)

View File

@@ -317,9 +317,10 @@
prop="pricePercentage"
v-if="!(addStore.vendorID === 16 && !vendorQuery.isBind)"
>
<!-- :disabled="isDisableByBrand" -->
<el-radio-group
v-model="addStore.createDeliveryType"
:disabled="isDisableByBrand"
:disabled="deliveryTypeDisable"
>
<el-radio :label="0">品牌发单</el-radio>
<el-radio :label="1">门店发单</el-radio>
@@ -567,6 +568,17 @@
style="width: 100px; height: 100px; margin-left: 50px"
/>
</div>
<!-- 是否自提 -->
<el-form-item label="是否允许自提" v-if="vendorQuery.isBind && addStore.vendorID === 9">
<el-switch
v-model="addStore.deliverySelf"
:active-value="1"
:inactive-value="0"
active-text="允许"
inactive-text="不允许"
>
</el-switch>
</el-form-item>
<!-- 满减 -->
<el-form-item label="减运费策略:" v-if="addStore.vendorID === 9">
@@ -1103,6 +1115,7 @@ export default {
// deliveryType: 0, // 门店快递类型
isSync: 0, // 0不同步 1同步,
isService: 0, // 切换服务商
deliverySelf:0, // 是否允许自提 0-不支持,1-支持
isSupplyGoods: 0, //
pricePercentagePack: '', // 调价包
freightDeductionPack: '', // 免运包
@@ -1359,8 +1372,11 @@ export default {
// (this.vendorQuery.isBind && this.addStore.isSync === 1)
// ? true
// : false
// : false;
// : false;
// },
deliveryTypeDisable(){
return localStorage.getItem('mobile') === '18981810340' ? false : this.isDisableByBrand
},
supplierID() {
return this.createEbaiForm.supplierID
@@ -1699,6 +1715,7 @@ export default {
this.addStore.deliveryFeeDeductionFee =
data[index].deliveryFeeDeductionFee / 100
this.addStore.isOrder = data[index].isOrder
this.addStore.deliverySelf = data[index].deliverySelf
} else if (this.vendorQuery.vendorID === 5) {
this.addStore.status = data[index].status
this.addStore.syncRule = data[index].syncRule
@@ -1847,7 +1864,8 @@ export default {
deliveryFeeDeductionFee: Math.round(
this.addStore.deliveryFeeDeductionFee * 100
),
isOrder: this.addStore.isOrder
isOrder: this.addStore.isOrder,
deliverySelf:this.addStore.deliverySelf
})
)
} else if (this.vendorQuery.vendorID === 4) {
@@ -1988,7 +2006,8 @@ export default {
this.addStore.deliveryFeeDeductionFee * 100
),
isOrder: this.addStore.isOrder,
createDeliveryType: this.addStore.createDeliveryType
createDeliveryType: this.addStore.createDeliveryType,
deliverySelf:this.addStore.deliverySelf
})
)
} else {

View File

@@ -2651,10 +2651,10 @@ export default {
let ddName = ''
let ddStatus = ''
let ddPack = ''
let txdID = ''
let txdName = ''
let txdStatus = ''
let txdPack = ''
// let txdID = ''
// let txdName = ''
// let txdStatus = ''
// let txdPack = ''
let jxID = ''
let jxName = ''
let jxStatus = ''
@@ -2711,16 +2711,16 @@ export default {
}
// txd
let arr16 = item.StoreMaps.filter((item) => item.vendorID === 16)
txdID = arr16.length === 0 ? '' : arr16[0].vendorStoreID
if (arr16.length > 0) {
txdName = arr16[0].vendorStoreName || arr16[0].storeName
txdStatus =
item.status === 0
? '临时休息'
: this.switchStatus(arr16[0].status)
txdPack = arr16[0].pricePercentagePack || ''
}
// let arr16 = item.StoreMaps.filter((item) => item.vendorID === 16)
// txdID = arr16.length === 0 ? '' : arr16[0].vendorStoreID
// if (arr16.length > 0) {
// txdName = arr16[0].vendorStoreName || arr16[0].storeName
// txdStatus =
// item.status === 0
// ? '临时休息'
// : this.switchStatus(arr16[0].status)
// txdPack = arr16[0].pricePercentagePack || ''
// }
// jx
let arr9 = item.StoreMaps.filter((item) => item.vendorID === 9)
@@ -2870,10 +2870,10 @@ export default {
ddName,
ddStatus,
ddPack,
txdID,
txdName,
txdStatus,
txdPack,
// txdID,
// txdName,
// txdStatus,
// txdPack,
jxID,
jxName,
jxStatus,

View File

@@ -159,6 +159,8 @@
<el-option label="大(1份)" :value="1"></el-option>
<el-option label="正常(2份)" :value="2"></el-option>
<el-option label="大(2份)" :value="3"></el-option>
<el-option label="中(1份)" :value="4"></el-option>
<el-option label="中(2份)" :value="5"></el-option>
</el-select>
</el-form-item>
<br v-if="showTestPrint">
@@ -655,7 +657,7 @@
</template>
<script>
import { GetVendorStore, updateStore, deleteStoreVendorMap, addStoreVendorMap, getStoreVendorMaps, updateStoreVendorMap, taoUpdateStatusOrTimeOrPoints, createStore } from '@/apis/store.js'
import { GetVendorStore, updateStore, deleteStoreVendorMap, addStoreVendorMap, updateStoreVendorMap, taoUpdateStatusOrTimeOrPoints, createStore } from '@/apis/store.js'
import { getPlaces, getCoordinateDistrictCode, getPlaces2, updateStoreTemplate } from '@/apis/cms.js'
import $ajax from 'axios'
import api from '@/utils/api'

View File

@@ -30,31 +30,50 @@
</div>
</el-aside> -->
<div v-if="allUser.length !== 0" style="display: flex;">
<!-- <el-badge value="new" style=" margin-top: 10px; margin-right: 40px;" :hidden="false">
<span >门店聊天</span>
</el-badge> -->
<div style="width: 500px;box-sizing: border-box;">
<div
v-for="(item,index) in allUser" :key="index"
style="display: flex;width: 500px;align-items: center; justify-content: center"
@click="queryDetailBut(item,false,'click')"
:style="{
'backgroundColor':item.userID === '' + currentUser.userID ? 'rgb(244 244 244)' : '',
'border-bottom':'1px solid #eee',
'padding':'10px'
}">
<div class="avatar">
<img
:src="item.vendorID === 1 ? 'https://image.jxc4.com/image/75654ab606494a0efdb0cf7d7ad060d9.png': item.vendorID === 3 ? 'https://image.jxc4.com/image/06a27a6503a6695824bf361ded5f1d45.png' : 'https://image.jxc4.com/image/884664b80ffd2eda64a4aab9f4dc402e.png'" mode="aspectFill" alt=""
style="width: 50px;height: 50px;"
/>
<template v-for="(item,index) in allUser">
<el-badge
:value="+item.NewMessageNum"
:max="99"
style=" margin-top: 10px; margin-right: 40px;"
:hidden="!item.NewMessageNum ? true : false"
>
<!-- <span >门店聊天</span> -->
<div
:key="index"
style="display: flex;width: 500px;align-items: center; justify-content: center"
@click="queryDetailBut(item,false,'click')"
:style="{
'backgroundColor':item.userID === '' + currentUser.userID ? 'rgb(244 244 244)' : '',
'border-bottom':'1px solid #eee',
'padding':'10px'
}">
<!-- NewMessageNum -->
<div class="avatar">
<img
:src="item.vendorID === 1 ? 'https://image.jxc4.com/image/75654ab606494a0efdb0cf7d7ad060d9.png': item.vendorID === 3 ? 'https://image.jxc4.com/image/06a27a6503a6695824bf361ded5f1d45.png' : 'https://image.jxc4.com/image/884664b80ffd2eda64a4aab9f4dc402e.png'" mode="aspectFill" alt=""
style="width: 50px;height: 50px;"
/>
</div>
<div style="margin-left: 10px;">
<div class="titleText" style="width:300px;display: flex" >
<div style="width: 100px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">
{{ item.userID }}
</div>
<div style="width: 200px;">
{{ `${item.storeInfo ? item.storeInfo.name + '(' + item.storeInfo.id +')' : '' }` }}
</div>
</div>
<div class="latestMsg">{{ item.latestMsg }}</div>
</div>
<div style="width: fit-content;white-space: nowrap;margin-left: 10px;">{{ item.latestTime.substring(5) }}</div>
</div>
<div style="margin-left: 10px;">
<div class="titleText" style="width:300px">
{{ item.userID + `${item.storeInfo ? item.storeInfo.name + '(' + item.storeInfo.id +')' : '' }` }}
</div>
<div class="latestMsg">{{ item.latestMsg }}</div>
</div>
<div style="width: fit-content;white-space: nowrap;margin-left: 10px;">{{ item.latestTime.substring(5) }}</div>
</div>
</el-badge>
</template>
<!-- <el-menu
style="width: 500px;"
@@ -147,14 +166,17 @@
</div>
<div class="chatBox" style="margin-left: 20px;border-left: 1px solid #bdbaba;">
<div class="chatBoxTitle" v-if="currentUser">{{ currentUser.storeInfo ? currentUser.userID + '' + currentUser.storeInfo.name + '('+ currentUser.storeInfo.id +')' + '' : '' }}</div>
<div class="chatBoxTitle" v-if="currentUser">
<!-- {{ currentUser }} -->
{{ currentUser.storeInfo ? currentUser.userID + '【' + currentUser.storeInfo.name + '('+ currentUser.storeInfo.id +')' + '】' : '' }}
</div>
<div class="chatBoxCenter">
<!-- 头像 -->
<div v-for="(item,index) in chatDetail" :key="index"
class="chatDetail-item"
:style="{
'flex-direction':item.msg_source == 1?'row-reverse':'',
'text-align':item.msg_source == 1?'right':'',
'flex-direction':item.msg_source == 1 ? 'row-reverse':'',
'text-align':item.msg_source == 1 ? 'right':'',
'margin':'20px',
'padding':'20px',
}">
@@ -207,13 +229,13 @@
<!-- 图片 -->
<el-popover
placement="right"
width="300"
width="1000"
trigger="hover"
v-else-if="item.msg_type == 2 || item.msg_type == 12">
<div>
<img :src="item.msg_content" alt="缩略图..." width="100%" />
</div>
<img slot="reference" :src="item.msg_content" alt="略缩图" style="width:100px;height:240px" />
<img slot="reference" :src="item.msg_content" alt="略缩图" style="width:200px;height:240px" />
</el-popover>
<!-- 视频 -->
@@ -301,6 +323,10 @@ export default {
isGetDetail:{
type:Boolean,
default:false
},
value:{
type:Number,
default:0
}
},
data() {
@@ -341,7 +367,10 @@ export default {
let mt = this.allUserList.mt
let elm = this.allUserList.elm
let jd = this.allUserList.jd
return mt.concat(elm).concat(jd) || []
let arr = mt.concat(elm).concat(jd) || []
if(arr.length>0) this.$emit("input", arr.length)
// console.log(this.allUserList,'1111111111,allUser',arr)
return arr
}
},
created(){
@@ -379,20 +408,20 @@ export default {
let arr = []
res.forEach(item => {
let brr = item.vendorStoreList || []
// this.personalStore.push({...item})
this.personalStore.push({
address: "四川省成都市新都区三河场江陵路市场内16-19号摊位老向蔬菜店",
cityName: "成都市",
id: 100296,
name: "谢卫路店",
payeeName: "向文祥",
status: 1,
tel1: "13658078848",
tel2: "13658078848",
elmStoreID:"",
jdStoreID:"",
mtStoreID:"7026352"
})
this.personalStore.push({...item})
// this.personalStore.push({
// address: "四川省成都市新都区三河场江陵路市场内16-19号摊位老向蔬菜店",
// cityName: "成都市",
// id: 100296,
// name: "谢卫路店",
// payeeName: "向文祥",
// status: 1,
// tel1: "13658078848",
// tel2: "13658078848",
// elmStoreID:"",
// jdStoreID:"",
// mtStoreID:"7026352"
// })
// console.log('item',item,'brr',brr)
if(brr.length>0){
brr.map(i => {
@@ -419,23 +448,24 @@ export default {
}
})
// console.log(arr,'this.personalStore',this.personalStore)
// return arr
return arr
// return [{"vendorStoreID":"7290541","vendorID":"1","appID":"589"},{"vendorStoreID":"2233065983","vendorID":"3","appID":"34665"},{"vendorStoreID":"11998833","vendorID":"0","appID":"320406"}]
return [{"vendorStoreID":"7026352","vendorID":"1","appID":"589"}]
// return [{"vendorStoreID":"7026352","vendorID":"1","appID":"589"}]
},
async getUser(flag){
let res = await getChatUserList(this.paramsData,true)
// console.log('1111111111,获取用户列表',res)
if(JSON.stringify(res) === '{}') return
let keys = Object.keys(res)
this.platArr = keys
this.allUserList['mt'] = []
this.allUserList['elm'] = []
this.allUserList['jd'] = []
// this.platInfo(this.platArr)
keys.forEach(i => {
let userArr = i.split(':')
// this.allUserList[userArr[0]] = {}
this.allUserList['mt'] = []
this.allUserList['elm'] = []
this.allUserList['jd'] = []
if(userArr[2] === '1'){
// 美团
// this.allUserList['mt'] = []
@@ -467,13 +497,22 @@ export default {
})
}else if(userArr[2] === '3'){
// 淘宝闪购
this.allUserList['elm'] = []
res[i].reverse().forEach.forEach(element => {
// this.allUserList['elm'] = []
// console.log('i,iiiiiiiiiiiiiii',i,'res,,,翻转arr')
// debugger
res[i].reverse().forEach(element => {
let resData = JSON.parse(element)
let findIndex = this.allUserList['elm'].findIndex(item => item.payLoad.groupId === resData.payLoad.groupId)
// debugger
let findIndex = this.allUserList['elm'].findIndex(item => item.userID === resData.userID)
if(findIndex === -1){
let latestMsgHandler = resData.latestMsg
let find = this.personalStore.find(i => i.mtStoreID === userArr[1])
// let latestMsgHandler = resData.latestMsg
let latestMsgHandler = JSON.parse(resData.latestMsg).text ? JSON.parse(resData.latestMsg).text : JSON.parse(resData.latestMsg).duration ? '【语音】' : '【图片】'
if (JSON.parse(resData.latestMsg).elements && JSON.parse(resData.latestMsg).elements.length > 0) {
let findItem = JSON.parse(resData.latestMsg).elements.filter(item => item.elementType === 1)
latestMsgHandler = findItem && findItem.length > 0 ? JSON.parse(findItem[0].elementContent).text.replace('@商家', '') : latestMsgHandler
}
let find = this.personalStore.find(i => i.elmStoreID === userArr[1])
this.allUserList['elm'].push({
...resData,
latestMsg: latestMsgHandler,
@@ -484,8 +523,20 @@ export default {
vendorStoreID:userArr[1],
storeInfo:find || ""
})
}else{
// this.allUserList['elm'][findIndex] = {
// ...resData,
// latestMsg: latestMsgHandler,
// latestTime: timeFormatDHM(+new Date(resData.latestTime )),
// orderInfo: {},
// orderDesc: '',
// platformID:userArr[0],
// vendorStoreID:userArr[1],
// storeInfo:find || ""
// }
}
})
// debugger
}else if(userArr[2] === '0'){
// 京东
this.allUserList['JD'][userArr[1]] = []
@@ -494,7 +545,7 @@ export default {
let findIndex = this.allUserList[userArr[0]][userArr[1]].findIndex(item => item.payLoad.groupId === resData.payLoad.groupId)
if(findIndex === -1){
let latestMsgHandler = resData.latestMsg
let find = this.personalStore.find(i => i.jdStoreID === userArr[1])
this.allUserList[userArr[0]][userArr[1]].push({
...resData,
latestMsg: latestMsgHandler,
@@ -511,7 +562,7 @@ export default {
})
if(this.isGetDetail) this.queryDetailFirst(flag)
// console.log('allUserList,,,allUserList',this.allUserList)
console.log('allUserList,,,allUserList',this.allUserList)
},
queryDetailFirst(flag){
if(!this.currentUser){
@@ -560,9 +611,9 @@ export default {
queryDetailBut:debounce(
function name(query,falg,type) {
if(type && type === 'click'){
console.log('11111111111,,聊天记里',query)
// console.log(this.currentUser,'11111111111,,聊天记里',query)
if(query.userID === this.currentUser.userID) return // 不用重复点击
return
// return
}
if(query.userID !== this.currentUser.userID) this.chatDetail = [] // 清空聊天记录
if(this.detailTimer) clearInterval(this.detailTimer)
@@ -1000,4 +1051,10 @@ export default {
/deep/ .el-textarea__inner{
height: 100px !important;
}
.sendText{
width: 100%;
height: 100px;
background-color: #fff;
}
</style>

View File

@@ -483,15 +483,15 @@
<el-tab-pane label="配送总额" name="deliveryAmount">
<div>
<h1 style="text-align: center;">达达配送</h1>
<div style="display: flex;justify-content: center;align-items: center;border-bottom:1px solid #bfbfbf;padding-bottom: 20px;">
<div style="margin-right: 10px;font-size: 28px;margin-left: 10px;color:red">{{ '¥' + dadaDeliver.platformBalance }}</div>
<el-input placeholder="请输入充值金额" v-model.number="dadaDeliver.amount" style="width: 200px;margin-left: 10px;">
<template slot="append" >
<div @click="sureRecharge('dada')">充值</div>
</template>
</el-input>
</div>
<div style="display: flex;justify-content: center;align-items: center;border-bottom:1px solid #bfbfbf;padding-bottom: 20px;">
<div style="margin-right: 10px;font-size: 28px;margin-left: 10px;color:red">{{ '¥' + dadaDeliver.platformBalance }}</div>
<el-input placeholder="请输入充值金额" v-model.number="dadaDeliver.amount" style="width: 200px;margin-left: 10px;">
<template slot="append" >
<div @click="sureRecharge('dada')">充值</div>
</template>
</el-input>
</div>
<h1 style="text-align: center;">蜂鸟配送</h1>
<div style="display: flex;justify-content: center;align-items: center;">
@@ -505,8 +505,13 @@
</div>
</el-tab-pane>
<!-- <el-tab-pane label="门店聊天" name="storechat">
<ChatDetail :isGetDetail="isGetDetail"></ChatDetail>
<!-- <el-tab-pane name="storechat">
<span slot="label">
<el-badge value="new" style=" margin-top: 10px; margin-right: 40px;" :hidden="allUser ? false: true">
<div style="margin-top:-10px">门店聊天</div>
</el-badge>
</span>
<ChatDetail :isGetDetail="isGetDetail" v-model="allUser"></ChatDetail>
</el-tab-pane> -->
</el-tabs>
@@ -616,6 +621,7 @@ export default {
},
data() {
return {
allUser:0, // 聊天详情,所有用户信息条数
isGetDetail:false,
newFeatures: [],
html: '',