Commit 0e07ceaa by 前端

Merge branch 'v3.0' into 'zhangxw_dev_3.0'

提交个人中心模块

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