微信小程序聊天功能的示例代码


Posted in Javascript onJanuary 13, 2020

效果

微信小程序聊天功能的示例代码

初始化滚动条高度

var keyHeight = 0;

数据格式

const CHAT_DATA=[
 {
  type:0,//0客服1用户
  content:'欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎欢迎',
  headImg:'../../assets/common/images/headHortrait.jpeg',//头像
  creatTime:'2019-01-01',//创建时间
  contentType:'text'
 }, {
  type: 0,//0客服1用户
  content: '1111111',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'text'
 }, {
  type: 1,//0客服1用户
  content: '222222',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'text'
 }, {
  type: 0,//0客服1用户
  content: '333333',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'text'
 }, {
  type: 1,//0客服1用户
  content: '4444444',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'text',
 }, {
  type: 0,//0客服1用户
  content: 'http://tmp/wxc79c66d8b0ed19a8.o6zAJs6QE8L8FKq645ts4e3LoKzI.pGakaVHKmbQ3160aa57e2bf33cb576fbabf691cd890b.durationTime=3706.aac',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'voice',
  duration: '3706',
 },{
  type: 1,//0客服1用户
  content: 'http://tmp/wxc79c66d8b0ed19a8.o6zAJs6QE8L8FKq645ts4e3LoKzI.pGakaVHKmbQ3160aa57e2bf33cb576fbabf691cd890b.durationTime=3706.aac',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'voice',
  duration:'3706'
 },
 {
  type: 1,//0客服1用户
  content: 'https://img.yzcdn.cn/vant/cat.jpeg',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'img'
 }, {
  type: 1,//0客服1用户
  content: 'https://img.yzcdn.cn/vant/cat.jpeg',
  headImg: '../../assets/common/images/headHortrait.jpeg',//头像
  creatTime: '2019-01-01',//创建时间
  contentType: 'img'
 }
];

wxml对话框

<block wx:key wx:for='{{chatData}}' wx:for-index="index">

   <!-- 单个消息1 客服发出(左) -->
   <view wx:if='{{item.type==0}}' id='msg-{{index}}' class="contentLeft" style=''>
    <view class="head">
      <image class="headImg" src='{{item.headImg}}' mode='widthFix'></image>
    </view>
    <view class='leftMsg' wx:if="{{item.contentType==='text'}}">{{item.content}}</view>
    <view class='leftMsg' wx:if="{{item.contentType==='voice'}}" data-duration="{{item.content}}">{{item.duration}}s</view>
     
    <view class='leftMsg img' wx:if="{{item.contentType==='img'}}"><image src="{{item.content}}" data-src="{{item.content}}" mode='widthFix' bindtap="onPreview"/></view>
   </view>

   <!-- 单个消息2 用户发出(右) -->
   <view wx:else id='msg-{{index}}' class="contentRight">
    <view class='rightMsg' wx:if="{{item.contentType==='voice'}}" data-duration="{{item.duration}}" bindtap="playRecord" style="width:{{30+item.duration*5}}px;justify-content: flex-end;display:flex;color:#000;">{{item.duration}}"<van-icon name="../../../assets/common/icon/voice-r.png" style="padding:0 0 0 5px;" /></view>
    <view class='rightMsg' wx:if="{{item.contentType==='text'}}">{{item.content}}</view>
    
    <view class='rightMsg img' wx:if="{{item.contentType==='img'}}"><image src="{{item.content}}" data-src="{{item.content}}" mode='widthFix' bindtap="onPreview"/></view>
     <view>
      <image class="headImg" src='{{item.headImg}}' mode='widthFix'></image>
    </view>
   </view>

  </block>

wxml底部输入框

