Commit c0d80c49 by wangzhihui

积分接口联调

1 parent b9d66b94
......@@ -85,6 +85,7 @@ Component({
show: false
})
this.replaceNickName(walletObj)
this.triggerEvent('open')
} else {
wx.p.wxApi.showToast(message)
}
......
......@@ -50,13 +50,14 @@ Component({
methods: {
go(e){
console.log(e)
let {index} =e.currentTarget.dataset
let {index} =e.currentTarget.dataset;
const thisPage = wx.p.router.getPageInstance()
let arr=[
()=>{
// 积分钱包
thisPage.open()
},
()=>{
const thisPage = wx.p.router.getPageInstance()
thisPage.toBank()
}
]
......
......@@ -30,8 +30,12 @@ Page({
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
let userInfo = wx.p.storage.get('userInfo')
this.setData({
userInfo
})
//是否开通
// await this.openPointsWallet()
await this.openPointsWallet()
this.searchScoreSummaryData()
this.getScoreProfitListData()
},
......@@ -39,10 +43,10 @@ Page({
const {
phone,
channelSource
} = wx.p.storage.get('userInfo');
} = this.data.userInfo;
wx.p.api.withdrawalApi.openPointsWallet({
phone,
source: channelSource //1.阳光激励 2.续保用户 3.管理层
scoreSource: channelSource //1.阳光激励 2.续保用户 3.管理层
}).then(res => {
if (res.code == 0) {
this.setData({
......@@ -55,6 +59,31 @@ Page({
wx.p.wxApi.showToast(JSON.stringify(err))
})
},
open() {
const {
userInfo: {
phone,
channelSource,
nickName
},
scoreSummary: {
currentScore
}
} = this.data;
this.setData({
showEnableWallet: true,
walletObj: {
"name": nickName,
phone,
"scoreSource": channelSource,
currentScore
}
})
},
//更新开通状态
update(){
this.openPointsWallet()
},
jump() {
wx.p.router.go('/packageIndex/pages/integral/withdrawalNote/withdrawalNote')
},
......@@ -63,7 +92,7 @@ Page({
phone,
channelSource
} = wx.p.storage.get('userInfo');
} = this.data.userInfo;
wx.p.api.withdrawalApi.searchScoreSummary({
staffPhone: phone,
channelSource, //1.阳光激励 2.续保用户 3.管理层
......@@ -89,7 +118,7 @@ Page({
} = this.data, {
phone,
channelSource,
} = wx.p.storage.get('userInfo');
} = this.data.userInfo;
wx.p.api.withdrawalApi.getScoreProfitList({
staffPhone: phone,
merchantId: '44211227',
......
......@@ -3,7 +3,8 @@
"usingComponents": {
"profit-list":"./components/profitList",
"have-open": "./components/open",
"have-no-ope": "./components/noOpen"
"have-no-ope": "./components/noOpen",
"enable-wallet": "/components/EnableWallet/EnableWallet"
}
}
\ No newline at end of file
......@@ -20,3 +20,5 @@
</view>
</block>
<!-- 开通钱包 -->
<enable-wallet show="{{showEnableWallet}}" walletObj="{{walletObj}}" bindopen="update"></enable-wallet>
......@@ -6,8 +6,8 @@ Page({
*/
data: {
showConfirmDialog: false,
taxRateObj: {
},
goodsList: [],
taxRateObj: {},
confirmButtons: [{
text: '取消',
extClass: 'btn_cancel'
......@@ -24,6 +24,36 @@ Page({
wx.p.router.getRouterParams().then(params => {
this.setData(params)
this.getTaxRate()
this.getGoodsList()
})
},
// 获取商品数据
getGoodsList() {
let {
pageNum,
goodsList,
goodsSkuName,
frontendCategoryId,
activeTab
} = this.data
let userInfo = wx.p.storage.get('userInfo')
let params = {
pageNum: 2,
pageSize: 4,
canExchange: 1,
staffPhone: userInfo?.phone,
staffPlatform: userInfo?.channelSource,
merchantNo: userInfo?.merchantId
}
wx.p.api.homeApi.getGoodsStockroomList(params).then(res => {
res?.list?.forEach((val, index) => {
if (index == 0) val.goodsSource = 2
else val.goodsSource = 1
})
this.setData({
goodsList: res?.list
})
})
},
getTaxRate() {
......@@ -35,7 +65,7 @@ Page({
} = this.data;
wx.p.api.withdrawalApi.getTaxRate({
withdrawalScore: sumbitScore,
staffPhone:phone,
staffPhone: phone,
channelSource,
merchantId: '44211227',
}).then(res => {
......
{
"usingComponents": {},
"usingComponents": {
"goods": "/components/goods/goods"
},
"navigationBarTitleText": "积分提现"
}
\ No newline at end of file
......@@ -13,35 +13,39 @@
<view class="item">您的本次提现金额 <view class="price">{{taxRateObj.withdrawalScore}}<text>元</text></view>
</view>
</view>
<view class="label">以下为无工资收入和有工资收入的相关税率与收入对比:</view>
<view class="label">以下为无工资收入和有工资收入的相关税率与收入对比:</view>
</view>
<view class="salary-comparison">
<view class="salary flex_scb">
<view class="proportion">{{taxRateObj.taxRateWithoutSalary}}%</view>
<view class="proportion income">{{taxRateObj.taxRateWithSalary}}%</view>
<view class="salary flex_scb">
<view class="proportion">{{taxRateObj.taxRateWithoutSalary}}%</view>
<view class="proportion income">{{taxRateObj.taxRateWithSalary}}%</view>
</view>
<view class="accumulative flex_sc">
<view class="earning have-no">
<view class="money">{{taxRateObj.totalIncomeWithoutSalary}}元</view>
<view class="text">累计提现+本次提现</view>
</view>
<view class="accumulative flex_sc">
<view class="earning have-no">
<view class="money">{{taxRateObj.totalIncomeWithoutSalary}}元</view>
<view class="text">累计提现+本次提现</view>
</view>
<view class=" earning have">
<view class="money">{{taxRateObj.totalIncomeWithSalary}}元</view>
<view class="text">{{taxRateObj.withdrawalScore}}*{{taxRateObj.month}}个月+累计提现+本次提现</view>
</view>
<view class=" earning have">
<view class="money">{{taxRateObj.totalIncomeWithSalary}}元</view>
<view class="text">{{taxRateObj.withdrawalScore}}*{{taxRateObj.month}}个月+累计提现+本次提现</view>
</view>
<view class="tips">以上仅为本平台评估展示,本次提现金额不会扣除,您的真实税务建议您去<text>个人所得税APP</text>查询</view>
</view>
<view class="tips">以上仅为本平台评估展示,本次提现金额不会扣除,您的真实税务建议您去<text>个人所得税APP</text>查询</view>
</view>
<view class="tax-container"></view>
<view class="recommend-container">
<view class="recommend-title">以下为根据您此次的提现积分推荐的积分商品</view>
<view class="goods-container"></view>
<view class="suggest">若以上没有心仪商品,您可以点击<text>“去商城”</text>一键跳转积分商城选购更多商品</view>
<view class="suggest">若您仍然想提现,请点击<text>“继续提现”</text>按钮提交提现申请。</view>
<view class="btns flex_scb">
<view class="btn-text" bind:tap="goMall">去商城</view>
<view class="btn-text withdraw" bind:tap="goContinue">继续提现</view>
</view>
<view class="recommend-title">以下为根据您此次的提现积分推荐的积分商品</view>
<view class="goods-box" wx:if="{{goodsList.length}}">
<goods list="{{goodsList}}" bindjoin="handleAddToCart"></goods>
</view>
<view class="suggest">若以上没有心仪商品,您可以点击<text>“去商城”</text>一键跳转积分商城选购更多商品</view>
<view class="suggest">若您仍然想提现,请点击<text>“继续提现”</text>按钮提交提现申请。</view>
<view class="btns flex_scb">
<view class="btn-text" bind:tap="goMall">去商城</view>
<view class="btn-text withdraw" bind:tap="goContinue">继续提现</view>
</view>
</view>
</view>
<Dialog show="{{ showConfirmDialog }}" mask="true" bindbuttontap="bindButton" buttons="{{confirmButtons}}" title="提示">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!