Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
99bac123
Commit
99bac123
authored
Mar 09, 2021
by
程智春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nativehome_tst' of
http://code.mayi888.com/chengmo/mayi-mp-shop
into nativehome_tst
parents
1fcfbad1
27241d6a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
21 deletions
+82
-21
src/pages/home/index.vue
+17
-13
src/pages/tabBar1/index.vue
+1
-1
src/pages/tabBar2/index.vue
+1
-1
src/pages/tabBar3/index.vue
+1
-1
src/pages/tabBar4/index.vue
+1
-1
src/utils/index.js
+23
-0
src/utils/mayi.js
+2
-2
static/nativeComponents/TimeLimitedDiscount/index.js
+36
-2
No files found.
src/pages/home/index.vue
View file @
99bac123
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<cube-nav
:datas=
"item"
></cube-nav>
<cube-nav
:datas=
"item"
></cube-nav>
</div>
</div>
<div
v-else-if=
"item.componentCode == 'time-limited-discount' && item.componentInfo.visible == 1"
>
<div
v-else-if=
"item.componentCode == 'time-limited-discount' && item.componentInfo.visible == 1"
>
<time-limited-discount
:
datas=
"item
"
></time-limited-discount>
<time-limited-discount
:
class=
"'time-limited-discount'+index"
:datas=
"item"
:k=
"index
"
></time-limited-discount>
</div>
</div>
<div
v-if=
"item.componentCode == 'links' && item.componentInfo.visible == 1"
>
<div
v-if=
"item.componentCode == 'links' && item.componentInfo.visible == 1"
>
<links
:datas=
"item"
></links>
<links
:datas=
"item"
></links>
...
@@ -106,6 +106,7 @@ import imgText from '@/components/content/imgText'
...
@@ -106,6 +106,7 @@ import imgText from '@/components/content/imgText'
import
coupon
from
'@/components/activity/coupon'
import
coupon
from
'@/components/activity/coupon'
import
integralTurntable
from
'@/components/activity/integralTurntable'
import
integralTurntable
from
'@/components/activity/integralTurntable'
import
{
setTabBarActive
,
checkTabbarPage
,
themeColor
}
from
"../../utils/mayi.js"
;
import
{
setTabBarActive
,
checkTabbarPage
,
themeColor
}
from
"../../utils/mayi.js"
;
import
{
throttle
}
from
"../../utils/index.js"
const
app
=
getApp
();
const
app
=
getApp
();
export
default
{
export
default
{
...
@@ -182,17 +183,7 @@ export default {
...
@@ -182,17 +183,7 @@ export default {
this
.
changeLocation
=
options
.
changeLocation
||
''
this
.
changeLocation
=
options
.
changeLocation
||
''
if
(
this
.
changeLocation
==
1
){
if
(
this
.
changeLocation
==
1
){
// let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
// console.log(extConfig, "-----------extConfig");
// if (
// process.env.NODE_ENV == "development" ||
// JSON.stringify(extConfig) == "{}"
// ) {
// extConfig = { mixid: "antgood", shopid: 67 };
// }
console
.
log
(
'this.$store.state.extConfig'
,
this
.
$store
.
state
.
extConfig
)
console
.
log
(
'this.$store.state.extConfig'
,
this
.
$store
.
state
.
extConfig
)
app
.
getShopInfo
(
this
.
$store
.
state
.
extConfig
);
app
.
getShopInfo
(
this
.
$store
.
state
.
extConfig
);
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
}
}
...
@@ -233,10 +224,11 @@ export default {
...
@@ -233,10 +224,11 @@ export default {
onShow
()
{
onShow
()
{
setTabBarActive
.
bind
(
this
)(
checkTabbarPage
(
'/'
));
setTabBarActive
.
bind
(
this
)(
checkTabbarPage
(
'/'
));
this
.
$mp
.
page
.
onPageScroll
=
(
el
)
=>
{
this
.
$mp
.
page
.
onPageScroll
=
(
el
)
=>
{
th
is
.
scrolls
(
el
);
th
rottle
(
this
.
scrolls
(
el
),
100
)
};
};
},
},
methods
:
{
methods
:
{
init
(
pageList
)
{
init
(
pageList
)
{
setTabBarActive
.
bind
(
this
)(
checkTabbarPage
(
'/'
));
setTabBarActive
.
bind
(
this
)(
checkTabbarPage
(
'/'
));
...
@@ -252,10 +244,22 @@ export default {
...
@@ -252,10 +244,22 @@ export default {
wx
.
stopPullDownRefresh
()
wx
.
stopPullDownRefresh
()
},
},
scrolls
(
el
){
scrolls
(
el
){
this
.
setFooterShow
(
el
);
//
this.setFooterShow(el);
if
(
this
.
$mp
.
page
&&
this
.
$mp
.
page
.
selectComponent
(
".goodsListItem"
)){
if
(
this
.
$mp
.
page
&&
this
.
$mp
.
page
.
selectComponent
(
".goodsListItem"
)){
this
.
$mp
.
page
.
selectComponent
(
".goodsListItem"
).
getScroll
(
el
);
this
.
$mp
.
page
.
selectComponent
(
".goodsListItem"
).
getScroll
(
el
);
}
}
if
(
this
.
pageData
)
{
for
(
let
i
=
0
;
i
<
this
.
pageData
.
length
;
i
++
)
{
const
element
=
this
.
pageData
[
i
]
if
(
element
.
componentCode
==
"time-limited-discount"
){
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".time-limited-discount"
+
i
)
;
com
&&
com
.
getScroll
(
el
);
}
}
}
},
},
setFooterShow
(
el
){
setFooterShow
(
el
){
let
afterScrollTop
=
el
.
scrollTop
;
let
afterScrollTop
=
el
.
scrollTop
;
...
...
src/pages/tabBar1/index.vue
View file @
99bac123
...
@@ -51,7 +51,7 @@ export default {
...
@@ -51,7 +51,7 @@ export default {
if
(
!
this
.
ss
&&
ss
)
{
if
(
!
this
.
ss
&&
ss
)
{
this
.
ss
=
`&sessionid=
${
ss
}
`
;
this
.
ss
=
`&sessionid=
${
ss
}
`
;
}
else
if
(
!
ss
){
}
else
if
(
!
ss
){
!
this
.
params
.
includes
(
'logOut=true'
)
&&
(
this
.
params
+=
"&logOut=true"
)
//
!this.params.includes('logOut=true') && (this.params+="&logOut=true")
}
else
{
}
else
{
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
}
}
...
...
src/pages/tabBar2/index.vue
View file @
99bac123
...
@@ -50,7 +50,7 @@ export default {
...
@@ -50,7 +50,7 @@ export default {
if
(
!
this
.
ss
&&
ss
)
{
if
(
!
this
.
ss
&&
ss
)
{
this
.
ss
=
`&sessionid=
${
ss
}
`
;
this
.
ss
=
`&sessionid=
${
ss
}
`
;
}
else
if
(
!
ss
){
}
else
if
(
!
ss
){
this
.
params
+=
"&logOut=true"
//
this.params+="&logOut=true"
}
else
{
}
else
{
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
}
}
...
...
src/pages/tabBar3/index.vue
View file @
99bac123
...
@@ -56,7 +56,7 @@ export default {
...
@@ -56,7 +56,7 @@ export default {
if
(
!
this
.
ss
&&
ss
)
{
if
(
!
this
.
ss
&&
ss
)
{
this
.
ss
=
`&sessionid=
${
ss
}
`
;
this
.
ss
=
`&sessionid=
${
ss
}
`
;
}
else
if
(
!
ss
){
}
else
if
(
!
ss
){
this
.
params
+=
"&logOut=true"
//
this.params+="&logOut=true"
}
else
{
}
else
{
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
}
}
...
...
src/pages/tabBar4/index.vue
View file @
99bac123
...
@@ -56,7 +56,7 @@ export default {
...
@@ -56,7 +56,7 @@ export default {
if
(
!
this
.
ss
&&
ss
)
{
if
(
!
this
.
ss
&&
ss
)
{
this
.
ss
=
`&sessionid=
${
ss
}
`
;
this
.
ss
=
`&sessionid=
${
ss
}
`
;
}
else
if
(
!
ss
){
}
else
if
(
!
ss
){
this
.
params
+=
"&logOut=true"
//
this.params+="&logOut=true"
}
else
{
}
else
{
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
this
.
params
+=
`×tamp=
${
new
Date
().
getTime
()}
`
}
}
...
...
src/utils/index.js
View file @
99bac123
...
@@ -2,6 +2,29 @@ function formatNumber(n) {
...
@@ -2,6 +2,29 @@ function formatNumber(n) {
const
str
=
n
.
toString
()
const
str
=
n
.
toString
()
return
str
[
1
]
?
str
:
`0
${
str
}
`
return
str
[
1
]
?
str
:
`0
${
str
}
`
}
}
// 防抖
export
function
debounce
(
fn
,
wait
)
{
var
timeout
=
null
;
return
function
()
{
if
(
timeout
!==
null
)
clearTimeout
(
timeout
);
timeout
=
setTimeout
(
fn
,
wait
);
}
}
// 节流
export
function
throttle
(
func
,
delay
)
{
var
prev
=
Date
.
now
();
return
function
()
{
var
context
=
this
;
var
args
=
arguments
;
var
now
=
Date
.
now
();
if
(
now
-
prev
>=
delay
)
{
func
.
apply
(
context
,
args
);
prev
=
Date
.
now
();
}
}
}
//格式时间
//格式时间
export
function
formatTime
(
date
)
{
export
function
formatTime
(
date
)
{
...
...
src/utils/mayi.js
View file @
99bac123
...
@@ -29,7 +29,7 @@ export function $themeToLink(data, option) {
...
@@ -29,7 +29,7 @@ export function $themeToLink(data, option) {
let
type
=
data
.
type
;
let
type
=
data
.
type
;
// 点击底部栏--
// 点击底部栏--
// if (option
) {
if
(
type
!=
2
)
{
// 登录拦截
// 登录拦截
let
parseLink
=
getUrlofLink
(
data
);
let
parseLink
=
getUrlofLink
(
data
);
let
aa
=
noLoginListPath
.
includes
(
parseLink
)
||
parseLink
.
substr
(
0
,
7
)
==
"/goods/"
let
aa
=
noLoginListPath
.
includes
(
parseLink
)
||
parseLink
.
substr
(
0
,
7
)
==
"/goods/"
...
@@ -52,7 +52,7 @@ export function $themeToLink(data, option) {
...
@@ -52,7 +52,7 @@ export function $themeToLink(data, option) {
}
}
// console.log(option, data,'---',parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`)
// console.log(option, data,'---',parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`)
// return
// return
//
}
}
// 历史数据
// 历史数据
...
...
static/nativeComponents/TimeLimitedDiscount/index.js
View file @
99bac123
...
@@ -39,6 +39,7 @@ xcsoft.countdown = function(a, b, c) {
...
@@ -39,6 +39,7 @@ xcsoft.countdown = function(a, b, c) {
d
.
minute
=
0
;
d
.
minute
=
0
;
d
.
second
=
0
;
d
.
second
=
0
;
d
.
t
=
setInterval
(
function
()
{
d
.
t
=
setInterval
(
function
()
{
console
.
log
(
'倒计时'
)
e
=
new
Date
().
getTime
();
e
=
new
Date
().
getTime
();
f
=
parseInt
(
e
/
1000
+
x
);
f
=
parseInt
(
e
/
1000
+
x
);
var
l
=
d
.
time
-
f
;
var
l
=
d
.
time
-
f
;
...
@@ -109,10 +110,15 @@ const componentOptions = {
...
@@ -109,10 +110,15 @@ const componentOptions = {
properties
:
{
properties
:
{
datas
:
{
datas
:
{
type
:
Object
type
:
Object
},
k
:{
type
:
String
}
}
},
},
// 组件数据
// 组件数据
data
:
{
data
:
{
loaded
:
false
,
isContain
:
false
,
isPageHidden
:
false
,
// 页面是否处于隐藏状态
isPageHidden
:
false
,
// 页面是否处于隐藏状态
timeData
:
{},
timeData
:
{},
isLoading
:
true
,
isLoading
:
true
,
...
@@ -243,6 +249,24 @@ const componentOptions = {
...
@@ -243,6 +249,24 @@ const componentOptions = {
}
}
});
});
},
},
getScroll
(){
this
.
getEleInfo
(()
=>
{
this
.
getData
()
});
},
// 获取当前组件位置信息
getEleInfo
(
cb
){
if
(
this
.
loaded
||
this
.
isContain
)
return
this
.
isContain
=
true
;
let
{
windowHeight
}
=
wx
.
getSystemInfoSync
()
let
query
=
wx
.
createSelectorQuery
().
in
(
this
);
query
.
select
(
'.time-limited-discount'
).
boundingClientRect
(
rect
=>
{
if
(
rect
.
top
<
windowHeight
&&
rect
.
top
+
rect
.
height
>
0
)
{
cb
&&
cb
()
}
this
.
isContain
=
false
;
}).
exec
();
},
onChange
(
e
)
{
onChange
(
e
)
{
this
.
setData
({
timeData
:
e
.
detail
});
this
.
setData
({
timeData
:
e
.
detail
});
},
},
...
@@ -275,6 +299,8 @@ const componentOptions = {
...
@@ -275,6 +299,8 @@ const componentOptions = {
});
});
},
},
getData
()
{
getData
()
{
if
(
this
.
loaded
)
return
this
.
loaded
=
true
let
{
dimension
}
=
this
.
data
.
datas
.
componentData
;
let
{
dimension
}
=
this
.
data
.
datas
.
componentData
;
if
(
dimension
==
0
)
{
if
(
dimension
==
0
)
{
this
.
init
();
this
.
init
();
...
@@ -287,7 +313,11 @@ const componentOptions = {
...
@@ -287,7 +313,11 @@ const componentOptions = {
lifetimes
:
{
lifetimes
:
{
created
()
{},
created
()
{},
ready
()
{
ready
()
{
this
.
getData
();
this
.
loaded
=
false
;
this
.
isContain
=
false
;
this
.
getEleInfo
(()
=>
{
this
.
getData
()
});
},
},
moved
()
{},
moved
()
{},
detached
()
{}
detached
()
{}
...
@@ -297,7 +327,11 @@ const componentOptions = {
...
@@ -297,7 +327,11 @@ const componentOptions = {
pageLifetimes
:
{
pageLifetimes
:
{
// 页面被展示
// 页面被展示
show
()
{
show
()
{
this
.
getData
();
this
.
loaded
=
false
;
this
.
isContain
=
false
;
this
.
getEleInfo
(()
=>
{
this
.
getData
()
});
const
{
isPageHidden
}
=
this
.
data
;
const
{
isPageHidden
}
=
this
.
data
;
// show事件发生前,页面不是处于隐藏状态时
// show事件发生前,页面不是处于隐藏状态时
if
(
!
isPageHidden
)
{
if
(
!
isPageHidden
)
{
...
...
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