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
38b91522
Commit
38b91522
authored
Mar 03, 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
65905271
cbe75d49
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
318 additions
and
13 deletions
+318
-13
src/api/index.js
+4
-0
src/components/activity/integralTurntable.vue
+5
-1
src/pages/home/index.vue
+3
-0
src/pages/home/main.json
+2
-1
src/pages/index/index.vue
+3
-3
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/mayi.js
+9
-4
static/nativeComponents/SharePicture/index.js
+156
-0
static/nativeComponents/SharePicture/index.json
+5
-0
static/nativeComponents/SharePicture/index.wxml
+38
-0
static/nativeComponents/SharePicture/index.wxss
+89
-0
No files found.
src/api/index.js
View file @
38b91522
...
@@ -24,6 +24,9 @@ console.log(process.env,'-----------------config------')
...
@@ -24,6 +24,9 @@ console.log(process.env,'-----------------config------')
},
},
getLiveCon
(
data
){
getLiveCon
(
data
){
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/liveBroadcastInfo/getPageListByIds`
,
data
);
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/liveBroadcastInfo/getPageListByIds`
,
data
);
},
queryBuyingShowList
(
data
){
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/activityInfo/buyingShow/queryBuyingShowList`
,
data
);
}
}
}
}
\ No newline at end of file
src/components/activity/integralTurntable.vue
View file @
38b91522
...
@@ -78,8 +78,12 @@ export default {
...
@@ -78,8 +78,12 @@ export default {
// },
// },
// 跳转到大转盘页
// 跳转到大转盘页
toPrizePage
()
{
toPrizePage
()
{
let
link
=
`/turntable?turntableCode=
${
this
.
datas
.
componentData
.
turntableCode
}
`
let
link
=
`/turntable?turntableCode=
${
this
.
datas
.
componentData
.
turntableCode
}
`
app
.
$themeToLink
(
link
);
app
.
$themeToLink
({
type
:
1
,
link
:
link
});
},
},
// toEnvPage() {
// toEnvPage() {
// let query = {
// let query = {
...
...
src/pages/home/index.vue
View file @
38b91522
...
@@ -78,6 +78,9 @@
...
@@ -78,6 +78,9 @@
<div
v-if=
"item.componentCode == 'information' && item.componentInfo.visible == 1"
>
<div
v-if=
"item.componentCode == 'information' && item.componentInfo.visible == 1"
>
<information
:datas=
"item"
></information>
<information
:datas=
"item"
></information>
</div>
</div>
<div
v-if=
"item.componentCode == 'share-picture' && item.componentInfo.visible == 1"
>
<share-picture
:datas=
"item"
></share-picture>
</div>
</div>
</div>
<bottomCont></bottomCont>
<bottomCont></bottomCont>
</div>
</div>
...
...
src/pages/home/main.json
View file @
38b91522
...
@@ -17,7 +17,8 @@
...
@@ -17,7 +17,8 @@
"speedy-nav"
:
"/static/nativeComponents/SpeedyNav/index"
,
"speedy-nav"
:
"/static/nativeComponents/SpeedyNav/index"
,
"video-player"
:
"/static/nativeComponents/VideoPlayer/index"
,
"video-player"
:
"/static/nativeComponents/VideoPlayer/index"
,
"photo-gallery"
:
"/static/nativeComponents/PhotoGallery/index"
,
"photo-gallery"
:
"/static/nativeComponents/PhotoGallery/index"
,
"live-broadcast"
:
"/static/nativeComponents/LiveBroadcast/index"
"live-broadcast"
:
"/static/nativeComponents/LiveBroadcast/index"
,
"share-picture"
:
"/static/nativeComponents/SharePicture/index"
},
},
"enablePullDownRefresh"
:
true
,
"enablePullDownRefresh"
:
true
,
"backgroundColor"
:
"#f5f5f5"
"backgroundColor"
:
"#f5f5f5"
...
...
src/pages/index/index.vue
View file @
38b91522
<
template
>
<
template
>
<div>
<div>
<!--
<div>
{{
withoutScene
?
"初始化完成"
:
"初始化中"
}}
</div>
-->
<div
style=
"width:100%;height:90vh;display:flex;justify-content: center;align-items: center;"
>
<div
style=
"width:100%;height:90vh;display:flex;justify-content: center;align-items: center;"
>
<van-loading
size=
"40px"
type=
"spinner"
></van-loading>
<van-loading
size=
"40px"
type=
"spinner"
></van-loading>
</div>
</div>
...
@@ -24,7 +23,8 @@ export default {
...
@@ -24,7 +23,8 @@ export default {
baseUrl
:
process
.
env
.
BASE_URL
,
baseUrl
:
process
.
env
.
BASE_URL
,
link
:
this
.
baseUrl
,
link
:
this
.
baseUrl
,
page
:
"/"
,
page
:
"/"
,
params
:
"?mixid="
+
this
.
shopId
+
'&native=1'
,
location_obj
:
wx
.
getStorageSync
(
"location"
),
params
:
"?mixid="
+
this
.
shopId
+
`&location_obj=
${
this
.
location_obj
}
`
,
userInfo
:
{
userInfo
:
{
nickName
:
"mpvue"
,
nickName
:
"mpvue"
,
...
@@ -134,7 +134,7 @@ export default {
...
@@ -134,7 +134,7 @@ export default {
//来自直播详情
//来自直播详情
this
.
page
=
decodeURIComponent
(
options
.
backpath
);
this
.
page
=
decodeURIComponent
(
options
.
backpath
);
if
(
this
.
page
.
includes
(
"?"
)){
if
(
this
.
page
.
includes
(
"?"
)){
this
.
params
=
"&mixid="
+
this
.
shopId
+
'&native=1'
;
this
.
params
=
"&mixid="
+
this
.
shopId
+
`&location_obj=
${
this
.
location_obj
}
`
;
}
}
options
.
params
&&
(
this
.
params
+=
"&"
+
serialize
(
decodeURIComponent
(
options
.
params
)));
options
.
params
&&
(
this
.
params
+=
"&"
+
serialize
(
decodeURIComponent
(
options
.
params
)));
console
.
log
(
this
.
page
,
this
.
params
)
console
.
log
(
this
.
page
,
this
.
params
)
...
...
src/pages/tabBar1/index.vue
View file @
38b91522
...
@@ -22,7 +22,7 @@ export default {
...
@@ -22,7 +22,7 @@ export default {
return
{
return
{
link
:
process
.
env
.
BASE_URL
,
link
:
process
.
env
.
BASE_URL
,
page
:
"/"
,
page
:
"/"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
"&tabbar=1&native=1"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
`&tabbar=1&location_obj=
${
wx
.
getStorageSync
(
"location"
)}
`
,
index
:
1
,
index
:
1
,
ss
:
""
,
ss
:
""
,
};
};
...
...
src/pages/tabBar2/index.vue
View file @
38b91522
...
@@ -21,7 +21,7 @@ export default {
...
@@ -21,7 +21,7 @@ export default {
return
{
return
{
link
:
process
.
env
.
BASE_URL
,
link
:
process
.
env
.
BASE_URL
,
page
:
"/"
,
page
:
"/"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
"&tabbar=2&native=1"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
`&tabbar=2&location_obj=
${
wx
.
getStorageSync
(
"location"
)}
`
,
index
:
2
,
index
:
2
,
ss
:
""
,
ss
:
""
,
};
};
...
...
src/pages/tabBar3/index.vue
View file @
38b91522
...
@@ -21,7 +21,7 @@ export default {
...
@@ -21,7 +21,7 @@ export default {
return
{
return
{
link
:
process
.
env
.
BASE_URL
,
link
:
process
.
env
.
BASE_URL
,
page
:
"/"
,
page
:
"/"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
"&tabbar=3&native=1"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
`&tabbar=3&location_obj=
${
wx
.
getStorageSync
(
"location"
)}
`
,
index
:
3
,
index
:
3
,
ss
:
""
,
ss
:
""
,
};
};
...
...
src/pages/tabBar4/index.vue
View file @
38b91522
...
@@ -21,7 +21,7 @@ export default {
...
@@ -21,7 +21,7 @@ export default {
return
{
return
{
link
:
process
.
env
.
BASE_URL
,
link
:
process
.
env
.
BASE_URL
,
page
:
"/"
,
page
:
"/"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
"&tabbar=4&native=1"
,
params
:
"?mixid="
+
this
.
$store
.
state
.
mixid
+
`&tabbar=4&location_obj=
${
wx
.
getStorageSync
(
"location"
)}
`
,
index
:
4
,
index
:
4
,
ss
:
""
,
ss
:
""
,
};
};
...
...
src/utils/mayi.js
View file @
38b91522
...
@@ -27,8 +27,9 @@ export function $themeToLink(data, option) {
...
@@ -27,8 +27,9 @@ export function $themeToLink(data, option) {
let
app
=
getApp
();
let
app
=
getApp
();
let
type
=
data
.
type
;
let
type
=
data
.
type
;
// 点击底部栏
// 点击底部栏--
if
(
option
)
{
// if (option) {
// 登录拦截
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/"
console
.
log
(
parseLink
,
aa
,
'parseLinkparseLinkparseLink'
,
parseLink
,
noLoginListPath
)
console
.
log
(
parseLink
,
aa
,
'parseLinkparseLinkparseLink'
,
parseLink
,
noLoginListPath
)
...
@@ -38,15 +39,19 @@ export function $themeToLink(data, option) {
...
@@ -38,15 +39,19 @@ export function $themeToLink(data, option) {
return
return
}
}
//
替换首页位置
//
判断是否市跳转到tabbar页面 替换首页位置
let
isTabbarIndex
=
checkTabbarPage
(
parseLink
);
let
isTabbarIndex
=
checkTabbarPage
(
parseLink
);
console
.
log
(
'44'
,
isTabbarIndex
)
if
(
isTabbarIndex
>=
0
)
{
isTabbarIndex
=
isTabbarIndex
==
0
?
checkTabbarPage
(
'/'
)
:
isTabbarIndex
isTabbarIndex
=
isTabbarIndex
==
0
?
checkTabbarPage
(
'/'
)
:
isTabbarIndex
wx
.
switchTab
({
wx
.
switchTab
({
url
:
parseLink
==
'/'
?
'/pages/home/main'
:
`/pages/tabBar
${
isTabbarIndex
}
/main`
,
url
:
parseLink
==
'/'
?
'/pages/home/main'
:
`/pages/tabBar
${
isTabbarIndex
}
/main`
,
})
})
console
.
log
(
option
,
data
,
'---'
,
parseLink
==
'/'
?
'/pages/home/main'
:
`/pages/tabBar
${
isTabbarIndex
}
/main`
)
return
return
}
}
// console.log(option, data,'---',parseLink == '/' ? '/pages/home/main' : `/pages/tabBar${isTabbarIndex}/main`)
// return
// }
// 历史数据
// 历史数据
...
...
static/nativeComponents/SharePicture/index.js
0 → 100644
View file @
38b91522
// static/nativeComponents/SharePicture/index.js
const
app
=
getApp
()
const
{
indexApi
}
=
app
;
Component
({
/**
* 组件的属性列表
*/
properties
:
{
datas
:
{
type
:
Object
}
},
/**
* 组件的初始数据
*/
data
:
{
tabIndex
:
0
,
waterfallLeftList
:[],
waterfallRightList
:[],
loaded
:
true
,
pageNum
:
1
,
tabId
:
1
,
},
ready
(){
this
.
queryBuyingShowList
(
0
);
},
/**
* 组件的方法列表
*/
methods
:
{
tabHandle
(
e
){
let
index
=
e
.
currentTarget
.
dataset
.
index
let
item
=
e
.
currentTarget
.
dataset
.
item
console
.
log
(
index
,
item
,
this
.
data
.
tabIndex
)
if
(
this
.
data
.
tabIndex
!=
index
){
this
.
setData
({
tabIndex
:
index
,
tabId
:
item
.
id
})
this
.
queryBuyingShowList
(
0
)
}
},
queryBuyingShowList
(
type
){
if
(
this
.
data
.
datas
.
componentData
[
"activityFlag"
][
0
][
"id"
]
==
""
||
!
this
.
data
.
loaded
){
return
;
}
this
.
setData
({
loaded
:
false
})
if
(
type
==
0
){
this
.
setData
({
pageNum
:
1
})
}
else
{
this
.
setData
({
pageNum
:
this
.
data
.
pageNum
+
1
})
}
let
query
=
{
activityId
:
this
.
data
.
datas
.
componentData
.
activityFlag
[
0
].
id
||
4
,
sortType
:
this
.
data
.
tabId
,
pageNum
:
this
.
data
.
pageNum
,
startTime
:
Array
.
isArray
(
this
.
data
.
datas
.
componentData
.
publishTime
)
?
this
.
data
.
datas
.
componentData
.
publishTime
[
0
]
:
""
,
endTime
:
Array
.
isArray
(
this
.
data
.
datas
.
componentData
.
publishTime
)
?
this
.
data
.
datas
.
componentData
.
publishTime
[
1
]
:
""
,
pageSize
:
+
this
.
data
.
datas
.
componentData
[
"quantity"
]
}
indexApi
.
queryBuyingShowList
(
query
).
then
(
res
=>
{
this
.
setData
({
loaded
:
true
})
if
(
res
.
data
.
code
==
'200'
){
let
data
=
res
.
data
.
data
let
{
waterfallLeftList
,
waterfallRightList
}
=
this
.
data
if
(
type
==
0
){
data
.
forEach
((
item
,
index
)
=>
{
item
.
customerHandImage
=
app
.
DFSImg
(
item
.
customerHandImage
)
item
.
checkMP4Status
=
this
.
checkMP4
(
item
.
urls
)
if
(
this
.
getFileType
(
item
.
urls
[
0
])
==
'video'
){
item
.
coverImg
=
app
.
DFSImg
(
`
${
item
.
urls
[
0
]}
?x-oss-process=video/snapshot,t_1,m_fast`
)
}
else
{
item
.
coverImg
=
app
.
DFSImg
(
item
.
urls
[
0
],
400
,
null
,
1
)
}
if
(
index
%
2
==
0
){
waterfallLeftList
.
push
(
item
)
}
else
{
waterfallRightList
.
push
(
item
)
}
})
this
.
setData
({
waterfallLeftList
,
waterfallRightList
})
console
.
log
(
this
.
data
.
waterfallLeftList
,
this
.
data
.
waterfallRightList
,
' this.data.waterfallRightList'
)
}
else
{
}
}
})
.
catch
(
err
=>
{
this
.
setData
({
loaded
:
true
})
})
},
getFileType
(
name
)
{
if
(
!
name
)
return
false
;
var
imgType
=
[
"gif"
,
"jpeg"
,
"jpg"
,
"bmp"
,
"png"
];
var
videoType
=
[
"avi"
,
"wmv"
,
"mkv"
,
"mp4"
,
"mov"
,
"rm"
,
"3gp"
,
"flv"
,
"mpg"
,
"rmvb"
];
if
(
RegExp
(
".("
+
imgType
.
join
(
"|"
)
+
")$"
,
"i"
).
test
(
name
.
toLowerCase
())
)
{
return
"image"
;
}
else
if
(
RegExp
(
".("
+
videoType
.
join
(
"|"
)
+
")$"
,
"i"
).
test
(
name
.
toLowerCase
())
)
{
return
"video"
;
}
else
{
return
false
;
}
},
checkMP4
(
data
)
{
for
(
let
index
=
0
;
index
<
data
.
length
;
index
++
)
{
if
(
this
.
getFileType
(
data
[
index
])
==
"video"
)
{
return
true
;
}
else
{
return
false
;
}
}
},
}
})
static/nativeComponents/SharePicture/index.json
0 → 100644
View file @
38b91522
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
static/nativeComponents/SharePicture/index.wxml
0 → 100644
View file @
38b91522
<!--static/nativeComponents/SharePicture/index.wxml-->
<view class="waterfall-content" style="background-color:{{datas.componentData['backgroundColor']}};padding-top:{{datas.componentData.paddingList[0]['value'] * 2}}rpx;padding-bottom:{{datas.componentData.paddingList[1]['value'] * 2}}rpx;padding-left:{{datas.componentData.paddingList[2]['value'] * 2}}rpx;padding-right:{{datas.componentData.paddingList[3]['value'] * 2}}rpx">
<view class="tab-wrap">
<view class="tab-item {{tabIndex == index && 'checked'}}" wx:for="{{datas.componentData['list']}}" :key="index" wx:if="{{item.show}}" bindtap="tabHandle" data-index="{{index}}" data-item="{{item}}" z>
<text>{{item.name}}</text>
</view>
</view>
<view class="waterfall-wrap">
<view class="waterfall-l" style="padding-right:{{datas.componentData.proGap}}rpx">
<view class="item" wx:for="{{waterfallLeftList}}" wx:key="index" style="border-width:{{datas.componentData['borderColorShow'] ? '1px' : ''}};border-style:{{datas.componentData['borderColorShow'] ? 'solid' : ''}};border-color:{{datas.componentData['borderColorShow'] ? datas.componentData['borderColor'] : ''}}">
<view class="img-wrap">
<image src="{{item.coverImg}}" mode="widthFix"></image>
<i class="iconfont-common common-iconbofang2 icon{{datas.componentData['playBtnPosition']}}" wx:if="{{item.checkMP4Status}}"></i>
</view>
<view class="content">
<view class="title" wx:if="{{datas.componentData['textContentShow']}}" style="color:{{datas.componentData['textContentColor']}};font-weight:{{datas.componentData['textContentFontWeight']}};font-size:{{datas.componentData['textContentFontSize'] * 20}}rpx">
{{item.commentContent}}
</view>
</view>
</view>
</view>
<view class="waterfall-r" style="padding-left:{{datas.componentData.proGap}}rpx">
<view class="item" wx:for="{{waterfallRightList}}" wx:key="index" style="border-width:{{datas.componentData['borderColorShow'] ? '1px' : ''}};border-style:{{datas.componentData['borderColorShow'] ? 'solid' : ''}};border-color:{{datas.componentData['borderColorShow'] ? datas.componentData['borderColor'] : ''}}">
<view class="img-wrap">
<image src="{{item.coverImg}}" mode="widthFix"></image>
<i class="iconfont-common common-iconbofang2 icon{{datas.componentData['playBtnPosition']}}" wx:if="{{item.checkMP4Status}}"></i>
</view>
<view class="content">
<view class="title" wx:if="{{datas.componentData['textContentShow']}}" style="color:{{datas.componentData['textContentColor']}};font-weight:{{datas.componentData['textContentFontWeight']}};font-size:{{datas.componentData['textContentFontSize'] * 20}}rpx">
{{item.commentContent}}
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
static/nativeComponents/SharePicture/index.wxss
0 → 100644
View file @
38b91522
/* static/nativeComponents/SharePicture/index.wxss */
@import "/static/font/common_icon.wxss";
.waterfall-content {
font-size: 20rpx;
width: 100%;
height: 100%;
position: relative;
box-sizing: border-box;
}
.waterfall-content .tab-wrap{
display: flex;
justify-content: space-around;
padding: 32rpx 0;
box-sizing: border-box
}
.waterfall-content .tab-wrap .tab-item{
transition: all 0.2s;
border-radius: 40rpx;
width: 96rpx;
height: 44rpx;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
}
.waterfall-content .tab-wrap .tab-item text{
font-size: 26rpx;
}
.checked {
background-color: var(--main-color);
color: #ffffff;
}
.waterfall-wrap{
position: relative;
box-sizing: border-box;
overflow: hidden;
}
.waterfall-l,.waterfall-r{
width: 50%;
box-sizing: border-box;
float: left;
}
.waterfall-l .item, .waterfall-r .item{
border-radius: 12rpx;
margin-top: 20rpx;
overflow: hidden;
background-color: white;
}
.waterfall-l .item:first-child, .waterfall-r .item:first-child{
margin-top: 0
}
.waterfall-wrap .img-wrap{
position: relative;
}
.waterfall-wrap .img-wrap image{
display: block;
}
.waterfall-wrap .img-wrap .iconfont-common {
color: #fff;
position: absolute;
font-size: 60rpx;
}
.icon0 {
left: 4rpx;
bottom: 4rpx;
}
.icon1 {
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.icon2 {
right: 4rpx;
top: 4rpx;
}
.content{
padding : 19rpx 17rpx 20rpx 17rpx;
}
.content .title{
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
\ 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