Commit 49de1026 by wangzhihui

积分

1 parent 3f8c3296
......@@ -101,7 +101,8 @@
"mp-icon": "weui-miniprogram/icon/icon",
"mp-dialog": "weui-miniprogram/dialog/dialog",
"mp-cell": "weui-miniprogram/cell/cell",
"mp-cells": "weui-miniprogram/cells/cells"
"mp-cells": "weui-miniprogram/cells/cells",
"Dialog":"/components/Dialog/Dialog"
},
"style": "v2",
"resolveAlias": {
......
......@@ -35,4 +35,8 @@ image {
display: flex;
align-items: center;
justify-content: space-between;
}
.suggest-box{
font-size: 28rpx;
color: #1B233D;
}
\ 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
{
"component": true,
"usingComponents": {}
}
\ 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
<!--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'
console.log( wx.p.WxValidate,'999')
console.log(wx.p.WxValidate, '999')
const {
methods
} = new wx.p.WxValidate()
......@@ -10,6 +10,18 @@ Page({
* 页面的初始数据
*/
data: {
buttons: [{
text: '我知道了'
}, {
text: '去兑换',
extClass: 'btn_primary'
}],
repeatButtons: [{
text: '去修改'
}, {
text: '继续添加',
extClass: 'btn_primary'
}],
form: [{
label: '姓名',
key: 'bankUserName',
......@@ -48,14 +60,14 @@ Page({
{
label: '身份证人像面',
key: 'bankEmblem',
icon:'emblem',
upload:true,
icon: 'emblem',
upload: true,
},
{
label: '身份证国徽面',
key: 'bankPortrait',
icon:'portrait',
upload:true,
icon: 'portrait',
upload: true,
}
],
btnDisabled: true,
......@@ -65,8 +77,8 @@ Page({
idCardNo: '',
bankName: '',
bankNumber: '',
bankPortrait:'',
bankEmblem:''
bankPortrait: '',
bankEmblem: ''
}
},
......@@ -76,7 +88,9 @@ Page({
*/
onLoad(options) {
if (options && options.item) {
const {item} = options
const {
item
} = options
this.setData({
formData: {
bankUserName: item.bankUserName,
......@@ -94,6 +108,21 @@ Page({
}
// this.getBankList()
},
repeatConfirm(e){
let {
index
} = e.detail
},
del(e) {
const {
item: {
key,
}
} = e.currentTarget.dataset;
this.setData({
[`formData.${key}`]: ''
})
},
async upload(e) {
console.log(1111)
const {
......@@ -101,7 +130,7 @@ Page({
key,
}
} = e.currentTarget.dataset
console.log(e)
console.log(e)
const {
tempFiles
} = await wx.chooseMedia({
......@@ -111,11 +140,11 @@ Page({
[file] = tempFiles,
_this = this
wx.p.wxApi.showLoading('上传中...')
console.log(tempFiles,'tempFiles')
let fileUrl=file.tempFilePath
let imgType = fileUrl.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.p.wxApi.showLoading('上传中...')
console.log(tempFiles, 'tempFiles')
let fileUrl = file.tempFilePath
let imgType = fileUrl.split('.')[1]
let type = imgType == 'unknown' ? 'jpg' : imgType
try {
wx.getFileSystemManager().readFile({
filePath: fileUrl, //选择图片返回的相对路径
......@@ -129,7 +158,7 @@ Page({
console.log(img)
wx.p.wxApi.hideLoading()
_this.setData({
[`formData.${key}`]:img
[`formData.${key}`]: img
})
})
}
......@@ -240,7 +269,7 @@ Page({
this.setData({
showModal: true,
success: true,
dialogText:'您的银行账户添加成功!'
dialogText: '您的银行账户添加成功!'
})
} else {
this.setData({
......
......@@ -132,8 +132,24 @@ page {
}
.bank-img {
width: 256rpx;
height: 192rpx;
.select-url {
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
......@@ -24,14 +24,15 @@
<view class="upload-wrap" bind:tap="upload" data-item="{{item}}">
<view class="label">{{item.label}}</view>
<block wx:if="{{ !formData[item.key]}}">
<view class="upload">
<view class="upload" bind:tap="upload" data-item="{{item}}">
<glsx-image src="/bankAccount/{{item.icon}}.png" class="bank-icon"></glsx-image>
<view class="text">上传照片</view>
</view>
</block>
<blcok wx:else>
<view wx:else class="select-url" >
<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>
</block>
......@@ -52,6 +53,15 @@
<!-- disabled="{{btnDisabled}}" -->
<button class="button text-center" hover-class="btn-hover" loading="{{submitLoading}}" bindtap="submit">提交</button>
</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> -->
\ No newline at end of file
......@@ -7,7 +7,8 @@ Page({
* 页面的初始数据
*/
data: {
open:true,
open:false,
showAccountModal:true,
listData: [{
id: 2104467,
infoName: "积分兑换",
......@@ -29,6 +30,11 @@ Page({
onLoad(options) {
},
hidePopup() {
this.setData({
showAccountModal: false
})
},
navbarReady(e) {
let {
height
......@@ -37,6 +43,21 @@ Page({
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() {
wx.p.router.back()
},
......
......@@ -11,7 +11,7 @@
border: 2rpx solid #FFFFFF;
border-radius: 24rpx;
padding: 32rpx 28rpx;
margin: 20rpx ;
margin: 20rpx;
box-sizing: border-box;
.title_wrap {
......@@ -70,7 +70,7 @@
.right-icon {
width: 32rpx;
height: 32rpx;
margin-left:4rpx;
margin-left: 4rpx;
}
.tip {
......@@ -94,9 +94,93 @@
}
.bgF{
.bgF {
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
<!--packageIndex/pages/integral/index/index.wxml-->
<!--积分中心 -->
<view class="integral-container {{!open?'bgF':''}}">
<!-- <have-no-ope>
<have-no-ope>
<view class="list_widget">
<view class="title_wrap">
收益明细
</view>
<view class="list_data_widget">
<block wx:for="{{listData}}" wx:key="index">
<view class="element" bind:tap="handleDetail" data-id="{{item.id}}">
<view class="title">{{item.infoName}} <view class="right-icon-box">
<view class="title_wrap">
收益明细
</view>
<view class="list_data_widget">
<block wx:for="{{listData}}" wx:key="index">
<view class="element" bind:tap="handleDetail" data-id="{{item.id}}">
<view class="title">{{item.infoName}} <view class="right-icon-box">
</view>
</view>
<view class="date">{{item.updatedTime}}</view>
<view class="price {{item.type==0?'':'blackColor'}}">
<text wx:if="{{item.infoName==='积分商品售后'}}" class="tip">退还</text>
<text class="mini">{{item.type==0?'+':'-'}}</text>
<text>{{item.rewardScore}}</text>
<glsx-image mode="widthFix" class="right-arrow" src="/integral/arrow.png" />
</view>
</view>
<view class="date">{{item.updatedTime}}</view>
<view class="price {{item.type==0?'':'blackColor'}}">
<text wx:if="{{item.infoName==='积分商品售后'}}" class="tip">退还</text>
<text class="mini">{{item.type==0?'+':'-'}}</text>
<text>{{item.rewardScore}}</text>
<glsx-image mode="widthFix" class="right-arrow" src="/integral/arrow.png" />
</view>
</view>
</block>
<view wx:if="{{listData.length}}" class="no_more_tip">没有更多啦</view>
<view wx:else class="no_more_tip">暂无收益明细</view>
</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-open>
</have-no-ope>
<!-- <have-open>
<view class="list_widget">
<view class="title_wrap">
收益明细
......@@ -50,6 +50,15 @@
<view wx:else class="no_more_tip">暂无收益明细</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>
\ No newline at end of file
......@@ -8,6 +8,7 @@ Page({
navStyle: "background-color: transparent;",
agree: false,
showAuthDialog: false,
showConfirmDialog: false,
sumbitScore: '',
buttons: [{
text: '取消'
......@@ -15,6 +16,12 @@ Page({
text: '同意',
extClass: 'btn_primary'
}],
confirmButtons: [{
text: '取消'
}, {
text: '确认',
extClass: 'btn_primary'
}],
bankInfo: {
"id": 34,
"staffId": 16550,
......@@ -76,7 +83,7 @@ Page({
if (this.submit) return
const checkAgree = this.checkAgree()
if (checkAgree) return false
// wx.$api.showToast('有一笔兑换正在进行')
// wx.p.wxApi.showToast('有一笔兑换正在进行')
let {
sumbitScore,
score: {
......@@ -86,8 +93,11 @@ Page({
let withDrawType = 3
const money = this.accSub(Number(sumbitScore), 0)
if (money <= 0) return wx.$api.showToast(`您的积分不足,请确认后重新申请兑换`)
this.comfirmSumbit(sumbitScore, withDrawType)
if (money <= 0) return wx.p.wxApi.showToast(`您的积分不足,请确认后重新申请兑换`)
// this.comfirmSumbit(sumbitScore, withDrawType)
this.setData({
showConfirmDialog: true
})
},
// 提现确认模块
comfirmSumbit(sumbitScore, withDrawType, rateQuery = {}, sourceFrom) {
......@@ -101,7 +111,7 @@ Page({
}).then(() => {
if (this.submit) return
this.submit = true
wx.$api.showLoading('提交中')
wx.p.api.showLoading('提交中')
MineApi.WithdrawalApi({
withdrawalScore: sumbitScore,
withDrawType,
......@@ -112,16 +122,16 @@ Page({
}).then(res => {
wx.hideLoading();
if (res.code == 0) {
wx.$eventbus.emit('REFRESH_WITHDRALWAL')
wx.$router.redirectTo('/packageStoreAssistant/packageMine/pages/withdrawalSuccess/withdrawalSuccess', {
wx.p.eventbus.off('REFRESH_WITHDRALWAL')
wx.p.router.redirectTo('/packageStoreAssistant/packageMine/pages/withdrawalSuccess/withdrawalSuccess', {
title: tabData[tabIndex]
})
} else {
wx.$api.showToast(res.message)
wx.p.wxApi.showToast(res.message)
this.submit = false
}
}).catch((err) => {
wx.$api.showToast(JSON.stringify(err))
wx.p.wxApi.showToast(JSON.stringify(err))
this.submit = false
})
}).catch(() => {
......@@ -222,6 +232,7 @@ Page({
return false
},
agreeEvent(e) {
console.log(e)
let {
index
} = e.detail
......
......@@ -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 {
color: #5092FF;
......@@ -197,6 +179,7 @@
padding: 8px 0;
}
.btn_primary{
color: #FC5B32;
}
.suggest-box {
font-size: 28rpx;
color: #1B233D;
}
\ No newline at end of file
......@@ -45,12 +45,15 @@
</view>
<!-- 未同意协议弹窗提示 -->
<mp-dialog show="{{ showAuthDialog }}" class="auth-dialog-class" width="var(--fontSize552)" bindclose="onClose" mask="true" bindbuttontap="agreeEvent" buttons="{{buttons}}">
<view slot="title">
<view class="title_text">隐私协议与用户协议</view>
</view>
<Dialog show="{{ showAuthDialog }}" mask="true" bindbuttontap="agreeEvent" buttons="{{buttons}}" title="免责协议">
<view class="message-box">
<view class="message">为保障你的合法权益,请阅读并同意</view>
<text catchtap="jump" data-url="privacy">《免责协议》</text>
</view>
</mp-dialog>
\ 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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!