Prerequisites#
- Apply for a mini program account
Getting Started#
-
Clone Wedding-invitation and import it into the WeChat development tool. When importing, fill in your appid.
-
Enable cloud development (choose the free package).
-
Create four collections named
bless,photos,comment,invitation, anduser. -
Open the
sqlfolder and import the data according to the collection names. -
Modify the
envfield in theapp.jsfile in the root directory to your cloud development environment ID.
wx.cloud.init({
env: ''
})
-
Right-click on
functionsand select the current cloud development environment. Right-click onget_openIdand select the third option "Upload and Deploy: Cloud Installation Dependencies". -
Recompile.
Data Format Description#
-
blessis the data for the "Friend's Blessing" page. -
commentis the data for the "Leave a Comment" page. -
photosis the data for the "Sweet Album" page. -
useris the user data. -
invitationis the data table (only one record) for basic information. This data is used for the mini program's "Home" and "Map" pages. The data format is as follows:
{
// Groom's name
"boy": "Jay Chou",
// Wedding date in Gregorian calendar
"date": "2020-10-01 12:00:00",
// Bride's name
"girl": "Hannah Quinlivan",
// Wedding location (name of hotel or church)
"hotel": "Selby Abbey, North Yorkshire, England",
// Wedding date in lunar calendar
"lunar": "15th day of the 8th lunar month in the year of Gengzi",
// Background music URL
"music": "https://6465-dev-1goaza5i509ecff5-1258198969.tcb.qcloud.la/audio/ido.mp3?sign=f186b54afeca081690c8c03c2573521c&t=1601797034",
// Whether the background music plays automatically
"autoPlay": false,
// Homepage background image
"image": "https://6465-dev-1goaza5i509ecff5-1258198969.tcb.qcloud.la/photos/cover.jpeg?sign=5ebe072ba028b0a2da8aa54fb82586a0&t=1601799069",
// Wedding location address
"address": "Selby, North Yorkshire, England",
// Wedding location latitude and longitude
"latitude": 38.446324,
"longitude": 112.735426,
// Groom & bride's phone numbers
"boyPhone": "13412344321",
"girlPhone": "13698766789"
}
Note⚠️⚠️⚠️#
-
If the mini program page displays abnormally, please disable the "ES6 to ES5" function.
-
Due to the adjustment of the rules for obtaining user avatars and nicknames in the mini program, it is no longer possible to directly obtain user nicknames and avatars by calling
wx.getUserProfile. Therefore,Wedding-invitationhas been modified according to the official requirements, and users will be redirected to a page to fill in their nicknames and avatars when using the "Blessing" and "Comment" functions for the first time. -
You need to modify the security rules for all tables in the cloud development
databaseandstorageto custom rules. The rules are as follows:
- If you are a personal mini program, the "Leave a Comment" page will not pass the review and you need to comment out this page. 😭😭😭