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