Refactor:分包
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<view class="cash-audit">
|
||||
<view class="pictrue">
|
||||
<image :src="`${staticUrl}/examine.png`" />
|
||||
</view>
|
||||
<view class="tip">提现申请已提交,等待人工审核</view>
|
||||
<view class="time">{{ time }}</view>
|
||||
<view class="bnt bg-color-red" @click="goUserPromotion()">好的</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "CashAudit",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
staticUrl:this.$STATIC_RESOURCE_URL,
|
||||
time: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
let myData = new Date();
|
||||
this.time = myData.toLocaleString();
|
||||
},
|
||||
methods: {
|
||||
goUserPromotion() {
|
||||
this.$yrouter.back();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<view class="commission-details" ref="container">
|
||||
<view class="promoterHeader bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper">
|
||||
<view>
|
||||
<view class="name">佣金明细</view>
|
||||
<view class="money">
|
||||
¥<text class="num">{{ force2Decimal(commission) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sign-record" ref="content">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<view class="data">{{ item.time }}</view>
|
||||
<view class="listn" v-for="(val, indexn) in item.list" :key="indexn">
|
||||
<view class="itemn acea-row row-between-wrapper">
|
||||
<view>
|
||||
<view class="name line1">{{ val.title }}</view>
|
||||
<view>{{ val.addTime }}</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="" style="flex-shrink: 0;text-align: right;">{{val.status==0?"待收货确定":(val.status==1?"有效":"无效")}}</view>
|
||||
<view class="">
|
||||
<view class="num" v-if="val.pm == 1">+{{ force2Decimal(val.number) }}</view>
|
||||
<view class="num font-color-red" v-if="val.pm == 0">
|
||||
-{{ force2Decimal(val.number) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getCommissionInfo, getSpreadInfo } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
|
||||
export default {
|
||||
name: "CommissionDetails",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
mixins: [pageListenMixins],
|
||||
data: function() {
|
||||
return {
|
||||
info: [],
|
||||
commission: 0,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 3
|
||||
},
|
||||
types: 9,//3,
|
||||
loaded: false,
|
||||
loading: false,
|
||||
pageKeyId: Object.freeze('userSpreadBill')
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getCommission();
|
||||
this.getIndex();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loading === false && this.getIndex();
|
||||
},
|
||||
methods: {
|
||||
force2Decimal(v){
|
||||
return this.$force2Decimal(v);
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
if (that.loading == true || that.loaded == true) return;
|
||||
that.loading = true;
|
||||
getCommissionInfo(that.where, that.types).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
|
||||
that.where.page = that.where.page + 1;
|
||||
that.info.push.apply(that.info, res.data);
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
getCommission: function() {
|
||||
let that = this;
|
||||
getSpreadInfo().then(
|
||||
res => {
|
||||
that.commission = res.data.commissionCount;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.promoterHeader {
|
||||
.headerCon {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<view class="distribution-posters">
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true">
|
||||
<block v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<swiper-item>
|
||||
<image
|
||||
class="slide-image"
|
||||
:src="item.wap_poster"
|
||||
mode="widthFix"
|
||||
show-menu-by-longpress
|
||||
/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="keep bg-color-red" @click="saveImg">保存海报</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import { getSpreadImg } from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
let from = {};
|
||||
if (this.$deviceType == "app") {
|
||||
from.from = "app";
|
||||
}
|
||||
getSpreadImg(from).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
downloadIamge: function(imgsrc, name) {
|
||||
var that = this;
|
||||
this.isDown = true;
|
||||
var downloadUrl = imgsrc;
|
||||
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function(data) {},
|
||||
fail: function(data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
that.openDialogVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function() {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,361 @@
|
||||
<template>
|
||||
<view class="promoter-list" ref="container">
|
||||
<view class="header">
|
||||
|
||||
<!-- 搜索开始 -->
|
||||
<view class="search acea-row row-between-wrapper" style="background-color: #F5F5F5 !important;margin-top: 22rpx;">
|
||||
<form @submit.prevent="submitForm" style="width: 100% !important;">
|
||||
<view class="input" style="text-align: left !important;background: #fff !important;width: auto !important;">
|
||||
<text class="iconfont icon-sousuo2"
|
||||
style="left: 28rpx !important;right: auto !important;margin-right: 10rpx;font-size: 32rpx !important;color: #9D9D9D !important;"></text>
|
||||
<input style="margin-left: 70rpx !important;text-align: left !important;color: #CCCCCC !important;"
|
||||
placeholder="点击搜索会员名称" placeholder-style="color:#CCCCCC" v-model="screen.keyword"
|
||||
@confirm="submitForm"/>
|
||||
<!-- <text class="iconfont icon-guanbi"></text> -->
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<!-- 搜索结束 -->
|
||||
|
||||
<view class="promoterHeader" style="height: 160rpx !important;">
|
||||
<view class="headerCon acea-row row-between-wrapper"
|
||||
style="width: auto !important;padding: 0 32rpx !important;">
|
||||
<view class="acea-row row-column">
|
||||
<view class="name"
|
||||
style="color: #000000 !important;font-size: 32rpx !important;font-weight: 500;margin-bottom: 20rpx;">
|
||||
{{ first + second || '0' }}
|
||||
</view>
|
||||
<view style="color: #8C8C8C;font-size: 24rpx;"> 推广人数(人)</view>
|
||||
</view>
|
||||
<view class="acea-row row-middle">
|
||||
<view class="dropDownBtn acea-row row-middle row-center" @click="changeGrade()">
|
||||
<text style="color: #fff;font-size: 24rpx;margin-right: 28rpx;">
|
||||
{{ screen.grade == 0 ? '一级' : '二级' }}
|
||||
</text>
|
||||
<image style="width: 24rpx;height: 12rpx;" :src="webUrl+'/20210819151908963957.png'" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 一二级筛选 -->
|
||||
<!-- <view class="nav acea-row row-around">
|
||||
<view
|
||||
class="item"
|
||||
:class="screen.grade == 0 ? 'on' : ''"
|
||||
@click="checkGrade(0)"
|
||||
>一级({{ first||'0' }})</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="screen.grade == 1 ? 'on' : ''"
|
||||
@click="checkGrade(1)"
|
||||
>二级({{ second||'0' }})</view>
|
||||
</view> -->
|
||||
<!-- 一二级筛选 -->
|
||||
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="sortNav acea-row row-middle" :class="fixedState === true ? 'on' : ''">
|
||||
<view class="sortItem" :style="(childCount === 1 || childCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('childCount')">
|
||||
团队排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="childCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="childCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="childCount == 3"/>
|
||||
</view>
|
||||
<view class="sortItem" :style="(numberCount === 1 || numberCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('numberCount')">
|
||||
金额排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="numberCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="numberCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="numberCount == 3"/>
|
||||
</view>
|
||||
<view class="sortItem" :style="(orderCount === 1 || orderCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('orderCount')">
|
||||
订单排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="orderCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="orderCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="orderCount == 3"/>
|
||||
</view>
|
||||
<view class="sortItem" :style="(levelCount === 1 || levelCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('levelCount')">
|
||||
等级排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="levelCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="levelCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="levelCount == 3"/>
|
||||
</view>
|
||||
</view>
|
||||
<view :class="fixedState === true ? 'sortList' : ''">
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(val, spreadListIndex) in spreadList"
|
||||
:key="spreadListIndex"
|
||||
>
|
||||
<view class="picTxt acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||
<view class="" style="width: 60rpx;word-wrap: break-word;text-align: center;margin-right: 8rpx;">
|
||||
{{ spreadListIndex + 1 }}
|
||||
</view>
|
||||
<view class="pictrue" style="flex-shrink: 0;margin-right: 8rpx;">
|
||||
<image :src="val.avatar"/>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1 acea-row row-middle">{{ val.nickname }}
|
||||
<text class="levelBox">{{ val.levelName }}</text>
|
||||
</view>
|
||||
<view style="color: #999999 !important;">加入时间: {{ val.time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>
|
||||
<text class="font-color-red">{{ val.childCount }}</text>
|
||||
人
|
||||
</view>
|
||||
<view>{{ val.orderCount }}单</view>
|
||||
<view>
|
||||
<text class="font-color-red">{{ val.numberCount ? val.numberCount : 0 }}</text>
|
||||
元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-px-6" v-if="spreadList.length === 0">
|
||||
<u-divider :text=" ' · 此级别未找到会员 · ' " textPosition="center"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import {getSpreadUser} from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
|
||||
export default {
|
||||
name: "PromoterList",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
mixins: [pageListenMixins],
|
||||
data: function () {
|
||||
return {
|
||||
fixedState: false,
|
||||
screen: {
|
||||
page: 1,
|
||||
limit: 15,
|
||||
grade: 0,
|
||||
keyword: "",
|
||||
sort: ""
|
||||
},
|
||||
childCount: 2,
|
||||
numberCount: 2,
|
||||
orderCount: 2,
|
||||
levelCount: 2,
|
||||
loaded: false,
|
||||
loading: false,
|
||||
spreadList: [],
|
||||
loadTitle: "",
|
||||
first: "",
|
||||
second: "",
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
pageKeyId: Object.freeze('userSpreadStat')
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.getSpreadUsers();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getSpreadUsers();
|
||||
},
|
||||
watch: {
|
||||
"screen.sort": function () {
|
||||
this.screen.page = 1;
|
||||
this.loaded = false;
|
||||
this.loading = false;
|
||||
this.spreadList = [];
|
||||
this.getSpreadUsers();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeGrade: function () {
|
||||
var that = this;
|
||||
uni.showActionSheet({
|
||||
itemList: ['一级', '二级'],
|
||||
success: function (res) {
|
||||
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||
that.checkGrade(res.tapIndex);
|
||||
},
|
||||
fail: function (res) {
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
handleScroll: function () {
|
||||
// var scrollTop =
|
||||
// document.documentElement.scrollTop || document.body.scrollTop;
|
||||
// var offsetTop = document.querySelector(".header").clientHeight;
|
||||
// if (scrollTop >= offsetTop) {
|
||||
// this.fixedState = true;
|
||||
// } else {
|
||||
// this.fixedState = false;
|
||||
// }
|
||||
},
|
||||
submitForm: function () {
|
||||
this.screen.page = 1;
|
||||
this.loaded = false;
|
||||
this.loading = false;
|
||||
this.spreadList = [];
|
||||
this.getSpreadUsers();
|
||||
},
|
||||
getSpreadUsers: function () {
|
||||
let that = this,
|
||||
screen = that.screen;
|
||||
if (that.loaded || that.loading) return;
|
||||
that.loading = true;
|
||||
getSpreadUser(screen).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.spreadList.push.apply(that.spreadList, res.data.list);
|
||||
that.loaded = res.data.list.length < that.screen.limit; //判断所有数据是否加载完成;
|
||||
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
|
||||
that.screen.page = that.screen.page + 1;
|
||||
that.first = res.data.total;
|
||||
that.second = res.data.totalLevel;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
},
|
||||
300
|
||||
);
|
||||
},
|
||||
checkGrade: function (val) {
|
||||
if (val == this.screen.grade) return;
|
||||
else {
|
||||
this.screen.page = 1;
|
||||
this.screen.grade = val;
|
||||
this.loading = false;
|
||||
this.loaded = false;
|
||||
this.spreadList = [];
|
||||
this.getSpreadUsers();
|
||||
}
|
||||
},
|
||||
sort: function (types) {
|
||||
let that = this;
|
||||
switch (types) {
|
||||
case "childCount":
|
||||
if (that.childCount == 2) {
|
||||
that.childCount = 1;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "childCount DESC";
|
||||
} else if (that.childCount == 1) {
|
||||
that.childCount = 3;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "childCount ASC";
|
||||
} else if (that.childCount == 3) {
|
||||
that.childCount = 2;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
case "numberCount":
|
||||
if (that.numberCount == 2) {
|
||||
that.numberCount = 1;
|
||||
that.orderCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "numberCount DESC";
|
||||
} else if (that.numberCount == 1) {
|
||||
that.numberCount = 3;
|
||||
that.orderCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "numberCount ASC";
|
||||
} else if (that.numberCount == 3) {
|
||||
that.numberCount = 2;
|
||||
that.orderCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
case "orderCount":
|
||||
if (that.orderCount == 2) {
|
||||
that.orderCount = 1;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "orderCount DESC";
|
||||
} else if (that.orderCount == 1) {
|
||||
that.orderCount = 3;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "orderCount ASC";
|
||||
} else if (that.orderCount == 3) {
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
case "levelCount":
|
||||
if (that.levelCount == 2) {
|
||||
that.levelCount = 1;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.screen.sort = "level desc";
|
||||
} else if (that.levelCount == 1) {
|
||||
that.levelCount = 3;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.screen.sort = "level ASC";
|
||||
} else if (that.levelCount == 3) {
|
||||
that.levelCount = 2;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
that.screen.sort = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.dropDownBtn {
|
||||
width: 176rpx;
|
||||
height: 60rpx;
|
||||
background: #0DC5C5;
|
||||
box-shadow: 0px 8rpx 14rpx rgba(179, 188, 191, 0.6);
|
||||
opacity: 1;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.levelBox {
|
||||
padding: 0 10rpx;
|
||||
font-size: 18rpx;
|
||||
line-height: 28rpx;
|
||||
height: 28rpx;
|
||||
background: #FF564A;
|
||||
color: #fff;
|
||||
border-radius: 14rpx;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<view class="promoter-order" ref="container">
|
||||
<view class="promoterHeader bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||
<view style="flex-shrink: 0;margin-right: 40rpx;">
|
||||
<text class="name">累计推广订单</text>
|
||||
<view>
|
||||
<text class="num">{{ count||'0' }}</text>
|
||||
<text>单</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="flex-grow: 1;font-size: 24rpx;">
|
||||
{{ ruleText }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, listIndex) in list" :key="listIndex">
|
||||
<view class="title acea-row row-column row-center">
|
||||
<view class="data">{{ item.time }}</view>
|
||||
<text>本月累计推广订单:{{ item.count ? item.count : 0 }}单</text>
|
||||
</view>
|
||||
<view class="listn">
|
||||
<view class="itenm" v-for="(val, indexn) in item.child" :key="indexn">
|
||||
<view class="top acea-row row-between-wrapper">
|
||||
<view class="pictxt acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="val.avatar" />
|
||||
</view>
|
||||
<text class="text line1">{{ val.nickname }}</text>
|
||||
</view>
|
||||
<view class="money">
|
||||
<text>返佣:</text>
|
||||
<text class="font-color-red">¥{{ val.number ? val.number : 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
|
||||
<view class="acea-row row-between" style="flex-wrap: nowrap;">
|
||||
<view style="flex-grow: 1;">
|
||||
<text class="name">订单金额:</text>
|
||||
<text class="font-color-red">¥{{ val.payPrice || 0 }}(¥{{ val.totalPrice || 0 }}+¥{{ val.totalPostage || 0 }}运费)</text>
|
||||
</view>
|
||||
<view class="" style="flex-shrink: 0;">{{val.billStatus==0?"待收货确定":(val.billStatus==1?"有效":"无效")}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">订单号:</text>
|
||||
{{ val.orderId }}
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">下单时间:</text>
|
||||
{{ val.time }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getSpreadOrder, getUserSpreadRule } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
export default {
|
||||
name: "PromoterOrder",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
mixins: [pageListenMixins],
|
||||
data: function() {
|
||||
return {
|
||||
list: [],
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 15
|
||||
},
|
||||
loaded: false,
|
||||
loading: false,
|
||||
loadTitle: '',
|
||||
count: '',
|
||||
ruleText: '',
|
||||
pageKeyId: Object.freeze('userSpreadOrder')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getIndex()
|
||||
this.getRuleText()
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getIndex()
|
||||
},
|
||||
methods: {
|
||||
getRuleText() {
|
||||
getUserSpreadRule().then(res => {
|
||||
const { success, data } = res
|
||||
if (success) {
|
||||
this.ruleText = data.userSpreadRule || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
getIndex() {
|
||||
let there = this
|
||||
if (there.loaded == true || there.loading == true) return
|
||||
there.loading = true
|
||||
getSpreadOrder(there.where).then(
|
||||
res => {
|
||||
there.loading = false
|
||||
there.loaded = res.data.list.length < there.where.limit
|
||||
there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多"
|
||||
there.where.page = there.where.page + 1
|
||||
there.list.push.apply(there.list, res.data.list)
|
||||
there.count = res.data.count
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.promoterHeader .headerCon{
|
||||
width: auto !important;
|
||||
padding: 0 20rpx 0 20rpx !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<view class="cash-withdrawal">
|
||||
<view class="nav acea-row">
|
||||
<view
|
||||
v-for="(item, navListIndex) in navList"
|
||||
class="item font-color-red"
|
||||
@click="swichNav(navListIndex, item)"
|
||||
:key="navListIndex"
|
||||
>
|
||||
<view class="line bg-color-red" :class="currentTab === navListIndex ? 'on' : ''"></view>
|
||||
<view class="iconfont" :class="item.icon + ' ' + (currentTab === navListIndex ? 'on' : '')"></view>
|
||||
<view>{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view :hidden="currentTab !== 0" class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">微信号</view>
|
||||
<view class="input">
|
||||
<input placeholder="请输入微信号" v-model="post.weixin" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">提现</view>
|
||||
<view class="input">
|
||||
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
||||
<view class="bnt bg-color-red" @click="submitted">提现</view>
|
||||
</view>
|
||||
<view :hidden="currentTab !== 1" class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">用户名</view>
|
||||
<view class="input">
|
||||
<input placeholder="请填写您的支付宝用户名" v-model="post.name" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">账号</view>
|
||||
<view class="input">
|
||||
<input placeholder="请填写您的支付宝账号" v-model="post.alipay_code" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">提现</view>
|
||||
<view class="input">
|
||||
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
||||
<view class="bnt bg-color-red" @click="submitted">提现</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getBank, postCashInfo } from "@/api/user";
|
||||
import { required } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
|
||||
export default {
|
||||
name: "UserCash",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
navList: [
|
||||
{ name: "微信", type: "weixin", icon: "icon-weixin2" },
|
||||
{ name: "支付宝", type: "alipay", icon: "icon-icon34" }
|
||||
],
|
||||
post: {
|
||||
extract_type: "weixin",
|
||||
alipay_code: "",
|
||||
money: "",
|
||||
name: "",
|
||||
bankname: "",
|
||||
cardnum: "",
|
||||
weixin: ""
|
||||
},
|
||||
currentTab: 0,
|
||||
minPrice: 0,
|
||||
banks: [],
|
||||
commissionCount: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getBank();
|
||||
},
|
||||
methods: {
|
||||
swichNav: function(index, item) {
|
||||
console.log(item);
|
||||
this.currentTab = index;
|
||||
this.post.extract_type = item.type;
|
||||
},
|
||||
getBank: function() {
|
||||
let that = this;
|
||||
getBank().then(
|
||||
res => {
|
||||
that.banks = res.data.extractBank;
|
||||
that.minPrice = res.data.minPrice;
|
||||
that.commissionCount = res.data.commissionCount;
|
||||
},
|
||||
function(err) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
async submitted() {
|
||||
let bankname = this.post.bankname,
|
||||
alipay_code = this.post.alipay_code,
|
||||
money = this.post.money,
|
||||
name = this.post.name,
|
||||
cardnum = this.post.cardnum,
|
||||
weixin = this.post.weixin,
|
||||
that = this;
|
||||
// console.log(parseFloat(money))
|
||||
if (
|
||||
parseFloat(money) > parseFloat(that.commissionCount) ||
|
||||
parseFloat(that.commissionCount) == 0
|
||||
)
|
||||
return that.$dialog.message("余额不足");
|
||||
if (parseFloat(money) < parseFloat(that.minPrice))
|
||||
return that.$dialog.message("最低提现金额" + that.minPrice);
|
||||
//console.log(that.post.extract_type)
|
||||
switch (that.post.extract_type) {
|
||||
case "alipay":
|
||||
// if (!name) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝用户名",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!alipay_code) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝账号",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!money) {
|
||||
// uni.showToast({
|
||||
// title: "请输入提现金额",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
try {
|
||||
await this.$validator({
|
||||
name: [required(required.message("支付宝用户名"))],
|
||||
alipay_code: [required(required.message("支付宝账号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({ name, alipay_code, money });
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
alipayCode: alipay_code,
|
||||
name: name,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
break;
|
||||
case "weixin":
|
||||
try {
|
||||
await this.$validator({
|
||||
weixin: [required(required.message("提现微信号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({ weixin, money });
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
weixin: weixin,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
save: function(info) {
|
||||
postCashInfo(info).then(
|
||||
res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.router.push({ path: "/user/audit" });
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<view class="my-promotion">
|
||||
|
||||
<view class="topBanner acea-row row-middle row-center">
|
||||
<view class="item acea-row row-column">
|
||||
<view class="itemValue">{{ force2Decimal(Info.commissionCount) }}</view>
|
||||
<view class="itemTitle">当前佣金</view>
|
||||
</view>
|
||||
<view class="vline"></view>
|
||||
<view class="item acea-row row-column">
|
||||
<view class="itemValue">{{ force2Decimal(Info.lastDayCount) }}</view>
|
||||
<view class="itemTitle">今日收益</view>
|
||||
</view>
|
||||
<view class="vline"></view>
|
||||
<view class="item acea-row row-column">
|
||||
<view class="itemValue">{{ force2Decimal(Info.extractCount) }}</view>
|
||||
<view class="itemTitle">累计已提</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="acea-row row-right">
|
||||
<view class="withdrawRecordBtn acea-row row-middle row-center" @click="goCashRecord()">
|
||||
<image :src="webUrl+'/20210819120620545726.png'" mode="" style="width: 24rpx;height: 24rpx;margin-right: 10rpx;"></image>
|
||||
<text style="color: #fff;font-size: 24rpx;">提现记录</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-list acea-row row-column">
|
||||
<view class="menu-item acea-row row-middle" @click="goPromoterList()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819120915878640.png'" mode=""></image>
|
||||
<text class="menu-item-title">推广统计</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
<view class="menu-item acea-row row-middle" @click="goCommissionDetails()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819133737716135.png'" mode=""></image>
|
||||
<text class="menu-item-title">佣金明细</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
<view class="menu-item acea-row row-middle" @click="goPromoterOrder()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819133751983817.png'" mode=""></image>
|
||||
<text class="menu-item-title">推广人订单</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
<view class="menu-item acea-row row-middle" @click="toCash()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819133726059725.png'" mode=""></image>
|
||||
<text class="menu-item-title">立即提现</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- <view class="header">
|
||||
<view class="name acea-row row-center-wrapper">
|
||||
<view>当前佣金</view>
|
||||
<view class="record" @click="goCashRecord()">
|
||||
提现记录
|
||||
<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num">{{ force2Decimal(Info.commissionCount) }}</view>
|
||||
<view class="profit acea-row row-between-wrapper">
|
||||
<view class="item">
|
||||
<view>今日收益</view>
|
||||
<view class="money">{{ force2Decimal(Info.lastDayCount) }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>累积已提</view>
|
||||
<view class="money">{{ force2Decimal(Info.extractCount) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list acea-row row-between-wrapper">
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goPoster()">
|
||||
<text class="iconfont icon-erweima"></text>
|
||||
<view>推广名片</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goPromoterList()">
|
||||
<text class="iconfont icon-tongji"></text>
|
||||
<view>推广人统计</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goCommissionDetails()">
|
||||
<text class="iconfont icon-qiandai"></text>
|
||||
<view>佣金明细</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goPromoterOrder()">
|
||||
<text class="iconfont icon-dingdan"></text>
|
||||
<view>推广人订单</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="toCash()">
|
||||
<text class="iconfont icon-chongzhi"></text>
|
||||
<view>立即提现</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
||||
|
||||
import { getSpreadInfo } from "@/api/user";
|
||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||
|
||||
export default {
|
||||
name: "UserPromotion",
|
||||
mixins: [pageListenMixins],
|
||||
data: function() {
|
||||
return {
|
||||
Info: {
|
||||
lastDayCount: 0,
|
||||
extractCount: 0,
|
||||
commissionCount: 0
|
||||
},
|
||||
webUrl:this.$VUE_APP_RESOURCES_URL,
|
||||
pageKeyId: Object.freeze('userSpreadIndex')
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
|
||||
},
|
||||
onShow:function(){
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
force2Decimal(v){
|
||||
return this.$force2Decimal(v);
|
||||
},
|
||||
goPoster() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/Poster/index");
|
||||
},
|
||||
goCashRecord() {
|
||||
this.$yrouter.push('/pkg_user/views/withdrawalLog');
|
||||
},
|
||||
goPromoterList() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/PromoterList/index");
|
||||
},
|
||||
goCommissionDetails() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/CommissionDetails/index");
|
||||
},
|
||||
goPromoterOrder() {
|
||||
this.$yrouter.push("/pagesUser/user/promotion/PromoterOrder/index");
|
||||
},
|
||||
getInfo: function() {
|
||||
let that = this;
|
||||
getSpreadInfo().then(
|
||||
res => {
|
||||
that.Info = res.data;
|
||||
},
|
||||
function(err) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
toCash: function() {
|
||||
this.$yrouter.push("/pkg_user/views/withdrawal");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="less">
|
||||
.my-promotion{
|
||||
padding: 32rpx;
|
||||
}
|
||||
.my-promotion .header{
|
||||
background-image: none !important;
|
||||
background-color: #FE5261;
|
||||
}
|
||||
.my-promotion .list .item .iconfont{
|
||||
color: #FE5261 !important;
|
||||
}
|
||||
|
||||
.topBanner{
|
||||
height: 180rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 6rpx 16rpx rgba(232, 236, 241, 0.5);
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx;
|
||||
}
|
||||
.topBanner .item{
|
||||
flex: 1;
|
||||
}
|
||||
.topBanner .item .itemValue{
|
||||
color: #333333;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.topBanner .item .itemTitle{
|
||||
color: #999999;
|
||||
font-size: 22rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.vline{
|
||||
background-color: #E3E3E3;
|
||||
width: 1px;
|
||||
height: 64rpx;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
.withdrawRecordBtn{
|
||||
width: 174rpx;
|
||||
height: 60rpx;
|
||||
background: #0DC5C5;
|
||||
box-shadow: 0px 8rpx 14rpx rgba(179, 188, 191, 0.6);
|
||||
border-radius: 8rpx;
|
||||
margin: 32rpx 0;
|
||||
}
|
||||
|
||||
|
||||
.menu-list{
|
||||
|
||||
}
|
||||
.menu-list .menu-item{
|
||||
padding: 24rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 6rpx 16rpx rgba(232, 236, 241, 0.5);
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 18rpx;
|
||||
}
|
||||
|
||||
.menu-list .menu-item .menu-item-title{
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.menu-list .menu-item .menu-item-img{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
flex-shrink:0;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user