1 Star 0 Fork 390

你也用拉芳/weixin-chat

forked from 追风少年/weixin-chat 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 24.24 KB
一键复制 编辑 原始数据 按行查看 历史
追风少年 提交于 2023-01-09 22:47 . 新增GIF录制功能
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>在线微信对话生成器 By 追风少年</title>
<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="favicon.ico" />
<script type="text/javascript">
var _path = { images: '' }
var page = { data: {} }
</script>
<link rel="stylesheet" href="static/app/css/zui.min.css">
<link rel="stylesheet" href="static/app/css/app.css">
<link rel="stylesheet" href="static/app/css/wallet.css">
<script type="text/javascript" src="static/app/js/common.bundle.js"></script>
<script type="text/javascript" src="static/app/js/chat.bundle.js"></script>
<script src="static/app/js/html2canvas.min.js"></script>
<!-- gif -->
<script src="./static/app/js/gif.js"></script>
<script src="./static/app/js/gif.worker.js"></script>
</head>
<body>
<div id="vueApp" class="wrapper">
<div class="container-fluid page-content" style="margin-top: 10px;">
<!-- <div id="pageHeader">微信对话生成器</div> -->
<div class="edit-content">
<div class="tab">
<ul class="nav nav-tabs">
<li><a data-tab href="#tabContent1">外观设置</a></li>
<li class="active"><a data-tab href="#tabContent2">对话设置</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="tabContent1">
<!-- 外观设置 -->
<div class="view-setting">
<div class="view-set-item">
<span>手机信号:</span>
<select v-model="phone.single" class="form-control">
<option value="1">1格</option>
<option value="2">2格</option>
<option value="3">3格</option>
<option value="4" selected="selected">4格</option>
</select>
</div>
<div class="view-set-item">
<span>网络信号:</span>
<select v-model="phone.wifi" class="form-control">
<option value="1">wifi</option>
<option value="2">3G</option>
<option value="3">4G</option>
<option value="4">5G</option>
</select>
</div>
<div class="view-set-item">
<span>wifi信号:</span>
<select v-model="phone.wifi_single" class="form-control">
<option value="1">1格</option>
<option value="2">2格</option>
<option value="3" selected="selected">3格</option>
</select>
</div>
<div class="view-set-item">
<span>手机时间:</span>
<select v-model="phone.time_hour" class="form-control edit-phone-time-hour"></select>
<select v-model="phone.time_mini" class="form-control edit-phone-time-mini"></select>
</div>
<div class="view-set-item">
<span>充电中:</span>
<label class="my-radio"><input type="radio" name="charge"v-model="phone.battery_charge" value="1"></label>
<label class="my-radio"><input type="radio" name="charge"v-model="phone.battery_charge" value="0" checked></label>
</div>
<div class="view-set-item">
<span>手机电量:</span>
<input @change="onBatteryChange($event)" type="range" v-model="phone.battery_amount"
min="0" max="100" value="50" />
&nbsp;&nbsp;&nbsp;{{phone.battery_amount}}%
</div>
<div class="view-set-item">
<span>听筒模式:</span>
<label class="my-radio"><input type="radio" name="phone-ear" v-model="phone.ear" value="1"></label>
<label class="my-radio"><input type="radio" name="phone-ear" v-model="phone.ear" value="0" checked></label>
</div>
<div class="view-set-item">
<span>消息数目:</span>
<input type="number" name="phone-msg-count" class="form-control" v-model.number="setting.message">
</div>
<div class="view-set-item">
<span>聊天标题:</span>
<input type="text" class="form-control" v-model="setting.title">
</div>
<div class="view-set-item">
<span>语音模式:</span>
<label class="my-radio"><input type="radio" name="phone-voice" v-model="setting.voice" value="1"></label>
<label class="my-radio"><input type="radio" name="phone-voice" v-model="setting.voice" value="0" checked></label>
</div>
<div class="view-set-item">
<span>聊天背景:</span>
<a class="a-phone-set-bg" href="javascript:;" title="选择背景图">
<font>+</font>
<img class="img-phone-set-bg" :src="setting.background" />
<input @change="setBackground($event)" type="file" />
<span @click="deleteBackground" v-if="setting.background != ''">x</span>
</a>
</div>
</div>
</div>
<!-- 对话设置 -->
<div class="tab-pane active" id="tabContent2">
<div class="dialog-user">
<div class="dialog-user-title">编辑和选择用户(<font>第一个用户默认是自己,点击头像可更换头像哦</font></div>
<div class="dialog-user-items">
<div class="dialog-user-item el-remove">
<div class="dialog-user-face">
<a class="dialog-user-face-a" href="javascript:;">
<input type="file" placeholder="点击更换头像">
<i></i>
</a>
<input type="text" value="微信对话生成器" />
<a class="dialog-user-select">选择用户</a>
<a class="dialog-user-delete">x</a>
</div>
</div>
<div class="dialog-user-item el-remove">
<div class="dialog-user-face">
<a class="dialog-user-face-a" href="javascript:;">
<input type="file" placeholder="点击更换头像">
<i style="background-image: url(/static/app/images/user-face.png)"></i>
</a>
<input type="text" value="马先生" />
<a class="dialog-user-select">选择用户</a>
<a class="dialog-user-delete">x</a>
</div>
</div>
<div v-for="(user, index) in users" class="dialog-user-item">
<div class="dialog-user-face">
<a class="dialog-user-face-a" href="javascript:;">
<input @change="setUserImage($event, index)" type="file"
placeholder="点击更换头像">
<i :style="'background-image: url(' + user.image + ')'"></i>
</a>
<input type="text" v-model="user.name" />
<a @click="selectUser(index)"
:class="['dialog-user-select', {'dialog-user-selected':user.selected}]">选择用户</a>
<a v-if="!user.is_me" @click="delUser(index)" class="dialog-user-delete"
title="删除用户">x</a>
</div>
</div>
<div class="dialog-user-item">
<a @click="addUser" class="dialog-user-item-add" href="javascript:;"
title="添加用户">+</a>
</div>
</div>
<div class="dialog-user-content-title">发送人:{{getSender()}}</div>
<div class="dialog-user-content">
<div class="dialog-user-content-panel">
<textarea v-model="setting.dialog_content"
class="edit-dialog-text form-control"></textarea>
</div>
<div class="view-setting view-setting2">
<div class="view-set-item">
<span>红包或转账金额:</span>
<input v-model.number="setting.dialog_money" type="number"
class="form-control">
</div>
<div class="view-set-item">
<span>添加聊天时间:</span>
<select v-model="setting.date_year"
class="form-control edit-phone-time-year">
<option value="">-</option>
</select>
<select v-model="setting.date_month"
class="form-control edit-phone-time-month" style="width: 60px;">
<option value="">-</option>
</select>
<select v-model="setting.date_day" class="form-control edit-phone-time-day"
style="width: 60px;">
<option value="">-</option>
</select>
<select v-model="setting.date_xinqi" class="form-control">
<option value="">-</option>
<option value="星期一">星期一</option>
<option value="星期二">星期二</option>
<option value="星期三">星期三</option>
<option value="星期四">星期四</option>
<option value="星期五">星期五</option>
<option value="星期六">星期六</option>
<option value="星期日">星期日</option>
</select>
<select v-model="setting.date_shiduan" class="form-control"
style="width: 60px;">
<option value="">-</option>
<option value="上午">上午</option>
<option value="下午">下午</option>
<option value="凌晨">凌晨</option>
</select>
<select v-model="setting.date_hour"
class="form-control edit-phone-time-hour" style="width: 60px;">
</select>
<select v-model="setting.date_min" class="form-control edit-phone-time-mini"
style="width: 60px;">
</select>
</div>
<div class="view-set-item">
<span>语音时间:</span>
<input v-model.number="setting.dialog_voice" type="number"
class="form-control">
&nbsp;&nbsp;&nbsp;
<label>是否已读:</label>
<label class="my-radio"><input type="radio"
v-model="setting.dialog_voice_isread" value="1" checked>
</label>
<label class="my-radio"><input type="radio"
v-model="setting.dialog_voice_isread" value="0"></label>
</div>
<div class="view-set-item">
<span>红包备注:</span>
<input v-model="setting.dialog_repacket_remark" type="text"
class="form-control">
</div>
<div class="view-set-item">
<span>转账备注:</span>
<input v-model="setting.dialog_trans_remark" type="text"
class="form-control">
</div>
</div>
<div class="btn-groups">
<div class="btn-group">
<button @click="addTextDialog" class="btn btn-success">添加文字对话</button>
<button @click="addNoticeDialog" class="btn btn-primary">添加时间</button>
<button class="btn btn-primary btn-send-image">添加图片对话<input
@change="addImageDialog($event)" type="file"></button>
</div>
<div class="btn-group">
<button @click="addVoiceDialog" class="btn btn-primary">添加语音对话</button>
<button @click="addRedpacketDialog" class="btn btn-primary">添加红包对话</button>
<button @click="addTransferDialog" class="btn btn-primary">添加转账对话</button>
</div>
</div>
<button class="btn-clear" @click="cleanDialogs" href="javascript:;">清空聊天内容</button>
<button class="btn-clear" @click="save" href="javascript:;">生成图片</button>
<button class="btn-clear" id="downGif">生成GIF</button>
<div style="margin-top: 20px;">
<p>生成视频功能: 点击下方的"开始录制"按钮即可录制视频(停止录制后会在右侧生成视频,您可以下载该视频)</p>
<p>生成GIF图片: 点击下方的"开始录制"按钮即可生成动态图片(停止录制后点击上方的"生成GIF"按钮下载GIF图片)</p>
</div>
<button class="btn-recording" id="btn-start-recording">开始录制</button>
<button class="btn-recording" id="btn-stop-recording" disabled>停止录制</button>
</div>
</div>
</div>
</div>
</div>
<!-- phone -->
<div class="phone-wrap" id="element-to-record">
<div class="phone-content">
<div id="phone" class="phone">
<div class="phone-top">
<div class="phone-bar">
<div class="phone-time">{{phone.time_hour}}:{{phone.time_mini}}</div>
<div
:class="['phone-sigle', {'phone-sigle-v1':phone.single == 1}, {'phone-sigle-v2':phone.single == 2}, {'phone-sigle-v3':phone.single == 3}, {'phone-sigle-v4':phone.single == 4}]">
信号</div>
<div
:class="['phone-wifi', {'phone-wifi-v2':phone.wifi > 1}, phone.wifi == 1 ? 'phone-wifi-s' + phone.wifi_single : '']">
<template v-if="phone.wifi == 1">
wifi
</template>
<template v-else-if="phone.wifi == 2">
3G
</template>
<template v-else-if="phone.wifi == 3">
4G
</template>
<template v-else-if="phone.wifi == 4">
5G
</template>
</div>
<div :class="['phone-battery', {'phone-battery-charge':phone.battery_charge == 1}]">
<span>
<font :style="[{width: phone.battery_amount + '%'}]">电量</font>
<i></i>
</span>
</div>
</div>
<div class="phone-nav">
<div class="phone-nav-left">
<div class="phone-nav-back">返回</div>
<span v-if="setting.message && setting.message > 0">{{setting.message}}</span>
</div>
<div class="phone-nav-center">
<span>
<font>{{setting.title}}</font>
<i v-if="phone.ear == 1"></i>
</span>
</div>
<div class="phone-nav-right">
<div class="phone-nav-more">更多</div>
</div>
</div>
</div>
<div class="phone-bg">
<img @load="onBackgroundLoad($event)" :src="setting.background" />
</div>
<div class="phone-water"></div>
<div class="phone-body">
<div class="wechat-content">
<template v-for="(dialog, index) in dialogs">
<div :class="['wechat-dialog', {'wechat-dialog-right':dialog.is_me}]">
<div v-if="dialog.type != 'notice'" class="wechat-dialog-face">
<img :src="getUserById(dialog.user_id).image" />
</div>
<template v-if="dialog.type == 'text'">
<div class="wechat-dialog-text">{{dialog.content}}</div>
</template>
<template v-if="dialog.type == 'image'">
<div
:class="['wechat-dialog-text', 'wechat-dialog-image', {'wechat-dialog-image-noborder':setting.background != ''}]">
<img :src="dialog.image">
</div>
</template>
<template v-if="dialog.type == 'voice'">
<div class="wechat-dialog-text wechat-dialog-voice">
<div v-if="dialog.is_me"
:style="{width: getVoiceLength(dialog.time) + 'px'}"></div>
<span v-if="dialog.is_me">{{dialog.time}}"</span>
<i></i>
<span v-if="!dialog.is_me">{{dialog.time}}"</span>
<div v-if="!dialog.is_me"
:style="{width: getVoiceLength(dialog.time) + 'px'}"></div>
<em v-if="!dialog.is_me && dialog.isread == '0'"></em>
</div>
</template>
<template v-if="dialog.type == 'notice'">
<div class="wechat-dialog-notice">
<span
:class="[{'wechat-dialog-notice-has-bg':setting.background != ''},{'wechat-dialog-notice-system':dialog.is_system}]"
v-html="dialog.content"></span>
</div>
</template>
<template v-if="dialog.type == 'transfer' || dialog.type == 'redpacket'">
<div
:class="['wechat-dialog-text', 'wechat-dialog-trans', {'wechat-dialog-trans-get':dialog.is_get}]">
<div
:class="['wechat-dialog-trans-content', {'wechat-dialog-redp-content':dialog.type == 'redpacket'}]">
<i></i>
<div>
<span
v-if="dialog.type == 'transfer'">¥{{moneyFormat(dialog.money,
2, '', false)}}</span>
<font v-if="dialog.type == 'transfer'">{{dialog.remark}}
</font>
<span
v-if="dialog.type == 'redpacket'">{{dialog.remark}}</span>
<font v-if="dialog.type == 'redpacket' && dialog.is_get">
已领取</font>
</div>
</div>
<div class="wechat-dialog-trans-bottom">
<span v-if="dialog.type == 'transfer'">微信转账</span>
<span v-if="dialog.type == 'redpacket'">微信红包</span>
</div>
</div>
</template>
<a @click="deleteDialog(index)" class="a-wechat-dialog-del"
href="javascript:;" title="删除对话">X</a>
<div v-if="!dialog.is_get && dialog.type == 'redpacket'"
class="a-wechat-dialog-menu">
<a @click="redpacketGet(index)">领取</a>
</div>
<div v-if="!dialog.is_get && dialog.type == 'transfer'"
class="a-wechat-dialog-menu">
<a @click="transferGet(index)">领取</a>
</div>
</div>
</template>
<div class="wechat-dialog el-remove">
<div class="wechat-dialog-notice">
<span class="wechat-dialog-notice-has-bg">2019年5月20日 下午4:20</span>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog wechat-dialog-right el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-voice">
<span>1"</span><i></i>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-voice">
<i></i><span>1"</span><em></em>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog wechat-dialog-right el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-image"><img
src="static/app/images/dialog-demo1.jpeg"></div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog wechat-dialog-right el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text">
hellohelhellohellohellohellohellohellolohello</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-trans">
<div class="wechat-dialog-trans-content">
<i></i>
<div>
<span>¥1.00</span>
<font>转账给微截图</font>
</div>
</div>
<div class="wechat-dialog-trans-bottom">
<span>微信转账</span>
</div>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
<div class="a-wechat-dialog-menu">
<a>领取</a>
</div>
</div>
<div class="wechat-dialog el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-trans wechat-dialog-trans-get">
<div class="wechat-dialog-trans-content">
<i></i>
<div>
<span>¥1.00</span>
<font>转账给微截图</font>
</div>
</div>
<div class="wechat-dialog-trans-bottom">
<span>微信转账</span>
</div>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog wechat-dialog-right el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-trans">
<div class="wechat-dialog-trans-content">
<i></i>
<div>
<span>¥1.00</span>
<font>转账给微截图</font>
</div>
</div>
<div class="wechat-dialog-trans-bottom">
<span>微信转账</span>
</div>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog wechat-dialog-right el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-trans wechat-dialog-trans-get">
<div class="wechat-dialog-trans-content">
<i></i>
<div>
<span>¥1.00</span>
<font>转账给微截图</font>
</div>
</div>
<div class="wechat-dialog-trans-bottom">
<span>微信转账</span>
</div>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-trans">
<div class="wechat-dialog-trans-content wechat-dialog-redp-content">
<i></i>
<div>
<span>恭喜发财,大吉大利</span>
</div>
</div>
<div class="wechat-dialog-trans-bottom">
<span>微信红包</span>
</div>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
<div class="wechat-dialog wechat-dialog-right el-remove">
<div class="wechat-dialog-face">
<img src="static/app/images/user-face.png" />
</div>
<div class="wechat-dialog-text wechat-dialog-trans wechat-dialog-trans-get">
<div class="wechat-dialog-trans-content wechat-dialog-redp-content">
<i></i>
<div>
<span>恭喜发财,大吉大利</span>
</div>
</div>
<div class="wechat-dialog-trans-bottom">
<span>微信红包</span>
</div>
</div>
<a class="a-wechat-dialog-del" href="javascript:;" title="删除对话">X</a>
</div>
</div>
</div>
<div class="phone-bottom">
<div class="phone-bottom-chat">
<div class="wechat-bottom">
<div
:class="['wechat-bottom-icon', 'wechat-voice-icon', {'wechat-voice-say-icon':setting.voice == 1}]">
语音</div>
<div :class="['wechat-input', {'wechat-input-say':setting.voice == 1}]">
<template v-if="setting.voice == 1">按住 说话</template>
<template v-else>输入框</template>
</div>
<div class="wechat-bottom-icon wechat-emoji-icon">表情</div>
<div class="wechat-bottom-icon wechat-more-icon">更多功能</div>
</div>
</div>
<div class="phone-bottom-bar">
<i>返回桌面</i>
</div>
</div>
</div>
</div>
</div>
<div style="display: none; margin-left: 10px;">
<video controls autoplay playsinline id="preview-video"></video>
</div>
<canvas id="background-canvas" style="position: absolute; left: -99999px;"></canvas>
</div>
</div>
<!-- <canvas id="background-canvas" style="position: absolute; left: -99999px;"></canvas> -->
</div>
<a style="display: none;" id="lightBoxToggle" href="javascript:;" data-width="300" data-caption="右击图片,点击图片另存为即可下载图片">生成图片</a>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lcoschina/weixin-chat.git
git@gitee.com:lcoschina/weixin-chat.git
lcoschina
weixin-chat
weixin-chat
master

搜索帮助