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
80835d6b
Commit
80835d6b
authored
Dec 17, 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
583f8625
16b149b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
1 deletions
+77
-1
src/components/custom-list/index.vue
+71
-0
src/pages/home/index.vue
+6
-1
No files found.
src/components/custom-list/index.vue
0 → 100644
View file @
80835d6b
<
template
>
<!-- 自定义列表 -->
<div
class=
"customList"
:style=
"
{'padding':padding+'px','margin': margin+'px','border-radius': borderRadius + 'px','background':backgroundColor}">
<div
v-for=
"(item,index) in 4"
:key=
"index"
@
click=
"itemClick(item,index)"
>
<rich-text
:nodes=
"comStr"
></rich-text>
</div>
</div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
function
compiler
(
str
,
data
)
{
//正则表达式 .+匹配{{}}所有字符 ?取消贪婪 g全局
let
regulation
=
/
\{\{(
.+
?)\}\}
/g
;
str
=
str
.
replace
(
regulation
,
function
(
_
,
val
)
{
let
key
=
val
.
trim
();
//调用 对象嵌套函数
let
value
=
data
[
key
];
return
value
;
});
return
str
;
}
import
Vue
from
"vue"
;
export
default
{
name
:
"custom-list"
,
props
:
{
render
:
{
type
:
Boolean
,
default
:
false
,
},
datas
:
{
type
:
Object
,
default
:
()
=>
{
return
{};
},
},
},
data
()
{
return
{};
},
computed
:{
comStr
(){
return
compiler
(
this
.
datas
.
componentData
.
comStr
,
this
.
datas
.
componentData
.
comData
);
},
padding
()
{
return
this
.
datas
.
componentData
.
padding
;
},
margin
()
{
return
this
.
datas
.
componentData
.
margin
;
},
borderRadius
()
{
return
this
.
datas
.
componentData
.
borderRadius
;
},
backgroundColor
()
{
return
this
.
datas
.
componentData
.
backgroundColor
;
},
},
created
()
{},
mounted
()
{},
methods
:{
itemClick
(
item
,
index
){
eval
(
this
.
datas
.
componentData
.
comMethods
)
}
},
components
:
{},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.customList
{
}
</
style
>
src/pages/home/index.vue
View file @
80835d6b
...
@@ -93,6 +93,9 @@
...
@@ -93,6 +93,9 @@
<div
v-if=
"item.componentCode == 'wo-timeout' && item.componentInfo.visible == 1"
>
<div
v-if=
"item.componentCode == 'wo-timeout' && item.componentInfo.visible == 1"
>
<wo-timeout
:datas=
"item"
></wo-timeout>
<wo-timeout
:datas=
"item"
></wo-timeout>
</div>
</div>
<!--
<div
v-if=
"item.componentCode == 'custom-list' && item.componentInfo.visible == 1"
>
<custom-list
:datas=
"item"
></custom-list>
</div>
-->
</div>
</div>
<bottomCont></bottomCont>
<bottomCont></bottomCont>
...
@@ -145,6 +148,7 @@ import birth from '@/api/popup'
...
@@ -145,6 +148,7 @@ import birth from '@/api/popup'
import
couponPopup
from
'@/components/couponPopup.vue'
import
couponPopup
from
'@/components/couponPopup.vue'
import
NewUser
from
"../../components/newCustomer/newUser"
;
import
NewUser
from
"../../components/newCustomer/newUser"
;
import
NewPolite
from
"../../components/newCustomer/newPolite"
;
import
NewPolite
from
"../../components/newCustomer/newPolite"
;
import
customList
from
"../../components/custom-list"
;
import
{
setTabBarActive
,
checkTabbarPage
,
themeColor
,
checkShowConditionIds
}
from
"../../utils/mayi.js"
;
import
{
setTabBarActive
,
checkTabbarPage
,
themeColor
,
checkShowConditionIds
}
from
"../../utils/mayi.js"
;
import
indexApi
from
"@/api/index.js"
;
import
indexApi
from
"@/api/index.js"
;
import
{
throttle
,
concatUrl
}
from
"../../utils/index.js"
import
{
throttle
,
concatUrl
}
from
"../../utils/index.js"
...
@@ -200,7 +204,8 @@ export default {
...
@@ -200,7 +204,8 @@ export default {
NewPolite
,
NewPolite
,
birthPopup
,
birthPopup
,
mpvueCropper
,
mpvueCropper
,
woTimeout
woTimeout
,
'custom-list'
:
customList
},
},
onShareAppMessage
(
res
)
{
onShareAppMessage
(
res
)
{
let
{
shopCode
}
=
app
.
globalData
.
shopInfo
;
let
{
shopCode
}
=
app
.
globalData
.
shopInfo
;
...
...
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