Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
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
viitto
mallapp
Commits
3bc75e2d
Commit
3bc75e2d
authored
Jan 14, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a3770fd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
300 additions
and
4 deletions
+300
-4
goodsku.vue
components/goods/goodsku.vue
+50
-1
activitylist.vue
pages/friendcircle/activitylist.vue
+248
-1
index.vue
pages/index/index.vue
+2
-2
No files found.
components/goods/goodsku.vue
View file @
3bc75e2d
...
@@ -35,13 +35,18 @@
...
@@ -35,13 +35,18 @@
<text
class=
"label"
>
购买数量
</text>
<text
class=
"label"
>
购买数量
</text>
<u-number-box
:disabled=
"!skuObj"
v-model=
"gc"
:min=
"1"
:max=
"goodamount"
@
change=
"valChange"
></u-number-box>
<u-number-box
:disabled=
"!skuObj"
v-model=
"gc"
:min=
"1"
:max=
"goodamount"
@
change=
"valChange"
></u-number-box>
</view>
</view>
<view
class=
"btn-box"
v-if=
"g.totalStock>0&& g.status==1"
>
<
!--
<
view
class=
"btn-box"
v-if=
"g.totalStock>0&& g.status==1"
>
<view
style=
"flex: 1;"
v-if=
"optionType != 1"
>
<view
style=
"flex: 1;"
v-if=
"optionType != 1"
>
<u-button
@
click=
"joinCar"
:ripple=
"true"
:hair-line=
"false"
:custom-style=
"btn1"
>
加入购物车
</u-button>
<u-button
@
click=
"joinCar"
:ripple=
"true"
:hair-line=
"false"
:custom-style=
"btn1"
>
加入购物车
</u-button>
</view>
</view>
<view
style=
"flex: 1;"
v-if=
"optionType != 0"
>
<view
style=
"flex: 1;"
v-if=
"optionType != 0"
>
<u-button
@
click=
"buy"
:ripple=
"true"
:hair-line=
"false"
:custom-style=
"btn2"
>
立即购买
</u-button>
<u-button
@
click=
"buy"
:ripple=
"true"
:hair-line=
"false"
:custom-style=
"btn2"
>
立即购买
</u-button>
</view>
</view>
</view>
-->
<view
class=
"btn-box"
v-if=
"g.totalStock>0&& g.status==1"
>
<view
style=
"flex: 1;"
>
<u-button
:ripple=
"true"
:hair-line=
"false"
:custom-style=
"btn4"
@
click=
'signup'
>
立即报名
</u-button>
</view>
</view>
</view>
<view
class=
"btn-box"
v-if=
"g.totalStock==0"
>
<view
class=
"btn-box"
v-if=
"g.totalStock==0"
>
<view
style=
"flex: 1;"
>
<view
style=
"flex: 1;"
>
...
@@ -129,6 +134,15 @@
...
@@ -129,6 +134,15 @@
width
:
'100%'
,
width
:
'100%'
,
background
:
'#ababab'
background
:
'#ababab'
},
},
btn4
:
{
flex
:
1
,
height
:
'100%'
,
borderRadius
:
'40px'
,
border
:
'none'
,
color
:
'#FFF'
,
fontSize
:
'13px'
,
width
:
'100%'
},
sku
:
''
,
sku
:
''
,
g
:
{},
g
:
{},
skuObj
:
null
,
skuObj
:
null
,
...
@@ -178,6 +192,7 @@
...
@@ -178,6 +192,7 @@
this
.
bian
=
this
.
$utils
.
is_biang
;
this
.
bian
=
this
.
$utils
.
is_biang
;
this
.
btn1
.
background
=
this
.
secondary
;
this
.
btn1
.
background
=
this
.
secondary
;
this
.
btn2
.
background
=
this
.
mc
;
this
.
btn2
.
background
=
this
.
mc
;
this
.
btn4
.
background
=
this
.
mc
;
if
(
this
.
optionType
==
2
)
{
if
(
this
.
optionType
==
2
)
{
this
.
btn1
.
borderRadius
=
'40px 0 0 40px'
;
this
.
btn1
.
borderRadius
=
'40px 0 0 40px'
;
this
.
btn2
.
borderRadius
=
'0 40px 40px 0'
;
this
.
btn2
.
borderRadius
=
'0 40px 40px 0'
;
...
@@ -305,6 +320,40 @@
...
@@ -305,6 +320,40 @@
});
});
}
}
},
},
signup
(){
//教育报名
let
ShoppingCartIdList
=
[];
if
(
this
.
skuObj
&&
this
.
skuObj
.
id
)
{
let
good
=
{
DetailList
:
[],
Use_Integral
:
0
,
User_Coupon_Id
:
0
,
DeliveryMethod
:
0
,
AddressId
:
0
};
let
g
=
{
GoodsId
:
this
.
skuObj
.
goods_id
,
Number
:
this
.
gc
,
SpecificationSort
:
this
.
skuObj
.
sign_id
};
good
.
DetailList
.
push
(
g
);
uni
.
navigateTo
({
url
:
'/pages/order-submit/education-submit?formData='
+
encodeURIComponent
(
JSON
.
stringify
(
good
))
+
'&IsFormShoppingCart=2&ShoppingCartIdList='
+
JSON
.
stringify
(
ShoppingCartIdList
),
complete
(
res
)
{
console
.
log
(
res
);
}
});
}
else
{
uni
.
showToast
({
title
:
'请选择商品'
,
position
:
'bottom'
,
icon
:
'none'
,
duration
:
2000
});
}
},
//关闭弹窗
//关闭弹窗
cloGood
()
{
cloGood
()
{
this
.
popupClose
();
this
.
popupClose
();
...
...
pages/friendcircle/activitylist.vue
View file @
3bc75e2d
<
template
>
<
template
>
<view
class=
"activitylist"
:style=
"
{ height: contentHeight }">
<u-tabs
:list=
"list"
:is-scroll=
"false"
:current=
"current"
@
change=
"change"
:active-color=
"mainColor"
></u-tabs>
<view
class=
"activitylist-top"
>
<text
style=
"font-weight: bold;"
>
推荐优惠活动
</text>
<view
class=
"a-top-r"
style=
"display: flex;flex-direction: row;align-items: center;"
>
<text
style=
"margin-right: 5px;"
>
我的奖励
</text>
<u-icon
name=
"arrow"
:size=
"20"
color=
"#A5A4AC"
></u-icon>
</view>
</view>
<u-empty
v-if=
"g.length == 0"
text=
"暂无活动列表"
mode=
"list"
></u-empty>
<view
v-if=
"g.length > 0"
style=
"height: calc(100vh - 100px);width: calc(100vw);overflow: hidden; "
>
<scroll-view
:scroll-y=
"true"
:enable-back-to-top=
"true"
:enable-flex=
"true"
@
scrolltolower=
"lower"
:style=
"
{ height: '100%' }">
<view
class=
"interDList"
>
<view
class=
"inter-item"
v-for=
"(x, i) in g"
:key=
"i"
>
<view
style=
"width: 100%;height: 190px;border-top-left-radius: 6px;border-top-right-radius: 6px;position: relative;"
>
<image
:src=
"x.CoverImage"
mode=
'aspectFill'
style=
"width: 100%;height: 190px;;border-top-left-radius: 6px;border-top-right-radius: 6px;"
></image>
<view
class=
"imgview"
v-if=
"x.IsFinish==1 && x.SurplusDay!=0"
style=
"background: #CCCCCC;color: #777777;"
>
活动已完成
</view>
<view
class=
"imgview"
v-if=
"x.IsFinish==2 && x.SurplusDay!=0"
:style=
"
{background:mainColor,color:'#FFF'}">距离活动结束还有
{{
x
.
SurplusDay
}}
天
</view>
<view
class=
"imgview"
v-if=
" x.SurplusDay==0"
style=
"background: #CCCCCC;color: #777777;"
>
活动已结束
{{
x
.
SurplusDay
}}
天
</view>
</view>
<view
class=
"inter-item-title"
>
{{
x
.
ActivityName
}}
</view>
<view
style=
"padding: 0 15px 15px;"
>
<u-line-progress
:active-color=
"mainColor"
:percent=
"calculation(x)"
height=
'6'
:show-percent=
"false"
></u-line-progress>
<text
style=
"margin-top: 5px;font-size: 10px;color: #111111;"
>
当前进度
{{
calculation
(
x
)
}}
%
</text>
</view>
</view>
</view>
<u-loadmore
:status=
"status"
:load-text=
"loadText"
:font-size=
"24"
:margin-top=
"20"
:margin-bottom=
"20"
bg-color=
"#FAF8F9"
/>
</scroll-view>
</view>
<!-- 加载中 -->
<view
class=
"loading"
v-if=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
>
>
</u-loading>
<Text
style=
"color: #fff; margin-top: 10rpx;"
>
加载中...
</Text>
</view>
<!-- 取消提示 -->
<u-toast
ref=
"uToast"
/>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
'gbAuth'
></auth>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
auth
from
"@/components/auth/index.vue"
;
export
default
{
components
:
{
auth
},
data
()
{
return
{
pageTitle
:
"积分明细"
,
current
:
0
,
list
:
[{
name
:
"进行中"
},
{
name
:
"已结束"
},
],
showAuth
:
false
,
msg
:
{
pageIndex
:
1
,
pageSize
:
10
,
QActivityState
:
0
},
mainColor
:
""
,
secondary
:
''
,
contentHeight
:
0
,
page
:
1
,
page_count
:
1
,
g
:
[],
loading
:
false
,
isover
:
false
,
status
:
"loadmore"
,
loadText
:
{
loadmore
:
"轻轻上拉,加载更多"
,
loading
:
"努力加载中"
,
nomore
:
"没有更多了"
,
},
};
},
created
()
{
this
.
contentHeight
=
this
.
$utils
.
calcContentHeight
(
-
40
)
+
"px"
;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
secondary
=
this
.
$uiConfig
.
secondary
;
},
mounted
()
{
let
currentPages
=
getCurrentPages
();
let
u
=
"/"
+
currentPages
[
currentPages
.
length
-
1
].
route
;
let
pages
=
wx
.
getStorageSync
(
"basedata"
)
?
wx
.
getStorageSync
(
"basedata"
).
bar_title
:
[];
pages
.
forEach
((
x
)
=>
{
if
(
x
.
value
==
u
)
{
this
.
pageTitle
=
x
.
new_name
?
x
.
new_name
:
x
.
name
;
}
});
uni
.
setNavigationBarTitle
({
title
:
this
.
pageTitle
,
});
},
onLoad
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
avatarUrl
:
""
};
this
.
showAuth
=
true
;
}
else
{
this
.
init
();
}
},
methods
:
{
change
(
index
)
{
this
.
current
=
index
;
this
.
msg
.
pageIndex
=
1
;
this
.
g
=
[];
this
.
loading
=
true
;
this
.
init
();
},
init
()
{
this
.
loading
=
true
;
this
.
msg
.
QActivityState
=
this
.
current
+
1
this
.
request2
({
url
:
'/api/AppletOrder/GetGoodsActivityPageList'
,
data
:
this
.
msg
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
loading
=
false
;
this
.
g
=
this
.
g
.
concat
(
res
.
data
.
pageData
);
this
.
page_count
=
res
.
data
.
pageCount
;
if
(
this
.
page_count
==
1
)
{
this
.
status
=
"nomore"
;
}
}
}
);
},
lower
(
e
)
{
if
(
this
.
msg
.
pageIndex
<
this
.
page_count
)
{
this
.
msg
.
pageIndex
++
;
this
.
status
=
"loading"
;
this
.
init
();
}
else
{
this
.
status
=
"nomore"
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
this
.
init
();
},
//关闭登录窗口
gbAuth
()
{
uni
.
navigateBack
()
},
calculation
(
x
){
let
percent
=
0
if
(
x
.
Type
==
1
){
//计算完成率
percent
=
(
x
.
MyOrderNum
/
x
.
OrderNum
)
*
100
}
else
if
(
x
.
Type
==
2
){
percent
=
(
x
.
MyOrderMoney
/
x
.
OrderMoney
)
*
100
}
else
if
(
x
.
Type
==
3
){
percent
=
(
x
.
MyGoodsNum
/
x
.
GoodsNum
)
*
100
}
if
(
x
.
IsFinish
==
1
){
//如果完成了直接是百分百
percent
=
100
}
else
{
percent
.
toFixed
(
2
)
}
return
percent
}
},
};
</
script
>
</
script
>
<
style
>
<
style
>
.activitylist
{
width
:
100%
;
height
:
100%
;
background
:
#FAF8F9
;
}
.activitylist
.loading
{
width
:
200
rpx
;
height
:
200
rpx
;
background
:
#000000
;
opacity
:
0.7
;
border-radius
:
10
rpx
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
position
:
fixed
;
left
:
50%
;
top
:
30%
;
margin-left
:
-100
rpx
;
z-index
:
999
;
}
.activitylist
.interDList
{
width
:
100%
;
padding
:
0
15px
;
}
.inter-item
{
width
:
100%
;
border-radius
:
6px
;
margin-top
:
15px
;
background
:
#FFF
;
box-shadow
:
0
6px
10px
1px
#F2F2F2
;
}
.activitylist
.activitylist-top
{
width
:
100%
;
height
:
50px
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
0
15px
;
font-size
:
15px
;
color
:
#111111
;
}
.activitylist
.a-top-r
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
font-size
:
12px
;
}
.activitylist
.imgview
{
height
:
22px
;
border-radius
:
2px
;
font-size
:
11px
;
position
:
absolute
;
right
:
20px
;
bottom
:
8px
;
text-align
:
center
;
line-height
:
20px
;
padding
:
0
8px
;
}
.activitylist
.inter-item-title
{
width
:
100%
;
padding
:
12px
15px
0px
;
font-size
:
13px
;
color
:
#111111
;
font-weight
:
bold
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
}
</
style
>
</
style
>
pages/index/index.vue
View file @
3bc75e2d
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<u-icon
name=
"arrow-left"
size=
"44"
></u-icon>
<u-icon
name=
"arrow-left"
size=
"44"
></u-icon>
</view>
</view>
</view>
</view>
<
!--
<view
@
click=
'yj'
style=
"width: 200px;height: 50px;"
>
发布
</view>
--
>
<
view
@
click=
'yj'
style=
"width: 200px;height: 50px;"
>
活动
</view
>
<u-tabs
v-if=
"myPageData.home_pages && myPageData.home_pages.navs.length > 1"
name=
"name"
:list=
"myPageData.home_pages.navs"
<u-tabs
v-if=
"myPageData.home_pages && myPageData.home_pages.navs.length > 1"
name=
"name"
:list=
"myPageData.home_pages.navs"
:is-scroll=
"true"
:active-color=
"mainColor"
:current=
"active"
:bar-width=
"80"
:font-size=
"32"
:bold=
"false"
@
change=
"changeHandler"
></u-tabs>
:is-scroll=
"true"
:active-color=
"mainColor"
:current=
"active"
:bar-width=
"80"
:font-size=
"32"
:bold=
"false"
@
change=
"changeHandler"
></u-tabs>
<template
v-for=
"(item, i) in myPageData.home_pages.navs"
>
<template
v-for=
"(item, i) in myPageData.home_pages.navs"
>
...
@@ -1117,7 +1117,7 @@
...
@@ -1117,7 +1117,7 @@
},
},
yj
(){
yj
(){
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/friendcircle/
release
'
url
:
'/pages/friendcircle/
activitylist
'
})
})
}
}
},
},
...
...
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