Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
marubi-wish-list-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3a17532c
authored
2019-08-02 18:44:51 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
版本提交
1 parent
2d06ff22
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
849 additions
and
74 deletions
src/app.json
src/component/tips-common-comp/tips-common-comp.scss
src/component/tips-common-comp/tips-common-comp.wxml
src/component/tips-create-complete-comp/tips-create-complete-comp.js
src/component/tips-create-complete-comp/tips-create-complete-comp.wxml
src/image/oss/coop/coop-bg-1.png
src/image/oss/icon/icon-drow-down.png
src/pages/coop/coop.js
src/pages/coop/coop.json
src/pages/coop/coop.scss
src/pages/coop/coop.wxml
src/pages/create-wish/create-wish.js
src/pages/create-wish/create-wish.wxml
src/pages/question/question.scss
src/pages/question/question.wxml
src/pages/user-table/user-table.js
src/pages/user-table/user-table.json
src/pages/user-table/user-table.scss
src/pages/user-table/user-table.wxml
src/pages/wish/wish.js
src/pages/wish/wish.scss
src/pages/wish/wish.wxml
src/utils/util.js
src/app.json
View file @
3a17532
{
"pages"
:
[
"pages/user-table/user-table"
,
"pages/index/index"
,
"pages/authorize/authorize"
,
"pages/coop/coop"
,
"pages/register/register"
,
"pages/wish/wish"
,
"pages/create-wish/create-wish"
,
"pages/question/question"
,
"pages/new-welfare/new-welfare"
,
"pages/user-table/user-table"
,
"pages/coupon-detail/coupon-detail"
,
"pages/rank/rank"
,
"pages/poster/poster"
,
"pages/my-card/my-card"
,
"pages/coop/coop"
,
"pages/example/example"
,
"pages/more/more"
],
...
...
src/component/tips-common-comp/tips-common-comp.scss
View file @
3a17532
...
...
@@ -31,18 +31,25 @@
}
.tips
{
margin-top
:
24
px
;
height
:
210px
;
margin-top
:
32
px
;
//
height: 210px;
color
:
#999999
;
font-size
:
28px
;
@extend
.bb
;
padding
:
0
100px
;
text
{
line-height
:
32px
}
}
.btn
{
position
:
relative
;
@include
cb
(
234px
,
64px
);
// position: relative;
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
100px
;
margin
:
0
auto
;
// @include cb(300px, 80px);
@include
cb
(
234px
,
64px
);
}
}
...
...
src/component/tips-common-comp/tips-common-comp.wxml
View file @
3a17532
...
...
@@ -4,8 +4,8 @@
<view class="cont">
<view class="tit">· 温馨提示 ·</view>
<view class="tips">
<text decode="{{true}}"
>{{innerText}}</text>
<text decode="{{true}}">{{innerText}}</text>
</view>
<view bindtap="hideMask" class="btn">我知道了</view>
</view>
<view bindtap="hideMask" class="btn">我知道了</view>
</view>
...
...
src/component/tips-create-complete-comp/tips-create-complete-comp.js
View file @
3a17532
...
...
@@ -17,6 +17,14 @@ Component({
wishBillInfo
:{
type
:
Object
,
value
:
{},
},
wishInfo
:{
type
:
Object
,
value
:
{},
},
wishList
:{
type
:
Object
,
value
:
[],
}
},
data
:
{
...
...
src/component/tips-create-complete-comp/tips-create-complete-comp.wxml
View file @
3a17532
...
...
@@ -5,42 +5,18 @@
<view class="tit">· 太棒了 ·</view>
<view class="tips">
共获得
<span class="val">{{
eleVal
}}</span>
<span class="val">{{
wishInfo.totalElasticValue
}}</span>
弹力值
</view>
<!-- 心愿容器 -->
<view class="wish">
<view class="wish-item">
<view
wx:for="{{wishList}}" wx:key="{{index}}"
class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/prize/prize-3.png" />
<!-- <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" /> -->
<image class="prod" mode="aspectFit" src="../../image/prize/prize-{{item.tag}}.png" />
</view>
<!-- <view class="name">丸美弹力蛋白凝时紧致乳</view> -->
<view class="val">
<image class="icon" mode="widthFix" src="../../image/oss/create-wish/cw-light.png" />
获得20
</view>
</view>
<view class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/prize/prize-2.png" />
<!-- <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" /> -->
</view>
<!-- <view class="name">丸美弹力蛋白凝时紧致乳</view> -->
<view class="val">
<image class="icon" mode="widthFix" src="../../image/oss/create-wish/cw-light.png" />
获得20
</view>
</view>
<view class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/prize/prize-1.png" />
<!-- <image class="close" mode="widthFix" src="../../image/oss/create-wish/cw-close-btn.png" /> -->
</view>
<!-- <view class="name">丸美弹力蛋白凝时紧致乳</view> -->
<view class="val">
<image class="icon" mode="widthFix" src="../../image/oss/create-wish/cw-light.png" />
获得20
获得{{item.initialElasticValue}}
</view>
</view>
</view>
...
...
src/image/oss/coop/coop-bg-1.png
View file @
3a17532
295 KB
|
W:
|
H:
104 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/image/oss/icon/icon-drow-down.png
0 → 100644
View file @
3a17532
196 Bytes
src/pages/coop/coop.js
View file @
3a17532
import
{
getBindtapData
,
getObjByListKeyValue
}
from
'../../utils/util'
;
import
{
productMap
}
from
'../../const/custom-data'
;
let
app
=
getApp
();
Page
({
data
:
{},
data
:
{
options
:
null
,
wishInfo
:
{},
wishList
:
[]
},
onShareAppMessage
()
{},
onLoad
(
options
)
{},
onLoad
(
options
)
{
this
.
setData
({
options
})
this
.
initData
();
},
initData
()
{
app
.
queryIndex
().
then
((
result
)
=>
{
this
.
queryWishbillDetail
();
})
},
// 我也要玩
onPlayTooHandler
()
{
app
.
router
.
push
({
openType
:
"reLaunch"
,
path
:
"index"
})
},
// 获取心愿单详情
queryWishbillDetail
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
app
.
post
({
url
:
app
.
api
.
wishbillDetail
,
data
:
{
billCode
:
app
.
globalData
.
indexInfo
.
wishBillCode
}
}).
then
((
result
)
=>
{
let
wishList
=
result
.
wishGifts
;
wishList
.
forEach
(
element
=>
{
let
product
=
productMap
[
element
.
prizeDefineCode
+
""
];
element
=
Object
.
assign
(
element
,
product
);
let
progress
=
element
.
elasticValue
/
element
.
conditionElasticValue
*
100
;
if
(
progress
>
100
)
progress
=
100
;
// 直接计算坐标
let
progressLeft
=
progress
*
3.22
-
51
;
element
.
progress
=
progress
;
element
.
progressLeft
=
progressLeft
;
});
this
.
setData
({
wishInfo
:
result
,
wishList
:
wishList
})
console
.
log
(
"wishInfo:"
,
this
.
data
.
wishInfo
);
console
.
log
(
"wishList:"
,
this
.
data
.
wishList
);
})
});
},
// 子组件事件
evtcomp
(
evt
)
{
let
{
...
...
src/pages/coop/coop.json
View file @
3a17532
{
"navigationBarTitleText"
:
"
more
"
"navigationBarTitleText"
:
"
好友助力
"
}
...
...
src/pages/coop/coop.scss
View file @
3a17532
...
...
@@ -2,17 +2,299 @@
@import
'../../assets/scss/utils'
;
.page
{
font-weight
:
300
;
.bgc
{}
.bg
{}
.bg
{
position
:
fixed
;
width
:
100%
;
height
:
100%
;
}
.decoration
{
position
:
relative
;
z-index
:
11
;
.d1
{
position
:
absolute
;
width
:
728px
;
height
:
292px
;
top
:
-60px
;
left
:
11px
;
}
}
.main
{
.top-space
{
height
:
0
px
;
height
:
48
px
;
}
.content
{
position
:
relative
;
// 摇一摇
.shake
{
margin
:
0
auto
;
width
:
700px
;
height
:
920px
;
.ebg
{
width
:
700px
;
height
:
920px
;
position
:
absolute
;
}
.space1
{
height
:
52px
;
}
.cont
{
position
:
relative
;
.tips
{
margin
:
0
auto
;
width
:
480px
;
color
:
#333333
;
font-size
:
28px
;
line-height
:
1
.6
;
height
:
150px
;
}
// 心愿
.wish
{
position
:
relative
;
margin
:
450px
auto
0
;
display
:
flex
;
// justify-content: center;
@extend
.bb
;
min-height
:
238px
;
width
:
630px
;
&
-item
{
position
:
relative
;
text-align
:
center
;
width
:
210px
;
.display
{
position
:
relative
;
margin
:
0
auto
;
width
:
140px
;
height
:
140px
;
border-radius
:
70px
;
background-image
:
radial-gradient
(
circle
at
0
0
,
#ffffff
,
#f2e6e6
);
@extend
.fcc
;
.prod
{
max-width
:
200px
;
max-height
:
200px
;
margin-bottom
:
10px
;
}
.close
{
width
:
30px
;
height
:
30px
;
position
:
absolute
;
bottom
:
0
;
right
:
0
;
}
}
.name
{
width
:
160px
;
margin
:
8px
auto
0
;
color
:
#333333
;
font-size
:
20px
;
// font-weight: 300;
}
.val
{
@extend
.fcc
;
color
:
#b93138
;
font-size
:
20px
;
margin-top
:
4px
;
.icon
{
margin-left
:
6px
;
width
:
11px
;
height
:
18px
;
}
}
}
}
}
}
.result-wrap
{
position
:
relative
;
.play-too-btn
{
@include
cb
(
234px
,
64px
);
margin
:
12px
auto
0
;
}
}
// 摇后结果
.result
{
margin
:
0
auto
;
width
:
706px
;
height
:
923px
;
.ebg
{
width
:
706px
;
height
:
923px
;
position
:
absolute
;
}
.space1
{
height
:
32px
;
}
.cont
{
position
:
relative
;
.user
{
height
:
150px
;
display
:
flex
;
align-items
:
center
;
padding
:
0
98px
;
@extend
.bb
;
.portrait
{
width
:
100px
;
height
:
100px
;
border-radius
:
50px
;
}
.nickname
{
font-size
:
24px
;
color
:
#333333
;
line-height
:
1
.5
;
width
:
390px
;
margin-left
:
17px
;
}
}
.tips2
{
margin-top
:
46px
;
font-size
:
30px
;
text-align
:
center
;
color
:
#c82d3e
;
// background-color: wheat;
height
:
auto
;
.t1
{
line-height
:
1
.6
;
height
:
auto
;
}
}
// 奖品
.wish
{
margin
:
24px
auto
0
;
position
:
relative
;
width
:
580px
;
&
-item
{
position
:
relative
;
display
:
flex
;
justify-content
:
space-between
;
height
:
124px
;
padding
:
24px
0
;
.display
{
position
:
relative
;
width
:
124px
;
height
:
124px
;
border-radius
:
62px
;
background-image
:
radial-gradient
(
circle
at
0
0
,
#ffffff
,
#f2e6e6
);
@extend
.fcc
;
.prod
{
max-width
:
200px
;
max-height
:
200px
;
}
}
.mid
{
display
:
flex
;
flex
:
1
;
flex-wrap
:
wrap
;
padding
:
14px
20px
;
@extend
.bb
;
.name
{
color
:
#333333
;
font-size
:
26px
;
@include
ellipsis
(
2
);
}
.progress
{
display
:
flex
;
align-items
:
flex-end
;
align-self
:
flex-end
;
$proWidth
:
322px
;
.pro
{
width
:
$proWidth
;
position
:
relative
;
.flag
{
position
:
absolute
;
left
:
0px
;
bottom
:
14px
;
color
:
#a97a4b
;
font-size
:
16px
;
width
:
51px
;
height
:
30px
;
image
{
position
:
absolute
;
width
:
51px
;
height
:
30px
;
}
.t1
{
position
:
relative
;
text-align
:
center
;
width
:
51px
;
padding-top
:
2px
;
}
}
.line
{
width
:
$proWidth
;
height
:
12px
;
border-radius
:
6px
;
background-color
:
#f7e4e5
;
&
-thumb
{
height
:
12px
;
border-radius
:
6px
;
background-color
:
#ba3038
;
}
}
}
.val
{
font-size
:
24px
;
color
:
#c82d3e
;
padding-left
:
12px
;
}
}
}
}
}
}
}
}
}
}
...
...
src/pages/coop/coop.wxml
View file @
3a17532
<view class="page">
<view class="app__bgc bgc"></view>
<view class="app__bg bg"></view>
<!-- <view class="app__top-shadow"></view> -->
<image class="bg" src="../../image/oss/coop/coop-bg-1.png" mode="scaleToFill" />
<view class="decoration">
<image class="d1" mode="widthFix" src="../../image/oss/coop/coop-d1.png" />
</view>
<view class="app__content main">
<view class="top-space"></view>
<view class="content"></view>
<view class="content">
<!-- 摇一摇 -->
<view wx:if="{{1>10}}" class="shake">
<image class="ebg" mode="widthFix" src="../../image/oss/coop/coop-c2.png" />
<view class="space1"></view>
<view class="cont">
<view class="tips">你的好友{{wishInfo.member.nickname}}的心愿单需要你的帮助哦!拿起手机摇一摇,即可为ta贡献弹力值!</view>
<view class="wish">
<view wx:for="{{wishList}}" wx:key="{{index}}" class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/prize/prize-{{item.tag}}.png" />
</view>
<view class="name">{{item.prizeName}}</view>
</view>
</view>
</view>
</view>
<!-- 摇后结果 -->
<view class="result-wrap">
<view class="result">
<image class="ebg" mode="widthFix" src="../../image/oss/coop/coop-c3.png" />
<view class="space1"></view>
<view class="cont">
<view class="user">
<image class="portrait" mode="widthFix" src="{{wishInfo.member.avatar}}" />
<view class="nickname">
你的好友{{wishInfo.member.nickname}}的心愿单需要你的帮助哦!拿起手机摇一摇,即可为ta贡献弹力值!
</view>
</view>
<view class="tips2">
<text class="t1">太厉害了\n您总共摇出了140弹力值</text>
</view>
<!-- 奖品 -->
<view class="wish">
<view wx:for="{{wishList}}" wx:key="{{index}}" class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/prize/prize-{{item.tag}}.png" />
</view>
<view class="mid">
<view class="name">{{item.prizeName}}</view>
<view class="progress">
<view class="pro">
<view class="flag" style="left:{{item.progressLeft}}rpx;">
<image class="prod" mode="aspectFit" src="../../image/oss/my-wish/my-wish-c4.png" />
<view class="t1">{{item.elasticValue}}</view>
</view>
<view class="line">
<view class="line-thumb" style="width:{{item.progress}}%;"></view>
</view>
</view>
<view class="val">{{item.conditionElasticValue}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view bindtap="onPlayTooHandler" class="play-too-btn">我也要玩</view>
</view>
</view>
</view>
</view>
...
...
src/pages/create-wish/create-wish.js
View file @
3a17532
import
{
getBindtapData
getBindtapData
,
getObjByListKeyValue
}
from
'../../utils/util'
;
import
{
...
...
@@ -16,7 +17,7 @@ Page({
tipsWishVisible
:
false
,
tipsShakeVisible
:
false
,
tipsCommonVisible
:
false
,
tipsCreateCompleteVisible
:
fals
e
,
tipsCreateCompleteVisible
:
tru
e
,
tipsInnerText
:
""
,
curStatus
:
1
,
// 当前场景
candidate
:
[],
// 心愿候选列表
...
...
@@ -25,6 +26,8 @@ Page({
taskTotalElasticValue
:
0
,
// 任务分
wishBillInfo
:
{},
// 生成的心愿单
curWish
:
{},
// 当前选择心愿
wishInfo
:
{},
// 创建后的心愿信息
wishList
:
[],
// 创建后的心愿单列表
userInfo
:
{},
isPageVisible
:
false
,
},
...
...
@@ -51,6 +54,7 @@ Page({
userInfo
:
app
.
globalData
.
userInfo
})
this
.
queryWishbillPrizeCandidate
();
this
.
queryWishbillDetail
();
});
this
.
initShake
();
},
...
...
@@ -202,7 +206,8 @@ Page({
let
curIndex
=
getBindtapData
(
evt
,
"index"
);
console
.
log
(
"curIndex:"
,
curIndex
);
let
curData
=
productMap
[
curIndex
+
""
];
let
product
=
this
.
getProductByCode
(
curIndex
);
// let product = this.getProductByCode(curIndex);
let
product
=
getObjByListKeyValue
(
curIndex
,
'prizeDefineCode'
,
this
.
data
.
candidate
);
curData
=
Object
.
assign
(
curData
,
product
)
console
.
log
(
"product:"
,
product
);
console
.
log
(
"curData:"
,
curData
);
...
...
@@ -245,7 +250,7 @@ Page({
})
if
(
uni
)
{
this
.
setData
({
tipsInnerText
:
"心愿重复啦~"
,
tipsInnerText
:
"心愿重复啦~
\n换个其他心愿试试!
"
,
tipsCommonVisible
:
true
})
return
;
...
...
@@ -320,6 +325,30 @@ Page({
});
});
},
// 获取心愿单详情
queryWishbillDetail
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
app
.
queryIndex
().
then
((
result
)
=>
{
app
.
post
({
url
:
app
.
api
.
wishbillDetail
,
data
:
{
billCode
:
app
.
globalData
.
indexInfo
.
wishBillCode
}
}).
then
((
result
)
=>
{
let
wishList
=
result
.
wishGifts
;
wishList
.
forEach
(
element
=>
{
let
product
=
productMap
[
element
.
prizeDefineCode
+
""
];
element
=
Object
.
assign
(
element
,
product
);
});
console
.
log
(
"wishList:"
,
wishList
);
this
.
setData
({
wishInfo
:
result
,
wishList
:
wishList
})
})
})
});
},
// 隐藏所有蒙层
hideMask
()
{
this
.
setData
({
...
...
src/pages/create-wish/create-wish.wxml
View file @
3a17532
...
...
@@ -71,7 +71,7 @@
<tips-shake-comp bind:evtcomp="evtcomp"></tips-shake-comp>
</van-popup>
<van-popup show="{{ tipsCreateCompleteVisible }}">
<tips-create-complete-comp bind:evtcomp="evtcomp" wish-
list="{{myW
ishList}}" ele-val="{{taskTotalElasticValue}}" wish-bill-info="{{wishBillInfo}}"></tips-create-complete-comp>
<tips-create-complete-comp bind:evtcomp="evtcomp" wish-
info="{{wishInfo}}" wish-list="{{wishList}}" wish-list="{{w
ishList}}" ele-val="{{taskTotalElasticValue}}" wish-bill-info="{{wishBillInfo}}"></tips-create-complete-comp>
</van-popup>
<van-popup show="{{ tipsCommonVisible }}">
<tips-common-comp bind:evtcomp="evtcomp" inner-text="{{tipsInnerText}}"></tips-common-comp>
...
...
src/pages/question/question.scss
View file @
3a17532
...
...
@@ -62,15 +62,15 @@
justify-content
:
space-between
;
flex-wrap
:
wrap
;
margin-top
:
32px
;
// align-items: center;
&
-item
{
display
:
flex
;
width
:
312px
;
height
:
72px
;
line-height
:
72px
;
padding
:
20px
10px
;
border-radius
:
36px
;
border
:
solid
1px
#999999
;
@extend
.bb
;
padding
:
0
10px
;
font-size
:
22px
;
color
:
#333333
;
margin-bottom
:
28px
;
...
...
src/pages/question/question.wxml
View file @
3a17532
...
...
@@ -18,7 +18,8 @@
</view>
<view class="answer">
<view bindtap="onSelectAnswerHandler" data-pdata="{{item}}" data-pindex="{{index}}" data-data="{{item2}}" data-index="{{index2}}" wx:for="{{item.answers}}" wx:key="index2" wx:for-index="index2" wx:for-item="item2" class="answer-item {{item2.selected ? 'selected':''}} {{item2.rightAnswer == 1 && hadAnswer ? 'right' :''}} ">
{{questionNumList[index2]}}.{{item2.answer}}
<view>{{questionNumList[index2]}}.</view>
<view>{{item2.answer}}</view>
</view>
</view>
</view>
...
...
src/pages/user-table/user-table.js
View file @
3a17532
...
...
@@ -3,6 +3,24 @@ Page({
data
:
{},
onShareAppMessage
()
{},
onLoad
(
options
)
{},
/**
* 提交表单
* @param {*} evt
*/
onSubmitHandler
(
evt
)
{
},
/**
* 返回心愿单页面
* @param {*} evt
*/
onWishHandler
(
evt
)
{
app
.
router
.
push
({
openType
:
"reLaunch"
,
path
:
"wish"
})
},
// 子组件事件
evtcomp
(
evt
)
{
let
{
...
...
src/pages/user-table/user-table.json
View file @
3a17532
{
"navigationBarTitleText"
:
"
more
"
"navigationBarTitleText"
:
"
领取礼物
"
}
...
...
src/pages/user-table/user-table.scss
View file @
3a17532
@import
'../../assets/scss/mixins'
;
@import
'../../assets/scss/utils'
;
$contentWidth
:
560px
;
$iptHeight
:
80px
;
.page
{
.bgc
{}
.bg
{}
.bg
{
position
:
fixed
;
width
:
100%
;
height
:
100%
;
}
.decoration
{
position
:
relative
;
.d1
{
position
:
absolute
;
width
:
193px
;
height
:
625px
;
left
:
0
;
top
:
-120px
;
}
.d2
{
position
:
absolute
;
width
:
194px
;
height
:
369px
;
right
:
0
;
top
:
200px
;
}
}
.main
{
position
:
relative
;
.top-space
{
height
:
0px
;
height
:
4
0px
;
}
.content
{
position
:
relative
;
.top
{
.tit
{
text-align
:
center
;
width
:
369px
;
height
:
86px
;
margin
:
0
auto
;
image
{
width
:
369px
;
height
:
86px
;
}
}
.display
{
margin
:
24px
auto
0
;
position
:
relative
;
width
:
190px
;
height
:
190px
;
border-radius
:
95px
;
background-image
:
radial-gradient
(
circle
at
0
0
,
#ffffff
,
#d8d8d8
);
@extend
.fcc
;
.prod
{
max-width
:
200px
;
max-height
:
200px
;
}
.close
{
width
:
30px
;
height
:
30px
;
position
:
absolute
;
bottom
:
0
;
right
:
0
;
}
}
.name
{
text-align
:
center
;
color
:
#ffffff
;
font-size
:
28px
;
margin-top
:
20px
;
}
}
.table
{
position
:
relative
;
margin
:
12px
auto
0
;
width
:
744px
;
height
:
840px
;
.ebg
{
position
:
absolute
;
width
:
744px
;
height
:
840px
;
}
.tips
{
color
:
#ba3039
;
font-size
:
24px
;
}
.space1
{
height
:
88px
;
}
.border
{
position
:
relative
;
width
:
$contentWidth
;
margin
:
0
auto
;
height
:
840px
;
}
.submit-btn
{
@include
cb
(
300px
,
80px
);
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
68px
;
margin
:
0
auto
;
}
.edit
{
.form
{
margin-top
:
40px
;
.ipt
{
color
:
#333333
;
width
:
$contentWidth
;
height
:
$iptHeight
;
border-radius
:
40px
;
border
:
solid
1px
#b83138
;
background-color
:
#ffffff
;
display
:
flex
;
margin-bottom
:
30px
;
.label
{
text-align
:
center
;
width
:
110px
;
height
:
$iptHeight
;
line-height
:
$iptHeight
;
color
:
#b93138
;
font-size
:
28px
;
}
.input
{
flex
:
1
;
height
:
$iptHeight
;
@extend
.bb
;
padding-right
:
24px
;
}
.area
{
display
:
flex
;
align-items
:
center
;
&
-item
{
@include
ellipsis
(
1
);
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
150px
;
@extend
.bb
;
padding
:
0
20px
;
.icon
{
width
:
15px
;
height
:
9px
;
margin-left
:
8px
;
}
}
.line
{
width
:
2px
;
height
:
30px
;
background-color
:
#b83138
;
}
}
.textarea
{
min-height
:
160px
;
@extend
.bb
;
padding
:
24px
0
;
}
}
.ipt2
{
height
:
auto
;
// min-height: 160px;
}
}
}
.result
{
.form
{
margin
:
58px
auto
0
;
font-size
:
28px
;
color
:
#b93138
;
&
-item
{
display
:
flex
;
margin-bottom
:
30px
;
.label
{
width
:
80px
;
}
.val
{
color
:
#333333
;
flex
:
1
;
}
}
}
}
}
}
}
}
...
...
src/pages/user-table/user-table.wxml
View file @
3a17532
<view class="page">
<view class="app__bgc bgc"></view>
<view class="app__bg bg"></view>
<!-- <view class="app__top-shadow"></view> -->
<!-- <view class="app__bg bg"></view> -->
<image class="bg" src="../../image/oss/poster/poster-bg.png" mode="scaleToFill" />
<view class="decoration">
<image class="d1" mode="widthFix" src="../../image/oss/user-table/user-table-d1.png" />
<image class="d2" mode="widthFix" src="../../image/oss/user-table/user-table-d2.png" />
</view>
<view class="app__content main">
<view class="top-space"></view>
<view class="content"></view>
<view class="content">
<view class="top">
<view class="tit">
<image mode="widthFix" src="../../image/oss/user-table/user-table-c1.png" />
</view>
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/prize/prize-1.png" />
</view>
<view class="name">丸美弹力蛋白凝时紧致乳</view>
</view>
<!-- 表单 -->
<view class="table">
<image class="ebg" mode="widthFix" src="../../image/oss/user-table/user-table-c2.png" />
<!-- 编辑框 -->
<view wx:if="{{1>10}}" class="border edit">
<view class="space1"></view>
<view class="tips">*请填写您的邮寄地址,我们将为您送出以上礼品</view>
<view class="form">
<view class="ipt">
<view class="label">姓名</view>
<input class="input" placeholder="请输入" />
</view>
<view class="ipt">
<view class="label">电话</view>
<input class="input" placeholder="请输入" />
</view>
<view class="ipt">
<view class="label">区域</view>
<view class="input area">
<view class="area-item area-item2">
省
<image class="icon" mode="widthFix" src="../../image/oss/icon/icon-drow-down.png" />
</view>
<view class="line"></view>
<view class="area-item area-item2">
市
<image class="icon" mode="widthFix" src="../../image/oss/icon/icon-drow-down.png" />
</view>
<view class="line"></view>
<view class="area-item area-item2">
区
<image class="icon" mode="widthFix" src="../../image/oss/icon/icon-drow-down.png" />
</view>
</view>
</view>
<view class="ipt ipt2">
<view class="label">地址</view>
<textarea class="input textarea" placeholder="请输入"></textarea>
</view>
</view>
<view bindtap="onSubmitHandler" class="submit-btn">确认提交</view>
</view>
<!-- 结果显示 -->
<view wx:else class="border result">
<view class="space1"></view>
<view class="tips">*感谢您提交的地址,我们将尽快为您送出以上礼品</view>
<view class="form">
<view class="form-item">
<view class="label">姓名</view>
<view class="val">林小美</view>
</view>
<view class="form-item">
<view class="label">电话</view>
<view class="val">18812345678</view>
</view>
<view class="form-item">
<view class="label">地址</view>
<view class="val">广州市天河区珠江新城花城大道路xx广州市天河区珠江新城花城大道路xx广州市天河区珠江新城花城大道路xx</view>
</view>
</view>
<view bindtap="onWishHandler" class="submit-btn">返回首页</view>
</view>
</view>
</view>
</view>
</view>
...
...
src/pages/wish/wish.js
View file @
3a17532
import
{
getBindtapData
,
getObjByListKeyValue
}
from
'../../utils/util'
;
import
{
productMap
}
from
'../../const/custom-data'
;
let
app
=
getApp
();
Page
({
data
:
{
...
...
@@ -24,13 +33,21 @@ Page({
* 领取我的奖品
*/
onGetGiftHandler
(
evt
)
{
let
curData
=
getBindtapData
(
evt
);
console
.
log
(
"curData:"
,
curData
);
app
.
poster
({
url
:
app
.
api
.
wishbillGiftAccept
,
data
:
curData
}).
then
((
result
)
=>
{
// let curData
});
},
/**
* 查看我的奖品
*/
onCheckGiftHandler
(
evt
)
{
let
curData
=
getBindtapData
(
evt
);
console
.
log
(
"curData:"
,
curData
);
},
// 显示规则页面
onShowRuleHandler
()
{
...
...
@@ -69,9 +86,20 @@ Page({
billCode
:
app
.
globalData
.
indexInfo
.
wishBillCode
}
}).
then
((
result
)
=>
{
let
wishList
=
result
.
wishGifts
;
wishList
.
forEach
(
element
=>
{
let
product
=
productMap
[
element
.
prizeDefineCode
+
""
];
element
=
Object
.
assign
(
element
,
product
);
let
progress
=
element
.
elasticValue
/
element
.
conditionElasticValue
*
100
;
if
(
progress
>
100
)
progress
=
100
;
// 直接计算坐标
let
progressLeft
=
progress
*
2.2
-
51
;
element
.
progress
=
progress
;
element
.
progressLeft
=
progressLeft
;
});
this
.
setData
({
wishInfo
:
result
,
wishList
:
result
.
wishGifts
wishList
:
wishList
})
})
});
...
...
src/pages/wish/wish.scss
View file @
3a17532
...
...
@@ -59,7 +59,6 @@
width
:
182px
;
height
:
182px
;
border-radius
:
91px
;
background-color
:
wheat
;
left
:
0
;
right
:
0
;
top
:
-82px
;
...
...
@@ -124,7 +123,6 @@
max-width
:
200px
;
max-height
:
200px
;
}
}
.mid
{
...
...
@@ -137,7 +135,7 @@
.name
{
color
:
#333333
;
font-size
:
2
8
px
;
font-size
:
2
6
px
;
@include
ellipsis
(
2
);
}
...
...
@@ -201,7 +199,8 @@
align-self
:
center
;
font-size
:
28px
;
}
.disable
{
.disable
{
background
:
transparent
;
background-color
:
#d2d2d2
;
}
...
...
src/pages/wish/wish.wxml
View file @
3a17532
...
...
@@ -24,28 +24,30 @@
<view class="wish">
<view wx:for="{{wishList}}" wx:key="{{index}}" class="wish-item">
<view class="display">
<image class="prod" mode="aspectFit" src="../../image/prize/prize-
3
.png" />
<image class="prod" mode="aspectFit" src="../../image/prize/prize-
{{item.tag}}
.png" />
</view>
<view class="mid">
<view class="name">{{item.prizeName}}</view>
<view class="progress">
<view class="pro">
<view class="flag" style="left:{{
(item.elasticValue/item.conditionElasticValue) * 220 - 51
}}rpx;">
<view class="flag" style="left:{{
item.progressLeft
}}rpx;">
<image class="prod" mode="aspectFit" src="../../image/oss/my-wish/my-wish-c4.png" />
<view class="t1">{{item.elasticValue}}</view>
</view>
<view class="line">
<view class="line-thumb" style="width:{{item.
elasticValue/item.conditionElasticValue
}}%;"></view>
<view class="line-thumb" style="width:{{item.
progress
}}%;"></view>
</view>
</view>
<view class="val">{{item.conditionElasticValue}}</view>
</view>
</view>
<view wx:if="{{item.accessStatus == 0}}" class="btn disable">
弹力充值中
<view wx:if="{{item.accessStatus == 0}}" class="btn disable">弹力充值中</view>
<view bindtap="onGetGiftHandler" data-data="{{item}}" wx:if="{{item.accessStatus == 1}}" class="btn">
马上领取
</view>
<view bindtap="onCheckGiftHandler" data-data="{{item}}" wx:if="{{item.accessStatus == 2}}" class="btn">
已领取
</view>
<view bindtap="onGetGiftHandler" wx:if="{{item.accessStatus == 1}}" class="btn">马上领取</view>
<view bindtap="onCheckGiftHandler" wx:if="{{item.accessStatus == 2}}" class="btn">已领取</view>
</view>
</view>
<view bindtap="onCreatePosterHandler" class="poster-btn">生成海报</view>
...
...
src/utils/util.js
View file @
3a17532
...
...
@@ -132,13 +132,30 @@ function getBindtapData(evt, key = "data") {
return
evt
.
currentTarget
.
dataset
[
keyStr
];
}
/**
* 从数组中获取 key未value的对象
* @param {*} value
* @param {*} key
* @param {*} list
*/
function
getObjByListKeyValue
(
value
,
key
,
list
)
{
let
result
=
null
;
list
.
forEach
(
element
=>
{
if
(
element
[
key
+
""
]
==
value
)
{
result
=
element
;
}
});
return
result
;
}
/**
* 获取小程序码
* path = "/pages/index/index?pa=1"
* @param {*} path
*/
function
wxacodeGet
(
path
)
{
return
"
https://api.k.wxpai.cn/bizproxy/mzcfsapi/qrcode/create?path="
+
encodeURIComponent
(
path
);
return
"https://api.k.wxpai.cn/bizproxy/mzcfsapi/qrcode/create?path="
+
encodeURIComponent
(
path
);
}
...
...
@@ -215,4 +232,5 @@ module.exports = {
formatWeek
:
formatWeek
,
getBindtapData
:
getBindtapData
,
wxacodeGet
:
wxacodeGet
,
getObjByListKeyValue
:
getObjByListKeyValue
,
}
...
...
Please
register
or
sign in
to post a comment