Commit b2f0a66f by 杨北旺

提交个人中心模块

1 parent 103a2d85
...@@ -43,7 +43,8 @@ Page({ ...@@ -43,7 +43,8 @@ Page({
let para = { let para = {
id: user.bussinessId, id: user.bussinessId,
platformEntrance: 'STORE_ASSISTANT', platformEntrance: 'STORE_ASSISTANT',
department: value.id department: value.id,
merchantNo:user.merchantId
} }
MineApi.updateStaffDetailApi(para).then(res => { MineApi.updateStaffDetailApi(para).then(res => {
this.setData({ this.setData({
......
...@@ -16,7 +16,8 @@ Page({ ...@@ -16,7 +16,8 @@ Page({
let para = { let para = {
id: user.bussinessId, id: user.bussinessId,
platformEntrance: 'STORE_ASSISTANT', platformEntrance: 'STORE_ASSISTANT',
staffName: nickName staffName: nickName,
merchantNo:user.merchantId
} }
MineApi.updateStaffDetailApi(para).then(res => { MineApi.updateStaffDetailApi(para).then(res => {
wx.$eventbus.emit('SETTING') wx.$eventbus.emit('SETTING')
......
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import MineApi from '~/api/mineApi/index' import MineApi from '~/api/mineApi/index'
import Dialog from '@vant/weapp/dialog/dialog';
Page({ Page({
data: { data: {
IMGURL: IMG_URL, IMGURL: IMG_URL,
...@@ -7,17 +8,26 @@ Page({ ...@@ -7,17 +8,26 @@ Page({
sumbitScore: '' sumbitScore: ''
}, },
toSumbitData() { toSumbitData() {
let {sumbitScore} = this.data let { sumbitScore } = this.data
if(!sumbitScore)return wx.$api.showToast('请输入提现积分') if (!sumbitScore) return wx.$api.showToast('请输入有效的积分值')
if(sumbitScore==0)return wx.$api.showToast('提现积分不能为0') if (sumbitScore == 0) return wx.$api.showToast('请输入有效的积分值')
MineApi.WithdrawalApi({withdrawalScore:sumbitScore}).then(res=>{ Dialog.confirm({
if(res.code==0){ title: '提示',
message: `请确认是否将${sumbitScore}积分进行提现`,
}).then(() => {
wx.$api.showLoading('提交中')
MineApi.WithdrawalApi({ withdrawalScore: sumbitScore }).then(res => {
wx.hideLoading();
if (res.code == 0) {
wx.$eventbus.emit('REFRESH_WITHDRALWAL') wx.$eventbus.emit('REFRESH_WITHDRALWAL')
wx.$router.go('packageMine.withdrawalSuccess.index') wx.$router.go('packageMine.withdrawalSuccess.index')
}else{ } else {
wx.$api.showToast(res.message) wx.$api.showToast(res.message)
} }
}) })
}).catch(()=>{
});
}, },
onRoute(options) { onRoute(options) {
this.setData({ this.setData({
...@@ -34,9 +44,9 @@ Page({ ...@@ -34,9 +44,9 @@ Page({
}) })
}, },
// 失焦校验 // 失焦校验
checkNum(e){ checkNum(e) {
let { value } = e.detail let { value } = e.detail
if(value[value.length-1]=="."){ if (value[value.length - 1] == ".") {
this.setData({ this.setData({
sumbitScore: '' sumbitScore: ''
}) })
...@@ -48,7 +58,7 @@ Page({ ...@@ -48,7 +58,7 @@ Page({
sumbitScore: withdrawalScore sumbitScore: withdrawalScore
}) })
}, },
// 价格输入校验规则 // 价格输入校验规则(提现积分值:最小值需大于0)
priceVerify(price, max, min = 0) { priceVerify(price, max, min = 0) {
let result = 0 let result = 0
// 1.限制小数点为2位 // 1.限制小数点为2位
...@@ -58,6 +68,7 @@ Page({ ...@@ -58,6 +68,7 @@ Page({
if (price.indexOf('.') == 0) { if (price.indexOf('.') == 0) {
price = '' price = ''
} }
// 3.如果第一位是0,那第二位开始禁止为数值,只可以为小数点 // 3.如果第一位是0,那第二位开始禁止为数值,只可以为小数点
if (price.indexOf('0') == 0 && price.length > 1) { if (price.indexOf('0') == 0 && price.length > 1) {
if (price.indexOf('.') != 1) { if (price.indexOf('.') != 1) {
...@@ -67,6 +78,9 @@ Page({ ...@@ -67,6 +78,9 @@ Page({
price = '0.' price = '0.'
} }
} }
// if (price.indexOf('.') != -1) {
// price = price.slice(0, price.indexOf('.'))
// }
result = price result = price
// 4.判断最大值和最小值 // 4.判断最大值和最小值
if (price) { if (price) {
......
{ {
"usingComponents": {}, "usingComponents": {
"van-dialog": "@vant/weapp/dialog/index"
},
"navigationBarTitleText":"积分提现" "navigationBarTitleText":"积分提现"
} }
\ No newline at end of file \ No newline at end of file
...@@ -11,17 +11,19 @@ ...@@ -11,17 +11,19 @@
<view class="tip_wrapper flex_scb"> <view class="tip_wrapper flex_scb">
<view class="label">提现人</view> <view class="label">提现人</view>
<view class="tip flex_sc"> <view class="tip flex_sc">
<image mode="aspectFill" class="icon" src="{{user.headImgUrl}}" /> <image wx:if="{{user.headImgUrl}}" mode="aspectFill" class="icon" src="{{user.headImgUrl}}" />
<image wx:else mode="aspectFill" class="icon" src="{{IMGURL}}default_avatar.png" />
<text>{{strSubstr.getString(user.nickName)}}</text> <text>{{strSubstr.getString(user.nickName)}}</text>
</view> </view>
</view> </view>
<view class="input_wrapper"> <view class="input_wrapper">
<view class="title">输入提现的积分值</view> <view class="title">输入提现的积分值</view>
<view class="int_widget flex_scb"> <view class="int_widget flex_scb">
<input type="digit" bindblur="checkNum" value="{{sumbitScore}}" focus="{{true}}" bindinput="toFillCount" class="intClass" maxlength="20" placeholder="请输入" placeholder-class="input-placeholder"/> <input type="digit" bindblur="checkNum" value="{{sumbitScore}}" focus="{{true}}" bindinput="toFillCount" class="intClass" maxlength="20" placeholder="请输入整数" placeholder-class="input-placeholder"/>
<view class="btn flex_cc" bind:tap="toTixianAll">全部提现</view> <view class="btn flex_cc" bind:tap="toTixianAll">全部提现</view>
</view> </view>
</view> </view>
<view class="tip_msg">当前可提现积分:{{withdrawalScore}}</view> <view class="tip_msg">当前可提现积分:{{withdrawalScore}}</view>
<view class="sumbit_btn flex_cc" bind:tap="toSumbitData">提交</view> <view class="sumbit_btn flex_cc" bind:tap="toSumbitData">提交</view>
</view> </view>
<van-dialog id="van-dialog" />
\ No newline at end of file \ No newline at end of file
...@@ -15,7 +15,10 @@ Page({ ...@@ -15,7 +15,10 @@ Page({
res.map(item=>{ res.map(item=>{
if(item.status==3){ if(item.status==3){
item.iconType = 1 item.iconType = 1
}else{ }else if(item.status==4){
item.iconType = 2
}
else{
item.iconType = 0 item.iconType = 0
} }
return item return item
......
...@@ -22,7 +22,6 @@ Component({ ...@@ -22,7 +22,6 @@ Component({
methods: { methods: {
getWithdrawalData() { getWithdrawalData() {
MineApi.getScoreDetailApi().then(res => { MineApi.getScoreDetailApi().then(res => {
wx.hideLoading();
let data = { let data = {
score: { score: {
currentScore: res.currentScore, currentScore: res.currentScore,
...@@ -43,7 +42,6 @@ Component({ ...@@ -43,7 +42,6 @@ Component({
attached() { attached() {
this.getWithdrawalData() this.getWithdrawalData()
wx.$eventbus.on('REFRESH_WITHDRALWAL',()=>{ wx.$eventbus.on('REFRESH_WITHDRALWAL',()=>{
wx.$api.showLoading()
this.getWithdrawalData() this.getWithdrawalData()
}) })
} }
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<view class="box flex_cc left_box"> <view class="box flex_cc left_box">
<image class="icon" src="{{IMGURL}}num_icon_1.png" /> <image class="icon" src="{{IMGURL}}num_icon_1.png" />
<view class="text_wrap"> <view class="text_wrap">
<view class="price">{{score.totalReWardScore}}</view> <view class="price">{{score.totalReWardScore || 0}}</view>
<view class="tip">累计收益积分</view> <view class="tip">累计收益积分</view>
</view> </view>
</view> </view>
<view class="box flex_cc right_box"> <view class="box flex_cc right_box">
<image class="icon" src="{{IMGURL}}num_icon_2.png" /> <image class="icon" src="{{IMGURL}}num_icon_2.png" />
<view class="text_wrap"> <view class="text_wrap">
<view class="price">{{score.totalWithdrawalScore}}</view> <view class="price">{{score.totalWithdrawalScore || 0}}</view>
<view class="tip">累计提现积分</view> <view class="tip">累计提现积分</view>
</view> </view>
</view> </view>
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
</view> </view>
</view> </view>
</block> </block>
<view class="no_more_tip">没有更多啦</view> <view wx:if="{{listData.length}}" class="no_more_tip">没有更多啦</view>
<view wx:else class="no_more_tip">暂无收益明细</view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -25,6 +25,10 @@ Component({ ...@@ -25,6 +25,10 @@ Component({
url: '/pages/authentication/login/login', url: '/pages/authentication/login/login',
}); });
}) })
},
toShowBind(){
if(this.data.user&&this.data.user.bindStatus) return
this.triggerEvent('showModal',true)
} }
}, },
lifetimes: { lifetimes: {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</view> </view>
<view class="contact_widget flex_sc"> <view class="contact_widget flex_sc">
<view class="text">{{user.phone}}</view> <view class="text">{{user.phone}}</view>
<view class="wecat_wrap flex_cc"> <view bind:tap="toShowBind" class="wecat_wrap flex_cc">
<block wx:if="{{user.bindStatus}}"> <block wx:if="{{user.bindStatus}}">
<image class="icon" src="{{IMGURL}}wechat_active_icon.png" /> <image class="icon" src="{{IMGURL}}wechat_active_icon.png" />
<text>{{strSubstr.getString(user.brandName)}}</text> <text>{{strSubstr.getString(user.brandName)}}</text>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<image mode="widthFix" src="{{IMGURL}}mine_center_bg.png" /> <image mode="widthFix" src="{{IMGURL}}mine_center_bg.png" />
</view> </view>
<!-- 个人基础信息 --> <!-- 个人基础信息 -->
<user-info-widget user="{{user}}" boxStyle="{{user_box_style}}"></user-info-widget> <user-info-widget bind:showModal="toShowBindModal" user="{{user}}" boxStyle="{{user_box_style}}"></user-info-widget>
<!-- 积分信息 --> <!-- 积分信息 -->
<count-info-widget bind:showModal="toShowBindModal" user="{{user}}" boxStyle="{{count_box_style}}"></count-info-widget> <count-info-widget bind:showModal="toShowBindModal" user="{{user}}" boxStyle="{{count_box_style}}"></count-info-widget>
<!-- 收益明细信息 --> <!-- 收益明细信息 -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!