Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
ybf
Project
Project
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
xulili
ybf
Commits
02f5c0ea
Commit
02f5c0ea
authored
5 years ago
by
xd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面轮播图 以及修改轮播图多图上传测试
parent
9224f37c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
28 deletions
+54
-28
index.html
wx_application/public/counterPageHome/index.html
+8
-8
counterEdit.vue
wx_application/src/views/counter/counterEdit.vue
+42
-16
index.vue
wx_application/src/views/mainSale/active/main/index.vue
+4
-4
No files found.
wx_application/public/counterPageHome/index.html
View file @
02f5c0ea
...
...
@@ -126,6 +126,8 @@
pagination
:
{
el
:
'.swiper-pagination'
,
},
observer
:
true
,
observeParents
:
true
})
$
(
function
()
{
showQRInfo
()
...
...
@@ -134,19 +136,17 @@
$
.
ajax
({
type
:
'GET'
,
url
:
`http://139.155.48.151:8084/admin/auth/stall/getByOyStallCode?oyStallCode=
${
oyStallCode
}
`
,
// url: `http://139.155.48.151:8084/admin/auth/stall/getByOyStallCode?oyStallCode=1`,
success
:
function
(
data
)
{
console
.
log
(
data
,
'data'
)
var
str
=
""
;
for
(
i
=
0
;
i
<
data
.
data
.
carousel
.
length
;
i
++
)
{
var
_data
=
data
.
data
.
carousel
[
i
]
str
+=
'<div class="swiper-slide"><img src="'
+
_data
+
'" alt=""></div>'
for
(
i
=
0
;
i
<
data
.
data
.
carousel
.
length
;
i
++
)
{
var
_data
=
data
.
data
.
carousel
[
i
]
str
+=
'<div class="swiper-slide"><img src="'
+
_data
+
'" alt=""></div>'
}
$
(
"#slider"
).
append
(
str
)
var
mySwiper
=
new
Swiper
(
'.swiper-container'
,
{
loop
:
true
,
autoplay
:
true
,
pagination
:
'.swiper-pagination'
,
})
let
r1
=
document
.
getElementById
(
'slider'
).
innerHTML
let
r
=
document
.
getElementById
(
'slider'
).
innerHTML
let
info
=
data
.
data
.
stallInfo
$
(
"#logo"
).
attr
(
'src'
,
info
.
logo
)
$
(
".title"
).
text
(
info
.
name
)
...
...
This diff is collapsed.
Click to expand it.
wx_application/src/views/counter/counterEdit.vue
View file @
02f5c0ea
...
...
@@ -57,6 +57,7 @@
:before-read=
"beforeRead"
:after-read=
"afterAddBanner"
@
delete=
"deleteBanner"
multiple=
"true"
/>
<quill-editor
v-model=
"addForm.summary"
...
...
@@ -170,11 +171,25 @@ export default {
this
.
$emit
(
"input"
,
this
.
addForm
.
summary
);
},
beforeRead
(
file
)
{
//上传之前校验
if
(
file
.
type
!==
"image/jpeg"
&&
file
.
type
!==
"image/png"
)
{
this
.
$toast
(
"只允许上传jpg/png格式的图片!"
)
return
false
;
if
(
file
.
type
)
{
if
(
file
.
type
!==
"image/jpeg"
&&
file
.
type
!==
"image/png"
)
{
this
.
$toast
(
"只允许上传jpg/png格式的图片!"
)
return
false
;
}
}
else
{
console
.
log
(
222
);
file
.
forEach
(
item
=>
{
if
(
item
.
type
!==
"image/jpeg"
&&
item
.
type
!==
"image/png"
)
{
this
.
$toast
(
"只允许上传jpg/png格式的图片!"
)
}
})
// console.log(file,'file');
// console.log(file.type,'file.type');
}
//上传之前校验
return
true
;
},
async
afterRead
(
file
)
{
...
...
@@ -183,18 +198,27 @@ export default {
console
.
log
(
this
.
addForm
.
logo
,
"this.addForm.logo"
);
},
async
getImgUrl
(
file
)
{
let
params
=
new
FormData
();
params
.
append
(
"file"
,
file
);
let
url
=
"http://139.155.48.151:8084/admin/auth/util/saveImg"
;
const
img
=
await
axios
.
post
(
url
,
params
);
let
params
=
new
FormData
()
params
.
append
(
"file"
,
file
)
let
url
=
"http://139.155.48.151:8084/admin/auth/util/saveImg"
const
img
=
await
axios
.
post
(
url
,
params
)
let
urls
=
img
.
data
.
data
.
imgPath
;
console
.
log
(
urls
,
"urls"
);
return
urls
;
},
async
afterAddBanner
(
file
)
{
let
img
=
await
this
.
getImgUrl
(
file
.
file
);
this
.
list
.
push
(
img
);
console
.
log
(
this
.
list
,
"list"
);
if
(
file
.
file
)
{
let
img
=
await
this
.
getImgUrl
(
file
.
file
);
this
.
list
.
push
(
img
);
}
else
{
file
.
forEach
(
async
item
=>
{
let
imgs
=
await
this
.
getImgUrl
(
item
.
file
)
this
.
list
.
push
(
imgs
);
console
.
log
(
this
.
list
,
'list1'
)
})
}
},
deleteBanner
(
file
,
index
)
{
this
.
list
.
splice
(
index
.
index
,
1
);
...
...
@@ -230,11 +254,13 @@ export default {
this
.
$toast
(
"请输入正文"
)
return
false
}
editStore
(
Object
.
assign
(
this
.
addForm
,{
carousel
})).
then
(
res
=>
{
if
(
res
.
result
==
'success'
)
{
this
.
$router
.
go
(
-
1
)
}
})
console
.
log
(
Object
.
assign
(
this
.
addForm
,{
carousel
}),
'11'
);
editStore
(
Object
.
assign
(
this
.
addForm
,{
carousel
})).
then
(
res
=>
{
if
(
res
.
result
==
'success'
)
{
this
.
$router
.
go
(
-
1
)
}
})
}
}
};
...
...
This diff is collapsed.
Click to expand it.
wx_application/src/views/mainSale/active/main/index.vue
View file @
02f5c0ea
...
...
@@ -5,7 +5,7 @@
<img
class=
"logos-logo"
:src=
"test.manInfo.logoUrl"
/>
</div>
<div
class=
"manInfo-name"
@
click=
"manInfoClick"
>
我的专柜:
{{
test
.
manInfo
.
barName
}}
</div>
<div
class=
"manInfo-switch"
@
click=
"switchBarClick"
>
<div
class=
"manInfo-switch"
@
click=
"switchBarClick"
v-if=
"flag == 1"
>
<div
class=
"switch-text"
>
切换
</div>
<img
class=
"switch-icon"
:src=
"test.manInfo.icon['1']"
/>
</div>
...
...
@@ -26,7 +26,7 @@
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['2']"
/>
<div
class=
"menu-text"
>
任务列表
</div>
</div>
<div
class=
"menu"
@
click=
"menu05Click"
v-if=
"flag == 1"
>
<div
class=
"menu
margin1
"
@
click=
"menu05Click"
v-if=
"flag == 1"
>
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['5']"
/>
<div
class=
"menu-text"
>
活动模版
</div>
</div>
...
...
@@ -40,7 +40,7 @@
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['4']"
/>
<div
class=
"menu-text"
>
专柜维护
</div>
</div>
<div
class=
"menu"
@
click=
"handleCoupon"
v-if=
"flag == 1"
>
<div
class=
"menu
margin2
"
@
click=
"handleCoupon"
v-if=
"flag == 1"
>
<img
class=
"menu-logo"
:src=
"test.menuInfo.icon['1']"
/>
<div
class=
"menu-text"
>
优惠券管理
</div>
</div>
...
...
@@ -218,7 +218,7 @@ export default {
userInfoResOld
:
""
,
userInfoResNew
:
""
},
flag
:
1
flag
:
2
};
},
created
()
{
...
...
This diff is collapsed.
Click to expand it.
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