<view class='inputRoom' style='bottom: {{inputBottom}};height: {{bottomHeight}}'>
  <van-row class="bottomRow">
   <van-col span="2"wx:if="{{show}}"> <van-icon bindtap="startRecord" class="iconfont icon" class-prefix='icon' size="40rpx" name="yuyin" ></van-icon></van-col>
    <van-col span="2" wx:if="{{!show}}"> <van-icon bindtap="startRecord" class="iconfont icon" class-prefix='icon' size="40rpx" name="fabiaowenzhang" ></van-icon></van-col>
   <van-col span="18" wx:if="{{show}}"> <input bindconfirm='sendClick'bind:input="inputValue" adjust-position='{{false}}' value='{{inputVal}}' confirm-type='send' bindfocus='focus' bindblur='blur'></input></van-col>
   <van-col span="18" wx:if="{{!show}}"> <view class="holdTape" bind:touchstart="startTalk" bind:touchend='stopRecord'>按住请说话</view></van-col>
   <van-col span="2"><van-icon class="iconfont icon" class-prefix='icon' size="40rpx" name='biaoqing' bindtap="getEmoji"></van-icon></van-col>
   <van-col span="2"><van-uploader use-slot accept='image' bind:after-read="uploadeImg"> <van-icon class="iconfont icon" class-prefix='icon' size="40rpx" name='icon02' ></van-icon></van-uploader></van-col>
  </van-row> 
   <view wx:if="{{showEmoji}}" class="emoji">
   <emoji bind:clickEmoji="clickEmoji" data-key="inputVal" value="{{inputVal}}" />
  </view>
 </view>
  
</view>
<view class="recordDailog" wx:if="{{showDailog}}"  >
<view class="show">
 <image src="../../assets/common/images/record.png"></image>
 <text>{{toastTitle}}</text>
</view>

css

#page{
 height: 90%;
overflow-y: auto;

}
.content{
 background: white;

}

.inputRoom {
 width: 100vw;
 /* height: 16vw; */
 border-top: 1px solid #cdcdcd;
 position: fixed;
 bottom: 0;
 display: flex;
 align-items: center;
 z-index: 20;
 background: white;
 flex-direction: column;

}
.bottomRow{
 width: 100%;
 height: 16vw;
display: flex;
align-items: center;
flex-direction: row
}
.bottomRow .van-row{
 width: 100%;

}
.emoji{
 height: 30vw;
}
input {
width: 90%;
height: 9.33vw;
background-color: #EEF4FA;
border-radius: 6rpx;
font-size: 28rpx;
color: #444;
padding: 0 3%;
margin-left: 2%;
}

.leftMsg {
 font-size: 26rpx;
 color: #333333;
line-height: 6vw;
padding: 2vw 2.5vw;
background-color: #EEF4FA;
 border-radius: 10rpx;
 z-index: 10;
}

.rightMsg {
 font-size: 26rpx;
 color: white;
 line-height: 6vw;
 padding: 2vw 2.5vw;
 background-color: #496DFF;
 border-radius: 10rpx;
 z-index: 10;
}



.chatFrame{
 background: white;
 height: 100%
} 
.icon{
 line-height: 8vw;

}
.head{
 display: flex;
 align-items: center
}
.headImg{
 border-radius: 50%; width: 60rpx;height: 60rpx;
}
.holdTape{
 width: 90%;
height: 9.33vw;
background-color: #EEF4FA;
border-radius: 6rpx;
padding: 0 3%;
margin-left: 2%;
display: flex;
align-items: center;
justify-content: center;

}

.recordDailog{
 -webkit-transition-duration: 300ms;
transition-duration: 300ms;
z-index: 1000;
position: fixed;
top: 50%;
left: 50%;
width: -webkit-fit-content;
width: fit-content;
-webkit-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
max-width: var(--toast-max-width,70%);

}

