forked from angelo/web-retail-h5
Compare commits
No commits in common. "0fa1d67333da556fc08539e60a6c5af7a7a4cac1" and "a0c6fc5418258671e68255a65f9b0dbef949f2f4" have entirely different histories.
0fa1d67333
...
a0c6fc5418
14
pages.json
14
pages.json
|
|
@ -123,6 +123,13 @@
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/bonus/menu",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "奖金查询",
|
||||||
|
"navigationBarBackgroundColor": "#fff"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/bonus/index",
|
"path": "pages/bonus/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
@ -131,6 +138,13 @@
|
||||||
"enablePullDownRefresh": true
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/bonus/real-time",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "实时奖金",
|
||||||
|
"navigationBarBackgroundColor": "#fff"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/bonusSource/index",
|
"path": "pages/bonusSource/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,6 @@ export default {
|
||||||
BONUS_FIELD_MAP: {
|
BONUS_FIELD_MAP: {
|
||||||
repurRangeIncome: '复购级差收益',
|
repurRangeIncome: '复购级差收益',
|
||||||
retailRangeIncome: '直推级差收益',
|
retailRangeIncome: '直推级差收益',
|
||||||
retailAreaIncome: '复购配送收益',
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<view
|
||||||
|
@click="goRouter(item.path)"
|
||||||
|
class="kuaibox"
|
||||||
|
v-for="(item, index) in selfServiceList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<view class="">
|
||||||
|
{{ item.name }}
|
||||||
|
</view>
|
||||||
|
<image class="kuaiimg" :src="item.url" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as sel from '@/config/selfService.js'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['user']),
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selfServiceList: [
|
||||||
|
{
|
||||||
|
name: '实时奖金',
|
||||||
|
url: '../../static/images/bonus-record.svg',
|
||||||
|
path: '/pages/bonus/real-time',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '奖金明细',
|
||||||
|
url: '../../static/images/mark2.png',
|
||||||
|
path: '/pages/bonus/index',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
userInfo: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.userInfo = uni.getStorageSync('User')
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goRouter(path) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: path,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
padding: 4rpx 21rpx 500rpx 21rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.kuaibox {
|
||||||
|
width: 40%;
|
||||||
|
// height: 150rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 60rpx 40rpx 60rpx 22rpx;
|
||||||
|
margin: 13rpx 0rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-family: Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #666666;
|
||||||
|
|
||||||
|
.kuaiimg {
|
||||||
|
width: 52rpx;
|
||||||
|
height: 53rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,212 @@
|
||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<!-- 总览卡片 -->
|
||||||
|
<view class="summary-card">
|
||||||
|
<view class="summary-title-container">
|
||||||
|
<view class="summary-icon"></view>
|
||||||
|
<text class="summary-title">今日实发合计</text>
|
||||||
|
</view>
|
||||||
|
<view class="summary-amount">
|
||||||
|
<text class="currency-symbol">¥</text>
|
||||||
|
<text>{{ bonusData.realIncomeTotal || '0.00' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 奖金明细列表 -->
|
||||||
|
<view class="details-card">
|
||||||
|
<view class="detail-item">
|
||||||
|
<text class="detail-label">奖金日期</text>
|
||||||
|
<text class="detail-value date">{{
|
||||||
|
bonusData.settleDate || formatDate
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view v-for="(label, key) in detailLabels" :key="key" class="detail-item">
|
||||||
|
<text class="detail-label">{{ label }}</text>
|
||||||
|
<text class="detail-value">
|
||||||
|
<text class="currency-symbol-small">¥</text>
|
||||||
|
{{ bonusData[key] || '0.00' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<!-- 分割线 -->
|
||||||
|
<view class="divider"></view>
|
||||||
|
<!-- 小计 -->
|
||||||
|
<view class="detail-item total">
|
||||||
|
<text class="detail-label total-label">小计(¥)</text>
|
||||||
|
<text class="detail-value total-value">
|
||||||
|
<text class="currency-symbol-small">¥</text>
|
||||||
|
{{ bonusData.retailRealSubtotal || '0.00' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { realTimeBonus } from '@/config/bonus.js'
|
||||||
|
import dayjs from 'dayjs'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 使用截图中的数据作为示例
|
||||||
|
bonusData: {
|
||||||
|
totalIssued: 0,
|
||||||
|
date: '',
|
||||||
|
retailRangeIncome: 0,
|
||||||
|
retailSameLevelIncome: 0.0,
|
||||||
|
retailAreaIncome: 0.0,
|
||||||
|
// welfareLevelDifferenceIncome: 0.0,
|
||||||
|
// welfareDividendIncome: 0.0,
|
||||||
|
backPoints: 0,
|
||||||
|
subtotal: 0,
|
||||||
|
},
|
||||||
|
detailLabels: {
|
||||||
|
retailRangeIncome: '直推收益(¥)',
|
||||||
|
retailSameLevelIncome: '平级收益(¥)',
|
||||||
|
retailAreaIncome: '区域收益(¥)',
|
||||||
|
// welfareLevelDifferenceIncome: '福利级差收益(¥)',
|
||||||
|
// welfareDividendIncome: '福利分红收益(¥)',
|
||||||
|
backPoints: '重消收益(¥)',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {},
|
||||||
|
onShow() {
|
||||||
|
this.getRealTimeBonus()
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
formatDate() {
|
||||||
|
return dayjs(new Date()).format('YYYY-MM-DD')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getRealTimeBonus() {
|
||||||
|
realTimeBonus().then(res => {
|
||||||
|
this.bonusData = res.rows?.[0] || {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 主题色 */
|
||||||
|
:root {
|
||||||
|
--primary-color: #005bac;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 12px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family:
|
||||||
|
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
|
||||||
|
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-card {
|
||||||
|
background: linear-gradient(45deg, #005bac, #0077d9);
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 24px;
|
||||||
|
border-radius: 16px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
box-shadow: 0 8px 16px rgba(0, 91, 172, 0.2);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-title-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-icon {
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 2px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-title {
|
||||||
|
font-size: 16px;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-amount {
|
||||||
|
font-size: 38px;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-symbol {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-symbol-small {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #666;
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.details-card {
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 8px 20px;
|
||||||
|
border-radius: 16px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 18px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
height: 1px;
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-label {
|
||||||
|
font-size: 15px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-value {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-value.date {
|
||||||
|
color: #999;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
padding-top: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-label {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-value {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-value .currency-symbol-small {
|
||||||
|
color: var(--primary-color);
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -20,7 +20,7 @@ export default {
|
||||||
if (!gradeValue) return
|
if (!gradeValue) return
|
||||||
this.gradeValue = gradeValue
|
this.gradeValue = gradeValue
|
||||||
const params = {
|
const params = {
|
||||||
type: 'county',
|
type: gradeValue === 80 ? 'city' : 'county',
|
||||||
}
|
}
|
||||||
getRegionAreaList(params).then(res => {
|
getRegionAreaList(params).then(res => {
|
||||||
this.provinceList = res.data.filter(item => item.parent === 0)
|
this.provinceList = res.data.filter(item => item.parent === 0)
|
||||||
|
|
@ -44,6 +44,7 @@ export default {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
getCityFilterList() {
|
getCityFilterList() {
|
||||||
|
if (this.gradeValue === 80) return
|
||||||
if (!this.countyList.length) {
|
if (!this.countyList.length) {
|
||||||
this.cityList = []
|
this.cityList = []
|
||||||
}
|
}
|
||||||
|
|
@ -52,7 +53,7 @@ export default {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
getCountyFilterList() {
|
getCountyFilterList() {
|
||||||
if (!this.gradeValue) {
|
if (!this.gradeValue || this.gradeValue === 80) {
|
||||||
this.countyList = []
|
this.countyList = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -97,79 +97,49 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 区域信息Tab -->
|
<!-- 收益区域 -->
|
||||||
<view class="my_order" v-if="showRegionTabs">
|
<view class="my_order" v-if="regionInfoVisible">
|
||||||
<u-tabs
|
<view class="my_title">
|
||||||
:list="regionTabList"
|
<text class="thetitle">收益区域</text>
|
||||||
@change="onRegionTabChange"
|
|
||||||
:current="currentRegionTab"
|
|
||||||
:activeColor="'#005BAC'"
|
|
||||||
:inactiveColor="'#999999'"
|
|
||||||
:lineWidth="30"
|
|
||||||
:lineHeight="4"
|
|
||||||
:lineColor="'#005BAC'"
|
|
||||||
:itemStyle="'padding: 15rpx 25rpx; font-size: 20rpx;'"
|
|
||||||
>
|
|
||||||
</u-tabs>
|
|
||||||
|
|
||||||
<!-- Tab内容区域 -->
|
|
||||||
<view class="tab-content">
|
|
||||||
<!-- 已选区域内容 -->
|
|
||||||
<view v-if="currentRegionTab === 0 && hasRegionData">
|
|
||||||
<view class="region-info-box">
|
|
||||||
<view class="region-info-item">
|
|
||||||
<text class="region-info-label">{{ '省' }}</text>
|
|
||||||
<text class="region-info-value">{{
|
|
||||||
regionInfo.provinceVal || '-'
|
|
||||||
}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="region-info-item">
|
|
||||||
<text class="region-info-label">{{ '市' }}</text>
|
|
||||||
<text class="region-info-value">{{
|
|
||||||
regionInfo.cityVal || '-'
|
|
||||||
}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="region-info-item">
|
|
||||||
<text class="region-info-label">{{ '区' }}</text>
|
|
||||||
<text class="region-info-value">{{
|
|
||||||
regionInfo.countyVal || '-'
|
|
||||||
}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 配送中心内容 -->
|
|
||||||
<view v-if="currentRegionTab === 1 && hasDistributionData">
|
|
||||||
<view class="region-info-box">
|
|
||||||
<view class="region-info-item">
|
|
||||||
<text class="region-info-label">{{ '省' }}</text>
|
|
||||||
<text class="region-info-value">{{
|
|
||||||
dstributionCenter.provinceVal || '-'
|
|
||||||
}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="region-info-item">
|
|
||||||
<text class="region-info-label">{{ '市' }}</text>
|
|
||||||
<text class="region-info-value">{{
|
|
||||||
dstributionCenter.cityVal || '-'
|
|
||||||
}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="region-info-item">
|
|
||||||
<text class="region-info-label">{{ '区' }}</text>
|
|
||||||
<text class="region-info-value">{{
|
|
||||||
dstributionCenter.countyVal || '-'
|
|
||||||
}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 配送中心无数据状态 -->
|
|
||||||
<view v-if="currentRegionTab === 1 && !hasDistributionData">
|
|
||||||
<view class="empty-state">
|
|
||||||
<text class="empty-text">暂无配送中心信息</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<template
|
||||||
|
v-if="
|
||||||
|
regionInfo.provinceVal || regionInfo.cityVal || regionInfo.countyVal
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<view class="region-info-box">
|
||||||
|
<view class="region-info-item">
|
||||||
|
<text class="region-info-label">{{ '省' }}</text>
|
||||||
|
<text class="region-info-value">{{
|
||||||
|
regionInfo.provinceVal || '-'
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="region-info-item">
|
||||||
|
<text class="region-info-label">{{ '市' }}</text>
|
||||||
|
<text class="region-info-value">{{
|
||||||
|
regionInfo.cityVal || '-'
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="region-info-item">
|
||||||
|
<text class="region-info-label">{{ '区' }}</text>
|
||||||
|
<text class="region-info-value">{{
|
||||||
|
regionInfo.countyVal || '-'
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view class="region-select-action">
|
||||||
|
<u-button
|
||||||
|
@click="openRegionSelect"
|
||||||
|
color="#005BAC"
|
||||||
|
shape="circle"
|
||||||
|
text="选择区域"
|
||||||
|
></u-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="my_order">
|
<view class="my_order">
|
||||||
<view class="order_flex">
|
<view class="order_flex">
|
||||||
<template v-for="(item, index) in otherMenuList">
|
<template v-for="(item, index) in otherMenuList">
|
||||||
|
|
@ -392,7 +362,6 @@ export default {
|
||||||
ifSpecial: false,
|
ifSpecial: false,
|
||||||
awardsList: '',
|
awardsList: '',
|
||||||
regionInfo: {},
|
regionInfo: {},
|
||||||
dstributionCenter: {},
|
|
||||||
smallAreaBox: 0,
|
smallAreaBox: 0,
|
||||||
totalBox: 0,
|
totalBox: 0,
|
||||||
// performanceData: {},
|
// performanceData: {},
|
||||||
|
|
@ -400,7 +369,6 @@ export default {
|
||||||
totalSumPv: 0,
|
totalSumPv: 0,
|
||||||
smallAreaPv: 0,
|
smallAreaPv: 0,
|
||||||
isNormal: false,
|
isNormal: false,
|
||||||
currentRegionTab: 0, // 当前选中的tab索引
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
@ -410,7 +378,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.isNormal = isNormal
|
this.isNormal = isNormal
|
||||||
this.getRegionSelect()
|
// this.getRegionSelect()
|
||||||
this.getMemberBoxCount()
|
this.getMemberBoxCount()
|
||||||
this.getMarketDynamicBoxCount()
|
this.getMarketDynamicBoxCount()
|
||||||
// this.getUserAwardss()
|
// this.getUserAwardss()
|
||||||
|
|
@ -460,8 +428,8 @@ export default {
|
||||||
marketWrapperVisible() {
|
marketWrapperVisible() {
|
||||||
return this.userInfo.memberSign !== MEMBER_SIGN.ZERO_LEVEL
|
return this.userInfo.memberSign !== MEMBER_SIGN.ZERO_LEVEL
|
||||||
},
|
},
|
||||||
dstributionCenterVisible() {
|
regionInfoVisible() {
|
||||||
return !!this.dstributionCenter
|
return this.regionInfo?.regionStatus === 0
|
||||||
},
|
},
|
||||||
formattedTotalSumPv() {
|
formattedTotalSumPv() {
|
||||||
const value = String(this.totalSumPv || '0.00')
|
const value = String(this.totalSumPv || '0.00')
|
||||||
|
|
@ -495,54 +463,9 @@ export default {
|
||||||
decimal: parts.length > 1 ? `.${parts[1]}` : '',
|
decimal: parts.length > 1 ? `.${parts[1]}` : '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 是否有已选区域数据
|
|
||||||
hasRegionData() {
|
|
||||||
return !!(
|
|
||||||
this.regionInfo &&
|
|
||||||
(this.regionInfo.provinceVal ||
|
|
||||||
this.regionInfo.cityVal ||
|
|
||||||
this.regionInfo.countyVal)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
// 是否有配送中心数据
|
|
||||||
hasDistributionData() {
|
|
||||||
return !!(
|
|
||||||
this.dstributionCenter &&
|
|
||||||
(this.dstributionCenter.provinceVal ||
|
|
||||||
this.dstributionCenter.cityVal ||
|
|
||||||
this.dstributionCenter.countyVal)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
showRegionTabs() {
|
|
||||||
return !!(
|
|
||||||
(this.regionInfo && Object.keys(this.regionInfo).length) ||
|
|
||||||
(this.dstributionCenter && Object.keys(this.dstributionCenter).length)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
regionTabList() {
|
|
||||||
const tabs = []
|
|
||||||
|
|
||||||
if (this.regionInfo) {
|
|
||||||
tabs.push({
|
|
||||||
name: '已选区域',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.dstributionCenter) {
|
|
||||||
tabs.push({
|
|
||||||
name: '配送中心',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return tabs
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// Tab切换事件
|
|
||||||
onRegionTabChange({ index }) {
|
|
||||||
this.currentRegionTab = index
|
|
||||||
},
|
|
||||||
getRegionSelect() {
|
getRegionSelect() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
|
|
@ -550,12 +473,7 @@ export default {
|
||||||
getRegionSelect()
|
getRegionSelect()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.regionInfo = (res.data || []).filter(
|
this.regionInfo = res.data
|
||||||
item => item.businessType === 1
|
|
||||||
)?.[0]
|
|
||||||
this.dstributionCenter = (res.data || []).filter(
|
|
||||||
item => item.businessType === 2
|
|
||||||
)?.[0]
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -1429,25 +1347,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tab相关样式 */
|
|
||||||
.tab-content {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-state {
|
|
||||||
padding: 60rpx 20rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.region-select-action {
|
.region-select-action {
|
||||||
padding: 30rpx 20rpx;
|
padding: 30rpx 20rpx;
|
||||||
}
|
}
|
||||||
::v-deep .u-tabs__wrapper__nav__item__text {
|
|
||||||
font-size: 26rpx !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
/>
|
/>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item
|
<u-form-item
|
||||||
v-if="[80].includes(gradeValue) && provinceList.length"
|
v-if="[60, 70, 80].includes(gradeValue) && provinceList.length"
|
||||||
@click="regionSelectHandle"
|
@click="regionSelectHandle"
|
||||||
required
|
required
|
||||||
label="会员区域"
|
label="会员区域"
|
||||||
|
|
@ -827,7 +827,7 @@ export default {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
if (res.data.isEnough) {
|
if (res.data.isEnough) {
|
||||||
this.form.pkGradeVal = res.data.pkGradeVal
|
this.form.pkGradeVal = res.data.pkGradeVal
|
||||||
if ([80].includes(res.data.gradeValue)) {
|
if ([60, 70, 80].includes(res.data.gradeValue)) {
|
||||||
this.gradeValue = res.data.gradeValue
|
this.gradeValue = res.data.gradeValue
|
||||||
this.getRegionAreaList(res.data.gradeValue)
|
this.getRegionAreaList(res.data.gradeValue)
|
||||||
}
|
}
|
||||||
|
|
@ -1188,7 +1188,7 @@ export default {
|
||||||
},
|
},
|
||||||
goBuy() {
|
goBuy() {
|
||||||
const extParams = {}
|
const extParams = {}
|
||||||
if ([80].includes(this.gradeValue) && this.provinceList.length) {
|
if ([60, 70, 80].includes(this.gradeValue) && this.provinceList.length) {
|
||||||
if (!this.regionAddress.length) {
|
if (!this.regionAddress.length) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择会员区域',
|
title: '请选择会员区域',
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@
|
||||||
>
|
>
|
||||||
<u--input
|
<u--input
|
||||||
:placeholder="'请输入'"
|
:placeholder="'请输入'"
|
||||||
disabled
|
|
||||||
v-model="dataForm.accountName"
|
v-model="dataForm.accountName"
|
||||||
></u--input>
|
></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
@ -55,11 +54,7 @@
|
||||||
prop="sex"
|
prop="sex"
|
||||||
ref="item1"
|
ref="item1"
|
||||||
>
|
>
|
||||||
<u-radio-group
|
<u-radio-group v-model="dataForm.sex" @change="radioGroupChange">
|
||||||
disabled
|
|
||||||
v-model="dataForm.sex"
|
|
||||||
@change="radioGroupChange"
|
|
||||||
>
|
|
||||||
<u-radio
|
<u-radio
|
||||||
:customStyle="{ marginRight: '16rpx' }"
|
:customStyle="{ marginRight: '16rpx' }"
|
||||||
v-for="(item, index) in sexList"
|
v-for="(item, index) in sexList"
|
||||||
|
|
@ -80,6 +75,7 @@
|
||||||
>
|
>
|
||||||
<u--input
|
<u--input
|
||||||
suffixIcon="arrow-right"
|
suffixIcon="arrow-right"
|
||||||
|
readonly
|
||||||
v-model="dataForm.idName"
|
v-model="dataForm.idName"
|
||||||
disabled
|
disabled
|
||||||
:placeholder="'请选择'"
|
:placeholder="'请选择'"
|
||||||
|
|
@ -95,11 +91,10 @@
|
||||||
>
|
>
|
||||||
<u--input
|
<u--input
|
||||||
:placeholder="'请输入'"
|
:placeholder="'请输入'"
|
||||||
disabled
|
|
||||||
v-model="dataForm.idCard"
|
v-model="dataForm.idCard"
|
||||||
></u--input>
|
></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<!-- <u-form-item
|
<u-form-item
|
||||||
required
|
required
|
||||||
label-width="180rpx"
|
label-width="180rpx"
|
||||||
:label="'银行名称'"
|
:label="'银行名称'"
|
||||||
|
|
@ -142,8 +137,8 @@
|
||||||
v-model="dataForm.subBankName"
|
v-model="dataForm.subBankName"
|
||||||
disabledColor="#F5F5F5;"
|
disabledColor="#F5F5F5;"
|
||||||
></u--input>
|
></u--input>
|
||||||
</u-form-item> -->
|
</u-form-item>
|
||||||
<!-- <u-form-item
|
<u-form-item
|
||||||
required
|
required
|
||||||
@click="getDiqu"
|
@click="getDiqu"
|
||||||
:label="'所在地区'"
|
:label="'所在地区'"
|
||||||
|
|
@ -158,7 +153,7 @@
|
||||||
:placeholder="'请选择'"
|
:placeholder="'请选择'"
|
||||||
>
|
>
|
||||||
</u--input>
|
</u--input>
|
||||||
</u-form-item> -->
|
</u-form-item>
|
||||||
|
|
||||||
<view class="view-class">
|
<view class="view-class">
|
||||||
<u-form-item
|
<u-form-item
|
||||||
|
|
@ -170,7 +165,6 @@
|
||||||
>
|
>
|
||||||
<u-textarea
|
<u-textarea
|
||||||
v-model="dataForm.address"
|
v-model="dataForm.address"
|
||||||
disabled
|
|
||||||
placeholder-class="place-class"
|
placeholder-class="place-class"
|
||||||
class="border-color"
|
class="border-color"
|
||||||
maxlength="200"
|
maxlength="200"
|
||||||
|
|
@ -291,10 +285,10 @@ export default {
|
||||||
showAmount: false,
|
showAmount: false,
|
||||||
showCtype: false,
|
showCtype: false,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
// bankName: '',
|
bankName: '',
|
||||||
// cardNumber: '',
|
cardNumber: '',
|
||||||
// pkBank: '',
|
pkBank: '',
|
||||||
// subBankName: '',
|
subBankName: '',
|
||||||
accountName: '',
|
accountName: '',
|
||||||
idCard: '',
|
idCard: '',
|
||||||
pkProvince: '',
|
pkProvince: '',
|
||||||
|
|
@ -463,7 +457,6 @@ export default {
|
||||||
this.$set(this.dataForm, 'accountName', res.data.name)
|
this.$set(this.dataForm, 'accountName', res.data.name)
|
||||||
this.$set(this.dataForm, 'idCard', res.data.idCard)
|
this.$set(this.dataForm, 'idCard', res.data.idCard)
|
||||||
this.$set(this.dataForm, 'sex', res.data.sex)
|
this.$set(this.dataForm, 'sex', res.data.sex)
|
||||||
this.$set(this.dataForm, 'address', res.data.address)
|
|
||||||
} else {
|
} else {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.uploadImg1.deletePic({ index: 0 })
|
this.$refs.uploadImg1.deletePic({ index: 0 })
|
||||||
|
|
@ -493,13 +486,10 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
imageUploaded1(url) {
|
imageUploaded1(url) {
|
||||||
if (!url) return
|
|
||||||
this.dataForm.idFront = url
|
this.dataForm.idFront = url
|
||||||
this.getIdCardInfo(url)
|
|
||||||
},
|
},
|
||||||
imageUploaded2(url) {
|
imageUploaded2(url) {
|
||||||
this.dataForm.idBack = url
|
this.dataForm.idBack = url
|
||||||
this.idBackChange(url)
|
|
||||||
},
|
},
|
||||||
// radio选择发生变化
|
// radio选择发生变化
|
||||||
radioGroupChange(e) {
|
radioGroupChange(e) {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
/>
|
/>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item
|
<u-form-item
|
||||||
v-if="[80].includes(gradeValue) && provinceList.length"
|
v-if="[60, 70, 80].includes(gradeValue) && provinceList.length"
|
||||||
@click="regionSelectHandle"
|
@click="regionSelectHandle"
|
||||||
required
|
required
|
||||||
label="会员区域"
|
label="会员区域"
|
||||||
|
|
@ -719,7 +719,7 @@ export default {
|
||||||
console.log(res.data, 'res.data.memLevel')
|
console.log(res.data, 'res.data.memLevel')
|
||||||
if (res.data.isEnough) {
|
if (res.data.isEnough) {
|
||||||
this.form.pkGradeVal = res.data.pkGradeVal
|
this.form.pkGradeVal = res.data.pkGradeVal
|
||||||
if ([80].includes(res.data.gradeValue)) {
|
if ([60, 70, 80].includes(res.data.gradeValue)) {
|
||||||
this.gradeValue = res.data.gradeValue
|
this.gradeValue = res.data.gradeValue
|
||||||
this.getRegionAreaList(res.data.gradeValue)
|
this.getRegionAreaList(res.data.gradeValue)
|
||||||
}
|
}
|
||||||
|
|
@ -1005,7 +1005,7 @@ export default {
|
||||||
},
|
},
|
||||||
goBuy() {
|
goBuy() {
|
||||||
const extParams = {}
|
const extParams = {}
|
||||||
if ([80].includes(this.gradeValue) && this.provinceList?.length) {
|
if ([60, 70, 80].includes(this.gradeValue) && this.provinceList?.length) {
|
||||||
if (!this.regionAddress.length) {
|
if (!this.regionAddress.length) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择会员区域',
|
title: '请选择会员区域',
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,30 @@
|
||||||
|
import store from '@/store'
|
||||||
let userInfo = uni.getStorageSync('User')
|
let userInfo = uni.getStorageSync('User')
|
||||||
export function stateFormat(row, column, cellValue) {
|
export function stateFormat(row, column, cellValue) {
|
||||||
if (cellValue) {
|
if (cellValue) {
|
||||||
return Number(cellValue)
|
return Number(cellValue)
|
||||||
.toFixed(2)
|
.toFixed(2)
|
||||||
.replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
|
.replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
|
||||||
return $1 + ','
|
|
||||||
|
return $1 + ',';
|
||||||
})
|
})
|
||||||
|
|
||||||
.replace(/\.$/, '')
|
.replace(/\.$/, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//element 转成千分位并保留小数
|
//element 转成千分位并保留小数
|
||||||
//decimal 默认保留2位小数
|
//decimal 默认保留2位小数
|
||||||
export function toThousandthAndKeepDecimal(element, decimal = 2) {
|
export function toThousandthAndKeepDecimal(element, decimal = 2) {
|
||||||
if (!element || element === '') {
|
if (!element || element === '') {//值不存在 或为空
|
||||||
//值不存在 或为空
|
|
||||||
return ''
|
return ''
|
||||||
} else if (typeof element == 'string') {
|
} else if (typeof element == 'string') {
|
||||||
return Number(element).toLocaleString(undefined, {
|
return Number(element).toLocaleString(undefined, { minimumFractionDigits: decimal, maximumFractionDigits: decimal });
|
||||||
minimumFractionDigits: decimal,
|
|
||||||
maximumFractionDigits: decimal,
|
|
||||||
})
|
|
||||||
} else if (typeof element == 'number') {
|
} else if (typeof element == 'number') {
|
||||||
return element.toLocaleString(undefined, {
|
return element.toLocaleString(undefined, { minimumFractionDigits: decimal, maximumFractionDigits: decimal });
|
||||||
minimumFractionDigits: decimal,
|
|
||||||
maximumFractionDigits: decimal,
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
return element
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 千分号
|
// 千分号
|
||||||
export function numberToCurrencyNo(value) {
|
export function numberToCurrencyNo(value) {
|
||||||
|
|
@ -40,17 +36,14 @@ export function numberToCurrencyNo(value) {
|
||||||
// 获取整数部分
|
// 获取整数部分
|
||||||
const intPart = Math.trunc(value)
|
const intPart = Math.trunc(value)
|
||||||
// 整数部分处理,增加,
|
// 整数部分处理,增加,
|
||||||
const intPartFormat = intPart
|
const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
|
||||||
.toString()
|
|
||||||
.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
|
|
||||||
// 预定义小数部分
|
// 预定义小数部分
|
||||||
let floatPart = ''
|
let floatPart = ''
|
||||||
// 将数值截取为小数部分和整数部分
|
// 将数值截取为小数部分和整数部分
|
||||||
const valueArray = value.toString().split('.')
|
const valueArray = value.toString().split('.')
|
||||||
if (valueArray.length === 2) {
|
if (valueArray.length === 2) { // 有小数部分
|
||||||
// 有小数部分
|
|
||||||
floatPart = valueArray[1].toString() // 取得小数部分
|
floatPart = valueArray[1].toString() // 取得小数部分
|
||||||
if (floatPart.length == 1) {
|
if(floatPart.length == 1){
|
||||||
floatPart = floatPart + '0'
|
floatPart = floatPart + '0'
|
||||||
}
|
}
|
||||||
return intPartFormat + '.' + floatPart
|
return intPartFormat + '.' + floatPart
|
||||||
|
|
@ -69,9 +62,9 @@ export function numberToCurrencyNo(value) {
|
||||||
// }
|
// }
|
||||||
// 添加当地币
|
// 添加当地币
|
||||||
export function isLocal(value) {
|
export function isLocal(value) {
|
||||||
return '¥' + value
|
return (store.getters.user.currencyIcon + value) || (userInfo.currencyIcon + value)
|
||||||
}
|
}
|
||||||
// 添加当地币
|
// 添加当地币
|
||||||
export function isLocaled(value) {
|
export function isLocaled(value) {
|
||||||
return '¥'
|
return store.getters.user.currencyIcon || userInfo.currencyIcon
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue