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 f6723fa2
authored
Oct 12, 2022
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
..
2 parents
20beb725
c564c51b
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
557 additions
and
411 deletions
app.wxss
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/Tab/Tab.wxss
mixins/imgUrl.js
mixins/index.js
packageMine/pages/editBasicInfo/index.js
packageMine/pages/withdrawal/index.js
packageMine/pages/withdrawal/index.wxml
packageMine/pages/withdrawalSuccess/index.js
packageMine/pages/withdrawalSuccess/index.wxml
pages/tab/discovery/components/headerNav/headerNav.js
pages/tab/discovery/components/headerNav/headerNav.json
pages/tab/discovery/components/headerNav/headerNav.scss
pages/tab/discovery/components/headerNav/headerNav.wxml
pages/tab/discovery/components/product/product.js
pages/tab/discovery/components/product/product.json
pages/tab/discovery/components/product/product.scss
pages/tab/discovery/components/product/product.wxml
pages/tab/discovery/discovery.js
pages/tab/discovery/discovery.json
pages/tab/discovery/discovery.scss
pages/tab/discovery/discovery.wxml
pages/tab/mine/components/countInfo/countInfo.js
pages/tab/mine/components/countInfo/countInfo.wxml
pages/tab/mine/components/userInfo/userInfo.js
pages/tab/mine/components/userInfo/userInfo.wxml
router/router.js
router/routerBefore.js
router/wxOnAppRoute.js
utils/Draw.js
utils/util.js
utils/utils_wx.js
utils/wxShowToast.js
app.wxss
View file @
f6723fa
...
@@ -6,7 +6,7 @@ page {
...
@@ -6,7 +6,7 @@ page {
color: #282829;
color: #282829;
font-size: 28rpx;
font-size: 28rpx;
--themeColor: #F13C3D;
--themeColor: #F13C3D;
--btnColor: #
FC5B32
;
--btnColor: #
3666FE
;
--borderRadius: 8rpx;
--borderRadius: 8rpx;
--margin: 32rpx;
--margin: 32rpx;
}
}
...
...
components/Authorize/Authorize.js
View file @
f6723fa
// 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 @
f6723fa
...
@@ -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 @
f6723fa
// 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 @
f6723fa
// 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 @
f6723fa
// 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 @
f6723fa
// 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 @
f6723fa
// 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
}
`
...
...
components/Tab/Tab.wxss
View file @
f6723fa
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
width: 100%;
width: 100%;
height: 92rpx;
height: 92rpx;
box-sizing: border-box;
box-sizing: border-box;
border-bottom: 1rpx solid #EAEBEF;
}
}
.tab-box.left{
.tab-box.left{
padding-left: 32rpx;
padding-left: 32rpx;
...
@@ -25,8 +26,12 @@
...
@@ -25,8 +26,12 @@
display: flex;
display: flex;
align-items: center;
align-items: center;
box-sizing: border-box;
box-sizing: border-box;
color: #
A9A9A9
;
color: #
8A8C90
;
justify-content: center;
justify-content: center;
margin: 0 24rpx;
font-weight: 400;
font-size: 28rpx;
font-family: PingFangSC-Medium;
}
}
.left .text{
.left .text{
justify-content: flex-start;
justify-content: flex-start;
...
@@ -39,14 +44,14 @@
...
@@ -39,14 +44,14 @@
font-weight: 500;
font-weight: 500;
font-size: 28rpx;
font-size: 28rpx;
transition: all .25s;
transition: all .25s;
color:
#2C2C2C
;
color:
var(--btnColor)
;
}
}
.tab .line {
.tab .line {
width: 48rpx;
width: 48rpx;
height: var(--borderRadius);
height: var(--borderRadius);
background: var(--btnColor);
background: var(--btnColor);
border-radius:
2rpx
;
border-radius:
8rpx 8rpx 0 0
;
margin: 0 auto;
margin: 0 auto;
transform: scale(0);
transform: scale(0);
transition: all .25s;
transition: all .25s;
...
...
mixins/imgUrl.js
0 → 100644
View file @
f6723fa
import
{
IMG_URL
}
from
'~/utils/constantData'
module
.
exports
=
Behavior
({
data
:
{
IMGURL
:
IMG_URL
}
})
\ No newline at end of file
\ No newline at end of file
mixins/index.js
View file @
f6723fa
import
imgUrlMixin
from
'./imgUrl'
module
.
exports
=
{
module
.
exports
=
{
imgUrlMixin
}
}
packageMine/pages/editBasicInfo/index.js
View file @
f6723fa
...
@@ -30,12 +30,15 @@ Page({
...
@@ -30,12 +30,15 @@ Page({
clickRow
(
e
){
clickRow
(
e
){
const
{
index
}
=
e
.
currentTarget
.
dataset
const
{
index
}
=
e
.
currentTarget
.
dataset
console
.
log
(
index
);
if
(
index
==
1
){
if
(
index
==
1
){
this
.
setData
({
this
.
setData
({
showModal
:
true
showModal
:
true
})
})
return
return
}
}
wx
.
$router
.
go
(
'packageMine.settingName.index'
)
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
...
...
packageMine/pages/withdrawal/index.js
View file @
f6723fa
...
@@ -5,6 +5,8 @@ Page({
...
@@ -5,6 +5,8 @@ Page({
data
:
{
data
:
{
IMGURL
:
IMG_URL
,
IMGURL
:
IMG_URL
,
},
},
toSumbitData
(){
wx
.
$router
.
go
(
'packageMine.withdrawalSuccess.index'
)
}
})
})
\ No newline at end of file
\ No newline at end of file
packageMine/pages/withdrawal/index.wxml
View file @
f6723fa
...
@@ -13,5 +13,5 @@
...
@@ -13,5 +13,5 @@
<view class="btn flex_cc">全部提现</view>
<view class="btn flex_cc">全部提现</view>
</view>
</view>
</view>
</view>
<view class="sumbit_btn flex_cc">提交</view>
<view class="sumbit_btn flex_cc"
bind:tap="toSumbitData"
>提交</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
packageMine/pages/withdrawalSuccess/index.js
View file @
f6723fa
...
@@ -6,5 +6,8 @@ Page({
...
@@ -6,5 +6,8 @@ Page({
IMGURL
:
IMG_URL
,
IMGURL
:
IMG_URL
,
},
},
toWatchNote
(){
wx
.
$router
.
go
(
'packageMine.withdrawalNote.index'
)
},
})
})
\ No newline at end of file
\ No newline at end of file
packageMine/pages/withdrawalSuccess/index.wxml
View file @
f6723fa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<view class="tip_text">您的提现申请已成功提交,预计将在24小时</view>
<view class="tip_text">您的提现申请已成功提交,预计将在24小时</view>
<view class="tip_text">到达您的微信零钱,请留意到账情况</view>
<view class="tip_text">到达您的微信零钱,请留意到账情况</view>
<view class="btn_group flex_cc">
<view class="btn_group flex_cc">
<view class="btn_left flex_cc">查看提现记录</view>
<view class="btn_left flex_cc"
bind:tap="toWatchNote"
>查看提现记录</view>
<view class="btn_right flex_cc">返回我的积分</view>
<view class="btn_right flex_cc">返回我的积分</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
pages/tab/discovery/components/headerNav/headerNav.js
0 → 100644
View file @
f6723fa
// pages/tab/discovery/components/headerNav/headerNav.js
const
navStyle
=
"background-color: transparent;"
;
import
{
imgUrlMixin
}
from
'~/mixins/index'
Component
({
behaviors
:
[
imgUrlMixin
],
/**
* 组件的属性列表
*/
properties
:
{
},
/**
* 组件的初始数据
*/
data
:
{
navStyle
,
// IMG_URL,
sceneList
:[
'scene_talk.png'
,
'scene_delivery.png'
,
'scene_within_12mth.png'
,
'scene_more_12mth.png'
],
},
navbarReady
(
e
)
{
let
{
height
}
=
e
.
detail
;
this
.
setData
({
user_box_style
:
`padding-top:
${
height
+
20
}
px`
,
});
},
/**
* 组件的方法列表
*/
methods
:
{
}
})
pages/tab/discovery/components/headerNav/headerNav.json
0 → 100644
View file @
f6723fa
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/discovery/components/headerNav/headerNav.scss
0 → 100644
View file @
f6723fa
/* pages/tab/discovery/components/headerNav/headerNav.wxss */
.header
{
position
:
relative
;
width
:
100%
;
height
:
304rpx
;
margin-bottom
:
80rpx
;
box-shadow
:
0
16rpx
16rpx
0
rgba
(
230
,
236
,
245
,
0
.6
);
}
.scene-wrap
{
position
:
absolute
;
bottom
:
0
;
transform
:
translateY
(
75rpx
);
white-space
:
nowrap
;
}
.scene-item
{
width
:
672rpx
;
height
:
180rpx
;
}
\ No newline at end of file
\ No newline at end of file
pages/tab/discovery/components/headerNav/headerNav.wxml
0 → 100644
View file @
f6723fa
<!--pages/tab/discovery/components/headerNav/headerNav.wxml-->
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现">
<text>发现</text>
</navigation-bar>
<view class="header">
<image style="width: 100%;height: 100%" src="{{IMGURL}}discovery_center_bg.png"></image>
<scroll-view class="scene-wrap" scroll-x="{{true}}">
<block wx:for="{{sceneList}}" wx:key="index">
<image class="scene-item" src="{{IMGURL}}{{item}}"></image>
</block>
</scroll-view>
</view>
pages/tab/discovery/components/product/product.js
0 → 100644
View file @
f6723fa
// pages/tab/discovery/components/product/product.js
import
{
imgUrlMixin
}
from
'~/mixins/index'
Component
({
behaviors
:
[
imgUrlMixin
],
/**
* 组件的属性列表
*/
properties
:
{
},
/**
* 组件的初始数据
*/
data
:
{
navList
:[
'360全景导航'
,
'AR实景导航'
,
'座椅通风'
,
'氛围灯'
,
'数字化美容'
],
activeNavIdx
:
0
,
tab
:[
'适用场景'
,
'营销链路'
,
'项目亮点'
,
'适用场景'
,
'转化漏斗'
,
'合作流程'
,
'适用场景'
,
'营销链路'
,
'项目亮点'
,
'适用场景'
,
'转化漏斗'
,
'合作流程'
],
heightArr
:[],
curTabIdx
:
0
,
intoViewId
:
'to-0'
},
lifetimes
:{
ready
:
function
(){
console
.
log
(
11111
)
this
.
getImgHeight
()
},
},
/**
* 组件的方法列表
*/
methods
:
{
changeTab
(
e
){
let
idx
=
e
.
detail
this
.
setData
({
intoViewId
:
`to-
${
idx
}
`
})
},
changeNav
(
event
){
console
.
log
(
event
,
event
.
target
.
dataset
.
index
,
111
)
this
.
setData
({
activeNavIdx
:
event
.
target
.
dataset
.
index
})
},
scrolltoupper
(
event
){
const
idx
=
this
.
data
.
heightArr
.
findIndex
(
item
=>
item
>
event
.
detail
.
scrollTop
)
this
.
setData
({
curTabIdx
:
idx
})
console
.
log
(
this
.
data
.
curTabIdx1
)
},
getImgHeight
(){
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
let
heightArr
=
[]
let
s
=
0
query
.
selectAll
(
'.img-item'
).
boundingClientRect
((
react
)
=>
{
react
.
forEach
(
item
=>
{
s
+=
item
.
height
heightArr
.
push
(
s
)
})
this
.
data
.
heightArr
=
heightArr
console
.
log
(
this
.
data
.
heightArr
)
}).
exec
()
}
}
})
pages/tab/discovery/components/product/product.json
0 → 100644
View file @
f6723fa
{
"component"
:
true
,
"usingComponents"
:
{
"tab"
:
"../../../../../components/Tab/Tab"
}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/discovery/components/product/product.scss
0 → 100644
View file @
f6723fa
// 特色产品
.prod-wrap
.big-title
{
margin-left
:
40rpx
;
font-family
:
PingFangSC-S0pxibold
;
font-weight
:
600
;
font-size
:
36rpx
;
color
:
#1B233D
;
line-height
:
56rpx
;
}
.prod-wrap
.nav-wrap
{
white-space
:
nowrap
;
box-sizing
:
border-box
;
margin-top
:
24rpx
;
margin-bottom
:
32rpx
;
padding
:
0
20rpx
;
}
.prod-wrap
.nav-wrap
.nav
{
display
:
inline-block
;
width
:
188rpx
;
height
:
64rpx
;
border-radius
:
12rpx
;
font-weight
:
600
;
font-size
:
24rpx
;
letter-spacing
:
0
;
text-align
:
center
;
font-family
:
PingFangSC-Regular
;
line-height
:
64rpx
;
margin-right
:
12rpx
;
background
:
#FFFFFF
;
border
:
2rpx
solid
#DDE3F0
;
}
.prod-wrap
.nav-wrap
.active-nav
{
background-image
:
linear-gradient
(
0deg
,
#EBEFFF
8%
,
#FCFDFF
85%
);
border
:
2rpx
solid
rgba
(
68
,
97
,
240
,
0
.50
);
box-shadow
:
0
8rpx
16rpx
0
rgba
(
175
,
187
,
219
,
0
.35
);
}
.prod-wrap
.nav-wrap
.nav
:last-child
{
margin-right
:
0
;
}
.prod-item
{
background-color
:
#F5F7FB
;
border-radius
:
48rpx
48rpx
0
0
;
padding
:
40rpx
24rpx
32rpx
;
}
.prod-card
{
display
:
flex
;
height
:
208rpx
;
background-image
:
linear-gradient
(
1deg
,
#FFFFFF
10%
,
#FDFCFF
100%
);
border
:
2rpx
solid
#FFFFFF
;
box-shadow
:
0
8rpx
20rpx
0
rgba
(
197
,
205
,
235
,
0
.35
);
border-radius
:
20rpx
;
padding
:
20rpx
24rpx
;
box-sizing
:
border-box
;
position
:
relative
;
}
.prod-card
.card-img
{
width
:
160rpx
;
height
:
160rpx
;
flex-shrink
:
0
;
border-radius
:
4rpx
;
}
.img-desc
{
position
:
absolute
;
width
:
104rpx
;
height
:
40rpx
;
line-height
:
40rpx
;
background
:
#D7F5EB
;
border-radius
:
4rpx
;
font-family
:
PingFangSC-Medium
;
font-weight
:
600
;
font-size
:
24rpx
;
color
:
#24B38C
;
letter-spacing
:
0
;
text-align
:
center
;
}
.prod-info
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
padding
:
12rpx
0
;
margin-left
:
24rpx
;
}
.prod-info
>
text
{
display
:
block
;
white-space
:
nowrap
;
height
:
40rpx
;
line-height
:
40rpx
;
}
.prod-info
.title
{
font-family
:
PingFangSC-Medium
;
font-weight
:
600
;
font-size
:
28rpx
;
color
:
#323436
;
}
.prod-info
.sale
,
.prod-info
.earnings
{
font-size
:
26rpx
;
color
:
#7A8299
;
}
.prod-info
.sale-num
{
font-size
:
26rpx
;
color
:
#323436
;
}
.prod-info
.earnings-num
{
font-size
:
28rpx
;
font-family
:
DINAlternate-Bold
;
font-weight
:
Bold
;
color
:
#F35251
;
}
.share-btn
{
height
:
56rpx
;
line-height
:
56rpx
;
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-size
:
24rpx
;
background-image
:
linear-gradient
(
-60deg
,
#556AF5
0%
,
#7197FF
100%
);
border-radius
:
12rpx
;
color
:
#fff
;
padding
:
0
20rpx
;
display
:
flex
;
align-items
:
center
;
position
:
absolute
;
right
:
24rpx
;
top
:
50%
;
transform
:
translateY
(
-50%
);
}
.share-btn
.icon
{
width
:
24rpx
;
height
:
24rpx
;
margin-right
:
8rpx
;
}
.project-wrap
{
background-color
:
#F5F7FB
;
}
.project-img
{
height
:
500rpx
;
white-space
:
nowrap
;
.img-item
{
height
:
300rpx
;
}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/discovery/components/product/product.wxml
0 → 100644
View file @
f6723fa
<!--pages/tab/discovery/components/product/product.wxml-->
<view class="prod-wrap">
<text class="big-title">特色产品</text>
<scroll-view class="nav-wrap" scroll-x="{{true}}">
<block wx:for="{{navList}}" wx:key="index">
<text class='nav {{activeNavIdx==index ? "active-nav": ""}}' bindtap="changeNav" data-index="{{index}}">{{item}}</text>
</block>
</scroll-view>
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<text class="img-desc">轻改类</text>
<image src="{{IMGURL}}discovery_prod1.png"></image>
</view>
<view class="prod-info">
<text class="title">360全景导航</text>
<text class="sale">新车销量 <text class="sale-num">100</text></text>
<text class="earnings">预估收益 <text class="earnings-num">92.4 万</text></text>
</view>
<view class="share-btn">
<image class="icon" src="{{IMGURL}}share.png"></image>
<text>分享</text>
</view>
</view>
</view>
</view>
<view class="project-wrap">
<tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
<block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item">
{{item}}
</view>
</block>
</scroll-view>
</view>
pages/tab/discovery/discovery.js
View file @
f6723fa
...
@@ -7,14 +7,14 @@ Page({
...
@@ -7,14 +7,14 @@ Page({
data
:
{
data
:
{
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
},
},
methods
:{
},
/**
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
*/
*/
...
...
pages/tab/discovery/discovery.json
View file @
f6723fa
{
{
"usingComponents"
:
{}
"usingComponents"
:
{
"headerNav"
:
"./components/headerNav/headerNav"
,
"product"
:
"./components/product/product"
},
"navigationStyle"
:
"custom"
}
}
\ No newline at end of file
\ No newline at end of file
pages/tab/discovery/discovery.scss
View file @
f6723fa
/* pages/tab/output/output.wxss */
/* pages/tab/output/output.wxss */
pages/tab/discovery/discovery.wxml
View file @
f6723fa
<!--pages/tab/output/output.wxml-->
<view style="background: #fff;">
<text>pages/tab/output/output.wxml</text>
<headerNav></headerNav>
<product></product>
</view>
\ No newline at end of file
\ No newline at end of file
pages/tab/mine/components/countInfo/countInfo.js
View file @
f6723fa
...
@@ -18,6 +18,11 @@ Component({
...
@@ -18,6 +18,11 @@ Component({
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
toTiXian
(){
wx
.
$router
.
go
(
'packageMine.withdrawal.index'
)
},
toWatchNote
(){
wx
.
$router
.
go
(
'packageMine.withdrawalNote.index'
)
},
}
}
})
})
pages/tab/mine/components/countInfo/countInfo.wxml
View file @
f6723fa
<view style="{{boxStyle}}" class="integral_widget">
<view style="{{boxStyle}}" class="integral_widget">
<view class="wrapper">
<view class="wrapper">
<image mode="widthFix" class="bg_icon" src="{{IMGURL}}intergral_bg_icon.png" />
<image mode="widthFix" class="bg_icon" src="{{IMGURL}}intergral_bg_icon.png" />
<view class="btn_wrap flex_sc">
<view
bind:tap="toTiXian"
class="btn_wrap flex_sc">
<text>我要提现</text>
<text>我要提现</text>
<image class="right_icon" src="{{IMGURL}}right_arrow_icon.png" />
<image class="right_icon" src="{{IMGURL}}right_arrow_icon.png" />
</view>
</view>
<view class="tip">我的积分</view>
<view class="tip">我的积分</view>
<view class="money">5655999.99</view>
<view class="money">5655999.99</view>
<view class="note_btn">提现记录</view>
<view class="note_btn"
bind:tap="toWatchNote"
>提现记录</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
pages/tab/mine/components/userInfo/userInfo.js
View file @
f6723fa
...
@@ -21,6 +21,8 @@ Component({
...
@@ -21,6 +21,8 @@ Component({
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
toEditPage
(){
wx
.
$router
.
go
(
'packageMine.editBasicInfo.index'
)
}
}
}
})
})
pages/tab/mine/components/userInfo/userInfo.wxml
View file @
f6723fa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<view class="info_text">
<view class="info_text">
<view class="label flex_sc">
<view class="label flex_sc">
<text>百晓生</text>
<text>百晓生</text>
<image mode="aspectFill" class="edit_icon" src="{{IMGURL}}center_edit_icon.png" />
<image
bind:tap="toEditPage"
mode="aspectFill" class="edit_icon" src="{{IMGURL}}center_edit_icon.png" />
</view>
</view>
<view class="contact_widget flex_sc">
<view class="contact_widget flex_sc">
<view class="text">18269445456</view>
<view class="text">18269445456</view>
...
...
router/router.js
View file @
f6723fa
const
_routeHooks
=
Symbol
(
'_routeHooks'
)
const
_routeHooks
=
Symbol
(
'_routeHooks'
)
const
_query
=
Symbol
(
'_query'
)
const
_query
=
Symbol
(
'_query'
)
const
_routerList
=
Symbol
(
'_routerList'
)
const
_routerList
=
Symbol
(
'_routerList'
)
import
{
wxOnAppRouteFn
,
generateRoutList
}
from
'./wxOnAppRoute.js'
import
{
import
{
getNavigationBarTitleText
}
from
'~/utils/cache/storageApi'
generateRoutList
import
{
getUserInfo
}
from
'~/utils/cache/userInfo'
}
from
'./wxOnAppRoute.js'
import
{
getNavigationBarTitleText
}
from
'~/utils/cache/storageApi'
import
{
getUserInfo
}
from
'~/utils/cache/userInfo'
class
Router
{
class
Router
{
[
_query
]
=
{};
[
_query
]
=
{};
[
_routeHooks
]
=
[];
[
_routeHooks
]
=
[];
[
_routerList
]
=
[]
[
_routerList
]
=
[]
constructor
(
router
)
{
constructor
(
router
)
{
this
[
_routerList
]
=
generateRoutList
(
router
)
this
[
_routerList
]
=
generateRoutList
(
router
)
let
obj
=
{
wx
.
onAppRoute
&&
query
:
this
[
_query
],
wx
.
onAppRoute
(
e
=>
{
routeHooks
:
this
[
_routeHooks
],
let
thisPage
=
this
.
getPageInstance
()
routerList
:
this
[
_routerList
],
if
(
thisPage
)
{
getPageInstance
:
this
.
getPageInstance
,
thisPage
.
options
=
this
[
_query
]
getRootName
:
this
.
getRootName
,
this
.
setNavigationBarTitleText
(
thisPage
)
setNavigationBarTitleText
:
this
.
setNavigationBarTitleText
,
let
onRoute
=
thisPage
.
onRoute
getRouterList
:
this
.
getRouterList
typeof
onRoute
===
'function'
&&
onRoute
(
this
[
_query
])
}
this
[
_routeHooks
].
forEach
(
fn
=>
{
try
{
typeof
fn
===
'function'
&&
fn
(
e
,
this
[
_query
],
this
[
_routerList
])
}
catch
(
err
)
{
console
.
log
(
err
)
}
}
wxOnAppRouteFn
(
obj
)
})
this
[
_query
]
=
{}
})
}
}
/**设置标题栏 */
/**设置标题栏 */
setNavigationBarTitleText
=
thisPage
=>
{
setNavigationBarTitleText
=
thisPage
=>
{
...
@@ -27,8 +41,11 @@ class Router {
...
@@ -27,8 +41,11 @@ class Router {
if
(
getUserInfo
())
title
=
getUserInfo
().
merchantName
if
(
getUserInfo
())
title
=
getUserInfo
().
merchantName
const
router
=
`
${
thisPage
.
__route__
}
.html`
const
router
=
`
${
thisPage
.
__route__
}
.html`
if
(
__wxConfig
&&
__wxConfig
.
page
&&
__wxConfig
.
page
[
router
])
{
if
(
__wxConfig
&&
__wxConfig
.
page
&&
__wxConfig
.
page
[
router
])
{
let
{
navigationBarTitleText
,
navigationStyle
}
=
__wxConfig
.
page
[
router
].
window
let
{
if
(
!
title
)
title
=
'广汇车生活'
navigationBarTitleText
,
navigationStyle
}
=
__wxConfig
.
page
[
router
].
window
if
(
!
title
)
title
=
'生意助手'
if
(
!
navigationBarTitleText
&&
!
navigationStyle
)
if
(
!
navigationBarTitleText
&&
!
navigationStyle
)
wx
.
setNavigationBarTitle
({
wx
.
setNavigationBarTitle
({
title
title
...
@@ -39,12 +56,6 @@ class Router {
...
@@ -39,12 +56,6 @@ class Router {
getRouterList
=
()
=>
{
getRouterList
=
()
=>
{
return
this
[
_routerList
]
return
this
[
_routerList
]
}
}
/**获取当前分包名 */
getRootName
=
()
=>
{
let
router
=
`/
${
this
.
getPageInstance
().
__route__
}
`
let
{
rootName
}
=
this
.
getRouterList
().
find
(
item
=>
router
===
item
.
url
)
return
rootName
}
/**获取页面对象实例 */
/**获取页面对象实例 */
getPageInstance
=
(
size
=
1
)
=>
{
getPageInstance
=
(
size
=
1
)
=>
{
const
pages
=
getCurrentPages
()
const
pages
=
getCurrentPages
()
...
@@ -67,16 +78,16 @@ class Router {
...
@@ -67,16 +78,16 @@ class Router {
parent
=
_parent
parent
=
_parent
}
}
/**只传页面名 默认跳转当前包下的页面,相同名称默认第一个 */
/**只传页面名 默认跳转当前包下的页面,相同名称默认第一个 */
if
(
!
_name
&&
!
last_name
)
{
if
(
!
_name
&&
!
last_name
)
name
=
_parent
name
=
_parent
parent
=
this
.
getRootName
()
||
parent
}
const
routerMapItem
=
this
[
_routerList
].
find
(
item
=>
{
const
routerMapItem
=
this
[
_routerList
].
find
(
item
=>
{
if
(
route
.
includes
(
'/'
))
return
item
.
url
===
route
else
{
if
(
last_name
)
{
if
(
last_name
)
{
return
item
.
parent
===
parent
&&
item
.
name
===
last_name
&&
item
.
subPages
===
name
return
item
.
parent
===
parent
&&
item
.
name
===
last_name
&&
item
.
subPages
===
name
}
else
{
}
else
{
return
item
.
parent
===
parent
&&
item
.
name
===
name
return
item
.
parent
===
parent
&&
item
.
name
===
name
}
}
}
})
})
if
(
!
routerMapItem
)
{
if
(
!
routerMapItem
)
{
console
.
error
(
'找不到路由'
)
console
.
error
(
'找不到路由'
)
...
@@ -89,12 +100,9 @@ class Router {
...
@@ -89,12 +100,9 @@ class Router {
}
}
/**跳转至H5 */
/**跳转至H5 */
jumpH5
(
url
)
{
jumpH5
(
url
)
{
this
.
intercept
().
then
(
response
=>
{
if
(
response
)
return
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
`/pages/webView/webView?url=
${
encodeURIComponent
(
url
)}
`
url
:
`/pages/webView/webView?url=
${
encodeURIComponent
(
url
)}
`
})
})
})
}
}
/**页面跳转
/**页面跳转
*
*
...
@@ -108,47 +116,40 @@ class Router {
...
@@ -108,47 +116,40 @@ class Router {
* 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 $router.back() 可以返回到原页面。小程序中页面栈最多十层
* 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 $router.back() 可以返回到原页面。小程序中页面栈最多十层
*/
*/
go
(
route
,
events
)
{
go
(
route
,
events
)
{
let
{
routerMapItem
,
query
}
=
this
.
checkRouter
(
route
,
events
)
let
{
routerMapItem
,
query
}
=
this
.
checkRouter
(
route
,
events
)
if
(
routerMapItem
.
isTab
)
{
if
(
routerMapItem
.
isTab
)
{
wx
.
switchTab
({
wx
.
switchTab
({
url
:
routerMapItem
.
url
url
:
routerMapItem
.
url
})
})
}
else
{
}
else
{
if
(
events
&&
events
.
notIntercept
)
{
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
`
${
routerMapItem
.
url
}${
query
}
`
,
url
:
`
${
routerMapItem
.
url
}${
query
}
`
,
success
:
res
=>
events
&&
res
.
eventChannel
.
emit
(
'getData'
,
events
)
success
:
res
=>
events
&&
res
.
eventChannel
.
emit
(
'getData'
,
events
)
})
})
}
else
{
this
.
intercept
().
then
(
response
=>
{
if
(
response
)
return
wx
.
navigateTo
({
url
:
`
${
routerMapItem
.
url
}${
query
}
`
,
success
:
res
=>
events
&&
res
.
eventChannel
.
emit
(
'getData'
,
events
)
})
})
}
}
}
}
}
/**关闭所有页面,打开到应用内的某个页面 */
/**关闭所有页面,打开到应用内的某个页面 */
reLaunch
(
route
,
events
)
{
reLaunch
(
route
,
events
)
{
let
{
routerMapItem
,
query
}
=
this
.
checkRouter
(
route
,
events
)
let
{
this
.
intercept
().
then
(
response
=>
{
routerMapItem
,
if
(
response
)
return
query
}
=
this
.
checkRouter
(
route
,
events
)
wx
.
reLaunch
({
wx
.
reLaunch
({
url
:
`
${
routerMapItem
.
url
}${
query
}
`
url
:
`
${
routerMapItem
.
url
}${
query
}
`
})
})
})
}
}
/**关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 */
/**关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 */
redirectTo
(
route
,
events
)
{
redirectTo
(
route
,
events
)
{
let
{
routerMapItem
,
query
}
=
this
.
checkRouter
(
route
,
events
)
let
{
this
.
intercept
().
then
(
response
=>
{
routerMapItem
,
if
(
response
)
return
query
}
=
this
.
checkRouter
(
route
,
events
)
wx
.
redirectTo
({
wx
.
redirectTo
({
url
:
`
${
routerMapItem
.
url
}${
query
}
`
url
:
`
${
routerMapItem
.
url
}${
query
}
`
})
})
})
}
}
/**prevPageSize = 1
/**prevPageSize = 1
* 返回上prevPageSize页
* 返回上prevPageSize页
...
@@ -164,7 +165,7 @@ class Router {
...
@@ -164,7 +165,7 @@ class Router {
}
}
goHome
()
{
goHome
()
{
let
[
index
]
=
this
[
_routerList
]
let
[
index
]
=
this
[
_routerList
]
wx
.
switchTab
({
wx
.
reLaunch
({
url
:
index
.
url
url
:
index
.
url
})
})
}
}
...
@@ -180,18 +181,6 @@ class Router {
...
@@ -180,18 +181,6 @@ class Router {
if
(
i
>
-
1
)
list
.
splice
(
i
,
1
)
if
(
i
>
-
1
)
list
.
splice
(
i
,
1
)
}
}
}
}
async
intercept
()
{
const
authStatus
=
wx
.
$authStatus
if
(
authStatus
)
{
const
thisPage
=
this
.
getPageInstance
()
thisPage
.
setData
({
showLogin
:
true
})
return
await
true
}
else
{
return
await
false
}
}
}
}
export
default
Router
export
default
Router
\ No newline at end of file
\ No newline at end of file
router/routerBefore.js
View file @
f6723fa
import
{
IMG_URL
}
from
'~/utils/constantData'
/**
/**
* 执行路由前的准备工作
* 执行路由前的准备工作
*/
*/
/**处理前置钩子逻辑 */
/**处理前置钩子逻辑 */
const
routerBefore
=
(
next
)
=>
{
const
routerBefore
=
next
=>
{
// console.log("处理前置钩子逻辑");
// console.log("处理前置钩子逻辑");
// 配置图片全局路径
let
page
=
wx
.
$router
.
getPageInstance
()
page
&&
(
page
.
data
.
IMG_URL
=
IMG_URL
)
next
();
// page && page.setData({ IMG_URL })
};
// console.log()
// console.log(next)
next
()
}
/**处理后置钩子逻辑 */
/**处理后置钩子逻辑 */
const
routerAfter
=
(
next
)
=>
{
const
routerAfter
=
next
=>
{
// console.log("处理后置钩子逻辑");
// console.log("处理后置钩子逻辑");
next
()
;
next
()
}
;
}
// 重写Page方法
// 重写Page方法
const
OldPage
=
Page
;
const
OldPage
=
Page
Page
=
function
(
options
)
{
Page
=
function
(
options
)
{
const
oldShow
=
options
.
onShow
;
const
oldShow
=
options
.
onShow
const
oldHide
=
options
.
onHide
;
const
oldHide
=
options
.
onHide
options
.
onShow
=
function
()
{
options
.
onShow
=
function
()
{
routerBefore
(()
=>
{
routerBefore
(()
=>
{
oldShow
.
apply
(
this
,
arguments
)
;
oldShow
.
apply
(
this
,
arguments
)
})
;
})
}
;
}
options
.
onHide
=
function
()
{
options
.
onHide
=
function
()
{
routerAfter
(()
=>
{
routerAfter
(()
=>
{
oldHide
.
apply
(
this
,
arguments
)
;
oldHide
.
apply
(
this
,
arguments
)
})
;
})
}
;
}
OldPage
(
options
)
;
OldPage
(
options
)
}
;
}
export
default
routerBefore
;
export
default
routerBefore
router/wxOnAppRoute.js
View file @
f6723fa
import
util
from
'../utils/util.js'
// import util from '../utils/util.js'
import
{
getUserInfo
}
from
'~/utils/cache/userInfo'
// import {
import
{
IMG_URL
}
from
'~/utils/constantData'
// getUserInfo
// } from '~/utils/cache/userInfo'
/**
/**
* wx.onAppRoute钩子方法,
* wx.onAppRoute钩子方法,
...
@@ -13,74 +14,6 @@ import { IMG_URL } from '~/utils/constantData'
...
@@ -13,74 +14,6 @@ import { IMG_URL } from '~/utils/constantData'
* @param {*} obj.setNavigationBarTitleText
* @param {*} obj.setNavigationBarTitleText
* @param {*} obj.getRouterList
* @param {*} obj.getRouterList
*/
*/
export
const
wxOnAppRouteFn
=
obj
=>
{
wx
.
onAppRoute
&&
wx
.
onAppRoute
(
e
=>
{
let
thisPage
=
obj
.
getPageInstance
()
const
rootName
=
obj
.
getRootName
()
if
(
rootName
)
{
const
selectedColor
=
rootName
==
'packageEquity'
?
'#f7dcbc'
:
'#FC5B32'
wx
.
setTabBarStyle
({
selectedColor
,
color
:
'#979899'
,
backgroundColor
:
'#FFFFFF'
,
borderStyle
:
'white'
})
}
if
(
thisPage
)
{
obj
.
setNavigationBarTitleText
(
thisPage
)
let
onRoute
=
thisPage
.
onRoute
thisPage
.
$query
=
obj
.
query
typeof
onRoute
===
'function'
&&
onRoute
(
obj
.
query
)
thisPage
.
rootName
=
rootName
obj
.
getRouterList
().
find
(
item
=>
{
if
(
`/
${
thisPage
.
__route__
}
`
===
item
.
url
)
{
const
authStatus
=
wx
.
$authStatus
// if (item.isTab) thisPage.setData({
// showLogin: authStatus
// })
}
})
if
(
!
wx
.
$version
)
util
.
getImgVersion
().
then
(({
version
})
=>
{
wx
.
$version
=
version
||
'1.0.0'
thisPage
.
setData
({
img_version
:
wx
.
$version
})
})
else
thisPage
.
setData
({
img_version
:
wx
.
$version
})
// console.log(app)
thisPage
.
setData
({
IMGURL
:
IMG_URL
})
let
userInfo
=
getUserInfo
()
if
(
userInfo
&&
userInfo
.
phone
)
{
if
(
wx
.
$authStatus
)
{
thisPage
.
setData
({
userInfo
:
null
})
}
else
{
thisPage
.
setData
({
userInfo
})
if
(
thisPage
.
init
)
thisPage
.
init
(
userInfo
)
}
}
}
obj
.
routeHooks
.
forEach
(
fn
=>
{
try
{
typeof
fn
===
'function'
&&
fn
(
e
,
obj
.
query
,
obj
.
routerList
)
}
catch
(
err
)
{
console
.
log
(
err
)
}
})
obj
.
query
=
{}
})
}
/**
/**
* 生成特定格式路由
* 生成特定格式路由
*
*
...
@@ -102,16 +35,11 @@ export const generateRoutList = routerList => {
...
@@ -102,16 +35,11 @@ export const generateRoutList = routerList => {
}
}
if
(
item
.
parent
!==
'pages'
)
{
if
(
item
.
parent
!==
'pages'
)
{
let
parentList
=
item
.
url
.
split
(
`/`
)
let
parentList
=
item
.
url
.
split
(
`/`
)
if
(
parentList
.
length
>
5
)
{
if
(
parentList
.
length
>
4
)
{
item
.
url
=
item
.
url
.
replace
(
/
\/
__plugin__
\/[
a-z0-9A-Z
]
+/
,
''
)
item
.
url
=
item
.
url
.
replace
(
/
\/
__plugin__
\/[
a-z0-9A-Z
]
+/
,
''
)
obj
.
subPages
=
item
.
url
.
split
(
`/
${
item
.
parent
}
/pages/`
)[
1
].
split
(
'/'
)[
0
]
obj
.
subPages
=
item
.
url
.
split
(
`/
${
item
.
parent
}
/pages/`
)[
1
].
split
(
'/'
)[
0
]
}
}
}
}
if
(
obj
.
isTab
)
{
__wxConfig
.
tabBar
.
list
.
map
(
e
=>
{
if
(
obj
.
url
===
`/
${
e
.
pagePath
.
replace
(
'.html'
,
''
)}
`
)
obj
.
rootName
=
e
.
rootName
})
}
}
}
return
obj
return
obj
}))
}))
...
...
utils/Draw.js
View file @
f6723fa
...
@@ -8,10 +8,8 @@ class Draw {
...
@@ -8,10 +8,8 @@ class Draw {
[
_canvasObject_
]
=
null
;
[
_canvasObject_
]
=
null
;
[
_canvas_
]
=
null
[
_canvas_
]
=
null
constructor
(
canvasObject
)
{
constructor
(
canvasObject
)
{
wx
.
getSystemInfo
().
then
(({
wx
.
getSystemInfo
().
then
(({
pixelRatio
})
=>
{
pixelRatio
// console.log(pixelRatio)
})
=>
{
console
.
log
(
pixelRatio
)
this
[
_canvasObject_
]
=
canvasObject
this
[
_canvasObject_
]
=
canvasObject
this
[
_pixelRatio_
]
=
canvasObject
.
pixelRatio
||
pixelRatio
||
2
this
[
_pixelRatio_
]
=
canvasObject
.
pixelRatio
||
pixelRatio
||
2
const
height
=
this
.
toRpx
(
canvasObject
.
height
),
const
height
=
this
.
toRpx
(
canvasObject
.
height
),
...
@@ -38,14 +36,7 @@ class Draw {
...
@@ -38,14 +36,7 @@ class Draw {
drawImages
(
imageParams
,
callback
)
{
drawImages
(
imageParams
,
callback
)
{
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
save
()
this
[
_ctx_
].
save
()
let
{
let
{
borderRadius
,
height
,
width
,
url
,
x
,
y
}
=
imageParams
borderRadius
,
height
,
width
,
url
,
x
,
y
}
=
imageParams
height
=
this
.
toRpx
(
height
)
height
=
this
.
toRpx
(
height
)
width
=
this
.
toRpx
(
width
)
width
=
this
.
toRpx
(
width
)
x
=
this
.
toRpx
(
x
)
x
=
this
.
toRpx
(
x
)
...
@@ -78,13 +69,7 @@ class Draw {
...
@@ -78,13 +69,7 @@ class Draw {
if
(
fontSize
)
this
[
_ctx_
].
font
=
`
${
fontSize
}
px
${
font
}
`
if
(
fontSize
)
this
[
_ctx_
].
font
=
`
${
fontSize
}
px
${
font
}
`
return
this
[
_ctx_
].
measureText
(
text
).
width
return
this
[
_ctx_
].
measureText
(
text
).
width
}
}
drawFill
({
drawFill
({
x
,
y
,
width
,
height
,
color
})
{
x
,
y
,
width
,
height
,
color
})
{
height
=
this
.
toRpx
(
height
)
height
=
this
.
toRpx
(
height
)
width
=
this
.
toRpx
(
width
)
width
=
this
.
toRpx
(
width
)
x
=
this
.
toRpx
(
x
)
x
=
this
.
toRpx
(
x
)
...
@@ -97,24 +82,7 @@ class Draw {
...
@@ -97,24 +82,7 @@ class Draw {
this
[
_ctx_
].
save
()
this
[
_ctx_
].
save
()
}
}
drawText
(
textParams
)
{
drawText
(
textParams
)
{
let
{
let
{
textDecoration
,
textBaseline
,
lineHeight
,
fontWeight
,
textAlign
,
textWidth
,
maxWidth
,
fontSize
,
lastFont
,
opacity
,
lineNum
,
width
,
color
,
text
,
x
,
y
}
=
textParams
,
textDecoration
,
textBaseline
,
lineHeight
,
fontWeight
,
textAlign
,
textWidth
,
maxWidth
,
fontSize
,
lastFont
,
opacity
,
lineNum
,
width
,
color
,
text
,
x
,
y
}
=
textParams
,
font
=
this
[
_ctx_
].
font
.
split
(
'px'
)[
1
]
font
=
this
[
_ctx_
].
font
.
split
(
'px'
)[
1
]
textAlign
=
textAlign
||
'left'
textAlign
=
textAlign
||
'left'
textBaseline
=
textBaseline
||
'normal'
textBaseline
=
textBaseline
||
'normal'
...
@@ -258,15 +226,7 @@ class Draw {
...
@@ -258,15 +226,7 @@ class Draw {
}
}
drawLine
(
lineParams
,
callback
)
{
drawLine
(
lineParams
,
callback
)
{
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
beginPath
()
let
{
let
{
opacity
,
startX
,
startY
,
width
,
color
,
endX
,
endY
}
=
lineParams
opacity
,
startX
,
startY
,
width
,
color
,
endX
,
endY
}
=
lineParams
startX
=
this
.
toRpx
(
startX
)
startX
=
this
.
toRpx
(
startX
)
startY
=
this
.
toRpx
(
startY
)
startY
=
this
.
toRpx
(
startY
)
width
=
this
.
toRpx
(
width
)
width
=
this
.
toRpx
(
width
)
...
@@ -283,12 +243,7 @@ class Draw {
...
@@ -283,12 +243,7 @@ class Draw {
if
(
callback
)
callback
()
if
(
callback
)
callback
()
}
}
setLineY
=
params
=>
{
setLineY
=
params
=>
{
let
{
let
{
textDecoration
,
textBaseline
,
fontSize
,
y
}
=
params
textDecoration
,
textBaseline
,
fontSize
,
y
}
=
params
let
type
=
{
let
type
=
{
underline
:
{
underline
:
{
top
:
y
+
fontSize
,
top
:
y
+
fontSize
,
...
@@ -312,11 +267,7 @@ class Draw {
...
@@ -312,11 +267,7 @@ class Draw {
return
type
[
textDecoration
][
textBaseline
]
return
type
[
textDecoration
][
textBaseline
]
}
}
setLineX
({
setLineX
({
textAlign
,
text
,
x
})
{
textAlign
,
text
,
x
})
{
let
textWidth
=
this
.
getTextWidth
(
text
)
let
textWidth
=
this
.
getTextWidth
(
text
)
let
type
=
{
let
type
=
{
left
:
x
,
left
:
x
,
...
@@ -326,13 +277,7 @@ class Draw {
...
@@ -326,13 +277,7 @@ class Draw {
return
type
[
textAlign
]
return
type
[
textAlign
]
}
}
drawRadiusRect
({
drawRadiusRect
({
borderRadius
,
height
,
width
,
x
,
y
},
callBack
)
{
borderRadius
,
height
,
width
,
x
,
y
},
callBack
)
{
let
radius
=
typeof
borderRadius
===
'string'
?
((
Number
(
borderRadius
.
split
(
'%'
)[
0
])
/
100
)
*
width
)
/
2
:
borderRadius
/
2
let
radius
=
typeof
borderRadius
===
'string'
?
((
Number
(
borderRadius
.
split
(
'%'
)[
0
])
/
100
)
*
width
)
/
2
:
borderRadius
/
2
radius
=
radius
||
0
radius
=
radius
||
0
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
beginPath
()
...
@@ -343,12 +288,7 @@ class Draw {
...
@@ -343,12 +288,7 @@ class Draw {
}
}
if
(
callBack
)
callBack
()
if
(
callBack
)
callBack
()
}
}
getFontWidth
({
getFontWidth
({
textAlign
,
fontSize
,
text
,
x
})
{
textAlign
,
fontSize
,
text
,
x
})
{
let
type
=
{
let
type
=
{
left
:
x
,
left
:
x
,
center
:
x
-
(
fontSize
*
text
.
length
)
/
2
,
center
:
x
-
(
fontSize
*
text
.
length
)
/
2
,
...
@@ -358,12 +298,7 @@ class Draw {
...
@@ -358,12 +298,7 @@ class Draw {
}
}
drawDecoration
(
params
)
{
drawDecoration
(
params
)
{
let
{
let
{
newText
,
opacity
,
y
,
x
}
=
params
newText
,
opacity
,
y
,
x
}
=
params
let
lineX
=
x
let
lineX
=
x
let
lineY
=
y
let
lineY
=
y
lineX
=
this
.
setLineX
(
params
)
lineX
=
this
.
setLineX
(
params
)
...
...
utils/util.js
View file @
f6723fa
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 @
f6723fa
/**
/**
* 微信校验通知类工具封装
*/
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 @
20beb72
/**
* 微信校验通知类工具封装
*/
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