Commit 9cd79a74 by wangzhihui

积分jie'k

1 parent 9c79d042
......@@ -67,5 +67,9 @@ module.exports = {
/**开通积分钱包 */
openPointsWallet(data){
return api.fetch('scrm.api.shopmall.pointswallet.open',data)
},
/**检查银行卡身份信息 */
checkbankConfig(data){
return api.fetch('scrm.api.shopmall.score.bank.check.config',data)
}
}
\ No newline at end of file
......@@ -106,13 +106,15 @@ Page({
return new Promise((resolve) => {
const {
channelSource,
phone
phone,
merchantId,
merchantName
} = this.data.userInfo;
wx.p.api.withdrawalApi.getConfig({
channelSource,
staffPhone: phone,
merchantId: '44211227',
merchantName: '波波单店'
merchantId,
merchantName
}).then(res => {
console.log(res)
if (res.code == 0) {
......@@ -328,7 +330,9 @@ Page({
formData,
userInfo: {
phone,
channelSource
channelSource,
merchantId,
merchantName
},
checkRepeatFlag
} = this.data, {
......@@ -347,8 +351,8 @@ Page({
formData.checkRepeatFlag = checkRepeatFlag
formData.staffPhone = phone
formData.channelSource = channelSource
formData.merchantId = '44211227',
formData.merchantName = '波波单店'
formData.merchantId = merchantId
formData.merchantName = merchantName
const {
code,
message,
......
......@@ -23,15 +23,16 @@ Page({
const {
phone,
channelSource
channelSource,
merchantId,
merchantName
} = wx.p.storage.get('userInfo'),
res = await wx.p.api.withdrawalApi.getStaffBankList({
staffPhone: phone,
channelSource,
merchantId: '44211227',
merchantName: '波波单店'
merchantId,
merchantName
})
console.log(res)
if (res.code == 0) {
res && res.data?.map(e => {
e.bankNum = e.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
......
......@@ -49,7 +49,6 @@ Component({
*/
methods: {
go(e){
console.log(e)
let {index} =e.currentTarget.dataset;
const thisPage = wx.p.router.getPageInstance()
let arr=[
......
......@@ -43,6 +43,10 @@ Component({
{
text: '累计兑换',
key:'totalGoodExchangeScore',
},
{
text: '累计转赠',
key:'-',
}
],
},
......
......@@ -38,7 +38,7 @@
</view>
<view class="accumulative-content flex">
<view wx:for="{{havoData}}" wx:key="index" wx:for-item="i" class="c-item">
<view class="value">{{scoreSummary[i.key]}}</view>
<view class="value">{{scoreSummary[i.key]||'-'}}</view>
<view class="text">{{i.text}}</view>
</view>
</view>
......
......@@ -17,7 +17,7 @@ Page({
totalRewardScore: 200, //累计收益积分
totalWithdrawalScore: 400, //累计提现积分
},
open: true,
open: false,
staffBankFlag: false,
showAccountModal: false,
pageSize: 10,
......@@ -30,27 +30,30 @@ Page({
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
let userInfo = wx.p.storage.get('userInfo')
let userInfo = wx.p.storage.get('userInfo');
this.setData({
userInfo
})
//是否开通
await this.openPointsWallet()
await this.getPointsWalletData()
this.searchScoreSummaryData()
this.getScoreProfitListData()
},
openPointsWallet() {
getPointsWalletData() {
const {
phone,
nickName,
channelSource
} = this.data.userInfo;
wx.p.api.withdrawalApi.openPointsWallet({
wx.p.api.common.getPointsWalletData({
name: nickName,
phone,
scoreSource: channelSource //1.阳光激励 2.续保用户 3.管理层
}).then(res => {
if (res.code == 0) {
this.setData({
open: res.data,
open: res.data ? true : false,
isFlag: true
})
}
......@@ -81,22 +84,25 @@ Page({
})
},
//更新开通状态
update(){
this.openPointsWallet()
update() {
this.getPointsWalletData()
},
jump() {
wx.p.router.go('/packageIndex/pages/integral/withdrawalNote/withdrawalNote')
},
searchScoreSummaryData() {
const {
userInfo: {
phone,
channelSource
channelSource,
merchantId
}
} = this.data.userInfo;
} = this.data;
wx.p.api.withdrawalApi.searchScoreSummary({
staffPhone: phone,
channelSource, //1.阳光激励 2.续保用户 3.管理层
merchantId: '44211227'
merchantId
}).then(res => {
if (res.code == 0) {
this.setData({
......@@ -114,14 +120,16 @@ Page({
pageNum,
total,
pageSize,
scoreList
} = this.data, {
scoreList,
userInfo:{
phone,
channelSource,
} = this.data.userInfo;
merchantId
}
} = this.data;
wx.p.api.withdrawalApi.getScoreProfitList({
staffPhone: phone,
merchantId: '44211227',
merchantId,
channelSource,
pageSize,
pageNum
......
......@@ -2,7 +2,7 @@
<!--积分中心 -->
<block wx:if="{{isFlag}}">
<view class="integral-container {{!open?'bgF':''}}">
<have-no-ope wx:if="{{open}}" scoreSummary="{{scoreSummary}}">
<have-no-ope wx:if="{{!open}}" scoreSummary="{{scoreSummary}}">
<profit-list list="{{scoreList}}" triggered="{{triggered}}" nothing="{{nothing}}" bindscrollonReachBottom="scrollonReachBottom"></profit-list>
</have-no-ope>
<have-open wx:else scoreSummary="{{scoreSummary}}">
......
......@@ -58,7 +58,7 @@ Component({
console.log(e)
// let { url } = e.currentTarget.dataset
// const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${url}`
const path = `${this.data.url}`
// private user
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(path)}`
......
......@@ -7,6 +7,7 @@ Page({
data: {
navStyle: "background-color: transparent;",
agree: false,
isConfig: true,
showAuthDialog: false,
showConfirmDialog: false,
sumbitScore: '',
......@@ -24,7 +25,7 @@ Page({
extClass: 'btn_primary'
}],
score: '0',
bankInfo: { },
bankInfo: {},
bankList: []
},
......@@ -46,15 +47,16 @@ Page({
async getBankList() {
const {
phone,
channelSource
channelSource,
merchantId,
merchantName
} = wx.p.storage.get('userInfo'),
res = await wx.p.api.withdrawalApi.getStaffBankList({
staffPhone:phone,
staffPhone: phone,
channelSource,
merchantId: '44211227',
merchantName: '波波单店'
merchantId,
merchantName
})
console.log(res)
if (res.code == 0) {
res && res.data?.map(e => {
e.bankNum = e.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
......@@ -63,12 +65,27 @@ Page({
bankList: res.data || [],
bankInfo: res.data[0]
}, () => {
this.checkbankConfig()
//获取免责协议地址获取
this.getAgreementUrl()
})
}
},
checkbankConfig() {
let {
bankInfo
} = this.data;
wx.p.api.withdrawalApi.checkbankConfig({
id: bankInfo.id
}).then(res => {
if (res.code == 0) {
this.setData({
isConfig: res.data
})
}
})
},
getAgreementUrl() {
let {
bankInfo
......@@ -95,20 +112,46 @@ Page({
this.setData({
bankInfo
}, () => {
this.checkbankConfig()
this.getAgreementUrl()
})
},
updateBankConfig() {
let {
bankInfo,
score
} = this.data;
wx.showModal({
title: '提示',
content: '请上传您持卡人对应的身份证正反面照片!',
confirmText: '确定',
cancelText: '知道了',
confirmColor: '#F13C3D'
}).then(res => {
if (res.confirm) {
wx.p.router.go('/packageIndex/pages/bankAccount/add/add', {
item: bankInfo,
score
})
}
})
},
toSumbitData() {
let {
sumbitScore,
disclaimerAgreementUrl,
bankInfo: {
id
}
},
isConfig
} = this.data;
if (!sumbitScore) return wx.p.wxApi.showToast('请输入提现积分')
const checkAgree = this.checkAgree()
if (checkAgree) return false
if (isConfig) {
this.updateBankConfig()
return false
}
const money = this.accSub(Number(sumbitScore), 0)
if (money <= 0) return wx.p.wxApi.showToast(`您的积分不足,请确认后重新申请兑换`)
wx.p.router.go('/packageIndex/pages/integral/withdrawalRules/withdrawalRules', {
......
......@@ -3,8 +3,8 @@ Page({
data: {
STATUSICON: ['waiteing', 'comlpete', 'fail', 'ht'],
STATUSTEXT: ['处理中', '提现成功', '提现成功', '后台核销'],
pageSize: 1,
pageNum: 9999,
pageSize: 9999,
pageNum: 1,
listData: [],
isNoResult: false
},
......@@ -30,7 +30,8 @@ Page({
getScoreWithdrawalPage() {
const {
phone,
channelSource
channelSource,
merchantId
} = wx.p.storage.get('userInfo'), {
pageNum,
pageSize
......@@ -38,7 +39,7 @@ Page({
wx.p.api.withdrawalApi.getScoreWithdrawalPage({
staffPhone:phone,
channelSource,
merchantId: '44211227',
merchantId,
// staffPhone: 15626599735,
// channelSource: 1,
pageNum,
......
{
"usingComponents": {
},
"navigationBarTitleText":"兑换记录"
"navigationBarTitleText":"我的提现"
}
\ No newline at end of file
......@@ -59,7 +59,8 @@ Page({
getTaxRate() {
const {
phone,
channelSource
channelSource,
merchantId
} = wx.p.storage.get('userInfo'), {
sumbitScore
} = this.data;
......@@ -67,7 +68,7 @@ Page({
withdrawalScore: sumbitScore,
staffPhone: phone,
channelSource,
merchantId: '44211227',
merchantId
}).then(res => {
if (res.code == 0) {
this.setData({
......@@ -79,7 +80,7 @@ Page({
})
},
goMall() {
wx.p.router.redirectTo('/pages/tab/index/index')
wx.p.router.reLaunch('/pages/tab/index/index')
},
policyDetail() {
wx.p.router.jumpH5(`https://fgk.chinatax.gov.cn/zcfgk/c100012/c5241472/content.html`)
......@@ -109,7 +110,12 @@ Page({
sumbitScore,
disclaimerAgreementUrl,
bankId
} = this.data;
} = this.data,{
phone,
channelSource,
merchantId,
merchantName
} = wx.p.storage.get('userInfo');
if (this.submit) return
this.submit = true
wx.p.wxApi.showLoading('提交中')
......@@ -117,8 +123,10 @@ Page({
withdrawalScore: sumbitScore,
disclaimerAgreementUrl,
bankId,
merchantId: '44211227',
merchantName: '波波单店'
merchantId,
merchantName,
channelSource:channelSource,
staffPhone:phone,
}).then(res => {
wx.p.wxApi.hideLoading();
if (res.code == 0) {
......
......@@ -10,10 +10,10 @@ Page({
})
},
toWatchNote(){
// wx.p.router.go('/packageStoreAssistant/packageMine/pages/withdrawalNote/withdrawalNote')
wx.p.router.go('/packageIndex/pages/integral/withdrawalNote/withdrawalNote')
},
toBackMine(){
// wx.p.router.reLaunch('/pages/tab/storeAssistant/index?tabIndex=2')
wx.p.router.reLaunch('/packageIndex/pages/integral/index/index')
}
})
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!