Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nyx
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
发现
nyx
Commits
1979c813
Commit
1979c813
authored
Oct 13, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp: 功能优化
1. 为图片和logo上传分别提供图片合规验证功能
parent
d6b7145b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
48 行增加
和
26 行删除
+48
-26
增值产品-小程序及app/nyx-dev/app.js
+2
-2
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-post.js
+21
-19
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-submit/activity-submit.js
+25
-5
没有找到文件。
增值产品-小程序及app/nyx-dev/app.js
查看文件 @
1979c813
//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
:
'明白了'
})
...
...
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-post.js
查看文件 @
1979c813
// pa
ges/member/activity-post/activity-post.js
// pa
ges/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
(
"图片合规校验失败"
)
});
},
...
...
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-submit/activity-submit.js
查看文件 @
1979c813
// pa
ges/member/activity-post/activity-submit/activity-submit.js
// pa
ges/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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论