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 7051fa06
authored
Oct 11, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
去除组件 mixin方法
1 parent
60a22386
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
123 deletions
components/Authorize/Authorize.js
components/Calendar/Calendar.js
components/NavigationBar/NavigationBar.js
components/Popup/Popup.js
components/SearchBox/SearchBox.js
components/SearchInput/SearchInput.js
components/Tab/Tab.js
components/Authorize/Authorize.js
View file @
7051fa0
// components/Authorize/Authorize.js
import
{
componentsMixin
}
from
'../../mixins/index'
Component
({
behaviors
:
[
componentsMixin
],
/**
* 组件的属性列表
*/
...
...
@@ -39,7 +35,7 @@ Component({
}
},
observers
:
{
'show'
:
function
(
newVal
)
{
show
:
function
(
newVal
)
{
this
.
setData
({
openSet
:
newVal
})
...
...
@@ -48,9 +44,7 @@ Component({
/**
* 组件的初始数据
*/
data
:
{
},
data
:
{},
/**
* 组件的方法列表
*/
...
...
@@ -60,13 +54,8 @@ Component({
*/
noScroll
:
wx
.
$util
.
noScroll
(),
cancel
(
e
)
{
let
{
confirm
}
=
e
.
currentTarget
.
dataset
let
{
buttonType
,
title
}
=
this
.
data
let
{
confirm
}
=
e
.
currentTarget
.
dataset
let
{
buttonType
,
title
}
=
this
.
data
let
_this
=
this
if
(
buttonType
==
'getUserInfo'
&&
confirm
)
{
wx
.
getUserProfile
({
...
...
@@ -87,11 +76,7 @@ Component({
/**检验是否已授权位置 */
check
()
{
const
_this
=
this
let
{
buttonType
,
scopeType
,
autoOpen
}
=
this
.
properties
let
{
buttonType
,
scopeType
,
autoOpen
}
=
this
.
properties
if
(
buttonType
!=
'getPhoneNumber'
)
{
let
type
=
`scope.
${
scopeType
}
`
buttonType
=
'openSetting'
...
...
@@ -128,12 +113,9 @@ Component({
}
})
}
},
/**授权手机号 */
getPhoneNumber
({
detail
})
{
getPhoneNumber
({
detail
})
{
console
.
log
(
detail
)
this
.
triggerEvent
(
'getphonenumber'
,
detail
)
}
...
...
@@ -144,4 +126,4 @@ Component({
},
hide
:
function
()
{}
}
})
\ No newline at end of file
})
components/Calendar/Calendar.js
View file @
7051fa0
...
...
@@ -2,9 +2,7 @@
import
Calendar
from
'./Calendar_Function'
import
_component_
from
'./Static_Properties'
const
CalendarFunction
=
Symbol
(
'CalendarFunction'
)
import
{
componentsMixin
}
from
'../../mixins/index'
Component
({
// behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
...
...
@@ -24,7 +22,7 @@ Component({
this
[
CalendarFunction
].
setCalenderBodyHeight
()
},
showCalendar
(
e
)
{
let
type
=
e
&&
e
.
currentTarget
&&
e
.
currentTarget
.
dataset
.
type
||
''
let
type
=
(
e
&&
e
.
currentTarget
&&
e
.
currentTarget
.
dataset
.
type
)
||
''
let
result
=
type
===
'show'
if
(
!
result
)
{
this
.
setData
({
...
...
@@ -44,29 +42,19 @@ Component({
}
},
dateChange
(
e
)
{
let
{
current
}
=
e
.
detail
let
{
current
}
=
e
.
detail
this
.
setData
({
current
})
},
choose
(
e
)
{
let
{
dateType
,
minDate
,
maxDate
}
=
this
.
data
let
{
data
}
=
e
.
currentTarget
.
dataset
let
{
dateType
,
minDate
,
maxDate
}
=
this
.
data
let
{
data
}
=
e
.
currentTarget
.
dataset
if
((
minDate
&&
Date
.
parse
(
minDate
)
>
Date
.
parse
(
data
))
||
(
maxDate
&&
Date
.
parse
(
maxDate
)
<
Date
.
parse
(
data
)))
return
this
[
CalendarFunction
][
dateType
](
e
)
},
done
()
{
let
{
dateType
}
=
this
.
data
let
{
dateType
}
=
this
.
data
this
[
CalendarFunction
].
done
(
dateType
)
},
changeDate
(
e
)
{
...
...
@@ -87,4 +75,4 @@ Component({
attached
()
{
this
[
CalendarFunction
]
=
new
Calendar
(
this
)
}
})
\ No newline at end of file
})
components/NavigationBar/NavigationBar.js
View file @
7051fa0
// components/navigationBar/navigationBar.js
import
{
componentsMixin
}
from
'../../mixins/index'
Component
({
// behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
...
...
@@ -40,18 +36,9 @@ Component({
* 获取自定义导航栏信息
*/
wx
.
getSystemInfo
().
then
(
res
=>
{
let
{
fontSizeSetting
,
statusBarHeight
,
screenWidth
}
=
res
const
{
height
,
right
,
width
,
top
}
=
wx
.
getMenuButtonBoundingClientRect
()
let
navigationBarHeight
=
height
+
((
top
-
statusBarHeight
)
*
2
)
+
4
// 4
let
{
fontSizeSetting
,
statusBarHeight
,
screenWidth
}
=
res
const
{
height
,
right
,
width
,
top
}
=
wx
.
getMenuButtonBoundingClientRect
()
let
navigationBarHeight
=
height
+
(
top
-
statusBarHeight
)
*
2
+
4
// 4
let
navigationBarPadding
=
screenWidth
-
right
let
navigationBarWidth
=
screenWidth
-
(
navigationBarPadding
*
2
+
width
)
-
width
this
.
setData
({
...
...
@@ -66,10 +53,7 @@ Component({
})
})
},
emit
({
navigationBarHeight
,
statusBarHeight
})
{
emit
({
navigationBarHeight
,
statusBarHeight
})
{
let
navHeight
=
navigationBarHeight
+
statusBarHeight
const
thisPage
=
wx
.
$router
.
getPageInstance
()
const
currentPages
=
getCurrentPages
()
...
...
@@ -84,9 +68,10 @@ Component({
navHeight
,
statusBarHeight
})
if
(
currentPages
.
length
==
1
&&
!
thisPage
.
rootName
)
thisPage
.
setData
({
showHomeBtn
:
true
})
if
(
currentPages
.
length
==
1
&&
!
thisPage
.
rootName
)
thisPage
.
setData
({
showHomeBtn
:
true
})
}
},
lifetimes
:
{
...
...
@@ -95,4 +80,4 @@ Component({
this
.
setPageTitle
()
}
}
})
\ No newline at end of file
})
components/Popup/Popup.js
View file @
7051fa0
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
import
{
componentsMixin
}
from
'../../mixins/index'
Component
({
behaviors
:
[
componentsMixin
],
/**
* 组件的属性列表
*/
...
...
@@ -30,7 +26,6 @@ Component({
hideTab
})
}
}
},
title
:
String
,
...
...
@@ -47,9 +42,7 @@ Component({
/**
* 组件的初始数据
*/
data
:
{
},
data
:
{},
/**
* 组件的方法列表
...
...
@@ -66,11 +59,9 @@ Component({
}
},
attached
()
{
const
{
isTab
}
=
wx
.
$router
.
getRouterList
().
find
(
item
=>
item
.
url
===
`/
${
wx
.
$router
.
getPageInstance
().
route
}
`
)
const
{
isTab
}
=
wx
.
$router
.
getRouterList
().
find
(
item
=>
item
.
url
===
`/
${
wx
.
$router
.
getPageInstance
().
route
}
`
)
this
.
setData
({
isTab
})
},
})
\ No newline at end of file
}
})
components/SearchBox/SearchBox.js
View file @
7051fa0
// components/SearchBox/SearchBox.js
import
{
componentsMixin
}
from
'../../mixins/index'
;
Component
({
behaviors
:
[
componentsMixin
],
/**
* 组件的属性列表
*/
properties
:
{
placeholder
:
{
type
:
String
,
value
:
"请输入搜索内容"
,
value
:
'请输入搜索内容'
},
value
:
{
type
:
String
,
value
:
""
,
value
:
''
,
observer
(
n
)
{
this
.
setData
({
inputValue
:
n
,
})
;
}
,
inputValue
:
n
})
}
},
searchType
:
{
type
:
Number
,
value
:
1
,
value
:
1
},
couponDetails
:
Boolean
,
couponDetails
:
Boolean
},
/**
* 组件的初始数据
*/
data
:
{
inputValue
:
""
,
inputValue
:
''
},
/**
...
...
@@ -38,29 +36,29 @@ Component({
*/
methods
:
{
input
(
e
)
{
let
{
value
}
=
e
.
detail
;
let
{
value
}
=
e
.
detail
this
.
setData
({
inputValue
:
value
,
})
;
inputValue
:
value
})
},
blur
(
e
)
{
let
{
inputValue
}
=
this
.
data
;
let
{
inputValue
}
=
this
.
data
this
.
setData
({
inputValue
,
})
;
inputValue
})
},
clear
()
{
this
.
setData
({
inputValue
:
""
,
})
;
inputValue
:
''
})
},
confirm
(
e
)
{
let
{
value
}
=
e
.
detail
;
this
.
triggerEvent
(
"search"
,
value
);
let
{
value
}
=
e
.
detail
this
.
triggerEvent
(
'search'
,
value
)
},
search
(
e
)
{
let
{
value
}
=
e
.
currentTarget
.
dataset
;
this
.
triggerEvent
(
"search"
,
value
);
}
,
}
,
})
;
let
{
value
}
=
e
.
currentTarget
.
dataset
this
.
triggerEvent
(
'search'
,
value
)
}
}
})
components/SearchInput/SearchInput.js
View file @
7051fa0
// components/SearchInput/SearchInput.js
import
{
componentsMixin
}
from
'../../mixins/index'
Component
({
behaviors
:[
componentsMixin
],
/**
* 组件的属性列表
*/
...
...
@@ -22,9 +20,7 @@ Component({
/**
* 组件的初始数据
*/
data
:
{
},
data
:
{},
/**
* 组件的方法列表
...
...
@@ -39,9 +35,7 @@ Component({
})
},
input
(
e
)
{
let
{
value
}
=
e
.
detail
let
{
value
}
=
e
.
detail
this
.
setValue
(
value
)
this
.
triggerEvent
(
'input'
,
{
value
...
...
@@ -55,9 +49,7 @@ Component({
},
emit
(
e
)
{
let
{
detail
:{
value
},
detail
:
{
value
},
type
}
=
e
this
.
setData
({
...
...
@@ -69,4 +61,4 @@ Component({
})
}
}
})
\ No newline at end of file
})
components/Tab/Tab.js
View file @
7051fa0
// components/Tab/Tab.js
import
{
componentsMixin
}
from
'../../mixins/index'
Component
({
behaviors
:[
componentsMixin
],
/**
* 组件的属性列表
*/
...
...
@@ -36,9 +34,7 @@ Component({
*/
methods
:
{
click
(
e
)
{
let
{
count
}
=
e
.
currentTarget
.
dataset
let
{
count
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
count
,
to
:
`to-
${
count
}
`
...
...
@@ -46,4 +42,4 @@ Component({
this
.
triggerEvent
(
'click'
,
count
)
}
}
})
\ No newline at end of file
})
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