Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 60a22386
authored
Oct 10, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提示合并至wxapi里面
1 parent
36fbfd31
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
47 deletions
utils/util.js
utils/utils_wx.js
utils/wxShowToast.js
utils/util.js
View file @
60a2238
import
{
commonApi
,
equityApi
}
from
'../api/api'
import
{
commonApi
}
from
'../api/api'
// import {
// sopApi,
// commonApi,
// bigdatautilApi,
// equityApi
// } from '../api/api'
import
$router
from
'../router/index'
import
$router
from
'../router/index'
/**
/**
...
...
utils/utils_wx.js
View file @
60a2238
/**
/**
* 微信校验通知类工具封装
*/
const
tipsObj
=
{
phone
:
{
icon
:
'error'
,
title
:
'请输入手机号'
},
username
:
{
icon
:
'error'
,
title
:
'请输入用户名'
},
password
:
{
icon
:
'error'
,
title
:
'请输入密码'
}
}
/**
* 禁止滑动
* 禁止滑动
*/
*/
const
noScroll
=
()
=>
{}
const
noScroll
=
()
=>
{}
...
@@ -51,6 +70,26 @@ const showToast = val => {
...
@@ -51,6 +70,26 @@ const showToast = val => {
}
}
return
wx
.
showToast
(
obj
)
return
wx
.
showToast
(
obj
)
}
}
/**
*
* @param {* string | object} name 信息名称
* @param {* object | null} [params] 信息名称参数
*/
const
wxShowToast
=
(
name
,
params
)
=>
{
if
(
arguments
.
length
==
2
)
{
wx
.
showToast
({
title
:
tipsObj
[
name
][
'title'
],
icon
:
tipsObj
[
name
][
'icon'
],
...
params
})
}
else
{
wx
.
showToast
({
...
params
})
}
}
/**获取设备信息 */
/**获取设备信息 */
const
getSystemInfo
=
callBack
=>
{
const
getSystemInfo
=
callBack
=>
{
wx
.
getSystemInfo
({
wx
.
getSystemInfo
({
...
@@ -82,6 +121,7 @@ const wxApi = {
...
@@ -82,6 +121,7 @@ const wxApi = {
setCopyData
,
setCopyData
,
showToast
,
showToast
,
phoneCall
,
phoneCall
,
noScroll
noScroll
,
wxShowToast
}
}
export
default
wxApi
export
default
wxApi
utils/wxShowToast.js
deleted
100644 → 0
View file @
36fbfd3
/**
* 微信校验通知类工具封装
*/
const
tipsObj
=
{
phone
:
{
icon
:
"error"
,
title
:
"请输入手机号"
,
},
username
:
{
icon
:
"error"
,
title
:
"请输入用户名"
,
},
password
:
{
icon
:
"error"
,
title
:
"请输入密码"
,
},
};
/**
*
* @param {* string | object} name 信息名称
* @param {* object | null} [params] 信息名称参数
*/
const
wxShowToast
=
(
name
,
params
)
=>
{
if
(
arguments
.
length
==
2
)
{
wx
.
showToast
({
title
:
tipsObj
[
name
][
"title"
],
icon
:
tipsObj
[
name
][
"icon"
],
...
params
,
});
}
else
{
wx
.
showToast
({
...
params
,
});
}
};
export
default
wxShowToast
;
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment