Commit c0d80c49 by wangzhihui

积分接口联调

1 parent b9d66b94
...@@ -85,6 +85,7 @@ Component({ ...@@ -85,6 +85,7 @@ Component({
show: false show: false
}) })
this.replaceNickName(walletObj) this.replaceNickName(walletObj)
this.triggerEvent('open')
} else { } else {
wx.p.wxApi.showToast(message) wx.p.wxApi.showToast(message)
} }
......
...@@ -50,13 +50,14 @@ Component({ ...@@ -50,13 +50,14 @@ Component({
methods: { methods: {
go(e){ go(e){
console.log(e) console.log(e)
let {index} =e.currentTarget.dataset let {index} =e.currentTarget.dataset;
const thisPage = wx.p.router.getPageInstance()
let arr=[ let arr=[
()=>{ ()=>{
// 积分钱包 // 积分钱包
thisPage.open()
}, },
()=>{ ()=>{
const thisPage = wx.p.router.getPageInstance()
thisPage.toBank() thisPage.toBank()
} }
] ]
......
...@@ -30,8 +30,12 @@ Page({ ...@@ -30,8 +30,12 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
let userInfo = wx.p.storage.get('userInfo')
this.setData({
userInfo
})
//是否开通 //是否开通
// await this.openPointsWallet() await this.openPointsWallet()
this.searchScoreSummaryData() this.searchScoreSummaryData()
this.getScoreProfitListData() this.getScoreProfitListData()
}, },
...@@ -39,10 +43,10 @@ Page({ ...@@ -39,10 +43,10 @@ Page({
const { const {
phone, phone,
channelSource channelSource
} = wx.p.storage.get('userInfo'); } = this.data.userInfo;
wx.p.api.withdrawalApi.openPointsWallet({ wx.p.api.withdrawalApi.openPointsWallet({
phone, phone,
source: channelSource //1.阳光激励 2.续保用户 3.管理层 scoreSource: channelSource //1.阳光激励 2.续保用户 3.管理层
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.setData({ this.setData({
...@@ -55,6 +59,31 @@ Page({ ...@@ -55,6 +59,31 @@ Page({
wx.p.wxApi.showToast(JSON.stringify(err)) 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() { jump() {
wx.p.router.go('/packageIndex/pages/integral/withdrawalNote/withdrawalNote') wx.p.router.go('/packageIndex/pages/integral/withdrawalNote/withdrawalNote')
}, },
...@@ -63,7 +92,7 @@ Page({ ...@@ -63,7 +92,7 @@ Page({
phone, phone,
channelSource channelSource
} = wx.p.storage.get('userInfo'); } = this.data.userInfo;
wx.p.api.withdrawalApi.searchScoreSummary({ wx.p.api.withdrawalApi.searchScoreSummary({
staffPhone: phone, staffPhone: phone,
channelSource, //1.阳光激励 2.续保用户 3.管理层 channelSource, //1.阳光激励 2.续保用户 3.管理层
...@@ -89,7 +118,7 @@ Page({ ...@@ -89,7 +118,7 @@ Page({
} = this.data, { } = this.data, {
phone, phone,
channelSource, channelSource,
} = wx.p.storage.get('userInfo'); } = this.data.userInfo;
wx.p.api.withdrawalApi.getScoreProfitList({ wx.p.api.withdrawalApi.getScoreProfitList({
staffPhone: phone, staffPhone: phone,
merchantId: '44211227', merchantId: '44211227',
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"usingComponents": { "usingComponents": {
"profit-list":"./components/profitList", "profit-list":"./components/profitList",
"have-open": "./components/open", "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 \ No newline at end of file
...@@ -20,3 +20,5 @@ ...@@ -20,3 +20,5 @@
</view> </view>
</block> </block>
<!-- 开通钱包 -->
<enable-wallet show="{{showEnableWallet}}" walletObj="{{walletObj}}" bindopen="update"></enable-wallet>
...@@ -6,8 +6,8 @@ Page({ ...@@ -6,8 +6,8 @@ Page({
*/ */
data: { data: {
showConfirmDialog: false, showConfirmDialog: false,
taxRateObj: { goodsList: [],
}, taxRateObj: {},
confirmButtons: [{ confirmButtons: [{
text: '取消', text: '取消',
extClass: 'btn_cancel' extClass: 'btn_cancel'
...@@ -24,6 +24,36 @@ Page({ ...@@ -24,6 +24,36 @@ Page({
wx.p.router.getRouterParams().then(params => { wx.p.router.getRouterParams().then(params => {
this.setData(params) this.setData(params)
this.getTaxRate() 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() { getTaxRate() {
...@@ -35,7 +65,7 @@ Page({ ...@@ -35,7 +65,7 @@ Page({
} = this.data; } = this.data;
wx.p.api.withdrawalApi.getTaxRate({ wx.p.api.withdrawalApi.getTaxRate({
withdrawalScore: sumbitScore, withdrawalScore: sumbitScore,
staffPhone:phone, staffPhone: phone,
channelSource, channelSource,
merchantId: '44211227', merchantId: '44211227',
}).then(res => { }).then(res => {
......
{ {
"usingComponents": {}, "usingComponents": {
"goods": "/components/goods/goods"
},
"navigationBarTitleText": "积分提现" "navigationBarTitleText": "积分提现"
} }
\ No newline at end of file \ No newline at end of file
...@@ -35,7 +35,11 @@ ...@@ -35,7 +35,11 @@
<view class="tax-container"></view> <view class="tax-container"></view>
<view class="recommend-container"> <view class="recommend-container">
<view class="recommend-title">以下为根据您此次的提现积分推荐的积分商品</view> <view class="recommend-title">以下为根据您此次的提现积分推荐的积分商品</view>
<view class="goods-container"></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="suggest">若您仍然想提现,请点击<text>“继续提现”</text>按钮提交提现申请。</view> <view class="suggest">若您仍然想提现,请点击<text>“继续提现”</text>按钮提交提现申请。</view>
<view class="btns flex_scb"> <view class="btns flex_scb">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!