Commit 7f889a9d by liimin

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas/mini-program/…

…points-mall into SAAS+V4.56.0-0908
2 parents 809dae53 9c62e414
Showing 52 changed files with 1068 additions and 608 deletions
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 2
let index = 1
/**
*
......
......@@ -36,27 +36,45 @@ module.exports = {
return http.getMock();
},
/**手机号验证码登录 */
phoneSmsLogin() {
phoneSmsLogin(data) {
return http.fetch('scrm.api.sso.sms.login', {
source: 'MINIAPP',
...data
})
},
/**微信授权手机号登录 */
authPhoneLogin() {
authPhoneLogin(data) {
return http.fetch('scrm.api.sso.weapp.auth.phone', {
source: 'MINIAPP',
...data
})
},
/**查询积分钱包开通状态 */
getPointsWalletStatus() {
/**获取积分渠道列表 */
getPointsSourceList(data) {
return http.fetch('scrm.api.shopmall.score.get.channelSource', {
...data
})
},
/**查询积分钱包 */
getPointsWalletData(data) {
return http.fetch('scrm.api.shopmall.pointswallet.get', {
...data
})
},
/**开通积分钱包 */
openPointsWallet() {
openPointsWallet(data) {
return http.fetch('scrm.api.shopmall.pointswallet.open', {...data})
},
/**替换积分钱包昵称 */
replaceWalletName(data) {
return http.fetch('scrm.api.sso.nickName.replace', {...data})
},
/**获取积分汇总数据 */
getPointsSummary(data) {
return http.fetch('scrm.api.shopmall.score.summary.search', {...data})
},
/**获取用户信息 */
getLoginInfo(data) {
return http.fetch('scrm.api.sso.weapp.loginfo.get', {...data})
}
};
......@@ -8,22 +8,64 @@ module.exports = {
data,
);
},
/**积分明细列表查询 */
/**根据员工id查询员工银行卡列表 */
/**积分明细列表查询 */
getScoreProfitList(data) {
return api.fetch(
'scrm.api.shopmall.score.profit.list',
data
)
},
/**积分明细查询 */
getScoreDetail(data) {
return api.fetch(
'scrm.api.shopmall.score.detail.get',
data
)
},
/**提现列表查询 */
getScoreWithdrawalPage(data) {
return api.fetch(
'scrm.api.shopmall.score.withdrawal.page',
data
)
},
/** 免责协议地址获取*/
getAgreementUrl(data) {
return api.fetch(
'scrm.api.shopmall.score.withdrawal.disclaimer.agreement.get',
data
)
},
/** 积分提现*/
saveWithdrawal(data) {
return api.fetch('scrm.api.shopmall.score.withdrawal.save', data)
},
/**查询税率 */
getTaxRate(data) {
return api.fetch('scrm.api.shopmall.score.get.taxRate', data)
},
/**根据手机号查询员工银行卡列表 */
getStaffBankList(data) {
return api.fetch(
'scrm.api.stoassistant.withdrawal.staff.bank.list',
'scrm.api.shopmall.score.bank.list',
data,
);
},
/** 插入或更新员工银行卡信息 */
insetorupdateStaffBank(data) {
return api.fetch('scrm.api.stoassistant.withdrawal.staff.bank.insetorupdate',
return api.fetch('scrm.api.shopmall.score.bank.insertOrUpdate',
data);
},
/**智能外呼-联系人 */
findByActivityIdAndPhone(data) {
return api.fetch('dracIm.api.entmicro.findByActivityIdAndPhone', data)
/**根据id查询银行卡详情 */
getBankDetail(data) {
return api.fetch('scrm.api.shopmall.score.bank.get.detail', data)
},
/**查询上传证件配置信息 */
getConfig(data){
return api.fetch('scrm.api.shopmall.score.bank.get.document.config',data)
},
/**开通积分钱包 */
openPointsWallet(data){
return api.fetch('scrm.api.shopmall.pointswallet.open',data)
}
}
\ No newline at end of file
......@@ -78,28 +78,20 @@ class Request {
},
data
} = response
if (returnAll) {
resolve(data)
return
}
if (code == 20 || code == 21) {
wx.p.storage.rm('userInfo')
wx.p.storage.rm('sessionId')
wx.p.storage.rm('channelSource')
wx.hideLoading()
const thisPage = wx.p.router.getPageInstance(),
options = Object.keys(thisPage.options)
let currentRoute = thisPage.route,
query = []
if (options.length) {
options.map(key => {
query.push(`${key}=${thisPage.options[key]}`)
})
}
if (query.length) currentRoute += `?${query.join('&')}`
return wx.p.router.redirectTo('/pages/loading/loading', {
url: `/${currentRoute}`
})
// session过期跳转到登录页
wx.p.router.reLaunch('/pages/Login/Login')
} else {
if (code == '0') {
resolve(data.data)
if (returnAll) {
resolve(data)
} else {
resolve(data.data)
}
} else {
wx.showToast({
title: message || '系统异常',
......
......@@ -6,7 +6,7 @@ page {
font-size: 28rpx;
--themeColor: #FC5B32;
--btnColor: #FC8A32;
--fontColor:#7E4C15;
--fontColor: #7E4C15;
--borderRadius: 8rpx;
--margin: 32rpx;
/* 兼容 IOS<11.2 先constant再env */
......@@ -20,6 +20,7 @@ image {
height: 100%;
vertical-align: top;
}
.flex_sc {
display: flex;
align-items: center;
......@@ -36,7 +37,20 @@ image {
align-items: center;
justify-content: space-between;
}
.suggest-box{
.suggest-box {
font-size: 28rpx;
color: #1B233D;
}
.btn_primary {
color: #FC5B32;
font-weight: 500;
font-size: 28rpx;
}
.btn_cancel {
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
color: #1B233D;
}
\ No newline at end of file
......@@ -19,9 +19,7 @@
text-align: center;
}
.btn_primary {
color: #FC5B32;
}
.status {
width: 88rpx;
......@@ -29,6 +27,7 @@
position: relative;
left:50%;
transform: translateX(-50%);
margin-bottom:28rpx;
.icon{
width:100%;
height:100%;
......
......@@ -2,6 +2,7 @@
import {
centsToyuan
} from '~/utils/format'
import cartApi from '~/api/module/cart.js'
Component({
/**
* 组件的属性列表
......@@ -43,12 +44,14 @@ Component({
// 加入购物车
joinCart(e) {
let { target } = e.currentTarget.dataset
console.log('33333')
this.triggerEvent('join', target)
}
},
lifetimes: {
attached() {
this.setWidth()
let userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo})
}
}
})
\ No newline at end of file
......@@ -11,7 +11,8 @@ Page({
*/
data: {
buttons: [{
text: '我知道了'
text: '我知道了',
extClass: 'btn_cancel'
}, {
text: '去兑换',
extClass: 'btn_primary'
......@@ -71,14 +72,15 @@ Page({
}
],
btnDisabled: true,
isEnabled: false, //是否上传身份证
formData: {
bankUserName: '',
bankPhone: '',
idCardNo: '',
bankName: '',
bankNumber: '',
bankPortrait: '',
bankEmblem: ''
idCardBack: '',
idCardFront: ''
}
},
......@@ -86,9 +88,29 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
async onLoad() {
this.initData()
this.getBankList()
// await this.getConfig()
},
getConfig() {
const {
channelSource
} = wx.p.storage.get('userInfo');
wx.p.api.withdrawalApi.getConfig({
channelSource
}).then(res => {
this.setData({
isEnabled: res.isEnabled
})
})
},
initData() {
wx.p.router.getRouterParams().then(params => {
console.log(params)
console.log(params, params)
this.options = params
let {
item
} = params;
......@@ -99,7 +121,9 @@ Page({
bankPhone: item.bankPhone,
idCardNo: item.idCardNo,
bankName: item.bankName,
bankNumber: item.bankNumber
bankNumber: item.bankNumber,
idCardBack: item.idCardBack,
idCardFront: item.idCardFront
},
isEditBank: true
})
......@@ -109,8 +133,6 @@ Page({
this.check()
}
})
this.getBankList()
},
repeatConfirm(e) {
let {
......@@ -212,9 +234,15 @@ Page({
},
check() {
const {
formData
formData,
isEnabled
} = this.data
let btnDisabled = false
//配置是否开启身份证
if (!isEnabled) {
delete formData.idCardBack
delete formData.idCardFront
}
try {
for (const key in formData) {
if (!formData[key]) throw true
......@@ -229,60 +257,73 @@ Page({
dialogClose() {
wx.p.router.back()
},
bindButton(e) {
let {
value
} = e.detail;
let dialogObj = {
0: () => {
this.dialogClose()
},
1: () => {
this.dialogConfirm()
}
}
dialogObj[value]()
},
dialogConfirm() {
const {
success,
isEditBank
} = this.data, {
score,
user
} = this.options
if (success) wx.$router.redirectTo('/packageStoreAssistant/packageMine/pages/withdrawal/withdrawal', {
score,
user,
isEditBank
score
} = this.options;
wx.p.router.redirectTo('/packageIndex/pages/integral/withdrawal/withdrawal', {
score
})
else this.setData({
this.setData({
showModal: false
})
},
async submit() {
console.log( wx.p)
const {
formData
} = this.data, {
item
} = this.options, {
uuid
} = wx.p.storage.get('userInfo'),
validateKeys = ['bankPhone', 'idCardNo']
try {
validateKeys.map(e => {
if (e == 'bankPhone' && !methods.tel(formData[e])) throw '手机号'
if (e == 'idCardNo' && !methods.idcard(formData[e])) throw '身份证'
})
} catch (error) {
return wx.$api.showToast(`请输入正确的${error}`)
}
if (item && item.id) formData.id = item.id
formData.uuid = uuid
const {
code,
message
} = await wx.p.api.withdrawalApi.insetorupdateStaffBank(formData)
if (code == '0') {
this.setData({
showModal: true,
success: 'success',
dialogText: '您的银行账户添加成功!'
})
} else {
this.setData({
showModal: true,
success: 'fail',
dialogText: `原因:${message}`
})
// wx.$api.showToast(message)
}
this.setData({
showModal: true,
success: 'success',
dialogText: '您的银行账户添加成功!'
})
// const {
// formData
// } = this.data, {
// item
// } = this.options, {
// uuid
// } = wx.p.storage.get('userInfo'),
// validateKeys = ['bankPhone', 'idCardNo']
// try {
// validateKeys.map(e => {
// if (e == 'bankPhone' && !methods.tel(formData[e])) throw '手机号'
// if (e == 'idCardNo' && !methods.idcard(formData[e])) throw '身份证'
// })
// } catch (error) {
// return wx.p.wxApi.showToast(`请输入正确的${error}`)
// }
// if (item && item.id) formData.id = item.id
// formData.uuid = uuid
// const {
// code,
// message
// } = await wx.p.api.withdrawalApi.insetorupdateStaffBank(formData)
// if (code == '0') {
// this.setData({
// showModal: true,
// success: 'success',
// dialogText: '您的银行账户添加成功!'
// })
// } else {
// this.setData({
// showModal: true,
// success: 'fail',
// dialogText: `原因:${message}`
// })
// // wx.$api.showToast(message)
// }
}
})
\ No newline at end of file
......@@ -21,19 +21,22 @@
</picker>
</block>
<block wx:elif="{{item.upload}}">
<view class="upload-wrap" bind:tap="upload" data-item="{{item}}">
<view class="label">{{item.label}}</view>
<block wx:if="{{ !formData[item.key]}}">
<view class="upload" bind:tap="upload" data-item="{{item}}">
<glsx-image src="/bankAccount/{{item.icon}}.png" class="bank-icon"></glsx-image>
<view class="text">上传照片</view>
<block wx:if="{{isEnabled}}">
<view class="upload-wrap" bind:tap="upload" data-item="{{item}}">
<view class="label">{{item.label}}</view>
<block wx:if="{{ !formData[item.key]}}">
<view class="upload" bind:tap="upload" data-item="{{item}}">
<glsx-image src="/bankAccount/{{item.icon}}.png" class="bank-icon"></glsx-image>
<view class="text">上传照片</view>
</view>
</block>
<view wx:else class="select-url">
<image webp src="{{formData[item.key]}}" class="bank-img"></image>
<glsx-image src="/bankAccount/del.png" class="del-icon" catch:tap="del" data-item="{{item}}"></glsx-image>
</view>
</view>
</block>
<view wx:else class="select-url" >
<image webp src="{{formData[item.key]}}" class="bank-img"></image>
<glsx-image src="/bankAccount/del.png" class="del-icon" catch:tap="del" data-item="{{item}}"></glsx-image>
</view>
</view>
</block>
<block wx:else>
......@@ -42,7 +45,6 @@
<input value="{{ formData[item.key] }}" placeholder="{{item.placeholder}}" placeholder-style="color: #CECECE;" class="input" input-align="right" maxlength="{{item.maxlength}}" type="{{item.type}}" bindinput="bindInput" data-item="{{item}}" placeholder-class="placeStyle" />
</view>
</mp-cell>
<!-- <van-field value="{{ formData[item.key] }}" clearable label="{{item.label}}" placeholder="{{item.placeholder}}" placeholder-style="color: #CECECE;" border="{{false}}" label-class="label" input-class="input" input-align="right" maxlength="{{item.maxlength}}" type="{{item.type}}" bindinput="bindInput" data-item="{{item}}" /> -->
</block>
</view>
......@@ -53,15 +55,15 @@
<!-- disabled="{{btnDisabled}}" -->
<button class="button text-center" disabled="{{btnDisabled}}" hover-class="btn-hover" loading="{{submitLoading}}" bindtap="submit">提交</button>
</block>
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" statusIcon="{{success}}">
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="bindButton" buttons="{{buttons}}" statusIcon="{{success}}">
<view class="suggest-box">
{{success}}
{{dialogText}}
</view>
</Dialog>
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="repeatConfirm" buttons="{{repeatButtons}}" title="提示">
<!-- <Dialog show="{{ showModal }}" mask="true" bindbuttontap="repeatConfirm" buttons="{{repeatButtons}}" title="提示">
<view class="suggest-box">
建议您不要添加同一个人的多张卡片,避免提现时个人税务汇算累积
</view>
</Dialog>
</Dialog> -->
<!-- <dialog show="{{showModal}}" confirmText="{{success?'去兑换':'我知道了'}}" cancelText="我知道了" showCancelButton success="{{success}}" bindconfirm="dialogConfirm" bindcancel="dialogClose" text="{{dialogText}}"> -->
<!-- </dialog> -->
\ No newline at end of file
......@@ -5,13 +5,13 @@ Page({
* 页面的初始数据
*/
data: {
flag: false
},
/**
* 生命周期函数--监听页面显示
*/
onLoad(options) {
// this.getBankList()
this.getBankList()
// res = await MineApi.getStaffBankList({
// uuid
// })
......@@ -46,19 +46,26 @@ Page({
})
},
async getBankList() {
const {
uuid
staffPhone,
channelSource
} = wx.p.storage.get('userInfo'),
res = await wx.p.api.withdrawalApi.getStaffBankList({
uuid
staffPhone,
channelSource
})
res && res?.map(e => {
e.bankNum = e.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
})
this.setData({
list: res || [],
flag: true
})
console.log(res)
if (res.code ==0) {
res && res.data?.map(e => {
e.bankNum = e.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
})
this.setData({
list: res.data || [],
flag: true
})
}
},
jump(e) {
const {
......
......@@ -2,6 +2,6 @@
"navigationStyle": "custom",
"usingComponents":{
"mp-html":"/components/mp-html/index",
"sku": "./components/Sku"
"sku": "/components/Sku"
}
}
\ No newline at end of file
......@@ -4,7 +4,13 @@ Component({
* 组件的属性列表
*/
properties: {
scoreSummary:{
type:Object,
value: {},
observer(n){
}
}
},
/**
......@@ -25,15 +31,15 @@ Component({
havoNOData:[
{
text:'累计收益积分',
value:9505.50
key:'totalRewardScore',
},
{
text:'累计提现积分',
value:9505.50
key:'totalWithdrawalScore',
},
{
text:'累计兑换积分',
value:9505.50
key:'totalGoodExchangeScore',
}
],
},
......
......@@ -28,10 +28,10 @@
<view class="title">我的积分</view>
<view class="integral">
<glsx-image webp src="/integral/logo.png" class="gold"></glsx-image>
<view class="number --fontColor">1680</view>
<view class="number"> {{scoreSummary.currentScore}}</view>
</view>
</view>
<view class="flex note-btn --fontColor" bind:tap="goRecord">提现记录 <glsx-image webp src="/integral/right.png" class="right"></glsx-image>
<view class="flex note-btn" bind:tap="goRecord">提现记录 <glsx-image webp src="/integral/right.png" class="right"></glsx-image>
</view>
<view class="flex withdraw" bind:tap="toCash">
......@@ -42,7 +42,7 @@
<view class="content flex">
<view wx:for="{{havoNOData}}" wx:key="index" wx:for-item="i" class="c-item">
<view class="value">{{i.value}}</view>
<view class="value">{{scoreSummary[i.key]}}</view>
<view class="text">{{i.text}}</view>
</view>
</view>
......
......@@ -4,7 +4,13 @@ Component({
* 组件的属性列表
*/
properties: {
scoreSummary:{
type:Object,
value: {},
observer(n){
}
}
},
/**
......@@ -13,7 +19,7 @@ Component({
data: {
navStyle: "background-color: transparent;",
guideList: [{
value: 3,
key: 'bankCardSize',
text: '银行卡',
rightIcon: 'right'
},
......@@ -28,19 +34,15 @@ Component({
],
havoData: [{
text: '累计收益',
value: 9505.50
key:'totalRewardScore',
},
{
text: '累计提现',
value: 9505.50
key:'totalWithdrawalScore',
},
{
text: '累计兑换',
value: 9505.50
},
{
text: '累计转赠',
value: 9505.50
key:'totalGoodExchangeScore',
}
],
},
......
......@@ -20,7 +20,7 @@
<glsx-image webp src="/integral/logo.png" class="gold"></glsx-image>宋慧的总积分
</view>
<view class="integral">
1680
{{scoreSummary.currentScore}}
</view>
</view>
<view class="flex withdraw" bind:tap="toCash">
......@@ -29,7 +29,7 @@
</view>
<view class="guide-wrap flex">
<view wx:for="{{guideList}}" class="guide flex" wx:for-item="g" wx:key="index" bind:tap="go" data-index="{{index}}">
<view class="value" wx:if="{{g.value}}">{{g.value}}</view>
<view class="value" wx:if="{{g.key}}">{{scoreSummary[g.key]}}</view>
<glsx-image webp src="/integral/{{g.leftIcon}}.png" class="left" wx:if="{{g.leftIcon}}"></glsx-image>
<view class="text">{{g.text}}</view>
<glsx-image webp src="/integral/{{g.rightIcon}}.png" class="right" wx:if="{{g.rightIcon}}"></glsx-image>
......@@ -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">{{i.value}}</view>
<view class="value">{{scoreSummary[i.key]}}</view>
<view class="text">{{i.text}}</view>
</view>
</view>
......
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
type: Array,
value: [],
observer(n) {
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
.list_widget {
// margin-top: 674rpx;
background: #FFFFFF;
border: 2rpx solid #FFFFFF;
border-radius: 24rpx;
padding: 32rpx 28rpx;
margin: 20rpx;
box-sizing: border-box;
.title_wrap {
font-weight: 500;
font-size: 34rpx;
color: #0A0D14;
text-align: center;
}
}
.list_data_widget {
box-sizing: border-box;
.element {
width: 100%;
border-bottom: 2rpx solid #f2f2f2;
padding: 28rpx 0;
position: relative;
.title {
font-weight: 500;
font-size: 28rpx;
color: #292D33;
line-height: 44rpx;
display: flex;
align-items: center;
}
.date {
font-weight: 400;
font-size: 24rpx;
color: #8F959E;
line-height: 36rpx;
margin-top: 8rpx;
}
.price {
position: absolute;
right: 0;
top: 50%;
transform: translate(0, -50%);
color: #FB8A32;
font-size: 40rpx;
display: flex;
align-items: center;
.mini {
font-size: 32rpx;
}
}
.blackColor {
color: #333333;
}
.right-icon {
width: 32rpx;
height: 32rpx;
margin-left: 4rpx;
}
.tip {
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 44rpx;
margin-right: 12rpx;
}
}
.no_more_tip {
margin-top: 40rpx;
font-weight: 400;
font-size: 24rpx;
color: #BEBEBE;
line-height: 36rpx;
text-align: center;
}
}
\ No newline at end of file
<view class="list_widget">
<view class="title_wrap">
收益明细
</view>
<view class="list_data_widget">
<block wx:for="{{list}}" wx:key="index">
<view class="element" bind:tap="handleDetail" data-id="{{item.id}}">
<view class="title">{{item.infoName}} <view class="right-icon-box">
</view>
</view>
<view class="date">{{item.updatedTime}}</view>
<view class="price {{item.type==0?'':'blackColor'}}">
<text wx:if="{{item.infoName==='积分商品售后'}}" class="tip">退还</text>
<text class="mini">{{item.type==0?'+':'-'}}</text>
<text>{{item.rewardScore}}</text>
<glsx-image mode="widthFix" class="right-arrow" src="/integral/arrow.png" />
</view>
</view>
</block>
<view wx:if="{{list.length}}" class="no_more_tip">没有更多啦</view>
<view wx:else class="no_more_tip">暂无收益明细</view>
</view>
</view>
\ No newline at end of file
......@@ -7,9 +7,21 @@ Page({
* 页面的初始数据
*/
data: {
open: false,
isFlag:true,
scoreSummary: {
currentScore: 345333.00, //当前积分
bankCardSize: 4,
totalGoodExchangeScore: 100, //累计兑换积分
totalRewardScore: 200, //累计收益积分
totalWithdrawalScore: 400, //累计提现积分
},
open: true,
staffBankFlag: false,
showAccountModal: false,
listData: [{
pageSize: 10,
pageNum: 1,
total: 0,
scoreList: [{
id: 2104467,
infoName: "积分兑换",
rewardScore: 5,
......@@ -27,12 +39,82 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
async onLoad(options) {
console.log(wx.p)
await this.openPointsWallet()
this.searchScoreSummaryData()
this.getScoreProfitListData()
},
openPointsWallet(){
const {
staffPhone,
channelSource
} = wx.p.storage.get('userInfo');
wx.p.api.withdrawalApi.openPointsWallet({
phone:staffPhone,
source:channelSource //1.阳光激励 2.续保用户 3.管理层
}).then(res => {
if (res.code == 0) {
this.setData({
open: res.data,
isFlag:true
})
}
}).catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err))
})
},
jump() {
wx.p.router.go('/packageIndex/pages/integral/withdrawalNote/withdrawalNote')
},
searchScoreSummaryData() {
const {
staffPhone,
channelSource
} = wx.p.storage.get('userInfo');
wx.p.api.withdrawalApi.searchScoreSummary({
staffPhone,
channelSource //1.阳光激励 2.续保用户 3.管理层
}).then(res => {
if (res.code == 0) {
this.setData({
scoreSummary: res.data,
staffBankFlag: !res.data.bankCardSize
})
}
}).catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err))
})
},
getScoreProfitListData() {
let {
pageNum,
total,
pageSize
} = this.data;
wx.p.api.withdrawalApi.getScoreProfitList({
staffPhone: '',
channelSource: '',
pageSize,
pageNum
}).then(res => {
let data;
if (res.code == 0) {
data = res.data?.list ? res.data?.list : []
}
this.setData({
scoreList: pageNum == 1 ? data : [...scoreList, ...data],
total: res.data.count,
mineTrigger: false
})
}).catcn((err) => {
wx.p.wxApi.showToast(JSON.stringify(err))
})
},
toBank() {
wx.p.router.go('/packageIndex/pages/bankAccount/list/list')
},
......@@ -52,23 +134,32 @@ Page({
/**跳转至银行卡 */
toAddBankAccount(e) {
const {
score,
user
} = wx.p.router.router.getPageInstance()
currentScore,
} = this.data.scoreSummary;
this.setData({
showAccountModal: false
}, () => {
wx.p.router.router.go('/packageStoreAssistant/packageMine/pages/bankAccount/detail/detail', {
score,
user
wx.p.router.go('/packageIndex/pages/bankAccount/add/add', {
score: currentScore
})
})
},
toCash(){
// this.setData({
// showAccountModal: true
// })
wx.p.router.go('/packageIndex/pages/integral/withdrawal/withdrawal')
toCash() {
const {
currentScore,
} = this.data.scoreSummary,{
staffBankFlag
}=this.data;
if (staffBankFlag) {
this.setData({
showAccountModal: true
})
return
}
wx.p.router.go('/packageIndex/pages/integral/withdrawal/withdrawal',{
score: currentScore
})
},
back() {
wx.p.router.back()
......
{
"navigationStyle": "custom",
"usingComponents": {
"have-open":"./components/open",
"have-no-ope":"./components/noOpen"
"profit-list":"./components/profitList",
"have-open": "./components/open",
"have-no-ope": "./components/noOpen"
}
}
\ No newline at end of file
......@@ -5,92 +5,7 @@
align-items: center;
}
.list_widget {
// margin-top: 674rpx;
background: #FFFFFF;
border: 2rpx solid #FFFFFF;
border-radius: 24rpx;
padding: 32rpx 28rpx;
margin: 20rpx;
box-sizing: border-box;
.title_wrap {
font-weight: 500;
font-size: 34rpx;
color: #0A0D14;
text-align: center;
}
}
.list_data_widget {
box-sizing: border-box;
.element {
width: 100%;
border-bottom: 2rpx solid #f2f2f2;
padding: 28rpx 0;
position: relative;
.title {
font-weight: 500;
font-size: 28rpx;
color: #292D33;
line-height: 44rpx;
display: flex;
align-items: center;
}
.date {
font-weight: 400;
font-size: 24rpx;
color: #8F959E;
line-height: 36rpx;
margin-top: 8rpx;
}
.price {
position: absolute;
right: 0;
top: 50%;
transform: translate(0, -50%);
color: #FB8A32;
font-size: 40rpx;
display: flex;
align-items: center;
.mini {
font-size: 32rpx;
}
}
.blackColor {
color: #333333;
}
.right-icon {
width: 32rpx;
height: 32rpx;
margin-left: 4rpx;
}
.tip {
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 44rpx;
margin-right: 12rpx;
}
}
.no_more_tip {
margin-top: 40rpx;
font-weight: 400;
font-size: 24rpx;
color: #BEBEBE;
line-height: 36rpx;
text-align: center;
}
}
}
......
<!--packageIndex/pages/integral/index/index.wxml-->
<!--积分中心 -->
<view class="integral-container {{!open?'bgF':''}}">
<have-no-ope wx:if="{{open}}">
<view class="list_widget">
<view class="title_wrap">
收益明细
</view>
<view class="list_data_widget">
<block wx:for="{{listData}}" wx:key="index">
<view class="element" bind:tap="handleDetail" data-id="{{item.id}}">
<view class="title">{{item.infoName}} <view class="right-icon-box">
</view>
</view>
<view class="date">{{item.updatedTime}}</view>
<view class="price {{item.type==0?'':'blackColor'}}">
<text wx:if="{{item.infoName==='积分商品售后'}}" class="tip">退还</text>
<text class="mini">{{item.type==0?'+':'-'}}</text>
<text>{{item.rewardScore}}</text>
<glsx-image mode="widthFix" class="right-arrow" src="/integral/arrow.png" />
</view>
</view>
</block>
<view wx:if="{{listData.length}}" class="no_more_tip">没有更多啦</view>
<view wx:else class="no_more_tip">暂无收益明细</view>
</view>
</view>
<block wx:if="{{isFlag}}">
<view class="integral-container {{!open?'bgF':''}}">
<have-no-ope wx:if="{{open}}" scoreSummary="{{scoreSummary}}">
<profit-list list="{{scoreList}}"></profit-list>
</have-no-ope>
<have-open wx:else>
<view class="list_widget">
<view class="title_wrap">
收益明细
</view>
<view class="list_data_widget">
<block wx:for="{{listData}}" wx:key="index">
<view class="element" bind:tap="handleDetail" data-id="{{item.id}}">
<view class="title">{{item.infoName}} <view class="right-icon-box">
</view>
</view>
<view class="date">{{item.updatedTime}}</view>
<view class="price {{item.type==0?'':'blackColor'}}">
<text wx:if="{{item.infoName==='积分商品售后'}}" class="tip">退还</text>
<text class="mini">{{item.type==0?'+':'-'}}</text>
<text>{{item.rewardScore}}</text>
<glsx-image mode="widthFix" class="right-arrow" src="/integral/arrow.png" />
</view>
</view>
</block>
<view wx:if="{{listData.length}}" class="no_more_tip">没有更多啦</view>
<view wx:else class="no_more_tip">暂无收益明细</view>
</view>
</view>
<have-open wx:else scoreSummary="{{scoreSummary}}">
<profit-list list="{{scoreList}}"></profit-list>
</have-open>
</view>
......@@ -61,4 +18,5 @@
<button class="modal_btn" catchtap="toAddBankAccount">去添加</button>
</view>
</view>
\ No newline at end of file
</view>
</block>
......@@ -23,10 +23,10 @@ Component({
// type: Boolean,
// value: false
// },
// index: {
// type: Boolean,
// value: false
// }
url: {
type: String,
value: ''
},
agree: Boolean
},
......@@ -56,9 +56,9 @@ Component({
},
jump(e) {
console.log(e)
let { url } = e.currentTarget.dataset
const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${baseUrl}${url}.html`
// let { url } = e.currentTarget.dataset
// const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${url}`
// private user
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(path)}`
......
......@@ -9,7 +9,8 @@ Page({
agree: false,
showAuthDialog: false,
showConfirmDialog: false,
sumbitScore: '250.00',
sumbitScore: '',
disclaimerAgreementUrl: '',
buttons: [{
text: '取消'
}, {
......@@ -22,19 +23,7 @@ Page({
text: '确认',
extClass: 'btn_primary'
}],
score: {
"bankWithdrawalScore": "230.00",
"currentScore": "0.00",
"existBankWithdrawal": false,
"existWechatMotivationWithdrawal": false,
"motivationWithdrawalScore": "0.00",
"notExchangeScore": "0.00",
"supportWithdrawalScore": "0.00",
"totalRewardScore": "0.00",
"totalWithdrawalScore": "0.00",
"wechatMotivationWithdrawalScore": "0.00",
"wechatWithdrawalScore": "0.00"
},
score: '10000',
bankInfo: {
"id": 34,
"staffId": 16550,
......@@ -79,22 +68,58 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log( wx.p)
this.getBankList()
console.log(wx.p)
wx.p.router.getRouterParams().then(params => {
console.log(params)
this.setData(params)
})
this.getBankList()
},
back() {
wx.p.router.back()
},
jump() {
},
async getBankList(){
async getBankList() {
const {
uuid
} = wx.p.storage.get('userInfo'),
staffPhone,
channelSource
} = wx.p.storage.get('userInfo'),
res = await wx.p.api.withdrawalApi.getStaffBankList({
uuid
staffPhone,
channelSource
})
res && res?.map(e => {
e.bankNum = e.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
})
this.setData({
list: res || [],
flag: true
console.log(res)
if (res.code == 0) {
res && res.data?.map(e => {
e.bankNum = e.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
})
this.setData({
bankList: res.data || [],
flag: true,
bankInfo: res.data[0]
}, () => {
//获取免责协议地址获取
this.getAgreementUrl()
})
}
},
getAgreementUrl() {
let {
bankInfo
} = this.data;
wx.p.api.withdrawalApi.getAgreementUrl({
bankUserName: bankInfo.bankUserName
}).then(res => {
if (res.code == 0) {
this.setData({
disclaimerAgreementUrl: res.data
})
}
}).catch((err) => {
wx.p.wxApi.showToast(err)
})
},
bindPickerChange(e) {
......@@ -106,68 +131,24 @@ Page({
bankInfo.bankNum = bankInfo.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
this.setData({
bankInfo
}, () => {
this.getAgreementUrl()
})
},
toSumbitData() {
if (this.submit) return
let {sumbitScore,disclaimerAgreementUrl,bankInfo:{
id
} }=this.data;
if (!sumbitScore) return wx.p.wxApi.showToast('请输入提现积分')
const checkAgree = this.checkAgree()
if (checkAgree) return false
wx.p.router.go('/packageIndex/pages/integral/withdrawalSuccess/withdrawalSuccess')
// wx.p.wxApi.showToast('有一笔兑换正在进行')
// let {
// sumbitScore,
// score: {
// existWechatMotivationWithdrawal
// }
// } = this.data
// let withDrawType = 3
// const money = this.accSub(Number(sumbitScore), 0)
// if (money <= 0) return wx.p.wxApi.showToast(`您的积分不足,请确认后重新申请兑换`)
// // this.comfirmSumbit(sumbitScore, withDrawType)
// this.setData({
// showConfirmDialog: true
// })
},
// 提现确认模块
comfirmSumbit(sumbitScore, withDrawType, rateQuery = {}, sourceFrom) {
let {
tabIndex,
tabData,
} = this.data;
Dialog.confirm({
title: '提示',
message: `请确认是否将${sumbitScore}积分进行兑换`,
}).then(() => {
if (this.submit) return
this.submit = true
wx.p.api.showLoading('提交中')
MineApi.WithdrawalApi({
withdrawalScore: sumbitScore,
withDrawType,
sourceFrom,
wechatAppId: appId,
withdrawalSource: 3,
...rateQuery
}).then(res => {
wx.hideLoading();
if (res.code == 0) {
wx.p.eventbus.off('REFRESH_WITHDRALWAL')
wx.p.router.redirectTo('/packageStoreAssistant/packageMine/pages/withdrawalSuccess/withdrawalSuccess', {
title: tabData[tabIndex]
})
} else {
wx.p.wxApi.showToast(res.message)
this.submit = false
}
}).catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err))
this.submit = false
})
}).catch(() => {
this.submit = 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', {
sumbitScore,
disclaimerAgreementUrl,
bankId: id
})
},
accSub(arg1, arg2) {
let r1, r2, m, n;
......@@ -187,15 +168,10 @@ Page({
},
toTixianAll() {
let {
score: {
existBankWithdrawal,
bankWithdrawalScore,
wechatWithdrawalScore
}
} = this.data,
withdrawalScore = bankWithdrawalScore
score
} = this.data;
this.setData({
sumbitScore: withdrawalScore
sumbitScore: score
})
},
handleInput(e) {
......@@ -204,16 +180,11 @@ Page({
} = e.detail
let {
sumbitScore,
score: {
existBankWithdrawal,
bankWithdrawalScore,
wechatWithdrawalScore
},
} = this.data,
withdrawalScore = bankWithdrawalScore
sumbitScore = this.priceVerify(value, withdrawalScore)
score
} = this.data;
sumbitScore = this.priceVerify(value, score)
this.setData({
sumbitScore: sumbitScore||''
sumbitScore: sumbitScore || ''
})
},
// 价格输入校验规则(提现积分值:最小值需大于0)
......
......@@ -15,7 +15,7 @@
</view>
<view class="to-cash" style="top:{{navHeight}}px; margin-top:-474rpx">
<view class="text">当前可提现积分</view>
<view class="value">1680</view>
<view class="value">{{score}}</view>
<view class="operate-wrap">
<view class="info">本次提现积分</view>
<view class="operate">
......@@ -38,7 +38,7 @@
</view>
<view class="auth_box">
<!-- 协议 -->
<auth-setting bind:choose="authChoose" agree="{{ agree }}" />
<auth-setting bind:choose="authChoose" agree="{{ agree }}" url="{{disclaimerAgreementUrl}}" />
</view>
<view class="submit" bind:tap="toSumbitData">提交</view>
</view>
......@@ -52,8 +52,3 @@
</view>
</Dialog>
<Dialog show="{{ showConfirmDialog }}" mask="true" bindbuttontap="comfirmSumbit" buttons="{{confirmButtons}}" title="提示">
<view class="suggest-box">
您的银行账户修改成功!
</view>
</Dialog>
\ No newline at end of file
// import MineApi from '~/api/mineApi/index'
Page({
data: {
STATUSICON: ['waiteing', 'comlpete', 'fail', 'ht'],
STATUSTEXT:['处理中','提现成功','提现成功','后台核销'],
STATUSTEXT: ['处理中', '提现成功', '提现成功', '后台核销'],
pageSize:1,
pageNum:9999,
listData: [],
isNoResult: false
},
toastError(e){
toastError(e) {
const {
reason
} = e.currentTarget.dataset
// wx.$api.showToast(reason);
wx.showModal({
title: '',
content:String(reason) ,
content: String(reason),
showCancel: false,
confirmText: '我知道了',
confirmColor: '#1B233D',
success(res) {
}
success(res) {}
})
},
onLoad(options) {
// MineApi.getWithdrawalListApi().then(res => {
// if (res && res.length) {
let res=[ {
"id" : 16118,
"wechatAvatarUrl" : null,
"wechatNickName" : null,
"withdrawalScore" : 50995.46,
"withdrawalTime" : "2025-08-15 09:48",
"successTime" : null,
"status" : 4,
"type" : 3,
"bankUserName" : "望周知",
"bankName" : "中国邮政储蓄银行",
"bankNumber" : "6555555555555555555",
"bankPhone" : "18955555555",
"idCardNo" : "341181199508252222",
"exportStatus" : 0,
"failReason" : null,
"source" : 1
},{"id" : 16067,
"wechatAvatarUrl" : null,
"wechatNickName" : null,
"withdrawalScore" : 32.00,
"withdrawalTime" : "2024-11-08 17:17",
"successTime" : "2024-11-08 17:25",
"status" : 3,
"type" : 3,
"bankUserName" : "姚孝章",
"bankName" : "招商银行",
"bankNumber" : "6214830050900165",
"bankPhone" : "13650810420",
"idCardNo" : "440582199609153643",
"exportStatus" : 0,
"failReason" : null,
"source" : 1
this.getScoreWithdrawalPage()
let res = [{
"id": 16118,
"wechatAvatarUrl": null,
"wechatNickName": null,
"withdrawalScore": 50995.46,
"withdrawalTime": "2025-08-15 09:48",
"successTime": null,
"status": 4,
"type": 3,
"bankUserName": "望周知",
"bankName": "中国邮政储蓄银行",
"bankNumber": "6555555555555555555",
"bankPhone": "18955555555",
"idCardNo": "341181199508252222",
"exportStatus": 0,
"failReason": null,
"source": 1
}, {
"id" : 16066,
"wechatAvatarUrl" : null,
"wechatNickName" : null,
"withdrawalScore" : 30.50,
"withdrawalTime" : "2024-11-08 15:55",
"successTime" : null,
"status" : 2,
"type" : 3,
"bankUserName" : "姚孝章",
"bankName" : "招商银行",
"bankNumber" : "6214830050900165",
"bankPhone" : "13650810420",
"idCardNo" : "440582199609153643",
"exportStatus" : 0,
"failReason" : null,
"source" : 1
} ]
console.log(2222)
res.map(item => {
"id": 16067,
"wechatAvatarUrl": null,
"wechatNickName": null,
"withdrawalScore": 32.00,
"withdrawalTime": "2024-11-08 17:17",
"successTime": "2024-11-08 17:25",
"status": 3,
"type": 3,
"bankUserName": "姚孝章",
"bankName": "招商银行",
"bankNumber": "6214830050900165",
"bankPhone": "13650810420",
"idCardNo": "440582199609153643",
"exportStatus": 0,
"failReason": null,
"source": 1
}, {
"id": 16066,
"wechatAvatarUrl": null,
"wechatNickName": null,
"withdrawalScore": 30.50,
"withdrawalTime": "2024-11-08 15:55",
"successTime": null,
"status": 2,
"type": 3,
"bankUserName": "姚孝章",
"bankName": "招商银行",
"bankNumber": "6214830050900165",
"bankPhone": "13650810420",
"idCardNo": "440582199609153643",
"exportStatus": 0,
"failReason": null,
"source": 1
}]
console.log(2222)
res.map(item => {
if (item.status == 3) {
item.iconType = 1
} else if (item.status == 4) {
item.iconType = 2
} else {
item.iconType = 0
}
if (item.type == 2) {
item.iconType = 3
}
if (item.type == 3 && item.bankNumber) {
item.bankNumber = item.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
}
return item
})
// }
let flag = res.length ? false : true
this.setData({
listData: res || [],
isNoResult: flag
})
// })
},
getScoreWithdrawalPage() {
const {
staffPhone,
channelSource
} = wx.p.storage.get('userInfo'),
{pageNum,pageSize}=this.data;
wx.p.api.withdrawalApi.getScoreWithdrawalPage({
staffPhone,
channelSource,
pageNum,
pageSize
}).then(res => {
if (res.code == 0) {
res.list.map(item => {
if (item.status == 3) {
item.iconType = 1
} else if (item.status == 4) {
......@@ -91,19 +128,19 @@ Page({
if (item.type == 2) {
item.iconType = 3
}
if(item.type == 3 && item.bankNumber ){
if (item.type == 3 && item.bankNumber) {
item.bankNumber = item.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
}
return item
})
}
// }
let flag = res.length ? false : true
let flag = res.list.length ? false : true
this.setData({
listData: res || [],
listData: res.list || [],
isNoResult: flag
})
// })
})
}
})
\ No newline at end of file
......@@ -3,37 +3,38 @@
<view wx:if="{{!isNoResult}}" class="list">
<block wx:for="{{listData}}" wx:key="index">
<view class="element">
<view class="status {{STATUSICON[item.iconType]}}">{{STATUSTEXT[item.iconType]}}</view>
<block wx:if="{{item.type == 3}}">
<view class="bank-info">
<view class="name">
{{item.bankName || ''}}({{item.bankUserName|| ''}})
</view>
<view class="card-no">
{{item.bankNumber|| ''}}
</view>
<view class="status {{STATUSICON[item.iconType]}}">{{STATUSTEXT[item.iconType]}}</view>
<block wx:if="{{item.type == 3}}">
<view class="bank-info">
<view class="name">
{{item.bankName || ''}}({{item.bankUserName|| ''}})
</view>
<view class="card-no">
{{item.bankNumber|| ''}}
</view>
</view>
</block>
<view class="countText flex">
-{{item.withdrawalScore}}
<!-- <block wx:if="{{item.status == 4&&item.failReason}}">
<view class="type flex">
<view class="failReason">{{item.failReason}} </view>
<glsx-image mode="widthFix" class="error-icon" bind:tap="toastError" data-reason="{{item.failReason}}" src="store-assistant/error-icon.png" />
</view>
</block> -->
<block>
<view class="type">
银行卡兑换
</view>
</block>
<view class="countText flex">
-{{item.withdrawalScore}}
<block wx:if="{{item.status == 4&&item.failReason}}">
<view class="type flex"><view class="failReason">{{item.failReason}} </view> <glsx-image mode="widthFix" class="error-icon" bind:tap="toastError" data-reason="{{item.failReason}}" src="store-assistant/error-icon.png" /></view>
</block>
<block wx:else>
<view wx:if="{{item.type == -1}}" class="type">
消耗积分
</view>
<view wx:else class="type">
{{item.type == 3 ?'银行卡':item.type == 1?'零钱':'微信'}}兑换
</view>
</block>
</view>
<view class="line"></view>
<view class="date_wrap flex_scb">
<view class="dateText">{{item.type == -1 ?'兑换':'申请'}}时间:{{item.withdrawalTime || ''}}</view>
<view wx:if="{{item.successTime}}" class="dateText">完成时间:{{item.successTime || ''}}</view>
</view>
</view>
<view class="line"></view>
<view class="date_wrap flex_scb">
<view class="dateText">{{item.type == -1 ?'兑换':'申请'}}时间:{{item.withdrawalTime || ''}}</view>
<view wx:if="{{item.successTime}}" class="dateText">完成时间:{{item.successTime || ''}}</view>
</view>
</view>
</block>
</view>
......
......@@ -5,23 +5,120 @@ Page({
* 页面的初始数据
*/
data: {
showConfirmDialog: false,
taxRateObj: {
withdrawalScore: 1000,
totalWithdrawalScore: 2000,
month: 2,
totalIncomeWithoutSalary: 2100,
taxRateWithoutSalary:3,
totalIncomeWithSalary: 33322,
taxRateWithSalary: 10,
baseIncome: 8989
},
confirmButtons: [{
text: '取消',
extClass: 'btn_cancel'
}, {
text: '确认',
extClass: 'btn_primary'
}],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.p.router.getRouterParams().then(params => {
this.setData(params)
this.getTaxRate()
})
},
getTaxRate() {
const {
staffPhone,
channelSource
} = wx.p.storage.get('userInfo'), {
sumbitScore
} = this.data;
wx.p.api.WithdrawalApi.getTaxRate({
withdrawalScore: sumbitScore,
staffPhone,
channelSource
}).then(res => {
if (res.code == 0) {
this.setData({
taxRateObj: res.data
})
}
}).catch(err => {
wx.p.wxApi.showToast(JSON.stringify(err))
})
},
goMall() {
wx.p.router.replace('/pages/tab/index/index')
wx.p.router.redirectTo('/pages/tab/index/index')
},
policyDetail() {
wx.p.router.jumpH5(`https://fgk.chinatax.gov.cn/zcfgk/c100012/c5241472/content.html`)
},
goContinue(){
wx.p.router.replace('/packageIndex/pages/integral/withdrawalSuccess/withdrawalSuccess')
bindButton(e) {
let {
value
} = e.detail;
let dialogObj = {
0: () => {
this.dialogClose()
},
1: () => {
this.dialogConfirm()
}
}
dialogObj[value]()
},
dialogClose() {
this.submit = false
this.setData({
showConfirmDialog: false,
})
},
dialogConfirm() {
let {
sumbitScore,
disclaimerAgreementUrl,
bankInfo: {
id
}
} = this.data;
if (this.submit) return
this.submit = true
wx.p.wxApi.showLoading('提交中')
wx.p.api.WithdrawalApi.saveWithdrawal({
withdrawalScore: sumbitScore,
disclaimerAgreementUrl,
bankId: id
}).then(res => {
wx.p.wxApi.hideLoading();
if (res.code == 0) {
wx.p.router.redirectTo('/packageIndex/pages/integral/withdrawalSuccess/withdrawalSuccess')
} else {
wx.p.wxApi.showToast(res.message)
this.submit = false
}
}).catch((err) => {
this.submit = false
wx.p.wxApi.showToast(JSON.stringify(err))
}).finally(() => {
this.setData({
showConfirmDialog: false
})
})
},
goContinue() {
this.setData({
showConfirmDialog: true
})
},
/**
* 生命周期函数--监听页面初次渲染完成
......
......@@ -8,26 +8,26 @@
</view>
<view class="consumption">
<view class="info">截止当前</view>
<view class="item">您已在本平台累计提现 <view class="price">7000<text>元</text></view>
<view class="item">您已在本平台累计提现 <view class="price">{{taxRateObj.totalWithdrawalScore}}<text>元</text></view>
</view>
<view class="item">您的本次提现金额 <view class="price">7000<text>元</text></view>
<view class="item">您的本次提现金额 <view class="price">{{taxRateObj.withdrawalScore}}<text>元</text></view>
</view>
</view>
<view class="label">以下为无工资收入和有工资收入的相关税率与收入对比:</view>
</view>
<view class="salary-comparison">
<view class="salary flex_scb">
<view class="proportion">3%</view>
<view class="proportion income">10%</view>
<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">8000元</view>
<view class="money">{{taxRateObj.totalIncomeWithoutSalary}}元</view>
<view class="text">累计提现+本次提现</view>
</view>
<view class=" earning have">
<view class="money">78000元</view>
<view class="text">1万*7个月+累计提现+本次提现</view>
<view class="money">{{taxRateObj.totalIncomeWithSalary}}元</view>
<view class="text">{{taxRateObj.withdrawalScore}}*{{taxRateObj.month}}个月+累计提现+本次提现</view>
</view>
</view>
<view class="tips">以上仅为本平台评估展示,本次提现金额不会扣除,您的真实税务建议您去<text>个人所得税APP</text>查询</view>
......@@ -43,4 +43,9 @@
<view class="btn-text withdraw" bind:tap="goContinue">继续提现</view>
</view>
</view>
</view>
\ No newline at end of file
</view>
<Dialog show="{{ showConfirmDialog }}" mask="true" bindbuttontap="bindButton" buttons="{{confirmButtons}}" title="提示">
<view class="suggest-box">
请确认是否将{{sumbitScore}}积分进行兑换
</view>
</Dialog>
\ No newline at end of file
import { commonApi } from '~/api/module/common'
import commonApi from '~/api/module/common.js'
const phoneRex = /^[1]([3-9])[0-9]{9}$/
Page({
/**
......@@ -18,7 +18,9 @@ Page({
}, {
text: '同意',
extClass: 'btn_primary'
}]
}],
pointsSource: [],
walletObj: {}
},
changeLoginType() {
const {
......@@ -48,7 +50,7 @@ Page({
data,
code
} = await wx.p.api.userApi.login()
if (code == '0') this.customerLoginCallBack(data)
// if (code == '0') this.customerLoginCallBack(data)
if (data) this.sessionId = data.sessionId
wx.hideLoading()
},
......@@ -139,7 +141,6 @@ Page({
if (!mobile) throw '请输入手机号'
if (!captcha) throw '请输入验证码'
if (!phoneRex.test(mobile)) throw '请输入正确的手机号'
// if (!isAgree) throw '请同意以下用户协议'
wx.p.wxApi.showLoading()
const {
code,
......@@ -164,57 +165,146 @@ Page({
async getPhoneNumber({
detail
}) {
const {
isAgree
} = this.data
try {
if (detail.errMsg && ['authorized', 'deny'].findIndex(e => detail.errMsg.toLowerCase().includes(e)) != -1) return
if (!detail?.code) throw '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
// if (!isAgree) throw '请同意以下用户协议'
wx.p.wxApi.showLoading()
let obj = {
encryptedData: detail.encryptedData,
iv: detail.iv,
sessionId: this.sessionId
}
const {
code,
data,
message
} = await commonApi.authPhoneLogin(detail, this.sessionId)
} = await commonApi.authPhoneLogin(obj)
wx.hideLoading()
if (code == '0') this.customerLoginCallBack(data)
else throw message
} catch (error) {
console.log(error, '222222')
this.showTips(error || '服务不可用')
setTimeout(() => {
this.onLoad()
}, 1500)
}
},
/**C端登录回调 */
/**登录回调 */
customerLoginCallBack(data) {
wx.p.storage.set('sessionId', data?.sessionId)
// 获取积分来源
this.getSource(data)
},
getSource(loginData) {
commonApi.getPointsSourceList({
staffPhone: loginData?.phone
}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({pointsSource: data?.map(val => { return val.channelSource })})
if (data?.length > 1) { // 积分渠道来源大于1 需要选择
this.setData({
showChooseSource: true
})
} else if (data?.length == 1) {
this.setChannelSource(data[0]?.channelSource, loginData)
}
} else {
wx.p.wxApi.showToast(message)
}
})
},
// 设置积分渠道
setChannelSource(source, loginData) {
wx.p.isLogin = true
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
// 返回上一页
wx.p.router.back(thisPage => {
thisPage && thisPage.setData({
userInfo: data
})
thisPage.onLoginSuccess && thisPage.onLoginSuccess() //登陆成功后页面回调
wx.p.storage.set('userInfo', {...loginData})
wx.p.storage.set('channelSource', `${source}`)
wx.p.storage.set('sessionId', loginData?.sessionId)
// 查询积分钱包
this.getPointsWallet()
},
// 获取积分钱包数据
getPointsWallet() {
let userInfo = wx.p.cache.userInfo.getUserInfo()
commonApi.getPointsWalletData({
phone: userInfo?.phone,
name: userInfo?.nickName,
scoreSource: wx.p.storage.get('channelSource')
}).then(res => {
let { code, data, message } = res
if (code == 0) {
if (data && Object.keys(data)?.length) { // 有数据返回说明已开通钱包
// 调用替换钱包昵称接口
this.replaceNickName(data)
} else {
let channelSource = wx.p.storage.get('channelSource')
// 获取当前积分数量
commonApi.getPointsSummary({staffPhone: userInfo?.phone, channelSource}).then(r => {
if (r?.code == 0) {
this.setData({
showEnableWallet: true,
walletObj: {name: userInfo?.nickName, phone: userInfo?.phone, scoreSource: channelSource, currentScore: r?.data?.currentScore || 0}
})
} else {
wx.p.wxApi.showToast(r.message)
}
})
}
} else {
wx.p.wxApi.showToast(message)
}
})
},
// 选择积分来源
pointSourceEvent() {
// 替换积分钱包昵称
replaceNickName(data) {
let userInfo = wx.p.cache.userInfo.getUserInfo()
commonApi.replaceWalletName({
nickName: data?.name,
phone: data?.phone,
scoreSource: data?.scoreSource
}).then(res => {
let { code, data, message } = res
wx.p.storage.set('userInfo', {...userInfo, nickName: data?.name}) // 更新storage中的nickName
if (code == 0) {
wx.p.router.reLaunch('/pages/tab/index/index')
} else {
wx.p.wxApi.showToast(message)
}
})
},
// 选择积分来源
pointSourceEvent(e) {
wx.p.storage.set('channelSource', `${e.detail}`)
},
// 关闭开通积分钱包弹窗
closeWallet() {
this.setData({ showEnableWallet: false })
let userInfo = wx.p.cache.userInfo.getUserInfo()
let data = {
name: userInfo?.nickName,
phone: userInfo?.phone,
scoreSource: wx.p.storage.get('channelSource')
}
// 替换钱包昵称 使用登录信息返回的数据
this.replaceNickName(data)
},
// 一键开通积分钱包
enableWalletConfirm() {
enableWalletConfirm(e) {
let { walletObj } = e.detail
commonApi.openPointsWallet(walletObj).then(res => {
let { code, message } = res
if (code == 0) {
// 替换钱包昵称
this.replaceNickName({...walletObj})
} else {
wx.p.wxApi.showToast(message)
}
})
},
// 开通成功
......
......@@ -66,8 +66,8 @@
</view>
</Dialog>
<!-- 积分来源选择 -->
<points-source show="{{showChooseSource}}" bindconfirm="pointSourceEvent"></points-source>
<points-source show="{{showChooseSource}}" pointsSource="{{pointsSource}}" bindconfirm="pointSourceEvent"></points-source>
<!-- 开通钱包 -->
<enable-wallet show="{{showEnableWallet}}" bindclose="closeWallet" bindconfirm="enableWalletConfirm"></enable-wallet>
<enable-wallet show="{{showEnableWallet}}" walletObj="{{walletObj}}" bindclose="closeWallet" bindconfirm="enableWalletConfirm"></enable-wallet>
<!-- 钱包开通成功 -->
<enable-success show="{{showEnableSuccess}}" bindconfirm="successConfirm"></enable-success>
\ No newline at end of file
......@@ -7,6 +7,10 @@ Component({
properties: {
show: {
type: Boolean
},
walletObj: {
type: Object,
value: {}
}
},
......@@ -43,14 +47,15 @@ Component({
let { value } = e.detail
value = target == 'phone' ? value.replace(/[^0-9]/g, '') : value
this.setData({
[target]: value
[`walletObj.${target}`]: value
})
},
// 开通
confirm() {
let { name, phone } = this.data
if (!name) return wx.p.wxApi.showToast('姓名不能为空')
if (!phone || !/^[1]([3-9])[0-9]{9}$/.test(phone)) return wx.p.wxApi.showToast('请输入正确手机号')
let { walletObj } = this.data
if (!walletObj?.name) return wx.p.wxApi.showToast('姓名不能为空')
if (!walletObj?.phone || !/^[1]([3-9])[0-9]{9}$/.test(walletObj?.phone)) return wx.p.wxApi.showToast('请输入正确手机号')
this.triggerEvent('confirm', {walletObj})
}
}
})
\ No newline at end of file
......@@ -17,18 +17,18 @@
<view class="label">{{item.label}}</view>
<view class="tips">
{{item.tips}}
<text class="label" wx:if="{{item.pointsFlag}}">{{1500}}</text>
<text class="label" wx:if="{{item.pointsFlag}}">{{walletObj.currentScore}}</text>
</view>
</view>
</view>
<view class="text">请确认信息无误</view>
<view class="input-box">
<view class="input-label">姓名</view>
<input bindinput="input" data-target="name" maxlength="10" value="{{name}}" type="text" placeholder="请输入"/>
<input bindinput="input" data-target="name" maxlength="10" value="{{walletObj.name}}" type="text" placeholder="请输入"/>
</view>
<view class="input-box">
<view class="input-label">手机号</view>
<input bindinput="input" data-target="phone" maxlength="11" value="{{phone}}" type="text" placeholder="请输入"/>
<input bindinput="input" data-target="phone" maxlength="11" value="{{walletObj.phone}}" type="text" placeholder="请输入"/>
</view>
<view class="wallet-btn" bindtap="confirm">一键开通</view>
</view>
......
......@@ -7,6 +7,16 @@ Component({
properties: {
show: {
type: Boolean
},
pointsSource: {
type: Array,
observer: function(val) {
let { sourceArr } = this.data
const filteredArr = sourceArr.filter(item => val?.includes(Number(item.id)))
this.setData({
channelSourceArr: filteredArr
})
}
}
},
......@@ -14,25 +24,26 @@ Component({
* 组件的初始数据
*/
data: {
sourceArr: [{
sourceArr: [ {
id: 1,
label: '续保用户',
color: '#AF531F',
background: 'linear-gradient(90deg, #FCF5E5 0%, #FFE9BD 100%)',
icon: 'source-1'
}, {
id: 2,
label: '阳光激励用户',
color: '#C7462B',
background: 'linear-gradient(90deg, #FCF3F2 0%, #FFE0DB 100%)',
icon: 'source-2'
}, {
id: 2,
label: '续保用户',
color: '#AF531F',
background: 'linear-gradient(90deg, #FCF5E5 0%, #FFE9BD 100%)',
icon: 'source-1'
}, {
id: 3,
label: '管理层',
color: '#244BCA',
background: 'linear-gradient(90deg, #E7F5FD 0%, #C3E7FF 100%)',
icon: 'source-3'
}]
}],
channelSourceArr: []
},
/**
......@@ -42,21 +53,22 @@ Component({
// 切换选择来源
checkSource(e) {
let { target } = e.currentTarget.dataset
let { sourceArr } = this.data
sourceArr?.forEach(val => {
let { channelSourceArr } = this.data
channelSourceArr?.forEach(val => {
val.isChecked = false
if (val.id == target.id) {
val.isChecked = true
}
})
this.setData({sourceArr})
this.setData({channelSourceArr})
},
// 下一步
nextStep(e) {
let { target } = e.currentTarget.dataset
if (target) return // 未选择来源不可点击
// 请求接口
console.log('请求接口')
let { channelSourceArr } = this.data
let channelSource = channelSourceArr?.find(val => val.isChecked == true)?.id
this.triggerEvent('confirm', channelSource)
}
}
})
\ No newline at end of file
......@@ -16,7 +16,7 @@
<view class="source-content isFullSucreen {{close?'close':''}}">
<view class="title">您的积分渠道来源</view>
<view class="source-box">
<view class="source-item" wx:for="{{sourceArr}}" wx:key="index" bindtap="checkSource" data-target="{{item}}" style="color: {{item.color}};background-image: {{item.background}};">
<view class="source-item" wx:for="{{channelSourceArr}}" wx:key="index" bindtap="checkSource" data-target="{{item}}" style="color: {{item.color}};background-image: {{item.background}};">
<view>
<view class="source-icon">
<glsx-image src="/login/{{item.icon}}.png"></glsx-image>
......@@ -28,6 +28,6 @@
</view>
</view>
</view>
<view class="btn {{fn.btnDisabled(sourceArr) ? 'disabled' : ''}}" bindtap="nextStep" data-target="{{fn.btnDisabled(sourceArr)}}">下一步</view>
<view class="btn {{fn.btnDisabled(channelSourceArr) ? 'disabled' : ''}}" bindtap="nextStep" data-target="{{fn.btnDisabled(channelSourceArr)}}">下一步</view>
</view>
</view>
\ No newline at end of file
// pages/loading/loading.js
import { systemApi } from "~/api/index";
import commonApi from '~/api/module/common.js'
Page({
/**
* 页面的初始数据
......@@ -24,23 +25,16 @@ Page({
this.login();
},
async login(options = {}) {
if (options.merchantId) wx.$merchant_id = options.merchantId;
try {
const { code, data, message } = await wx.p.api.userApi.login();
if (data)
wx.p.storage.set("merchant_info", {
merchantId: data.merchantId,
merchantName: data.merchantName,
});
const { code, data, message } = await commonApi.getLoginInfo();
if (code == "0") {
wx.p.isLogin = true;
wx.p.storage.set("userInfo", data);
wx.p.storage.set("sessionId", data.sessionId);
if (!data) throw message;
wx.p.storage.set("userInfo", data)
if (!data) throw message
} else {
wx.p.isLogin = false;
wx.p.storage.rm("userInfo");
wx.p.storage.rm("sessionId");
wx.p.storage.rm("channelSource")
}
console.log("登陆信息:", data);
if (options.url) {
......
......@@ -27,17 +27,8 @@
background: #FFFFFF;
}
.type-1 .button {
width: 104rpx;
height: 60rpx;
border-radius: 38rpx;
background-color: var(--btnColor);
color: #fff;
font-size: var(--margin);
}
.type-1 .input-box {
width: calc(100% - 110rpx);
width: 100%;
display: flex;
align-items: center;
}
......
......@@ -42,27 +42,21 @@ Component({
methods: {
handleFixedTabChange(e) {
let { value } = e.currentTarget.dataset
let { activeSubTab } = this.data
this.setData({
activeTab: value,
to: `to-${value}`
})
this.triggerEvent('tabchange', { activeTab: value, activeSubTab })
},
handleDynamicTabChange(e) {
let { value } = e.currentTarget.dataset
let { activeTab } = this.data
this.setData({
activeSubTab: value,
subTo: `to-${value}`
})
},
click(e) {
let {
count
} = e.currentTarget.dataset
this.setData({
count,
to: `to-${count}`
})
this.triggerEvent('click', count)
this.triggerEvent('tabchange', { activeTab, activeSubTab: value })
}
}
})
......
import {
kfMixin,
} from '~/mixins/index'
import homeApi from '~/api/module/home.js'
import commonApi from '~/api/module/common.js'
Page({
behaviors: [kfMixin],
/**
* 页面的初始数据
*/
......@@ -12,6 +10,7 @@ Page({
customerlist: [],
navStyle : "background-color: transparent;",
animationData: {},
bannerUrl: '',
specialSaleArr: [{
id: 1,
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/index-bg.png',
......@@ -129,6 +128,24 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const userInfo = wx.p.cache.userInfo.getUserInfo()
let channelSource = wx.p.storage.get('channelSource')
this.setData({userInfo, channelSource})
// 获取当前积分数据
this.getPointsData()
},
getPointsData() {
let { userInfo, channelSource } = this.data
if (!userInfo?.phone && !channelSource) return
commonApi.getPointsSummary({staffPhone: userInfo?.phone, channelSource: Number(channelSource)}).then(r => {
if (r?.code == 0) {
this.setData({
currentScore: r?.data?.currentScore || 0
})
} else {
wx.p.wxApi.showToast(r.message)
}
})
},
// 跳转积分中心
handleToPointCenter() {
......@@ -152,6 +169,19 @@ Page({
toIntegral(){
wx.p.router.go('/packageIndex/pages/integral/index/index')
},
// 商品搜素
handleSearch(e) {
console.log(e)
},
// 切换分类筛选
changeTab(e) {
console.log(e, '===')
},
// 加入购物车
handleAddToCart(e) {
},
/**
* 生命周期函数--监听页面显示
*/
......
......@@ -13,8 +13,6 @@ page {
.bg {
width: 100%;
height: 480rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/index-bg.png') no-repeat;
background-size: 100% 480rpx;
position: fixed;
left: 0;
top: 0;
......
<navigation-bar page-title="积分商城" custom navStyle="{{navStyle}}">
<view class="page-title">积分商城</view>
</navigation-bar>
<view class="bg"></view>
<view class="bg">
<glsx-image src="{{bannerUrl || 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/index-bg.png'}}"></glsx-image>
</view>
<block wx:if="{{navHeight}}">
<view class="container-box">
<view class="container" style="height: calc(100vh - {{navHeight}}px);margin-top: {{navHeight}}px;">
<view class="points-box">
<view class="points-btn" bindtap="handleToPointCenter">
<view>
<view style="display: flex;align-items: center;">
<view class="icon">
<glsx-image src="/index/points-icon.png"></glsx-image>
</view>
<view class="points-num" bind:tap="toIntegral">1680</view>
<view class="points-num" bind:tap="toIntegral">{{currentScore || '-'}}</view>
</view>
<view class="arrow-icon">
<mp-icon icon="arrow" color="#F4776D" size="7"></mp-icon>
......@@ -41,11 +43,11 @@
<view class="goods-content">
<view class="goods-box-title">商品兑换</view>
<view class="sticky">
<search-box placeholder="搜索商品"></search-box>
<good-tab tab="{{tab}}" subTab="{{subTab}}" align="left" openScroll bindclick="changeTab" index="{{goodsIndex}}"></good-tab>
<search-box placeholder="搜索商品" bindsearch="handleSearch"></search-box>
<good-tab tab="{{tab}}" subTab="{{subTab}}" align="left" openScroll bindtabchange="changeTab" index="{{goodsIndex}}"></good-tab>
</view>
<view class="goods-box">
<goods list="{{goodsList}}"></goods>
<goods list="{{goodsList}}" bindjoin="handleAddToCart"></goods>
</view>
</view>
</block>
......@@ -53,5 +55,4 @@
</view>
</view>
</block>
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file
......@@ -12,6 +12,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo})
// this.getMemberCardData();
},
navbarReady(e) {
......
......@@ -11,7 +11,8 @@ export const STORAGE_OBJECTkEY = {
sessionId: 'sessionId',
bindInfo:'bindInfo',
unauthorized:'unauthorized',
wx_user_info:'wx_user_info'
wx_user_info:'wx_user_info',
channelSource: 'channelSource'
}
export default{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!