123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398 |
- <template>
- <view style="">
-
-
- <text class="numberComment">{{pinlunNum}}条评论</text>
- <view
- :style="'width: '+ Width +'px; height: '+ (Height/num) +'px; margin-top: 20upx; background-color: #fff; display: flex; flex-direction: column;'">
- <text v-if="pinlunList.length == 0"
- :style="'font-size: 14px; font-weight: bold; color: #a3a1a4; margin-top: 150upx; margin-left: '+ (Width/2.9) +'px; position: absolute;'">
- ~ 快来评论吧 ~</text>
- <list :show-scrollbar="false" :scrollable="true" @loadmore="loadmore" @scroll="scrolls">
- <cell v-for="(list,index) in pinlunList">
- <view :style="'width: '+ Width +'px; display: flex; flex-direction: row;'">
-
- <image :src="list.avatar" mode="aspectFill" class="pictrue"></image>
-
- <view
- :style="'width: '+ (Width*0.8) +'px; display: flex; flex-direction: column; margin-top: 40upx; margin-left: 20upx;'">
-
- <view style="display: flex; flex-direction: row;">
- <text class="name">{{list.nickname}}</text>
- <image v-if="list.is_money_level>0" class="vip" src="@/static/images/vip.png"></image>
-
- <view v-if="list.uid == 0"
- style="background-color: #E43D33; border-radius: 5upx; margin-left: 15upx;height: 32upx;display: flex;align-items: center;flex-direction: row;">
- <text
- style="font-size: 9px; font-weight: bold; padding-left: 8upx; padding-right: 8upx; font-weight: bold; color: #FFFFFF;">商家</text>
- </view>
- </view>
-
- <view @click="huifu(index)"
- :style="'width: '+ (Width*0.78) +'px; display: flex; flex-direction: row; flex-wrap: wrap; margin-top: 8upx;'">
- <text
- :style="'width: '+ (Width*0.78) +'px;font-size: 28rpx; font-weight: 400; color: #333; margin-left: 0upx;'">{{list.content}}</text>
-
- </view>
-
- <view
- :style="'width: '+ (Width*0.8) +'px; height: 40upx; display: flex; flex-direction: row; margin-top: 25upx;'">
- <text style="font-size: 12px; color: #a3a1a4;">{{list.add_time}} · {{list.city?list.city:''}}</text>
- <text @click="huifu(index)" class="time">回复</text>
-
- <image v-if="!list.is_like" class="like" @click="tolike(list,index)"
- :src="imgHost + '/statics/images/zan01.png'"></image>
- <image v-if="list.is_like" class="like" @click="tolike(list,index)"
- :src="imgHost + '/statics/images/zan02.png'"></image>
- <text class="likeNum" @click="tolike(list,index)">{{list.like_num}}</text>
- </view>
-
- <block v-for="(li,inde) in list.reply" v-if="list.isShow">
- <view :style="'width: '+ (Width*0.8) +'px; display: flex; flex-direction: row;'">
-
- <image :src="li.avatar" mode="aspectFill" class="childrenPic"></image>
-
- <view
- :style="'width: '+ (Width*0.8*0.87) +'px; display: flex; flex-direction: column; margin-top: 40upx; margin-left: 20upx;'">
- <view style="display: flex; flex-direction: row;">
- <view style="display: flex; flex-direction: row;">
-
- <text class="childrenName">{{li.nickname}}</text>
- <image v-if="li.is_money_level>0" class="vip"
- src="@/static/images/vip.png"></image>
-
- <view v-if="li.uid==0"
- style="background-color: #E43D33; border-radius: 5upx; margin-left: 15upx;height: 32upx;display: flex;align-items: center;flex-direction: row;">
- <text
- style="font-size: 9px; font-weight: bold; padding-left: 8upx; padding-right: 8upx; font-weight: bold; color: #FFFFFF;">商家</text>
- </view>
- </view>
-
-
-
-
- {{li.gethuifuUser}}
-
-
-
- </view>
-
- <view
- :style="'width: '+ (Width*0.8*0.85) +'px; display: flex; flex-direction: row; flex-wrap: wrap; margin-top: 8upx;word-break: break-all;'">
- <text
- :style="'width: '+ (Width*0.8*0.85) +'px;font-size: 28rpx; font-weight: 400; color: #333; margin-left: 0upx;'">{{li.content}}</text>
- </view>
-
-
-
- <view
- :style="'width: '+ (Width*0.8*0.87) +'px; height: 40upx; display: flex; flex-direction: row; margin-top: 16upx;'">
- <text style="font-size: 12px; color: #a3a1a4;">{{li.add_time}} · {{li.city?li.city:''}}</text>
-
-
- <image class="childrenLike" v-if="!li.is_like"
- @click="tosonlike(index,inde,li)"
- :src="imgHost + '/statics/images/zan01.png'"></image>
- <image class="childrenLike" v-if="li.is_like"
- @click="tosonlike(index,inde,li)"
- :src="imgHost + '/statics/images/zan02.png'"></image>
- <text class="childrenLikeNum"
- @click="tosonlike(index,inde,li)">{{li.like_num}}</text>
- </view>
- </view>
- </view>
- </block>
-
- <view v-if="list.reply_count > 0"
- :style="'width: '+ (Width*0.8) +'px; display: flex; flex-direction: row; margin-top: 30upx;'">
- <view
- style="width: 60upx; height: 1px; background-color: #a3a1a4; opacity: 0.6; margin-top: 13upx;">
- </view>
- <text @click="zhangkai(index,list)" v-if="list.reply_count!=list.reply.length"
- style="font-size: 12px; font-weight: bold; color: #cdcbd4; margin-left: 12upx;">展开{{list.reply_count}}条回复</text>
- <text @click="shouqi(list)" v-if="list.reply.length"
- style="font-size: 12px; font-weight: bold; color: #cdcbd4; margin-left: 12upx;">收起</text>
- </view>
- </view>
- </view>
-
- <view v-if="index == (pinlunList.length-1)" :style="'width: '+ Width +'px; height: 80px;'"></view>
- </cell>
- </list>
- </view>
-
- <view v-if="show && ischangepinlun==false" @touchstart="parentPinglun"
- :style="'width: '+ Width +'px; height: '+ plHeight +'px; background-color: #fff; position: fixed; bottom: 0;'">
- <view
- :style="'width: '+ (Width-30) +'px; height: 32px; margin-left: 15px; margin-top: 14upx; background-color: #eee; border-radius: 100upx; display: flex; flex-direction: row;'">
- <text v-if="platform=='ios'"
- style="font-size: 14px; color: #999; margin-top: 17upx; margin-left: 30upx;">说点什么呗~</text>
- <text v-if="platform!=='ios'"
- style="font-size: 14px; color: #999; margin-top: 13upx; margin-left: 30upx;">说点什么呗~</text>
- <image :src="imgHost + '/statics/images/send01.png'"
- style="width: 40upx; margin-top: 15upx; height: 40upx; position: absolute; right: 25upx;"></image>
- </view>
- </view>
- <view v-if="show && ischangepinlun==true" @touchstart="parentPinglun"
- :style="'width: '+ Width +'px; height: 53px; background-color: #fff;position: fixed; bottom: 0;'">
- <view
- :style="'width: '+ (Width-30) +'px; height: 32px;margin-left: 15px; margin-top: 20upx; background-color: #eee; border-radius: 100upx; display: flex; flex-direction: row;'">
- <text v-if="platform=='ios'"
- style="font-size: 14px; color: #a3a1a4; margin-top: 17upx; margin-left: 30upx;">说点什么呗~</text>
- <text v-if="platform!=='ios'"
- style="font-size: 14px; color: #a3a1a4; margin-top: 13upx; margin-left: 30upx;">说点什么呗~</text>
- <image :src="imgHost + '/statics/images/send01.png'"
- style="width: 40upx; margin-top: 15upx; height: 40upx; position: absolute; right: 25upx;"></image>
- </view>
- </view>
-
- <uni-popup type="bottom" ref="openPinglun" @touchmove.stop.prevent="movehandle" @change="change">
- <view style="display: flex; flex-direction: column;">
- <view @click="openPinglun"
- :style="'width: '+ Width +'px; background-color: #FFFFFF; display: flex; flex-direction: row;'">
- <view
- :style="'width: '+ (Width-30)*percent +'px; margin-left: 15px; margin-top: 20upx; background-color: #f2f0f4; border-radius: '+ borderRadius +'upx; margin-bottom: 20upx; display: flex; flex-direction: row;'">
-
- <textarea
- :style="'width: '+ (Width-60)*percent +'px; height: 20px; margin-bottom: 20upx; font-size: 15px; color: #000000; margin-top: 20upx; margin-left: 30upx;'"
- :placeholder="placeholder" :cursor-spacing="cursorSpacing" :auto-focus="autoFocus"
- :auto-height="autoHeight" :adjust-position="adjustPosition" v-model="value" maxlength="150"
- @linechange="linechange" @keyboardheightchange="keyboardheightchange" @focus="focus"
- @click="clickTextarea" @blur="blur"></textarea>
-
-
-
- </view>
-
- <view v-if="(value!=='' || imageURL !== '') && isSend" @click="sendSMS"
- style="width: 30px; height: 30px; border-radius: 40px; margin-top: 30upx; margin-left: 20upx;">
- <image :src="imgHost + '/statics/images/send02.png'" style="width: 30px; height: 30px;"></image>
- </view>
- </view>
- </view>
-
- <view v-if="isShowImage" :style="'width: '+ Width +'px; height: 75px; background-color: #FFFFFF;'">
- <view style="display: flex; flex-direction: row;">
- <image :src="imageURL" mode="aspectFill"
- style="width: 120upx; height: 120upx; margin-top: 10upx; margin-left: 50upx;"></image>
-
- </view>
- </view>
-
- <view :style="'width: '+ Width +'px; height: '+ emojiHeight +'px; background-color: #FFFFFF;'">
-
- <block v-if="isToShow">
-
-
-
- <swiper
- :style="'width: '+ Width +'px; height: '+ (emojiHeight-40) +'px; background-color: #FFFFFF;'"
- :current="current" @change="currentChange">
- <swiper-item>
- <scroll-view
- :style="'width: '+ Width +'px; height: '+ (emojiHeight-40) +'px; background-color: #FFFFFF;'"
- :scroll-y="true">
- <text v-if="nowImage.length !== 0" @click="qingkonGIF"
- style="font-size: 12px; margin-top: 20upx; position: absolute; right: 40upx; color: #007AFF;">清空</text>
- <view style="display: flex; flex-direction: row; flex-wrap: wrap; margin-top: 40upx;">
- <block v-for="(list,index) in nowImage">
- <image @click="clicknowImage(index)" :src="list" mode="aspectFill"
- style="width: 120upx; height: 120upx; margin-top: 40upx; margin-left: 55upx;">
- </image>
-
- </block>
- <block v-if="nowImage.length == 0">
- <text
- :style="'font-size: 14px; color: #999999; margin-top: 200upx; margin-left: '+ (Width/3.2) +'px;'">~
- 您还没使用过图片 ~</text>
- </block>
- </view>
- <view :style="'width: '+ Width +'px; height: 80px;'"></view>
- </scroll-view>
- </swiper-item>
- <swiper-item>
- <scroll-view
- :style="'width: '+ Width +'px; height: '+ (emojiHeight-40) +'px; background-color: #FFFFFF;'"
- :scroll-y="true">
- <block v-if="nowTimeEmojiList.length !== 0">
- <text style="font-size: 12px; margin-top: 20upx; margin-left: 30upx;">最近使用</text>
- <text @click="qingkon"
- style="font-size: 12px; margin-top: 20upx; position: absolute; right: 40upx; color: #007AFF;">清空</text>
- <view
- style="display: flex; flex-direction: row; flex-wrap: wrap; margin-bottom: 20upx;">
-
- <block v-for="(list,index) in nowTimeEmojiList">
- <image @click="clicknowTimeEmoji(index)"
- :src="'../../static/emojis/qq/'+list.url+''"
- style="width: 35px; height: 35px; margin-top: 30upx; margin-left: 36upx;">
- </image>
- </block>
-
-
- </view>
- </block>
- <text style="font-size: 12px; margin-top: 20upx; margin-left: 30upx;">全部表情</text>
- <view style="display: flex; flex-direction: row; flex-wrap: wrap;">
-
- <block v-for="(list,index) in emojilist">
- <image @click="clickEmoji(index)" :src="'../../static/emojis/qq/'+list.url+''"
- style="width: 35px; height: 35px; margin-top: 30upx; margin-left: 36upx;">
- </image>
- </block>
-
-
- </view>
- <view :style="'width: '+ Width +'px; height: 80px;'"></view>
- </scroll-view>
- <view v-if="platform=='ios'"
- style="position: absolute; display: flex; flex-direction: row; bottom: 0; right: 0; width: 300upx; height: 160upx; background-color: #FFFFFF; box-shadow: -20px -40px 20px 60upx #FFFFFF; border-radius: 2upx;">
- <view @click="undo"
- style="width: 130upx; height: 60upx; margin-top: 20upx; border-radius: 40upx; border: 1upx solid #c6c5c8;">
-
- </view>
-
- <view v-if="(value!=='' || imageURL !== '') && isSend" @click="sendSMS"
- style="width: 130upx; height: 60upx; margin-top: 20upx; margin-left: 20upx; border-radius: 40upx; background-color: #ff1a63;">
- <text
- style="font-size: 14px; font-weight: bold; text-align: center; color: #FFFFFF; padding-top: 10upx;">发送</text>
- </view>
- <view v-if="(value == '' && imageURL == '') && isSend"
- style="width: 130upx; height: 60upx; margin-top: 20upx; margin-left: 20upx; border-radius: 40upx; background-color: #bab9bb;">
- <text
- style="font-size: 14px; font-weight: bold; text-align: center; color: #FFFFFF; padding-top: 10upx;">发送</text>
- </view>
- </view>
- <view v-if="platform!=='ios'"
- style="position: absolute; display: flex; flex-direction: row; bottom: 20upx; right: 20upx; width: 300upx; height: 80upx; padding: 10upx; background-color: #eceef1; border-radius: 20upx;">
- <view @click="undo"
- style="width: 130upx; height: 60upx; margin-top: 0; border-radius: 40upx; border: 1upx solid #c6c5c8;">
- <image src="../../static/douyin/shanchu-3.png"
- style="width: 45upx; height: 30upx; margin-top: 15upx; margin-left: 40upx;">
- </image>
- </view>
-
- <view v-if="(value!=='' || imageURL !== '') && isSend" @click="sendSMS"
- style="width: 130upx; height: 60upx; margin-top: 0; margin-left: 20upx; border-radius: 40upx; background-color: #ff1a63;">
- <text
- style="font-size: 14px; font-weight: bold; text-align: center; color: #FFFFFF; padding-top: 10upx;">发送</text>
- </view>
- <view v-if="(value == '' && imageURL == '') && isSend"
- style="width: 130upx; height: 60upx; margin-top: 0; margin-left: 20upx; border-radius: 40upx; background-color: #bab9bb;">
- <text
- style="font-size: 14px; font-weight: bold; text-align: center; color: #FFFFFF; padding-top: 10upx;">发送</text>
- </view>
- </view>
- </swiper-item>
- <swiper-item>
- <scroll-view
- :style="'width: '+ Width +'px; height: '+ (emojiHeight-40) +'px; background-color: #FFFFFF;'"
- :scroll-y="true">
- <view style="display: flex; flex-direction: row; flex-wrap: wrap;">
- <view v-if="platform=='ios'" @click="addlikeImage"
- style="width: 120upx; height: 120upx; border-radius: 10upx; border: 1upx dashed #000000; margin-top: 40upx; margin-left: 55upx;">
-
- </view>
- <view v-if="platform!=='ios'" @click="addlikeImage"
- style="width: 120upx; height: 120upx; border-radius: 10upx; border: 1px solid #000000; margin-top: 40upx; margin-left: 55upx;">
-
- </view>
- <block v-for="(list,index) in likeImage">
- <image @click="clickLikeImage(index)" :src="list" mode="aspectFill"
- style="width: 120upx; height: 120upx; margin-top: 40upx; margin-left: 55upx;">
- </image>
-
- </block>
- </view>
- <view :style="'width: '+ Width +'px; height: 80px;'"></view>
- </scroll-view>
- </swiper-item>
- <swiper-item>
- <scroll-view
- :style="'width: '+ Width +'px; height: '+ (emojiHeight-40) +'px; background-color: #FFFFFF;'"
- :scroll-y="true" @scrolltolower="scrolltolowerGIF">
- <view style="display: flex; flex-direction: row; flex-wrap: wrap;">
- <view v-if="platform=='ios'" @click="searchGIF"
- style="width: 120upx; height: 120upx; border-radius: 10upx; border: 1upx dashed #000000; margin-top: 40upx; margin-left: 55upx;">
-
- </view>
- <view v-if="platform!=='ios'" @click="searchGIF"
- style="width: 120upx; height: 120upx; border-radius: 10upx; border: 1px solid #000000; margin-top: 40upx; margin-left: 55upx;">
-
- </view>
- <block v-for="(list,index) in gifAndpnglist">
- <image @click="clickGIF(index)" :src="list.url" mode="aspectFill"
- style="width: 120upx; height: 120upx; margin-top: 40upx; margin-left: 55upx;">
- </image>
- </block>
- </view>
- <view :style="'width: '+ Width +'px; height: 80px;'"></view>
- </scroll-view>
- </swiper-item>
- </swiper>
- </block>
- <block v-if="!isToShow">
-
- </block>
- </view>
- </uni-popup>
-
- <uni-popup type="bottom" ref="searchEmoji" @touchmove.stop.prevent="movesearch" @change="searchGIFChange">
- <view v-if="searchGIFValue !== ''"
- :style="'width: '+ Width +'px; height: 80px; border-bottom: 1upx solid #e3e1e5; background-color: #FFFFFF; border-top-left-radius: 20upx; border-top-right-radius: 20upx;'">
-
- <scroll-view
- :style="'width: '+ Width +'px; height: 80px; border-bottom: 1upx solid #e3e1e5; display: flex; flex-direction: row;'"
- :scroll-x="true" style="display: flex; flex-direction: row;" :show-scrollbar="false">
- <block v-for="(list,index) in GifList">
- <image @click="selectGIF(index)" :src="list.url" mode="aspectFill"
- style="width: 120upx; height: 120upx; margin-top: 20upx; margin-left: 20upx;"></image>
- </block>
- <view style="width: 20upx; height: 120upx; margin-left: 10upx;"></view>
- </scroll-view>
- </view>
-
- <view :style="'width: '+ Width +'px; background-color: #FFFFFF; display: flex; flex-direction: row;'">
- <view
- :style="'width: '+ (Width-30) +'px; margin-left: 15px; margin-top: 20upx; background-color: #FFFFFF; margin-bottom: 20upx; display: flex; flex-direction: row;'">
- <input
- :style="'width: '+ (Width*0.8) +'px; height: 20px; margin-bottom: 20upx; font-size: 15px; color: #000000; margin-top: 15upx; margin-left: 30upx;'"
- placeholder="搜索表情包" v-model="searchGIFValue" :auto-focus="false" :adjust-position="false"
- @blur="blurGIF" />
-
- </view>
- </view>
- <view v-if="platform=='ios'"
- :style="'width: '+ Width +'px; height: '+ (emojiHeight+40) +'px; background-color: #FFFFFF;'">
-
- </view>
- <view v-if="platform!=='ios'"
- :style="'width: '+ Width +'px; height: '+ emojiHeight +'px; background-color: #FFFFFF;'">
-
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
-
-
-
-
-
- import parsehtml from '../../common/html-parse/parse_html.js'
-
- import time from '../../common/time-utils/currentData.js'
- import {
- HTTP_REQUEST_URL
- } from '@/config/app';
- import {
- commentList,
- markeComment,
- replyCommentList,
- replyCommentLike
- } from '@/api/short-video.js';
- import {
- mapGetters
- } from 'vuex';
- export default {
- name: "douyin-scrollview",
- props: {
- Width: {
- type: Number,
- default: 0
- },
- Height: {
- type: Number,
- default: 0
- },
- deleteIOSHeight: {
- type: Number,
- default: 0
- },
- deleteAndroidHeight: {
- type: Number,
- default: 0
- }
- },
- computed: mapGetters(['uid']),
- data() {
- return {
- videoID: 0,
- pinlunNum: 0,
-
-
-
- num: 1.15,
- plHeight: 0,
- value: "",
- autoHeight: false,
- borderRadius: 100,
- lineheight: 0,
- percent: 1,
- show: true,
- emojiHeight: 0,
- emojiheight: 0,
- cursorSpacing: 20,
- autoFocus: true,
- isopen: false,
- isToShow: false,
- adjustPosition: false,
- placeholder: "说点什么呗~",
-
- current: 1,
- emojilist: [],
- nowTimeEmojiList: [],
- sinaEmojilist: [],
- currentNum: 4.4,
- likeImage: [],
- nowImage: [],
- gifAndpngList: [],
- gifAndpnglist: [],
- searchGIFValue: "",
- isSearcopen: false,
- GifList: [],
- isShowImage: false,
- imageURL: "",
- platform: "",
- systemVerson: "",
- ischangepinlun: true,
-
-
- pinlunList: [],
- pinlunListX: [],
- pinlun_list: [],
- isSend: true,
- userID: "",
- videouserID: "",
- update: true,
- huifuUser: "",
- gethuifuUser: "",
- gethuifuUserID: "",
- istohuifu: false,
- huifuindex: -1,
- iszhangkai: false,
- imgHost: HTTP_REQUEST_URL,
-
- limit: 10,
- page: 1,
- pages: 1,
- parentNum: 0
- };
- },
- watch: {
-
- searchGIFValue(val) {
- this.isopen = false;
- if (val !== '') {
- var sms = []
- for (let i = 0; i < this.gifAndpngList.length; i++) {
- if (this.gifAndpngList[i].name.indexOf(val) !== -1) {
- sms.push(this.gifAndpngList[i]);
- }
- }
- this.GifList = sms;
- }
- },
-
- value(val) {
- if (val == "") {
- this.autoHeight = false
- if (this.imageURL !== '') {
- this.percent = 0.9
- } else {
- this.percent = 1
- }
- } else {
- this.autoHeight = true
- this.percent = 0.9
- }
- },
-
- imageURL(val) {
- if (val !== '') {
- this.percent = 0.9
- } else {
- if (this.value == '') {
- this.percent = 1
- }
- }
- },
-
- lineheight(newVal, oldVal) {
- if (Math.abs(newVal) < 30) {
- this.borderRadius = 100
- } else {
- this.borderRadius = 30
- }
- }
- },
-
- created() {
-
- this.isToShow = false;
-
- var model = uni.getSystemInfoSync().model;
-
- this.platform = uni.getSystemInfoSync().platform;
-
- var systemVerson = uni.getSystemInfoSync().system
- if (systemVerson.split(' ')[0] == "Android") {
- if (systemVerson.split(' ')[1] < 9) {
-
- this.ischangepinlun = false
- this.windowHeight = uni.getSystemInfoSync().screenHeight;
- this.emojiHeight = this.windowHeight / 2.1 - this.deleteAndroidHeight;
- } else {
-
- this.ischangepinlun = true
- this.windowHeight = uni.getSystemInfoSync().screenHeight;
- this.emojiHeight = this.windowHeight / 2.6 - this.deleteAndroidHeight;
- }
- } else {
- if (uni.getSystemInfoSync().platform == 'ios' && (model !== 'iPhone6' || model !== 'iPhone6s' || model !==
- 'iPhone7' || model !== 'iPhone8')) {
-
- this.ischangepinlun = true
- this.windowHeight = uni.getSystemInfoSync().screenHeight;
- this.emojiHeight = this.windowHeight / 2.2 - this.deleteIOSHeight;
- } else {
-
- this.ischangepinlun = false
- this.windowHeight = uni.getSystemInfoSync().screenHeight;
- this.emojiHeight = this.windowHeight / 2.1 - this.deleteIOSHeight;
- }
- }
-
- this.videoID = uni.getStorageSync("videoID");
-
- this.pinlunNum = uni.getStorageSync("pinlunNum");
-
- this.userID = uni.getStorageSync("user")._id;
-
- this.getnewpinlun();
-
- if (uni.getSystemInfoSync().platform == 'ios' && (model !== 'iPhone6' || model !== 'iPhone6s' || model !==
- 'iPhone7' || model !== 'iPhone8')) {
- this.num = 1.25
- } else {
- this.num = 1.15
- }
- if (uni.getSystemInfoSync().platform == 'ios') {
- this.adjustPosition = true
- } else {
- this.adjustPosition = false
- }
- this.plHeight = this.Height - (this.Height / this.num);
- console.log(this.plHeight);
-
- this.focus();
-
- if (this.imageURL !== '') {
- this.percent = 0.9
- }
-
-
-
-
- this.likeImage = uni.getStorageSync("likeImage");
-
- this.nowImage = uni.getStorageSync("nowImage");
-
- this.nowTimeEmojiList = uni.getStorageSync("nowTimeEmojiList");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- methods: {
-
- getnewpinlun() {
-
- commentList(this.videoID, {
- limit: 10,
- page: this.pages
- }).then(res => {
- this.pages = this.pages + 1
- this.pinlunList = this.pinlunList.concat(res.data);
- }).catch(err => {
- return uni.showToast({
- title: err,
- icon: 'none',
- duration: 2000
- });
- })
- },
- sendSMS() {
- this.isSend = false;
- uni.showLoading({
- title: '正在发送...'
- })
- let pid = this.parentNum ? 0 : this.pinlunList[this.huifuindex].id;
- let data = {
- id: this.videoID,
- pid: pid,
- content: this.value
- }
- markeComment(data).then(res => {
- uni.hideLoading();
- this.pinlunNum = this.pinlunNum + 1;
- this.$emit('pinlunFun', this.pinlunNum)
- this.value = "";
- this.imageURL = "";
- this.$refs.openPinglun.close();
- this.isSend = true;
- this.pages = 1;
- this.pinlunList = [];
- this.getnewpinlun();
- }).catch(err => {
- return uni.showToast({
- title: err,
- icon: 'none',
- duration: 2000
- });
- });
- },
- loadmore() {
- this.getnewpinlun();
- },
- scrolls() {},
- tolike(item, index) {
-
- replyCommentLike('like', item.id).then(res => {
- this.pinlunList[index].is_like = !this.pinlunList[index].is_like
- const video = this.pinlunList[index];
- item.is_like ? video.like_num += 1 : video.like_num -= 1;
- }).catch(err => {
- return uni.showToast({
- title: err,
- icon: 'none',
- duration: 2000
- });
- })
- },
- tosonlike(index, inde, item) {
- replyCommentLike('like', item.id).then(res => {
- this.pinlunList[index].reply[inde].is_like = !this.pinlunList[index].reply[inde].is_like
- const video = this.pinlunList[index].reply[inde];
- item.is_like ? video.like_num += 1 : video.like_num -= 1;
- }).catch(err => {
- return uni.showToast({
- title: err,
- icon: 'none',
- duration: 2000
- });
- })
- },
- zhangkai(index, item) {
-
- if (item.isShow == undefined || item.isShow == 'undefined') {
- this.page = 1;
- }
- replyCommentList(item.id, {
- limit: this.limit,
- page: this.page
- }).then(res => {
- this.page = this.page + 1;
- item.reply = item.reply.concat(res.data);
- if (item.reply.length) {
- item.isShow = true;
- }
- this.$set(this, 'pinlunList', this.pinlunList);
- }).catch(err => {
- return uni.showToast({
- title: err,
- icon: 'none',
- duration: 2000
- });
- })
- },
- shouqi(item) {
- this.page = 1
- item.reply = [];
- item.isShow = false;
- this.$set(this, 'pinlunList', this.pinlunList);
- },
- deletesonpinlun(index, inde) {},
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- addlikeImage() {
- uni.showModal({
- title: '⏰演示项目提醒⏰',
- content: '请前往 douyin-scrollview.nvue组件\naddlikeImage()函数进行配置',
- success: () => {}
- })
- },
-
- sonhuifu(index, inde) {
-
-
- this.huifuUser = uni.getStorageSync("user").username;
- this.gethuifuUser = this.pinlunList[index].sonPinlun[inde].username;
- this.gethuifuUserID = this.pinlunList[index].sonPinlun[inde].userID;
- this.istohuifu = true;
- this.placeholder = "回复:" + this.gethuifuUser;
- this.huifuindex = index;
- this.openPinglun();
- },
- huifu(index) {
-
-
- this.parentNum = 0;
- this.placeholder = "回复:" + this.pinlunList[index].nickname;
- this.huifuindex = index;
- this.openPinglun();
- },
- clicknowImage(index) {
-
- this.imageURL = this.nowImage[index];
- this.isShowImage = true;
- },
- selectGIF(index) {
-
-
- this.imageURL = this.GifList[index].url;
- this.isShowImage = true;
- this.searchGIFValue = ""
- this.$refs.searchEmoji.close();
- if (uni.getStorageSync("nowImage").length == 0) {
- this.nowImage = []
- this.nowImage.push(this.imageURL)
- uni.setStorageSync("nowImage", this.nowImage);
- } else {
- this.nowImage = uni.getStorageSync("nowImage");
- let isTrue = true;
- for (let i = 0; i < this.nowImage.length; i++) {
- if (this.imageURL == this.nowImage[i]) {
- isTrue = false;
- }
- }
- if (isTrue) {
- this.nowImage.push(this.imageURL)
- }
- uni.setStorageSync("nowImage", this.nowImage);
- }
- },
- deleteimageURL() {
-
- this.imageURL = "";
- this.isShowImage = false;
- },
- clickGIF(index) {
-
-
- this.imageURL = this.gifAndpnglist[index].url;
- this.isShowImage = true;
- if (uni.getStorageSync("nowImage").length == 0) {
- this.nowImage = []
- this.nowImage.push(this.imageURL)
- uni.setStorageSync("nowImage", this.nowImage);
- } else {
- this.nowImage = uni.getStorageSync("nowImage");
- let isTrue = true;
- for (let i = 0; i < this.nowImage.length; i++) {
- if (this.imageURL == this.nowImage[i]) {
- isTrue = false;
- }
- }
- if (isTrue) {
- this.nowImage.push(this.imageURL)
- }
- uni.setStorageSync("nowImage", this.nowImage);
- }
- },
- clearSearchValue() {
-
- this.searchGIFValue = ""
- },
- blurGIF() {
-
-
- if (this.searchGIFValue == '') {
- this.$refs.searchEmoji.close();
- }
- },
- searchGIF() {
-
-
- if (uni.getSystemInfoSync().platform == 'ios') {
- this.$refs.searchEmoji.open('bottom');
- } else {
- setTimeout(() => {
- this.$refs.searchEmoji.open('bottom');
- }, 500)
- }
- },
- deletenowImage(index) {
-
- var sms = []
- for (let i = 0; i < this.nowImage.length; i++) {
- if (this.nowImage[i] !== this.nowImage[index]) {
- sms.push(this.nowImage[i])
- }
- }
- this.nowImage = sms;
- uni.setStorageSync("nowImage", this.nowImage);
- },
- clickLikeImage(index) {
-
-
- if (uni.getStorageSync("nowImage").length == 0) {
- this.nowImage = []
- this.nowImage.push(this.likeImage[index])
- uni.setStorageSync("nowImage", this.nowImage);
- } else {
- this.nowImage = uni.getStorageSync("nowImage");
- let isTrue = true;
- for (let i = 0; i < this.nowImage.length; i++) {
- if (this.likeImage[index] == this.nowImage[i]) {
- isTrue = false;
- }
- }
- if (isTrue) {
- this.nowImage.push(this.likeImage[index])
- }
- uni.setStorageSync("nowImage", this.nowImage);
- }
- },
- deleteImage(index) {
-
-
- uni.showModal({
- title: '确定删除?',
- success: (re) => {
- if (re.confirm) {
- uni.removeSavedFile({
- filePath: this.likeImage[index],
- success: () => {
- var sms = []
- for (let i = 0; i < this.likeImage.length; i++) {
- if (this.likeImage[i] !== this.likeImage[index]) {
- sms.push(this.likeImage[i])
- }
- }
- var smh = []
- for (let i = 0; i < this.nowImage.length; i++) {
- if (this.nowImage[i] !== this.likeImage[index]) {
- smh.push(this.nowImage[i])
- }
- }
- this.nowImage = smh;
- uni.setStorageSync("nowImage", this.nowImage);
- this.likeImage = sms;
- uni.setStorageSync("likeImage", this.likeImage);
- }
- });
- }
- }
- })
- },
- qingkonGIF() {
-
- uni.showModal({
- title: '确定清空?',
- success: (re) => {
- if (re.confirm) {
- this.nowImage = []
- uni.removeStorageSync("nowImage");
- }
- }
- })
- },
- searchGIFChange(e) {
- },
- change(e) {
-
-
- this.isToShow = false;
- if (e.show == true) {
- this.show = false;
- this.getGif();
- } else {
- uni.hideKeyboard();
- this.show = true
- this.autoFocus = true;
- this.isopen = false;
- this.current = 1;
- this.currentNum = 4.4;
- this.isShowImage = false;
- this.cursorSpacing = 20;
- this.placeholder = "说点什么呗~";
- this.istohuifu = false;
- }
- },
-
-
- clickTextarea() {
- this.isopen = false;
- if (uni.getSystemInfoSync().platform == 'ios') {
- this.autoFocus = false;
- setTimeout(() => {
- this.autoFocus = true;
- }, 200)
- }
- },
- closeSheet() {
- this.$emit('closeScrollview');
- },
- movehandle() {},
- movesearch() {},
- parentPinglun() {
- this.parentNum = 1;
- this.openPinglun();
- },
- openPinglun() {
- this.$refs.openPinglun.open('bottom')
- },
- linechange(event) {
- this.lineheight = event.detail.height
- },
- keyboardheightchange() {},
- blur() {
- uni.hideKeyboard();
- },
- focus() {
- if (uni.getSystemInfoSync().platform == 'ios') {
- this.autoFocus = false;
- this.isopen = true;
- }
- setTimeout(() => {
- this.autoFocus = true;
- this.isopen = false;
- setTimeout(() => {
- if (uni.getSystemInfoSync().platform == 'ios') {
- this.isToShow = true;
- }
- if (this.imageURL !== '') {
- this.isShowImage = true;
- }
- }, 1500)
- }, 20)
- },
- toemoji() {
- if (this.isopen == false) {
- this.isopen = true;
- setTimeout(() => {
- this.isToShow = true;
- }, 500)
- uni.hideKeyboard();
- } else {
- if (uni.getSystemInfoSync().platform == 'ios') {
- this.isShowImage = false;
- } else {
- this.isToShow = false;
- }
- this.isopen = false;
- this.autoFocus = false;
- setTimeout(() => {
- this.autoFocus = true;
- if (this.imageURL !== '') {
- setTimeout(() => {
- this.isShowImage = true;
- }, 1300)
- }
- }, 20)
- }
- },
- undo() {
- if (this.value !== "") {
- var str = ""
- for (let i = 0; i < this.value.length - 1; i++) {
- str += this.value[i]
- }
- this.value = str;
- }
- },
- timeEmoji() {
- this.currentNum = 1
- this.current = 0
- },
- nowEmoji() {
- this.currentNum = 4.3
- this.current = 1
- },
- likeEmoji() {
- this.currentNum = 7.6
- this.current = 2
- },
- gifEmoji() {
- this.currentNum = 11.0
- this.current = 3
- },
- qingkon() {
- uni.showModal({
- title: '确定清空?',
- success: (re) => {
- if (re.confirm) {
- this.nowTimeEmojiList = []
- uni.removeStorageSync("nowTimeEmojiList");
- }
- }
- })
- },
- clicknowTimeEmoji(index) {
- var str = this.nowTimeEmojiList[index].alt;
- this.value += str;
- },
- clickEmoji(index) {
-
- var str = this.emojilist[index].alt;
- this.value += str;
- if (uni.getStorageSync("nowTimeEmojiList").length == 0) {
- this.nowTimeEmojiList = []
- this.nowTimeEmojiList.push(this.emojilist[index])
- uni.setStorageSync("nowTimeEmojiList", this.nowTimeEmojiList);
- } else {
- this.nowTimeEmojiList = uni.getStorageSync("nowTimeEmojiList");
- let isTrue = true;
- for (let i = 0; i < this.nowTimeEmojiList.length; i++) {
- if (this.emojilist[index].alt == this.nowTimeEmojiList[i].alt) {
- isTrue = false;
- }
- }
- if (isTrue) {
- this.nowTimeEmojiList.push(this.emojilist[index])
- }
- uni.setStorageSync("nowTimeEmojiList", this.nowTimeEmojiList);
- }
- },
- clicksinaEmoji(index) {
- console.log(this.sinaEmojilist[index])
- },
- currentChange(e) {
- var num = e.detail.current + 1
- switch (num) {
- case 1:
- this.currentNum = 1
- break;
- case 2:
- this.currentNum = 4.3
- break;
- case 3:
- this.currentNum = 7.6
- break;
- case 4:
- this.currentNum = 11.0
- break;
- default:
- break;
- }
- },
- getGif() {
- var list = []
- for (let i = 0; i < 15; i++) {
- var num = Math.round(Math.random() * this.gifAndpngList.length);
- list.push(this.gifAndpngList[num]);
- }
- this.gifAndpnglist = list
- },
- scrolltolowerGIF() {
- for (let i = 0; i < 15; i++) {
- var num = Math.round(Math.random() * this.gifAndpngList.length);
- this.gifAndpnglist.push(this.gifAndpngList[num]);
- }
- }
-
- }
- }
- </script>
- <style lang="scss">
- .vip {
- width: 56rpx;
- height: 20rpx;
- margin-top: 5rpx;
- margin-left: 16rpx;
- }
- .closeBnt {
- position: absolute;
- right: 30rpx;
- margin-top: 34rpx;
- width: 30rpx;
- height: 30rpx;
- }
- .numberComment {
- font-size: 26rpx;
- font-weight: 500;
- text-align: center;
- color: #333;
- margin-top: 34rpx;
- }
- .pictrue {
- width: 60rpx;
- height: 60rpx;
- border: 1px solid #fff;
- border-radius: 50rpx;
- margin-top: 20px;
- margin-left: 15px;
- }
- .name {
- font-size: 24rpx;
- font-weight: 500;
- color: #666;
- }
- .time {
- font-size: 12px;
- font-weight: 400;
- color: #999999;
- margin-left: 10px;
- margin-top: 2rpx;
- }
- .like {
- color: #999;
- position: absolute;
- right: 45rpx;
- margin-left: 5rpx;
- width: 26rpx;
- height: 26rpx;
- }
- .likeNum {
- font-size: 22rpx;
- color: #a3a1a4;
- position: absolute;
- right: 22rpx;
- margin-top: 2rpx;
- }
- .childrenPic {
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- margin-top: 20px;
- }
- .childrenName {
- font-size: 24rpx;
- font-weight: 500;
- color: #666;
- }
- .childrenLike {
- color: #999;
- position: absolute;
- right: 20rpx;
- width: 27rpx;
- height: 27rpx;
- }
- .childrenLikeNum {
- font-size: 22rpx;
- color: #a3a1a4;
- position: absolute;
- right: 0rpx;
- margin-top: 2rpx;
- }
- </style>
|