Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
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
wangxuelai
wechatapp.shangjiadao.com
Commits
31c4bdb4
Commit
31c4bdb4
authored
May 24, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
6345f462
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
7 deletions
+77
-7
api.js
constants/api.js
+2
-1
integral.js
service/customer/integral.js
+11
-1
index.js
src/pages/mall/index.js
+11
-0
index.wxml
src/pages/mall/index.wxml
+3
-3
index.js
src/pages/scoreprodetail/index.js
+49
-1
index.wxml
src/pages/scoreprodetail/index.wxml
+1
-1
No files found.
constants/api.js
View file @
31c4bdb4
...
...
@@ -11,7 +11,8 @@ const apis = {
goodsList
:
`
${
api
}
student/integral/goods`
,
goodsDetail
:
`
${
api
}
student/integral/goods`
,
goodsDetail
:
`
${
api
}
student/integral/goods`
,
exchangesGoodsDetail
:
`
${
api
}
student/integral/exchanges`
exchangesGoodsDetail
:
`
${
api
}
student/integral/exchanges`
,
integralExchange
:
`
${
api
}
student/integral/exchange`
},
common
:
{
consumerSession
:
`
${
api
}
common/login`
,
...
...
service/customer/integral.js
View file @
31c4bdb4
...
...
@@ -41,9 +41,19 @@ function exchangesGoodsDetail (data) {
errorresolve
:
1
,
})
}
function
integralExchange
(
data
)
{
return
wxRequest
({
role
:
'2c'
,
url
:
apis
.
customer
.
integral
.
integralExchange
,
data
,
method
:
'POST'
,
errorresolve
:
1
,
})
}
export
{
myIntegral
,
goodsList
,
exchangesGoodsDetail
,
goodsDetail
goodsDetail
,
integralExchange
}
\ No newline at end of file
src/pages/mall/index.js
View file @
31c4bdb4
...
...
@@ -216,5 +216,16 @@ Page({
}).
catch
((
err
)
=>
{
});
},
goExchangeList
()
{
wx
.
navigateTo
({
url
:
`/src/pages/pointsexchangerecord/index?sid=
${
this
.
data
.
sid
}
`
,
})
},
goGoodDetail
(
e
)
{
const
{
id
}
=
e
.
currentTarget
.
dataset
;
wx
.
navigateTo
({
url
:
`/src/pages/scoreprodetail/index?sid=
${
this
.
data
.
sid
}
&gid=
${
id
}
`
,
})
}
})
\ No newline at end of file
src/pages/mall/index.wxml
View file @
31c4bdb4
...
...
@@ -12,7 +12,7 @@
<image class="btnicon" src="{{localImageRoot}}2c/mall/earnscore.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<text class="btnname" selectable="false" space="false" decode="false">赚积分</text>
</view>
<view class="btn btnb" hover-class="none" hover-stop-propagation="false">
<view class="btn btnb" hover-class="none" hover-stop-propagation="false"
bindtap="goExchangeList"
>
<image class="btnicon" src="{{localImageRoot}}2c/mall/exchangerecord.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<text class="btnname" selectable="false" space="false" decode="false">兑换记录</text>
</view>
...
...
@@ -24,7 +24,7 @@
<text class="areaname" selectable="false" space="false" decode="false">精选奖品</text>
</view>
<view class="prizecontent" hover-class="none" hover-stop-propagation="false" wx:if="{{goodsList.length > 0}}">
<view class="prizecardbox {{(index+1)%2 == 1 ? 'odd' : 'even'}}" hover-class="none" hover-stop-propagation="false" wx:for="{{goodsList}}" wx:key="{{index}}">
<view class="prizecardbox {{(index+1)%2 == 1 ? 'odd' : 'even'}}" hover-class="none" hover-stop-propagation="false"
bindtap="goGoodDetail" data-id="{{item.id}}"
wx:for="{{goodsList}}" wx:key="{{index}}">
<view class="prizecard" hover-class="none" hover-stop-propagation="false">
<image class="prizeimage" src="{{filter.imagify(item.cover)}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<view class="prizename" hover-class="none" hover-stop-propagation="false">{{item.title}}</view>
...
...
@@ -40,7 +40,7 @@
<text class="areaname" selectable="false" space="false" decode="false">优惠卡券</text>
</view>
<view class="couponcontent" hover-class="none" hover-stop-propagation="false" wx:if="{{couponList.length > 0}}">
<view class="couponcardbox {{(index+1)%2 == 1 ? 'odd' : 'even'}}" hover-class="none" hover-stop-propagation="false" wx:for="{{couponList}}" wx:key="{{index}}">
<view class="couponcardbox {{(index+1)%2 == 1 ? 'odd' : 'even'}}" hover-class="none" hover-stop-propagation="false"
bindtap="goGoodDetail" data-id="{{item.id}}"
wx:for="{{couponList}}" wx:key="{{index}}">
<view class="couponcard" hover-class="none" hover-stop-propagation="false">
<view class="couponitem" hover-class="none" hover-stop-propagation="false">
<image class="couponbg" src="{{localImageRoot}}2c/mall/cardbgblue.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
...
...
src/pages/scoreprodetail/index.js
View file @
31c4bdb4
import
{
exchangesGoodsDetail
,
goodsDetail
,
myIntegral
myIntegral
,
integralExchange
}
from
'../../../service/customer/integral.js'
;
var
app
=
getApp
();
Page
({
...
...
@@ -17,6 +18,7 @@ Page({
gid
:
0
,
params
:
{},
balance
:
0
,
submitting
:
false
},
/**
...
...
@@ -122,5 +124,51 @@ Page({
})
}
})
},
buy
()
{
const
that
=
this
;
if
(
that
.
data
.
params
.
status
==
2
)
{
wx
.
showToast
({
title
:
'商品已下架'
})
return
;
}
if
(
that
.
data
.
params
.
price
>
that
.
data
.
balance
)
{
wx
.
showModal
({
title
:
'提示'
,
content
:
`积分不足,邀请好友赚取更多积分吧~`
,
confirmColor
:
'#FFA719'
,
confirmText
:
'知道了'
,
showCancel
:
false
})
return
;
}
wx
.
showModal
({
title
:
'提示'
,
content
:
`需要消耗
${
that
.
data
.
params
.
price
}
积分`
,
confirmColor
:
'#FFA719'
,
confirmText
:
'兑换'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
if
(
that
.
data
.
submitting
)
{
return
}
that
.
data
.
submitting
=
true
;
integralExchange
({
good_id
:
that
.
data
.
gid
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
that
.
data
.
submitting
=
false
;
if
(
code
==
200
)
{
that
.
setData
({
balance
:
Number
(
that
.
data
.
balance
)
-
Number
(
that
.
data
.
params
.
price
)
})
}
}).
catch
(()
=>
{
that
.
data
.
submitting
=
false
;
})
}
}
})
}
})
\ No newline at end of file
src/pages/scoreprodetail/index.wxml
View file @
31c4bdb4
...
...
@@ -45,6 +45,6 @@
<text class="linecost" selectable="false" space="false" decode="false">{{balance}}积分</text>
</view>
</view>
<view class="buyboxright" hover-class="none" hover-stop-propagation="false"
>立即兑换
</view>
<view class="buyboxright" hover-class="none" hover-stop-propagation="false"
bindtap="buy">{{params.status == 1? '立即兑换' : '已下架'}}
</view>
</view>
</view>
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