12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573 |
- <style lang="scss">
- .display-none-selset {
- display: none !important;
- }
- .chouzhen span {
- display: inline-block;
- }
- .check-video .ant-tabs-nav-container {
- text-align: center;
- font-size: 20px;
- }
- .step3-image {
- span {
- padding: 0;
- }
- .ant-checkbox {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 100;
- }
- }
- .step3-modal {
- .ant-checkbox {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 100;
- }
- }
- .onlny-click-track {
- .ant-list-item-content {
- width: 60%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .sticker-styles .ant-radio-wrapper {
- margin-right: 0;
- }
- </style>
- <style scoped lang="scss">
- .actor-photo-list {
- display: flex;
- padding-left: 0;
- li {
- width: 20%;
- margin: 10px;
- position: relative;
- height: 380px;
- border: 1px solid #f2f2f2;
- list-style: none;
- img,
- video {
- width: 100%;
- }
- }
- }
- .chouzhen {
- border-style: solid;
- border-width: 1px;
- border-color: #e4e4e4;
- width: calc(20% - 10px);
- padding: 10px;
- margin-right: 10px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- background: #fff;
- position: relative;
- z-index: 99;
- float: left;
- }
- li.chouzhen.first:before {
- font-size: 12px;
- content: '首帧';
- position: absolute;
- top: 7px;
- left: 5px;
- width: 36px;
- height: 20px;
- color: rgb(255, 255, 255);
- line-height: 20px;
- text-align: center;
- background: rgba(0, 0, 0, 0.5);
- border-radius: 2px;
- z-index: 1000;
- }
- .actor-photo-list {
- display: flex;
- padding-left: 0;
- li {
- width: 25%;
- margin: 10px;
- position: relative;
- height: 250px;
- border: 1px solid #f2f2f2;
- list-style: none;
- img,
- video {
- width: 100%;
- margin-top: auto;
- margin-bottom: auto;
- top: 0;
- bottom: 0;
- position: absolute;
- max-height: 250px;
- }
- }
- }
- </style>
- <template>
- <a-card :body-style="{ padding: '24px 32px' }" :bordered="false" class="only-step3">
- <a-tabs style="width: 50%; margin: 0 auto" type="editable-card" hideAdd @edit="remove">
- <a-tab-pane
- v-for="(pane, bestIndex) in pans"
- :tab="pane.tab"
- :key="pane.key"
- v-model="pansKey"
- disabled
- :closable="pane.closable"
- class="shishishis"
- >
- <a-form @submit="handleSubmit" :form="form" style="margin-top: 20px" :hideRequiredMark="true">
- <a-form-item label="广告组名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input v-model="pane.tab" readOnly></a-input>
- </a-form-item>
- <!-- <a-form-item label="素材同步" :labelCol="labelCol" :wrapperCol="wrapperCol">
-
- </a-form-item> -->
- <a-form-item
- label="创意内容"
- :labelCol="labelCol"
- v-if="
- pane.sceneId.indexOf(5) >= 0 ||
- pane.sceneId.indexOf(1) >= 0 ||
- pane.sceneId.indexOf(7) >= 0 ||
- pane.sceneId.indexOf(6) >= 0
- "
- >
- <a-layout>
- <a-layout-content style="padding: 10px">
- <a-row>
- <a-col :span="24" v-for="(item, index) of pane.list" :key="index">
- <a-card title :ref="item">
- <a-icon
- type="close"
- style="float: right; cursor: pointer"
- @click="deleteCreative(bestIndex, index)"
- />
- <div style="clear: both"></div>
- <a-form-item label="素材类型">
- <a-radio-group
- buttonStyle="solid"
- v-model="item.creativeMaterialType"
- @change="changeType(item)"
- >
- <a-radio-button value="1">竖版视频</a-radio-button>
- <a-radio-button value="2">横版视频</a-radio-button>
- <!-- <a-radio-button value="4" v-if="JSON.parse(pane.sceneId).indexOf(7)>0">便利贴创意</a-radio-button> -->
- </a-radio-group>
- </a-form-item>
- <div class="dynamically_add_form_item">
- <a-form-item label="" v-if="getData('creativeMaterialType') != '4'">
- <a @click="getVideoList('video', index, item, bestIndex)">选择视频</a>
- <a @click="uploadVideo(index, bestIndex, item)" style="margin-left: 10px">上传视频</a>
- <br />
- <video
- :src="item.videoList.url"
- controls="controls"
- style="width: 25%"
- v-if="item.videoList"
- ></video>
- </a-form-item>
- <div class="downLoad" style="overflow: auto">
- <ul
- class="actor-photo-list step3-image"
- :style="{
- width: item.imageUrlList.length > 4 ? 25 * item.imageUrlList.length + '%' : '100%',
- }"
- v-if="item.imageUrlList.length > 0"
- >
- <a-checkbox-group
- v-model="item.checkArrImage"
- style="width: 100%; display: flex; padding-left: 0"
- @change="onChangeCheckImage"
- >
- <li v-for="(item, index) of item.imageUrlList" :key="index">
- <a-checkbox :value="item.code" style="height: 100%; width: 100%">
- <img class="video" :src="item.url" />
- </a-checkbox>
- </li>
- </a-checkbox-group>
- </ul>
- </div>
- <a-form-item label="">
- <a @click="getVideoList('image', index, item, bestIndex)">选择封面</a>
- <a @click="uploadImages(index, bestIndex, item)" style="margin-left: 10px">上传封面</a>
- <a @click="showImages(index, bestIndex)" v-if="item.chouzhenShow" style="margin-left: 10px"
- >推荐封面</a
- >
- <br />
- <span v-for="(item, deleteIndex) of item.imageList" style="position: relative">
- <img :src="item.url" style="width: 18%; margin: 1%" :key="item.url" />
- <a-icon
- type="close-circle"
- @click="deleteData(index, bestIndex, deleteIndex)"
- style="position: absolute; right: 0px"
- />
- </span>
- </a-form-item>
- <a-form-item label="" v-if="getData('creativeMaterialType') != '4' && stickerStyles.length > 0">
- <a @click="getCoverUrl(index, item, bestIndex)">封面贴纸</a>
- <br />
- <span style="position: relative; display: block; width: 25%" v-if="item.coverUrl">
- <img :src="showStickerStyles(item.coverUrl)" style="width: 100%" />
- <a-icon
- type="close-circle"
- @click="deleteCover(index, bestIndex)"
- style="position: absolute; right: -10px; top: -10px"
- />
- </span>
- </a-form-item>
- <a-form-item label="贴纸广告语" v-if="item.coverUrl">
- <a-textarea
- placeholder="请输入贴纸广告语"
- v-model.trim="item.coverSlogans"
- :autosize="{ minRows: 2, maxRows: 2 }"
- :max-length="14"
- ></a-textarea>
- <p
- style="
- font-size: 12px;
- color: #b6bbc7;
- letter-spacing: 0.3px;
- text-align: right;
- line-height: 20px;
- position: absolute;
- bottom: 0;
- right: 6px;
- width: 100%;
- margin-bottom: 0;
- "
- >
- {{ item.coverSlogans.length + '/14' }}
- </p>
- </a-form-item>
- <a-form-item label="广告语">
- <a @click="showTitle(index, bestIndex)">推荐广告语</a>
- <div
- class="step4-else"
- style="
- display: inline-block;
- position: relative;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- width: 100%;
- "
- >
- <a-textarea
- class="rending"
- placeholder="请输入广告语"
- v-model.trim="item.description"
- :autosize="{ minRows: 2, maxRows: 6 }"
- :max-length="30"
- ></a-textarea>
- <p
- style="
- font-size: 12px;
- color: #b6bbc7;
- letter-spacing: 0.3px;
- text-align: right;
- line-height: 20px;
- position: absolute;
- bottom: 0;
- right: 6px;
- width: 100%;
- margin-bottom: 0;
- "
- >
- {{ item.description.length + '/30' }}
- </p>
- </div>
- <!-- <a-textarea
- class="rending"
- placeholder="请输入广告语"
- v-model.trim="item.description"
- :autosize="{ minRows: 2, maxRows: 6 }"
- ></a-textarea>
- <span v-if="item.description.length > 30" style="color: red">广告语长度不能超过30个字符</span> -->
- <br />
- <a @click="cunTitle(index, bestIndex)">收藏</a>
- <a @click="showCunTitle(index, bestIndex)" style="margin-left: 10px">收藏列表</a>
- <br />
- <a-tag
- v-for="(itemTag, indexTag) of tags"
- :key="indexTag"
- @click="getChange(item, itemTag, index)"
- >{{ itemTag.name }}</a-tag
- >
- </a-form-item>
- <a-form-item label="创意标题">
- <a-input v-model="item.name"></a-input>
- </a-form-item>
- </div>
- </a-card>
- </a-col>
- </a-row>
- <div :style="{ marginBottom: '16px' }">
- <a-button @click="addCreative(bestIndex)" :disabled="contentAll >= 15 || listCheck">
- 添加创意</a-button
- >
- </div>
- </a-layout-content>
- </a-layout>
- </a-form-item>
- <a-form-item label="便利贴广告" :labelCol="labelCol" v-if="pane.sceneId.indexOf(3) >= 0">
- <a-layout>
- <a-layout-content style="padding: 10px">
- <a-row>
- <a-col :span="24" v-for="(item, index) of pane.postAdList" :key="index">
- <a-card title :ref="item">
- <a-icon
- type="close"
- style="float: right; cursor: pointer"
- @click="deleteCreative(bestIndex, index, 'postAdList')"
- />
- <div style="clear: both"></div>
- <div class="dynamically_add_form_item">
- <div class="downLoad" style="overflow: auto">
- <ul
- class="actor-photo-list step3-image"
- :style="{
- width: item.imageUrlList.length > 4 ? 25 * item.imageUrlList.length + '%' : '100%',
- }"
- v-if="item.imageUrlList.length > 0"
- >
- <a-checkbox-group
- v-model="item.checkArrImage"
- style="width: 100%; display: flex; padding-left: 0"
- @change="onChangeCheckImage"
- >
- <li v-for="(item, index) of item.imageUrlList" :key="index">
- <a-checkbox :value="item.code" style="height: 100%; width: 100%">
- <img class="video" :src="item.url" />
- </a-checkbox>
- </li>
- </a-checkbox-group>
- </ul>
- </div>
- <a-form-item label="">
- <a @click="getVideoList('image', index, item, bestIndex, 'postAdList')">选择封面</a>
- <a @click="uploadImages(index, bestIndex, item, 'postAdList')" style="margin-left: 10px"
- >上传封面</a
- >
- <a @click="showImages(index, bestIndex)" v-if="item.chouzhenShow" style="margin-left: 10px"
- >推荐封面</a
- >
- <br />
- <span v-for="(item, deleteIndex) of item.imageList" style="position: relative">
- <img :src="item.url" style="width: 18%; margin: 1%" :key="item.url" />
- <a-icon
- type="close-circle"
- @click="deleteData(index, bestIndex, deleteIndex, 'postAdList')"
- style="position: absolute; right: 0px"
- />
- </span>
- </a-form-item>
- <a-form-item label="广告语">
- <!-- <a @click="showTitle(index, bestIndex)">推荐广告语</a> -->
- <a-textarea
- class="rending"
- placeholder="请输入广告语"
- v-model.trim="item.description"
- :autosize="{ minRows: 2, maxRows: 6 }"
- ></a-textarea>
- <span v-if="item.description.length > 30" style="color: red">广告语长度不能超过30个字符</span>
- <br />
- <!-- <a @click="cunTitle(index, bestIndex)">收藏</a>
- <a @click="showCunTitle(index, bestIndex)" style="margin-left: 10px">收藏列表</a>
- <br />
- <a-tag
- v-for="(itemTag, indexTag) of tags"
- :key="indexTag"
- @click="getChange(item, itemTag, index)"
- >{{ itemTag.name }}</a-tag
- > -->
- </a-form-item>
- <a-form-item label="短广告语">
- <a-textarea
- class="rending"
- placeholder="请输入短广告语"
- v-model.trim="item.shortSlogan"
- :autosize="{ minRows: 2, maxRows: 6 }"
- :maxLength="8"
- ></a-textarea>
- <span v-if="item.shortSlogan.length > 8" style="color: red"
- >短广告语长度不能超过30个字符</span
- >
- </a-form-item>
- <a-form-item label="创意标题">
- <a-input v-model="item.name"></a-input>
- </a-form-item>
- </div>
- </a-card>
- </a-col>
- </a-row>
- <div :style="{ marginBottom: '16px' }">
- <a-button @click="addAdList(bestIndex)" :disabled="contentAll >= 15 || pane.postAdList.length >= 1">
- 添加便利贴</a-button
- >
- </div>
- </a-layout-content>
- </a-layout>
- </a-form-item>
- <a-form-item label="创意分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-cascader
- :options="createOptions"
- v-decorator="['creativeCategory']"
- :fieldNames="fieldNames"
- placeholder="请选择创意分类"
- />
- </a-form-item>
- <a-form-item label="创意标签" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select
- mode="tags"
- style="width: 100%"
- placeholder="按回车生成标签"
- v-decorator="['creativeTag', { validator: creativeTagValid }]"
- dropdownClassName="display-none-selset"
- :token-separators="[',', ' ', ',']"
- >
- </a-select>
- <span v-if="getData('creativeTag') && getData('creativeTag').length > 10" style="color: red"
- >创意标签最多填写10个,请删减</span
- >
- <br />
- <a-popconfirm @confirm="getInfo(record)">
- <div slot="title">
- <div>
- 分类名称:
- <a-input placeholder="请输入" v-model="tagName" style="display: inline-block; width: 300px" />
- </div>
- </div>
- <!-- <a-button slot="okText" type="primary" :disabled="refuseReason == ''">确定</a-button> -->
- <!-- <a @click="setData(record)">复制</a> -->
- <a style="margin-right: 10px" :disabled="!getData('creativeTag')">收藏</a>
- <!-- @click="collection('creativeTag')" -->
- </a-popconfirm>
- <a @click="showCunTag('creativeTag')">收藏列表</a>
- </a-form-item>
- <!-- @change="createChange" -->
- <a-form-item label="行动号召" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select
- v-decorator="['actionBarText', { rules: [{ required: true, message: '行动号召按钮文案' }] }]"
- showSearch
- allowClear
- placeholder="选择行动号召按钮文案"
- optionFilterProp="children"
- :filterOption="filterOption"
- >
- <a-select-option v-for="appModel in appList" :key="appModel.id" :value="appModel.actionBarText">
- {{ appModel.actionBarText }}
- </a-select-option>
- </a-select>
- </a-form-item>
- <a-form-item label="下载详情" v-if="showSite" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select
- v-decorator="['siteId']"
- showSearch
- allowClear
- placeholder="选择应用下载详情页"
- optionFilterProp="children"
- :filterOption="filterOption"
- >
- <a-select-option v-for="appModel in siteList" :key="appModel.siteId" :value="appModel.siteId">
- {{ appModel.name }}
- </a-select-option>
- </a-select>
- </a-form-item>
- <a-form-item label="第三方点击监测链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input
- v-if="pane.bid_type == 6"
- v-decorator="[
- 'clickTrackUrl',
- {
- rules: [{ message: '请输入第三方检测链接' }, { validator: handleConfirmValue }],
- },
- ]"
- placeholder="请输入第三方检测链接"
- >
- </a-input>
- <a-input
- v-else
- v-decorator="[
- 'clickTrackUrl',
- {
- rules: [{ message: '请输入第三方检测链接' }],
- },
- ]"
- placeholder="请输入第三方检测链接"
- >
- </a-input>
- <a
- v-if="getData('clickTrackUrl')"
- @click="
- clickTrackUrlShow = true
- clickTrackUrlShowType == '1'
- "
- style="margin-right: 10px"
- >收藏监测链接</a
- >
- <a
- @click="
- getClickTrackUrlList('1')
- clickTrackUrlShowType = '1'
- "
- >监测链接列表</a
- >
- </a-form-item>
- <a-form-item label="第三方ActionBar点击监控链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input
- v-decorator="[
- 'actionbarClickUrl',
- {
- rules: [{ message: '请输入第三方点击监控链接' }],
- },
- ]"
- placeholder="请输入第三方点击监控链接"
- >
- </a-input>
- <span style="color: red; position: relative; top: -10px">仅加白使用</span>
- <br />
- <a
- v-if="getData('actionbarClickUrl')"
- @click="
- clickTrackUrlShow = true
- clickTrackUrlShowType = '2'
- "
- style="margin-right: 10px; position: relative; top: -20px"
- >收藏监测链接</a
- >
- <a
- @click="
- getClickTrackUrlList('2')
- clickTrackUrlShowType = '2'
- "
- style="margin-right: 10px; position: relative; top: -20px"
- >监测链接列表</a
- >
- </a-form-item>
- </a-form>
- </a-tab-pane>
- </a-tabs>
- <a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
- <a-button type="primary" @click="handleSubmit" :loading="loading">提交</a-button>
- </a-form-item>
- <checkMatemal ref="check" @showVideo="showData"></checkMatemal>
- <a-modal :maskClosable="false" v-model="visible" :footer="null" :width="520">
- <div style="width: 100%; height: 329px; display: flex; flex-flow: column">
- <main
- class="container"
- style="width: 100%; text-align: center; margin: 66px auto 24px; font-size: 30px; font-weight: 100"
- >
- <h2 data-splitting class="headline headline--yell" style="color: red">起量</h2>
- </main>
- <div style="width: 100%; text-align: center; font-size: 24px; margin-bottom: 65px">
- <img src="@/assets/success.png" alt="" style="width: 24px; margin-right: 10px" />创建成功
- </div>
- <div style="width: 100%; margin-bottom: 43px; display: flex; justify-content: center">
- <a-button key="submit" type="primary" @click="handleOk" style="margin-right: 8px"> 返回列表 </a-button>
- <a-button key="back" @click="handleCancel">关闭</a-button>
- </div>
- </div>
- </a-modal>
- <a-modal
- :maskClosable="false"
- title="封面上传"
- @cancel="closeImage"
- @afterClose="closeImage"
- v-model="addImageVisible"
- >
- <template slot="footer">
- <a-button key="back" @click="closeImage">取消</a-button>
- <a-button key="submit" type="primary" @click="handleOkImage" :loading="loadingImage"> 确定 </a-button>
- </template>
- <a-form-item label="" class="add-image-material">
- <uploadFile
- v-if="addImageVisible"
- :value.sync="urlListImage.url"
- :checkFile="fileWater"
- @overUpload="overUploadImage"
- @removeUpload="deleteImage"
- :fileCount="15"
- uploadType="image"
- />
- <!--
- <upload-to-ali style="width:100%" v-model="urlListImage.url" :customDomain="customDomain" :multiple="true"
- preview :region="region" :bucket="bucket" :accept="acceptImage" :max="15" :size="2048"
- :accessKeyId="accessKeyId" :accessKeySecret="accessKeySecret" :before-upload="fileWater" :dir="dirImg"
- @delete='deleteImage' @loaded="overUploadImage"></upload-to-ali> -->
- <span
- v-if="material.filter((item) => item == false).length > 0 && urlListImage.url.length > 0"
- style="color: red"
- >上传素材的尺寸不符,请修改(<span v-for="(item, index) of material" :key="index" v-show="!item"
- >第{{ index + 1 }}张</span
- >出错)</span
- >
- <span
- v-else-if="urlListImage.url.length > 0 && material.filter((item) => item == false).length == 0"
- style="color: green"
- >上传成功</span
- >
- </a-form-item>
- </a-modal>
- <a-modal
- :maskClosable="false"
- title="视频上传"
- @cancel="closeVideo"
- @afterClose="closeVideo"
- v-model="addVideoVisible"
- >
- <template slot="footer">
- <a-button key="back" @click="closeVideo">取消</a-button>
- <a-button key="submit" type="primary" @click="handleOkVideo" :loading="loadingVideo"> 确定 </a-button>
- </template>
- <a-form-item label="" class="add-image-material">
- <uploadFile
- v-if="addVideoVisible"
- :checkFile="file"
- :value.sync="urlList.url"
- @overUpload="overUpload"
- :fileCount="10"
- uploadType="video"
- :multiple="false"
- />
- <!-- <upload-to-ali v-model="urlList.url" :customDomain="customDomain" preview :region="region" :bucket="bucket"
- :accept="acceptVideo" :max="10" :size="1024000" :accessKeyId="accessKeyId" :accessKeySecret="accessKeySecret"
- :before-upload="file" :dir="dirVideo" @loaded="overUpload">
- </upload-to-ali> -->
- <span v-if="messageTip" style="color: red">{{ messageTip }}</span>
- </a-form-item>
- </a-modal>
- <a-modal :maskClosable="false" title="抽帧展示" v-model="chouzhen" :width="1000">
- <template slot="footer">
- <a-button key="back" @click="chouzhen = false">关闭</a-button>
- <a-button key="submit" type="primary" @click="handleOkChouzhen"> 确定 </a-button>
- </template>
- <a-button type="primary" @click="onCheckAllChange"> 全选 </a-button>
- <!-- </a-checkbox> -->
- <ul v-if="chouzhenList.length > 0" style="height: 600px; overflow: auto; padding-left: 0" class="step3-modal">
- <a-checkbox-group v-model="checkList" @change="onChange" style="width: 100%">
- <li
- v-for="(item, index) of chouzhenList"
- :key="index"
- class="chouzhen"
- style="height: 320px"
- :class="{ first: index == 0 }"
- >
- <a-checkbox
- :value="item.signature"
- style="position: absolute; z-index: 100; width: 100%; height: 100%; right: 0; top: 0; float: right"
- >
- <img :src="item.url" alt="" style="width: 100%" />
- </a-checkbox>
- <a
- style="position: absolute; bottom: 0; width: 100%; text-align: center; margin-left: -10px; z-index: 100"
- @click.stop="
- showImageStr = item.url
- showImageChouzhen = true
- "
- >查看封面</a
- >
- </li>
- </a-checkbox-group>
- </ul>
- </a-modal>
- <a-modal title="抽帧详情" v-model="showImageChouzhen" :width="400" :footer="null">
- <img :src="showImageStr" style="width: 100%" />
- </a-modal>
- <a-modal :maskClosable="false" title="选择素材" v-model="visibleMatemal" @ok="handleOkShow" :width="1000">
- <a-tabs type="card" @change="callback" v-model="active" class="check-video">
- <a-tab-pane :tab="item.label" v-for="item of tab" :key="item.value">
- <a-row :gutter="24">
- <a-col :span="12">
- <a-form-item label="日期选择" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-range-picker name="buildTime" v-model="time" />
- </a-form-item>
- </a-col>
- <!-- <a-col :span="12">
- <a-form-item label="筛选条件" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select v-model="orderBy" style="width: 100%">
- <a-select-option value="time"> 按时间排序 </a-select-option>
- <a-select-option value="cost"> 按消耗排序</a-select-option>
- </a-select>
- </a-form-item>
- </a-col> -->
- </a-row>
- <ul v-if="dataSource.length > 0" style="overflow: auto; padding-left: 0">
- <a-checkbox-group v-model="checkVideo" @change="onChangeVideo" style="width: 100%">
- <li v-for="(item, index) of dataSource" :key="index" class="chouzhen" style="height: 400px">
- <!-- <video class="video" :src="item.url" controls="controls" style="width:100%">
- 您的浏览器不支持 video 标签。
- </video> -->
- <a-checkbox :value="item" style="width: 100%; position: absolute; z-index: 100; right: 0; top: 0">
- <img :src="item.coverUrl" alt="" style="width: 100%; margin-bottom: 30px" />
- <div style="width: 100%; text-align: center">
- {{ item.statDate ? '时间:' + item.statDate.split(' ')[0] : '消耗:' + item.charge }}
- </div>
- </a-checkbox>
- <a @click="matemalVideo(item, index)" style="position: absolute; z-index: 100; right: 56px; bottom: 5px"
- >查看视频</a
- >
- </li>
- </a-checkbox-group>
- </ul>
- <div v-else style="width: 100%; height: 400px; display: flex; justify-content: center; align-items: center">
- <img
- src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
- alt=""
- v-if="!loadingVideoList"
- />
- <img v-else src="@/views/modules/material/loading.gif" />
- </div>
- </a-tab-pane>
- <a-button slot="tabBarExtraContent" type="primary" @click="tongbu()" :loading="tongbuLoading">
- 刷新素材</a-button
- >
- </a-tabs>
- <!-- <ul class="actor-photo-list">
- <a-checkbox-group v-model="checkArr" style="width:100%; display: flex;padding-left: 0;"
- @change="onChangeCheck">
- <li v-for="(item, index) of dataSource" :key="index">
- <a-checkbox :value="item" style="position:absolute;z-index:100;padding-right:30px">
- </a-checkbox>
- </li>
- </a-checkbox-group>
- </ul> -->
- <div style="text-align: right">
- <a-pagination
- size="small"
- :showTotal="ipagination.showTotal"
- style="float: right"
- v-if="dataSource.length > 0"
- showQuickJumper
- :pageSize.sync="ipagination.pageSize"
- :total="ipagination.total"
- v-model="ipagination.current"
- @change="getDataSource"
- />
- </div>
- </a-modal>
- <a-modal title="查看视频" v-model="visibleVideo" :width="400" :footer="null">
- <video class="video" :src="videoUrlShow" controls="controls" style="width: 100%">
- 您的浏览器不支持 video 标签。
- </video>
- </a-modal>
- <a-modal title="收藏标题" v-model="creativeTagVisible" :width="1000" @ok="okTag">
- <el-tree :data="optionsTag" show-checkbox node-key="id" :props="defaultProps" :check-strictly="true" ref="tree">
- </el-tree>
- </a-modal>
- <a-modal :maskClosable="false" title="选择素材" v-model="stickerVisible" @ok="handleOkCover" :width="1000">
- <a-radio-group v-model="stickerStylesValue" class="sticker-styles" v-if="stickerStyles.length > 0">
- <a-radio v-for="(item, index) in stickerStyles" :key="index" :value="item.overlay_type">
- <img :src="item.overlay_preview_url" alt="" style="width: 100px; margin: 10px; opacity: 0.5" />
- </a-radio>
- </a-radio-group>
- </a-modal>
- <a-modal title="推荐标题" v-model="titleVisible" :width="1000" :footer="null">
- <a-row :gutter="10">
- <a-col :sm="10" style="margin-bottom: 20px; z-index: 10">
- <a-card class="search-box" style="min-height: 500px">
- <div style="margin-bottom: 30px">
- <span style="display: inline-block; width: 80px">行业</span>
- <a-cascader
- style="margin-top: 1rem; width: 300px"
- v-model="dataOne"
- :options="options"
- :showSearch="{ filter }"
- expandTrigger="hover"
- @change="onChangeTitle"
- placeholder="请选择行业"
- >
- <a-icon type="smile" slot="suffixIcon" class="test" />
- </a-cascader>
- </div>
- <div style="margin-bottom: 30px">
- <span style="display: inline-block; width: 80px">关键词</span>
- <a-input placeholder="请输入关键词" v-model="value" style="width: 300px" />
- </div>
- <span style="display: inline-block; width: 80px; float: left"></span>
- <a-button type="primary" @click="searchQuery" :disabled="value == ''">生成</a-button>
- </a-card>
- </a-col>
- <a-col :sm="14" style="margin-bottom: 20px; z-index: 10">
- <a-card class="search-box" style="over-flow: auto">
- <a-list size="large" bordered :dataSource="title">
- <a-list-item slot="renderItem" slot-scope="item">
- <a slot="actions" @click="okTitle(item)">选择</a>
- {{ item }}
- </a-list-item>
- </a-list>
- </a-card>
- </a-col>
- </a-row>
- </a-modal>
- <a-modal title="收藏标题" v-model="cunTitleVisible" :width="1000" :footer="null">
- <a-row :gutter="10">
- <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
- <a-card class="search-box" style="over-flow: auto">
- <a-list size="large" bordered :dataSource="cunTitleList">
- <a-list-item slot="renderItem" slot-scope="item">
- <div slot="actions">
- <a @click="okTitleCun(item)">选择</a>
- <a-divider type="vertical" />
- <a @click="removeTitleCun(item)">删除</a>
- </div>
- {{ item.title }}
- </a-list-item>
- </a-list>
- </a-card>
- </a-col>
- </a-row>
- </a-modal>
- <a-modal title="监测链接名称" v-model="clickTrackUrlShow">
- <template slot="footer">
- <a-button
- key="submit"
- :disabled="trackUrlName == '' && !showTrackUrlNameElse"
- type="primary"
- @click="clickTrackUrlOk"
- >
- 确定
- </a-button>
- </template>
- <a-input placeholder="请输入监测链接名称" v-model="trackUrlName" @blur="changeTrackUrlName" style="width: 100%" />
- <span style="color: red" v-if="!showTrackUrlNameElse">名称重复</span>
- </a-modal>
- <a-modal title="监测链接列表" v-model="clickTrackUrlList" :width="1000" :footer="null">
- <a-spin :spinning="spinning">
- <a-row :gutter="10" class="onlny-click-track">
- <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
- <a-card class="search-box" style="over-flow: auto">
- <!-- <a-input v-model="trackName"></a-input> -->
- <a-input-search
- placeholder="请输入监测链接名称"
- enter-button="Search"
- size="large"
- @search="onSearch"
- style="width: 40%; margin-bottom: 20px"
- v-model="trackName"
- />
- <a-list size="large" bordered :dataSource="trackUrlList">
- <a-list-item slot="renderItem" slot-scope="item" :title="item.trackUrl" style="line-height: 50px">
- <div slot="actions">
- <a @click="okClickTrackUrl(item)">选择</a>
- <a-divider type="vertical" />
- <a @click="removeClickTrackUrl(item)">删除</a>
- </div>
- {{ item.trackName }}
- <a-input v-model="item.trackUrl" readOnly style="margin: 10px; width: 70%"></a-input>
- </a-list-item>
- </a-list>
- </a-card>
- </a-col>
- </a-row>
- </a-spin>
- </a-modal>
- </a-card>
- </template>
- <script>
- import { getAction, postAction, deleteAction } from '@/api/manage'
- import { mapGetters } from 'vuex'
- import UploadToAli from '@femessage/upload-to-ali'
- import moment from 'moment'
- import VuePreview from 'vue-preview'
- import jq from 'jquery'
- import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
- import checkMatemal from './stepModule/checkMatemal'
- import BMF from 'browser-md5-file'
- import uploadFile from '@/components/uploadFile.vue'
- let nowIndex = 0
- let bestIndex = 0
- let showRemove = false
- export default {
- name: 'BaseForm',
- components: {
- UploadToAli,
- VuePreview,
- checkMatemal,
- uploadFile,
- },
- data() {
- return {
- fieldNames: {
- label: 'category_name',
- value: 'category_id',
- children: 'child',
- },
- createOptions: [],
- stickerVisible: false,
- stickerStyles: [],
- stickerStylesValue: '',
- coverSlogansList: [{ coverSlogans: '' }],
- captionsList: [{ captions: '' }],
- sceneIdValue: '1',
- trackName: '',
- showImageChouzhen: false,
- showImageStr: null,
- tongbuLoading: false,
- showTrackUrlNameElse: true,
- clickTrackUrlShow: false,
- clickTrackUrlShowType: '1',
- clickTrackUrlList: false,
- spinning:false,
- trackUrlList: [],
- trackUrlName: '',
- showSite: true,
- titleVisible: false,
- cunTitleVisible: false,
- cunTitleList: [],
- options: [],
- data: [],
- value: '',
- dataOne: [],
- title: [],
- creativeTagVisible: false,
- tags: [],
- visibleMatemal: false,
- visibleVideo: false,
- videoUrlShow: '',
- time: [],
- orderBy: 'time',
- channelType: 0,
- checkVideo: [],
- dataSource: [],
- tab: [
- {
- value: 0,
- label: '内部',
- },
- {
- value: 1,
- label: '外部',
- },
- ],
- active: 0,
- ipagination: {
- current: 1,
- pageSize: 5,
- // pageSizeOptions: ['10', '20', '30'],
- showTotal: (total, range) => {
- return range[0] + '-' + range[1] + ' 共' + total + '条'
- },
- showQuickJumper: true,
- // showSizeChanger: true,
- total: 0,
- onChange: (current) => {
- // 切换分页时的回调,
- // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
- this.ipagination.current = current
- },
- },
- chouzhen: false,
- chouzhenList: [],
- checkList: [],
- indeterminate: true,
- checkAll: false,
- pans: [],
- pansKey: '',
- addImageVisible: false,
- addVideoVisible: false,
- loadingVideoList: false,
- loadingVideo: false,
- loadingImage: false,
- allForm: {
- videoList: '',
- imageList: [],
- fail: [],
- success: [],
- },
- form: this.$form.createForm(this),
- list: [],
- vertical: 'vertical',
- appList: [],
- siteList: [],
- labelCol: {
- lg: {
- span: 6,
- },
- sm: {
- span: 6,
- },
- xs: {
- span: 6,
- },
- md: {
- span: 6,
- },
- },
- wrapperCol: {
- lg: {
- span: 18,
- },
- sm: {
- span: 18,
- },
- xs: {
- span: 14,
- },
- md: {
- span: 14,
- },
- },
- visible: false,
- loading: false,
- imageUrlList: [],
- checkAllImage: false,
- checkArrImage: [],
- content: 0,
- urlListImage: {
- url: [],
- md5: [],
- },
- urlList: {
- url: '',
- md5: '',
- photoId: '',
- },
- imageArrList: [],
- material: [],
- creativeCopywriter: '',
- customDomain: '',
- region: 'oss-cn-beijing',
- bucket: 'ctop-media',
- acceptVideo: 'video/mpeg,video/mp4',
- acceptImage: 'image/jpeg,image/jpg',
- accessKeyId: 'LTAIbNbqWzSOklQV',
- accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
- messageTip: null,
- verticalPhoto: [],
- horizontalPhoto: [],
- creativeMaterialType: '1',
- postAdTrue: false,
- optionsTag: [],
- defaultProps: {
- children: 'children',
- label: 'label',
- id: 'id',
- },
- tagName: '',
- optionsTag: [],
- }
- },
- methods: {
- getInfo(item) {
- if (this.tagName == '') {
- this.$message.error('请输入分类名称')
- return
- } else {
- let params = {}
- params.tagName = this.tagName
- // params.campaignBudget = this.campaignBudget
- params.tagArray = JSON.stringify(this.getData('creativeTag'))
- params.userId = this.userInfo().id
- params.accountId = localStorage.getItem('accountId')
- postAction('/tag/kuaiShouCreativeTagCollection/add', params).then((res) => {
- if (res.success) {
- this.$message.success('添加成功')
- this.tagName = ''
- } else {
- this.$message.error(res.message)
- }
- })
- }
- },
- getCoverUrl(index, item, bestIndex) {
- nowIndex = index
- bestIndex = bestIndex
- this.stickerVisible = true
- },
- changeType(item) {
- this.$nextTick(() => {
- if (item.creativeMaterialType == '1') {
- item.name = '自定义创意_竖版视频_'
- } else {
- item.name = '自定义创意_横版视频_'
- }
- })
- },
- ...mapGetters(['nickname', 'avatar', 'userInfo']),
- onSearch(value) {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.userId = this.userInfo().id
- params.trackType = this.clickTrackUrlShowType
- params.pageNo = 1
- params.pageSize = 500
- params.trackName = value
- getAction('/kuaishou/kuaiShouTrackUrlCollection/list', params).then((res) => {
- if (res.success) {
- this.trackUrlList = res.result.records
- } else {
- this.$message.error(res.message)
- }
- })
- },
- changeTrackUrlName() {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.userId = this.userInfo().id
- params.trackName = this.trackUrlName
- getAction('/kuaishou/kuaiShouTrackUrlCollection/checkTrackName', params).then((res) => {
- this.showTrackUrlNameElse = res.result
- })
- },
- clickTrackUrlOk() {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.userId = this.userInfo().id
- params.trackName = this.trackUrlName
- params.trackType = this.clickTrackUrlShowType
- params.trackUrl =
- this.clickTrackUrlShowType == '1' ? this.getData('clickTrackUrl') : this.getData('actionbarClickUrl')
- postAction('/kuaishou/kuaiShouTrackUrlCollection/add', params).then((res) => {
- if (res.success) {
- this.clickTrackUrlShow = false
- this.trackUrlName = ''
- this.$message.success('添加成功')
- } else {
- this.$message.error(res.message)
- }
- })
- },
- okClickTrackUrl(item) {
- this.clickTrackUrlList = false
- if (this.clickTrackUrlShowType == '1') {
- this.form.setFieldsValue({
- clickTrackUrl: item.trackUrl,
- })
- } else {
- this.form.setFieldsValue({
- actionbarClickUrl: item.trackUrl,
- })
- }
- },
- removeClickTrackUrl(item) {
- deleteAction('/kuaishou/kuaiShouTrackUrlCollection/delete', {
- id: item.id,
- }).then((res) => {
- if (res.success) {
- this.getClickTrackUrlList(this.clickTrackUrlShowType)
- }
- })
- },
- getClickTrackUrlList(type) {
- this.spinning = true
- this.clickTrackUrlList = true
- this.trackUrlList = []
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.trackType = type
- params.userId = this.userInfo().id
- params.pageNo = 1
- params.pageSize = 500
- getAction('/kuaishou/kuaiShouTrackUrlCollection/list', params).then((res) => {
- if (res.success) {
- this.spinning = false
- this.trackUrlList = res.result.records
- } else {
- this.spinning = false
- this.$message.error(res.message)
- }
- })
- },
- showTitle(index, bestIndex) {
- nowIndex = index
- bestIndex = bestIndex
- this.titleVisible = true
- this.getHangye()
- },
- okTitle(item) {
- this.pans[bestIndex].list[nowIndex].description = item
- this.titleVisible = false
- this.dataOne = []
- this.value = ''
- this.title = []
- },
- cunTitle(nowIndex, lastIndex) {
- if (this.pans[lastIndex].list[nowIndex].description == '') {
- this.$message.error('请填写广告语后再进行收藏')
- } else {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.userId = this.userInfo().id
- params.title = this.pans[lastIndex].list[nowIndex].description
- postAction('/kuaishou/kuaiShouTitleCollection/add', params).then((res) => {
- if (res.success) {
- this.$message.success('收藏成功')
- } else {
- this.$message.error(res.message)
- }
- })
- }
- },
- showCunTag(type) {
- this.creativeTagVisible = true
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.userId = this.userInfo().id
- params.pageSize = 1000
- params.pageNo = 1
- getAction('/tag/kuaiShouCreativeTagCollection/list', params).then((res) => {
- if (res.success) {
- console.log(res.result)
- this.optionsTag = res.result.records.map((item) => {
- return {
- id: item.id,
- label: item.tagName,
- children: JSON.parse(item.tagArray).map((item) => {
- return {
- id: item,
- label: item,
- disabled: true,
- }
- }),
- }
- })
- }
- })
- },
- okTag() {
- var data = this.$refs.tree.getCheckedKeys()
- if (data.length > 1) {
- this.$message.error('只能选择一个选项')
- // this.$refs.tree.setCheckedKeys([]);
- } else {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.userId = this.userInfo().id
- params.pageSize = 1000
- params.pageNo = 1
- params.id = data[0]
- getAction('/tag/kuaiShouCreativeTagCollection/list', params).then((res) => {
- if (res.success) {
- console.log(res.result)
- this.$nextTick(() => {
- this.form.setFieldsValue({
- creativeTag: JSON.parse(res.result.records[0].tagArray).map((item) => {
- return item
- }),
- })
- this.form.validateFields(['creativeTag'])
- })
- this.creativeTagVisible = false
- } else {
- this.$message.error('选择出错,请稍后选择或自行手填')
- }
- })
- }
- },
- showCunTitle(index, bestIndex) {
- nowIndex = index
- bestIndex = bestIndex
- this.cunTitleVisible = true
- this.getCunTitle()
- },
- getCunTitle() {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.userId = this.userInfo().id
- params.pageNo = 1
- params.pageSize = 500
- getAction('/kuaishou/kuaiShouTitleCollection/list', params).then((res) => {
- if (res.success) {
- this.cunTitleList = res.result.records
- }
- })
- },
- removeTitleCun(item) {
- deleteAction('/kuaishou/kuaiShouTitleCollection/delete', {
- id: item.id,
- }).then((res) => {
- if (res.success) {
- this.getCunTitle()
- }
- })
- },
- okTitleCun(item) {
- this.pans[bestIndex].list[nowIndex].description = item.title
- this.cunTitleVisible = false
- this.cunTitleList = []
- },
- searchQuery() {
- // /ctop/creativeTitle/titleSuggestion
- getAction('/ctop/creativeTitle/titleSearch', {
- firstCategory: this.dataOne[0],
- secondCategory: this.dataOne[1],
- keywords: this.value,
- }).then((res) => {
- console.log(res)
- this.title = res.result ? res.result : []
- })
- // firstCategory,secondCategory,keywords
- },
- getHangye() {
- getAction('/ctop/creativeTitle/getTitleLabel', '').then((res) => {
- if (res.success) {
- this.options = res.result.map((item) => {
- return {
- label: item.label,
- value: item.value,
- children:
- item.children.length > 0
- ? [
- {
- label: '不限',
- value: 0,
- },
- ].concat(item.children)
- : [
- {
- label: '不限',
- value: 0,
- },
- ],
- }
- })
- this.options = [
- {
- label: '不限',
- value: 0,
- },
- ].concat(this.options)
- if (this.dataOne.length > 0) {
- return
- } else {
- this.dataOne = [0]
- }
- }
- })
- },
- onChangeTitle(value, selectedOptions) {
- this.dataOne = value
- this.value = ''
- this.title = []
- },
- filter(inputValue, path) {
- return path.some((option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
- },
- handleSearch(value) {
- if (this.dataOne.length > 0) {
- const str = {
- firstCategory: this.dataOne[0],
- secondCategory: this.dataOne[1],
- keyword: value,
- }
- getAction('/ctop/creativeTitle/titleSuggestion', str).then((d) => {
- const result = d.result ? d.result : []
- this.data = result.map((item) => {
- return {
- value: item,
- text: item,
- }
- })
- })
- } else {
- this.data = []
- return
- }
- },
- matemalVideo(item) {
- this.visibleVideo = true
- this.videoUrlShow = item.url
- },
- onChange(checkedList) {
- this.indeterminate = !!checkedList.length && checkedList.length < this.chouzhenList.length
- this.checkAll = checkedList.length === this.chouzhenList.length
- },
- onCheckAllChange(e) {
- if (this.checkAll) {
- this.checkList = []
- } else {
- this.checkList = this.chouzhenList.map((item) => {
- return item.signature
- })
- }
- this.checkAll = !this.checkAll
- },
- onCheckAllImageChange(index, item) {
- if (this.pans[index].list[item.key].checkAllImage) {
- this.pans[index].list[item.key].checkArrImage = []
- } else {
- this.pans[index].list[item.key].checkArrImage = this.pans[index].list[item.key].imageUrlList.map((item) => {
- return item.code
- })
- }
- this.pans[index].list[item.key].checkAllImage = !this.pans[index].list[item.key].checkAllImage
- },
- onChangeCheckImage(checkedList) {},
- handleConfirmValue(rule, value, callback) {
- if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value.length < 10000) {
- callback()
- } else {
- callback('链接不能为空且开头为http://或https://,并且长度小于10000')
- }
- },
- creativeTagValid(rule, value, callback) {
- if (value.length > 10) {
- callback('创意标签最多填写10个,请删减')
- } else {
- callback()
- }
- },
- showData(item, type) {
- var index = this.pans.findIndex((item) => item.key === this.pansKey)
- // this.pans[index].list[item.key].imageList = []
- if (type == 'video') {
- this.pans[index].list[item.key].videoList = item.video
- getAction('/kuaishou/batch/getCreativeCopywriter', {
- code: item.video.signature,
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- if (res.success) {
- this.pans[index].list[item.key].description = res.result ? res.result.creativeCopywriter : ''
- }
- })
- getAction('/ctop/MaterialImageInfo/list', {
- videoId: item.video.signature,
- status: 1,
- }).then((res) => {
- if (res.success) {
- this.pans[index].list[item.key].imageUrlList = res.result
- this.pans[index].list[item.key].checkArrImage = res.result.map((item) => {
- return item.code
- })
- }
- })
- var params = {
- videoSignature: item.video.signature,
- pageSize: 20,
- pageNo: 1,
- }
- getAction('/cutFrame/material/list', params).then((res) => {
- if (res.success) {
- if (res.result.records.length > 0) {
- this.pans[index].list[item.key].chouzhenShow = true
- } else {
- this.pans[index].list[item.key].chouzhenShow = false
- }
- }
- })
- } else {
- // this.pans[index].list[item.key].imageList.push(...item.image)
- if (this.creativeMaterialType == '4') {
- if (item.image.length + this.contentAll > 15) {
- this.$message.error('当前选择封面' + item.image.length + '张,最多可选择' + (15 - this.contentAll) + '张')
- return
- } else {
- this.pans[index].postAdList[item.key].imageList.push(...item.image)
- this.chouzhen = false
- this.chouzhenList = []
- this.checkList = []
- this.checkAll = false
- }
- } else {
- if (item.image.length + this.contentAll > 15) {
- this.$message.error('当前选择封面' + item.image.length + '张,最多可选择' + (15 - this.contentAll) + '张')
- return
- } else {
- this.pans[index].list[item.key].imageList.push(...item.image)
- this.chouzhen = false
- this.chouzhenList = []
- this.checkList = []
- this.checkAll = false
- }
- }
- }
- },
- getData(className) {
- return this.form.getFieldValue(className)
- },
- onChangeVideo() {
- if (this.checkVideo.length > 1) {
- this.checkVideo.shift()
- }
- },
- callback(key) {
- this.channelType = key
- this.checkVideo = []
- this.ipagination.current = 1
- this.time = []
- // var params = {}
- // params.channelType = key
- // params.accountId = localStorage.getItem('accountId')
- // params.materialType = this.getData('creativeMaterialType')
- // params.pageSize = this.ipagination.pageSize
- // params.pageNo = this.ipagination.current
- // this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
- },
- getDataSource(page, pageSize) {
- this.ipagination.current = page
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.materialType = this.creativeMaterialType
- params.pageSize = this.ipagination.pageSize
- params.pageNo = page
- params.channelType = this.channelType
- params.status = 0
- params.orderBy = this.orderBy
- if (this.time.length > 0) {
- // params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
- // params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
- params.startDate = moment(this.time[0]).format('YYYY-MM-DD') + ' 00:00:00'
- params.endDate = moment(this.time[1]).format('YYYY-MM-DD') + ' 23:59:59'
- }
- this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
- },
- showVideoList(url, params) {
- this.dataSource = []
- this.loadingVideoList = true
- getAction(url, params).then((res) => {
- console.log(res)
- if (res.success) {
- this.dataSource = res.result.list
- this.ipagination.total = res.result.total
- this.loadingVideoList = false
- } else {
- this.loadingVideoList = false
- }
- })
- },
- getVideoList(type, index, item, bestIndex) {
- if (type == 'video') {
- nowIndex = index
- bestIndex = bestIndex
- this.orderBy = 'time'
- this.visibleMatemal = true
- this.checkVideo = []
- this.active = 0
- this.time = []
- this.channelType = 0
- this.creativeMaterialType = item.creativeMaterialType
- // var params = {}
- // params.accountId = localStorage.getItem('accountId')
- // params.materialType = this.getData('creativeMaterialType')
- // params.pageSize = this.ipagination.pageSize
- // params.pageNo = this.ipagination.current
- // params.params.channelType = 0 = 0
- // this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
- } else {
- this.creativeMaterialType = item.creativeMaterialType
- this.$refs.check.showCheck(
- item.creativeMaterialType,
- '/kuaishou/batch/getImageList',
- item.imageList,
- type,
- index
- )
- }
- },
- remove(targetKey) {
- let activeKey = this.pansKey
- let lastIndex
- this.pans.forEach((pane, i) => {
- if (pane.key === targetKey) {
- lastIndex = i - 1
- }
- })
- const panes = this.pans.filter((pane) => pane.key !== targetKey)
- if (panes.length && activeKey === targetKey) {
- if (lastIndex >= 0) {
- activeKey = panes[lastIndex].key
- } else {
- activeKey = panes[0].key
- }
- }
- this.pans = panes
- this.pansKey = activeKey
- this.form.resetFields()
- if (this.pans.length == 0) {
- this.$bus.$emit('remove', '/account/stepForm')
- } else {
- this.addCreative(0)
- getAction('/kuaishou/batch/checkCreativeCount', {
- unitId: this.pansKey,
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- this.content = res.result
- })
- }
- },
- handleOk() {
- this.remove(this.pansKey)
- if (localStorage.getItem('originality')) {
- this.$router.replace({
- path: '/account/originality',
- })
- } else {
- this.$router.replace({
- path: '/account/accountIndex',
- })
- }
- },
- handleCancel(e) {
- this.visible = false
- this.remove(this.pansKey)
- },
- handleSubmit(e) {
- e.preventDefault()
- var index = this.pans.findIndex((item) => item.key === this.pansKey)
- var data = this.pans[index].list.map((item) => {
- return item.imageList.length + item.imageUrlList.length
- })
- if (this.contentAll > 15) {
- this.$message.error('封面最多15张')
- return
- }
- this.form.validateFields((err, values) => {
- if (!err) {
- this.loading = true
- var dataJson = this.pans[index].list.map((item) => {
- return {
- creativeMaterialType: item.creativeMaterialType,
- description: item.description,
- imageArr: item.imageList.map((ele, index) => {
- return {
- signature: ele.signature,
- name: item.name,
- }
- }),
- imageArrTwo: item.checkArrImage.map((ele, index) => {
- return {
- signature: ele,
- name: item.name,
- }
- }),
- photoId: item.videoList.photoId,
- name: item.name,
- overlayType: item.coverUrl,
- stickerTitle: item.coverSlogans,
- }
- })
- var dataAd = this.pans[index].postAdList.map((item) => {
- return {
- creativeMaterialType: item.creativeMaterialType,
- description: item.description,
- shortSlogan: item.shortSlogan,
- imageArr: item.imageList.map((ele, index) => {
- return {
- signature: ele.signature,
- name: item.name,
- }
- }),
- name: item.name,
- }
- })
- var allJson = dataJson.map((item) => {
- return {
- description: item.description,
- imageArr:
- item.imageArr.concat(item.imageArrTwo).length > 0
- ? item.imageArr.concat(item.imageArrTwo)
- : [
- {
- name: item.name,
- },
- ],
- photoId: item.photoId,
- creativeMaterialType: item.creativeMaterialType,
- overlayType: item.overlayType,
- stickerTitle: item.stickerTitle,
- }
- })
- var params = Object.assign({}, values)
- // var params = {
- params.dataJson = allJson.concat(dataAd)
- // ...values,
- params.creativeCategory = params.creativeCategory
- ? params.creativeCategory[params.creativeCategory.length - 1]
- : null
- params.unitId = this.pansKey
- params.accountId = localStorage.getItem('accountId')
- params.content = this.content
- // }
- postAction('/kuaishou/batch/createCreative', params).then((res) => {
- if (res.success) {
- this.visible = true
- this.loading = false
- this.$nextTick(() => {
- Splitting()
- })
- } else {
- this.loading = false
- this.$message.error(res.message)
- }
- })
- }
- })
- },
- nextStep() {
- var that = this
- setTimeout(function () {
- that.$emit('nextStep')
- }, 1500)
- },
- prevStep() {
- this.$emit('prevStep')
- },
- addCreative(index) {
- this.$nextTick(() => {
- this.pans[index].list.push({
- videoList: '',
- imageList: [],
- name: '自定义创意_竖版视频_',
- description: '',
- creativeMaterialType: '1',
- actionBarText: '',
- imageUrlList: [],
- checkArrImage: [],
- checkAllImage: false,
- chouzhenShow: false,
- coverUrl: '',
- coverSlogans: '',
- })
- })
- },
- addAdList(index) {
- this.$nextTick(() => {
- this.pans[index].postAdList.push({
- imageList: [],
- shortSlogan: '',
- name: '便利贴创意',
- description: '',
- creativeMaterialType: '4',
- actionBarText: '',
- imageUrlList: [],
- checkArrImage: [],
- checkAllImage: false,
- chouzhenShow: false,
- })
- })
- },
- deleteCreative(bestIndex, index, type) {
- if (type) {
- this.pans[bestIndex].postAdList.splice(index, 1)
- } else {
- this.pans[bestIndex].list.splice(index, 1)
- }
- },
- filterOption(input, option) {
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- },
- uploadVideo(index, bestIndex, item) {
- nowIndex = index
- bestIndex = bestIndex
- this.addVideoVisible = true
- this.creativeMaterialType = item.creativeMaterialType
- },
- tongbu() {
- this.tongbuLoading = true
- getAction('/kuaishou/batch/syncVideo', {
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- if (res.success) {
- this.$message.success(res.message)
- this.tongbuLoading = false
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.materialType = this.creativeMaterialType
- params.pageSize = this.ipagination.pageSize
- params.pageNo = 1
- params.status = 0
- params.channelType = this.channelType
- params.orderBy = this.orderBy
- if (this.time.length > 0) {
- // params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
- // params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
- params.startDate = moment(this.time[0]).format('YYYY-MM-DD') + ' 00:00:00'
- params.endDate = moment(this.time[1]).format('YYYY-MM-DD') + ' 23:59:59'
- }
- this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
- } else {
- this.$message.error(res.message)
- this.tongbuLoading = false
- }
- })
- },
- handleOkChouzhen(e) {
- var arr = []
- for (let i = 0; i < this.chouzhenList.length; i++) {
- for (let j = 0; j < this.checkList.length; j++) {
- if (this.chouzhenList[i].signature == this.checkList[j]) {
- arr.push(this.chouzhenList[i])
- }
- }
- }
- if (arr.length + this.contentAll > 15) {
- this.$message.error('当前选择封面' + arr.length + '张,最多可选择' + (15 - this.contentAll) + '张')
- return
- } else {
- this.pans[bestIndex].list[nowIndex].imageList.push(...arr)
- this.chouzhen = false
- this.chouzhenList = []
- this.checkList = []
- this.checkAll = false
- }
- },
- showImages(index, bestIndex) {
- this.chouzhen = true
- this.chouzhenList = []
- nowIndex = index
- bestIndex = bestIndex
- var params = {
- videoSignature: this.pans[bestIndex].list[index].videoList.signature,
- pageSize: 20,
- pageNo: 1,
- }
- getAction('/cutFrame/material/list', params).then((res) => {
- if (res.success) {
- this.chouzhenList.push(...res.result.records)
- }
- })
- },
- uploadImages(index, bestIndex, item, type) {
- nowIndex = index
- bestIndex = bestIndex
- this.addImageVisible = true
- this.loadingImage = false
- this.creativeMaterialType = item.creativeMaterialType
- if (type) {
- this.postAdTrue = true
- } else {
- this.postAdTrue = false
- }
- },
- closeImage() {
- this.addImageVisible = false
- this.urlListImage = {
- url: [],
- md5: [],
- }
- this.imageArrList = []
- nowIndex = 0
- bestIndex = 0
- this.loadingImage = false
- },
- closeVideo() {
- this.addVideoVisible = false
- this.urlList = {
- url: '',
- md5: '',
- photoId: '',
- }
- nowIndex = 0
- bestIndex = 0
- this.messageTip = null
- },
- handleOkImage(e) {
- this.loadingImage = true
- var params = {
- accountId: localStorage.getItem('accountId'),
- uploadImageArr: this.imageArrList,
- creativeMaterialType: this.creativeMaterialType,
- }
- postAction('/kusiShouUpload/image', params).then((res) => {
- if (res.success) {
- if (!this.postAdTrue) {
- if (res.result.length + this.contentAll > 15) {
- this.$message.error('当前上传封面' + res.result.length + '张,最多可上传' + (15 - this.contentAll) + '张')
- this.loadingImage = false
- return
- } else {
- this.pans[bestIndex].list[nowIndex].imageList.push(...res.result)
- this.closeImage()
- this.loadingImage = false
- }
- } else {
- if (res.result.length + this.contentAll > 15) {
- this.$message.error('当前上传封面' + res.result.length + '张,最多可上传' + (15 - this.contentAll) + '张')
- this.loadingImage = false
- return
- } else {
- this.pans[bestIndex].postAdList[nowIndex].imageList.push(...res.result)
- this.closeImage()
- this.loadingImage = false
- }
- }
- } else {
- this.$message.error('封面上传失败')
- this.loadingImage = false
- }
- })
- },
- deleteImage(url) {
- var index = this.imageArrList.findIndex((v) => v.url === url)
- this.imageArrList.splice(index, 1)
- },
- overUploadImage(urlAll) {
- var that = this
- that.material = []
- that.imageArrList = []
- var img
- if (urlAll.length > 0) {
- for (var i = 0; i < urlAll.length; i++) {
- that.imageArrList.push({
- signature: this.urlListImage.md5[i],
- url: urlAll[i].url,
- })
- img = new Image()
- img.src = urlAll[i].url
- }
- }
- },
- fileWater(file) {
- var bmf = new BMF()
- var that = this
- // this.urlListImage = {
- // url: [],
- // md5: []
- // }
- return new Promise(function (resolve, reject) {
- bmf.md5(file, (err, md5) => {
- that.urlListImage.md5.push(md5)
- resolve()
- })
- })
- },
- overUpload(urlAll) {
- console.log(this.urlList)
- },
- file(file) {
- var bmf = new BMF()
- var that = this
- return new Promise(function (resolve, reject) {
- bmf.md5(file, (err, md5) => {
- getAction('/kusiShouUpload/checkVideo', {
- signature: md5,
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- if (res.code == 0) {
- if (res.result.isExistence) {
- showRemove = res.result.isExistence
- that.urlList.md5 = res.result.signature
- that.urlList.url = res.result.videoUrl
- that.urlList.photoId = res.result.photoId
- reject()
- } else {
- showRemove = res.result.isExistence
- that.urlList.md5 = md5
- resolve()
- }
- } else {
- reject()
- }
- })
- })
- })
- },
- handleOkVideo(e) {
- this.loadingVideo = true
- if (showRemove) {
- this.pans[bestIndex].list[nowIndex].videoList = {
- photoId: this.urlList.photoId,
- url: this.urlList.url,
- }
- this.loadingVideo = false
- var params = {
- videoSignature: this.urlList.md5,
- pageSize: 20,
- pageNo: 1,
- }
- getAction('/cutFrame/material/list', params).then((res) => {
- if (res.success) {
- if (res.result.records.length > 0) {
- this.pans[bestIndex].list[nowIndex].chouzhenShow = true
- } else {
- this.pans[bestIndex].list[nowIndex].chouzhenShow = false
- }
- }
- })
- this.closeVideo()
- } else {
- var params = {
- url: this.urlList.url,
- type: this.creativeMaterialType,
- signature: this.urlList.md5,
- accountId: localStorage.getItem('accountId'),
- }
- postAction('/kusiShouUpload/video', params).then((res) => {
- if (res.success) {
- this.pans[bestIndex].list[nowIndex].videoList = {
- photoId: res.result.photoId,
- url: this.urlList.url,
- }
- this.loadingVideo = false
- this.closeVideo()
- } else {
- this.messageTip = res.message
- this.loadingVideo = false
- this.urlList = {
- url: '',
- md5: '',
- photoId: '',
- }
- nowIndex = 0
- bestIndex = 0
- }
- })
- }
- },
- deleteCover(index, bestIndex) {
- this.pans[index].list[bestIndex].coverUrl = ''
- },
- deleteData(index, bestIndex, deleteIndex, type) {
- if (type) {
- this.pans[index].postAdList[bestIndex].imageList.splice(deleteIndex, 1)
- } else {
- this.pans[index].list[bestIndex].imageList.splice(deleteIndex, 1)
- }
- },
- handleOkCover(e) {
- this.pans[bestIndex].list[nowIndex].coverUrl = this.stickerStylesValue
- this.stickerVisible = false
- },
- showStickerStyles(value) {
- return this.stickerStyles.filter((item) => item.overlay_type == value)[0].overlay_preview_url
- },
- handleOkShow(e) {
- //
- this.pans[bestIndex].list[nowIndex].imageList = []
- getAction('/kuaishou/batch/getCreativeCopywriter', {
- code: this.checkVideo[0].signature,
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- if (res.success) {
- this.pans[bestIndex].list[nowIndex].description = res.result
- ? res.result.creativeCopywriter
- ? res.result.creativeCopywriter
- : ''
- : ''
- }
- })
- getAction('/ctop/MaterialImageInfo/list', {
- videoId: this.checkVideo[0].signature,
- status: 1,
- }).then((res) => {
- // console.log(res)
- if (res.success) {
- this.pans[bestIndex].list[nowIndex].imageUrlList = res.result
- this.pans[bestIndex].list[nowIndex].checkArrImage = res.result.map((item) => {
- return item.code
- })
- }
- })
- this.pans[bestIndex].list[nowIndex].videoList = this.checkVideo[0]
- this.visibleMatemal = false
- this.ipagination.current = 1
- var params = {
- videoSignature: this.checkVideo[0].signature,
- pageSize: 20,
- pageNo: 1,
- }
- getAction('/cutFrame/material/list', params).then((res) => {
- if (res.success) {
- if (res.result.records.length > 0) {
- this.pans[bestIndex].list[nowIndex].chouzhenShow = true
- } else {
- this.pans[bestIndex].list[nowIndex].chouzhenShow = false
- }
- }
- })
- },
- judge(item) {
- var re = /[(.*?)]/g
- var array = []
- var temp
- while ((temp = re.exec(item.text))) {
- array.push(temp[1])
- }
- item.countTag = array.length
- },
- getChange(item, tag, index) {
- this.judge(item)
- var node = document.getElementsByClassName('rending')[index]
- var v = '[' + tag.name + ']'
- if (document.selection) {
- //IE
- node.focus()
- var sel = document.selection.createRange()
- sel.text = v
- sel.select()
- item.description = v
- } else if (node.selectionStart || node.selectionStart == '0') {
- //MOZILLA/GOOGLE
- var startPos = node.selectionStart
- var endPos = node.selectionEnd
- var restoreTop = node.scrollTop
- node.value = node.value.substring(0, startPos) + v + node.value.substring(endPos, node.value.length)
- if (restoreTop > 0) {
- node.scrollTop = restoreTop
- }
- item.text = node.value
- node.focus()
- node.selectionStart = startPos + v.length
- node.selectionEnd = startPos + v.length
- item.description = node.value
- } else {
- //OTHER
- node.value += v
- item.text = node.value
- node.focus()
- item.description = node.value
- }
- },
- getAppList(appId) {
- getAction('/kuaishou/batch/getPageList', {
- accountId: localStorage.getItem('accountId'),
- appId: appId,
- viewComp: 7,
- }).then((res) => {
- if (res.success) {
- this.siteList = res.result
- }
- })
- },
- },
- computed: {
- dirImg() {
- let date = new Date()
- let y = date.getFullYear()
- let MM = date.getMonth() + 1
- MM = MM < 10 ? '0' + MM : MM
- let d = date.getDate()
- d = d < 10 ? '0' + d : d
- return 'image/' + y + '-' + MM + '-' + d + '/'
- },
- dirVideo() {
- let date = new Date()
- let y = date.getFullYear()
- let MM = date.getMonth() + 1
- MM = MM < 10 ? '0' + MM : MM
- let d = date.getDate()
- d = d < 10 ? '0' + d : d
- return 'video/' + y + '-' + MM + '-' + d + '/'
- },
- contentAll() {
- var count,
- arr = []
- if (this.pans[0].list.length > 0) {
- for (let i = 0; i < this.pans[0].list.length; i++) {
- arr.push(...this.pans[0].list[i].checkArrImage, ...this.pans[0].list[i].imageList)
- }
- return arr.length + this.content + this.pans[0].postAdList.length
- } else {
- return 0
- }
- },
- listCheck() {
- if (this.pans[0].list.length > 0) {
- if (
- this.pans[0].list[this.pans[0].list.length - 1].imageUrlList.length == 0 &&
- this.pans[0].list[this.pans[0].list.length - 1].imageList.length == 0
- ) {
- return true
- } else {
- return false
- }
- } else {
- return false
- }
- },
- },
- watch: {
- time(n, o) {
- if (n.length > 0) {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.materialType = this.creativeMaterialType
- params.pageSize = this.ipagination.pageSize
- params.pageNo = 1
- params.status = 0
- params.channelType = this.channelType
- params.startDate = moment(n[0]).format('YYYY-MM-DD') + ' 00:00:00'
- params.endDate = moment(n[1]).format('YYYY-MM-DD') + ' 23:59:59'
- params.orderBy = this.orderBy
- this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
- } else {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.materialType = this.creativeMaterialType
- params.pageSize = this.ipagination.pageSize
- params.pageNo = 1
- params.status = 0
- params.channelType = this.channelType
- params.orderBy = this.orderBy
- this.ipagination.current = 1
- this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
- }
- },
- orderBy(n, o) {
- var params = {}
- params.accountId = localStorage.getItem('accountId')
- params.materialType = this.creativeMaterialType
- params.pageSize = this.ipagination.pageSize
- params.pageNo = 1
- params.status = 0
- params.channelType = this.channelType
- if (this.time.length > 0) {
- params.startDate = moment(this.time[0]).format('YYYY-MM-DD') + ' 00:00:00'
- params.endDate = moment(this.time[1]).format('YYYY-MM-DD') + ' 23:59:59'
- } else {
- }
- params.orderBy = n
- this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
- },
- visibleVideo(n, o) {
- if (!n) {
- closeAllVideoFun()
- }
- },
- clickTrackUrlList(n, o) {
- if (!n) {
- this.trackName = ''
- }
- },
- },
- mounted: function () {
- this.$nextTick(() => {
- Splitting()
- if (localStorage.getItem('pans')) {
- this.pans = JSON.parse(localStorage.getItem('pans')).map((item) => {
- return {
- ...item,
- list: [],
- postAdList: [],
- sceneId: JSON.parse(item.sceneId).map((item) => {
- return parseInt(item)
- }),
- }
- })
- this.pansKey = this.pans[0].key
- // setTimeout(() => {
- // if (
- // this.pans.sceneId.indexOf(5) >= 0 ||
- // this.pans.sceneId.indexOf(1) >= 0 ||
- // this.pans.sceneId.indexOf(7) >= 0 ||
- // this.pans.sceneId.indexOf(6) >= 0
- // ) {
- // this.addCreative(0)
- // }
- // }, 0)
- getAction('/kuaishou/batch/checkCreativeCount', {
- unitId: this.pansKey,
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- this.content = res.result
- })
- getAction('/kuaishou/batch/getActionBarText', {
- campaignId: localStorage.getItem('campaignId')
- ? localStorage.getItem('campaignId')
- : localStorage.getItem('advertisingGroupKey'),
- }).then((res) => {
- if (res.success) {
- this.appList = res.result
- }
- })
- if (localStorage.getItem('appId')) {
- this.showSite = true
- this.getAppList(localStorage.getItem('appId'))
- } else {
- getAction('/kuaishou/batch/getAppId', {
- accountId: localStorage.getItem('accountId'),
- unitId: this.pansKey,
- }).then((res) => {
- if (res.success) {
- if (res.result) {
- this.showSite = true
- this.getAppList(res.result)
- } else {
- this.showSite = false
- }
- }
- })
- }
- }
- getAction('/kuaishou/batch/getCreativeCategory', {
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- if (res.success) {
- console.log(res)
- this.createOptions = res.result
- }
- })
- getAction('/kuaishou/batch/creativeWord', {
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- if (res.success) {
- this.tags = res.result
- }
- })
- getAction('/kuaishou/batch/getCreativeWordStyles', {
- accountId: localStorage.getItem('accountId'),
- }).then((res) => {
- this.stickerStyles = []
- if (res.success) {
- if (res.result) {
- var data = res.result.map((item) => {
- return item.sticker_styles
- })
- data.map((item) => {
- item.map((i) => {
- this.stickerStyles.push(i)
- })
- })
- }
- // console.log(this.stickerStyles)
- } else {
- this.stickerStyles = []
- }
- })
- })
- },
- }
- </script>
- <style lang="scss" scope>
- $colors: #f9ca24, #3498db, #ff7979, #1abc9c, #e74c3c, #f8c291;
- /* Recommended styles for Splitting */
- .splitting .word,
- .splitting .char {
- display: inline-block;
- }
- /* Psuedo-element chars */
- .splitting .char {
- position: relative;
- }
- /**
- * Populate the psuedo elements with the character to allow for expanded effects
- * Set to `display: none` by default; just add `display: block` when you want
- * to use the psuedo elements
- */
- .splitting .char::before,
- .splitting .char::after {
- content: attr(data-char);
- position: absolute;
- top: 0;
- left: 0;
- visibility: hidden;
- transition: inherit;
- user-select: none;
- }
- /* Expanded CSS Variables */
- .splitting {
- /* The center word index */
- --word-center: calc((var(--word-total) - 1) / 2);
- /* The center character index */
- --char-center: calc((var(--char-total) - 1) / 2);
- /* The center character index */
- --line-center: calc((var(--line-total) - 1) / 2);
- }
- .splitting .word {
- /* Pecent (0-1) of the word's position */
- --word-percent: calc(var(--word-index) / var(--word-total));
- /* Pecent (0-1) of the line's position */
- --line-percent: calc(var(--line-index) / var(--line-total));
- }
- .splitting .char {
- /* Percent (0-1) of the char's position */
- --char-percent: calc(var(--char-index) / var(--char-total));
- /* Offset from center, positive & negative */
- --char-offset: calc(var(--char-index) - var(--char-center));
- /* Absolute distance from center, only positive */
- --distance: calc((var(--char-offset) * var(--char-offset)) / var(--char-center));
- /* Distance from center where -1 is the far left, 0 is center, 1 is far right */
- --distance-sine: calc(var(--char-offset) / var(--char-center));
- /* Distance from center where 1 is far left/far right, 0 is center */
- --distance-percent: calc((var(--distance) / var(--char-center)));
- }
- * {
- box-sizing: border-box;
- }
- * {
- margin: 0;
- padding: 0;
- }
- // html, body {
- // height: 100%;
- // }
- .headline {
- align-items: center;
- // background-color: var(--color);
- display: flex;
- font-family: 'Lexend Deca', sans-serif;
- font-weight: 400;
- // font-size: calc(1rem + 15vmin);
- height: 72px;
- justify-content: center;
- // overflow: hidden;
- perspective: 1000px;
- scroll-snap-align: start;
- width: 100%;
- }
- .word,
- .char {
- animation-delay: var(--del);
- animation-direction: var(--dir, normal);
- animation-duration: var(--dur);
- animation-iteration-count: infinite;
- animation-name: var(--name);
- animation-timing-function: var(--tf);
- display: inline-block;
- position: relative;
- transform-origin: 50% 100%;
- z-index: 1;
- }
- // =========================
- // Headline animations
- // =========================
- .headline--yell .char {
- --name: yell;
- --dur: 2s;
- --tf: ease;
- -webkit-transform-origin: 50% 100%;
- transform-origin: 50% 100%;
- }
- @-webkit-keyframes yell {
- 3% {
- -webkit-transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- }
- 6% {
- -webkit-transform: scale(calc(1 * var(--distance-percent) + 1.2)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- transform: scale(calc(1 * var(--distance-percent) + 1.2)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- }
- 12% {
- -webkit-transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- }
- 18% {
- -webkit-transform: scaleY(1) translateY(-2%);
- transform: scaleY(1) translateY(-2%);
- }
- 25% {
- -webkit-transform: scaleY(0.98);
- transform: scaleY(0.98);
- }
- 50% {
- -webkit-transform: scaleY(1);
- transform: scaleY(1);
- }
- 75% {
- -webkit-transform: scale(0.98);
- transform: scale(0.98);
- }
- }
- @keyframes yell {
- 3% {
- -webkit-transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- }
- 6% {
- -webkit-transform: scale(calc(1 * var(--distance-percent) + 1.2)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- transform: scale(calc(1 * var(--distance-percent) + 1.2)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- }
- 12% {
- -webkit-transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- transform: scale(calc(1 * var(--distance-percent) + 1.5)) rotate(calc(15deg * var(--distance-sine)))
- translateY(-10%);
- }
- 18% {
- -webkit-transform: scaleY(1) translateY(-2%);
- transform: scaleY(1) translateY(-2%);
- }
- 25% {
- -webkit-transform: scaleY(0.98);
- transform: scaleY(0.98);
- }
- 50% {
- -webkit-transform: scaleY(1);
- transform: scaleY(1);
- }
- 75% {
- -webkit-transform: scale(0.98);
- transform: scale(0.98);
- }
- }
- </style>
|