.show{
width: var(--toast-default-width,90px);
min-height: var(--toast-default-min-height,90px);
padding: var(--toast-default-padding,16px);
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
box-sizing: initial;
color: var(--toast-text-color,#fff);
font-size: var(--toast-font-size,14px);
line-height: var(--toast-line-height,20px);
white-space: pre-wrap;
word-wrap: break-word;
background-color: var(--toast-background-color,rgba(50,50,51,.88));
border-radius: var(--toast-border-radius,4px);

}
.show image{
 width: 24px;
 height: 24px
}
image{
 /* max-width: 88vw;
max-height: 400rpx; */
width: 100%
}
.img{
background: none;
width: 90%
}
.contentRight{
 display: flex; justify-content: flex-end; padding: 2vw 2vw 2vw 11vw;width: 86%;
}
.contentLeft{
 display: flex; padding: 2vw 11vw 2vw 2vw;width: 86%;
}

js

// pages/contact/contact.js
const {
 pageFunc
} = require('../../utils/util.js');
const app = getApp();
var windowWidth = wx.getSystemInfoSync().windowWidth;
var windowHeight = wx.getSystemInfoSync().windowHeight;
var keyHeight = 0;
const { CHAT_DATA}=require("../../data/customerService.js");
import Toast from '../../components/vant/toast/toast';
const recorderManager = wx.getRecorderManager();
const innerAudioContext = wx.createInnerAudioContext();
const db = wx.cloud.database();
/**
 * 初始化数据
 */
/**
 * 计算msg总高度
 */
function calScrollHeight(that, keyHeight) {
 var query = wx.createSelectorQuery();
 query.select('.scrollMsg').boundingClientRect(function(rect) {
 }).exec();
}
Page({

 /**
  * 页面的初始数据
  */
 data: {
  scrollHeight: '100vh',
  inputVal:"",
  inputBottom: 0,
  chatData:[],
  show:true,
  showDailog:false,
  bottomHeight:"18vw",
  sendData:{},
  pagination: {
   pageSize: 5,
   currentPage: 1,
   total: 0,
  },
  showEmoji:false,
  toastTitle:"录音中...."
 },

 /**
  * 生命周期函数--监听页面加载
  */
 onLoad: function (options) {
  // this.setData({
  //  cusHeadIcon: app.globalData.userInfo.avatarUrl,
  // });
  const {
   pagination
  } = this.data
  this.getData({ param: CHAT_DATA, pagination });
   wx.pageScrollTo({
    scrollTop: 1000
   })
 },
 getData(params) {
  const { chatData } = this.data;
  const {
   param,
   pagination: {
    pageSize = 10,
    currentPage = 1
   },
  } = params;
  this.setData({
   pagination: { pageSize, currentPage }
  });
  const {
   data,
   pagination
  } = pageFunc(param, currentPage, pageSize);
  data.forEach((item) => {
   if (item.duration) {
    item.duration = Math.ceil(item.duration / 1000)
   }
  });
   this.setData({
    'chatData': data.concat(chatData)
   });
 },
 startRecord(){//开始录音
 const {show}=this.data
  if (show){
   this.setData({
    show: false,
   })
  }else{
   this.setData({
    show: true,
   })
  }
  
  
 },
 startTalk(e){//开始说话
  this.setData({
   showDailog:true,
  })
  const options = {
   duration: 60000,
   sampleRate: 44100,
   numberOfChannels: 1,
   encodeBitRate: 192000,
   format: 'aac',
   frameSize: 50
  }
  recorderManager.start(options)
  recorderManager.onStart((res) => {
  })
 },
 stopRecord(){//停止说话
  const that=this
  this.setData({
   showDailog:false,
  })
  recorderManager.stop();
  recorderManager.onStop((res) => {
   const { sendData, chatData } = that.data;
   let { tempFilePath, duration, fileSize} = res
   sendData.tempFilePathData=res
   duration = Math.ceil(duration / 1000)
   const data = { content: tempFilePath, duration , fileSize, contentType: 'voice', type: 1};
   chatData.push(data);
   wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
    // 使页面滚动到底部
    wx.pageScrollTo({
     scrollTop: rect.bottom + 5000
    })
   }).exec();
   that.setData({
    'tempFilePath': tempFilePath,
    sendData,
    chatData,
    scrollHeight: (windowHeight - 0) + 'px',
    toView: 'msg-' + (chatData.length - 1),
    inputBottom: '0px'
   })
  })
 },

 playRecord(e){//播放语音
  const { currentTarget: { dataset: { duration } }}=e;
  const { tempFilePath} = this.data
  innerAudioContext.autoplay = true;
  innerAudioContext.src = tempFilePath ,
   innerAudioContext.onPlay(() => {
    this.setData({
     toastTitle: "播放中....",
     showDailog: true,
    })
   })
  innerAudioContext.onEnded((res) => {
   this.setData({
    toastTitle: "录音中....",
    showDailog: false,
   })
  })
  innerAudioContext.onError((res) => {
  });
  innerAudioContext.play()
 },

 uploadeImg(e){
  const { file: { path,size:fileSize} } = e.detail;
  const { chatData } = this.data;
  const data = { content: path, fileSize, contentType: 'img', type: 1 };
  chatData.push(data);
  wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
   // 使页面滚动到底部
   wx.pageScrollTo({
    scrollTop: rect.bottom + 5000
   })
  }).exec()
  this.setData({
   chatData,
   scrollHeight: (windowHeight - 0) + 'px',
   toView: 'msg-' + (chatData.length - 1),
   inputBottom:'0px'
  })
 },
 getEmoji(){//获取表情包
  wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
   // 使页面滚动到底部
   wx.pageScrollTo({
    scrollTop: rect.bottom + 5000
   })
  }).exec()
 this.setData({
  showEmoji:true,
  bottomHeight:"48vw"
 })
 },

 clickEmoji: function (e) {//选择表情包
  const {
   detail: {
    value
   },
   currentTarget: {
    dataset: {
     key
    }
   }
  } = e;
  this.setData({
   [key]: value
  })
 },

 onPreview(e){
  const {
   currentTarget: {
    dataset: {
     src
    }
   }
  } = e;
  const urls = [src]
  wx.previewImage({
   current: src,
   urls
  })
 },
 /**
  * 生命周期函数--监听页面显示
  */
 onShow: function () {

 },

 /**
  * 页面相关事件处理函数--监听用户下拉动作
  */
 onPullDownRefresh: function () {
  let { pagination: { currentPage } } = this.data
  this.getData({
   param: CHAT_DATA,
   pagination: {
    pageSize: 5,
    currentPage: currentPage + 1,
   }
  });
 },

 /**
  * 页面上拉触底事件的处理函数
  */
 onReachBottom: function () {

 },

 /**
  * 获取聚焦
  */
 inputValue(e){
  const {detail:{value}}=e
  this.setData({
   inputVal:value
  })
 },
 focus: function (e) {
  const { chatData}=this.data
  keyHeight = e.detail.height;
  wx.pageScrollTo({
   scrollTop: windowHeight - keyHeight
  })
  this.setData({
   toView: 'msg-' + (chatData.length - 1),
   inputBottom: keyHeight + 'px',
   scrollHeight: (windowHeight - keyHeight) + 'px',
   showEmoji:false,
   bottomHeight: "18vw"
  })
  //计算msg高度
  // calScrollHeight(this, keyHeight);

 },

 //失去聚焦(软键盘消失)
 blur: function (e) {
  const { chatData } = this.data
  this.setData({
   scrollHeight: '100vh',
   inputBottom: 0
  })
  this.setData({
   toView: 'msg-' + (chatData.length - 1)
  })

 },

 /**
  * 发送点击监听
  */
 sendClick: function (e) {
  const { chatData, scrollHeight}=this.data;
  wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
   // 使页面滚动到底部
   wx.pageScrollTo({
    scrollTop: rect.bottom + 5000
   })
  }).exec()
 
  chatData.push({
   type: 1,
   contentType: 'text',
   content: e.detail.value,
   headImg: '../../assets/common/images/headHortrait.jpeg',
  })
  this.setData({
   chatData,
   inputVal:''
  });


 },

 /**
  * 退回上一页
  */
 toBackClick: function () {
  wx.navigateBack({})
 }

})// pages/contact/contact.js
const {
 pageFunc
} = require('../../utils/util.js');
const app = getApp();
var windowWidth = wx.getSystemInfoSync().windowWidth;
var windowHeight = wx.getSystemInfoSync().windowHeight;
var keyHeight = 0;
const { CHAT_DATA}=require("../../data/customerService.js");
import Toast from '../../components/vant/toast/toast';
const recorderManager = wx.getRecorderManager();
const innerAudioContext = wx.createInnerAudioContext();
const db = wx.cloud.database();
/**
 * 初始化数据
 */
