Ich habe zuvor eine Version des mobilen WeChat-Terminals von h5 erstellt und sie basierend auf der Originalversion aktualisiert Neue werden hinzugefügt: Wechat, Adressbuch, Entdecken und Ich. Das Modul verfügt über Links- und Rechts-Touch- und Slide-Screen-Umschaltung, die Chat-Seite verfügt über eine optimierte Mehrbildvorschau, Videowiedergabe, Menü-Benutzeroberfläche für langes Drücken, der Editor am unteren Rand des Chats wurde neu optimiert und organisiert (mehr Emoticons hinzugefügt). , und das Popup-Fenster verwendet speziell das selbst entwickelte wcPop.js. Schauen Sie sich die Projekt-Renderings an!
HTML-Codeausschnitt:
<!-- //Wechat unteres Funktionspanel--><div class=wc__footTool-panel> <!-- Eingabefeldmodul--> <div class=wc__editor-panel wc__borT flexbox> <div class=wrap-editor flex1 > <div class=editor J__wcEditor contenteditable=true></div></div> <i class=btn btn-emotion></i> <i class=btn btn-choose></i> <button class=btn-submit J__wchatSubmit>Send</button> </div> <!-- Ausdruck, Auswahlmodul--> <div class=wc__choose-panel wc__borT style= display: none;> <!-- Ausdrucksbereich--> <div class=wrap-emotion style=display: none;> <div class=emotion__cells flexbox flex__direction-column> <div class=emotion__cells-swiper flex1 id=J__swiperEmotion> <div class=swiper-container> <div class=swiper-wrapper></div> <div class=pagination-emotion></div> < /div> </div> <div class=emotion__cells-footer id=J__emotionFootTab> <ul class=clearfix> <li class=swiperTmpl cur tmpl=swiper__tmpl-emotion01><img src=img/emotion/face01/face-lbl.png <li class=swiperTmpl tmpl=swiper__tmpl-emotion02><img src=img/emotion/ face02/face-lbl.gif <li class=swiperTmpl tmpl=swiper__tmpl-emotion03><img src=img/emotion/face03/face-lbl.gif <li class=swiperTmpl tmpl=swiper__tmpl-emotion04><img src=img/emotion/face04/face-lbl.gif <li class =swiperTmpl tmpl=swiper__tmpl-emotion05><img src=img/emotion/face05/face-lbl.gif <li class=swiperTmpl tmpl=swiper__tmpl-emotion06><img src=img/emotion/face06/face-lbl.gif <li class=swiperTmplSet><img src=img /wchat/icon__emotion-set.png </ul> </div> </div> </div> <!-- Bereich auswählen--> <div class=wrap-choose style=display: none;> <div class=choose__cells> <ul class=clearfix> <li><a class=J__wchatZp href=javascript :;><span class=img><img src=img/wchat/icon__choose-zp.png /><input type=file Accept=image/* /></span><em>Fotos</em></a></li> <li><a class=J__wchatSp href=javascript:;><span class=img><img src=img/wchat/ icon__choose-sp.png /><input type=file Accept=video/* /></span><em>Video</em></a></li> <li><a class=J__wchatHb href=javascript:;><span class=img><img src=img/wchat/icon__choose-hb.png /></span><em>Roter Umschlag</em></a></li> <li > <a class=J__wchatSc href=javascript:;><span class=img><img src=img/wchat/icon__choose-sc.png /></span><em>Meine Sammlung</em></a></li> <li><a class=J__wchatWj href=javascript:;><span class=img><img src=img/ wchat /icon__choose-wj.png /></span><em>Datei</em></a></li> </ul> </div> </div> </div></div>< div class=wc__choosePanel-tmpl> <!-- //Roter Umschlag template.begin --> <div id=J__popupTmpl-Hongbao style=display:none;> <div class=wc__popupTmpl tmpl-hongbao> <i class=wc-xclose > </i> <ul class=clearfix> <li class=item flexbox> <label class=txt>Gesamtbetrag</label><input class=ipt-txt flex1 type=tel name=hbAmount placeholder=0.00 /><em class=unit>元</em> </li> <li class=item flexbox> <label class=txt>Anzahl der roten Umschläge< /li> label><input class=ipt-txt flex1 type=tel name=hbNum placeholder=fill in the number/><em class=unit>pieces</em> </li> <li class=tips>Die Gesamtzahl der Personen, die online sind, beträgt <em class=memNum>186</em></li> <li class=item item-area> <textarea class=describe name=content placeholder=Herzlichen Glückwunsch zum Reichwerden und Viel Glück></ textarea> </li> <li class=amountTotal>¥<em class=num>0,00</em></li> </ul> </div> </div> <!-- //Roter Umschlag template.end --></div>
Js-Codeausschnitt:
// ...Popup-Menü lange drücken $(#J__chatMsgList).on(longTap, li .msg, function(e){ var that = $(this), menuTpl, menuNode = $(<div class='wc__chatTapMenu animierte anim -fadeIn'></div>); that.addClass(taped); that.parents(li).siblings().find(.msg).removeClass(taped); var isRevoke = that.parents(li).hasClass(me); var _revoke = isRevoke ? <i class='ico i4'></i>Zurückziehen</a> : ; if(that.hasClass(picture)){ console.log(picture long press); <div class='menu menu-picture'><a href='#'><i class='ico i1'></i>Kopieren</a><a href='#'><i class=' ico i2'></i>Sammeln</a><a href='#'><i class='ico i3'></i>Speichern unter</a>+ _revoke +<a href='#' ><i class='ico i5'></i>Delete</a></div>; }else if(that.hasClass(video)){ console.log(video long press); ><a href='#'><i class='ico i3'></i>Speichern unter</a> + _revoke +<a href='#'><i class='ico i5'></i>Delete</a></div>; }else{ console.log(text long press); <i class='ico i1'></i>Kopieren</a><a href='#'><i class='ico i2'></i>Sammeln</a> + _revoke +<a href ='#'><i class='ico i5'></i>Delete</a></div> } if(!$(.wc__chatTapMenu).length){ $(.wc__chatMsg-panel).append(menuNode.html(menuTpl) ); autoPos(); }else{ $(.wc__chatTapMenu).hide().html(menuTpl).fadeIn(250); autoPos(); } function autoPos(){ console.log(that.position().top) var _other = that.parents(li ).hasClass(others); $(.wc__chatTapMenu).css({ position: absolute, left: that.position().left + parseInt(that.css(marginLeft)) + (_other ? 0 : that.outerWidth() - $(.wc__chatTapMenu).outerWidth()), top: that.position().top - $(.wc__chatTapMenu).outerHeight( ) - 8 }});Darstellung:
ZusammenfassenDas Obige ist die vom Herausgeber eingeführte HTML5-High-Imitation-WeChat-Chat- und Emoticon-Funktion. Wenn Sie Fragen haben, hinterlassen Sie mir bitte eine Antwort Sie rechtzeitig. Ich möchte mich auch bei allen für die Unterstützung der VeVb-Kampfsport-Website bedanken!