Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_Travel
Commits
eba58ed8
Commit
eba58ed8
authored
Feb 21, 2025
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
cca67d1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
184 additions
and
1441 deletions
+184
-1441
index.vue
components/tabbar/index.vue
+79
-299
index.vue
pages/index/index.vue
+105
-1142
No files found.
components/tabbar/index.vue
View file @
eba58ed8
<
style
scoped
>
.tabbarMain
{
height
:
100
upx
;
position
:
fixed
;
z-index
:
50
;
flex
:
1
;
bottom
:
0
;
left
:
0
;
right
:
0
;
z-index
:
99999999
;
border-top
:
1
upx
solid
#ddd
;
padding-top
:
96
rpx
;
background
:
#fff
;
}
.tabbarMainIphone
{
height
:
156
upx
;
padding-bottom
:
64
upx
;
}
.tabBtnMina
{
width
:
750
upx
;
height
:
88
upx
;
position
:
absolute
;
z-index
:
2
;
bottom
:
0
;
flex-direction
:
row
;
display
:
flex
;
left
:
0
;
right
:
0
;
z-index
:
99999999
;
}
.tabBtnMinaIphone
{
height
:
156
upx
;
padding-bottom
:
64
upx
;
}
.imgse
{
height
:
48
upx
;
width
:
48
upx
;
}
.txtBtn
{
font-size
:
24
upx
;
color
:
#666666
;
}
.txtBtnSel
{
font-size
:
24
upx
;
color
:
#333333
;
}
.itmMain
{
width
:
150
upx
;
flex
:
1
;
justify-content
:
center
;
align-items
:
center
;
display
:
flex
;
flex-direction
:
column
;
}
.imgseTs
{
width
:
150
upx
;
height
:
140
upx
;
margin-bottom
:
90
upx
;
position
:
relative
;
z-index
:
1
;
bottom
:
0
upx
;
}
.btnfixMin
{
width
:
750
upx
;
height
:
178
upx
;
position
:
absolute
;
z-index
:
1
;
bottom
:
0
;
}
.btnfixMinIphone
{
bottom
:
64
upx
;
}
.fixTpm
{
width
:
150
upx
;
height
:
140
upx
;
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
position
:
relative
;
z-index
:
0
;
}
.imgseTsAnds
{
width
:
150
upx
;
height
:
150
upx
;
position
:
fixed
;
z-index
:
1
;
bottom
:
10
upx
;
border-radius
:
150
upx
;
}
</
style
>
<
template
>
<view
class=
"tabbarMain bar-box"
:class=
"[flagTypeInfo ? 'tabbarMainIphone' : '']"
v-if=
"navs && navs.length > 0"
>
<view
class=
"tabBtnMina"
:class=
"[flagTypeInfo ? 'tabBtnMinaIphone' : '']"
mode=
""
>
<view
class=
"tabbarMain"
:style=
"
{paddingBottom: `${bottomSafeHeight}px`}" v-if="navs.length">
<view
class=
"tabBtnMina"
>
<view
class=
"itmMain"
v-for=
"(x, i) in navs"
...
...
@@ -108,23 +9,12 @@
>
<image
class=
"imgse"
:fade-show=
"false"
v-if=
"active != i"
:src=
"active === i ? x.active_icon : x.icon"
mode=
"aspectFit"
:src=
"x.icon"
></image>
<image
class=
"imgse"
:fade-show=
"false"
v-if=
"active === i"
mode=
"aspectFit"
:src=
"x.active_icon"
></image>
<text
class=
"txtBtn"
:style=
"
{ color: active == i ? x.active_color : x.color }"
>
{{
x
.
text
}}
</text
>
/>
<text
class=
"txtBtn"
:style=
"
{ color: active == i ? x.active_color : x.color }">
{{
x
.
text
}}
</text>
</view>
</view>
</view>
...
...
@@ -135,199 +25,89 @@ export default {
data
()
{
return
{
active
:
0
,
platforms
:
""
,
leftWidth
:
0
,
flagTypeInfo
:
false
,
navs
:
[],
crtPath
:
""
,
bottomSafeHeight
:
0
,
currentPath
:
''
};
},
created
()
{
},
mounted
()
{
this
.
flagTypeInfo
=
this
.
$uiConfig
.
is_bang
;
let
tempSystem
=
uni
.
getSystemInfoSync
();
this
.
platforms
=
tempSystem
.
platform
;
this
.
$nextTick
(()
=>
{
// #ifdef APP-NVUE || APP-PLUS || APP-PLUS-NVUE ||APP-VUE
if
(
this
.
platforms
==
"android"
)
{
let
temp
=
this
.
$refs
.
leftWidth
;
this
.
leftWidth
=
tempSystem
.
screenWidth
/
2
;
}
// #endif
});
if
(
uni
.
getStorageSync
(
"navs"
))
{
this
.
navs
=
uni
.
getStorageSync
(
"navs"
)
??
[];
}
else
{
setTimeout
(()
=>
{
this
.
navs
=
uni
.
getStorageSync
(
"navs"
)
??
[];
this
.
activeHandler
();
},
3000
);
}
this
.
activeHandler
();
this
.
navs
=
uni
.
getStorageSync
(
"navs"
)
||
[]
this
.
calcSafeArea
()
this
.
activeHandler
()
},
methods
:
{
calcSafeArea
()
{
const
{
safeAreaInsets
}
=
uni
.
getSystemInfoSync
()
this
.
bottomSafeHeight
=
safeAreaInsets
.
bottom
>
0
?
safeAreaInsets
.
bottom
:
10
},
activeHandler
()
{
let
t
=
getCurrentPages
();
const
pages
=
getCurrentPages
()
const
currentPage
=
pages
[
pages
.
length
-
1
]
const
query
=
currentPage
.
options
const
queryString
=
Object
.
keys
(
query
)
.
map
(
key
=>
`
${
key
}
=
${
query
[
key
]}
`
)
.
join
(
'&'
)
this
.
currentPath
=
`/
${
currentPage
.
route
}${
queryString
?
'?'
+
queryString
:
''
}
`
// #ifdef MP-WEIXIN
let
query
=
t
[
t
.
length
-
1
].
__displayReporter
.
query
;
let
queryString
=
""
;
for
(
var
k
in
query
)
{
queryString
+=
`&
${
k
}
=
${
query
[
k
]}
`
;
this
.
navs
.
forEach
((
item
,
index
)
=>
{
if
(
this
.
currentPath
===
item
.
url
)
{
this
.
active
=
index
}
if
(
queryString
!=
""
)
{
queryString
=
"?"
+
queryString
.
substring
(
1
,
queryString
.
length
);
}
this
.
crtPath
=
"/"
+
t
[
t
.
length
-
1
].
route
+
queryString
;
// #endif
// #ifdef MP-ALIPAY
this
.
crtPath
=
t
[
t
.
length
-
1
].
$page
.
fullPath
;
// #endif
this
.
navs
.
forEach
((
x
,
i
)
=>
{
if
(
x
.
url
==
this
.
crtPath
)
{
this
.
active
=
i
;
}
});
})
},
goUrl
(
url
)
{
if
(
this
.
crtPath
!=
url
)
{
uni
.
redirectTo
({
url
:
url
,
});
if
(
this
.
currentPath
!==
url
)
{
uni
.
redirectTo
({
url
})
}
else
{
uni
.
reLaunch
({
url
:
url
,
});
}
},
},
};
</
script
>
<!-- <template>
<view class="bar-box">
<div class="bar-box-line">
<view class="bar-item" v-for="(x,i) in menus" @click="changeMenuHandler(x)">
<i class="icon iconfont" :class="[x.icon]" v-if="current != x.page"></i>
<view class="acitve" v-else>
{{x.name}}
</view>
</view>
</div>
</view>
</template>
<script>
export default {
data() {
return {
menus: [],
current: ''
};
},
mounted() {
let pages = getCurrentPages()
this.current = "/" + pages[pages.length - 1].route ? ? ''
this.menus = [{
name: '首页',
icon: 'icon-home',
page: '/pages/index/index'
},
{
name: '订单',
icon: 'icon-Work',
page: '/pages/jiuzhai/jz_MyOrder'
},
{
name: '我的',
icon: 'icon-my1',
page: '/pages/user-center/user-center'
}
]
},
methods: {
changeMenuHandler(menu) {
this.current = menu.page
if (menu.page.indexOf('pages') != -1) {
uni.redirectTo({
url: menu.page
url
})
}
}
}
}
}
</
script
>
-->
<
style
>
/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
@font-face
{
font-family
:
"nav-font"
;
src
:
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/tcIItWsk6dTo.woff2")
format
(
"woff2"
),
url("//at.alicdn.com/wf/webfont/MQHUV6e56ce5/RZzswoFvsjUs.woff")
format
(
"woff"
);
font-display
:
swap
;
}
.bar-box
{
padding-bottom
:
env
(
safe-area-inset-bottom
);
background-color
:
#FFF
;
border-top-left-radius
:
20
rpx
;
border-top-right-radius
:
20
rpx
;
box-shadow
:
0
0
6px
rgba
(
0
,
0
,
0
,
.12
);
<
style
>
.tabbarMain
{
position
:
fixed
;
z-index
:
50
;
flex
:
1
;
z-index
:
999
;
bottom
:
0
;
left
:
0
;
right
:
0
;
z-index
:
99999999
;
}
background
:
#fff
;
border-top
:
1
rpx
solid
#E0E0E0
;
padding
:
20
rpx
0
0
;
}
.bar-box-line
{
.tabBtnMina
{
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
nowrap
;
align-items
:
center
;
padding
:
20
upx
0
30
upx
;
}
.bar-box-line.uninset
{
padding
:
20
upx
0
40
upx
;
}
.bar-box-line.inset
{
padding
:
20
upx
0
;
}
}
.bar-box-line
.bar-item
{
.itmMain
{
flex
:
1
;
width
:
1p
x
;
text-align
:
center
;
color
:
#abadb9
;
position
:
relative
;
}
display
:
fle
x
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.bar-box-line
.bar-item
.icon
{
font-size
:
50
rpx
;
}
.imgse
{
width
:
48
rpx
;
height
:
48
rpx
;
}
.bar-box-line
.bar-item
.acitve
{
font-size
:
32
rpx
;
font-weight
:
bold
;
color
:
#1F2429
;
text-align
:
center
;
font-family
:
nav-font
;
}
.txtBtn
{
font-size
:
20
rpx
;
color
:
#666
;
margin-top
:
8
rpx
;
line-height
:
1
;
}
.bar-box-line
.bar-item
.acitve
::after
{
display
:
inline-block
;
content
:
' '
;
width
:
4px
;
height
:
4px
;
border-radius
:
4px
;
background-color
:
#1F2429
;
position
:
absolute
;
left
:
calc
(
50%
-
2px
);
top
:
60
rpx
;
}
.txtBtnSel
{
color
:
#333
;
font-size
:
24
rpx
;
}
</
style
>
\ No newline at end of file
pages/index/index.vue
View file @
eba58ed8
<
template
>
<
view
class=
"indexpage
"
>
<
scroll-view
scroll-y=
"true"
style=
"height: 100vh;"
@
scroll=
"handleScroll
"
>
<view
v-if=
"showStart == true"
style=
"width: 100vw; height: 100vh"
>
<image
:src=
"startData.PicUrl"
mode=
"aspectFit"
style=
"width: 100%; height: 100%; position: relative"
>
<view
class=
"Startbtn"
:style=
"
{ top: pagePaddingBottom }" @click="startb">
...
...
@@ -7,29 +7,26 @@
</view>
</image>
</view>
<view
v-if=
"myPageData.home_pages"
v-show=
"showStart == false"
:style=
"[myPageData.home_pages.navs[active].templateBg]"
>
<view
v-if=
"myPageData.home_pages"
class=
"safe-top"
v-show=
"showStart == false"
:style=
"[myPageData.home_pages.navs[active].templateBg]"
>
<view
class=
"content"
:style=
"
{
'padding-bottom':(pageId==0?'
78px
':'0px'),
'padding-bottom':(pageId==0?'
calc(57px + env(safe-area-inset-bottom))
':'0px'),
}">
<!-- paddingTop: pagePaddingBottom, --
>
<view
v-if=
"pageId!=0"
class=
"index-title"
:class=
"
{ MainTopLeft: pageTitleStr.length > 10 }" :style="[
<view
:style=
"
{opacity:`${pageId!=0?100:scrollTop}%`}"
>
<view
class=
"index-title"
:class=
"
{ MainTopLeft: pageTitleStr.length > 10 }" :style="[
myPageData.home_pages.navs[active].templateBg,
titleStyle,
{
color: myPageData.home_pages.navs[active].templateBg
? myPageData.home_pages.navs[active].templateBg.titleColor
: '',
},
]">
}]">
<text
v-if=
"isNavPosition == 0"
>
{{
pageTitleStr
}}
</text>
<view
v-if=
"isNavPosition == 1"
style=
"width: 78%"
>
<search
:style-str=
"searchData"
></search>
<view
v-if=
"pageId!=0"
class=
"back-arrow row items-center"
@
click=
"goback"
>
<u-icon
name=
"home_1"
custom-prefix=
"tffont"
color=
"#111"
size=
"38"
style=
"font-weight: bolder;"
></u-icon>
</view>
<view
class=
"back-arrow"
v-if=
"showBack"
@
click=
"goback"
>
<u-icon
name=
"arrow-left"
size=
"44"
></u-icon>
</view>
</view>
<!--
<view
@
click=
'yj'
style=
"width: 200px;height: 50px;"
>
活动
</view>
-->
<u-tabs
v-if=
"myPageData.home_pages && myPageData.home_pages.navs.length > 1"
name=
"name"
:list=
"myPageData.home_pages.navs"
:is-scroll=
"true"
:active-color=
"mainColor"
:current=
"active"
:bar-width=
"80"
:font-size=
"32"
:bold=
"false"
@
change=
"changeHandler"
></u-tabs>
...
...
@@ -48,40 +45,11 @@
<copyright
v-if=
"d.id == 'copyright'"
:cop=
"d.data"
:key=
"di"
></copyright>
<checkin
v-if=
"d.id == 'check-in'"
:check=
"d.data"
:key=
"di"
></checkin>
<userbox
v-if=
"d.id == 'user-info'"
:ts=
"d.data"
:key=
"di"
></userbox>
<view
v-if=
"d.id == 'image-text'"
class=
"imageText"
:key=
"di"
>
<view
v-html=
"d.data.content"
></view>
</view>
<userorder
v-if=
"d.id == 'user-order'"
:uo=
"d.data"
:key=
"di"
></userorder>
<mapi
v-if=
"d.id == 'map'"
:mapi=
"d.data"
:key=
"di"
></mapi>
<checkform
v-if=
"d.id == 'form'"
:forms=
"d.data"
:key=
"di"
></checkform>
<addialog
v-if=
"d.id == 'modal' && d.data.opened"
:ads=
"d.data"
:key=
"di"
></addialog>
<quicknav
v-if=
"d.id == 'quick-nav' && d.data.navSwitch == 1"
:navs=
"d.data"
:key=
"di"
></quicknav>
<!--
<pingtuan
v-if=
"d.id == 'pintuan'"
:goods=
"d.data"
:key=
"di"
></pingtuan>
-->
<shopinfo
v-if=
"d.id == 'shop-info'"
:ad=
"d.data"
:key=
"di"
ref=
"son"
></shopinfo>
<guide
v-if=
"d.id == 'drive-guide'"
:info=
"d.data"
ref=
"city"
></guide>
<!-- 网课列表 -->
<rgoods
v-if=
"d.id == 'educationCustom'"
:goods=
"d.data"
></rgoods>
<!-- 资讯 -->
<argoods
v-if=
"d.id == 'educationArticle'"
:goods=
"d.data"
></argoods>
<!-- 最近学习组件 -->
<rstudy
v-if=
"d.id == 'education'"
:goods=
"d.data"
ref=
"study"
></rstudy>
<store
v-if=
"d.id == 'reservestore'"
:goods=
"d.data"
:storeinfo=
"storeInfo"
></store>
<!-- 线下服务商品 -->
<sindex
v-if=
"d.id == 'storeGoods'"
:goods=
"d.data"
:key=
"di"
></sindex>
<!-- 老师列表 -->
<educationteacher
v-if=
"d.id == 'educationteacher'"
:goods=
"d.data"
:key=
"di"
></educationteacher>
<!--导航栏-->
<navpage
v-if=
"d.id == 'nav-page'"
:navs=
"d.data"
:key=
"di"
></navpage>
<!-- 相亲的人物模板 -->
<!--
<matchmaking
v-if=
"d.id == 'miaiuser'"
:navs=
"d.data"
:key=
"di"
></matchmaking>
-->
<!-- 相亲活动 -->
<miaiactivitytype
v-if=
"d.id == 'miaiactivitytype'"
:goods=
"d.data"
></miaiactivitytype>
<!-- 相亲活动自定义 -->
<miaiactivityCustom
v-if=
"d.id == 'miaiactivityCustom'"
:goods=
"d.data"
></miaiactivityCustom>
</
template
>
</view>
</template>
...
...
@@ -89,30 +57,14 @@
<tabbar></tabbar>
</view>
<view
class=
"tips_t"
v-if=
"
add_show == 1 &&
JSON.stringify(setting) != '{}' &&
setting.add_app_text != null
"
:style=
"{
'border-radius': setting.add_app_bg_radius + 'rpx',
opacity: setting.add_app_bg_transparency / 100,
top: pagePaddingBottom,
}"
>
<u-icon
name=
"cross"
color=
"#fff"
@
click=
"close"
></u-icon>
<view
style=
"width: 1px; height: 20px; margin: 0 10px; background: #fff"
></view>
<Text
style=
"color: #fff"
>
{{ setting.add_app_text }}
</Text>
<view
class=
"triangle-up"
:style=
"{ top: pagePaddingBottom }"
></view>
</view>
<coupon
v-if=
"showCoupons"
:coupon-message=
"couponMessage"
:cform=
"ComeFrom"
@
goLook=
"goLook"
@
closeBtn=
"closeBtn"
></coupon>
<
template
v-if=
"setting&&setting.is_show_auth&& setting.is_show_auth==1"
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</
template
>
<!-- <official-account></official-account> -->
<orderPopup
v-if=
"showorder"
:orderPopupdata=
"orderPopupdata"
@
gosalesvolume=
"gosalesvolume"
@
closeBtn=
"closeBtn_order"
></orderPopup>
</view>
<official-account></official-account>
</view>
</view>
</scroll-view>
</template>
<
script
>
...
...
@@ -130,72 +82,36 @@
import
checkin
from
"@/components/checkin/index"
;
import
userbox
from
"@/components/userbox/index"
;
import
userorder
from
"@/components/userorder/index"
;
import
mapi
from
"@/components/mapi/index"
;
import
checkform
from
"@/components/checkform/index"
;
import
addialog
from
"@/components/addialog/index"
;
import
quicknav
from
"@/components/quicknav/index"
;
import
coupon
from
"@/components/coupons/coupons"
;
import
shopinfo
from
"@/components/shopinfo/shopinfo"
;
import
auth
from
"@/components/auth/index.vue"
;
import
guide
from
"@/components/guidecar/index.vue"
;
import
rstudy
from
"@/components/study/Rstudy.vue"
;
import
rgoods
from
"@/components/study/index.vue"
;
import
argoods
from
"@/components/studyArticle/index.vue"
;
import
store
from
"@/components/store/store.vue"
;
import
sindex
from
"@/components/store/index.vue"
;
import
educationteacher
from
"@/components/educationteacher/index"
;
import
navpage
from
"@/components/navpage/index"
;
import
miaiactivitytype
from
"@/components/miaiactivitytype/index"
;
import
miaiactivityCustom
from
"@/components/miaiactivityCustom/index"
;
import
orderPopup
from
"@/components/coupons/orderPopup.vue"
;
//离线订单弹窗
const
innerAudioContext
=
uni
.
createInnerAudioContext
();
export
default
{
data
()
{
return
{
title
:
"Hello"
,
myPageData
:
{},
indexPageData
:
{},
mainColor
:
""
,
active
:
0
,
contentHeight
:
0
,
pageId
:
0
,
setting
:
{},
add_show
:
1
,
showtabs
:
true
,
showCoupons
:
false
,
couponMessage
:
""
,
pageTitleStr
:
""
,
titleStyle
:
""
,
pagePaddingBottom
:
"0px"
,
showBack
:
false
,
showAuth
:
false
,
U
:
{},
shopData
:
{},
JumpType
:
0
,
GoodsId
:
29
,
guidecar
:
{},
searchData
:
{},
//传递给search data
isNavPosition
:
0
,
//设置搜索框位置
IsOpenSchool
:
0
,
OrderId
:
0
,
storePosition
:
""
,
//线下服务获取经纬度
storeInfo
:
{},
fxstoreId
:
0
,
//分享过来的门店id
showStart
:
false
,
//是否显示启动页
u
:
{},
showStart
:
false
,
startData
:
{},
ComeFrom
:
""
,
cardsmoney
:
0
,
//储值卡带过来的金额
orderPopupdata
:
{},
//离线收益的弹窗
showorder
:
false
,
//显示弹出
carMsg
:
""
,
//景点专车分享带过来的字段
id
:
0
,
//酒店带过来字段
dayObj
:
""
,
//酒店带过来字段
searchObj
:
""
,
//酒店带过来字段
tcid
:
0
,
//线路带过来字段
configId
:
0
,
//线路带过来字段
cityId
:
0
,
//线路带来字段
videoId
:
0
,
//视频字段
b2bUser
:
{},
//同行信息
safeTop
:
0
,
isNavPosition
:
0
,
scrollTop
:
0
};
},
components
:
{
...
...
@@ -213,36 +129,15 @@
checkin
,
userbox
,
userorder
,
mapi
,
checkform
,
addialog
,
quicknav
,
coupon
,
shopinfo
,
auth
,
guide
,
rstudy
,
rgoods
,
argoods
,
store
,
sindex
,
educationteacher
,
navpage
,
miaiactivitytype
,
miaiactivityCustom
,
orderPopup
,
auth
},
onLoad
(
options
)
{
let
that
=
this
;
uni
.
getSystemInfo
({
success
(
res
)
{
that
.
titleStyle
=
{
height
:
"45px"
,
paddingTop
:
`
${
res
.
statusBarHeight
}
px`
,
};
that
.
pagePaddingBottom
=
45
+
res
.
statusBarHeight
+
"px"
;
},
});
let
c
=
this
.
$uiConfig
.
is_bang
?
78
:
50
;
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
c
);
if
(
options
&&
options
.
page_id
)
{
...
...
@@ -255,311 +150,56 @@
queryString
=
"/pages/index/index?"
+
queryString
.
substring
(
1
,
queryString
.
length
);
}
let
p
=
0
;
if
(
uni
.
getStorageSync
(
"navs"
))
{
uni
.
getStorageSync
(
"navs"
).
forEach
((
x
)
=>
{
if
(
x
.
url
==
queryString
)
{
p
=
1
;
}
});
}
if
(
p
==
0
)
{
this
.
showtabs
=
false
;
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
();
}
}
let
mall_UserInfo
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
//同行联系人绑定的优惠卷
if
(
uni
.
getStorageSync
(
'coupons'
))
{
this
.
showCoupons
=
true
;
this
.
couponMessage
=
uni
.
getStorageSync
(
'coupons'
);
}
if
(
options
&&
options
.
Up
)
{
//校园id
uni
.
setStorageSync
(
"Up"
,
{
Up
:
options
.
Up
,
});
this
.
IsOpenSchool
=
options
.
Up
==
2
?
1
:
0
;
//分享进来是否是校园模式
}
if
(
options
&&
options
.
custom_params
)
{
let
custom_params
=
JSON
.
parse
(
decodeURIComponent
(
options
.
custom_params
));
if
(
custom_params
.
user_id
)
{
uni
.
setStorageSync
(
"pid"
,
{
pid
:
custom_params
.
user_id
,
});
}
if
(
custom_params
.
Up
)
{
//校园id
uni
.
setStorageSync
(
"Up"
,
{
Up
:
custom_params
.
Up
,
});
this
.
IsOpenSchool
=
custom_params
.
Up
==
2
?
1
:
0
;
//分享进来是否是校园模式
}
}
if
(
mall_UserInfo
&&
mall_UserInfo
.
UserPageType
)
{
//进入页面时 判断登录缓存里是否是校园模式
this
.
IsOpenSchool
=
mall_UserInfo
.
UserPageType
==
2
?
1
:
0
;
}
if
(
options
&&
options
.
user_id
)
{
uni
.
setStorageSync
(
"pid"
,
{
pid
:
options
.
user_id
,
});
}
if
(
options
&&
options
.
SmallShopId
)
{
uni
.
setStorageSync
(
"SmallShopId"
,
{
SmallShopId
:
options
.
SmallShopId
,
});
}
//从其他小程序跳转过来
if
(
options
&&
options
.
CounponPassword
)
{
//小程序的来自
uni
.
setStorageSync
(
"CounponPassword"
,
{
CounponPassword
:
options
.
CounponPassword
,
});
}
if
(
options
&&
options
.
KeyWord
)
{
//口令
uni
.
setStorageSync
(
"KeyWord"
,
{
KeyWord
:
options
.
KeyWord
,
});
}
if
(
options
&&
options
.
ComeFrom
)
{
//跳过来的文字描述
this
.
ComeFrom
=
options
.
ComeFrom
;
uni
.
setStorageSync
(
"ComeFrom"
,
{
ComeFrom
:
options
.
ComeFrom
,
});
}
if
(
options
&&
options
.
scene
)
{
//兼容之前小程序的调转
this
.
getjump
(
options
.
scene
);
}
if
(
options
&&
options
.
storeId
)
{
this
.
fxstoreId
=
options
.
storeId
;
}
if
(
options
&&
options
.
carMsg
)
{
this
.
carMsg
=
options
.
carMsg
;
}
// #ifdef MP-WEIXIN
wx
.
showShareMenu
({
withShareTicket
:
true
,
menus
:
[
"shareAppMessage"
,
"shareTimeline"
],
});
if
(
options
&&
options
.
JumpType
)
{
//跳转类型 1为详情2为直播列表3为司导
this
.
JumpType
=
options
.
JumpType
;
if
(
options
.
JumpType
==
3
)
{
this
.
guidecar
.
GoodsId
=
options
.
GoodsId
;
this
.
guidecar
.
address
=
options
.
address
?
JSON
.
parse
(
decodeURIComponent
(
options
.
address
))
:
""
;
this
.
guidecar
.
Pickcar
=
options
.
Pickcar
?
JSON
.
parse
(
decodeURIComponent
(
options
.
Pickcar
))
:
""
;
this
.
guidecar
.
StartTime
=
options
.
StartTime
?
options
.
StartTime
:
""
;
this
.
guidecar
.
EndTime
=
options
.
EndTime
?
options
.
EndTime
:
""
;
}
}
if
(
options
&&
options
.
J
)
{
//司导分享的的特殊处理
this
.
JumpType
=
options
.
J
;
if
(
options
.
J
==
3
)
{
this
.
guidecar
.
GoodsId
=
options
.
i
;
this
.
guidecar
.
address
=
options
.
address
?
JSON
.
parse
(
decodeURIComponent
(
options
.
address
))
:
""
;
this
.
guidecar
.
Pickcar
=
options
.
P
?
JSON
.
parse
(
decodeURIComponent
(
options
.
P
))
:
""
;
this
.
guidecar
.
StartTime
=
options
.
S
?
options
.
S
:
""
;
this
.
guidecar
.
EndTime
=
options
.
E
?
options
.
E
:
""
;
}
if
(
options
&&
options
.
u
)
{
uni
.
setStorageSync
(
"pid"
,
{
pid
:
options
.
u
,
});
}
if
(
options
&&
options
.
m
)
{
uni
.
setStorageSync
(
"SmallShopId"
,
{
SmallShopId
:
options
.
m
,
});
}
}
if
(
options
&&
options
.
id
)
{
//商品详情
this
.
GoodsId
=
options
.
id
;
}
else
{
this
.
GoodsId
=
options
.
GoodsId
?
options
.
GoodsId
:
29
;
}
if
(
options
&&
options
.
money
)
{
//储值卡
this
.
cardsmoney
=
options
.
money
;
}
if
(
options
&&
options
.
dayObj
)
{
this
.
dayObj
=
options
.
dayObj
;
}
if
(
options
&&
options
.
searchObj
)
{
this
.
searchObj
=
options
.
searchObj
;
}
if
(
options
&&
options
.
OrderId
)
{
//代付订单id
this
.
OrderId
=
options
.
OrderId
;
}
if
(
options
&&
options
.
tcid
)
{
this
.
tcid
=
options
.
tcid
;
}
if
(
options
&&
options
.
configId
)
{
this
.
configId
=
options
.
configId
;
}
if
(
options
&&
options
.
cityId
)
{
this
.
cityId
=
options
.
cityId
;
}
let
set
=
uni
.
getStorageSync
(
"basedata"
)
?
uni
.
getStorageSync
(
"basedata"
).
mall
.
setting
:
{};
this
.
setting
=
set
;
that
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
that
.
b2bUser
=
uni
.
getStorageSync
(
"b2b_user"
);
if
(
that
.
b2bUser
&&
that
.
b2bUser
.
salesBaseInfo
==
''
){
uni
.
removeStorageSync
(
'b2b_user'
)
that
.
b2bUser
=
null
}
console
.
log
(
"onLoad_setting"
,
this
.
setting
);
console
.
log
(
"onLoad_b2bUser"
,
this
.
b2bUser
);
if
(
!
that
.
u
)
{
that
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
,
};
that
.
showAuth
=
true
;
}
else
if
(
!
that
.
b2bUser
&&
this
.
setting
&&
this
.
setting
.
is_show_auth
&&
this
.
setting
.
is_show_auth
==
1
)
{
that
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
,
};
that
.
showAuth
=
true
;
}
else
{
that
.
sharejump
();
//4-9新加
}
// #endif
if
(
!
uni
.
getStorageSync
(
"add_top_app"
))
{
uni
.
setStorageSync
(
"add_top_app"
,
{
add_top_app_show
:
1
,
});
}
this
.
add_show
=
uni
.
getStorageSync
(
"add_top_app"
)
?
uni
.
getStorageSync
(
"add_top_app"
).
add_top_app_show
:
1
;
this
.
isShowBack
();
let
now
=
new
Date
();
let
nowtime
=
now
.
getFullYear
()
+
"-"
+
(
now
.
getMonth
()
+
1
)
+
"-"
+
now
.
getDate
();
if
(
!
uni
.
getStorageSync
(
"Startup_page"
))
{
//获取启动页信息1、没有记录日期
this
.
getstartModel
(
nowtime
);
}
else
{
//记录日期和当天相差1天调取
let
dayc
=
this
.
DateDiff
(
uni
.
getStorageSync
(
"Startup_page"
).
time
,
nowtime
);
if
(
dayc
>=
1
)
{
this
.
getstartModel
(
nowtime
);
}
}
const
mu
=
uni
.
getStorageSync
(
'mall_UserInfo'
)
const
bu
=
uni
.
getStorageSync
(
'b2b_user'
)
if
(
!
mu
||
!
bu
)
this
.
showAuth
=
true
this
.
init
()
uni
.
showNavigationBarLoading
();
},
created
()
{
if
(
uni
.
getStorageSync
(
"lastLogin"
)){
const
tempHour
=
(
new
Date
().
getTime
()
-
uni
.
getStorageSync
(
"lastLogin"
))
/
1000
/
60
/
60
if
(
tempHour
>
70
){
uni
.
removeStorageSync
(
'b2b_user'
)
uni
.
removeStorageSync
(
'mall_UserInfo'
)
}
}
else
{
uni
.
removeStorageSync
(
'b2b_user'
)
uni
.
removeStorageSync
(
'mall_UserInfo'
)
mounted
()
{
const
that
=
this
uni
.
getSystemInfo
({
success
(
res
)
{
that
.
titleStyle
=
{
height
:
"45px"
,
paddingTop
:
`
${
res
.
statusBarHeight
}
px`
,
};
that
.
safeTop
=
res
.
statusBarHeight
}
});
},
// #ifdef MP-WEIXIN
onShareTimeline
()
{
setTimeout
(()
=>
{
this
.
getReceive
();
},
2500
);
let
uid
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserId
:
0
;
if
(
uid
==
0
)
{
uid
=
uni
.
getStorageSync
(
"pid"
)
?
uni
.
getStorageSync
(
"pid"
).
pid
:
0
;
}
let
SmallShopId
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
SmallShopId
:
0
;
if
(
SmallShopId
==
0
)
{
//如果微店id为0 去找所属微店id
SmallShopId
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserSmallShopId
:
0
;
}
let
title
=
this
.
setting
.
share_title
?
this
.
setting
.
share_title
:
uni
.
getStorageSync
(
"basedata"
).
mall
.
name
;
let
Up
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserPageType
:
0
;
return
{
title
:
title
,
query
:
"user_id="
+
uid
+
"&SmallShopId="
+
SmallShopId
+
"&Up="
+
Up
,
query
:
"user_id="
+
uid
,
imageUrl
:
""
,
};
},
onShareAppMessage
(
res
)
{
setTimeout
(()
=>
{
this
.
getReceive
();
},
2500
);
let
uid
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserId
:
0
;
if
(
uid
==
0
)
{
uid
=
uni
.
getStorageSync
(
"pid"
)
?
uni
.
getStorageSync
(
"pid"
).
pid
:
0
;
}
let
SmallShopId
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
SmallShopId
:
0
;
if
(
SmallShopId
==
0
)
{
//如果微店id为0 去找所属微店id
SmallShopId
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserSmallShopId
:
0
;
}
let
title
=
this
.
setting
.
share_title
?
this
.
setting
.
share_title
:
uni
.
getStorageSync
(
"basedata"
).
mall
.
name
;
let
Up
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserPageType
:
0
;
return
{
title
:
title
,
path
:
"/pages/index/index?user_id="
+
uid
+
"&SmallShopId="
+
SmallShopId
+
"&Up="
+
Up
,
path
:
"/pages/index/index?user_id="
+
uid
,
imageUrl
:
""
,
};
},
...
...
@@ -569,93 +209,18 @@
uni
.
hideNavigationBarLoading
();
},
500
);
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
getIsOpenReserve
();
this
.
$utils
.
VersionUpdate
()
},
methods
:
{
//获取IsOpenReserve
getIsOpenReserve
()
{
this
.
request2
({
url
:
"/api/Mall/GetAppConfig"
,
data
:
{},
},
(
res
)
=>
{
uni
.
setStorageSync
(
"GetAppConfig"
,
res
.
data
);
//方便在分类判断
if
(
res
.
resultCode
==
1
)
{
if
(
res
.
data
.
IsOpenReserve
==
1
)
{
this
.
getstore
();
}
else
{
this
.
init
();
}
}
else
{
this
.
init
();
}
}
);
},
DateDiff
(
sDate1
,
sDate2
)
{
var
aDate
,
oDate1
,
oDate2
,
iDays
;
aDate
=
sDate1
.
split
(
"-"
);
oDate1
=
new
Date
(
aDate
[
1
]
+
"-"
+
aDate
[
2
]
+
"-"
+
aDate
[
0
]);
//转换为9-25-2017格式
aDate
=
sDate2
.
split
(
"-"
);
oDate2
=
new
Date
(
aDate
[
1
]
+
"-"
+
aDate
[
2
]
+
"-"
+
aDate
[
0
]);
iDays
=
parseInt
(
Math
.
abs
(
oDate1
-
oDate2
)
/
1000
/
60
/
60
/
24
);
//把相差的毫秒数转换为天数
return
iDays
;
},
getstartModel
(
time
)
{
this
.
request2
({
url
:
"/api/AppletSchool/GetEducationStartUpModel"
,
data
:
{},
},
(
res
)
=>
{
uni
.
setStorageSync
(
"Startup_page"
,
{
time
:
time
});
//方便在分类判断
if
(
res
.
resultCode
==
1
)
{
if
(
res
.
data
.
IsShow
==
1
)
{
this
.
showStart
=
true
;
this
.
startData
=
res
.
data
;
innerAudioContext
.
src
=
res
.
data
.
MusicUrl
;
innerAudioContext
.
play
();
setTimeout
(()
=>
{
this
.
showStart
=
false
;
if
(
innerAudioContext
!=
undefined
)
{
//判断下不是无法暂停
innerAudioContext
.
stop
();
}
},
res
.
data
.
Seconds
*
1000
);
}
}
else
{}
}
);
},
startb
()
{
//跳过启动页
this
.
showStart
=
false
;
if
(
innerAudioContext
!=
undefined
)
{
//判断下不是无法暂停
innerAudioContext
.
stop
();
}
},
getphonenumber
(
e
)
{
uni
.
checkSession
({
//检查登录状态是否过期
success
:
(
x
)
=>
{
if
(
x
.
errMsg
==
"checkSession:ok"
)
{
//没有过期
console
.
log
(
"没过期"
);
}
},
fail
:
(
err
)
=>
{
//检测失败重新登录
console
.
log
(
err
);
},
});
},
getunilogin
(
res
)
{
let
that
=
this
;
//静默登录操作
uni
.
login
({
provider
:
"weixin"
,
success
:
(
info
)
=>
{
...
...
@@ -665,26 +230,11 @@
code
:
info
.
code
,
};
that
.
getCode
(
obj
);
},
fail
:
()
=>
{
uni
.
showToast
({
title
:
"微信登录授权失败"
,
icon
:
"none"
,
});
if
(
!
that
.
u
)
{
that
.
u
=
{
nickName
:
"未登录h"
,
avatarUrl
:
""
,
};
that
.
showAuth
=
true
;
}
},
});
},
//调用获取code
getCode
(
obj
)
{
var
that
=
this
;
//这里请求接口
that
.
request2
({
url
:
"/api/mall/GetWeChatOpenId"
,
data
:
{
...
...
@@ -701,18 +251,6 @@
},
getLogin
(
obj
)
{
var
that
=
this
;
let
pid
=
uni
.
getStorageSync
(
"pid"
)
?
uni
.
getStorageSync
(
"pid"
).
pid
:
0
;
let
Up
=
uni
.
getStorageSync
(
"Up"
)
?
uni
.
getStorageSync
(
"Up"
).
Up
:
0
;
let
SmallShopId
=
uni
.
getStorageSync
(
"SmallShopId"
)
?
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
let
CounponPassword
=
uni
.
getStorageSync
(
"CounponPassword"
)
?
uni
.
getStorageSync
(
"CounponPassword"
).
CounponPassword
:
0
;
let
KeyWord
=
uni
.
getStorageSync
(
"KeyWord"
)
?
uni
.
getStorageSync
(
"KeyWord"
).
KeyWord
:
""
;
that
.
request2
({
url
:
"/api/AppletLogin/Login"
,
data
:
{
...
...
@@ -721,642 +259,107 @@
Name
:
obj
.
Name
,
Photo
:
obj
.
Photo
,
Moblie
:
""
,
SuperiorId
:
pid
,
SmallShopId
:
SmallShopId
,
UserPageType
:
Up
,
CounponPassword
:
CounponPassword
,
KeyWord
:
KeyWord
,
},
},
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
uni
.
setStorageSync
(
"mall_UserInfo"
,
res
.
data
);
if
(
res
.
couponResultCode
==
1
)
{
that
.
showCoupons
=
true
;
that
.
couponMessage
=
res
.
couponMessage
;
}
that
.
u
=
res
.
data
;
uni
.
removeStorageSync
(
"pid"
);
uni
.
removeStorageSync
(
"SmallShopId"
);
uni
.
removeStorageSync
(
"Up"
);
uni
.
removeStorageSync
(
"CounponPassword"
);
uni
.
removeStorageSync
(
"KeyWord"
);
that
.
getPageType
();
if
(
res
.
data
.
IsOpenSchool
==
1
)
{
//校园开启
that
.
init
();
}
// 如果登录的情况下直接跳转商品详情或者直播列表
that
.
sharejump
();
}
else
{
if
(
!
that
.
u
)
{
that
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
,
};
that
.
showAuth
=
true
;
}
}
}
);
},
getorderPupop
()
{
let
now
=
new
Date
();
let
Month
=
now
.
getMonth
()
+
1
<
10
?
"0"
+
(
now
.
getMonth
()
+
1
)
:
now
.
getMonth
()
+
1
;
let
day
=
now
.
getDate
()
<
10
?
"0"
+
now
.
getDate
()
:
now
.
getDate
();
let
nowtime
=
now
.
getFullYear
()
+
"-"
+
Month
+
"-"
+
day
+
" "
+
now
.
getHours
()
+
":"
+
now
.
getMinutes
()
+
":"
+
now
.
getSeconds
();
if
(
uni
.
getStorageSync
(
"order_old_time"
))
{
let
oldtime
=
uni
.
getStorageSync
(
"order_old_time"
).
time
;
if
(
new
Date
(
nowtime
).
getTime
()
!=
new
Date
(
oldtime
).
getTime
())
{
this
.
getUserOffline
(
nowtime
,
oldtime
);
}
}
uni
.
setStorageSync
(
"order_old_time"
,
{
time
:
nowtime
});
//吧当前时间存起来
},
getUserOffline
(
now
,
old
)
{
this
.
request2
({
url
:
"/api/AppletUser/GetUserOfflineEarningsInfo"
,
data
:
{
StartTime
:
old
,
EndTime
:
now
,
},
},
(
res
)
=>
{
this
.
orderPopupdata
=
res
.
data
;
if
(
this
.
orderPopupdata
.
State
==
1
)
{
if
(
this
.
orderPopupdata
.
OrderNum
>
0
)
{
this
.
showorder
=
true
;
}
}
}
);
},
closeBtn_order
()
{
this
.
showorder
=
false
;
},
gosalesvolume
()
{
this
.
showorder
=
false
;
setTimeout
(()
=>
{
let
UserId
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserId
:
0
;
uni
.
navigateTo
({
url
:
"/pages/share-order/share-order"
,
});
},
10
);
},
sharejump
()
{
//分享的总跳转
let
that
=
this
;
setTimeout
(()
=>
{
if
(
that
.
JumpType
==
1
)
{
//商品详情
uni
.
navigateTo
({
url
:
"/pages/goods/goods?GoodsId="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
2
)
{
//直播列表
uni
.
navigateTo
({
url
:
"/pages/live/index"
,
});
}
else
if
(
that
.
JumpType
==
3
)
{
//司导详情
that
.
goguidecar
();
}
else
if
(
that
.
JumpType
==
4
)
{
//代付页面
uni
.
navigateTo
({
url
:
"/pages/order/payment-order?GoodsId="
+
that
.
OrderId
,
});
}
else
if
(
that
.
JumpType
==
5
)
{
//课程详情
uni
.
navigateTo
({
url
:
"/pages/school/courseInfo?GoodsId="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
6
)
{
//课程代付页面
uni
.
navigateTo
({
url
:
"/pages/school/personal/payment-order?OrderId="
+
that
.
OrderId
,
});
}
else
if
(
that
.
JumpType
==
7
)
{
//线下服务门店详情
uni
.
navigateTo
({
url
:
"/pages/reserve/storeDetails?id="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
8
)
{
//服务人员详情
uni
.
navigateTo
({
url
:
"/pages/reserve/designerDetail?ID="
+
that
.
GoodsId
+
"&storeId="
+
that
.
fxstoreId
,
});
}
else
if
(
that
.
JumpType
==
9
)
{
//线下服务商品
try
{
uni
.
setStorageSync
(
"storeId"
,
{
storeId
:
that
.
fxstoreId
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
uni
.
navigateTo
({
url
:
"/pages/reserve/goodsDetails?GoodsId="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
10
)
{
//拼拼push活动详情
uni
.
navigateTo
({
url
:
"/pages/blindDate/postDetails?Id="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
11
)
{
//用户详情
uni
.
navigateTo
({
url
:
"/pages/blindDate/persondetails?UserId="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
12
)
{
//储值卡的领取
uni
.
navigateTo
({
url
:
"/pages/coupon/cards/cardsreceive?Id="
+
that
.
GoodsId
+
"&cardsmoney="
+
that
.
cardsmoney
,
});
}
else
if
(
that
.
JumpType
==
13
)
{
//用户资料
uni
.
navigateTo
({
url
:
"/pages/blindDate/persondetails?UserId="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
14
)
{
//用户资料填写
uni
.
navigateTo
({
url
:
"/pages/blindDate/editData"
});
}
else
if
(
that
.
JumpType
==
15
)
{
//门票详情
uni
.
navigateTo
({
url
:
"/pages/ticketCoupons/detail?id="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
16
)
{
//餐食详情
uni
.
navigateTo
({
url
:
"/pages/restaurant/detail?id="
+
that
.
GoodsId
,
});
}
else
if
(
that
.
JumpType
==
17
)
{
//景点专车
uni
.
navigateTo
({
url
:
"/pages/guidecar/bookaCarList?carMsg="
+
that
.
carMsg
,
});
}
else
if
(
that
.
JumpType
==
18
)
{
//酒店详情
uni
.
navigateTo
({
url
:
"/pages/hotel/detail?id="
+
that
.
GoodsId
+
"&dayObj="
+
that
.
dayObj
+
"&searchObj="
+
that
.
searchObj
,
});
}
else
if
(
that
.
JumpType
==
19
)
{
//线路详情
uni
.
navigateTo
({
url
:
"/pages/jiuzhai/jz_LineDetail?tcid="
+
that
.
tcid
+
"&configId="
+
that
.
configId
+
"&cityId="
+
that
.
cityId
,
});
}
},
500
);
},
updateuserinfo
(
msg
)
{
this
.
request2
({
url
:
"/api/MemberUser/SetMemberPhoto"
,
data
:
msg
,
},
(
res
)
=>
{
//静默处理不做任何提示
},
(
error
)
=>
{}
);
},
goback
()
{
uni
.
navigateBack
({
delta
:
1
,
});
},
isShowBack
()
{
let
navs
=
uni
.
getStorageSync
(
"navs"
)
?
uni
.
getStorageSync
(
"navs"
)
:
[];
if
(
navs
)
{
let
t
=
getCurrentPages
();
let
query
=
t
[
t
.
length
-
1
].
__displayReporter
.
query
;
let
queryString
=
""
;
for
(
var
k
in
query
)
{
queryString
+=
`&
${
k
}
=
${
query
[
k
]}
`
;
}
if
(
queryString
!=
""
)
{
queryString
=
"?"
+
queryString
.
substring
(
1
,
queryString
.
length
);
}
let
crtPath
=
"/"
+
t
[
t
.
length
-
1
].
route
+
queryString
;
let
isExsit
=
false
;
navs
.
forEach
((
x
,
i
)
=>
{
if
(
x
.
url
==
crtPath
)
{
isExsit
=
true
;
}
});
this
.
showBack
=
!
isExsit
;
}
},
getjump
(
scene
)
{
let
a
=
"YZnsGuRojCKBkb1siP3VwkhkPFvh-D"
;
//测试数据
this
.
request
({
url
:
""
,
data
:
{
r
:
"api/default/qr-code-parameter"
,
token
:
scene
,
},
},
(
res
)
=>
{
uni
.
setStorageSync
(
"pid"
,
{
pid
:
res
.
data
.
detail
.
user_id
?
res
.
data
.
detail
.
user_id
:
0
,
});
//存储上级的id
let
objurl
=
this
.
ObjectToUrl
(
res
.
data
.
detail
.
data
);
uni
.
navigateTo
({
url
:
"/"
+
res
.
data
.
detail
.
path
+
"?"
+
objurl
,
});
}
);
},
ObjectToUrl
(
e
,
t
)
{
var
n
=
""
;
for
(
var
i
in
e
)
n
+=
"&"
+
i
+
"="
+
(
t
?
encodeURIComponent
(
e
[
i
])
:
e
[
i
]);
return
n
.
substr
(
1
);
uni
.
redirectTo
({
url
:
'/pages/index/index'
})
},
init
()
{
let
mall_IsOpenSchool
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
IsOpenSchool
:
0
;
let
open_school
=
0
;
if
(
this
.
IsOpenSchool
==
1
&&
mall_IsOpenSchool
==
1
)
{
//this.IsOpenSchool 通过分享进来的 是否是校园 1 是0不是 mall_IsOpenSchool缓存获取校园模式开启没有
open_school
=
1
;
}
else
{
open_school
=
0
;
}
let
storeId
=
uni
.
getStorageSync
(
"storeId"
)
&&
uni
.
getStorageSync
(
"storeId"
).
storeId
?
uni
.
getStorageSync
(
"storeId"
).
storeId
:
0
;
this
.
request2
({
url
:
"/api/Mall/GetHome"
,
data
:
{
page_id
:
this
.
pageId
,
open_school
:
open_school
,
StoreId
:
storeId
,
},
},
(
res
)
=>
{
// this.$uiConfig.mainColor = res.data.mall.setting.mallStyle.main
// this.$uiConfig.secondary = res.data.mall.setting.mallStyle.secondary
if
(
res
.
data
.
mall
.
setting
.
mallStyle
.
pricecolor
)
{
this
.
$uiConfig
.
pricecolor
=
res
.
data
.
mall
.
setting
.
mallStyle
.
pricecolor
;
}
this
.
indexPageData
=
res
.
data
.
home_pages
.
navs
[
0
].
template
.
data
;
this
.
myPageData
=
res
.
data
;
if
(
res
.
data
.
navbar
.
navs
)
{
uni
.
setStorageSync
(
"navs"
,
res
.
data
.
navbar
.
navs
);
}
uni
.
setStorageSync
(
"basedata"
,
res
.
data
);
if
(
res
.
data
&&
res
.
data
.
mall
&&
res
.
data
.
mall
.
setting
)
{
this
.
setting
=
res
.
data
.
mall
.
setting
;
}
if
(
Object
.
keys
(
this
.
$refs
).
length
>
0
&&
this
.
$refs
.
study
)
{
//判断
this
.
$refs
.
study
[
0
].
getData
();
//调取最近学习组件的方法
}
if
(
this
.
myPageData
.
home_pages
.
navs
.
length
>
0
&&
this
.
myPageData
.
home_pages
.
navs
[
0
].
template
.
data
.
length
>
0
)
{
this
.
myPageData
.
home_pages
.
navs
[
0
].
template
.
data
.
forEach
((
x
)
=>
{
if
(
x
.
id
==
"search"
)
{
this
.
searchData
=
x
.
data
;
this
.
isNavPosition
=
x
.
data
.
searchPosition
;
if
(
this
.
isNavPosition
==
1
)
{
this
.
searchData
.
top
=
-
5
;
this
.
searchData
.
left
=
10
;
}
}
else
if
(
x
.
id
==
"shop-info"
)
{
this
.
getSmallShopById
();
}
else
if
(
x
.
id
==
"miaiuser"
)
{
//4-29新加 相亲模式随机的时候调用接口
if
(
x
.
data
.
addUserType
==
4
)
{
this
.
request2
({
url
:
"/api/AppletMiai/GetDailyRandomList"
,
data
:
{
pageIndex
:
1
,
pageSize
:
x
.
data
.
goodsLength
,
Sex
:
0
,
},
},
(
Daily
)
=>
{
if
(
Daily
.
resultCode
==
1
)
{
x
.
data
.
list
=
Daily
.
data
.
pageData
;
}
}
);
}
}
});
}
if
(
res
.
data
.
home_pages
.
title
!=
""
)
{
this
.
formatBg
();
if
(
this
.
pageId
==
0
)
{
uni
.
setNavigationBarTitle
({
title
:
res
.
data
.
home_pages
.
title
,
});
if
(
!
this
.
shopData
.
Name
||
this
.
shopData
.
Name
==
""
)
{
this
.
pageTitleStr
=
res
.
data
.
home_pages
.
title
;
}
}
else
{
uni
.
setNavigationBarTitle
({
title
:
res
.
data
.
home_pages
.
navs
[
0
].
name
,
});
if
(
!
this
.
shopData
.
Name
||
this
.
shopData
.
Name
==
""
)
{
this
.
pageTitleStr
=
res
.
data
.
home_pages
.
navs
[
0
].
name
;
}
}
// uni.setNavigationBarColor({
// //字体颜色
// frontColor: res.data.navbar.top_text_color,
// //背景颜色
// backgroundColor: res.data.navbar.top_background_color,
// });
this
.
titleStyle
.
color
=
res
.
data
.
navbar
.
top_text_color
;
this
.
titleStyle
.
backgroundColor
=
res
.
data
.
navbar
.
top_background_color
;
this
.
isShowBack
();
}
this
.
formatBg
();
if
(
this
.
u
&&
res
.
data
.
user_info
&&
res
.
data
.
user_info
.
openOfflineEarnings
==
1
)
{
//判断是否登录 是否开启 进行离线收益的弹出
this
.
getorderPupop
();
//4-9号新加
}
},
(
error
)
=>
{}
);
},
getstore
()
{
let
that
=
this
;
uni
.
getLocation
({
type
:
"wgs84"
,
success
:
function
(
res
)
{
let
position
=
res
.
latitude
+
","
+
res
.
longitude
;
uni
.
setStorageSync
(
"position"
,
{
position
:
position
,
});
that
.
getCurrentStore
();
},
fail
:
function
(
err
)
{
that
.
getCurrentStore
();
},
});
},
getCurrentStore
()
{
let
storeId
=
uni
.
getStorageSync
(
"storeId"
)
&&
uni
.
getStorageSync
(
"storeId"
).
storeId
?
uni
.
getStorageSync
(
"storeId"
).
storeId
:
0
;
let
position
=
uni
.
getStorageSync
(
"position"
)
&&
uni
.
getStorageSync
(
"position"
).
position
?
uni
.
getStorageSync
(
"position"
).
position
:
""
;
this
.
request2
({
url
:
"/api/AppletStores/GetCurrentStore"
,
data
:
{
storeId
:
storeId
,
position
:
position
,
},
},
(
res
)
=>
{
if
(
res
.
data
&&
res
.
data
.
storeInfo
)
{
this
.
storeInfo
=
res
.
data
.
storeInfo
;
uni
.
setStorageSync
(
"storeId"
,
{
storeId
:
res
.
data
.
storeInfo
.
storeId
,
});
if
(
res
.
data
.
storeInfo
.
storeId
&&
res
.
data
.
storeInfo
.
storeId
>
0
)
{
setTimeout
((
x
)
=>
{
this
.
init
();
},
1000
);
}
}
}
);
},
getSmallShopById
()
{
let
Id
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
SmallShopId
:
0
;
if
(
Id
==
0
)
{
Id
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserSmallShopId
:
0
;
}
this
.
request2
({
url
:
"/api/AppletUser/GetSmallShopById"
,
data
:
{
Id
:
Id
,
},
},
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
shopData
=
res
.
data
;
if
(
this
.
shopData
.
Name
&&
this
.
shopData
.
Name
!=
""
)
{
this
.
pageTitleStr
=
this
.
shopData
.
Name
;
}
}
}
);
},
close
()
{
this
.
add_show
=
2
;
uni
.
setStorageSync
(
"add_top_app"
,
{
add_top_app_show
:
2
,
});
},
changeHandler
(
i
)
{
this
.
active
=
i
;
},
formatBg
()
{
this
.
myPageData
.
home_pages
.
navs
.
forEach
((
y
)
=>
{
y
.
template
.
data
.
forEach
((
x
)
=>
{
if
(
x
.
id
==
"background"
)
{
let
t
=
""
;
y
.
templateBg
=
{};
if
(
x
.
data
.
showImg
)
{
y
.
templateBg
.
backgroundColor
=
x
.
data
.
backgroundColor
;
y
.
templateBg
.
backgroundImage
=
`url('
${
x
.
data
.
backgroundPicUrl
}
')`
;
y
.
templateBg
.
backgroundPosition
=
x
.
data
.
positionText
;
y
.
templateBg
.
backgroundRepeat
=
x
.
data
.
repeatText
?
x
.
data
.
repeatText
:
"no-repeat"
;
y
.
templateBg
.
backgroundSize
=
`
${
x
.
data
.
backgroundWidth
==
0
?
"auto"
:
x
.
data
.
backgroundWidth
+
"%"
}
${
x
.
data
.
backgroundHeight
==
0
?
"auto"
:
x
.
data
.
backgroundHeight
+
"%"
}
`
;
y
.
templateBg
.
backgroundRepeat
=
"no-repeat"
;
y
.
templateBg
.
backgroundSize
=
"auto auto"
;
}
else
{
y
.
templateBg
.
background
=
x
.
data
.
backgroundColor
;
y
.
templateBg
.
titleColor
=
"#000 !important"
;
}
if
(
this
.
myPageData
.
home_pages
.
navs
.
length
>
1
)
{
y
.
templateBg
.
overflowY
=
"auto"
;
y
.
templateBg
.
height
=
this
.
contentHeight
+
"px"
;
}
else
{
y
.
templateBg
.
overflowY
=
"auto"
;
y
.
templateBg
.
height
=
this
.
contentHeight
+
40
+
"px"
;
}
if
(
x
.
data
.
titleColor
)
{
y
.
templateBg
.
titleColor
=
x
.
data
.
titleColor
+
" !important"
;
}
y
.
templateBg
.
paddingTop
=
`
${
this
.
safeTop
}
px`
}
});
if
(
!
y
.
templateBg
)
{
y
.
templateBg
=
{
titleColor
:
"#000"
,
};
y
.
templateBg
=
{
titleColor
:
"#000"
};
}
});
},
getReceive
()
{
//分享进入调取领券接口
// 1-分享,2-购买并付款
this
.
request2
({
url
:
"/api/AppletUser/ShareCoupon"
,
data
:
{
TriggerType
:
1
,
},
},
(
res
)
=>
{
if
(
res
.
couponResultCode
==
1
)
{
this
.
couponMessage
=
res
.
couponMessage
;
this
.
showCoupons
=
true
;
}
}
);
},
goLook
()
{
this
.
showCoupons
=
false
;
},
closeBtn
()
{
this
.
showCoupons
=
false
;
changeHandler
(
i
)
{
this
.
active
=
i
;
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
this
.
$refs
.
son
)
{
this
.
$refs
.
son
[
0
].
getSmallShopById
(
2
);
//第一次登陆成功后去调取微店的信息
}
this
.
getPageType
();
//获取用户类型(校园)
let
IsOpenMiAi
=
uni
.
getStorageSync
(
"basedata"
)
?
uni
.
getStorageSync
(
"basedata"
).
mall
.
setting
.
is_show_miai
:
0
;
//是否开启相亲模式 5-13新加
if
(
this
.
u
.
IsOpenSchool
==
1
||
IsOpenMiAi
==
1
)
{
this
.
init
();
}
// 如果登录的情况下直接跳转商品详情或者直播列表
this
.
sharejump
();
},
getPageType
()
{
this
.
request2
({
url
:
"/api/AppletUser/GetAppletUserPageType"
,
data
:
{},
},
(
res
)
=>
{
let
mall_UserInfo
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
)
:
{};
mall_UserInfo
.
IsOpenSchool
=
res
.
data
.
IsOpenSchool
;
mall_UserInfo
.
UserPageType
=
res
.
data
.
UserPageType
;
uni
.
setStorageSync
(
"mall_UserInfo"
,
mall_UserInfo
);
if
(
this
.
IsOpenSchool
==
1
&&
res
.
data
.
UserPageType
!=
2
)
{
//这种情况是自己注册过 但是 通过分享进来的判断
this
.
IsOpenSchool
=
0
;
this
.
init
();
}
}
);
},
//关闭登录窗口
gbAuth
()
{
this
.
showAuth
=
false
;
},
goguidecar
()
{
uni
.
navigateTo
({
url
:
"/pages/guidecar/guidecarGoodsdetails?GoodsId="
+
this
.
guidecar
.
GoodsId
+
"&address="
+
this
.
guidecar
.
address
+
"&Pickcar="
+
this
.
guidecar
.
Pickcar
+
"&StartTime="
+
this
.
guidecar
.
StartTime
+
"&EndTime="
+
this
.
guidecar
.
EndTime
,
});
handleScroll
(
val
){
this
.
scrollTop
=
val
.
target
.
scrollTop
},
getPickcar
(
Name
)
{
//选择取消地址
this
.
$refs
.
city
[
0
].
getPickcar
(
Name
);
getjump
(
scene
)
{
let
a
=
"YZnsGuRojCKBkb1siP3VwkhkPFvh-D"
;
//测试数据
this
.
request
({
url
:
""
,
data
:
{
r
:
"api/default/qr-code-parameter"
,
token
:
scene
,
},
yj
()
{
// let obj ={ArriveCityId: 7,
// ArriveCityName: "九寨沟",
// ArriveCityType: 2,
// Q_Date: "2021-5-25",
// StartCityId: 262,
// StartCityName: "成都",
// StartCityType: 1}
// obj = encodeURIComponent(JSON.stringify(obj))
// uni.navigateTo({
// url: '/pages/guidecar/bookaCarList?carMsg='+obj
// })
},
(
res
)
=>
{
uni
.
setStorageSync
(
"pid"
,
{
pid
:
res
.
data
.
detail
.
user_id
?
res
.
data
.
detail
.
user_id
:
0
,
});
//存储上级的id
let
objurl
=
this
.
ObjectToUrl
(
res
.
data
.
detail
.
data
);
uni
.
navigateTo
({
url
:
"/pages/jiuzhai/jz_Line"
,
// url: '/pages/blindDate/personal/IDidentification'
url
:
"/"
+
res
.
data
.
detail
.
path
+
"?"
+
objurl
,
});
}
);
},
ObjectToUrl
(
e
,
t
)
{
var
n
=
""
;
for
(
var
i
in
e
)
n
+=
"&"
+
i
+
"="
+
(
t
?
encodeURIComponent
(
e
[
i
])
:
e
[
i
]);
return
n
.
substr
(
1
);
},
},
};
...
...
@@ -1368,33 +371,6 @@
flex-direction
:
column
;
width
:
100%
;
overflow-x
:
hidden
;
/* align-items: center;
justify-content: center; */
}
.content
.tips_t
{
position
:
fixed
;
right
:
6px
;
height
:
36px
;
background
:
#000000
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
padding
:
0
10px
;
font-size
:
12px
;
margin-top
:
10px
;
z-index
:
9999999
;
}
.triangle-up
{
width
:
0
;
height
:
0
;
border-left
:
10px
solid
transparent
;
border-right
:
10px
solid
transparent
;
border-bottom
:
12px
solid
black
;
position
:
fixed
;
right
:
65px
;
}
.index-title
{
...
...
@@ -1408,12 +384,19 @@
color
:
#fff
;
box-sizing
:
content-box
;
z-index
:
5
;
background-color
:
#FFF
;
}
.back-arrow
{
position
:
absolute
;
left
:
5px
;
bottom
:
12.5px
;
bottom
:
10px
;
width
:
60
rpx
;
height
:
60
rpx
;
border-radius
:
60
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.Startbtn
{
...
...
@@ -1435,28 +418,8 @@
padding-left
:
10px
;
}
/* .logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
} */
/* #ifdef MP-ALIPAY */
.indexpage
{
padding-bottom
:
100
rpx
;
.safe-top
{
height
:
unset
!important
;
padding-bottom
:
0
rpx
!important
;
}
/* #endif */
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment