Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
ming-order
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
ming-order
Commits
a6022fbb
Commit
a6022fbb
authored
Oct 18, 2019
by
fengzhaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MOD:预加载
parent
7a76d31d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
35 deletions
+65
-35
workspace.xml
.idea/workspace.xml
+6
-4
null.png
img/null.png
+0
-0
menu.html
menu.html
+59
-31
No files found.
.idea/workspace.xml
View file @
a6022fbb
...
@@ -2,10 +2,8 @@
...
@@ -2,10 +2,8 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"3f11f0c2-4f1a-448b-9322-b444722d73f2"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
id=
"3f11f0c2-4f1a-448b-9322-b444722d73f2"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/img/noClassification.png"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/img/null.png"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/vcs.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/vcs.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/css/index.css"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/css/index.css"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/menu.html"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/menu.html"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/menu.html"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/menu.html"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
...
@@ -81,7 +79,11 @@
...
@@ -81,7 +79,11 @@
<workItem
from=
"1570843686159"
duration=
"23451000"
/>
<workItem
from=
"1570843686159"
duration=
"23451000"
/>
<workItem
from=
"1571017846901"
duration=
"8561000"
/>
<workItem
from=
"1571017846901"
duration=
"8561000"
/>
<workItem
from=
"1571102112992"
duration=
"17373000"
/>
<workItem
from=
"1571102112992"
duration=
"17373000"
/>
<workItem
from=
"1571188950681"
duration=
"581000"
/>
<workItem
from=
"1571188950681"
duration=
"3097000"
/>
<workItem
from=
"1571275786297"
duration=
"2522000"
/>
<workItem
from=
"1571285097218"
duration=
"20273000"
/>
<workItem
from=
"1571371461255"
duration=
"4370000"
/>
<workItem
from=
"1571383513641"
duration=
"738000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
...
...
img/null.png
0 → 100644
View file @
a6022fbb
967 Bytes
menu.html
View file @
a6022fbb
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<ul
v-if=
"isProduct"
>
<ul
v-if=
"isProduct"
>
<li
v-for=
"(menu,index) in defaultProduct"
:key=
"menu.productId"
@
click=
"addCar(menu,index)"
v-cloak
>
<li
v-for=
"(menu,index) in defaultProduct"
:key=
"menu.productId"
@
click=
"addCar(menu,index)"
v-cloak
>
<div
class=
"imgContainer"
>
<div
class=
"imgContainer"
>
<img
:src=
'menu.productIcon'
alt=
"
"
>
<img
:src=
'url'
alt=
""
ref=
"img
"
>
</div>
</div>
<div
class=
"name"
>
{{menu.productName}}
</div>
<div
class=
"name"
>
{{menu.productName}}
</div>
<div
class=
"price"
>
¥{{menu.productPrice}}
</div>
<div
class=
"price"
>
¥{{menu.productPrice}}
</div>
...
@@ -78,11 +78,10 @@
...
@@ -78,11 +78,10 @@
</div>
</div>
</body>
</body>
<script>
<script>
// 获取orgId
// 获取orgId
//
var orgId = window.android.getOrgId()
var
orgId
=
window
.
android
.
getOrgId
()
//
localStorage.setItem('orgId',orgId)
localStorage
.
setItem
(
'orgId'
,
orgId
)
localStorage
.
setItem
(
'orgId'
,
'ding9ddd48137390507735c2f4657eb6378f'
)
//
localStorage.setItem('orgId','ding9ddd48137390507735c2f4657eb6378f')
// axios.defaults.baseURL = 'http://192.168.1.101:9999/mingpay-phone' // 本地钱
// axios.defaults.baseURL = 'http://192.168.1.101:9999/mingpay-phone' // 本地钱
axios
.
defaults
.
baseURL
=
'https://gateway.mingwork.com/mingpay-phone'
// beta环境
axios
.
defaults
.
baseURL
=
'https://gateway.mingwork.com/mingpay-phone'
// beta环境
...
@@ -102,7 +101,6 @@
...
@@ -102,7 +101,6 @@
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
return
reject
(
res
)
return
reject
(
res
)
});
});
}))
}))
}
}
}
}
...
@@ -112,13 +110,15 @@
...
@@ -112,13 +110,15 @@
var
order
=
new
Vue
({
var
order
=
new
Vue
({
el
:
'#gen'
,
el
:
'#gen'
,
data
:
{
data
:
{
url
:
'img/null.png'
,
urls
:
[],
categorys
:
[],
// 菜单分类
categorys
:
[],
// 菜单分类
defaultProduct
:
[],
// 默认展示的菜
defaultProduct
:
[],
// 默认展示的菜
selectIndex
:
'0'
,
// 左侧选中类别的index,用来做选项卡判断
selectIndex
:
'0'
,
// 左侧选中类别的index,用来做选项卡判断
selectStyle
:
{
selectStyle
:
{
'font-family'
:
'PingFangSC-Medium'
,
'font-family'
:
'PingFangSC-Medium'
,
'border-right'
:
'5px solid red'
,
'border-right'
:
'5px solid red'
,
'background-color'
:
' #FF
EDED
'
,
'background-color'
:
' #FF
DEDE
'
,
'color'
:
' #E60012'
'color'
:
' #E60012'
},
//左侧菜单分类列表选中时的样式
},
//左侧菜单分类列表选中时的样式
carList
:
[],
// 所有加入购物车的列表数据
carList
:
[],
// 所有加入购物车的列表数据
...
@@ -144,8 +144,6 @@
...
@@ -144,8 +144,6 @@
if
(
this
.
categorys
.
length
!=
0
)
{
if
(
this
.
categorys
.
length
!=
0
)
{
return
this
.
$http
.
request
(
'/v1/product/list_product'
,
'post'
,{
productCategoryId
:
this
.
categorys
[
0
].
productCategoryId
})
return
this
.
$http
.
request
(
'/v1/product/list_product'
,
'post'
,{
productCategoryId
:
this
.
categorys
[
0
].
productCategoryId
})
.
then
(
e
=>
{
.
then
(
e
=>
{
console
.
log
(
e
.
data
.
data
,
111111111
)
if
(
e
.
data
.
data
.
length
!=
0
)
{
if
(
e
.
data
.
data
.
length
!=
0
)
{
this
.
isProduct
=
true
this
.
isProduct
=
true
e
.
data
.
data
.
forEach
((
product
)
=>
{
e
.
data
.
data
.
forEach
((
product
)
=>
{
...
@@ -153,7 +151,9 @@
...
@@ -153,7 +151,9 @@
if
(
product
.
productStatus
==
'UP'
)
{
if
(
product
.
productStatus
==
'UP'
)
{
this
.
defaultProduct
.
push
(
product
)
this
.
defaultProduct
.
push
(
product
)
}
}
})
})
this
.
preLoad
(
this
.
defaultProduct
)
}
}
else
{
else
{
this
.
isProduct
=
false
this
.
isProduct
=
false
...
@@ -170,30 +170,45 @@
...
@@ -170,30 +170,45 @@
},
},
mounted
()
{
mounted
()
{
window
.
clearCar
=
this
.
clearCar
window
.
clearCar
=
this
.
clearCar
const
that
=
this
setTimeout
(
function
(
res
)
{
var
product
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
defaultProduct
))
product
.
forEach
((
item
,
index
)
=>
{
var
img
=
new
Image
()
var
urls
=
[]
urls
[
index
]
=
item
.
productIcon
img
.
src
=
urls
[
index
]
img
.
onload
=
function
()
{
that
.
$refs
.
img
[
index
].
src
=
urls
[
index
]
}
})
},
500
)
},
},
methods
:{
methods
:{
// 选菜的类别的点击事件
// 选菜的类别的点击事件
selectClass
:
function
(
menu
,
index
)
{
selectClass
:
function
(
menu
,
index
)
{
this
.
selectIndex
=
index
if
(
this
.
selectIndex
!=
index
)
{
this
.
defaultProduct
=
[]
this
.
selectIndex
=
index
this
.
$http
.
request
(
'/v1/product/list_product'
,
'post'
,{
productCategoryId
:
menu
.
productCategoryId
})
this
.
defaultProduct
=
[]
.
then
(
res
=>
{
this
.
$http
.
request
(
'/v1/product/list_product'
,
'post'
,{
productCategoryId
:
menu
.
productCategoryId
})
if
(
res
.
data
.
data
.
length
!=
0
)
{
.
then
(
res
=>
{
this
.
isProduct
=
true
if
(
res
.
data
.
data
.
length
!=
0
)
{
res
.
data
.
data
.
forEach
(
product
=>
{
this
.
isProduct
=
true
if
(
product
.
productStatus
==
'UP'
)
{
res
.
data
.
data
.
forEach
(
product
=>
{
this
.
defaultProduct
.
push
(
product
)
if
(
product
.
productStatus
==
'UP'
)
{
}
this
.
defaultProduct
.
push
(
product
)
})
}
}
})
else
{
this
.
preLoad
(
this
.
defaultProduct
)
this
.
isProduct
=
false
}
}
else
{
this
.
isProduct
=
false
})
}
.
catch
(
err
=>
{
})
console
.
log
(
err
)
.
catch
(
err
=>
{
})
console
.
log
(
err
)
})
}
},
},
// 点击加入购物车列表e
// 点击加入购物车列表e
addCar
:
function
(
e
)
{
addCar
:
function
(
e
)
{
...
@@ -264,9 +279,22 @@
...
@@ -264,9 +279,22 @@
})
})
// 向设备端发送详情账单
// 向设备端发送详情账单
window
.
android
.
pay
(
JSON
.
stringify
(
setData
),
this
.
allPrice
)
window
.
android
.
pay
(
JSON
.
stringify
(
setData
),
this
.
allPrice
)
},
preLoad
:
function
(
product
)
{
product
.
forEach
((
item
,
index
)
=>
{
const
that
=
this
var
img
=
new
Image
()
var
urls
=
[]
urls
[
index
]
=
item
.
productIcon
img
.
src
=
urls
[
index
]
img
.
onload
=
function
()
{
setTimeout
(
function
()
{
that
.
$refs
.
img
[
index
].
src
=
urls
[
index
]
},
500
)
}
})
}
}
}
},
})
})
</script>
</script>
...
...
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