本次修改的内容为

main
WangLuFei 10 months ago
parent fae151b1bb
commit 2a248ba55a

@ -0,0 +1,31 @@
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
ecmaFeatures: {
modules: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
rules: {},
}

@ -1,2 +1,2 @@
# project
![](./ooo.png)

@ -0,0 +1,19 @@
// app.js
App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
},
globalData: {
userInfo: null
}
})

@ -0,0 +1,52 @@
{
"pages": [
"pages/index/index",
"pages/guest/guest",
"pages/video/video",
"pages/picture/picture"
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Weixin",
"navigationBarBackgroundColor": "#ffffff"
},
"style": "v2",
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents",
"tabBar":{
"color":"#ccc",
"selectedColor":"#ff4c91",
"borderStyle":"white",
"backgroundColor":"#fff",
"list":[{
"pagePath":"pages/index/index",
"iconPath":"images/invite.png",
"selectedIconPath":"images/invite.png",
"text":"邀请函"
},{
"pagePath":"pages/picture/picture",
"iconPath":"images/marry.png",
"selectedIconPath":"images/marry.png",
"text":"照片"
},{
"pagePath":"pages/video/video",
"iconPath":"images/video.png",
"selectedIconPath":"images/video.png",
"text":"美好时光"
},{
"pagePath":"pages/guest/guest",
"iconPath":"images/guest.png",
"selectedIconPath":"images/guest.png",
"text":"宾客信息"
}
]
},
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor":"#ff4c91",
"navigationBarTextStyle":"white"
}
}

@ -0,0 +1,16 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
page{
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 KiB

@ -0,0 +1,66 @@
// pages/guest/guest.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,28 @@
<!--pages/guest/guest.wxml-->
<image class="bg" src="/images/bj_2.png" />
<form>
<view class="content">
<view class="input">
<input name="name" placeholder-class="phcolor" placeholder="输入您的姓名"/>
</view>
<view class="input">
<input name="phone" placeholder-class="phcolor" placeholder="输入您的手机号码"/>
</view>
<view class="radio">
<text>请选择您的性别:</text>
<radio-group>
<radio>男</radio>
<radio>女</radio>
</radio-group>
</view>
<view class="check">
<text>请选择您需要的点心:</text>
<checkbox-group>
<checkbox>蛋糕</checkbox>
<checkbox>甜甜圈</checkbox>
<checkbox>巧克力</checkbox>
</checkbox-group>
</view>
<button>提交</button>
</view>
</form>

@ -0,0 +1,48 @@
/* pages/guest/guest.wxss */
.bg{
width: 100vw;
height: 100vh;
}
.content{
width: 80vw;
position: fixed;
left: 10vw;
bottom: 8vh;
}
.content .input{
font-size: large;
border: 1rpx solid #ff4c91;
border-radius: 10rpx;
padding: 1.5vh 40rpx;
margin-bottom: 1.5vh;
color: #ff4c91;
}
.content .radio{
font-size: large;
margin-bottom: 1.5vh;
color: #ff4c91;
display: flex;
}
.content .check{
font-size: large;
margin-bottom: 1.5vh;
color: #ff4c91;
}
.check checkbox-group{
margin-top: 1.5vh;
color: #ff4c91;
}
.check checkbox-group checkbox{
margin-left: 20rpx;
}
.check checkbox-group checkbox:nth-child(1){
margin-left: 0;
}
.content button{
font-size: large;
background:#ff4c91;
color: #fff;
}
.content .phcolor{
color: #ff4c91;
}

@ -0,0 +1,49 @@
// index.js
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
Page({
data: {
motto: 'Hello World',
userInfo: {
avatarUrl: defaultAvatarUrl,
nickName: '',
},
hasUserInfo: false,
canIUseGetUserProfile: wx.canIUse('getUserProfile'),
canIUseNicknameComp: wx.canIUse('input.type.nickname'),
},
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
},
onChooseAvatar(e) {
const { avatarUrl } = e.detail
const { nickName } = this.data.userInfo
this.setData({
"userInfo.avatarUrl": avatarUrl,
hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl,
})
},
onInputChange(e) {
const nickName = e.detail.value
const { avatarUrl } = this.data.userInfo
this.setData({
"userInfo.nickName": nickName,
hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl,
})
},
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息开发者每次通过该接口获取用户个人信息均需用户确认开发者妥善保管用户快速填写的头像昵称避免重复弹窗
wx.getUserProfile({
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
},
})

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "邀请函"
}

@ -0,0 +1,61 @@
<!--index.wxml-->
<scroll-view class="scrollarea" scroll-y type="list">
<view class="container">
<view class="userinfo">
<block wx:if="{{canIUseNicknameComp && !hasUserInfo}}">
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="avatar" src="{{userInfo.avatarUrl}}"></image>
</button>
<view class="nickname-wrapper">
<text class="nickname-label">昵称</text>
<input type="nickname" class="nickname-input" placeholder="请输入昵称" bind:change="onInputChange" />
</view>
</block>
<block wx:elif="{{!hasUserInfo}}">
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
<view wx:else> 请使用2.10.4及以上版本基础库 </view>
</block>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
<view class="usermotto">
<text class="user-motto">{{motto}}</text>
</view>
</view>
</scroll-view>
<image class="bg" src="/images/bg_1.png"/>
<view class="content">
<image class="content-gif" src="/images/save_the_date.gif"/>
<view class="content-title">邀请函</view>
<view class="content-avatar">
<image src="/images/avatar.png"/>
</view>
<view class="content-info"></view>
<view class="content-address"></view>
</view>
<view class="content-info">
<view class="contenr-name">
<image src="/images/tel.png"/>
<view>王辉辉</view>
<view>新郎</view>
</view>
<view class="content-wedding">
<image src="/images/wedding.png"/>
</view>
<view class="content-wedding">
<image src="/images/wedding.png"/>
<view>张琳琳</view>
<view>新娘</view>
</view>
</view>
<view class="content-address">
<view>我们诚邀您来参加我们的婚礼</view>
<view>时间2022年1月28日</view>
<view>地点北京市海淀区xx路xx酒店</view>
</view>

