业务背景
婚纱影楼小程序提供了一个连贯用户与影楼的平台,相当于影楼在微信的官网。它能帮忙影楼展现拍摄实力,记录访客数据,宣传优惠活动。应用频率高,不便流传,是影楼在微信端宣传营销的得力助手。其采纳腾讯提供的小程序云开发解决方案,毋庸服务器和域名。 样片页是影楼展现优良摄影样片提供给用户观赏并且吸引客户的。套系页是影楼依据市场需求推出的不同套餐,用户能够依照本人的爱好预约套系。集体核心能够查看用户预约的拍摄打算,也能够获取到影楼的联系方式。
性能需要
数据库设计
技术攻关
小程序目前提审是越来越严格,须要 对用户公布的内容,图片,视频等进行平安合规校验,保障不呈现不雅的内容。
对此开发了针对图片和文本的校验办法
const cloudHelper = require('../helper/cloud_helper.js');const pageHelper = require('../helper/page_helper.js');const setting = require('../setting/setting.js');/** * 图片类型校验 * @param {*} fileName * @param {*} type */function imgTypeCheck(path, type = ['jpg', 'jpeg', 'png','JPG','JPEG','PNG']) { let fmt = path.split(".")[(path.split(".")).length - 1]; if (type.indexOf(fmt) > -1) return true; else return false;}/** * 图片大小校验 * @param {*} size * @param {*} maxSize */function imgSizeCheck(size, maxSize) { return size < maxSize;}async function imgCheckCloud(path, opt) { /* let result = await cloudHelper.callCloudSumbit('check/img', params, opt).then(res => { return true; }).catch(err => { return false; }); */ let result = await wx.cloud.callFunction({ name: 'cloud', data: { route: 'check/img', token : '', params:{img: wx.cloud.CDN( { type: 'filePath', filePath: path, }) } }, success: function (res) { console.log(res) console.log('succ') return true; }, fail: function (res) { console.log(res) return false; }, complete: function (res) { } }); return result;}/** * 图像校验 * @param {*} imgData */async function imgCheck(imgData) { let result = await wx.serviceMarket.invokeService({ service: 'wxee446d7507c68b11', api: 'imgSecCheck', data: { "Action": "ImageModeration", "Scenes": ["PORN", "POLITICS", "TERRORISM"], "ImageUrl": new wx.serviceMarket.CDN({ type: 'filePath', filePath: imgData, }), "ImageBase64": '', "Config": "", "Extra": "" }, }).then(res => { if (res && res.data && res.data.Response && res.data.Response.PornResult && res.data.Response.PornResult.Suggestion === 'PASS' && res.data.Response.PoliticsResult && res.data.Response.PoliticsResult.Suggestion === 'PASS' && res.data.Response.TerrorismResult && res.data.Response.TerrorismResult.Suggestion === 'PASS') return true; else return false; }).catch(err => { console.log(err); return false; }); return result;}module.exports = { imgCheck, imgCheckCloud, imgTypeCheck, imgSizeCheck}
前端界面设计
后端界面设计
Git Open source
Gitee