Commit 49de1026 by wangzhihui

积分

1 parent 3f8c3296
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
"mp-icon": "weui-miniprogram/icon/icon", "mp-icon": "weui-miniprogram/icon/icon",
"mp-dialog": "weui-miniprogram/dialog/dialog", "mp-dialog": "weui-miniprogram/dialog/dialog",
"mp-cell": "weui-miniprogram/cell/cell", "mp-cell": "weui-miniprogram/cell/cell",
"mp-cells": "weui-miniprogram/cells/cells" "mp-cells": "weui-miniprogram/cells/cells",
"Dialog":"/components/Dialog/Dialog"
}, },
"style": "v2", "style": "v2",
"resolveAlias": { "resolveAlias": {
......
...@@ -35,4 +35,8 @@ image { ...@@ -35,4 +35,8 @@ image {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
}
.suggest-box{
font-size: 28rpx;
color: #1B233D;
} }
\ No newline at end of file \ No newline at end of file
// components/Dialog/dialog.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: false
},
// 弹窗的标题
title: {
type: String,
value: ''
},
//是否显示蒙层
mask: {
type: Boolean,
value: true
},
buttons: {
type: Array,
default: () => [{
text: '取消',
extClass: 'btn_cancel'
}, {
text: '确定',
extClass: 'btn_primary'
}]
},
//['success','fail','loading]
statusIcon: {
type: String,
default: ""
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
handleClick(e) {
console.log(e)
this.triggerEvent('buttontap', {
...e
})
},
onClose() {}
}
})
\ 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
/* components/Dialog/dialog.wxss */
.auth-dialog-class {
text-align: center;
font-size: var(--fontSize28);
font-weight: 400;
}
.auth-dialog-class .van-dialog__header {
font-size: var(--fontSize36);
font-weight: 500;
color: #333333;
}
.title_text {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 40rpx;
color: #000000;
text-align: center;
}
.btn_primary {
color: #FC5B32;
}
.status {
width: 88rpx;
height: 88rpx;
position: relative;
left:50%;
transform: translateX(-50%);
.icon{
width:100%;
height:100%;
}
}
\ No newline at end of file \ No newline at end of file
<!--components/Dialog/dialog.wxml-->
<mp-dialog show="{{ show }}" class="auth-dialog-class" width="var(--fontSize552)" bindclose="onClose" mask="{{mask}}" bindbuttontap="handleClick" buttons="{{buttons}}" bindclose="onClose">
<view slot="title" wx:if="{{title}}">
<view class="title_text">{{title}}</view>
</view>
<view class="status" wx:if="{{statusIcon}}">
<glsx-image webp src="/status/{{statusIcon}}.png" class="icon"></glsx-image>
</view>
<slot></slot>
</mp-dialog>
// import WxValidate from '~/utils/WxValidate' // import WxValidate from '~/utils/WxValidate'
console.log( wx.p.WxValidate,'999') console.log(wx.p.WxValidate, '999')
const { const {
methods methods
} = new wx.p.WxValidate() } = new wx.p.WxValidate()
...@@ -10,6 +10,18 @@ Page({ ...@@ -10,6 +10,18 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
buttons: [{
text: '我知道了'
}, {
text: '去兑换',
extClass: 'btn_primary'
}],
repeatButtons: [{
text: '去修改'
}, {
text: '继续添加',
extClass: 'btn_primary'
}],
form: [{ form: [{
label: '姓名', label: '姓名',
key: 'bankUserName', key: 'bankUserName',
...@@ -48,14 +60,14 @@ Page({ ...@@ -48,14 +60,14 @@ Page({
{ {
label: '身份证人像面', label: '身份证人像面',
key: 'bankEmblem', key: 'bankEmblem',
icon:'emblem', icon: 'emblem',
upload:true, upload: true,
}, },
{ {
label: '身份证国徽面', label: '身份证国徽面',
key: 'bankPortrait', key: 'bankPortrait',
icon:'portrait', icon: 'portrait',
upload:true, upload: true,
} }
], ],
btnDisabled: true, btnDisabled: true,
...@@ -65,8 +77,8 @@ Page({ ...@@ -65,8 +77,8 @@ Page({
idCardNo: '', idCardNo: '',
bankName: '', bankName: '',
bankNumber: '', bankNumber: '',
bankPortrait:'', bankPortrait: '',
bankEmblem:'' bankEmblem: ''
} }
}, },
...@@ -76,7 +88,9 @@ Page({ ...@@ -76,7 +88,9 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
if (options && options.item) { if (options && options.item) {
const {item} = options const {
item
} = options
this.setData({ this.setData({
formData: { formData: {
bankUserName: item.bankUserName, bankUserName: item.bankUserName,
...@@ -94,6 +108,21 @@ Page({ ...@@ -94,6 +108,21 @@ Page({
} }
// this.getBankList() // this.getBankList()
}, },
repeatConfirm(e){
let {
index
} = e.detail
},
del(e) {
const {
item: {
key,
}
} = e.currentTarget.dataset;
this.setData({
[`formData.${key}`]: ''
})
},
async upload(e) { async upload(e) {
console.log(1111) console.log(1111)
const { const {
...@@ -101,7 +130,7 @@ Page({ ...@@ -101,7 +130,7 @@ Page({
key, key,
} }
} = e.currentTarget.dataset } = e.currentTarget.dataset
console.log(e) console.log(e)
const { const {
tempFiles tempFiles
} = await wx.chooseMedia({ } = await wx.chooseMedia({
...@@ -111,11 +140,11 @@ Page({ ...@@ -111,11 +140,11 @@ Page({
[file] = tempFiles, [file] = tempFiles,
_this = this _this = this
wx.p.wxApi.showLoading('上传中...') wx.p.wxApi.showLoading('上传中...')
console.log(tempFiles,'tempFiles') console.log(tempFiles, 'tempFiles')
let fileUrl=file.tempFilePath let fileUrl = file.tempFilePath
let imgType = fileUrl.split('.')[1] let imgType = fileUrl.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType let type = imgType == 'unknown' ? 'jpg' : imgType
try { try {
wx.getFileSystemManager().readFile({ wx.getFileSystemManager().readFile({
filePath: fileUrl, //选择图片返回的相对路径 filePath: fileUrl, //选择图片返回的相对路径
...@@ -129,7 +158,7 @@ Page({ ...@@ -129,7 +158,7 @@ Page({
console.log(img) console.log(img)
wx.p.wxApi.hideLoading() wx.p.wxApi.hideLoading()
_this.setData({ _this.setData({
[`formData.${key}`]:img [`formData.${key}`]: img
}) })
}) })
} }
...@@ -240,7 +269,7 @@ Page({ ...@@ -240,7 +269,7 @@ Page({
this.setData({ this.setData({
showModal: true, showModal: true,
success: true, success: true,
dialogText:'您的银行账户添加成功!' dialogText: '您的银行账户添加成功!'
}) })
} else { } else {
this.setData({ this.setData({
......
...@@ -132,8 +132,24 @@ page { ...@@ -132,8 +132,24 @@ page {
} }
.bank-img {
width: 256rpx; .select-url {
height: 192rpx; position: relative;
.bank-img {
width: 256rpx;
height: 192rpx;
z-index:1;
border-radius: 12rpx;
}
.del-icon {
width: 32rpx;
height: 32rpx;
position: absolute;
top:12rpx;
right:12rpx;
z-index:99;
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -24,14 +24,15 @@ ...@@ -24,14 +24,15 @@
<view class="upload-wrap" bind:tap="upload" data-item="{{item}}"> <view class="upload-wrap" bind:tap="upload" data-item="{{item}}">
<view class="label">{{item.label}}</view> <view class="label">{{item.label}}</view>
<block wx:if="{{ !formData[item.key]}}"> <block wx:if="{{ !formData[item.key]}}">
<view class="upload"> <view class="upload" bind:tap="upload" data-item="{{item}}">
<glsx-image src="/bankAccount/{{item.icon}}.png" class="bank-icon"></glsx-image> <glsx-image src="/bankAccount/{{item.icon}}.png" class="bank-icon"></glsx-image>
<view class="text">上传照片</view> <view class="text">上传照片</view>
</view> </view>
</block> </block>
<blcok wx:else> <view wx:else class="select-url" >
<image webp src="{{formData[item.key]}}" class="bank-img"></image> <image webp src="{{formData[item.key]}}" class="bank-img"></image>
</blcok> <glsx-image src="/bankAccount/del.png" class="del-icon" bind:tap="del" data-item="{{item}}"></glsx-image>
</view>
</view> </view>
</block> </block>
...@@ -52,6 +53,15 @@ ...@@ -52,6 +53,15 @@
<!-- disabled="{{btnDisabled}}" --> <!-- disabled="{{btnDisabled}}" -->
<button class="button text-center" hover-class="btn-hover" loading="{{submitLoading}}" bindtap="submit">提交</button> <button class="button text-center" hover-class="btn-hover" loading="{{submitLoading}}" bindtap="submit">提交</button>
</block> </block>
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="dialogConfirm" buttons="{{buttons}}" statusIcon="success">
<view class="suggest-box">
您的银行账户修改成功!
</view>
</Dialog>
<Dialog show="{{ showModal }}" mask="true" bindbuttontap="repeatConfirm" buttons="{{repeatButtons}}" title="提示">
<view class="suggest-box">
建议您不要添加同一个人的多张卡片,避免提现时个人税务汇算累积
</view>
</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
...@@ -7,7 +7,8 @@ Page({ ...@@ -7,7 +7,8 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
open:true, open:false,
showAccountModal:true,
listData: [{ listData: [{
id: 2104467, id: 2104467,
infoName: "积分兑换", infoName: "积分兑换",
...@@ -29,6 +30,11 @@ Page({ ...@@ -29,6 +30,11 @@ Page({
onLoad(options) { onLoad(options) {
}, },
hidePopup() {
this.setData({
showAccountModal: false
})
},
navbarReady(e) { navbarReady(e) {
let { let {
height height
...@@ -37,6 +43,21 @@ Page({ ...@@ -37,6 +43,21 @@ Page({
navHeight: height navHeight: height
}) })
}, },
/**跳转至银行卡 */
toAddBankAccount(e) {
const {
score,
user
} = wx.p.router.router.getPageInstance()
this.setData({
showAccountModal: false
}, () => {
wx.p.router.router.go('/packageStoreAssistant/packageMine/pages/bankAccount/detail/detail', {
score,
user
})
})
},
back() { back() {
wx.p.router.back() wx.p.router.back()
}, },
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
border: 2rpx solid #FFFFFF; border: 2rpx solid #FFFFFF;
border-radius: 24rpx; border-radius: 24rpx;
padding: 32rpx 28rpx; padding: 32rpx 28rpx;
margin: 20rpx ; margin: 20rpx;
box-sizing: border-box; box-sizing: border-box;
.title_wrap { .title_wrap {
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
.right-icon { .right-icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
margin-left:4rpx; margin-left: 4rpx;
} }
.tip { .tip {
...@@ -94,9 +94,93 @@ ...@@ -94,9 +94,93 @@
} }
.bgF{
.bgF {
background-color: #fff; background-color: #fff;
} }
.bgt{
margin: 114rpx 20rpx 0!important; .bgt {
margin: 114rpx 20rpx 0 !important;
}
.popclass {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
.popup-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .6);
}
.popup-content{
position: absolute;
height: 560rpx;
left: 0;
width: 100%;
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
animation: show-popup .2s forwards;
box-sizing: border-box;
.modal_title {
font-weight: 500;
font-size: 40rpx;
color: #333333;
box-sizing: border-box;
padding-top: 48rpx;
padding-left: 49rpx;
}
.modal_tip {
font-weight: 400;
font-size: 32rpx;
color: #333333;
margin-top: 64rpx;
padding-left: 49rpx;
}
}
.modal_error {
font-size: 32rpx;
color: #FE5662;
margin-top: 12rpx;
padding-left: 49rpx;
}
.btns {
display: flex;
padding: 0 48rpx;
gap: 0 20rpx;
}
.modal_btn {
margin: 0;
width: calc(100% - 98rpx);
height: 88rpx;
margin: 0 auto;
margin-top: 120rpx;
background: #FB8A32;
border-radius: 20rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
&::after {
display: none;
}
}
.default {
background: #fff;
color: #333;
border: 2rpx solid #e1e1e1;
}
} }
\ No newline at end of file \ No newline at end of file
<!--packageIndex/pages/integral/index/index.wxml--> <!--packageIndex/pages/integral/index/index.wxml-->
<!--积分中心 --> <!--积分中心 -->
<view class="integral-container {{!open?'bgF':''}}"> <view class="integral-container {{!open?'bgF':''}}">
<!-- <have-no-ope> <have-no-ope>
<view class="list_widget"> <view class="list_widget">
<view class="title_wrap"> <view class="title_wrap">
收益明细 收益明细
</view> </view>
<view class="list_data_widget"> <view class="list_data_widget">
<block wx:for="{{listData}}" wx:key="index"> <block wx:for="{{listData}}" wx:key="index">
<view class="element" bind:tap="handleDetail" data-id="{{item.id}}"> <view class="element" bind:tap="handleDetail" data-id="{{item.id}}">
<view class="title">{{item.infoName}} <view class="right-icon-box"> <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>
</view> </view>
<view class="date">{{item.updatedTime}}</view> </block>
<view class="price {{item.type==0?'':'blackColor'}}"> <view wx:if="{{listData.length}}" class="no_more_tip">没有更多啦</view>
<text wx:if="{{item.infoName==='积分商品售后'}}" class="tip">退还</text> <view wx:else class="no_more_tip">暂无收益明细</view>
<text class="mini">{{item.type==0?'+':'-'}}</text> </view>
<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>
</view> --> </have-no-ope>
<!-- </have-no-ope> --> <!-- <have-open>
<have-open>
<view class="list_widget"> <view class="list_widget">
<view class="title_wrap"> <view class="title_wrap">
收益明细 收益明细
...@@ -50,6 +50,15 @@ ...@@ -50,6 +50,15 @@
<view wx:else class="no_more_tip">暂无收益明细</view> <view wx:else class="no_more_tip">暂无收益明细</view>
</view> </view>
</view> </view>
</have-open> </have-open> -->
</view>
<view wx:if="{{showAccountModal}}" class="popclass" data-name="showAccountModal">
<view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content">
<view class="modal_title">提示</view>
<view class="modal_tip">首次兑换需要您添加个人真实的银行账户!</view>
<button class="modal_btn" catchtap="toAddBankAccount">去添加</button>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -8,6 +8,7 @@ Page({ ...@@ -8,6 +8,7 @@ Page({
navStyle: "background-color: transparent;", navStyle: "background-color: transparent;",
agree: false, agree: false,
showAuthDialog: false, showAuthDialog: false,
showConfirmDialog: false,
sumbitScore: '', sumbitScore: '',
buttons: [{ buttons: [{
text: '取消' text: '取消'
...@@ -15,6 +16,12 @@ Page({ ...@@ -15,6 +16,12 @@ Page({
text: '同意', text: '同意',
extClass: 'btn_primary' extClass: 'btn_primary'
}], }],
confirmButtons: [{
text: '取消'
}, {
text: '确认',
extClass: 'btn_primary'
}],
bankInfo: { bankInfo: {
"id": 34, "id": 34,
"staffId": 16550, "staffId": 16550,
...@@ -76,7 +83,7 @@ Page({ ...@@ -76,7 +83,7 @@ Page({
if (this.submit) return if (this.submit) return
const checkAgree = this.checkAgree() const checkAgree = this.checkAgree()
if (checkAgree) return false if (checkAgree) return false
// wx.$api.showToast('有一笔兑换正在进行') // wx.p.wxApi.showToast('有一笔兑换正在进行')
let { let {
sumbitScore, sumbitScore,
score: { score: {
...@@ -86,8 +93,11 @@ Page({ ...@@ -86,8 +93,11 @@ Page({
let withDrawType = 3 let withDrawType = 3
const money = this.accSub(Number(sumbitScore), 0) const money = this.accSub(Number(sumbitScore), 0)
if (money <= 0) return wx.$api.showToast(`您的积分不足,请确认后重新申请兑换`) if (money <= 0) return wx.p.wxApi.showToast(`您的积分不足,请确认后重新申请兑换`)
this.comfirmSumbit(sumbitScore, withDrawType) // this.comfirmSumbit(sumbitScore, withDrawType)
this.setData({
showConfirmDialog: true
})
}, },
// 提现确认模块 // 提现确认模块
comfirmSumbit(sumbitScore, withDrawType, rateQuery = {}, sourceFrom) { comfirmSumbit(sumbitScore, withDrawType, rateQuery = {}, sourceFrom) {
...@@ -101,7 +111,7 @@ Page({ ...@@ -101,7 +111,7 @@ Page({
}).then(() => { }).then(() => {
if (this.submit) return if (this.submit) return
this.submit = true this.submit = true
wx.$api.showLoading('提交中') wx.p.api.showLoading('提交中')
MineApi.WithdrawalApi({ MineApi.WithdrawalApi({
withdrawalScore: sumbitScore, withdrawalScore: sumbitScore,
withDrawType, withDrawType,
...@@ -112,16 +122,16 @@ Page({ ...@@ -112,16 +122,16 @@ Page({
}).then(res => { }).then(res => {
wx.hideLoading(); wx.hideLoading();
if (res.code == 0) { if (res.code == 0) {
wx.$eventbus.emit('REFRESH_WITHDRALWAL') wx.p.eventbus.off('REFRESH_WITHDRALWAL')
wx.$router.redirectTo('/packageStoreAssistant/packageMine/pages/withdrawalSuccess/withdrawalSuccess', { wx.p.router.redirectTo('/packageStoreAssistant/packageMine/pages/withdrawalSuccess/withdrawalSuccess', {
title: tabData[tabIndex] title: tabData[tabIndex]
}) })
} else { } else {
wx.$api.showToast(res.message) wx.p.wxApi.showToast(res.message)
this.submit = false this.submit = false
} }
}).catch((err) => { }).catch((err) => {
wx.$api.showToast(JSON.stringify(err)) wx.p.wxApi.showToast(JSON.stringify(err))
this.submit = false this.submit = false
}) })
}).catch(() => { }).catch(() => {
...@@ -222,6 +232,7 @@ Page({ ...@@ -222,6 +232,7 @@ Page({
return false return false
}, },
agreeEvent(e) { agreeEvent(e) {
console.log(e)
let { let {
index index
} = e.detail } = e.detail
......
...@@ -162,25 +162,7 @@ ...@@ -162,25 +162,7 @@
} }
} }
.auth-dialog-class {
text-align: center;
font-size: var(--fontSize28);
font-weight: 400;
}
.auth-dialog-class .van-dialog__header {
font-size: var(--fontSize36);
font-weight: 500;
color: #333333;
}
.title_text {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 40rpx;
color: #000000;
text-align: center;
}
.message-box text { .message-box text {
color: #5092FF; color: #5092FF;
...@@ -197,6 +179,7 @@ ...@@ -197,6 +179,7 @@
padding: 8px 0; padding: 8px 0;
} }
.btn_primary{ .suggest-box {
color: #FC5B32; font-size: 28rpx;
} color: #1B233D;
}
\ No newline at end of file \ No newline at end of file
...@@ -45,12 +45,15 @@ ...@@ -45,12 +45,15 @@
</view> </view>
<!-- 未同意协议弹窗提示 --> <!-- 未同意协议弹窗提示 -->
<mp-dialog show="{{ showAuthDialog }}" class="auth-dialog-class" width="var(--fontSize552)" bindclose="onClose" mask="true" bindbuttontap="agreeEvent" buttons="{{buttons}}"> <Dialog show="{{ showAuthDialog }}" mask="true" bindbuttontap="agreeEvent" buttons="{{buttons}}" title="免责协议">
<view slot="title">
<view class="title_text">隐私协议与用户协议</view>
</view>
<view class="message-box"> <view class="message-box">
<view class="message">为保障你的合法权益,请阅读并同意</view> <view class="message">为保障你的合法权益,请阅读并同意</view>
<text catchtap="jump" data-url="privacy">《免责协议》</text> <text catchtap="jump" data-url="privacy">《免责协议》</text>
</view> </view>
</mp-dialog>
\ No newline at end of file \ No newline at end of file
</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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!