issue
Taro2
+
Taro``Taro
+
CMS
config #
cloud #
dist #
node_modules #
package.json #
src #
service # cssimageconfig
common # cssimageconfig
components #
store # redux
| pages #
| | Index # index
| | | index.jsx # index
| | | index.scss # index
| | | index.config.js # indexpage.json
util # (util.jsglobalData.js)
app.jsx #
app.scss #
index.html #
static # (CDN)
README.md #
clone``project.config.json``appid
src/service/config``DBID
ID`
wedding_invite
wedding_msgs
wedding_photos
wedding_video
static/db
yarn
yarn
yarn dev:weapp
yarn build:weapp
npm
npm install
npm run dev:weapp
npm run build:weapp
Taro
...
CMS
CMS
static/schema
.
Taro React/Vue/Nerv ///// QQ /H5
Taro2``Taro3``Taro2
TaroDemo
Taro2UI
DBID
serviceCURD
JSON``MongoDb
JSON JSON JSON
API
const db = Taro.cloud.database({
env: 'DBID'
});
collection
db.collection('wedding_msgs')
.orderBy('createTime', 'desc') //
.skip(current * 10)
.limit(pageSize)
.get()
service/cloud/index.js
export
Tips
cloud/functions.js``msgSecCheck
security.msgSecCheck
/**
* @Description:
*/
//
const cloud = require('wx-server-sdk');
cloud.init();
//
exports.main = async function (event, context) {
console.log(event);
let opts = {
content: event.content || ''
};
let fun = cloud.openapi.security.msgSecCheck(opts);
return fun.then(res => {
return res;
}).catch(err => {
return err;
});
};
//
Taro.cloud.callFunction({
name: 'msgCheck',
data: { content: data.userMsg },
}).then(res => {
if (res && res.result && res.result.errCode === 0) {
Taro.showLoading({
title: '...',
mask: true
});
//
cloud.add('wedding_msgs', data).then(msgRes => {
resolve(msgRes);
}, (err) => {
console.log(err);
reject(err);
});
} else {
reject(res.result);
}
}).catch(err => {
console.log(err);
reject(err);
});
Taro + Taro + Antd + koa2 + MongoDb
redux
selectComponent
const barrageComp = this.selectComponent('.barrage')
Taro.createRef();
GitHubStar
issue