Commit acefcac6 by 前端

Merge branch 'SAAS+V4.45-0926' into 'develop'

上线合并

See merge request !330
2 parents ae0425c4 91cfb8ef
Showing 60 changed files with 2378 additions and 81 deletions
...@@ -72,6 +72,18 @@ ...@@ -72,6 +72,18 @@
] ]
}, },
{ {
"root": "integration",
"name": "integration",
"pages": [
"pages/bankAccount/list/list",
"pages/bankAccount/detail/detail",
"pages/point/index/index",
"pages/point/record/record",
"pages/point/toCash/toCash",
"pages/point/success/success"
]
},
{
"root": "tabMine", "root": "tabMine",
"name": "tabMine", "name": "tabMine",
"pages": [ "pages": [
......
...@@ -29,10 +29,10 @@ Component({ ...@@ -29,10 +29,10 @@ Component({
} }
}) })
console.log(storeList, 'copyStoreList'); console.log(storeList, 'copyStoreList');
let newArray = storeList.slice(0, 20) // let newArray = storeList.slice(0, 20)
this.setData({ this.setData({
userInfo, userInfo,
copyStoreList: newArray, copyStoreList: storeList,
searchValue: '', searchValue: '',
edit: false, edit: false,
customSearchFlag: false, customSearchFlag: false,
...@@ -173,9 +173,9 @@ Component({ ...@@ -173,9 +173,9 @@ Component({
if (i.merchantId == selectedMerchantId) i.active = true if (i.merchantId == selectedMerchantId) i.active = true
return i return i
}) })
let newArray = storeList.slice(0, 20) // let newArray = storeList.slice(0, 20)
this.setData({ this.setData({
copyStoreList: newArray copyStoreList: storeList
}) })
} else { } else {
let arr = [] let arr = []
......
...@@ -26,13 +26,16 @@ Component({ ...@@ -26,13 +26,16 @@ Component({
IMG_URL, IMG_URL,
isYqdSuper: '', isYqdSuper: '',
selectedSceneName: '', selectedSceneName: '',
userInfo: {} userInfo: {},
staffBankFlag: false,
isForbidden: false,
}, },
lifetimes: { lifetimes: {
ready() { ready() {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
this.setData({ this.setData({
isForbidden: !(userInfo?.isSuper || userInfo?.loginRole == 3),
isYqdSuper: app.globalData.isYqdSuper, isYqdSuper: app.globalData.isYqdSuper,
selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName, selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName,
selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc, selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc,
...@@ -45,6 +48,7 @@ Component({ ...@@ -45,6 +48,7 @@ Component({
['userInfo.createdTime']: date ['userInfo.createdTime']: date
}) })
} }
this.getStaffBankList()
this.getVersionInfo() this.getVersionInfo()
} }
}, },
...@@ -53,6 +57,70 @@ Component({ ...@@ -53,6 +57,70 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
/**跳转至银行卡 */
toAddBankAccount(e) {
const {
score,
user
} = this.data
this.setData({
showAccountModal: false
}, () => {
wx.$router.go('integration.detail', {
score
})
})
},
async getStaffBankList() {
let userInfo = wx.$util.getUserInfo(),
res = await api.getStaffBankList({
uuid: userInfo.uuid
})
console.log(res)
if (res.data && res.data.length) {
this.data.staffBankFlag = true
const [staffBankInfo] = res.data
if (staffBankInfo.state == 2 && !this.staffBankInfo) {
this.staffBankInfo = staffBankInfo
this.setData({
showAccountErrorModal: true
})
}
}
},
//我的积分
toPoint() {
console.log(999)
//判断是否添加银行卡
if (!this.data.staffBankFlag) {
this.setData({
showAccountModal: true
})
return
}
// 新的积分兑换页面
wx.$router.go('integration.index')
},
toCloseModal(e) {
const {
name
} = e.currentTarget.dataset
this.setData({
[name]: false
});
},
//收款账户
jumpAccount() {
const {
score,
user
} = wx.$router.getPageInstance()
wx.$router.go('integration.list', {
score,
user
})
},
// 跳转到工资绩效 // 跳转到工资绩效
jump(e) { jump(e) {
let { url } = e.currentTarget.dataset let { url } = e.currentTarget.dataset
......
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
</view> </view>
<view class="name_box"> <view class="name_box">
<view class="item name text-hide">{{userInfo.name}}</view> <view class="item name text-hide">{{userInfo.name}}</view>
<view class="change_btn" bindtap="changeAccount">切换账号</view> <view class="point-box" wx:if="{{isForbidden}}">
<view class="change_btn" bind:tap="toPoint">我的积分</view>
<image class="icon_card" bindtap="jumpAccount" src="{{IMG_URL}}bank-card.png" mode="" />
</view>
<!-- <view class="change_btn" bindtap="changeAccount">切换账号</view> -->
</view> </view>
<view class="user-info"> <view class="user-info">
<view class="user-text"> <view class="user-text">
...@@ -48,6 +52,7 @@ ...@@ -48,6 +52,7 @@
</view> </view>
</view> </view>
<view class="logout-box"> <view class="logout-box">
<view class="logout text-center" bindtap="changeAccount">切换账号</view>
<view class="logout text-center" bindtap="logout">退出账号</view> <view class="logout text-center" bindtap="logout">退出账号</view>
<view class="message-box"> <view class="message-box">
<!-- <view class="message">为保障你的合法权益,请阅读并同意</view> --> <!-- <view class="message">为保障你的合法权益,请阅读并同意</view> -->
...@@ -58,3 +63,25 @@ ...@@ -58,3 +63,25 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 提现账号 -->
<van-popup show="{{showAccountModal}}" round position="bottom" bind:click-overlay="toCloseModal" custom-class="popclass" data-name="showAccountModal">
<view class="modal_title">提示</view>
<view class="modal_tip">首次兑换需要您添加个人真实的银行账户!</view>
<button class="modal_btn" catchtap="toAddBankAccount">去添加</button>
</van-popup>
<!-- 银行卡信息有误 -->
<van-popup show="{{showAccountErrorModal}}" round position="bottom" bind:click-overlay="toCloseModal" custom-class="popclass" data-name="showAccountErrorModal">
<view class="modal_title">提示</view>
<view class="modal_tip">您的银行信息有误</view>
<view class="modal_error">原因:手机号非银行预留手机号</view>
<view class="btns">
<button class="modal_btn default" catchtap="toCloseModal" data-name="showAccountErrorModal">我知道了</button>
<button class="modal_btn" catchtap="toEditBankAccount" >去编辑</button>
</view>
</van-popup>
<!-- 绑定微信提示弹框 -->
<van-popup bind:click-overlay="toCloseModal" show="{{ showModal }}" custom-class="popclass" position="bottom" custom-style="height: 35%" data-name="showModal">
<view class="modal_title">提示</view>
<view class="modal_tip">您未绑定微信,请先完成绑定</view>
<button class="modal_btn" open-type="getPhoneNumber" catch:tap="toCloseModal" data-name="showModal" bindgetphonenumber="toBindWechat">去绑定</button>
</van-popup>
...@@ -66,10 +66,15 @@ page { ...@@ -66,10 +66,15 @@ page {
white-space: nowrap; white-space: nowrap;
} }
.point-box {
display: flex;
align-items: center;
}
.change_btn { .change_btn {
width: var(--fontSize134); width: var(--fontSize134);
height: var(--fontSize48); height: var(--fontSize48);
background: rgba(53, 180, 238, .1); background: rgba(52, 123, 255, 0.1);
color: #347BFF; color: #347BFF;
font-size: var(--fontSize24); font-size: var(--fontSize24);
display: flex; display: flex;
...@@ -78,6 +83,12 @@ page { ...@@ -78,6 +83,12 @@ page {
border-radius: var(--fontSize24); border-radius: var(--fontSize24);
} }
.icon_card {
width: 72rpx;
height: 48rpx;
margin-left: var(--fontSize24);
}
.user-info { .user-info {
padding: 0 var(--fontSize50); padding: 0 var(--fontSize50);
} }
...@@ -349,35 +360,110 @@ page { ...@@ -349,35 +360,110 @@ page {
.logout-box { .logout-box {
/* position: sticky; */ /* position: sticky; */
/* position: -webkit-sticky; */ /* position: -webkit-sticky; */
width: calc(100% - 40rpx);
background: #FFFFFF;
position: absolute; position: absolute;
top: calc(100% - var(--fontSize150)); top: calc(100% - var(--fontSize250));
left: 50%; /* left: 50%;
transform: translateX(-50%); transform: translateX(-50%); */
display: flex; display: flex;
flex-flow: column; flex-flow: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding-bottom: var(--fontSize30); padding: 0 32rpx;
margin: 0 20rpx;
box-sizing: border-box;
border-radius: 16rpx;
} }
.logout { .logout {
width: var(--fontSize326); /* position: fixed;
height: var(--fontSize80); bottom: var(--fontSize106);
background: #FFFFFF; left: 50%;
display: flex; transform: translateX(-50%); */
justify-content: center; width: 100%;
align-items: center; height: var(--fontSize88);
border: var(--fontSize2) solid #DCDEE0; color: #292D33;
border-radius: var(--fontSize12);
color: #6C6C70;
font-size: var(--fontSize28); font-size: var(--fontSize28);
} }
.logout-box :first-child {
border-bottom: 1rpx solid #E4E8EE;
}
.message-box { .message-box {
font-size: var(--fontSize24); font-size: var(--fontSize24);
margin-top: var(--fontSize12); position: absolute;
bottom: calc(-1 * var(--fontSize55));
left: 50%;
transform: translateX(-50%);
} }
.message-box text { .message-box text {
color: #5092FF; color: #5092FF;
} }
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.popclass {
position: relative;
border-radius: 24rpx 24rpx 0 0;
z-index: 999;
}
.popclass .modal_title {
font-weight: 500;
font-size: 40rpx;
color: #333333;
box-sizing: border-box;
padding-top: 48rpx;
padding-left: 49rpx;
}
.popclass .modal_tip {
font-weight: 400;
font-size: 32rpx;
color: #333333;
margin-top: 64rpx;
padding-left: 49rpx;
}
.popclass .modal_error {
font-size: 32rpx;
color: #FE5662;
margin-top: 12rpx;
padding-left: 49rpx;
}
.popclass .btns {
display: flex;
padding: 0 48rpx;
gap: 0 20rpx;
}
.popclass .modal_btn {
margin: 0;
width: calc(100% - 98rpx);
height: 88rpx;
margin: 0 auto;
margin-top: 120rpx;
background: #347BFF;
border-radius: 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
}
.modal_btn::after {
display: none;
}
.popclass .default {
background: #fff;
color: #333;
border: 2rpx solid #e1e1e1;
}
\ No newline at end of file \ No newline at end of file
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 2; let index = 1;
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
......
// const api = wx.$request
import api from '~/utils/request/request.js'
// const api = wx.$request
module.exports = {
/**根据员工id查询员工银行卡列表 */
getStaffBankList(data) {
let params = data || {}
return api.post(
'dj.api.smartcarlife.withdrawal.staff.bank.list',
params,
);
},
// 获取收益明细列表
getScoreListApi(data) {
let params = data || {}
return api.post( "dj.api.smartcarlife.score.list",
params
);
},
/** 根据id查询银行卡详情 */
getStaffBankDetail(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.withdrawal.staff.bank.detail',
params,
);
},
/** 插入或更新员工银行卡信息 */
insetorupdateStaffBank(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.withdrawal.staff.bank.insetorupdate',
params);
},
/** 获取手续费率 */
getRate(data) {
let params = data || {}
return api.post('dj.api.smartcarlife.withdrawal.staff.rate',
params,
);
},
// 获取积分详情
getScoreDetailApi(data) {
let params = data || {}
return api.post("dj.api.smartcarlife.score.detail",
params,
);
},
// 提现记录
getWithdrawalListApi(data) {
let params = data || {}
return api.post("dj.api.smartcarlife.withdrawal.list",
params,
);
},
// 提现
WithdrawalApi(data) {
let params = data || {}
return api.post(
"dj.api.smartcarlife.withdrawal.insert",
params
);
}
}
\ No newline at end of file \ No newline at end of file
// packageStoreAssistant/components/Dialog/Dialog.js
Component({
options: {
multipleSlots: true
},
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
confirmText: String,
cancelText: String,
showCancelButton: Boolean,
success: Boolean,
text: String
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
confirm() {
this.triggerEvent('confirm')
},
cancel() {
this.triggerEvent('cancel')
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index"
}
}
\ No newline at end of file \ No newline at end of file
.dialog {
display: flex;
flex-direction: column;
align-items: center;
.icon {
width: 96rpx;
height: 96rpx;
}
.text {
font-size: 28rpx;
color: #1B233D;
text-align: center;
max-width: 400rpx;
line-height: 40rpx;
padding: 24rpx 0;
}
}
\ No newline at end of file \ No newline at end of file
<van-dialog use-slot use-title-slot show="{{ show }}" show-cancel-button="{{showCancelButton}}" confirm-button-text="{{confirmText}}" cancel-button-text="{{cancelText}}" confirm-button-color="#347BFF" cancel-button-color="#1B233D" bindconfirm="confirm" bindcancel="cancel">
<view class="dialog">
<view class="icon">
<gl-image src="/bankAccount/{{success?'success':'err'}}.png"></gl-image>
</view>
<text class="text">
<block wx:if="{{text}}">
{{text}}
</block>
<block wx:else>
<block wx:if="{{success}}">
<slot name="success"></slot>
</block>
<block wx:else>
<slot name="error"></slot>
</block>
</block>
</text>
</view>
</van-dialog>
\ No newline at end of file \ No newline at end of file
Component({
/**
* 组件的属性列表
*/
properties: {
info: Object,
show: Boolean
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
cancel() {
this.sumbit = false
this.setData({
show: false
})
},
confirm() {
if (this.sumbit) return
this.sumbit = true
this.cancel()
this.triggerEvent('sumbit')
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.modal {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 98;
perspective: 99999999px;
.modal-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
animation: show-popup-bg .1s forwards .1s;
}
}
@keyframes show-popup-bg {
0% {
background-color: rgba(0, 0, 0, 0);
}
100% {
background-color: rgba(45, 45, 51, .6);
}
}
.modal-box {
width: 590rpx;
padding-bottom: 48rpx;
background: #FFFFFF;
box-shadow: inset 0 0 48rpx 16rpx #E0EAFF;
border-radius: 20rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
animation: show-modal .1s forwards;
display: flex;
align-items: center;
flex-direction: column;
.modal-title {
font-weight: 600;
font-size: 40rpx;
color: #3D5BD6;
margin-top: 64rpx;
margin-bottom: 24rpx;
}
.modal-tip {
font-weight: 400;
font-size: 30rpx;
color: #7A8299;
}
.modal-main {
margin-top: 48rpx;
.cell {
display: flex;
margin-bottom: 8rpx;
.label {
width: 120rpx;
height: 56rpx;
font-weight: 400;
font-size: 30rpx;
color: #7A8299;
margin-right: 24rpx;
line-height: 56rpx;
}
.value {
font-weight: 400;
font-size: 30rpx;
color: #1B233D;
line-height: 56rpx;
white-space: pre-wrap;
word-break: break-all;
}
}
}
.modal-footer {
margin-top: 64rpx;
display: flex;
align-items: center;
justify-content: center;
.btn {
width: 240rpx;
height: 88rpx;
background: #FFFFFF;
border: 2rpx solid #4466F0;
border-radius: 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #3D5BD6;
display: flex;
align-items: center;
justify-content: center;
}
.right {
border: none;
background-image: linear-gradient(-78deg, #556AF5 0%, #7197FF 100%);
border-radius: 12rpx;
color: #FFFFFF;
}
}
}
\ No newline at end of file \ No newline at end of file
<view wx:if="{{show}}" class="modal">
<view class="modal-bg" />
<view class="modal-box">
<view class="modal-title">积分兑换到账详情</view>
<view class="modal-main">
<view class="cell">
<view class="label">兑换积分</view>
<view class="value">{{info.count || '--'}}</view>
</view>
<view class="cell">
<view class="label">到账积分</view>
<view class="value">{{info.money || '--'}}</view>
</view>
<view class="cell">
<view class="label">手续费率</view>
<view class="value">{{info.rate || '--'}}</view>
</view>
</view>
<view class="modal-footer">
<view bind:tap="confirm" class="btn right">好的</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
import WxValidate from '~/utils/WxValidate'
const {
methods
} = new WxValidate()
import MineApi from '../../../api'
Page({
/**
* 页面的初始数据
*/
data: {
form: [{
label: '姓名',
key: 'bankUserName',
placeholder: '请输入银行卡预留的姓名',
maxlength: 10
},
{
label: '手机号',
key: 'bankPhone',
placeholder: '请输入银行卡预留的手机号',
maxlength: 11,
type: 'number'
},
{
label: '身份证',
key: 'idCardNo',
placeholder: '请输入银行卡预留的身份证号',
maxlength: 18,
type: 'idcard'
},
{
label: '开户银行',
key: 'bankName',
placeholder: '请选择您的开户银行',
fn: 'click',
pickerData: [],
pickerKey: 'bankName'
},
{
label: '银行账户',
key: 'bankNumber',
placeholder: '请输入开户银行账户',
maxlength: 19,
type: 'number'
}
],
btnDisabled: true,
formData: {
bankUserName: '',
bankPhone: '',
idCardNo: '',
bankName: '',
bankNumber: ''
}
},
/**
* 生命周期函数--监听页面加载
*/
onRoute(options) {
if (options && options.item) {
const {
item
} = options
this.options=options
this.setData({
formData: {
bankUserName: item.bankUserName,
bankPhone: item.bankPhone,
idCardNo: item.idCardNo,
bankName: item.bankName,
bankNumber: item.bankNumber
}
})
wx.setNavigationBarTitle({
title: '编辑账户'
})
this.check()
}
//员工积分详情
this.getWithdrawalData()
this.getBankList()
},
//获取员工积分详情
getWithdrawalData() {
MineApi.getScoreDetailApi().then(res => {
if(res.code ==0){
this.setData({
score:res.data
})
}
})
},
async getBankList() {
const {
bankList
} = await wx.$util.getMockData(), {
form
} = this.data,
index = form.findIndex(e => e.key == 'bankName')
this.setData({
[`form[${index}].pickerData`]: bankList
})
},
bindInput(e) {
const {
item: {
key,
}
} = e.currentTarget.dataset
this.setData({
[`formData.${key}`]: e.detail
})
this.check()
},
bindPickerChange(e) {
const {
value
} = e.detail, {
item: {
key,
pickerKey,
pickerData
}
} = e.currentTarget.dataset,
val = pickerData[value][pickerKey]
this.setData({
[`formData.${key}`]: val
})
this.check()
},
check() {
const {
formData
} = this.data
let btnDisabled = false
try {
for (const key in formData) {
if (!formData[key]) throw true
}
} catch (error) {
btnDisabled = error
}
this.setData({
btnDisabled
})
},
dialogClose() {
wx.$router.back()
},
dialogConfirm() {
const {
success,
score
} = this.data;
// 跳转到新的积分兑换页面
if (success) wx.$router.redirectTo('integration.toCash', {
score
})
else this.setData({
showModal: false
})
},
async submit() {
const {
formData
} = this.data, {
item
} = this.options, userInfo = wx.$util.getUserInfo(),
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 = userInfo.uuid
const {
code,
message
} = await MineApi.insetorupdateStaffBank(formData)
if (code == '0') {
this.setData({
showModal: true,
success: true,
dialogText: item&&item.id?'您的银行账户修改成功!':'您的银行账户添加成功'
})
} else {
// this.setData({
// showModal: true,
// success: false,
// dialogText: `原因:${message}`
// })
// wx.$api.showToast(message)
}
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "添加账户",
"usingComponents": {
"dialog": "../../../components/Dialog/Dialog"
}
}
\ No newline at end of file \ No newline at end of file
/* integration/pages/bankAccount/detail/detail.wxss */
page {
background: #F7F8FA;
}
.tips {
font-size: 28rpx;
color: #6E6E7A;
height: 88rpx;
padding-left: 48rpx;
text {
font-size: 24rpx;
color: #333333;
}
}
.form {
margin: 0 32rpx;
border-radius: 16rpx;
background-color: #fff;
.item {
height: 112rpx;
border-bottom: 2rpx solid #F0F0F0;
&:last-of-type {
border-bottom: none;
}
.label {
font-weight: 500;
font-size: 28rpx;
color: #333333 !important;
}
.input {
width: 400rpx !important;
}
}
}
.button {
width: 654rpx;
height: 88rpx;
background-color:#347BFF;
border-radius:12rpx;
margin: auto 48rpx ;
font-weight: 600;
font-size: 32rpx;
color: #FFFFFF;
padding: 0;
position:absolute;
bottom:164rpx;
&[disabled]:not([type]) {
background: #CCCED1 !important;
border-color: #CCCED1 !important;
color: #fff !important;
box-shadow: none;
&::after {
border-color: #CCCED1 !important;
}
}
&::after {
border-color: #F13C3D !important;
}
}
.btn-hover {
opacity: .75;
}
.flex {
display: flex;
align-items: center;
}
/* 在你的样式文件中添加以下代码 */
button::after{
border: none;
}
button:focus {
outline: none; /* 移除焦点时的轮廓 */
}
<block>
<view class="tips flex">
账户信息<text>(首次申请兑换时需要您输入正确的银行账户信息)</text>
</view>
<view class="form">
<block wx:for="{{form}}" wx:key="index">
<view class="item flex">
<block wx:if="{{item.pickerData}}">
<picker bindchange="bindPickerChange" range-key="{{item.pickerKey}}" range="{{item.pickerData}}" data-item="{{item}}">
<van-field value="{{ formData[item.key] }}" clearable label="{{item.label}}" placeholder="{{item.placeholder}}" border="{{false}}" label-class="label" input-class="input" is-link readonly input-align="right" />
</picker>
</block>
<block wx:else>
<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>
</block>
</view>
<button class="button text-center" loading="{{submitLoading}}" bindtap="submit" disabled="{{btnDisabled}}">提交</button>
</block>
<dialog show="{{showModal}}" confirmText="{{success?'去兑换':'我知道了'}}" cancelText="我知道了" showCancelButton success="{{success}}" bindconfirm="dialogConfirm" bindcancel="dialogClose" text="{{dialogText}}">
</dialog>
\ No newline at end of file \ No newline at end of file
// integration/pages/bankAccount/list/list.js
import MineApi from '../../../api'
Page({
/**
* 页面的初始数据
*/
data: {
list: []
},
/**
* 生命周期函数--监听页面加载
*/
async onRoute(options) {
try {
let userInfo = wx.$util.getUserInfo(),
res = await MineApi.getStaffBankList({
uuid: userInfo.uuid
})
if (res.code == 0) {
if (res.data) {
res && res.data?.map(e => {
e.bankNum = e.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
})
}
this.setData({
list: res.data
})
}
} catch (err) {
} finally {
this.setData({
flag: true
})
}
},
jump(e) {
const {
item
} = e.currentTarget.dataset
wx.$router.go('integration.detail', {
item
})
},
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "收款账户"
}
\ No newline at end of file \ No newline at end of file
page {
background: #F7F8FA;
}
.list {
padding: 24rpx 32rpx;
.item {
padding: 0 32rpx;
min-height: 112rpx;
background: #FFFFFF;
border-radius: 16rpx;
font-weight: 500;
font-size: 28rpx;
color: #333333;
margin-bottom: 20rpx;
.text{
max-width: 90%;
}
.icon{
width: 32rpx;
height: 32rpx;
opacity: .5;
margin-left: auto;
flex-shrink: 0;
}
}
}
.nothing {
width: 100vw;
height: 100vh;
font-size: 28rpx;
color: #7A8299;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 64rpx;
box-sizing: border-box;
background-color: #fff;
.icon {
width: 400rpx;
height: 400rpx;
}
.btn {
width: calc(100% - 124rpx);
height: 84rpx;
margin-top: 88rpx;
font-size: 32rpx;
color: #1B233D;
border-radius: 20rpx;
border: 2rpx solid #dfdee1;
}
}
.flex {
display: flex;
align-items: center;
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{flag}}">
<block wx:if="{{list.length}}">
<view class="list">
<block wx:for="{{list}}" wx:key="index">
<view class="item flex" bindtap="jump" data-item="{{item}}">
<view class="text ">
{{item.bankName}}({{item.bankUserName}}){{item.bankNum}}
</view>
<view class="icon">
<gl-image src="/bankAccount/center_edit_icon.png"></gl-image>
</view>
</view>
</block>
</view>
</block>
<block wx:else>
<view class="nothing">
<view class="icon">
<gl-image src="/bankAccount/nothing.png"></gl-image>
</view>
暂无已添加的收款账户
<view class="btn text-center" bindtap="jump">
去添加
</view>
</view>
</block>
</block>
\ No newline at end of file \ No newline at end of file
// integration/pages/point/index/index.js
import MineApi from '../../../api'
Page({
/**
* 页面的初始数据
*/
data: {
score: {},
pageSize: 10,
pageNum: 1,
total: 0,
scoreList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
//我要兑换
toTiXian() {
let {
score
} = this.data
// 新的积分兑换页面
wx.$router.go('integration.toCash', {
score
})
},
toWatchNote() {
wx.$router.go('integration.record')
},
// 触底刷新
mineReachBottom() {
let {
pageNum,
total,
pageSize
} = this.data
if (pageNum * pageSize >= total) {
this.nothing = true
return
}
this.setData({
pageNum: pageNum + 1
}, () => {
this.getInMoneyList()
})
},
//下拉刷新
mineRefresh() {
this.nothing = false
this.setData({
pageNum: 1
}, () => {
this.getInMoneyList()
this.getWithdrawalData()
})
},
//获取员工积分详情
getWithdrawalData() {
MineApi.getScoreDetailApi().then(res => {
if (res.code == 0) {
this.setData({
score: res.data
})
}
})
},
// 获取收益明细
getInMoneyList() {
if (this.nothing) return
const {
pageSize,
pageNum,
scoreList
} = this.data
MineApi.getScoreListApi({
pageSize,
pageNum
}).then((res) => {
console.log(res)
let data;
if (res.code == 0) {
data = res.data?.data ? res.data?.data : []
}
this.setData({
scoreList: pageNum == 1 ? data : [...scoreList, ...data],
total: res.data.count,
mineTrigger: false
})
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
//员工积分详情
this.getWithdrawalData()
// 积分列表
this.getInMoneyList()
this.setData({
isFullSucreen: wx.$util.isFullSucreen(true)
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"navigationBarTitleText": "我的积分",
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* integration/pages/point/index/index.wxss */
.integral_widget {
position: relative;
z-index: 2;
margin:24rpx 0;
.wrapper {
position: relative;
width: calc(100% - 64rpx);
margin-left: 33rpx;
.bg_icon {
width: 100%;
height: 100%;
}
.btn_wrap {
position: absolute;
top: 48rpx;
right: 20rpx;
height: 64rpx;
width: 160rpx;
}
.tip {
position: absolute;
top: 32rpx;
left: 40rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
letter-spacing: 0;
line-height: 44rpx;
}
.money {
position: absolute;
top: 84rpx;
left: 40rpx;
font-weight: Bold;
font-size: 72rpx;
color: #FFFFFF;
}
.note_btn {
position: absolute;
right: 60rpx;
top: 152rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
text-decoration: underline;
}
}
}
.list_widget {
position: relative;
z-index: 3;
margin-top: -70rpx;
.image_wrap {
position: relative;
.box {
width: 335rpx;
height: 152rpx;
.icon {
width: 72rpx;
height: 72rpx;
margin-right: 16rpx;
}
.text_wrap {
.price {
font-weight: Bold;
font-size: 32rpx;
color: #292D33;
line-height: 48rpx;
}
.tip {
font-weight: 400;
font-size: 28rpx;
color: #8F959E;
}
}
}
.left_box {
position: absolute;
left: 32rpx;
top: 32rpx;
}
.right_box {
position: absolute;
right: 32rpx;
top: 32rpx;
}
}
.title_wrap {
margin-top: 24rpx;
margin-bottom: 8rpx;
.icon {
width: 176rpx;
height: 64rpx;
}
}
.list_data_widget {
box-sizing: border-box;
padding: 0 48rpx;
.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;
}
.date {
font-weight: 400;
font-size: 24rpx;
color: #8F959E;
line-height: 36rpx;
}
.price {
position: absolute;
right: 0;
top: 50%;
transform: translate(0, -50%);
color: #f56c50;
font-size: 40rpx;
display: flex;
align-items: flex-end;
.mini {
font-size: 32rpx;
}
}
.blackColor {
color: #292d33;
}
.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;
}
}
.shop_banner {
box-sizing: border-box;
padding: 0 20rpx;
height: 254rpx;
.shop_banner_icon {
height: 254rpx;
}
}
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file \ No newline at end of file
<!--integration/pages/point/index/index.wxml-->
<scroll-view style="height: calc(100vh - {{isFullSucreen ? 34 : 0}}px);" scroll-y refresher-enabled bindrefresherrefresh="mineRefresh" bindscrolltolower="mineReachBottom" refresher-triggered="{{mineTrigger}}">
<view class="integral_widget">
<view class="wrapper">
<gl-image webp mode="widthFix" class="bg_icon" src="/bankAccount/mine-jf-btn.png" />
<view bind:tap="toTiXian" class="btn_wrap"></view>
<view class="tip">我的积分</view>
<view class="money">{{score.currentScore||0}}</view>
<view class="note_btn" bind:tap="toWatchNote">兑换记录</view>
</view>
<view class="list_widget">
<view class="image_wrap">
<gl-image webp mode="widthFix" class="banner_icon" src="/bankAccount/list_bg_icon.png" />
<block wx:if="{{score}}">
<view class="box flex_cc left_box">
<gl-image class="icon" src="/bankAccount/num_icon_1.png" />
<view class="text_wrap">
<view class="price">{{score.totalRewardScore || 0}}</view>
<view class="tip">累计收益积分</view>
</view>
</view>
<view class="box flex_cc right_box">
<gl-image class="icon" src="/bankAccount/num_icon_2.png" />
<view class="text_wrap">
<view class="price">{{score.totalWithdrawalScore || 0}}</view>
<view class="tip">累计兑换积分</view>
</view>
</view>
</block>
</view>
<view class="title_wrap flex_cc">
<gl-image mode="widthFix" class="icon" src="/bankAccount/title_icon.png" />
</view>
<view class="list_data_widget">
<block wx:for="{{scoreList}}" wx:key="index">
<view class="element">
<view class="title">{{item.infoName}}</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>
</view>
</view>
</block>
<view wx:if="{{scoreList.length}}" class="no_more_tip">没有更多啦</view>
<view wx:else class="no_more_tip">暂无收益明细</view>
</view>
</view>
</view>
</scroll-view>
\ No newline at end of file \ No newline at end of file
import MineApi from '../../../api'
Page({
data: {
STATUSICON: ['waiteing', 'comlpete', 'fail', 'ht'],
listData: [],
isNoResult: true
},
onRoute(options) {
MineApi.getWithdrawalListApi().then(res => {
if (res.code==0 && res.data) {
res.data.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.data.length ? false : true
this.setData({
listData: res.data || [],
isNoResult: flag
})
})
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"van-empty": "@vant/weapp/empty/index"
},
"navigationBarTitleText":"兑换记录"
}
\ No newline at end of file \ No newline at end of file
/* integration/pages/point/record/record.wxss */
page {
background: #F7F8FA;
}
.container {
padding: 40rpx 0;
}
.title_widget {
margin-bottom: 38rpx;
.text_1 {
font-weight: 600;
font-size: 36rpx;
color: #1B233D;
padding-left: 32rpx;
}
.marlf8 {
margin: 0 8rpx;
}
.text_2 {
font-weight: 400;
font-size: 28rpx;
color: #2D2D33;
}
}
.list {
.element {
position: relative;
.bgicon {
height: 260rpx;
}
.posi_wrap {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
box-sizing: border-box;
padding: 40rpx 60rpx 32rpx;
.avatar_info {
.icon {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-right: 8rpx;
}
.nameText {
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
}
.countText {
font-weight: bold;
font-size: 60rpx;
color: #333333;
line-height: 72rpx;
margin-top: 16rpx;
margin-bottom: 15rpx;
.type {
font-weight: 400;
font-size: 20rpx;
color: #999;
margin-left: auto;
padding-right: 30rpx;
}
}
.line {
width: calc(100% - 32rpx);
height: 2rpx;
background: #EDEDED;
}
.date_wrap {
margin-top: 15rpx;
box-sizing: border-box;
padding-right: 32rpx;
.dateText {
font-weight: 400;
font-size: 20rpx;
color: #999999;
line-height: 32rpx;
}
}
}
}
.bank {
.posi_wrap {
.bank-info {
font-size: 28rpx;
color: #333333;
.card-no {
height: 38rpx;
}
}
.countText {
font-weight: 700;
font-size: 48rpx;
color: #333333;
margin: 10rpx 0 19rpx;
line-height: 56rpx;
}
}
}
}
.flex_sc {
display: flex;
align-items: center;
}
.flex {
display: flex;
align-items: center;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
\ No newline at end of file \ No newline at end of file
<view class="container isFullSucreen">
<view wx:if="{{!isNoResult}}" class="title_widget flex_sc">
<view class="text_1">兑换记录</view>
<view class="text_2 marlf8">·</view>
<view class="text_2">{{listData.length}}</view>
</view>
<view wx:if="{{!isNoResult}}" class="list">
<block wx:for="{{listData}}" wx:key="index">
<view class="element {{item.type == 3?'bank':''}}">
<gl-image wx:if="{{item.type==-1}}" webp mode="widthFix" class="bgicon" src="/bankAccount/status_shop_change.png" />
<gl-image wx:else webp mode="widthFix" class="bgicon" src="/bankAccount/status_{{STATUSICON[item.iconType]}}.png" />
<view class="posi_wrap">
<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>
<block wx:else>
<view class="avatar_info flex_sc">
<image wx:if="{{item.wechatAvatarUrl}}" mode="widthFix" class="icon" src="{{item.wechatAvatarUrl}}" />
<gl-image wx:else mode="widthFix" class="icon" src="/bankAccount/default_avatar.png" />
<view class="nameText">{{item.wechatNickName || ''}}</view>
</view>
</block>
<view class="countText flex">
-{{item.withdrawalScore}}
<view wx:if="{{item.type == -1}}" class="type">
消耗积分
</view>
<view wx:else class="type">
{{item.type == 3 ?'银行卡':'微信'}}兑换
</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>
</view>
</block>
</view>
<van-empty wx:if="{{isNoResult}}" description="暂无兑换记录" />
</view>
\ No newline at end of file \ No newline at end of file
Page({
data: {
},
toWatchNote(){
wx.$router.reLaunch('integration.record')
},
toBackMine(){
wx.$router.reLaunch('integration.index')
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText":"积分兑换"
}
\ No newline at end of file \ No newline at end of file
/* integration/pages/point/success/success.wxss */
page {
background: white;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
}
.icon {
width: 400rpx;
height: 400rpx;
margin-top: 64rpx;
}
.max_text {
font-weight: 600;
font-size: 40rpx;
color: #292D33;
margin-top: 16rpx;
margin-bottom: 24rpx;
}
.tip_text {
font-weight: 400;
font-size: 28rpx;
color: #7A8299;
}
.btn_group {
margin-top: 128rpx;
.btn_left {
width: 330rpx;
height: 80rpx;
box-sizing: border-box;
border-radius: 12rpx;
font-weight: 400;
font-size: 32rpx;
color: #292D33;
box-sizing: border-box;
background: #F7F8FA;
}
.btn_right {
width: 316rpx;
height: 80rpx;
background: #347BFF;
border-radius: 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
margin-left: 22rpx;
box-sizing: border-box;
}
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file \ No newline at end of file
<view class="container">
<gl-image mode="widthFix" class="icon" src="/bankAccount/success_icon_1.png" />
<view class="max_text">提交成功</view>
<view class="tip_text">您的银行卡积分兑换申请已成功提交!</view>
<!-- <view class="tip_text">您的提现申请已成功提交,预计将在24小时</view> -->
<!-- <view class="tip_text">到达您的微信零钱,请留意到账情况</view> -->
<view class="btn_group flex_cc">
<view class="btn_left flex_cc" bind:tap="toWatchNote">查看兑换记录</view>
<view class="btn_right flex_cc" bind:tap="toBackMine">返回我的积分</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// integration/pages/point/toCash/toCash.js
import MineApi from '../../../api'
import Dialog from '@vant/weapp/dialog/dialog';
Page({
data: {
sumbitScore: '',
showRate:false
},
toSumbitData() {
if (this.submit) return wx.$api.showToast('有一笔兑换正在进行')
let {
sumbitScore
} = this.data
let withDrawType = 3
let rateQuery = {}
console.log(this.accSub(Number(sumbitScore),0))
const money = this.accSub(Number(sumbitScore),0)
if (money <= 0) return wx.$api.showToast(`您的积分不足,请确认后重新申请兑换`)
// if(rateInfo){
// rateQuery = {
// withdrawalRate:rateInfo,
// arrivedAmount:money
// }
// this.tixianQuery = {
// sumbitScore,
// withDrawType,
// rateQuery
// }
// this.toShowModal(sumbitScore)
// return
// }
this.comfirmSumbit(sumbitScore,withDrawType)
},
// 提现确认模块
comfirmSumbit(sumbitScore,withDrawType,rateQuery={}){
Dialog.confirm({
title: '提示',
message: `请确认是否将${sumbitScore}积分进行兑换`,
}).then(() => {
if (this.submit) return
this.submit = true
wx.$api.showLoading('提交中')
MineApi.WithdrawalApi({
withdrawalScore: sumbitScore,
withDrawType,
sourceFrom: 1 // 来源 0:活动 1:阳光激励
}).then(res => {
wx.hideLoading();
if (res.code == 0) {
wx.$router.redirectTo('integration.success')
} else {
wx.$api.showToast(res.message)
this.submit = false
}
}).catch((err) => {
wx.$api.showToast(JSON.stringify(err))
this.submit = false
})
}).catch(() => {
this.submit = false
});
},
onRoute(options) {
// this.getRateInfo()
this.setData({
user: options.user,
score: options.score,
sumbitScore: options?.score?.motivationWithdrawalScore
})
},
/**添加手续费提示 */
toShowModal(sumbitScore){
const Rate = Number(this.data.rateInfo)
const money = this.accSub(Number(sumbitScore),(Number(sumbitScore)*Rate))
const obj = {
count:sumbitScore,
money:money,
rate:`${Rate*100}%`
}
this.setData({
showRate:true,
rateMoney:obj
})
},
/**获取手续费 */
getRateInfo(){
const userStorage = wx.$storage.get("userInfo");
MineApi.getRate({merchantId:userStorage.merchantId}).then(res=>{
this.setData({
rateInfo:res
})
})
},
toJump(){
this.comfirmSumbit(this.tixianQuery.sumbitScore,this.tixianQuery.withDrawType,this.tixianQuery.rateQuery)
},
accSub(arg1, arg2) {
let r1, r2, m, n;
try {
r1 = arg1.toString().split(".")[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r2 = 0;
}
m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //动态控制精度长度
n = (r1 >= r2) ? r1 : r2;
return ((arg1 * m - arg2 * m) / m).toFixed(n);
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index",
"modal": "../../../components/Modal"
},
"navigationBarTitleText":"兑换"
}
\ No newline at end of file \ No newline at end of file
/* integration/pages/point/toCash/toCash.wxss */
page {
background: #F7F8FA;
}
.tab{
background-color: #fff;
}
.container {
padding: 32rpx;
.container_title {
margin: 8rpx 0 24rpx;
font-size: 36rpx;
font-weight: 600;
color: #292D33;
}
}
.input_wrapper {
width: 686rpx;
background: #FFFFFF;
border-radius: 16rpx;
box-sizing: border-box;
padding: 32rpx;
.title {
font-weight: 400;
font-size: 32rpx;
color: #292D33;
}
.int_widget {
box-sizing: border-box;
margin-top: 32rpx;
background: #F0F1F5;
border-radius: 8rpx;
.intClass {
width: 100%;
font-weight: 700;
font-size: 48rpx;
color: #757980;
padding: 16rpx 20rpx;
}
.btn {
width: 154rpx;
height: 48rpx;
background: rgba(85, 106, 245, 0.10);
border-radius: 24rpx;
font-weight: 400;
font-size: 24rpx;
color: #556AF5;
}
}
.score_tip{
color: #999EA8;
margin-top: 16rpx;
font-size: 24rpx;
}
}
.tip_msg_warn{
font-weight: 400;
font-size: 24rpx;
color: #8F959E;
margin-top: 16rpx;
line-height: 40rpx;
}
.sumbit_btn {
margin: 0 auto;
margin-top: 70rpx;
width: calc(100% - 32rpx);
height: 88rpx;
background: #347BFF;
border-radius:12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file \ No newline at end of file
<!--integration/pages/point/toCash/toCash.wxml-->
<block>
<view class="container">
<view class="container_title">阳光激励兑换</view>
<view class="input_wrapper">
<view class="title">兑换积分</view>
<view class="int_widget flex_scb">
<input type="digit" value="{{sumbitScore}}" disabled class="intClass" />
</view>
<view class="score_tip">银行卡可兑换积分:{{score.motivationWithdrawalScore}}</view>
</view>
<view class="tip_msg_warn">兑换规则:<view>1.每次兑换只能把积分一次性全部兑换,不可分批兑换</view>
<view>2.工作日17点前兑换的当日到账,17点后兑换的次日到账;非工作日顺延。</view></view>
<view class="sumbit_btn flex_cc" bind:tap="toSumbitData">提交</view>
</view>
<van-dialog id="van-dialog" />
</block>
<!-- <modal show="{{showRate}}" info="{{rateMoney}}" bind:sumbit="toJump"></modal> -->
...@@ -35,7 +35,7 @@ Page({ ...@@ -35,7 +35,7 @@ Page({
key: 'payTime' key: 'payTime'
}, { }, {
label: '推荐人', label: '推荐人',
arr: ['staffName', 'staffPhone'] arr: ['referrerName', 'referrerPhone']
}, { }, {
label: '门店名称', label: '门店名称',
key: 'merchantName' key: 'merchantName'
...@@ -46,6 +46,9 @@ Page({ ...@@ -46,6 +46,9 @@ Page({
label: '交易流水号', label: '交易流水号',
key: 'tradeNo' key: 'tradeNo'
}, { }, {
label: '积分归属',
key: 'staffSource'
}, {
label: '备注', label: '备注',
key: 'remark' key: 'remark'
}], }],
...@@ -94,7 +97,7 @@ Page({ ...@@ -94,7 +97,7 @@ Page({
pageNum, pageNum,
pageSize: 4, pageSize: 4,
search: keyword, search: keyword,
supervisorAudit: statusObj[tabIndex] supervisorStatus: statusObj[tabIndex]
} }
if (nothing) return if (nothing) return
api.getPointsReviewListAPI(params).then(res => { api.getPointsReviewListAPI(params).then(res => {
...@@ -108,6 +111,7 @@ Page({ ...@@ -108,6 +111,7 @@ Page({
val.operateTime = (val?.operationList?.[0]?.operateTime && (new Date(val.operationList[0].operateTime).format('yyyy.MM.dd hh:mm:ss') || val.operationList[0].operateTime)) || '' // 审批时间 val.operateTime = (val?.operationList?.[0]?.operateTime && (new Date(val.operationList[0].operateTime).format('yyyy.MM.dd hh:mm:ss') || val.operationList[0].operateTime)) || '' // 审批时间
val.operator = val?.operationList?.[0]?.operator || '' // 审批人 val.operator = val?.operationList?.[0]?.operator || '' // 审批人
val.operatorPhone = val?.operationList?.[0]?.operatorPhone || '' // 审批人手机号 val.operatorPhone = val?.operationList?.[0]?.operatorPhone || '' // 审批人手机号
val.staffSource = val.staffSource == 1 ? '驻店员工' : '门店员工' // 积分归属
}) })
let tempList = listData?.concat(data?.list) let tempList = listData?.concat(data?.list)
this.setData({ this.setData({
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<view class="occupy_element"></view> <view class="occupy_element"></view>
<block wx:for="{{listData}}" wx:key="index"> <block wx:for="{{listData}}" wx:key="index">
<view class="list-item"> <view class="list-item">
<view class="status text-center" style="color:{{statusObj[item.supervisorAudit].color }};background-color:{{statusObj[item.supervisorAudit].background }};"> <view class="status text-center" style="color:{{statusObj[item.supervisorStatus].color }};background-color:{{statusObj[item.supervisorStatus].background }};">
{{statusObj[item.supervisorAudit].text }} {{statusObj[item.supervisorStatus].text }}
</view> </view>
<view class="name"> <view class="name">
<view class="name-text text-hide ">{{item.customerName}}</view> <view class="name-text text-hide ">{{item.customerName}}</view>
...@@ -75,16 +75,16 @@ ...@@ -75,16 +75,16 @@
</block> </block>
</view> </view>
</view> </view>
<view class="item-flex" wx:if="{{item.supervisorAudit == 2}}"> <view class="item-flex" wx:if="{{item.supervisorStatus == 2}}">
<view class="label">{{item.failType == 1 ? '退款' : item.failType == 2 ? '撤单' : item.failType == 3 ? '错单' : ''}}时间</view> <view class="label">{{item.failType == 1 ? '退款' : item.failType == 2 ? '撤单' : item.failType == 3 ? '错单' : ''}}时间</view>
<view class="value">{{item.failTime}}</view> <view class="value">{{item.failTime}}</view>
</view> </view>
</view> </view>
<view class="btn-box" wx:if="{{item.supervisorAudit == 0}}"> <view class="btn-box" wx:if="{{item.supervisorStatus == 0}}">
<view class="line"></view> <view class="line"></view>
<view class="btn" catch:tap="handleReview" data-item="{{item}}">审批</view> <view class="btn" catch:tap="handleReview" data-item="{{item}}">审批</view>
</view> </view>
<view class="review-message" wx:if="{{item.supervisorAudit == 1}}"> <view class="review-message" wx:if="{{item.supervisorStatus == 1}}">
<view class="review-item"> <view class="review-item">
<view class="label">审批时间</view> <view class="label">审批时间</view>
<view class="value">{{item.operateTime}}</view> <view class="value">{{item.operateTime}}</view>
......
...@@ -27,5 +27,20 @@ module.exports = { ...@@ -27,5 +27,20 @@ module.exports = {
/** 根据园区店商户号获取服务商列表 */ /** 根据园区店商户号获取服务商列表 */
queryPartnersByYqShop(data) { queryPartnersByYqShop(data) {
return api.post('dj.api.scenemerchantref.queryPartnersByYqShop', data) return api.post('dj.api.scenemerchantref.queryPartnersByYqShop', data)
} },
/**根据员工id查询员工银行卡列表 */
getStaffBankList(data) {
let params = data || {}
return api.post(
'dj.api.smartcarlife.withdrawal.staff.bank.list',
params,
);
},
// 获取积分详情
getScoreDetailApi(data) {
let params = data || {}
return api.post("dj.api.smartcarlife.score.detail",
params,
);
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -59,10 +59,76 @@ Page({ ...@@ -59,10 +59,76 @@ Page({
selectedSceneName: '', selectedSceneName: '',
selectedSceneDesc: '', selectedSceneDesc: '',
versionData: {}, versionData: {},
isForbidden:false isForbidden: false,
staffBankFlag: false
},
/**跳转至银行卡 */
toAddBankAccount(e) {
const {
score,
user
} = this.data
this.setData({
showAccountModal: false
}, () => {
wx.$router.go('integration.detail', {
score
})
})
},
async getStaffBankList() {
let userInfo = wx.$util.getUserInfo(),
res = await api.getStaffBankList({
uuid: userInfo.uuid
})
console.log(res)
if (res.data && res.data.length) {
this.data.staffBankFlag = true
const [staffBankInfo] = res.data
if (staffBankInfo.state == 2 && !this.staffBankInfo) {
this.staffBankInfo = staffBankInfo
this.setData({
showAccountErrorModal: true
})
}
}
},
//我的积分
toPoint() {
//判断是否添加银行卡
if (!this.data.staffBankFlag) {
this.setData({
showAccountModal: true
})
return
}
// 新的积分兑换页面
wx.$router.go('integration.index')
},
toCloseModal(e) {
const {
name
} = e.currentTarget.dataset
this.setData({
[name]: false
});
},
//收款账户
jumpAccount() {
const {
score,
user
} = wx.$router.getPageInstance()
wx.$router.go('integration.list', {
score,
user
})
}, },
jump(e) { jump(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 = `${baseUrl}${url}.html`
wx.navigateTo({ wx.navigateTo({
...@@ -70,8 +136,14 @@ Page({ ...@@ -70,8 +136,14 @@ Page({
}) })
}, },
getByYqShop() { getByYqShop() {
let { sceneType, merchantId } = wx.$util.getUserInfo() let {
api.queryPartnersByYqShop({ scene: sceneType, merchantId }).then(res => { sceneType,
merchantId
} = wx.$util.getUserInfo()
api.queryPartnersByYqShop({
scene: sceneType,
merchantId
}).then(res => {
const merchantInfo = (res.data || []).slice(0, 3) const merchantInfo = (res.data || []).slice(0, 3)
console.log(merchantInfo, 'merchantInfo') console.log(merchantInfo, 'merchantInfo')
this.setData({ this.setData({
...@@ -106,7 +178,7 @@ Page({ ...@@ -106,7 +178,7 @@ Page({
navBarHeight navBarHeight
}) })
}, },
noScroll() { }, noScroll() {},
showWork() { showWork() {
let { let {
showWorkBox showWorkBox
...@@ -340,16 +412,21 @@ Page({ ...@@ -340,16 +412,21 @@ Page({
this.setData({ this.setData({
isForbidden: !(userInfo?.isSuper || userInfo?.loginRole == 3), isForbidden: !(userInfo?.isSuper || userInfo?.loginRole == 3),
isYqdSuper: app.globalData.isYqdSuper, isYqdSuper: app.globalData.isYqdSuper,
selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName, selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName,
selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc
}) })
this.getVersionInfo() this.getVersionInfo()
this.getByYqShop() this.getByYqShop()
// this.getStaffBankList()
// console.log(app.globalData.isYqdSuper) // console.log(app.globalData.isYqdSuper)
}, },
// jump: e => wx.$router.jump(e), // jump: e => wx.$router.jump(e),
onPageScroll({ scrollTop }) { onPageScroll({
scrollTop
}) {
this.setData({ this.setData({
navStyle: scrollTop > 90 ? 'background-color: #FFFFFF;box-shadow:none;' : 'background-color: rgba(0,0,0,0);box-shadow:none;' navStyle: scrollTop > 90 ? 'background-color: #FFFFFF;box-shadow:none;' : 'background-color: rgba(0,0,0,0);box-shadow:none;'
}) })
...@@ -358,34 +435,35 @@ Page({ ...@@ -358,34 +435,35 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { }, onReady: function () {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
// this.getTotal() // this.getTotal()
this.getStaffBankList()
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { }, onHide: function () {},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { }, onUnload: function () {},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { }, onPullDownRefresh: function () {},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { }, onReachBottom: function () {},
/** /**
* 查看我的种草 * 查看我的种草
......
...@@ -17,7 +17,11 @@ ...@@ -17,7 +17,11 @@
</view> </view>
<view class="name_box"> <view class="name_box">
<view class="item name text-hide">{{userInfo.name}}</view> <view class="item name text-hide">{{userInfo.name}}</view>
<view class="change_btn" bindtap="changeAccount">切换账号</view> <view class="point-box" wx:if="{{isForbidden}}">
<view class="change_btn" bind:tap="toPoint">我的积分</view>
<image class="icon_card" bindtap="jumpAccount" src="{{IMG_URL}}bank-card.png" mode="" />
</view>
<!-- <view class="change_btn" bindtap="changeAccount">切换账号</view> -->
</view> </view>
<view class="user-info"> <view class="user-info">
<view class="user-text"> <view class="user-text">
...@@ -146,6 +150,7 @@ ...@@ -146,6 +150,7 @@
</view> --> </view> -->
</view> </view>
<view class="logout-box {{!isForbidden?'fixbtn':''}}"> <view class="logout-box {{!isForbidden?'fixbtn':''}}">
<view class="logout text-center" bindtap="changeAccount">切换账号</view>
<view class="logout text-center" bindtap="logout">退出账号</view> <view class="logout text-center" bindtap="logout">退出账号</view>
<view class="message-box"> <view class="message-box">
<!-- <view class="message">为保障你的合法权益,请阅读并同意</view> --> <!-- <view class="message">为保障你的合法权益,请阅读并同意</view> -->
...@@ -201,3 +206,25 @@ ...@@ -201,3 +206,25 @@
<!-- isYqdSuper --> <!-- isYqdSuper -->
<switch-popup show="{{showMerchantPop}}" height="{{'80%'}}" title="{{merchantPopConfig.title}}" isYqdSuper="{{isYqdSuper}}" tips="{{merchantPopConfig.tips}}" /> <switch-popup show="{{showMerchantPop}}" height="{{'80%'}}" title="{{merchantPopConfig.title}}" isYqdSuper="{{isYqdSuper}}" tips="{{merchantPopConfig.tips}}" />
</block> </block>
<!-- 提现账号 -->
<van-popup show="{{showAccountModal}}" round position="bottom" bind:click-overlay="toCloseModal" custom-class="popclass" data-name="showAccountModal">
<view class="modal_title">提示</view>
<view class="modal_tip">首次兑换需要您添加个人真实的银行账户!</view>
<button class="modal_btn" catchtap="toAddBankAccount">去添加</button>
</van-popup>
<!-- 银行卡信息有误 -->
<van-popup show="{{showAccountErrorModal}}" round position="bottom" bind:click-overlay="toCloseModal" custom-class="popclass" data-name="showAccountErrorModal">
<view class="modal_title">提示</view>
<view class="modal_tip">您的银行信息有误</view>
<view class="modal_error">原因:手机号非银行预留手机号</view>
<view class="btns">
<button class="modal_btn default" catchtap="toCloseModal" data-name="showAccountErrorModal">我知道了</button>
<button class="modal_btn" catchtap="toEditBankAccount" >去编辑</button>
</view>
</van-popup>
<!-- 绑定微信提示弹框 -->
<van-popup bind:click-overlay="toCloseModal" show="{{ showModal }}" custom-class="popclass" position="bottom" custom-style="height: 35%" data-name="showModal">
<view class="modal_title">提示</view>
<view class="modal_tip">您未绑定微信,请先完成绑定</view>
<button class="modal_btn" open-type="getPhoneNumber" catch:tap="toCloseModal" data-name="showModal" bindgetphonenumber="toBindWechat">去绑定</button>
</van-popup>
\ No newline at end of file \ No newline at end of file
...@@ -53,11 +53,15 @@ page { ...@@ -53,11 +53,15 @@ page {
color: #323436; color: #323436;
font-weight: 600; font-weight: 600;
} }
.point-box {
display: flex;
align-items: center;
}
.change_btn { .change_btn {
width: var(--fontSize134); width: var(--fontSize134);
height: var(--fontSize48); height: var(--fontSize48);
background: rgba(52, 123, 255, .1); background: rgba(52, 123, 255, 0.1);
color: #347BFF; color: #347BFF;
font-size: var(--fontSize24); font-size: var(--fontSize24);
display: flex; display: flex;
...@@ -66,6 +70,13 @@ page { ...@@ -66,6 +70,13 @@ page {
border-radius: var(--fontSize24); border-radius: var(--fontSize24);
} }
.icon_card {
width: 72rpx;
height: 48rpx;
margin-left: var(--fontSize24);
}
.user-info { .user-info {
padding: 0 var(--fontSize50); padding: 0 var(--fontSize50);
} }
...@@ -444,11 +455,17 @@ page { ...@@ -444,11 +455,17 @@ page {
.work-box .disabled { .work-box .disabled {
opacity: .5; opacity: .5;
} }
.logout-box { .logout-box {
width: calc(100% - 40rpx);
background: #FFFFFF;
border-radius: 16rpx;
position: relative; position: relative;
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-direction: column;
padding: 0 32rpx;
margin: 0 20rpx;
box-sizing: border-box;
} }
.logout { .logout {
...@@ -456,15 +473,16 @@ page { ...@@ -456,15 +473,16 @@ page {
bottom: var(--fontSize106); bottom: var(--fontSize106);
left: 50%; left: 50%;
transform: translateX(-50%); */ transform: translateX(-50%); */
width: var(--fontSize326); width: 100%;
height: var(--fontSize80); height: var(--fontSize88);
background: #FFFFFF; color: #292D33;
border: var(--fontSize2) solid #DCDEE0;
border-radius: var(--fontSize12);
color: #6C6C70;
font-size: var(--fontSize28); font-size: var(--fontSize28);
} }
.logout-box :first-child {
border-bottom: 1rpx solid #E4E8EE;
}
.c_blue { .c_blue {
color: #347BFF; color: #347BFF;
} }
...@@ -493,5 +511,65 @@ page { ...@@ -493,5 +511,65 @@ page {
.fixbtn { .fixbtn {
position: fixed; position: fixed;
bottom: 100rpx; bottom: 100rpx;
width: 100%;
}
.popclass {
position: relative;
border-radius: 24rpx 24rpx 0 0;
z-index: 999;
}
.popclass .modal_title {
font-weight: 500;
font-size: 40rpx;
color: #333333;
box-sizing: border-box;
padding-top: 48rpx;
padding-left: 49rpx;
}
.popclass .modal_tip {
font-weight: 400;
font-size: 32rpx;
color: #333333;
margin-top: 64rpx;
padding-left: 49rpx;
}
.popclass .modal_error {
font-size: 32rpx;
color: #FE5662;
margin-top: 12rpx;
padding-left: 49rpx;
}
.popclass .btns {
display: flex;
padding: 0 48rpx;
gap: 0 20rpx;
}
.popclass .modal_btn {
width: calc(100% - 98rpx);
height: 88rpx;
margin: 0 auto;
margin-top: 120rpx;
margin-bottom:20rpx;
background: #347BFF;
border-radius: 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
}
.modal_btn::after {
display: none;
}
.popclass .default {
background: #fff;
color: #333;
border: 2rpx solid #e1e1e1;
} }
\ No newline at end of file \ No newline at end of file
...@@ -32,4 +32,9 @@ module.exports = { ...@@ -32,4 +32,9 @@ module.exports = {
data.sceneType = 1 data.sceneType = 1
return api.post('dj.api.smartcarlife.order.statByStatus', data) return api.post('dj.api.smartcarlife.order.statByStatus', data)
}, },
/** 获取商户基本信息 */
getServiceBaseInfo(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo", data)
}
} }
...@@ -42,6 +42,7 @@ Page({ ...@@ -42,6 +42,7 @@ Page({
tabListTemplate: ["全部", "待跟进", "已升级", "战败"], tabListTemplate: ["全部", "待跟进", "已升级", "战败"],
isMake: true, isMake: true,
selectType: 1, selectType: 1,
isSettingExpiredTraffic: false // 是否启用流量失效
}, },
// 创建一个动画实例 // 创建一个动画实例
// createAnimation: function () { // createAnimation: function () {
...@@ -68,6 +69,13 @@ Page({ ...@@ -68,6 +69,13 @@ Page({
}, },
// 确定是否要显示 // 确定是否要显示
showSelectType({ scene = "", item = {} }) { showSelectType({ scene = "", item = {} }) {
let {isSettingExpiredTraffic} = this.data
// 当切换门店后,不支持录入失效客户工单,将selectType置为1录入工单
if (!isSettingExpiredTraffic && this.data.selectType == 3) {
this.setData({
selectType: 1
})
}
wx.$modal( wx.$modal(
this, this,
{ {
...@@ -87,6 +95,7 @@ Page({ ...@@ -87,6 +95,7 @@ Page({
wx.$router.go("tabWorkOrder.defeatOrder", { wx.$router.go("tabWorkOrder.defeatOrder", {
scene, scene,
...item, ...item,
isExpiredTraffic: selectType == 3
}); });
} }
}, },
...@@ -665,6 +674,7 @@ Page({ ...@@ -665,6 +674,7 @@ Page({
}, },
() => { () => {
this.search(); this.search();
this.getCreateOrderSetting()
} }
); );
} }
...@@ -675,6 +685,16 @@ Page({ ...@@ -675,6 +685,16 @@ Page({
// } // }
// console.log(options,'options'); // console.log(options,'options');
}, },
// 获取轻改录单配置是否启用流量失效
getCreateOrderSetting() {
let userInfo = wx.$util.getUserInfo()
let merchantType = userInfo?.merchantAccountList.includes("6") || userInfo?.merchantAccountList.includes("8")
if (merchantType && !userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.userType == 2 && userInfo?.shopMerchantId) {
api.getServiceBaseInfo({merchantId: userInfo?.shopMerchantId}).then(res => {
this.setData({isSettingExpiredTraffic: res?.data?.trafficExpireFlag == 'Y'})
})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -684,6 +704,7 @@ Page({ ...@@ -684,6 +704,7 @@ Page({
this.setData({ this.setData({
isMake: !(userInfo?.isSuper || userInfo?.loginRole == 3), isMake: !(userInfo?.isSuper || userInfo?.loginRole == 3),
}); });
this.getCreateOrderSetting()
}, },
/** /**
......
...@@ -229,5 +229,9 @@ ...@@ -229,5 +229,9 @@
<gl-image class="icon" src="/miniProgram/order3.png"></gl-image> <gl-image class="icon" src="/miniProgram/order3.png"></gl-image>
战败下单 战败下单
</view> </view>
<view wx:if="{{isSettingExpiredTraffic}}" class="modalbox cancle {{ selectType == 3?'act': '' }}" bindtap="selectType" data-type="3">
<gl-image class="icon" src="/miniProgram/order4.png"></gl-image>
失效客户
</view>
</view> </view>
</modal> </modal>
\ No newline at end of file \ No newline at end of file
...@@ -563,6 +563,7 @@ Page({ ...@@ -563,6 +563,7 @@ Page({
isCarBrand, isCarBrand,
isPlateNumber, isPlateNumber,
refusalReason, refusalReason,
isExpiredTraffic
} = this.data; } = this.data;
let key = this.checkRequired(orderObj); let key = this.checkRequired(orderObj);
if (key) { if (key) {
...@@ -589,7 +590,7 @@ Page({ ...@@ -589,7 +590,7 @@ Page({
if (isPlateNumber && !notUpgradeOrderList[index].customer.plateNumber) { if (isPlateNumber && !notUpgradeOrderList[index].customer.plateNumber) {
return this.showToast(`请输入第${index + 1}位客户车牌号`); return this.showToast(`请输入第${index + 1}位客户车牌号`);
} }
if (!notUpgradeOrderList[index].subOrderList?.length) { if (!notUpgradeOrderList[index].subOrderList?.length && !isExpiredTraffic) {
return this.showToast(`请选择第${index + 1}位客户产品`); return this.showToast(`请选择第${index + 1}位客户产品`);
} }
if (refusalReason && !notUpgradeOrderList[index].customer.refusalReason) { if (refusalReason && !notUpgradeOrderList[index].customer.refusalReason) {
...@@ -608,7 +609,11 @@ Page({ ...@@ -608,7 +609,11 @@ Page({
}; };
arr.push(obj); arr.push(obj);
}); });
val.subOrderList = arr; val.subOrderList = !isExpiredTraffic ? arr : [];
if (isExpiredTraffic) {
delete val.customer?.['experienceFlag'] // 删除是否体验参数
val['packageGoodsList'] = [] // 删除商品参数
}
}); });
orderObj = { orderObj = {
...@@ -956,6 +961,7 @@ Page({ ...@@ -956,6 +961,7 @@ Page({
onShow: function (res) { }, onShow: function (res) { },
onRoute(res) { onRoute(res) {
console.log(res, "onroute"); console.log(res, "onroute");
this.setData({isExpiredTraffic: res?.isExpiredTraffic})
if (res.scene) { if (res.scene) {
let { isAlreadyExistOrder } = this.data; let { isAlreadyExistOrder } = this.data;
res.returnFun = true; res.returnFun = true;
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<gl-cell wx:if="{{ orderObj.selectPayType !=0 }}" required="{{ isPlateNumber }}" border valueAlign="right" iconSrc="{{ scanIcon }}" bindtitleClick="navOcr" data-type="plateNumber" label="车牌号" requiredAfter labelWidth="var(--fontSize240)"> <gl-cell wx:if="{{ orderObj.selectPayType !=0 }}" required="{{ isPlateNumber }}" border valueAlign="right" iconSrc="{{ scanIcon }}" bindtitleClick="navOcr" data-type="plateNumber" label="车牌号" requiredAfter labelWidth="var(--fontSize240)">
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" value="{{ li.customer.plateNumber }}" bindinput="input" data-name="customer.plateNumber" data-index="{{ ind }}" maxlength="8" always-embed></input> <input placeholder="点击输入" class="input" placeholder-class="placeholder-class" value="{{ li.customer.plateNumber }}" bindinput="input" data-name="customer.plateNumber" data-index="{{ ind }}" maxlength="8" always-embed></input>
</gl-cell> </gl-cell>
<view class="goods_box"> <view class="goods_box" wx:if="{{!isExpiredTraffic}}">
<view class="label" style="margin-bottom: {{ !frontGearArr.length && !sideRearGearArr.length && !skylightArr.length ? 'var(--fontSize40)' : '' }};"> <view class="label" style="margin-bottom: {{ !frontGearArr.length && !sideRearGearArr.length && !skylightArr.length ? 'var(--fontSize40)' : '' }};">
请选择产品 请选择产品
<text class="required">*</text> <text class="required">*</text>
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
</block> </block>
</view> </view>
<!-- required="{{ experienceFlag }}" requiredAfter --> <!-- required="{{ experienceFlag }}" requiredAfter -->
<gl-cell wx:if="{{ experienceFlag }}" border label="是否体验" valueAlign="right" labelWidth="var(--fontSize140)"> <gl-cell wx:if="{{ experienceFlag && !isExpiredTraffic }}" border label="是否体验" valueAlign="right" labelWidth="var(--fontSize140)">
<view class="gender-box"> <view class="gender-box">
<view class="block text-center {{ li.customer.experienceFlag=='Y'?'':'right' }}" /> <view class="block text-center {{ li.customer.experienceFlag=='Y'?'':'right' }}" />
<view class="male text-center {{ li.customer.experienceFlag == 'Y'?'active':'' }}" bindtap="changeExperience" data-index="{{ ind }}" data-experience="Y">是</view> <view class="male text-center {{ li.customer.experienceFlag == 'Y'?'active':'' }}" bindtap="changeExperience" data-index="{{ ind }}" data-experience="Y">是</view>
......
...@@ -293,6 +293,7 @@ scroll-view ::-webkit-scrollbar { ...@@ -293,6 +293,7 @@ scroll-view ::-webkit-scrollbar {
.list { .list {
transition: all .25s; transition: all .25s;
padding-bottom: var(--fontSize80);
} }
.addBtn .addIcon { .addBtn .addIcon {
......
...@@ -111,16 +111,17 @@ Page({ ...@@ -111,16 +111,17 @@ Page({
// console.log(result) // console.log(result)
let { let {
code, code,
message,
solution solution
} = result } = result
if (code == 0) { if (code == 0) {
wx.$util.refreshPageData() wx.$util.refreshPageData()
wx.$router.redirectTo('constructionOrderDetail', orderInfo) wx.$router.redirectTo('constructionOrderDetail', orderInfo)
} else { } else {
// console.log('false') if (solution) {
wx.showModal({ wx.showModal({
title: '温馨提示', title: '温馨提示',
content: solution, content: message,
showCancel: false, showCancel: false,
confirmText: '刷新', confirmText: '刷新',
confirmColor: '#347BFF', confirmColor: '#347BFF',
...@@ -130,6 +131,9 @@ Page({ ...@@ -130,6 +131,9 @@ Page({
} }
} }
}) })
} else {
wx.$util.showToast(message)
}
} }
}) })
.catch(err => { .catch(err => {
......
...@@ -79,9 +79,10 @@ ...@@ -79,9 +79,10 @@
<view class="label icon"> <view class="label icon">
<image src="../../images/voucher_icon.png" mode="" /> <image src="../../images/voucher_icon.png" mode="" />
</view> </view>
<view class="value"> <view class="value" wx:if="{{orderInfo.couponName || orderInfo.customerCoupon.customerCouponCode || orderInfo.customerCoupon.employeeName}}">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}}) {{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view> </view>
<view class="value" wx:else>无</view>
</view> </view>
<view class="line" /> <view class="line" />
<view class="cell total"> <view class="cell total">
...@@ -246,7 +247,8 @@ ...@@ -246,7 +247,8 @@
</view> </view>
</block> --> </block> -->
</view> </view>
<block wx:if="{{(!userInfo.isSuper && userInfo.userType == 2&&orderInfo.status!=10&&orderInfo.status!=9)||isMake}}"> <!-- 已支付4 战败2 已评价6 三种状态才展示 并且不是通过失效客户录入的战败单 -->
<block wx:if="{{(!userInfo.isSuper && userInfo.loginRole != 3 && userInfo.userType == 2 && (orderInfo.status == 4 || orderInfo.status == 2 || orderInfo.status == 6)) && (orderInfo.subOrderList && orderInfo.subOrderList.length)}}">
<!-- 不需要走签名逻辑 --> <!-- 不需要走签名逻辑 -->
<view wx:if="{{signatureSwitch&&orderInfo.selectPayType!=0}}" class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}"> <view wx:if="{{signatureSwitch&&orderInfo.selectPayType!=0}}" class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn text-center" bindtap="navOrderSignature">客户签名确认</view> <view class="btn text-center" bindtap="navOrderSignature">客户签名确认</view>
......
...@@ -59,9 +59,10 @@ ...@@ -59,9 +59,10 @@
</view> </view>
<view class="cell"> <view class="cell">
<view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view> <view class="label icon"><image src="../../images/voucher_icon.png" mode=""/></view>
<view class="value"> <view class="value" wx:if="{{orderInfo.couponName || orderInfo.customerCoupon.customerCouponCode || orderInfo.customerCoupon.employeeName}}">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}}) {{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view> </view>
<view class="value" wx:else>无</view>
</view> </view>
<view class="line" /> <view class="line" />
<view class="cell total"> <view class="cell total">
...@@ -141,7 +142,8 @@ ...@@ -141,7 +142,8 @@
</view> </view>
</view> </view>
</view> </view>
<block wx:if="{{!userInfo.isSuper && userInfo.userType == 2&&orderInfo.status!=10}}"> <!-- 已支付4 战败2 已评价6 三种状态才展示 并且不是通过失效客户录入的战败单 -->
<block wx:if="{{(!userInfo.isSuper && userInfo.loginRole != 3 && userInfo.userType == 2 && (orderInfo.status == 4 || orderInfo.status == 2 || orderInfo.status == 6)) && (orderInfo.subOrderList && orderInfo.subOrderList.length)}}">
<view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}"> <view class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="btn text-center comfirmBtn" bindtap="confirmConstruction">确认完成施工</view> <view class="btn text-center comfirmBtn" bindtap="confirmConstruction">确认完成施工</view>
</view> </view>
......
...@@ -6,9 +6,9 @@ import apiCon from '~/api/api' ...@@ -6,9 +6,9 @@ import apiCon from '~/api/api'
import comApi from '~/api/api' import comApi from '~/api/api'
let toastList = { let toastList = {
deliveryCount: '新车交付数不能为空', deliveryCount: '新车交付数不能为空',
toShopFilmCount: '到店贴膜量(轻改)不能为空', toShopFilmCount: '触客台次(轻改)不能为空',
upgradeCount: '升级转化量(轻改)不能为空', // upgradeCount: '升级转化量(轻改)不能为空',
upgradeMoney: '今日转化产值(轻改)不能为空' // upgradeMoney: '今日转化产值(轻改)不能为空'
} }
const app = getApp() const app = getApp()
let programeFlag = false let programeFlag = false
...@@ -123,7 +123,9 @@ Page({ ...@@ -123,7 +123,9 @@ Page({
}) })
}, },
checkRequired(obj) { checkRequired(obj) {
let target = ['deliveryCount', 'toShopFilmCount', 'upgradeCount', 'upgradeMoney'] // 屏蔽升级转化率、今日转化产值
// let target = ['deliveryCount', 'toShopFilmCount', 'upgradeCount', 'upgradeMoney']
let target = ['deliveryCount', 'toShopFilmCount']
try { try {
target.map(key => { target.map(key => {
if ((obj[key] == '' || obj[key] == null) && (obj[key] != '0' || obj[key] != 0)) { if ((obj[key] == '' || obj[key] == null) && (obj[key] != '0' || obj[key] != 0)) {
...@@ -211,7 +213,7 @@ Page({ ...@@ -211,7 +213,7 @@ Page({
}) })
return return
} }
if (isNaN(orderObj.upgradeMoney)) return this.showToast('请输入正确的今日转化产值') // if (isNaN(orderObj.upgradeMoney)) return this.showToast('请输入正确的今日转化产值')
// 多选的数据处理 // 多选的数据处理
formData.map(item => { formData.map(item => {
let { name } = item let { name } = item
...@@ -226,6 +228,8 @@ Page({ ...@@ -226,6 +228,8 @@ Page({
orderObj.isAdmin = role == 'super' ? true : false orderObj.isAdmin = role == 'super' ? true : false
orderObj.oprBy = orderObj.staffUuid orderObj.oprBy = orderObj.staffUuid
orderObj.sceneType = 1 orderObj.sceneType = 1
delete orderObj.upgradeCount
delete orderObj.upgradeMoney
wx.$util.showLoading() wx.$util.showLoading()
if (this.data.isSubmit) return if (this.data.isSubmit) return
this.setData({ this.setData({
......
...@@ -38,18 +38,18 @@ ...@@ -38,18 +38,18 @@
</view> </view>
<!-- 到店贴膜量 --> <!-- 到店贴膜量 -->
<view class="input-item"> <view class="input-item">
<view class="label">到店贴膜量(轻改)<text class="required_text">*</text><text>{{orderObj.staffName}}</text></view> <view class="label">触客台次(轻改)<text class="required_text">*</text><text>{{orderObj.staffName}}</text></view>
<input <input
value="{{orderObj.toShopFilmCount}}" value="{{orderObj.toShopFilmCount}}"
class="content-input {{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? 'disabled' : ''}}" type="number" class="content-input {{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? 'disabled' : ''}}" type="number"
placeholder="每日填写本人该业务的到店贴膜量" placeholder="每日填写本人该业务的触客台次"
maxlength="3" maxlength="3"
bindinput="input" bindinput="input"
data-name="toShopFilmCount" data-name="toShopFilmCount"
disabled="{{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport)}}"/> disabled="{{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport)}}"/>
</view> </view>
<!-- 升级转化量 --> <!-- 升级转化量 -->
<view class="input-item"> <!-- <view class="input-item">
<view class="label">升级转化量(轻改)<text class="required_text">*</text><text>{{orderObj.staffName}}</text></view> <view class="label">升级转化量(轻改)<text class="required_text">*</text><text>{{orderObj.staffName}}</text></view>
<input <input
value="{{orderObj.upgradeCount}}" value="{{orderObj.upgradeCount}}"
...@@ -60,9 +60,9 @@ ...@@ -60,9 +60,9 @@
data-name="upgradeCount" data-name="upgradeCount"
disabled="{{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport)}}" disabled="{{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport)}}"
type="number"/> type="number"/>
</view> </view> -->
<!-- 今日转化产值 --> <!-- 今日转化产值 -->
<view class="input-item"> <!-- <view class="input-item">
<view class="label">今日转化产值(轻改)<text class="required_text">*</text><text>{{orderObj.staffName}}</text></view> <view class="label">今日转化产值(轻改)<text class="required_text">*</text><text>{{orderObj.staffName}}</text></view>
<view class="content-input flex {{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? 'disabled' : ''}}"> <view class="content-input flex {{filter.filterDisabled(role, weeklyList, orderObj.reportDate, isEditReport) ? 'disabled' : ''}}">
<input <input
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
type="digit"/> type="digit"/>
<text>元</text> <text>元</text>
</view> </view>
</view> </view> -->
<!-- 问题 --> <!-- 问题 -->
<block wx:for="{{formData}}" wx:key="index"> <block wx:for="{{formData}}" wx:key="index">
<gl-cell border valueAlign="right" label="{{item.label}}" class="pickerCell" labelWidth="{{defaultLabelWidth}}"> <gl-cell border valueAlign="right" label="{{item.label}}" class="pickerCell" labelWidth="{{defaultLabelWidth}}">
......
...@@ -21,7 +21,8 @@ export const STORAGE_OBJECTkEY = { ...@@ -21,7 +21,8 @@ export const STORAGE_OBJECTkEY = {
noSignInUuid: 'noSignInUuid', noSignInUuid: 'noSignInUuid',
outTradeNo: 'outTradeNo', outTradeNo: 'outTradeNo',
crowdFundingParams: 'crowdFundingParams', crowdFundingParams: 'crowdFundingParams',
dateStaffPop: 'dateStaffPop' dateStaffPop: 'dateStaffPop',
mock_data: 'mock_data',
} }
// export const IMG_VERSION = () => { // export const IMG_VERSION = () => {
......
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
} from './http.js' } from './http.js'
// console.log(secretKey, 'secretKey') // console.log(secretKey, 'secretKey')
import util from '~/utils/util.js' import util from '~/utils/util.js'
import { envIndex } from '~/config'
import qs from '~/utils/lib/qs' import qs from '~/utils/lib/qs'
/**接口 */ /**接口 */
class Request { class Request {
...@@ -123,5 +124,29 @@ class Request { ...@@ -123,5 +124,29 @@ class Request {
//data['sign'] = obj.sign; //data['sign'] = obj.sign;
return obj return obj
} }
getMock() {
const configModule = 'dj-car-boutique-work-wechat-miniapp',
env = {
'1': 'develop',
'2': 'test',
'3': 'production',
'4': 'beta'
} [envIndex],
configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${configModule}&env=${env}`
return new Promise(resolve => {
wx.request({
url: configUrl,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
} }
export default new Request() export default new Request()
\ No newline at end of file \ No newline at end of file
import api from '~/api/api' import api from '~/api/api'
import requestApi from '~/utils/request/request'
import wxApi from '~/utils/utils_wx' import wxApi from '~/utils/utils_wx'
import format from '~/utils/utils_format' import format from '~/utils/utils_format'
import $router from '../router/index' import $router from '../router/index'
import $storage from './cache/storage'; import {
Storage
} from '~/utils/cache/storage'
const $Storage = new Storage()
/**emoji正则 */ /**emoji正则 */
const emojiReg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac])/g const emojiReg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac])/g
/** /**
...@@ -30,7 +34,12 @@ Date.prototype.format = function (fmt) { ...@@ -30,7 +34,12 @@ Date.prototype.format = function (fmt) {
/**触底加载 */ /**触底加载 */
const onReachBottom = (obj, callBack) => { const onReachBottom = (obj, callBack) => {
let _this = $router.getPageInstance() let _this = $router.getPageInstance()
let { pageNum, total, pageSize, nothing } = obj let {
pageNum,
total,
pageSize,
nothing
} = obj
if (!total && !pageNum) { if (!total && !pageNum) {
console.error('total&&pageNum为必传') console.error('total&&pageNum为必传')
return return
...@@ -158,9 +167,10 @@ var type = function (data) { ...@@ -158,9 +167,10 @@ var type = function (data) {
var toString = Object.prototype.toString var toString = Object.prototype.toString
var dataType = var dataType =
data instanceof Element data instanceof Element ?
? 'element' // 为了统一DOM节点类型输出 'element' // 为了统一DOM节点类型输出
: toString :
toString
.call(data) .call(data)
.replace(/\[object\s(.+)\]/, '$1') .replace(/\[object\s(.+)\]/, '$1')
.toLowerCase() .toLowerCase()
...@@ -173,7 +183,10 @@ var type = function (data) { ...@@ -173,7 +183,10 @@ var type = function (data) {
* @param {*} obj * @param {*} obj
*/ */
const deepClone = obj => { const deepClone = obj => {
const clone = require('rfdc')({ proto: false, circles: false }) const clone = require('rfdc')({
proto: false,
circles: false
})
return clone(obj) return clone(obj)
} }
...@@ -280,7 +293,9 @@ const arrayUnique = (arr, name) => { ...@@ -280,7 +293,9 @@ const arrayUnique = (arr, name) => {
var hash = {} var hash = {}
return arr.reduce(function (acc, cru, index) { return arr.reduce(function (acc, cru, index) {
if (!hash[cru[name]]) { if (!hash[cru[name]]) {
hash[cru[name]] = { index: index } hash[cru[name]] = {
index: index
}
acc.push(cru) acc.push(cru)
} else { } else {
acc.splice(hash[cru[name]]['index'], 1, cru) acc.splice(hash[cru[name]]['index'], 1, cru)
...@@ -288,6 +303,48 @@ const arrayUnique = (arr, name) => { ...@@ -288,6 +303,48 @@ const arrayUnique = (arr, name) => {
return acc return acc
}, []) }, [])
} }
/**获取mock数据 */
let mockRequestCount = null,
mockTimer = {},
mockCache = null
const getMockData = async () => {
const MOCKDATA = $Storage.get('mock_data')
console.log(MOCKDATA)
try {
if (MOCKDATA && Date.now() - MOCKDATA.createTime < 5 * 60e3) {
console.log(1)
return Promise.resolve(MOCKDATA)
} else {
if (!mockRequestCount) {
console.log(2)
mockCache = null
mockRequestCount = Date.now()
const data = await requestApi.getMock()
data.createTime = Date.now()
mockCache = data
$Storage.set('mock_data', data)
return Promise.resolve(data)
} else {
console.log(3)
const key = Date.now()
return new Promise((resolve) => {
mockTimer[key] = setInterval(() => {
if (mockCache) {
clearInterval(mockTimer[key])
mockRequestCount = null
resolve(mockCache)
}
}, 1e3)
})
}
}
} catch (error) {
if (mockTimer[key]) clearInterval(mockTimer[key])
mockRequestCount = null
return Promise.reject(error)
}
}
const util = { const util = {
onReachBottom, onReachBottom,
...@@ -314,7 +371,8 @@ const util = { ...@@ -314,7 +371,8 @@ const util = {
pointRecord, pointRecord,
debounce, debounce,
refreshPageData, refreshPageData,
arrayUnique arrayUnique,
getMockData
} }
const Util = Object.assign(util, wxApi, format) const Util = Object.assign(util, wxApi, format)
// console.log('Util', Util) // console.log('Util', Util)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!