Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7115df3a
authored
Feb 22, 2020
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
js
parent
c109081c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
11 deletions
src/store/modules/sample/index.js
src/views/sample/sample.vue
view/18.js
view/app.js
src/store/modules/sample/index.js
View file @
7115df3a
...
...
@@ -26,6 +26,8 @@ const mutations = {
state
.
ziYingIndex
=
payload
.
data
;
},
aggs
(
state
,
payload
)
{
var
arr
=
[];
var
obj
=
Object
.
keys
(
payload
.
data
.
aggs
);
...
...
@@ -37,11 +39,19 @@ const mutations = {
for
(
let
i
=
0
;
i
<
payload
.
data
.
aggs
[
k
].
list
.
length
;
i
++
)
{
payload
.
data
.
aggs
[
k
].
list
[
i
].
check
=
false
;
for
(
let
j
=
0
;
j
<
arr
.
length
;
j
++
)
{
if
(
payload
.
data
.
aggs
[
k
].
list
[
i
].
id
==
arr
[
j
])
{
payload
.
data
.
aggs
[
k
].
list
[
i
].
check
=
!
payload
.
data
.
aggs
[
k
].
list
[
i
].
check
;
payload
.
data
.
aggs
[
k
].
list
[
i
].
flag
=
!
payload
.
data
.
aggs
[
k
].
list
[
i
].
flag
;
if
(
payload
.
reset
)
{
payload
.
data
.
aggs
[
k
].
list
[
i
].
check
=
false
;
payload
.
data
.
aggs
[
k
].
list
[
i
].
flag
=
false
;
}
}
}
...
...
@@ -102,7 +112,6 @@ const actions = {
}
else
if
(
data
.
error_code
==
3
)
{
}
else
{
Toast
({
...
...
@@ -141,6 +150,7 @@ const actions = {
commit
({
type
:
'aggs'
,
data
:
data
.
data
,
reset
:
payload
.
params
.
reset
,
id
:
payload
.
params
.
id
});
}
else
{
...
...
src/views/sample/sample.vue
View file @
7115df3a
...
...
@@ -63,7 +63,7 @@
</template>
</ul>
<div
class=
"button"
>
<a
class=
"cancel"
>
重置
</a>
<a
class=
"cancel"
@
click=
"canel()"
>
重置
</a>
<a
class=
"confirm"
@
click=
"submit()"
>
确定
</a>
</div>
</div>
...
...
@@ -89,8 +89,8 @@
{{v.sample_max_number}}
</p>
<div
class=
"btn-wrap clr"
>
<div
class=
"btnw fl"
v-shareMask
>
送朋友
</div>
<div
class=
"btnx fr"
@
click=
"yaoqing(v)"
>
领取样品
</div>
<div
class=
"btnw fl"
v-shareMask
>
送朋友
</div>
<div
class=
"btnx fr"
@
click=
"yaoqing(v)"
>
领取样品
</div>
</div>
</div>
</div>
...
...
@@ -138,7 +138,7 @@
import
wxShare
from
"@/views/common/wxShare.vue"
;
import
{
services
as
Services
}
from
"../../api/index"
;
import
util
from
"../../util/index"
;
import
{
Tab
,
Tabs
,
Lazyload
,
List
,
Toast
,
Swipe
,
SwipeItem
,}
from
"vant"
;
import
{
Tab
,
Tabs
,
Lazyload
,
List
,
Toast
,
Swipe
,
SwipeItem
,}
from
"vant"
;
Vue
.
use
(
Tab
).
use
(
Tabs
).
use
(
Lazyload
).
use
(
Toast
).
use
(
Swipe
).
use
(
SwipeItem
);
...
...
@@ -146,7 +146,7 @@
name
:
"sample"
,
data
()
{
return
{
bannerHeight
:
173
,
bannerHeight
:
173
,
title
:
"猎芯网-自营样片"
,
meaushow
:
true
,
bgcolor
:
"#fafafa"
,
...
...
@@ -157,7 +157,7 @@
getPop
:
false
,
//获得机会弹窗,没机会时展示
getPops
:
false
,
quota
:
''
,
finished
:
false
,
finished
:
false
,
quotaNum
:
''
,
loadingYp
:
false
,
applyCount
:
0
,
...
...
@@ -226,7 +226,7 @@
this
.
$store
.
dispatch
({
type
:
"ziYingIndex"
,
params
:
{
'sample_class_id/eq'
:
1
}
params
:
{
'sample_class_id/eq'
:
1
}
});
this
.
$store
.
dispatch
({
...
...
@@ -266,13 +266,13 @@
this
.
$store
.
dispatch
({
type
:
"ziYingIndex"
,
params
:
{
'sample_class_id/eq'
:
name
}
params
:
{
'sample_class_id/eq'
:
name
}
});
},
onLoad
()
{
this
.
p
++
;
this
.
finished
=
true
;
this
.
finished
=
true
;
},
getuserf
()
{
this
.
getPop
=
false
;
...
...
@@ -300,6 +300,15 @@
this
.
layer
=
false
;
},
canel
:
function
()
{
let
params
=
Object
.
assign
({},
{
reset
:
true
,
'sample_class_id/eq'
:
this
.
sample_class_id
},
this
.
brand_id
,
this
.
packing
,
this
.
encap
,
this
.
attrs
,
{
id
:
this
.
id
.
join
(
','
)});
this
.
$store
.
dispatch
({
type
:
"aggs"
,
params
:
params
});
},
screenFn
:
function
(
id
,
key
,
flag
)
{
if
(
key
==
'brand_id'
)
{
...
...
@@ -389,7 +398,7 @@
return
;
}
else
{
var
stock
=
util
.
aggxde
(
item
.
stock
);
var
stock
=
util
.
aggxde
(
item
.
stock
);
if
(
this
.
applyCount
!=
0
)
{
if
(
stock
)
{
...
...
view/18.js
View file @
7115df3a
This diff is collapsed.
Click to expand it.
view/app.js
View file @
7115df3a
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