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
4ac35289
Commit
4ac35289
authored
Feb 23, 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
f0065bf6
328741c6
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
252 additions
and
37 deletions
+252
-37
config/dev.env.js
+2
-2
custom-tab-bar/index.js
+20
-2
custom-tab-bar/index.wxml
+21
-17
custom-tab-bar/index.wxss
+30
-4
project.config.json
+2
-2
src/main.js
+2
-0
src/pages/home/index.vue
+6
-5
src/pages/home/main.json
+3
-1
static/nativeComponents/GoodsList/index.js
+2
-2
static/nativeComponents/SharePopup/index.js
+8
-2
static/nativeComponents/VideoPlayer/index.js
+82
-0
static/nativeComponents/VideoPlayer/index.json
+4
-0
static/nativeComponents/VideoPlayer/index.wxml
+32
-0
static/nativeComponents/VideoPlayer/index.wxss
+38
-0
No files found.
config/dev.env.js
View file @
4ac35289
...
...
@@ -16,8 +16,8 @@ module.exports = merge(prodEnv, {//zjgyl
// BASE_URL:"'https://shop.mayi888.com'",
// BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://192.168.1.127:3000'",
BASE_URL
:
"'https://test-m-shop.mayi888.cn'"
,
// BASE_URL:"'http://172.16.1.61
:3004'",
//
BASE_URL:"'https://test-m-shop.mayi888.cn'",
BASE_URL
:
"'http://172.16.1.48
:3004'"
,
OLSHOP_URL
:
'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"'
,
// OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
...
...
custom-tab-bar/index.js
View file @
4ac35289
...
...
@@ -63,22 +63,34 @@ Component({
visible
:
1
}
],
mm
:
false
,
componentData
:
{},
show
:
true
},
attached
()
{
let
that
=
this
;
if
(
app
.
globalData
.
footerVal
)
{
let
mm
=
(
Math
.
ceil
(
app
.
globalData
.
footerVal
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
app
.
globalData
.
footerVal
.
componentData
[
'styleSelectionNum'
]
==
1
)
console
.
log
(
733333
,
mm
)
that
.
setData
({
componentData
:
app
.
globalData
.
footerVal
.
componentData
,
list
:
app
.
globalData
.
footerVal
.
componentData
.
list
list
:
app
.
globalData
.
footerVal
.
componentData
.
list
,
mm
:
mm
});
console
.
log
(
'777777'
,
Math
.
ceil
(
this
.
data
.
list
.
length
/
2
-
1
),
this
.
data
.
selected
,
this
.
data
.
componentData
[
'styleSelectionNum'
])
}
else
{
console
.
log
(
73333381
)
app
.
footerCallBack
=
function
(
params
)
{
console
.
log
(
'back'
)
that
.
setData
({
componentData
:
params
.
componentData
,
list
:
params
.
componentData
.
list
list
:
params
.
componentData
.
list
,
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&¶ms.componentData['styleSelectionNum']==1)
});
let
mm
=
(
Math
.
ceil
(
params
.
componentData
.
list
.
length
/
2
-
1
)
==
that
.
data
.
selected
&&
params
.
componentData
[
'styleSelectionNum'
]
==
1
)
console
.
log
(
'87777777'
,
mm
)
};
}
...
...
@@ -88,6 +100,12 @@ Component({
app
.
webviewCallBack
=
function
(
state
,
params
)
{
console
.
log
(
"webview变化"
,
state
,
params
);
};
//
this
.
setData
({
mm
:(
Math
.
ceil
(
this
.
data
.
list
.
length
/
2
-
1
)
==
this
.
data
.
selected
&&
this
.
data
.
componentData
[
'styleSelectionNum'
]
==
1
)
})
},
methods
:
{
init
()
{},
...
...
custom-tab-bar/index.wxml
View file @
4ac35289
<!--miniprogram/custom-tab-bar/index.wxml-->
<
cover-
view class="tab-bar {{show?'':'hide'}}">
<!-- <
cover-view class="antt ant-daipinglun"></cover-
view> -->
<!-- <
cover-view class="iconfont icon-fenzhi">3</cover-
view> -->
<view class="tab-bar {{show?'':'hide'}}">
<!-- <
view class="antt ant-daipinglun"></
view> -->
<!-- <
view class="iconfont icon-fenzhi">3</
view> -->
<
cover-view class="tab-bar-border"></cover-
view>
<
cover-
view
<
view class="tab-bar-border"></
view>
<view
wx:for="{{list}}"
wx:key="index"
class="tab-bar-item"
class="tab-bar-item
{{(Math.ceil(list.length/2-1)==selected&&componentData['styleSelectionNum']==1)?isItem:''}}
"
data-path="{{item.link}}"
data-index="{{index}}"
bindtap="switchTab"
>
<cover-view wx:if="{{item.iconType==0||!item.iconType}}">
<cover-view class="antt {{item.icon}}"></cover-view>
</cover-view>
<cover-view
<!-- {{index}}{{selected}}--{{Math.ceil(5/2-1)}}--{{mm}} -->
<!-- &&componentData['styleSelectionNum']==1 -->
<!-- 图标 -->
<view >
<view wx:if="{{item.iconType==0||!item.iconType}}">
<view class="antt {{item.icon}}" style="font-size:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}};color:{{index==selected?componentData.selectIconColor:componentData.defaultIconColor}}"></view>
</view>
<view
wx:elif="{{item.iconType==1}}"
class="img-view"
style="width:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}};height:{{(index==selected?componentData.selectionIconSize*2:componentData.defaultIconSize*2)+'rpx'}}"
>
<cover-image src="{{selected === index ? item.selectImgUrl : item.imgUrl}}"></cover-image>
</cover-view>
<image mode="aspectFit" src="{{selected === index ? item.selectImgUrl : item.imgUrl}}"></image>
</view>
</view>
<!-- 名称 -->
<
cover-view
style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? componentData.selectionTextNum*2 : componentData.defaultTextNum*2}}rpx">
{{item.title}}</
cover-
view>
</
cover-
view>
</
cover-
view>
<
view class="text"
style="color: {{selected === index ? componentData.selectTextColor : componentData.defaultTextColor}};font-size:{{selected === index ? componentData.selectionTextNum*2 : componentData.defaultTextNum*2}}rpx">
{{item.title}}</view>
</view>
</view>
custom-tab-bar/index.wxss
View file @
4ac35289
...
...
@@ -1378,10 +1378,15 @@
bottom: 0;
left: 0;
right: 0;
height: 48px;
background: white;
height: 51px;
display: flex;
padding-bottom: env(safe-area-inset-bottom);
font-size: 10px;
width: 100%;
bottom: 0;
left: 0;
background: #f5f5f4;
/* border-top: 1px solid #e2e2e2; */
}
.tab-bar-border {
...
...
@@ -1403,6 +1408,20 @@
flex-direction: column;
}
.isItem {
transform: translateY(-30%)
}
.icons {
width: 50px;
height: 50px;
background: var(--main-color);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border: 4px solid #fff;
}
.tab-bar-item cover-image {
width: 27px;
height: 27px;
...
...
@@ -1412,11 +1431,18 @@
/* font-size: 10px; */
}
.img-view cover-image{
object-fit: contain;
/* .img-view{
display: flex;
align-items: center;
} */
.img-view image{
/* object-fit: contain; */
width: 100%;
height: 100%;
}
.text{
margin-top: 4rpx;
}
.hide{
display: none;
...
...
project.config.json
View file @
4ac35289
...
...
@@ -2,7 +2,7 @@
"description"
:
"项目配置文件。"
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
fals
e
,
"es6"
:
tru
e
,
"enhance"
:
true
,
"postcss"
:
true
,
"minified"
:
true
,
...
...
@@ -10,7 +10,7 @@
"coverView"
:
true
,
"nodeModules"
:
true
,
"autoAudits"
:
true
,
"showShadowRootInWxmlPanel"
:
tru
e
,
"showShadowRootInWxmlPanel"
:
fals
e
,
"scopeDataCheck"
:
false
,
"uglifyFileName"
:
true
,
"checkInvalidKey"
:
true
,
...
...
src/main.js
View file @
4ac35289
...
...
@@ -43,6 +43,8 @@ mpApp.webviewCallBack = function () { }
mpApp
.
shareInit
=
function
()
{};
mpApp
.
themeColorCallBack
=
function
()
{};
// 全局数据
mpApp
.
processEnv
=
process
.
env
;
console
.
log
(
'3555555'
,
wx
)
// 全局跳转 data为link对象
mpApp
.
$themeToLink
=
$themeToLink
...
...
src/pages/home/index.vue
View file @
4ac35289
...
...
@@ -42,9 +42,6 @@
<div
v-if=
"item.componentCode == 'img-text' && item.componentInfo.visible == 1"
>
<img-text
:datas=
"item"
></img-text>
</div>
<div
v-if=
"item.componentCode == 'video-player' && item.componentInfo.visible == 1"
>
<videoPlayer
:datas=
"item"
></videoPlayer>
</div>
<div
v-if=
"item.componentCode == 'goods-search' && item.componentInfo.visible == 1"
>
<goods-search
:datas=
"item"
></goods-search>
</div>
...
...
@@ -63,6 +60,12 @@
<div
v-if=
"item.componentCode == 'speedy-nav'"
>
<speedy-nav
:datas=
"item"
></speedy-nav>
</div>
<div
v-if=
"item.componentCode == 'video-player'"
>
<video-player
:datas=
"item"
:indexs=
"index"
></video-player>
</div>
<div
v-if=
"item.componentCode == 'official-account'"
>
<official-account></official-account>
</div>
</div>
<bottomCont></bottomCont>
...
...
@@ -94,7 +97,6 @@ import partition from '@/components/basicTool/partition/index.vue'
import
shopPopup
from
'@/components/basicTool/shop-popup/index.vue'
import
text
from
'@/components/content/text'
import
imgText
from
'@/components/content/imgText'
import
videoPlayer
from
'@/components/content/videoPlayer'
import
coupon
from
'@/components/activity/coupon'
import
integralTurntable
from
'@/components/activity/integralTurntable'
import
{
setTabBarActive
,
checkTabbarPage
,
themeColor
}
from
"../../utils/mayi.js"
;
...
...
@@ -121,7 +123,6 @@ export default {
ThemeDataPlant
,
'text-text'
:
text
,
'img-text'
:
imgText
,
videoPlayer
,
coupon
,
integralTurntable
},
...
...
src/pages/home/main.json
View file @
4ac35289
...
...
@@ -12,7 +12,8 @@
"notice"
:
"/static/nativeComponents/Notice/index"
,
"pop-up"
:
"/static/nativeComponents/PopUp/index"
,
"share-popup"
:
"/static/nativeComponents/SharePopup/index"
,
"speedy-nav"
:
"/static/nativeComponents/SpeedyNav/index"
"speedy-nav"
:
"/static/nativeComponents/SpeedyNav/index"
,
"video-player"
:
"/static/nativeComponents/VideoPlayer/index"
},
"enablePullDownRefresh"
:
true
}
\ No newline at end of file
static/nativeComponents/GoodsList/index.js
View file @
4ac35289
...
...
@@ -346,9 +346,9 @@ const componentOptions = {
let
linkVal
=
""
;
if
(
goodsType
!=
1
)
{
if
(
style
==
"list"
)
{
linkVal
=
`/goods
/commodityMenu
?categoryName=
${
categoryName
}
&categoryId=
${
categoryId
}
`
;
linkVal
=
`/goods
Search/goodsSearch
?categoryName=
${
categoryName
}
&categoryId=
${
categoryId
}
`
;
}
else
{
linkVal
=
`/goods
/commodityMenu
`
;
linkVal
=
`/goods
Search/goodsSearch
`
;
}
}
else
{
linkVal
=
`/pointShop/productList?categoryName=
${
categoryName
}
&categoryId=
${
categoryId
}
`
;
...
...
static/nativeComponents/SharePopup/index.js
View file @
4ac35289
const
app
=
getApp
();
const
{
$themeToLink
}
=
app
;
const
{
$themeToLink
,
processEnv
,
globalData
}
=
app
;
const
componentOptions
=
{
// 组件选项
options
:
{
...
...
@@ -85,7 +85,13 @@ const componentOptions = {
});
},
toPosters
()
{
let
linkVal
=
`/goods/posters`
;
let
userInfo
=
wx
.
getStorageSync
(
"userInfo"
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
"userInfo"
)):
''
;
let
queryHref
=
`
${
processEnv
.
BASE_URL
}
?mixid=
${
globalData
.
shopInfo
.
shopCode
}
`
;
let
linkVal
=
`/goods/posters?type=index&href=
${
queryHref
}
`
;
if
(
userInfo
)
{
linkVal
+=
`&nickname=
${
userInfo
.
nickName
}
`
;
}
console
.
log
(
linkVal
,
"------------------linkVal"
);
$themeToLink
({
type
:
1
,
link
:
linkVal
});
},
},
...
...
static/nativeComponents/VideoPlayer/index.js
0 → 100644
View file @
4ac35289
const
componentOptions
=
{
// 组件选项
options
:
{
multipleSlots
:
true
},
behaviors
:
[],
properties
:
{
datas
:
{
type
:
Object
},
indexs
:
{
type
:
Number
}
},
// 组件数据
data
:
{
isPageHidden
:
false
,
// 页面是否处于隐藏状态
isPlay
:
false
,
videoContext
:
""
,
},
// 数据监听器
observers
:
{},
// 组件方法
methods
:
{
init
()
{},
playVideo
()
{
// 视频播放
if
(
this
.
data
.
datas
.
componentData
[
'nativeControl'
])
{
return
}
let
{
isPlay
}
=
this
.
data
;
if
(
isPlay
)
{
console
.
log
(
"暂停"
)
this
.
videoContext
.
pause
();
}
else
{
console
.
log
(
"播放"
)
this
.
videoContext
.
play
();
}
isPlay
=
!
isPlay
;
this
.
setData
({
isPlay
});
}
},
// 组件生命周期
lifetimes
:
{
created
()
{},
attached
()
{
this
.
init
();
},
ready
()
{
this
.
videoContext
=
wx
.
createVideoContext
(
`videoId
${
this
.
data
.
indexs
}
`
,
this
);
},
moved
()
{},
detached
()
{}
},
definitionFilter
()
{},
// 页面生命周期
pageLifetimes
:
{
// 页面被展示
show
()
{
const
{
isPageHidden
}
=
this
.
data
;
// show事件发生前,页面不是处于隐藏状态时
if
(
!
isPageHidden
)
{
return
;
}
// 重新执行定时器等操作
},
// 页面被隐藏
hide
()
{
this
.
setData
({
isPageHidden
:
true
});
// 清除定时器等操作
},
// 页面尺寸变化时
resize
()
{}
}
};
Component
(
componentOptions
);
static/nativeComponents/VideoPlayer/index.json
0 → 100644
View file @
4ac35289
{
"component"
:
true
,
"usingComponents"
:
{}
}
static/nativeComponents/VideoPlayer/index.wxml
0 → 100644
View file @
4ac35289
<view class="VideoPlayer">
<view class="title" wx:if="{{datas.componentData['title']}}">
<text>{{datas.componentData['title']}}</text>
</view>
<view class="main">
<view class="isVideo" wx:if="{{datas.componentData['type']<3}}">
<video
bindtap="playVideo"
id="videoId{{indexs}}"
src="{{datas.componentData['videoUrl']}}"
show-center-play-btn="{{datas.componentData['nativeControl']}}"
type="video/mp4"
controls="{{datas.componentData['nativeControl']}}"
loop="{{datas.componentData['loopPlay']}}"
poster="{{datas.componentData['poster']}}"
/>
<view
class="playerBtn"
bindtap="playVideo"
wx:if="{{!isPlay&&!datas.componentData['nativeControl']}}"
>
<image src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/06420e41-cd0b-4913-a1ef-9056ceebcc95.png" />
</view>
</view>
<!-- 代码片段展示 -->
<view class="isCodeSnippets" wx:if="{{datas.componentData['type']==3&&datas.componentData['codeSnippet']!=''}}">
<rich-text nodes="{{datas.componentData['codeSnippet']}}"></rich-text>
</view>
</view>
</view>
static/nativeComponents/VideoPlayer/index.wxss
0 → 100644
View file @
4ac35289
.VideoPlayer {
}
.title {
font-size: 36rpx;
padding: 20rpx 40rpx;
color: #333;
font-weight: bold;
}
.main{
width: 100%;
}
.main .isVideo{
width: 100%;
position: relative;
}
.main .isVideo video{
width: 100%;
}
.main .isVideo .playerBtn{
position: absolute;
top: 50%;
left: 50%;
width: 120rpx;
height: 120rpx;
margin-top: -60rpx;
margin-left: -60rpx;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
overflow: hidden;
}
.main .isVideo .playerBtn image{
width: 100%;
height: 100%;
}
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