首页下载资源移动开发微信小程序实现婚礼代码,免费!

ZIP微信小程序实现婚礼代码,免费!

m0_674180095.69MB需要积分:1

资源文件列表:

liudong05.zip 大约有52个文件
  1. liudong05/app.js
  2. liudong05/app.json 1.2KB
  3. liudong05/app.wxss 189B
  4. liudong05/images/
  5. liudong05/images/avatar.png 23.56KB
  6. liudong05/images/bg_1.png 316.24KB
  7. liudong05/images/bj_2.png 93.05KB
  8. liudong05/images/guest.png 7.47KB
  9. liudong05/images/htdocs/
  10. liudong05/images/htdocs/01.mp4 1.66MB
  11. liudong05/images/htdocs/03.mp4 3.34MB
  12. liudong05/images/invite.png 7.2KB
  13. liudong05/images/map.png 7.43KB
  14. liudong05/images/marry.png 11.67KB
  15. liudong05/images/music_icon.png 1.31KB
  16. liudong05/images/music_play.png 1.24KB
  17. liudong05/images/save_the_date.gif 46KB
  18. liudong05/images/tel.png 7.82KB
  19. liudong05/images/timg1.jpg 77.18KB
  20. liudong05/images/timg2.jpg 56.61KB
  21. liudong05/images/timg3.jpg 55.43KB
  22. liudong05/images/timg4.jpg 53.25KB
  23. liudong05/images/video.png 4.82KB
  24. liudong05/images/wedding.png 5.12KB
  25. liudong05/pages/
  26. liudong05/pages/guest/
  27. liudong05/pages/guest/guest.js 3.84KB
  28. liudong05/pages/guest/guest.json 48B
  29. liudong05/pages/guest/guest.wxml 1.02KB
  30. liudong05/pages/guest/guest.wxss 513B
  31. liudong05/pages/index/
  32. liudong05/pages/index/index.js 1.09KB
  33. liudong05/pages/index/index.json 45B
  34. liudong05/pages/index/index.wxml 1.23KB
  35. liudong05/pages/index/index.wxss 2.37KB
  36. liudong05/pages/map/
  37. liudong05/pages/map/map.js 816B
  38. liudong05/pages/map/map.wxml 60B
  39. liudong05/pages/picture/
  40. liudong05/pages/picture/picture.js 151B
  41. liudong05/pages/picture/picture.json 42B
  42. liudong05/pages/picture/picture.wxml 265B
  43. liudong05/pages/picture/picture.wxss 80B
  44. liudong05/pages/video/
  45. liudong05/pages/video/video.js 379B
  46. liudong05/pages/video/video.json 48B
  47. liudong05/pages/video/video.wxml 779B
  48. liudong05/pages/video/video.wxss 365B
  49. liudong05/project.config.json 716B
  50. liudong05/project.private.config.json 383B
  51. liudong05/utils/
  52. liudong05/utils/util.js 472B

资源介绍:

微信小程序实现婚礼代码,免费!
Page({ data: { picker: { arr: ['0', '1', '2', '3', '4', '5', '6'], index: 1 } }, pickerChange: function(e) { this.setData({ 'picker.index': e.detail.value }) }, // 验证姓名 nameChange: function(e) { this.checkName(e.detail.value) }, // 验证手机号 phoneChange: function(e) { this.checkPhone(e.detail.value) }, // checkName()方法 checkName: function(data) { var reg = /^[\u4E00-\u9FA5A-Za-z]+$/; return this.check(data, reg, '姓名输入错误!') }, // checkPhone()方法 checkPhone: function(data) { var reg = /^(((13)|(15)|(17)|(18))\d{9})$/; return this.check(data, reg, '手机号码输入有误!') }, // check()方法 check: function(data, reg, errMsg) { if (!reg.test(data)) { wx.showToast({ title: errMsg, icon: 'none', duration: 1500 }) } return true }, formSubmit: function(e) { var name = e.detail.value.name var phone = e.detail.value.phone if (this.checkName(name) && this.checkPhone(phone)) { // 在此处可编写代码将e.detail.value提交到服务器 wx.login({ success: res => { server.post({ formId: e.detail.formId, code: res.code }, () => { // 将表单提交给服务器,传入formId和code wx.showToast({ title: '提交成功', icon: 'success', duration: 1500 }) // 提交成功后,由服务器发送模板消息 server.sendTemplateMessage(res => { console.log('模板消息发送结果:', res.data) }) }) }, }) } } }) // 模拟服务器端代码 var server = { appid: '', // 在此处填写自己的appid secret: '', // 在此处填写自己的secret // 用于保存用户的openid和formId user: { openid: '', formId: '' }, // 用于接收表单,调用this.getOpenid()根据code换取openid post: function(data, success) { console.log('收到客户端提交的数据:', data) this.user.formId = data.formId this.getOpenid(data.code, res => { console.log('用户openid:' + res.data.openid) this.user.openid = res.data.openid success() }) }, // 用于根据code获取openid getOpenid: function(code, success) {}, // 用于发送模板消息 getOpenid: function(code, success) { wx.request({ url: 'https://api.weixin.qq.com/sns/jscode2session', data: { appid: this.appid, secret: this.secret, grant_type: 'authorization_code', js_code: code }, success: success }) }, // 用于发送模板消息 sendTemplateMessage: function(success) { var user = this.user var data = { touser: user.openid, template_id: '……', // 在此处填写模板id page: 'index', form_id: user.formId, data: { keyword1: { value: '王辉辉、张琳琳' }, keyword2: { value: '谢谢你的祝福' }, keyword3: { value: '请记得按时参加婚宴哦' }, keyword4: { value: '北京市海淀区XX路XX酒店' } } } this.getAccessToken(res => { var token = res.data.access_token console.log('服务器access_token:' + token) var url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=' + token wx.request({ url: url, method: 'post', data: data, success: success }) }) }, // 用于获取access_token getAccessToken: function(success) { var url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' + this.appid + '&secret=' + this.secret wx.request({ url: url, success: success }) } }
100+评论
captcha