@ -0,0 +1,135 @@
/**index.wxss**/
page {
height: 100vh;
display: flex;
flex-direction: column;
}
.scrollarea {
flex: 1;
overflow-y: hidden;
}
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
color: #aaa;
width: 80%;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.usermotto {
margin-top: 200px;
}
.avatar-wrapper {
padding: 0;
width: 56px !important;
border-radius: 8px;
margin-top: 40px;
margin-bottom: 40px;
}
.avatar {
display: block;
width: 56px;
height: 56px;
}
.nickname-wrapper {
display: flex;
width: 100%;
padding: 16px;
box-sizing: border-box;
border-top: .5px solid rgba(0, 0, 0, 0.1);
border-bottom: .5px solid rgba(0, 0, 0, 0.1);
color: black;
}
.nickname-label {
width: 105px;
}
.nickname-input {
flex: 1;
}
.bg{
width: 100vw;
height: 100vh;
}
.content{
width: 100vw;
height: 100vh;
position: fixed;
display: flex;
flex-direction: column;
align-items: center;
}
.content-gif{
width: 19vh;
height: 18.6vh;
margin-bottom: 1.5vh;
}
.content-title{
font-size: 5vh;
color: #ff4c91;
text-align: center;
margin-bottom: 2.5vh;
}
.content-avatar image{
width: 24vh;
height: 24vh;
border: 3px solid #ff4c91;
border-radius: 50%;
}
.content-info{
width: 45vw;
text-align: center;
margin-top: 4vh;
display: flex;
align-items: center;
}
.content-name{
color: #ff4c91;
font-size: 2.7vh;
line-height: 4.5vh;
font-weight: bold;
position: relative;
}
.content-name>image{
width: 2.6vh;
height: 2.6vh;
border: 1px solid #ff4c91;
border-radius: 50%;
position: absolute;
top: -1vh;
right: -3.6vh;
}
.content-wedding{
flex: 1;
}
.content-wedding>image{
width: 5.5vh;
height: 5.5vh;
margin-left: 20rpx;
}
.content-address{
margin-top: 5vh;
color: #ec5f89;
font-size: 2.5vh;
font-weight: bold;
text-align: center;
line-height: 4.5vh;
}
.content-address view:first-child{
font-size: 3vh;
padding-bottom: 2vh;
}

@ -0,0 +1,66 @@
// pages/logs/logs.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,2 @@
<!--pages/logs/logs.wxml-->
<text>pages/logs/logs.wxml</text>

@ -0,0 +1,66 @@
// pages/picture/picture.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,15 @@
<!--pages/picture/picture.wxml-->
<swiper indicator-color="white" indicator-active-color="#ff4c91" indicator-dotsautoplay interval="3500" duration="1000" vertical circular>
<swiper-item>
<image src="/images/timg1.jpg"/>
</swiper-item>
<swiper-item>
<image src="/images/timg2.jpg"/>
</swiper-item>
<swiper-item>
<image src="/images/timg3.jpg"/>
</swiper-item>
<swiper-item>
<image src="/images/timg4.jpg"/>
</swiper-item>
</swiper>

@ -0,0 +1,8 @@
/* pages/picture/picture.wxss */
swiper{
height: 100vh;
}
image{
width: 100vw;
height: 100vh;
}

@ -0,0 +1,66 @@
// pages/video/video.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,16 @@
<!--pages/video/video.wxml-->
<view class="video">
<view class="video-title">标题:海边随拍</view>
<view class="video-time">拍摄日期2022-01-01</view>
<video src="http://localhost:3000/01.mp4" objectFit="fill"></video>
</view>
<view class="video">
<view class="video-title">标题:勿忘初心</view>
<view class="video-time">拍摄日期2022-01-10</view>
<video src="http://localhost:3000/02.mp4" objectFit="fill"></video>
</view>
<view class="video">
<view class="video-title">标题:十年之约</view>
<view class="video-time">拍摄日期2022-01-20</view>
<video src="http://localhost:3000/03.mp4" objectFit="fill"></video>
</view>

@ -0,0 +1,20 @@
.video{
box-shadow: 0 8rpx 17rpx 0 rgba(7,17,27,0.1);
margin: 10rpx 25rpx;
margin-bottom: 30rpx;
padding: 20rpx;
border-radius: 10rpx;
background: #fff;
}
.video-title{
font-size: 35rpx;
color: #333;
}
.video-time{
font-size: 26rpx;
color: #979797;
}
.video video{
width: 100%;
margin-top: 20rpx;
}

@ -0,0 +1,28 @@
{
"compileType": "miniprogram",
"libVersion": "trial",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "auto",
"tabSize": 2
},
"appid": "wx48a8c8faed899379"
}

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "miniprogram-7",
"setting": {
"compileHotReLoad": true
}
}

@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

@ -0,0 +1,19 @@
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : `0${n}`
}
module.exports = {
formatTime
}
Loading…
Cancel
Save