/**
 * 计算msg总高度
 */
function calScrollHeight(that, keyHeight) {
 var query = wx.createSelectorQuery();
 query.select('.scrollMsg').boundingClientRect(function(rect) {
 }).exec();
}
Page({

 /**
  * 页面的初始数据
  */
 data: {
  scrollHeight: '100vh',
  inputVal:"",
  inputBottom: 0,
  chatData:[],
  show:true,
  showDailog:false,
  bottomHeight:"18vw",
  sendData:{},
  pagination: {
   pageSize: 5,
   currentPage: 1,
   total: 0,
  },
  showEmoji:false,
  toastTitle:"录音中...."
 },

 /**
  * 生命周期函数--监听页面加载
  */
 onLoad: function (options) {
  // this.setData({
  //  cusHeadIcon: app.globalData.userInfo.avatarUrl,
  // });
  const {
   pagination
  } = this.data
  this.getData({ param: CHAT_DATA, pagination });
   wx.pageScrollTo({
    scrollTop: 1000
   })
 },
 getData(params) {
  const { chatData } = this.data;
  const {
   param,
   pagination: {
    pageSize = 10,
    currentPage = 1
   },
  } = params;
  this.setData({
   pagination: { pageSize, currentPage }
  });
  const {
   data,
   pagination
  } = pageFunc(param, currentPage, pageSize);
  data.forEach((item) => {
   if (item.duration) {
    item.duration = Math.ceil(item.duration / 1000)
   }
  });
   this.setData({
    'chatData': data.concat(chatData)
   });
 },
 startRecord(){//开始录音
 const {show}=this.data
  if (show){
   this.setData({
    show: false,
   })
  }else{
   this.setData({
    show: true,
   })
  }
  
  
 },
 startTalk(e){//开始说话
  this.setData({
   showDailog:true,
  })
  const options = {
   duration: 60000,
   sampleRate: 44100,
   numberOfChannels: 1,
   encodeBitRate: 192000,
   format: 'aac',
   frameSize: 50
  }
  recorderManager.start(options)
  recorderManager.onStart((res) => {
  })
 },
 stopRecord(){//停止说话
  const that=this
  this.setData({
   showDailog:false,
  })
  recorderManager.stop();
  recorderManager.onStop((res) => {
   const { sendData, chatData } = that.data;
   let { tempFilePath, duration, fileSize} = res
   sendData.tempFilePathData=res
   duration = Math.ceil(duration / 1000)
   const data = { content: tempFilePath, duration , fileSize, contentType: 'voice', type: 1};
   chatData.push(data);
   wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
    // 使页面滚动到底部
    wx.pageScrollTo({
     scrollTop: rect.bottom + 5000
    })
   }).exec();
   that.setData({
    'tempFilePath': tempFilePath,
    sendData,
    chatData,
    scrollHeight: (windowHeight - 0) + 'px',
    toView: 'msg-' + (chatData.length - 1),
    inputBottom: '0px'
   })
  })
 },

 playRecord(e){//播放语音
  const { currentTarget: { dataset: { duration } }}=e;
  const { tempFilePath} = this.data
  innerAudioContext.autoplay = true;
  innerAudioContext.src = tempFilePath ,
   innerAudioContext.onPlay(() => {
    this.setData({
     toastTitle: "播放中....",
     showDailog: true,
    })
   })
  innerAudioContext.onEnded((res) => {
   this.setData({
    toastTitle: "录音中....",
    showDailog: false,
   })
  })
  innerAudioContext.onError((res) => {
  });
  innerAudioContext.play()
 },

 uploadeImg(e){
  const { file: { path,size:fileSize} } = e.detail;
  const { chatData } = this.data;
  const data = { content: path, fileSize, contentType: 'img', type: 1 };
  chatData.push(data);
  wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
   // 使页面滚动到底部
   wx.pageScrollTo({
    scrollTop: rect.bottom + 5000
   })
  }).exec()
  this.setData({
   chatData,
   scrollHeight: (windowHeight - 0) + 'px',
   toView: 'msg-' + (chatData.length - 1),
   inputBottom:'0px'
  })
 },
 getEmoji(){//获取表情包
  wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
   // 使页面滚动到底部
   wx.pageScrollTo({
    scrollTop: rect.bottom + 5000
   })
  }).exec()
 this.setData({
  showEmoji:true,
  bottomHeight:"48vw"
 })
 },

 clickEmoji: function (e) {//选择表情包
  const {
   detail: {
    value
   },
   currentTarget: {
    dataset: {
     key
    }
   }
  } = e;
  this.setData({
   [key]: value
  })
 },

 onPreview(e){
  const {
   currentTarget: {
    dataset: {
     src
    }
   }
  } = e;
  const urls = [src]
  wx.previewImage({
   current: src,
   urls
  })
 },
 /**
  * 生命周期函数--监听页面显示
  */
 onShow: function () {

 },

 /**
  * 页面相关事件处理函数--监听用户下拉动作
  */
 onPullDownRefresh: function () {
  let { pagination: { currentPage } } = this.data
  this.getData({
   param: CHAT_DATA,
   pagination: {
    pageSize: 5,
    currentPage: currentPage + 1,
   }
  });
 },

 /**
  * 页面上拉触底事件的处理函数
  */
 onReachBottom: function () {

 },

 /**
  * 获取聚焦
  */
 inputValue(e){
  const {detail:{value}}=e
  this.setData({
   inputVal:value
  })
 },
 focus: function (e) {
  const { chatData}=this.data
  keyHeight = e.detail.height;
  wx.pageScrollTo({
   scrollTop: windowHeight - keyHeight
  })
  this.setData({
   toView: 'msg-' + (chatData.length - 1),
   inputBottom: keyHeight + 'px',
   scrollHeight: (windowHeight - keyHeight) + 'px',
   showEmoji:false,
   bottomHeight: "18vw"
  })
  //计算msg高度
  // calScrollHeight(this, keyHeight);

 },

 //失去聚焦(软键盘消失)
 blur: function (e) {
  const { chatData } = this.data
  this.setData({
   scrollHeight: '100vh',
   inputBottom: 0
  })
  this.setData({
   toView: 'msg-' + (chatData.length - 1)
  })

 },

 /**
  * 发送点击监听
  */
 sendClick: function (e) {
  const { chatData, scrollHeight}=this.data;
  wx.createSelectorQuery().select('.content').boundingClientRect(function (rect) {
   // 使页面滚动到底部
   wx.pageScrollTo({
    scrollTop: rect.bottom + 5000
   })
  }).exec()
 
  chatData.push({
   type: 1,
   contentType: 'text',
   content: e.detail.value,
   headImg: '../../assets/common/images/headHortrait.jpeg',
  })
  this.setData({
   chatData,
   inputVal:''
  });


 },

 /**
  * 退回上一页
  */
 toBackClick: function () {
  wx.navigateBack({})
 }

})

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持三水点靠木。

