Commit ad8b809d by 前端

Merge branch 'v3.1.0' into 'master'

V3.1.0

See merge request !64
2 parents 16dc0402 b5c7d017
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-08 12:25:27
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-08 14:10:42
* @FilePath: \scrm-micro-drainage\public\hash.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// hash.js
self.importScripts('spark-md5.min.js')
self.onmessage = e => {
console.log(e)
const { file } = e.data
const spark = new self.SparkMD5.ArrayBuffer()
let count = 0
const loadNext = index => {
const reader = new FileReader()
reader.readAsArrayBuffer(file)
reader.onload = e => {
count++
spark.append(e.target.result)
var hexHash = spark.end()
var oParams = {}
oParams.fileMD5 = hexHash
oParams.file = e.target.result
oParams.size = file.size
self.postMessage(oParams)
}
}
loadNext(0)
}
(function(factory){if(typeof exports==="object"){module.exports=factory()}else if(typeof define==="function"&&define.amd){define(factory)}else{var glob;try{glob=window}catch(e){glob=self}glob.SparkMD5=factory()}})(function(undefined){"use strict";var add32=function(a,b){return a+b&4294967295},hex_chr=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function cmn(q,a,b,x,s,t){a=add32(add32(a,q),add32(x,t));return add32(a<<s|a>>>32-s,b)}function md5cycle(x,k){var a=x[0],b=x[1],c=x[2],d=x[3];a+=(b&c|~b&d)+k[0]-680876936|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[1]-389564586|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[2]+606105819|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[3]-1044525330|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[4]-176418897|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[5]+1200080426|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[6]-1473231341|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[7]-45705983|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[8]+1770035416|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[9]-1958414417|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[10]-42063|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[11]-1990404162|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[12]+1804603682|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[13]-40341101|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[14]-1502002290|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[15]+1236535329|0;b=(b<<22|b>>>10)+c|0;a+=(b&d|c&~d)+k[1]-165796510|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[6]-1069501632|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[11]+643717713|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[0]-373897302|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[5]-701558691|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[10]+38016083|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[15]-660478335|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[4]-405537848|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[9]+568446438|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[14]-1019803690|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[3]-187363961|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[8]+1163531501|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[13]-1444681467|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[2]-51403784|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[7]+1735328473|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[12]-1926607734|0;b=(b<<20|b>>>12)+c|0;a+=(b^c^d)+k[5]-378558|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[8]-2022574463|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[11]+1839030562|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[14]-35309556|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[1]-1530992060|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[4]+1272893353|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[7]-155497632|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[10]-1094730640|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[13]+681279174|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[0]-358537222|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[3]-722521979|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[6]+76029189|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[9]-640364487|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[12]-421815835|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[15]+530742520|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[2]-995338651|0;b=(b<<23|b>>>9)+c|0;a+=(c^(b|~d))+k[0]-198630844|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[7]+1126891415|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[14]-1416354905|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[5]-57434055|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[12]+1700485571|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[3]-1894986606|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[10]-1051523|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[1]-2054922799|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[8]+1873313359|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[15]-30611744|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[6]-1560198380|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[13]+1309151649|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[4]-145523070|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[11]-1120210379|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[2]+718787259|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[9]-343485551|0;b=(b<<21|b>>>11)+c|0;x[0]=a+x[0]|0;x[1]=b+x[1]|0;x[2]=c+x[2]|0;x[3]=d+x[3]|0}function md5blk(s){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=s.charCodeAt(i)+(s.charCodeAt(i+1)<<8)+(s.charCodeAt(i+2)<<16)+(s.charCodeAt(i+3)<<24)}return md5blks}function md5blk_array(a){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=a[i]+(a[i+1]<<8)+(a[i+2]<<16)+(a[i+3]<<24)}return md5blks}function md51(s){var n=s.length,state=[1732584193,-271733879,-1732584194,271733878],i,length,tail,tmp,lo,hi;for(i=64;i<=n;i+=64){md5cycle(state,md5blk(s.substring(i-64,i)))}s=s.substring(i-64);length=s.length;tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<length;i+=1){tail[i>>2]|=s.charCodeAt(i)<<(i%4<<3)}tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(state,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=n*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(state,tail);return state}function md51_array(a){var n=a.length,state=[1732584193,-271733879,-1732584194,271733878],i,length,tail,tmp,lo,hi;for(i=64;i<=n;i+=64){md5cycle(state,md5blk_array(a.subarray(i-64,i)))}a=i-64<n?a.subarray(i-64):new Uint8Array(0);length=a.length;tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<length;i+=1){tail[i>>2]|=a[i]<<(i%4<<3)}tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(state,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=n*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(state,tail);return state}function rhex(n){var s="",j;for(j=0;j<4;j+=1){s+=hex_chr[n>>j*8+4&15]+hex_chr[n>>j*8&15]}return s}function hex(x){var i;for(i=0;i<x.length;i+=1){x[i]=rhex(x[i])}return x.join("")}if(hex(md51("hello"))!=="5d41402abc4b2a76b9719d911017c592"){add32=function(x,y){var lsw=(x&65535)+(y&65535),msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&65535}}if(typeof ArrayBuffer!=="undefined"&&!ArrayBuffer.prototype.slice){(function(){function clamp(val,length){val=val|0||0;if(val<0){return Math.max(val+length,0)}return Math.min(val,length)}ArrayBuffer.prototype.slice=function(from,to){var length=this.byteLength,begin=clamp(from,length),end=length,num,target,targetArray,sourceArray;if(to!==undefined){end=clamp(to,length)}if(begin>end){return new ArrayBuffer(0)}num=end-begin;target=new ArrayBuffer(num);targetArray=new Uint8Array(target);sourceArray=new Uint8Array(this,begin,num);targetArray.set(sourceArray);return target}})()}function toUtf8(str){if(/[\u0080-\uFFFF]/.test(str)){str=unescape(encodeURIComponent(str))}return str}function utf8Str2ArrayBuffer(str,returnUInt8Array){var length=str.length,buff=new ArrayBuffer(length),arr=new Uint8Array(buff),i;for(i=0;i<length;i+=1){arr[i]=str.charCodeAt(i)}return returnUInt8Array?arr:buff}function arrayBuffer2Utf8Str(buff){return String.fromCharCode.apply(null,new Uint8Array(buff))}function concatenateArrayBuffers(first,second,returnUInt8Array){var result=new Uint8Array(first.byteLength+second.byteLength);result.set(new Uint8Array(first));result.set(new Uint8Array(second),first.byteLength);return returnUInt8Array?result:result.buffer}function hexToBinaryString(hex){var bytes=[],length=hex.length,x;for(x=0;x<length-1;x+=2){bytes.push(parseInt(hex.substr(x,2),16))}return String.fromCharCode.apply(String,bytes)}function SparkMD5(){this.reset()}SparkMD5.prototype.append=function(str){this.appendBinary(toUtf8(str));return this};SparkMD5.prototype.appendBinary=function(contents){this._buff+=contents;this._length+=contents.length;var length=this._buff.length,i;for(i=64;i<=length;i+=64){md5cycle(this._hash,md5blk(this._buff.substring(i-64,i)))}this._buff=this._buff.substring(i-64);return this};SparkMD5.prototype.end=function(raw){var buff=this._buff,length=buff.length,i,tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ret;for(i=0;i<length;i+=1){tail[i>>2]|=buff.charCodeAt(i)<<(i%4<<3)}this._finish(tail,length);ret=hex(this._hash);if(raw){ret=hexToBinaryString(ret)}this.reset();return ret};SparkMD5.prototype.reset=function(){this._buff="";this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};SparkMD5.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}};SparkMD5.prototype.setState=function(state){this._buff=state.buff;this._length=state.length;this._hash=state.hash;return this};SparkMD5.prototype.destroy=function(){delete this._hash;delete this._buff;delete this._length};SparkMD5.prototype._finish=function(tail,length){var i=length,tmp,lo,hi;tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(this._hash,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=this._length*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(this._hash,tail)};SparkMD5.hash=function(str,raw){return SparkMD5.hashBinary(toUtf8(str),raw)};SparkMD5.hashBinary=function(content,raw){var hash=md51(content),ret=hex(hash);return raw?hexToBinaryString(ret):ret};SparkMD5.ArrayBuffer=function(){this.reset()};SparkMD5.ArrayBuffer.prototype.append=function(arr){var buff=concatenateArrayBuffers(this._buff.buffer,arr,true),length=buff.length,i;this._length+=arr.byteLength;for(i=64;i<=length;i+=64){md5cycle(this._hash,md5blk_array(buff.subarray(i-64,i)))}this._buff=i-64<length?new Uint8Array(buff.buffer.slice(i-64)):new Uint8Array(0);return this};SparkMD5.ArrayBuffer.prototype.end=function(raw){var buff=this._buff,length=buff.length,tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i,ret;for(i=0;i<length;i+=1){tail[i>>2]|=buff[i]<<(i%4<<3)}this._finish(tail,length);ret=hex(this._hash);if(raw){ret=hexToBinaryString(ret)}this.reset();return ret};SparkMD5.ArrayBuffer.prototype.reset=function(){this._buff=new Uint8Array(0);this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};SparkMD5.ArrayBuffer.prototype.getState=function(){var state=SparkMD5.prototype.getState.call(this);state.buff=arrayBuffer2Utf8Str(state.buff);return state};SparkMD5.ArrayBuffer.prototype.setState=function(state){state.buff=utf8Str2ArrayBuffer(state.buff,true);return SparkMD5.prototype.setState.call(this,state)};SparkMD5.ArrayBuffer.prototype.destroy=SparkMD5.prototype.destroy;SparkMD5.ArrayBuffer.prototype._finish=SparkMD5.prototype._finish;SparkMD5.ArrayBuffer.hash=function(arr,raw){var hash=md51_array(new Uint8Array(arr)),ret=hex(hash);return raw?hexToBinaryString(ret):ret};return SparkMD5});
...@@ -74,7 +74,7 @@ var mixin = { ...@@ -74,7 +74,7 @@ var mixin = {
}, },
} }
const URL = const URL =
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config' 'https://oss-config.dev.glsx.com.cn/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/task-config') => { const getConfig = (url = URL + '/task-config') => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
request({ url }).then((res) => { request({ url }).then((res) => {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div class="welcome-box"> <div class="welcome-box">
<div class="content"> <div class="content">
<div class="content-bg"> <div class="content-bg">
<!-- <input type="file" @change="uploadF" /> -->
<wTextarea <wTextarea
ref="textContent" ref="textContent"
v-model="textValue" v-model="textValue"
...@@ -274,8 +275,8 @@ ...@@ -274,8 +275,8 @@
type="file" type="file"
style="opacity: 0" style="opacity: 0"
:id="item.type + 'file'" :id="item.type + 'file'"
ref="file" ref="fileVideo"
class="welcome-input" class="welcome-input upload-video"
:accept="item.accept || 'video/*'" :accept="item.accept || 'video/*'"
@change="(e) => handleVideoChange(e)" @change="(e) => handleVideoChange(e)"
/> />
...@@ -331,6 +332,7 @@ const wordType = [ ...@@ -331,6 +332,7 @@ const wordType = [
'code', 'code',
] ]
import emoji from '../../utils/emo' import emoji from '../../utils/emo'
import upload from '../../utils/upload'
// import ActivityModel from './activityModel' // import ActivityModel from './activityModel'
// import MessageModel from './messageModel' // import MessageModel from './messageModel'
// import materialModel from './materialModel' // import materialModel from './materialModel'
...@@ -338,6 +340,8 @@ import Emotion from './emotionWords' ...@@ -338,6 +340,8 @@ import Emotion from './emotionWords'
import wTextarea from './tag-textarea' import wTextarea from './tag-textarea'
// import vuedraggable from 'vuedraggable' // import vuedraggable from 'vuedraggable'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import { set } from 'vue'
import { commonApi } from '../../api/commonApi'
export default { export default {
name: 'GLEditor', name: 'GLEditor',
components: { components: {
...@@ -363,9 +367,14 @@ export default { ...@@ -363,9 +367,14 @@ export default {
type: Object, type: Object,
default: () => ATT_TYPE, default: () => ATT_TYPE,
}, },
linkStatus: {
type: Boolean,
default: true,
},
}, },
data() { data() {
return { return {
uploadInfo: null,
textNum: 0, textNum: 0,
maxNum: 1000, maxNum: 1000,
myArr: [{ name: 888 }, { name: 888 }], myArr: [{ name: 888 }, { name: 888 }],
...@@ -386,7 +395,6 @@ export default { ...@@ -386,7 +395,6 @@ export default {
}, },
mounted() { mounted() {
if (this.previewList.length) { if (this.previewList.length) {
// this.updateList(this.previewList, 1)
this.previewList.map((item) => { this.previewList.map((item) => {
if (item.materialType == ATT_TYPE.TEXT) { if (item.materialType == ATT_TYPE.TEXT) {
this.textValue = this.changeText(item.materialContent) this.textValue = this.changeText(item.materialContent)
...@@ -437,6 +445,16 @@ export default { ...@@ -437,6 +445,16 @@ export default {
}, },
}, },
methods: { methods: {
uploadF(e) {
this.uploadInfo.clickEvent(e.srcElement.files)
},
resetItem() {
this.previewList = []
this.textValue = ''
setTimeout(() => {
if (this.linkStatus) this.handleFun({ type: 'link' })
})
},
isPreview(preview, type) { isPreview(preview, type) {
return type return type
? preview.filter((item) => item.materialType == type).length ? preview.filter((item) => item.materialType == type).length
...@@ -502,29 +520,23 @@ export default { ...@@ -502,29 +520,23 @@ export default {
}, },
// 上传图片 // 上传图片
handleImgChange(e) { handleImgChange(e) {
// 判断是否有链接
var materialFlag = this.previewList.some((item) => {
if (item.materialType == ATT_TYPE.LINK) {
return true
}
})
if (materialFlag) {
document.querySelector('.upload-img').value = ''
this.$message.error(
'为规范小程序显示样式,专属链接不能与图片或视频同时配置'
)
return
}
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '图片上传中,请稍后', message: '图片上传中,请稍后',
}) })
// let imgFlag = false
// this.previewList.map((item) => {
// if (
// item.materialType != ATT_TYPE.IMAGE &&
// item.materialType != ATT_TYPE.TEXT
// ) {
// imgFlag = true
// }
// return imgFlag
// })
// let newList = []
// if (imgFlag) {
// this.previewList.map((item, index) => {
// if (item.materialType == this.ATT_TYPE.TEXT) {
// newList.push(item)
// }
// })
// this.previewList = newList
// }
var reader = new FileReader() var reader = new FileReader()
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
// 默认1MB // 默认1MB
...@@ -592,65 +604,105 @@ export default { ...@@ -592,65 +604,105 @@ export default {
} }
} }
}, },
// 上传视频 getImgUrl(url, multiple = 3) {
async handleVideoChange(e) { return new Promise((resolve, reject) => {
// let videoFlag = false var canvas = document.createElement('canvas') // 获取 canvas 对象
// this.previewList.map((item) => { const ctx = canvas.getContext('2d') // 绘制2d
// if ( let video = document.getElementById('video')
// item.materialType != ATT_TYPE.VEDIO && video.src = url
// item.materialType != ATT_TYPE.TEXT video.crossOrigin = 'anonymous' // 解决跨域问题,也就是提示污染资源无法转换视频
// ) { video.currentTime = 1 // 第一帧
// videoFlag = true video.oncanplay = async () => {
// } canvas.width = video.clientWidth * multiple // 获取视频宽度
// return videoFlag canvas.height = video.clientHeight * multiple // 获取视频高度
// }) // 利用canvas对象方法绘图
// let newList = [] ctx.drawImage(
// if (videoFlag) { video,
// this.previewList.map((item, index) => { 0,
// if (item.materialType == this.ATT_TYPE.TEXT) { 0,
// newList.push(item) video.clientWidth * multiple,
// } video.clientHeight * multiple
// })
// this.previewList = newList
// }
var file
try {
file = await this.uploadFileVideo(e)
this.$notify({
title: '提示',
message: '视频上传中,请稍后',
})
if (this.videoList.togetherItem) {
this.previewList = this.previewFilter(
this.videoList.togetherItem,
ATT_TYPE.VEDIO
) )
console.log(canvas, 'canvas')
// 转换成base64形式
var oGrayImg = canvas.toDataURL('image/png') // 截取后的视频封面
const file = this.dataURLtoFile(oGrayImg)
const imgUrl = await this.uploadImg(file)
resolve(imgUrl)
} }
})
},
//将base64转换为文件
dataURLtoFile(dataurl, filename = '1.png') {
var arr = dataurl.split(','),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
return new File([u8arr], filename, { type: mime })
},
uploadImg(fileInfo) {
return new Promise((resolve, reject) => {
var reader = new FileReader() var reader = new FileReader()
reader.readAsDataURL(file) reader.readAsDataURL(fileInfo)
reader.onload = (e) => { reader.onload = (e) => {
const imgFile = e.target.result const imgFile = e.target.result
const arrBase64 = imgFile.split(',') const base64 =
const splitStr = file.name.split('.') fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1]
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1] commonApi.uploadImgApi({ file: base64 }).then((res) => {
// const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] resolve(res)
this.videoList.uploadApi({ file: fileUrl }).then((res) => { })
console.log(res) }
if (res) { })
this.$notify({ },
// 上传视频
async handleVideoChange(e) {
// 判断是否有链接
var materialFlag = this.previewList.some((item) => {
if (item.materialType == ATT_TYPE.LINK) {
return true
}
})
if (materialFlag) {
document.querySelector('.upload-video').value = ''
this.$message.error(
'为规范小程序显示样式,专属链接不能与图片或视频同时配置'
)
return
}
await this.uploadFileVideo(e)
const that = this
this.uploadInfo = new upload({
showprocess: true,
success: function (res) {
document.querySelector('.upload-video').value = ''
that.$notify({
title: '提示', title: '提示',
message: '视频上传成功', message: '视频上传成功',
type: 'success', type: 'success',
}) })
this.previewList.push({ that.previewList.push({
materialType: this.ATT_TYPE.VEDIO, materialType: that.ATT_TYPE.VEDIO,
materialContent: res.data.data, materialContent: res,
}) })
} that.$nextTick(() => {
const videoUrl = res
that.getImgUrl(videoUrl).then((res) => {
console.log(res, 'videoimg')
that.$emit('getVideoImg', res.data.data)
that.$emit('getEditor')
}) })
} })
} catch (err) {} },
})
this.$notify({
title: '提示',
message: '视频上传中,请稍后',
})
this.uploadInfo.clickEvent(e.srcElement.files)
}, },
// 上传链接弹框 // 上传链接弹框
handleLinkChange() { handleLinkChange() {
...@@ -688,7 +740,7 @@ export default { ...@@ -688,7 +740,7 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let file = e.srcElement.files[0] let file = e.srcElement.files[0]
// 默认10MB // 默认10MB
const limitSize = this.videoList.limitSize || 10 const limitSize = this.videoList.limitSize || 50
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) { if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!') _this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
...@@ -728,6 +780,21 @@ export default { ...@@ -728,6 +780,21 @@ export default {
}) })
}, },
handleFun(type) { handleFun(type) {
// 判断是否有图片或者视频
var materialFlag = this.previewList.some((item) => {
if (
item.materialType == ATT_TYPE.IMAGE ||
item.materialType == ATT_TYPE.VEDIO
) {
return true
}
})
if (materialFlag) {
this.$message.error(
'为规范小程序显示样式,专属链接不能与图片或视频同时配置'
)
return
}
const name = type.type const name = type.type
if (name == 'nickname') { if (name == 'nickname') {
this.$refs.textContent.addTag('@昵称') this.$refs.textContent.addTag('@昵称')
...@@ -743,13 +810,10 @@ export default { ...@@ -743,13 +810,10 @@ export default {
if (this.previewList.length) { if (this.previewList.length) {
let linkFlag = 0 let linkFlag = 0
this.previewList.map((item) => { this.previewList.map((item) => {
console.log(item)
if (item.materialType == this.ATT_TYPE.LINK) { if (item.materialType == this.ATT_TYPE.LINK) {
console.log(111)
linkFlag = linkFlag + 1 linkFlag = linkFlag + 1
} }
}) })
console.log(linkFlag, 'linkFlag')
if (linkFlag > 0) { if (linkFlag > 0) {
this.$message.warning('最多上传一条活动专属链接!') this.$message.warning('最多上传一条活动专属链接!')
return return
...@@ -760,7 +824,6 @@ export default { ...@@ -760,7 +824,6 @@ export default {
materialType: this.ATT_TYPE.LINK, materialType: this.ATT_TYPE.LINK,
materialContent: '#活动专属链接#', materialContent: '#活动专属链接#',
}) })
console.log(this.previewList)
} }
}, },
close(index) { close(index) {
......
...@@ -12,10 +12,10 @@ export const nearlyAMonth = { ...@@ -12,10 +12,10 @@ export const nearlyAMonth = {
let month = date.getMonth() + 1 let month = date.getMonth() + 1
let day = date.getDate() let day = date.getDate()
let aheadOfMonth = month == '1' ? '12' : month - 1 let aheadOfMonth = month == '1' ? '12' : month - 1
let preDays = this.mGetDate(year, aheadOfMonth)
if (aheadOfMonth == '12') { if (aheadOfMonth == '12') {
preYear = preYear - 1 preYear = preYear - 1
} }
let preDays = this.mGetDate(preYear, aheadOfMonth)
this.defalutEndTime = year + '-' + month + '-' + day this.defalutEndTime = year + '-' + month + '-' + day
if (day > preDays) { if (day > preDays) {
this.defalutStartTime = preYear + '-' + aheadOfMonth + '-' + preDays this.defalutStartTime = preYear + '-' + aheadOfMonth + '-' + preDays
......
<template> <template>
<el-form <el-form
size='small' size="small"
inline inline
ref='withdrawalForm' ref="withdrawalForm"
:model='profitSearchForm' :model="profitSearchForm"
label-width='120px' label-width="120px"
class='demo-form-inline' class="demo-form-inline"
> >
<el-form-item label='员工名称'> <el-form-item label="员工名称">
<el-input <el-input
clearable clearable
v-model='profitSearchForm.staffName' v-model="profitSearchForm.staffName"
placeholder='请输入员工名称' placeholder="请输入员工名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='员工手机号'> <el-form-item label="员工手机号">
<el-input <el-input
clearable clearable
v-model='profitSearchForm.staffPhone' v-model="profitSearchForm.staffPhone"
placeholder='请输入员工手机号' placeholder="请输入员工手机号"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='所属业务场景'> <el-form-item label="所属业务场景">
<el-select v-model='profitSearchForm.businessScene' placeholder='所属业务场景'> <el-select
<el-option label='全部' value=''></el-option> v-model="profitSearchForm.businessScene"
<el-option label='1.0 新车权益销售' value='0'></el-option> placeholder="所属业务场景"
<el-option label='1.1 次新车精品升级' value='1'></el-option> >
<el-option label='1.2 次新车线上转化' value='2'></el-option> <el-option label="全部" value=""></el-option>
<el-option label='1.3 存量用户众筹' value='3'></el-option> <el-option label="1.0 新车权益升级" value="0"></el-option>
<el-option label="1.1 新车精品升级" value="1"></el-option>
<el-option label="1.2 新车膨胀金活动" value="2"></el-option>
<el-option label="1.3 售后直播众筹活动" value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='所属商户:'> <el-form-item label="所属商户:">
<el-input <el-input
clearable clearable
v-model='profitSearchForm.merchantName' v-model="profitSearchForm.merchantName"
placeholder='请输入所属商户' placeholder="请输入所属商户"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='所属活动/产品:'> <el-form-item label="所属活动/产品:">
<el-input <el-input
clearable clearable
v-model='profitSearchForm.activityName' v-model="profitSearchForm.activityName"
placeholder='请输入所属活动/产品' placeholder="请输入所属活动/产品"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='发放渠道:'> <el-form-item label="发放渠道:">
<el-select v-model='profitSearchForm.channel' placeholder='请选择发放渠道'> <el-select
<el-option label='全部' value=''></el-option> v-model="profitSearchForm.channel"
<el-option label='广联' value='1'></el-option> placeholder="请选择发放渠道"
<el-option label='门店' value='2'></el-option> >
<el-option label='服务商' value='3'></el-option> <el-option label="全部" value=""></el-option>
<el-option label="广联" value="1"></el-option>
<el-option label="门店" value="2"></el-option>
<el-option label="服务商" value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='关联任务:'> <el-form-item label="关联任务:">
<el-input <el-input
clearable clearable
v-model='profitSearchForm.missionName' v-model="profitSearchForm.missionName"
placeholder='请输入关联任务' placeholder="请输入关联任务"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='奖励时间'> <el-form-item label="奖励时间">
<el-date-picker <el-date-picker
value-format='yyyy-MM-dd' value-format="yyyy-MM-dd"
v-model='profitSearchForm.rewardTime' v-model="profitSearchForm.rewardTime"
type='daterange' type="daterange"
range-separator='至' range-separator="至"
start-placeholder='开始日期' start-placeholder="开始日期"
end-placeholder='结束日期'> end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type='primary' @click='handleSearch' <el-button type="primary" @click="handleSearch">查询 </el-button>
>查询 <el-button @click="reset">重置</el-button>
</el-button
>
<el-button @click='reset'>重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
...@@ -83,12 +87,12 @@ ...@@ -83,12 +87,12 @@
import { nearlyAMonth } from '@/mixin/nearlyAMonth' import { nearlyAMonth } from '@/mixin/nearlyAMonth'
export default { export default {
name: 'ProfitSearch', name: 'ProfitSearch',
mixins:[nearlyAMonth], mixins: [nearlyAMonth],
data() { data() {
return { return {
profitSearchForm: { profitSearchForm: {
businessScene:'', businessScene: '',
channel:'' channel: '',
}, },
} }
}, },
...@@ -100,21 +104,25 @@ export default { ...@@ -100,21 +104,25 @@ export default {
Object.keys(this.profitSearchForm).forEach((key) => { Object.keys(this.profitSearchForm).forEach((key) => {
this.profitSearchForm[key] = '' this.profitSearchForm[key] = ''
}) })
this.$set(this.profitSearchForm, 'rewardTime', [this.defalutStartTime, this.defalutEndTime]) this.$set(this.profitSearchForm, 'rewardTime', [
this.defalutStartTime,
this.defalutEndTime,
])
this.$nextTick(() => { this.$nextTick(() => {
this.handleSearch() this.handleSearch()
}) })
} },
}, },
created() { created() {
this.$set(this.profitSearchForm, 'rewardTime', [this.defalutStartTime, this.defalutEndTime]) this.$set(this.profitSearchForm, 'rewardTime', [
this.defalutStartTime,
this.defalutEndTime,
])
}, },
mounted() { mounted() {
this.handleSearch() this.handleSearch()
} },
} }
</script> </script>
<style scoped> <style scoped></style>
</style>
<template> <template>
<div style='margin: 16px'> <div style="margin: 16px">
<ProfitSearch @sendSearchForm='getSearchForm' /> <ProfitSearch @sendSearchForm="getSearchForm" />
<el-button type='primary' size='small' @click='handleOutput'>导出</el-button> <el-button type="primary" size="small" @click="handleOutput"
<div class='cumulativeAward'>累计发放奖励:{{ totalScore }}</div> >导出</el-button
>
<div class="cumulativeAward">累计发放奖励:{{ totalScore }}</div>
<d2-table <d2-table
class='my-row-height' class="my-row-height"
ref='profitTable' ref="profitTable"
:hasNum='true' :hasNum="true"
@sendAlldata ='getTotalScore' @sendAlldata="getTotalScore"
:tableParams='profitTableParams' :tableParams="profitTableParams"
:searchForm='profitSearchForm' :searchForm="profitSearchForm"
:getListApi='getListApi' :getListApi="getListApi"
:pageConf='pageConf' :pageConf="pageConf"
> >
<div slot="businessScene" slot-scope="scope"> <div slot="businessScene" slot-scope="scope">
<span v-if="scope.scope.businessScene == '0'">1.0 新车权益销售</span> <span v-if="scope.scope.businessScene == '0'">1.0 新车权益升级</span>
<span v-if="scope.scope.businessScene == '1'">1.1 次新车精品升级</span> <span v-if="scope.scope.businessScene == '1'">1.1 新车精品升级</span>
<span v-if="scope.scope.businessScene == '2'">1.2 次新车线上转化</span> <span v-if="scope.scope.businessScene == '2'">1.2 新车膨胀金活动</span>
<span v-if="scope.scope.businessScene == '3'">1.3 存量用户众筹</span> <span v-if="scope.scope.businessScene == '3'"
>1.3 售后直播众筹活动</span
>
</div> </div>
<div slot="channel" slot-scope="scope"> <div slot="channel" slot-scope="scope">
<span v-if="scope.scope.channel == '1'">广联</span> <span v-if="scope.scope.channel == '1'">广联</span>
<span v-if="scope.scope.channel == '2'">门店</span> <span v-if="scope.scope.channel == '2'">门店</span>
<span v-if="scope.scope.channel == '3'">服务商</span> <span v-if="scope.scope.channel == '3'">服务商</span>
</div> </div>
</d2-table> </d2-table>
</div> </div>
</template> </template>
...@@ -37,16 +40,16 @@ import { profitApi } from '@/api/profitManagement' ...@@ -37,16 +40,16 @@ import { profitApi } from '@/api/profitManagement'
export default { export default {
name: 'WithdrawalSearch', name: 'WithdrawalSearch',
components: { components: {
ProfitSearch ProfitSearch,
}, },
data() { data() {
return { return {
profitSearchForm:{}, profitSearchForm: {},
totalScore: '', totalScore: '',
pageConf: { pageConf: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageNum: 'pageNum', pageNum: 'pageNum',
totalCount: 'data.count' totalCount: 'data.count',
}, },
getListApi: profitApi.searchProfitList, getListApi: profitApi.searchProfitList,
profitTableParams: { profitTableParams: {
...@@ -54,44 +57,44 @@ export default { ...@@ -54,44 +57,44 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '员工名称', label: '员工名称',
prop: 'staffName' prop: 'staffName',
}, },
{ {
label: '员工手机号', label: '员工手机号',
prop: 'staffPhone' prop: 'staffPhone',
}, },
{ {
label: '奖励积分值', label: '奖励积分值',
prop: 'rewardScore' prop: 'rewardScore',
}, },
{ {
label: '关联任务', label: '关联任务',
prop: 'missionName' prop: 'missionName',
}, },
{ {
label: '发放渠道', label: '发放渠道',
prop: 'channel', prop: 'channel',
addHtml: 'channel' addHtml: 'channel',
}, },
{ {
label: '所属活动/产品', label: '所属活动/产品',
prop: 'activityName' prop: 'activityName',
}, },
{ {
label: '所属商户', label: '所属商户',
prop: 'merchantName' prop: 'merchantName',
}, },
{ {
label: '所属业务场景', label: '所属业务场景',
prop: 'businessScene', prop: 'businessScene',
addHtml:'businessScene' addHtml: 'businessScene',
}, },
{ {
label: '奖励时间', label: '奖励时间',
prop: 'rewardTime' prop: 'rewardTime',
} },
] ],
} },
} }
}, },
methods: { methods: {
...@@ -99,41 +102,43 @@ export default { ...@@ -99,41 +102,43 @@ export default {
handleOutput() { handleOutput() {
let params = JSON.parse(JSON.stringify(this.profitSearchForm)) let params = JSON.parse(JSON.stringify(this.profitSearchForm))
let pageConfig = { let pageConfig = {
pageSize:9999,pageNum:1 pageSize: 9999,
pageNum: 1,
} }
profitApi.exportProfitList({...params,...pageConfig}).then(res => { profitApi.exportProfitList({ ...params, ...pageConfig }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.$Utils.exportFn(res.data) this.$Utils.exportFn(res.data)
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '导出失败!' message: '导出失败!',
}) })
} }
}) })
}, },
getSearchForm(val){ getSearchForm(val) {
let params = JSON.parse(JSON.stringify(val)) let params = JSON.parse(JSON.stringify(val))
if (params && params.rewardTime) { if (params && params.rewardTime) {
params.rewardBeginTime = params.rewardTime[0] params.rewardBeginTime = params.rewardTime[0]
params.rewardEndTime = params.rewardTime[1] params.rewardEndTime = params.rewardTime[1]
} }
if(params.rewardTime && params.rewardTime.length) delete params.rewardTime if (params.rewardTime && params.rewardTime.length)
delete params.rewardTime
this.profitSearchForm = params this.profitSearchForm = params
setTimeout(() =>{ setTimeout(() => {
this.$refs.profitTable.refreshTable(false,true) this.$refs.profitTable.refreshTable(false, true)
},500) }, 500)
}, },
getTotalScore(val){ getTotalScore(val) {
let {totalScore} = val let { totalScore } = val
this.totalScore = totalScore this.totalScore = totalScore
} },
}, },
} }
</script> </script>
<style scoped> <style scoped>
.cumulativeAward{ .cumulativeAward {
margin: 16px 0; margin: 16px 0;
} }
.my-row-height >>> .el-table__body-wrapper .el-table__row { .my-row-height >>> .el-table__body-wrapper .el-table__row {
......
...@@ -101,15 +101,12 @@ export default { ...@@ -101,15 +101,12 @@ export default {
item.startTime = dayjs(item.startTime).format('YYYY-MM-DD') item.startTime = dayjs(item.startTime).format('YYYY-MM-DD')
item.endTime = dayjs(item.endTime).format('YYYY-MM-DD') item.endTime = dayjs(item.endTime).format('YYYY-MM-DD')
if (this.isClone) { if (this.isClone) {
console.log(this.taskDateNum)
let activityDays = this.getDateByDays(item.startTime, item.endTime) let activityDays = this.getDateByDays(item.startTime, item.endTime)
if (activityDays != this.taskDateNum) { if (activityDays != this.taskDateNum) {
item.taskStatus = 1 item.taskStatus = 1
} }
} }
}) })
console.log(this.activityData, 'this.activityData')
}) })
}, },
// 根据日期获取天数 // 根据日期获取天数
...@@ -121,12 +118,10 @@ export default { ...@@ -121,12 +118,10 @@ export default {
return day return day
}, },
handleSelectItem(item) { handleSelectItem(item) {
console.log(item)
this.selectItem = item this.selectItem = item
}, },
// 确认活动 // 确认活动
confirmActivity() { confirmActivity() {
console.log(11)
if (!this.selectItem.id) { if (!this.selectItem.id) {
this.$message({ this.$message({
message: '请选择活动', message: '请选择活动',
......
<template> <template>
<div> <div>
<div class='taskDetails' v-for='(item,index) in taskDetails' :key='index'> <div class="taskDetails" v-for="(item, index) in taskDetails" :key="index">
<div class='leftContent'> <div class="leftContent">
<p>{{ item.missonTypeName }}</p> <p>{{ item.missonTypeName }}</p>
<p>{{ item.missionName }}</p> <p>{{ item.missionName }}</p>
<p>{{ item.missonDesc }}</p> <p>{{ item.missonDesc }}</p>
<template v-if='item.platformMerchantMissionMaterialResponseList && item.platformMerchantMissionMaterialResponseList.length'> <template
<div v-for='(sub,idx,) in item.platformMerchantMissionMaterialResponseList' :key='idx'> v-if="
item.platformMerchantMissionMaterialResponseList &&
item.platformMerchantMissionMaterialResponseList.length
"
>
<div
v-for="(
sub, idx
) in item.platformMerchantMissionMaterialResponseList"
:key="idx"
>
<template v-if="sub.materialType == '1'"> <template v-if="sub.materialType == '1'">
<p v-html='tramWord(sub.materialContent)'></p> <p v-html="tramWord(sub.materialContent)"></p>
</template> </template>
<template v-if="sub.materialType == '2'"> <template v-if="sub.materialType == '2'">
<img class='displayImg' :src='sub.materialContent'> <img class="displayImg" :src="sub.materialContent" />
</template> </template>
<template v-if="sub.materialType == '3'"> <template v-if="sub.materialType == '3'">
<video class='displayImg' :src='sub.materialContent' /> <video class="displayImg" controls='controls' :src="sub.materialContent" />
</template> </template>
<template v-if="sub.materialType == '4'"> <template v-if="sub.materialType == '4'">
<p class='content'>{{sub.materialContent}}</p> <p class="content">{{ sub.materialContent }}</p>
</template> </template>
</div> </div>
</template> </template>
<div class='taskAward'> <div class="taskAward">
<div class='showInfoForm'> <div class="showInfoForm">
<span v-if='item.rewardTypeName'>奖励模式:{{ item.rewardTypeName }}</span> <span v-if="item.rewardTypeName"
<span v-if='item.rewardCountName'>奖励次数:{{ item.rewardCountName }}</span> >奖励模式:{{ item.rewardTypeName }}</span
>
<span v-if="item.rewardCountName"
>奖励次数:{{ item.rewardCountName }}</span
>
<span v-if="item.rewardCountName == '重复累计'"> <span v-if="item.rewardCountName == '重复累计'">
重复次数:{{ item.repeatCount == '-1' ? '无限制' : item.repeatCount }} 重复次数:{{
item.repeatCount == '-1' ? '无限制' : item.repeatCount
}}
</span> </span>
<span v-if='item.triggerValue'>触发值:{{ item.triggerValue }}</span> <span v-if="item.sharingMethod"
<span v-if='item.rewardScore'>奖励积分值:{{ item.rewardScore }}</span> >分享模式:{{ item.sharingMethod == '1'?'微信群发': item.sharingMethod == '2'? '分享好友' :item.sharingMethod == '3'?'分享朋友圈' :''}}</span
>
<span v-if="item.triggerValue"
>触发值:{{ item.triggerValue }}</span
>
<span v-if="item.rewardScore"
>奖励积分值:{{ item.rewardScore }}</span
>
<span v-if="item.minTriggerValue"
>最低指标:{{ item.minTriggerValue }}</span
>
</div> </div>
</div> </div>
</div> </div>
<div v-if="item.missonType != '1'" class='copyLine' id='copy' v-on:click='copy(item.id)'> <div
v-if="item.missonType != '1'"
class="copyLine"
id="copy"
v-on:click="copy(item.id)"
>
复制任务提醒链接 复制任务提醒链接
</div> </div>
</div> </div>
...@@ -48,15 +79,17 @@ export default { ...@@ -48,15 +79,17 @@ export default {
props: { props: {
taskDetails: { taskDetails: {
type: Array, type: Array,
default: [] default: [],
} },
}, },
data() { data() {
return {} return {}
}, },
methods: { methods: {
tramWord(val) { tramWord(val) {
let htm = val.replace(/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi, function(res) { let htm = val.replace(
/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi,
function (res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
...@@ -66,11 +99,14 @@ export default { ...@@ -66,11 +99,14 @@ export default {
index = '0' + index index = '0' + index
} }
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">` return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
}) }
)
return htm return htm
}, },
async copy(id) { async copy(id) {
await taskManagementApi.getStaffMissionLink({ missionId: id }).then(res => { await taskManagementApi
.getStaffMissionLink({ missionId: id })
.then((res) => {
if (res.code == '0' && res.data) { if (res.code == '0' && res.data) {
var input = document.createElement('input') var input = document.createElement('input')
input.value = res.data input.value = res.data
...@@ -83,8 +119,8 @@ export default { ...@@ -83,8 +119,8 @@ export default {
this.$message.error('复制失败!') this.$message.error('复制失败!')
} }
}) })
} },
} },
} }
</script> </script>
...@@ -97,10 +133,10 @@ export default { ...@@ -97,10 +133,10 @@ export default {
padding: 20px; padding: 20px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.leftContent{ .leftContent {
width: 70%; width: 70%;
} }
.content{ .content {
height: auto; height: auto;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
...@@ -110,7 +146,6 @@ export default { ...@@ -110,7 +146,6 @@ export default {
justify-content: space-between; justify-content: space-between;
} }
.showInfoForm { .showInfoForm {
margin-top: 10px; margin-top: 10px;
width: 700px; width: 700px;
...@@ -122,10 +157,10 @@ export default { ...@@ -122,10 +157,10 @@ export default {
width: 50%; width: 50%;
} }
.copyLine { .copyLine {
color: #409EFF; color: #409eff;
cursor: pointer; cursor: pointer;
} }
.displayImg{ .displayImg {
width: 500px; width: 500px;
height: 300px; height: 300px;
} }
......
<template> <template>
<div class='taskPlan'> <div class="taskPlan">
<div class='headline'>任务计划</div> <div class="headline">任务计划</div>
<el-tabs v-model='activeName' type='card'> <el-tabs v-model="activeName" type="card">
<el-tab-pane v-for='(item,index) in taskPlanList' :key='index' <el-tab-pane
:label="item.activityTime =='-1'?'完整周期' : item.activityTime" :name='item.activityTime'> v-for="(item, index) in taskPlanList"
<div class='taskInfo' v-for='(displayList,idx) in item.platformMerchantMissionResponseList' :key='idx'> :key="index"
<p class='taskType'>{{ displayList.missonTypeName }}</p> :label="item.activityTime == '-1' ? '完整周期' : item.activityTime"
:name="item.activityTime"
>
<div
class="taskInfo"
v-for="(displayList, idx) in item.platformMerchantMissionResponseList"
:key="idx"
>
<p class="taskType">{{ displayList.missonTypeName }}</p>
<p>{{ displayList.missionName }}</p> <p>{{ displayList.missionName }}</p>
<p>{{ displayList.missonDesc }}</p> <p>{{ displayList.missonDesc }}</p>
<template <template
v-if='displayList.platformMerchantMissionMaterialResponseList && displayList.platformMerchantMissionMaterialResponseList.length'> v-if="
<div v-for='(sub,idx,) in displayList.platformMerchantMissionMaterialResponseList' :key='idx'> displayList.platformMerchantMissionMaterialResponseList &&
displayList.platformMerchantMissionMaterialResponseList.length
"
>
<div
v-for="(
sub, idx
) in displayList.platformMerchantMissionMaterialResponseList"
:key="idx"
>
<template v-if="sub.materialType == '1'"> <template v-if="sub.materialType == '1'">
<p v-html='tramWord(sub.materialContent)'></p> <p v-html="tramWord(sub.materialContent)"></p>
</template> </template>
<template v-if="sub.materialType == '2'"> <template v-if="sub.materialType == '2'">
<img class='displayImg' :src='sub.materialContent'> <img class="displayImg" :src="sub.materialContent" />
</template> </template>
<template v-if="sub.materialType == '3'"> <template v-if="sub.materialType == '3'">
<video class='displayImg' :src='sub.materialContent' /> <video class="displayImg" controls='controls' :src="sub.materialContent" />
</template> </template>
<template v-if="sub.materialType == '4'"> <template v-if="sub.materialType == '4'">
<p>{{ sub.materialContent }}</p> <p>{{ sub.materialContent }}</p>
</template> </template>
</div> </div>
</template> </template>
<div class='showInfoForm'> <div class="showInfoForm">
<span v-if='displayList.rewardTypeName'>奖励模式:{{ displayList.rewardTypeName }}</span> <span v-if="displayList.rewardTypeName"
<span v-if='displayList.rewardCountName'>奖励次数:{{ displayList.rewardCountName }}</span> >奖励模式:{{ displayList.rewardTypeName }}</span
>
<span v-if="displayList.rewardCountName"
>奖励次数:{{ displayList.rewardCountName }}</span
>
<span v-if="displayList.rewardCountName == '重复累计'"> <span v-if="displayList.rewardCountName == '重复累计'">
重复次数:{{ displayList.repeatCount == '-1' ? '无限制' : displayList.repeatCount }} 重复次数:{{
displayList.repeatCount == '-1'
? '无限制'
: displayList.repeatCount
}}
</span> </span>
<span v-if='displayList.triggerValue'>触发值:{{ displayList.triggerValue }}</span> <span v-if="displayList.sharingMethod"
<span v-if='displayList.rewardScore'>奖励积分值:{{ displayList.rewardScore }}</span> >分享模式:{{ displayList.sharingMethod == '1'?'微信群发': displayList.sharingMethod == '2'? '分享好友' :displayList.sharingMethod == '3'?'分享朋友圈' :''}}</span
>
<span v-if="displayList.triggerValue"
>触发值:{{ displayList.triggerValue }}</span
>
<span v-if="displayList.rewardScore"
>奖励积分值:{{ displayList.rewardScore }}</span
>
<span v-if="displayList.minTriggerValue"
>最低指标:{{ displayList.minTriggerValue }}</span
>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
...@@ -49,29 +84,31 @@ export default { ...@@ -49,29 +84,31 @@ export default {
props: { props: {
taskPlanList: { taskPlanList: {
type: Array, type: Array,
default: [] default: [],
} },
}, },
data() { data() {
return { return {
activeName: '' activeName: '',
} }
}, },
watch: { watch: {
taskPlanList:{ taskPlanList: {
handler(newVal,oldVal){ handler(newVal, oldVal) {
if (!oldVal || newVal !== oldVal) { if (!oldVal || newVal !== oldVal) {
this.activeName = newVal && newVal[0].activityTime this.activeName = newVal && newVal[0].activityTime
this.taskPlanList = newVal this.taskPlanList = newVal
} }
}, },
immediate: true, immediate: true,
deep: true deep: true,
}
}, },
methods:{ },
methods: {
tramWord(val) { tramWord(val) {
let htm = val.replace(/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi, function(res) { let htm = val.replace(
/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi,
function (res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
...@@ -81,15 +118,16 @@ export default { ...@@ -81,15 +118,16 @@ export default {
index = '0' + index index = '0' + index
} }
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">` return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
}) }
)
return htm return htm
}, },
} },
} }
</script> </script>
<style scoped> <style scoped>
.taskPlan{ .taskPlan {
margin-top: 20px; margin-top: 20px;
} }
.headline { .headline {
...@@ -98,7 +136,7 @@ export default { ...@@ -98,7 +136,7 @@ export default {
} }
.taskInfo { .taskInfo {
border: 1px solid #E4E7ED; border: 1px solid #e4e7ed;
padding-left: 20px; padding-left: 20px;
padding-right: 20px; padding-right: 20px;
margin-bottom: 16px; margin-bottom: 16px;
...@@ -110,7 +148,7 @@ export default { ...@@ -110,7 +148,7 @@ export default {
.displayImg { .displayImg {
width: 500px; width: 500px;
height: 300px height: 300px;
} }
.showInfoForm { .showInfoForm {
......
...@@ -59,10 +59,14 @@ ...@@ -59,10 +59,14 @@
:pageConf="pageConf" :pageConf="pageConf"
> >
<div slot="businessScene" slot-scope="scope"> <div slot="businessScene" slot-scope="scope">
<span v-if="scope.scope.businessScene == 0">1.0新车权益销售</span> <span v-if="scope.scope.businessScene == 0">1.0 新车权益升级</span>
<span v-if="scope.scope.businessScene == 1">1.1次新车精品升级</span> <span v-if="scope.scope.businessScene == 1">1.1 新车精品升级</span>
<span v-if="scope.scope.businessScene == 2">1.2次新车线上转化</span> <span v-if="scope.scope.businessScene == 2"
<span v-if="scope.scope.businessScene == 3">1.3存量用户众筹</span> >1.2 次新车膨胀金活动</span
>
<span v-if="scope.scope.businessScene == 3"
>1.3 售后直播众筹活动</span
>
</div> </div>
<div slot="activityStatus" slot-scope="scope"> <div slot="activityStatus" slot-scope="scope">
<span v-if="scope.scope.activityStatus == statusNum.UNPUBLISH" <span v-if="scope.scope.activityStatus == statusNum.UNPUBLISH"
...@@ -78,7 +82,7 @@ ...@@ -78,7 +82,7 @@
<template slot="auth-button" slot-scope="scope"> <template slot="auth-button" slot-scope="scope">
<el-button <el-button
type="text" type="text"
v-if="scope.scope.activityStatus == statusNum.UNPUBLISH" v-if="scope.scope.activityStatus != statusNum.FINISHIED"
@click="handleEdit(scope.scope, 1)" @click="handleEdit(scope.scope, 1)"
>编辑</el-button >编辑</el-button
> >
...@@ -128,19 +132,19 @@ const sceneOption = [ ...@@ -128,19 +132,19 @@ const sceneOption = [
value: '', value: '',
}, },
{ {
label: '1.0新车权益销售', label: '1.0 新车权益升级',
value: '0', value: '0',
}, },
{ {
label: '1.1次新车精品升级', label: '1.1 新车精品升级',
value: '1', value: '1',
}, },
{ {
label: '1.2次新车线上转化', label: '1.2 次新车膨胀金活动',
value: '2', value: '2',
}, },
{ {
label: '1.3存量用户众筹', label: '1.3 售后直播众筹活动',
value: '3', value: '3',
}, },
] ]
......
<template> <template>
<div style='margin: 16px'> <div style="margin: 16px">
<el-form <el-form
size='small' size="small"
inline inline
ref='withdrawalForm' ref="withdrawalForm"
:model='withdrawalSearchForm' :model="withdrawalSearchForm"
label-width='100px' label-width="100px"
class='demo-form-inline' class="demo-form-inline"
> >
<el-form-item label='员工名称'> <el-form-item label="员工名称">
<el-input <el-input
clearable clearable
v-model='withdrawalSearchForm.staffName' v-model="withdrawalSearchForm.staffName"
placeholder='请输入员工名称' placeholder="请输入员工名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='员工手机号'> <el-form-item label="员工手机号">
<el-input <el-input
clearable clearable
v-model='withdrawalSearchForm.staffPhone' v-model="withdrawalSearchForm.staffPhone"
placeholder='请输入员工手机号' placeholder="请输入员工手机号"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='状态'> <el-form-item label="门店名称">
<el-select v-model='withdrawalSearchForm.status' placeholder='请选择状态'> <el-input
<el-option label='全部' value=''></el-option> clearable
<el-option label='待审核' value='1'></el-option> v-model="withdrawalSearchForm.merchantName"
<el-option label='到账中' value='2'></el-option> placeholder="请输入门店名称"
<el-option label='已到账' value='3'></el-option> ></el-input>
<el-option label='到账失败' value='4'></el-option> </el-form-item>
<el-form-item label="状态">
<el-select
v-model="withdrawalSearchForm.status"
placeholder="请选择状态"
>
<el-option label="全部" value=""></el-option>
<el-option label="待审核" value="1"></el-option>
<el-option label="到账中" value="2"></el-option>
<el-option label="已到账" value="3"></el-option>
<el-option label="到账失败" value="4"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='提现时间'> <el-form-item label="提现时间">
<el-date-picker <el-date-picker
value-format='yyyy-MM-dd' value-format="yyyy-MM-dd"
v-model='withdrawalSearchForm.withdrawalTime' v-model="withdrawalSearchForm.withdrawalTime"
type='daterange' type="daterange"
range-separator='至' range-separator="至"
start-placeholder='开始日期' start-placeholder="开始日期"
end-placeholder='结束日期'> end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label='审核时间'> <el-form-item label="审核时间">
<el-date-picker <el-date-picker
value-format='yyyy-MM-dd' value-format="yyyy-MM-dd"
v-model='withdrawalSearchForm.reviewTime' v-model="withdrawalSearchForm.reviewTime"
type='daterange' type="daterange"
range-separator='至' range-separator="至"
start-placeholder='开始日期' start-placeholder="开始日期"
end-placeholder='结束日期'> end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type='primary' <el-button type="primary" @click="handleSearch">查询 </el-button>
@click='handleSearch' <el-button @click="reset">重置</el-button>
>查询
</el-button
>
<el-button @click='reset'>重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -72,12 +80,15 @@ export default { ...@@ -72,12 +80,15 @@ export default {
data() { data() {
return { return {
withdrawalSearchForm: { withdrawalSearchForm: {
status:'' status: '',
} },
} }
}, },
created() { created() {
this.$set(this.withdrawalSearchForm, 'withdrawalTime', [this.defalutStartTime, this.defalutEndTime]) this.$set(this.withdrawalSearchForm, 'withdrawalTime', [
this.defalutStartTime,
this.defalutEndTime,
])
}, },
mounted() { mounted() {
this.handleSearch() this.handleSearch()
...@@ -90,15 +101,16 @@ export default { ...@@ -90,15 +101,16 @@ export default {
Object.keys(this.withdrawalSearchForm).forEach((key) => { Object.keys(this.withdrawalSearchForm).forEach((key) => {
this.withdrawalSearchForm[key] = '' this.withdrawalSearchForm[key] = ''
}) })
this.$set(this.withdrawalSearchForm, 'withdrawalTime', [this.defalutStartTime, this.defalutEndTime]) this.$set(this.withdrawalSearchForm, 'withdrawalTime', [
this.defalutStartTime,
this.defalutEndTime,
])
this.$nextTick(() => { this.$nextTick(() => {
this.handleSearch() this.handleSearch()
}) })
} },
} },
} }
</script> </script>
<style scoped> <style scoped></style>
</style>
<template> <template>
<d2-table <d2-table
class='my-row-height' class="my-row-height"
ref='withdrawalTable' ref="withdrawalTable"
:hasNum='true' :hasNum="true"
:tableParams='withdrawalTableParams' :tableParams="withdrawalTableParams"
:searchForm='searchForm' :searchForm="searchForm"
:getListApi='getListApi' :getListApi="getListApi"
:pageConf='pageConf' :pageConf="pageConf"
@sendAlldata = 'getAmountCollection' @sendAlldata="getAmountCollection"
> >
<div slot="status" slot-scope="scope"> <div slot="status" slot-scope="scope">
<span v-if="scope.scope.status == '1'">待审核</span> <span v-if="scope.scope.status == '1'">待审核</span>
...@@ -22,18 +22,18 @@ ...@@ -22,18 +22,18 @@
import { withdrawalApi } from '@/api/withdrawalManagement' import { withdrawalApi } from '@/api/withdrawalManagement'
export default { export default {
name: 'WithdrawalTable', name: 'WithdrawalTable',
props:{ props: {
searchForm:{ searchForm: {
type:Object, type: Object,
default:{} default: {},
} },
}, },
data() { data() {
return { return {
pageConf: { pageConf: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageNum: 'pageNum', pageNum: 'pageNum',
totalCount: 'data.count' totalCount: 'data.count',
}, },
withdrawalTableParams: { withdrawalTableParams: {
mutiSelectUniqueKey: 'id', mutiSelectUniqueKey: 'id',
...@@ -42,66 +42,82 @@ export default { ...@@ -42,66 +42,82 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '员工名称', label: '员工名称',
prop: 'staffName' prop: 'staffName',
}, },
{ {
label: '员工手机号', label: '员工手机号',
prop: 'staffPhone' prop: 'staffPhone',
},
{
label: '门店名称',
prop: 'merchantName',
}, },
{ {
label: '积分值', label: '积分值',
prop: 'withdrawalScore' prop: 'withdrawalScore',
}, },
{ {
label: '提现金额(元)', label: '提现金额(元)',
prop: 'withdrawalAmount' prop: 'withdrawalAmount',
}, },
{ {
label: '提现时间', label: '提现时间',
prop: 'withdrawalTime' prop: 'withdrawalTime',
}, },
{ {
label: '微信昵称', label: '微信昵称',
prop: 'wechatNickName' prop: 'wechatNickName',
}, },
{ {
label: '微信手机号', label: '微信手机号',
prop: 'wechatPhone' prop: 'wechatPhone',
}, },
{ {
label: '微信openid', label: '微信openid',
prop: 'wechatOpenId' prop: 'wechatOpenId',
}, },
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
addHtml:'status' addHtml: 'status',
}, },
{ {
label: '审核人', label: '审核人',
prop: 'reviewer' prop: 'reviewer',
}, },
{ {
label: '审核时间', label: '审核时间',
prop: 'reviewTime' prop: 'reviewTime',
}, },
{ {
label: '到账时间', label: '到账时间',
prop: 'successTime' prop: 'successTime',
} },
] ],
}, },
getListApi: withdrawalApi.withdrawalListApi, getListApi: withdrawalApi.withdrawalListApi,
} }
}, },
methods:{ methods: {
getAmountCollection(val){ getAmountCollection(val) {
let {receivedAmount,receivingAmount,reviewingAmount,totalAmount,failureAmount} =val let {
let amountCollection = {receivedAmount,receivingAmount,reviewingAmount,totalAmount,failureAmount} receivedAmount,
this.$emit('sendCollection',amountCollection) receivingAmount,
} reviewingAmount,
} totalAmount,
failureAmount,
} = val
let amountCollection = {
receivedAmount,
receivingAmount,
reviewingAmount,
totalAmount,
failureAmount,
} }
this.$emit('sendCollection', amountCollection)
},
},
}
</script> </script>
<style scoped> <style scoped>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!