Commit 1979c813 by jscat

nyx weapp: 功能优化

1. 为图片和logo上传分别提供图片合规验证功能
parent d6b7145b
//app.js
//app.js
......@@ -325,7 +325,7 @@ App({
if (checkResult.data.errcode == '87014') {
wx.hideLoading();
wx.showModal({
content: '第' + i + '张图存在敏感内容,请更换图片',
content: '第' + i + '张图存在敏感内容, 请更换',
showCancel: false,
confirmText: '明白了'
})
......
// pages/member/activity-post/activity-post.js
// pages/member/activity-post/activity-post.js
......@@ -129,24 +129,26 @@ Page({
navigateToEdit() {
var _this = this;
var newFilePaths = _this.data.photoArray
// let promise = app.onCheckPic(newFilePaths)
// //在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
// //then后的括号里应该是参数param
// //https://www.cnblogs.com/qlongbg/p/11603328.html
// promise.then(function (value) {
// console.log("===checkPic_enter promise then_" + value)
// //同步更新全局变量
// app.globalData.postData.photoArray = newFilePaths
// wx.navigateTo({ url: './edit/edit' })
// });
//先设置支付按钮为可点击
var canClick = true;
_this.setData({ canClick })
//离开的时候再赋值全局变量
app.globalData.postData.photoArray = newFilePaths
wx.navigateTo({ url: './activity-edit/activity-edit' })
let promise_checkPic = app.onCheckPic(newFilePaths)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise_checkPic.then(function (value) {
console.log("===checkPic_enter promise passed_" + value)
console.log("图片合规校验成功")
//先设置支付按钮为可点击
var canClick = true;
_this.setData({ canClick })
//离开的时候再赋值全局变量
app.globalData.postData.photoArray = newFilePaths
wx.navigateTo({ url: './activity-edit/activity-edit' })
},
function (value) {
console.log("===checkPic_enter promise failed_" + value)
console.log("图片合规校验失败")
});
},
......
// pages/member/activity-post/activity-submit/activity-submit.js
// pages/member/activity-post/activity-submit/activity-submit.js
......@@ -599,7 +599,7 @@ Page({
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
console.log("字段合规校验成功")
console.log("字段合规校验成功")
_this.getUserInfo()
},
function (value) {
......@@ -717,9 +717,29 @@ Page({
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log("===addLogo_上传图片参数", res)
_this.setData({
logoArray: res.tempFilePaths
})
//新增图片合规审核功能 jscat 20201013
var newFilePaths = res.tempFilePaths
let promise_checkPic = app.onCheckPic(newFilePaths)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise_checkPic.then(function (value) {
console.log("===checkPic_enter promise passed_" + value)
console.log("图片合规校验成功")
_this.setData({
logoArray: res.tempFilePaths
})
},
function (value) {
console.log("===checkPic_enter promise failed_" + value)
console.log("图片合规校验失败")
_this.setData({
logoArray: []
})
});
}
})
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论