Javascript 相关文章推荐
JS 页面自动加载函数(兼容多浏览器)
May 18 Javascript
五个jQuery图片画廊插件 推荐
May 12 Javascript
Javascript异步编程的4种方法让你写出更出色的程序
Jan 17 Javascript
jquery form 加载数据示例
Apr 21 Javascript
自己使用js/jquery写的一个定制对话框控件
May 02 Javascript
Javascript定义类(class)的三种方法详解
Mar 13 Javascript
JS实现根据文件字节数返回文件大小的方法
Aug 02 Javascript
详解JS异步加载的三种方式
Mar 07 Javascript
Bootstrap响应式导航由768px变成992px的实现代码
Jun 15 Javascript
JS库之Three.js 简易入门教程(详解之一)
Sep 13 Javascript
手把手带你封装一个vue component第三方库
Feb 14 Javascript
vue-quill-editor的使用及个性化定制操作
Aug 04 Javascript
js实现适配移动端的拖动效果
Jan 13 #Javascript
Vue 嵌套路由使用总结(推荐)
Jan 13 #Javascript
优化Vue中date format的性能详解
Jan 13 #Javascript
JS document文档的简单操作完整示例
Jan 13 #Javascript
JavaScript数组排序小程序实现解析
Jan 13 #Javascript
JS document form表单元素操作完整示例
Jan 13 #Javascript
JS校验与最终登陆界面功能完整示例
Jan 13 #Javascript
You might like
PHP+Tidy-完美的XHTML纠错+过滤
2007/04/10 PHP
解析php防止form重复提交的方法
2013/07/01 PHP
PHP实现在线阅读PDF文件的方法
2015/06/17 PHP
PHP pthreads v3下的Volatile简介与使用方法示例
2020/02/21 PHP
js中cookie的使用详细分析
2008/05/28 Javascript
javascript 面向对象全新理练之原型继承
2009/12/03 Javascript
JavaScript 事件冒泡简介及应用
2010/01/11 Javascript
Nodejs极简入门教程(二):定时器
2014/10/25 NodeJs
JQuery调用绑定click事件的3种写法
2015/03/28 Javascript
深入讲解AngularJS中的自定义指令的使用
2015/06/18 Javascript
jQuery增加自定义函数的方法
2015/07/18 Javascript
jQuery实现元素拖拽并cookie保存顺序的方法
2016/02/20 Javascript
基于bootstrap风格的弹框插件
2016/12/28 Javascript
微信小程序商城项目之淘宝分类入口(2)
2017/04/17 Javascript
详解Vue 方法与事件处理器
2017/06/20 Javascript
BACKBONE.JS 简单入门范例
2017/10/17 Javascript
Vue单页应用引用单独的样式文件的两种方式
2018/03/30 Javascript
使用webpack3.0配置webpack-dev-server教程
2018/05/29 Javascript
vue实现表单录入小案例
2019/09/27 Javascript
用vue 实现手机触屏滑动功能
2020/05/28 Javascript
JS前后端实现身份证号验证代码解析
2020/07/23 Javascript
JavaScript 中的执行上下文和执行栈实例讲解
2021/02/25 Javascript
Python内置模块logging用法实例分析
2018/02/12 Python
使用python采集脚本之家电子书资源并自动下载到本地的实例脚本
2018/10/23 Python
python3.6 tkinter实现屏保小程序
2019/07/30 Python
详解Python3 pickle模块用法
2019/09/16 Python
pandas read_excel()和to_excel()函数解析
2019/09/19 Python
python利用蒙版抠图(使用PIL.Image和cv2)输出透明背景图
2020/08/04 Python
CSS+jQuery+PHP+MySQL实现的在线答题功能
2015/04/25 HTML / CSS
英国领先的酒类网上商城:TheDrinkShop
2017/03/16 全球购物
运动会入场词50字
2014/02/20 职场文书
教师考核评语
2014/04/28 职场文书
求职信范文怎么写
2015/03/19 职场文书
2015年学生管理工作总结
2015/05/26 职场文书
党小组意见范文
2015/06/08 职场文书
索尼ICF-36收音机评测
2022/04/30 无线电