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