commit message

This commit is contained in:
Chopper
2021-05-13 11:03:32 +08:00
commit 23804939eb
2158 changed files with 149684 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<template>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,136 @@
<template>
<view class="wrapper">
<view>
<h4>实名认证请上传真实的个人信息认证通过后将无法修改</h4>
<view>
<u-form :model="ruleForm" label-width="200rpx" ref="uForm">
<u-form-item label="姓名" prop="name">
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
</u-form-item>
<u-form-item label="身份证" prop="idNumber">
<u-input
v-model="ruleForm.idNumber"
placeholder="请输入身份证号码"
/>
</u-form-item>
<!-- <u-form-item label="身份证正面照" prop="name">
<u-upload></u-upload>
</u-form-item>
<u-form-item label="身份证反面照" prop="name">
<u-upload></u-upload>
</u-form-item>
<u-form-item label="手持身份证照" prop="name">
<u-upload></u-upload>
</u-form-item> -->
</u-form>
<u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit">提交</u-button>
</view>
</view>
<view class="tips">
<view>您提交的信息正在审核</view>
<view>提交认证申请后工作人员将在三个工作日进行核对完成审核</view>
</view>
</view>
</template>
<script>
import { applyDistribution } from "@/api/goods";
export default {
data() {
return {
ruleForm: {
name: "",
idNumber: "",
},
rules: {
name: [
{
required: true,
message: "请输入姓名",
// 可以单个或者同时写两个触发验证方式
trigger: "blur",
},
{
// 自定义验证函数,见上说明
validator: (rule, value, callback) => {
// 上面有说返回true表示校验通过返回false表示不通过
// this.$u.test.mobile()就是返回true或者false的
return this.$u.test.chinese(value);
},
message: "姓名输入不正确",
// 触发器可以同时用blur和change
trigger: ["change", "blur"],
},
],
idNumber: [
{
required: true,
message: "请输入身份证",
// 可以单个或者同时写两个触发验证方式
trigger: "blur",
},
{
// 自定义验证函数,见上说明
validator: (rule, value, callback) => {
// 上面有说返回true表示校验通过返回false表示不通过
// this.$u.test.mobile()就是返回true或者false的
return this.$u.test.idCard(value);
},
message: "身份证号码不正确",
// 触发器可以同时用blur和change
trigger: ["change", "blur"],
},
],
},
};
},
methods: {
submit() {
this.$refs.uForm.validate((valid) => {
if (valid) {
applyDistribution(this.ruleForm).then((res) => {
if (res.data.success) {
uni.showToast({
title: "认证提交成功!",
duration: 2000,
icon: "none",
});
setTimeout(()=>{
uni.navigateBack();
},500)
}
else{
uni.showToast({
title: res.data.message,
duration: 2000,
icon:"none"
});
}
});
} else {
uni.showToast({
title: "请填写有效信息",
duration: 2000,
icon: "none",
});
}
});
},
},
onReady() {
this.$refs.uForm.setRules(this.rules);
},
};
</script>
<style lang="scss" scoped>
.wrapper {
padding: 32rpx;
}
.tips {
margin-top: 20rpx;
font-size: 24rpx;
color: #999;
}
</style>

View File

@@ -0,0 +1,123 @@
<template>
<view class="log-list">
<view class="log-way" v-for="(item, index) in datas" :key="index">
<view class="log-item">
<view class="log-item-view">
<view class="title">{{
item.distributionCashStatus == "APPLY"
? "待处理"
: item.distributionCashStatus == "PASS"
? "通过"
: "拒绝"
}}</view>
<view class="price">+{{ item.price | unitPrice }}</view>
</view>
<view class="log-item-view">
<view>{{ item.createTime }}</view>
<view></view>
</view>
</view>
</view>
<view class="empty" v-if="empty">
<u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
<!-- <u-empty text="暂无更多提现历史" mode="order"></u-empty> -->
</view>
</view>
</template>
<script>
import { cashLog, distributionOrderList } from "@/api/goods";
export default {
data() {
return {
datas: "", //数据集合
status: "loadmore",
iconType: "flower",
empty: false,
params: {
pageNumber: 1,
pageSize: 10,
},
type: 0,
routers: "",
achParams: {
distributionId: (this.routers && this.routers.id) || "", //分销商id
distributionName: (this.routers && this.routers.name) || "", //分销商名称
distributionOrderStatus: "", //分销商订单状态
pageNumber: 1,
pageSize: 10,
},
};
},
onLoad(option) {
let title;
option.type == 0 ? (title = "分销业绩") : (title = "提现记录");
uni.setNavigationBarTitle({
title: title, //这是修改后的导航栏文字
});
this.routers = option;
console.log(this.routers);
option.type == 0 ? this.achievement() : this.history();
},
mounted() {},
onReachBottom() {
this.status = "loading";
this.params.pageNumber++;
this.type == 1 ? this.history() : this.achievement();
},
methods: {
// 业绩
achievement() {
distributionOrderList(this.achParams).then((res) => {});
},
// 初始化提现历史
history() {
uni.showLoading({
title: "加载中",
});
cashLog(this.params).then((res) => {
if (res.data.success && res.data.result.records.length >= 1) {
this.datas = res.data.result.records;
} else {
this.status = "nomore";
this.empty = true;
}
uni.hideLoading();
});
},
},
};
</script>
<style lang="scss" scoped>
.empty {
margin: 40rpx 0;
}
.price {
color: $main-color;
font-weight: bold;
}
.log-list {
padding: 0 8rpx;
overflow: hidden;
margin: 20rpx 0;
}
.log-way {
margin: 10rpx 0;
overflow: hidden;
background: #fff;
border-radius: 10rpx;
padding: 20rpx 0;
}
.title {
font-size: 30rpx;
font-weight: bold;
}
.log-item-view {
padding: 8rpx 32rpx;
display: flex;
justify-content: space-between;
}
</style>

View File

@@ -0,0 +1,140 @@
<template>
<view>
<view class="nav-list">
<view class="total">可提现金额</view>
<view class="price">{{ distributionData.canRebate | unitPrice }}</view>
<view class="frozen"
>冻结金额{{ distributionData.commissionFrozen | unitPrice }}</view
>
</view>
<view class="nav">
<view class="nav-item">
<u-icon
size="50"
@click="handleClick('/pages/mine/distribution/list?id='+distributionData.id+'&name='+distributionData.memberName)"
color="#ff6b35"
name="bag-fill"
></u-icon>
<view>分销商品</view>
</view>
<view
class="nav-item"
@click="handleClick(`/pages/mine/distribution/history?type=0&id=${distributionData.id}&name=${distributionData.memberName}`)"
>
<u-icon size="50" color="#ff6b35" name="order"></u-icon>
<view>分销业绩</view>
</view>
<view
class="nav-item"
@click="handleClick('/pages/mine/distribution/history?type=1')"
>
<u-icon size="50" color="#ff6b35" name="red-packet-fill"></u-icon>
<view>提现记录</view>
</view>
<view
class="nav-item"
@click="handleClick('/pages/mine/distribution/withdrawal')"
>
<u-icon size="50" color="#ffc71c" name="rmb-circle-fill"></u-icon>
<view>提现</view>
</view>
<view class="nav-item" @click="handleClick('/pages/mine/distribution/list')">
<u-icon size="50" color="#1e9ff2" name="home-fill"></u-icon>
<view>选品库</view>
</view>
</view>
</view>
</template>
<script>
import { distribution } from "@/api/goods";
export default {
data() {
return {
distributionData: "",
};
},
methods: {
handleClick(url) {
uni.navigateTo({
url,
});
},
queryGoods(src) {
uni.navigateTo({
url: `/pages/mine/distribution/${src}`,
});
},
/**
* 初始化推广商品
*/
init() {
uni.showLoading({
title: "加载中",
});
distribution().then((res) => {
if (res.data.result) {
this.distributionData = res.data.result;
}
uni.hideLoading();
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss" scoped>
.nav {
// height: 176rpx;
background: #fff;
align-items: center;
display: flex;
// border-radius: 20rpx;
// transform: translateY(-20rpx);
// box-shadow: 4rpx 10rpx 22rpx rgba(0, 0, 0, 0.1);
flex-wrap: wrap;
}
.nav-list {
color: #fff;
padding: 40rpx 0;
background: $aider-light-color;
// border-bottom-left-radius: 100rpx;
// border-bottom-right-radius: 100rpx;
}
.total {
padding: 10rpx 0;
text-align: center;
font-size: 28rpx;
opacity: 0.8;
}
.frozen {
text-align: center;
font-size: 24rpx;
opacity: 0.8;
}
.price {
text-align: center;
color: #fff;
font-size: 50rpx;
}
.nav-item {
height: 240rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
> * {
margin: 10rpx 0;
}
width: 33%;
// color: #fff;
}
</style>

View File

@@ -0,0 +1,103 @@
<template>
<view class="wrapper">
<u-tabs
:list="list"
:is-scroll="false"
:current="current"
@change="change"
:active-color="$lightColor"
></u-tabs>
<!-- 推广人资料 -->
<view class="message">
<u-form :model="ruleForm" label-width="250rpx" ref="uForm">
<u-form-item label="会员昵称" prop="name">
<u-input v-model="ruleForm.name" />
</u-form-item>
<u-form-item label="账户类型" prop="name"> </u-form-item>
<u-form-item
label="收款人姓名"
placeholder="请输入收款人姓名"
prop="name"
>
<u-input v-model="ruleForm.name" />
</u-form-item>
<u-form-item
label="收款账号"
placeholder="请输入收款人账号"
prop="name"
>
<u-input v-model="ruleForm.name" />
</u-form-item>
<u-form-item
label="银行名称"
placeholder="请输入开户银行支行名称"
prop="name"
>
<u-input v-model="ruleForm.name" />
</u-form-item>
</u-form>
<u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit">提交</u-button>
</view>
</view>
</template>
<script>
export default {
components: {},
// 必须要在onReady生命周期因为onLoad生命周期组件可能尚未创建完毕
onReady() {
this.$refs.uForm.setRules(this.rules);
},
data() {
return {
current:0,
list: [
{
name: "推广人资料",
},
{
name: "平台审核",
},
{
name: "完成",
},
],
ruleForm: {
name: "",
radio: "",
},
rules: {
name: [
{
required: true,
message: "请输入姓名",
// 可以单个或者同时写两个触发验证方式
trigger: "blur",
},
],
},
};
},
};
</script>
<style lang="scss" scoped>
.menu {
height: 88rpx;
line-height: 88rpx;
background: $main-color;
display: flex;
> .menu-item {
flex: 1;
text-align: center;
color: $light-color;
}
}
.active {
color: #fff !important;
}
.message {
padding: 0 32rpx;
}
</style>

View File

@@ -0,0 +1,412 @@
<template>
<view class="wrapper">
<!-- 筛选弹出层 -->
<u-popup width="90%" v-model="popup" mode="right">
<view class="screen-title">商品筛选</view>
<view class="screen-view">
<view class="screen-item">
<h4>价格区间</h4>
<view class="flex">
<u-input class="u-bg" placeholder-style="font-size:22rpx;" type="number" input-align="center" placeholder="最低价"></u-input>
<view class="line"></view>
<u-input class="u-bg" placeholder-style="font-size:22rpx;" type="number" input-align="center" placeholder="最高价"></u-input>
</view>
</view>
<view class="screen-item">
<h4>销量</h4>
<view class="flex">
<u-input class="u-bg w200 flex1" placeholder-style="font-size:22rpx;" type="number" input-align="center" placeholder="销量"></u-input>
<view class="flex1">笔以上</view>
</view>
</view>
<view class="screen-item">
<h4>收入比率</h4>
<view class="flex">
<u-input class="u-bg" placeholder-style="font-size:22rpx;" type="number" input-align="center" placeholder="最低%"></u-input>
<view class="line"></view>
<u-input class="u-bg" placeholder-style="font-size:22rpx;" type="number" input-align="center" placeholder="最高%"></u-input>
</view>
</view>
<view class="screen-item">
<h4>包邮</h4>
<view class="flex">
<u-tag class="u-tag" shape="circle" text="包邮" mode="plain" type="info" />
</view>
</view>
<view class="screen-item">
<h4>促销活动</h4>
<view class="flex">
<u-tag class="u-tag" shape="circle" text="限时抢购" mode="plain" type="info" />
<u-tag class="u-tag" shape="circle" text="拼团秒杀" mode="plain" type="info" />
</view>
</view>
<view class="screen-item">
<h4>经营类型</h4>
<view class="flex">
<u-tag class="u-tag" shape="circle" text="平台自营" mode="plain" type="info" />
<u-tag class="u-tag" shape="circle" text="三方店铺" mode="plain" type="info" />
</view>
</view>
</view>
<view class="screen-btn">
<view class="screen-clear"> 重置 </view>
<view class="screen-submit"> 确定 </view>
</view>
</u-popup>
<!-- 导航栏 -->
<view class="nav">
<view class="nav-item" @click="handleMyGoods(true)" :class="{ checked: params.checked }">已选择</view>
<view class="nav-item" @click="handleMyGoods(false)" :class="{ checked: !params.checked }">未选择</view>
<!-- <view class="nav-item" @click="popup = !popup">筛选</view> -->
</view>
<!-- 商品列表 -->
<view class="goods-list">
<view class="goods-item" v-for="(item, index) in goodsList" :key="index">
<view class="goods-item-img" @click="handleNavgationGoods(item)">
<u-image width="176rpx" height="176rpx" :src="item.thumbnail"></u-image>
</view>
<view class="goods-item-desc">
<!-- 商品描述 -->
<view class="-item-title" @click="handleNavgationGoods(item)">
{{ item.goodsName }}
</view>
<!-- 商品金额 -->
<view class="-item-price" @click="handleNavgationGoods(item)">
佣金:
<span> {{ item.commission | unitPrice }}</span>
</view>
<!-- 比率佣金 -->
<view class="-item-bottom">
<view class="-item-bootom-money" @click="handleNavgationGoods(item)">
<!-- <view class="-item-bl">
比率:
<span>{{ "5.00%" }}</span>
</view> -->
<view class="-item-yj">
<span>{{ item.price | unitPrice }}</span>
</view>
</view>
<view>
<view class="click" v-if="!params.checked" @click="handleClickGoods(item)">立即选取</view>
<view class="click" v-if="params.checked" @click="handleLink(item)">分销商品</view>
</view>
</view>
</view>
</view>
<view class="empty">
<!-- <u-empty v-if="empty" text="没有分销商品了" mode="list"></u-empty> -->
</view>
</view>
<canvas class="canvas-hide" canvas-id="qrcode" />
<drawCanvas ref="drawCanvas" v-if="showFlag" :res="res" />
</view>
</template>
<script>
import {
distributionGoods,
checkedDistributionGoods,
getMpCode,
} from "@/api/goods";
import drawCanvas from "@/components/m-canvas";
export default {
data() {
return {
showFlag: false, //分销分享开关
empty: false,
popup: false, //弹出层开关
active_color: this.$mainColor,
current: 0,
params: {
pageNumber: 1,
pageSize: 10,
checked: true,
},
goodsList: [],
// 分销分享 实例
res: {
container: {
width: 600,
height: 960,
background: "#fff",
title: "分享背景",
},
// 分销分享
bottom: {
img: "",
code: "",
price: 0,
},
},
routers: "",
};
},
components: {
drawCanvas,
},
onLoad(options) {
this.routers = options;
},
watch: {
showFlag(val) {
console.log(val);
},
},
onShow() {
this.goodsList = [];
this.init();
},
methods: {
handleNavgationGoods(val) {
uni.navigateTo({
url: `/pages/product/goods?id=${val.skuId}&goodsId=${val.id}`,
});
},
async handleLink(goods) {
let page = `pages/product/goods`;
let scene = `${goods.skuId},${goods.id},${this.routers.id}`;
let result = await getMpCode({ page, scene });
if(result.data.success){
let callback = result.data.result;
this.res.container.title = `${goods.goodsName}`;
this.res.bottom.code = `data:image/png;base64,${callback}`;
this.res.bottom.price = this.$options.filters.unitPrice(goods.price, "¥");
this.res.bottom.desc = `${goods.goodsName}`;
this.res.bottom.img = `${goods.thumbnail}`;
if (this.showFlag) {
this.$refs.drawCanvas.init();
}
this.showFlag = true;
}
else{
uni.showToast({
title: `制作二维码失败!请稍后重试`,
duration: 2000,
icon:"none"
});
}
},
change(index) {
this.current = index;
},
// 点击我的选品库
handleMyGoods(flag) {
this.goodsList = [];
this.params.checked = flag;
this.init();
},
// 选择商品
handleClickGoods(val) {
uni.showLoading({
title: "加载中",
mask: true,
});
checkedDistributionGoods(val.id).then((res) => {
uni.hideLoading();
if (res.data.success) {
uni.showToast({
title: "已添加到我的选品库",
duration: 2000,
icon: "none",
});
setTimeout(() => {
this.goodsList = [];
this.init();
}, 500);
}
});
},
init() {
uni.showLoading({
title: "加载中",
});
distributionGoods(this.params).then((res) => {
uni.hideLoading();
if (res.data.success && res.data.result.records.length >= 1) {
this.goodsList.push(...res.data.result.records);
}
if (this.goodsList.length == 0) {
this.empty = true;
}
});
},
},
};
</script>
<style lang="scss" scoped>
.canvas-hide {
/* 1 */
position: fixed;
right: 100vw;
bottom: 100vh;
/* 2 */
z-index: -9999;
/* 3 */
opacity: 0;
}
.empty {
margin: 40rpx 0;
}
.checked {
color: $main-color;
font-weight: bold;
}
.screen-btn {
display: flex;
width: 100%;
height: 88rpx;
line-height: 88rpx;
position: fixed;
bottom: 0;
> .screen-clear,
.screen-submit {
width: 50%;
text-align: center;
}
.screen-submit {
background: $main-color;
color: #fff;
}
}
.screen-item {
margin-bottom: 40rpx;
}
.flex1 {
padding-left: 10rpx;
}
.u-tag {
margin-right: 20rpx;
}
.line {
width: 40rpx;
height: 2rpx;
background: #999;
margin: 0 10rpx;
}
.u-bg {
background: #eff1f4;
border-radius: 0.4em;
font-size: 22rpx;
}
.screen-title {
height: 88rpx;
text-align: center;
font-size: 28upz;
line-height: 88rpx;
border-bottom: 1px solid #ededed;
}
.flex {
display: flex;
margin: 20rpx 0;
align-items: center;
}
.screen-view {
padding: 32rpx;
}
.bar {
padding: 0 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
height: 88rpx;
width: 100%;
background: #fff;
z-index: 8;
> .bar-btn {
display: flex;
}
}
.nav {
background: #fff;
width: 100%;
display: flex;
height: 88rpx;
box-sizing: border-box;
border-top: 1px solid #ededed;
border-bottom: 1px solid #ededed;
> .nav-item {
line-height: 88rpx;
height: 88rpx;
flex: 1;
text-align: center;
}
}
.click {
background: $main-color;
color: #fff;
margin: 0 4rpx;
font-size: 22rpx;
padding: 10rpx 20rpx;
border-radius: 100px;
}
.goods-list {
// #ifdef H5
height: calc(100vh - 176rpx);
// #endif
// #ifndef H5
height: calc(100vh - 88rpx);
// #endif
overflow: auto;
}
.goods-item {
border-radius: 20rpx;
background: #fff;
display: flex;
padding: 22rpx;
margin: 20rpx;
justify-content: space-between;
> .goods-item-desc {
flex: 2;
padding: 0 16rpx;
line-height: 1.7;
> .-item-bottom {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20rpx;
> .-item-bootom-money {
> .-item-bl,
.-item-yj {
margin-right: 10rpx;
font-size: 24rpx;
color: $font-color-base;
}
}
}
> .-item-title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
> .-item-price {
color: $jd-color;
> span {
font-size: 36rpx;
}
}
}
}
.wrapper {
width: 100%;
}
</style>

View File

@@ -0,0 +1,129 @@
<template>
<view>
<view class="withdrawal-list">
<view class="title">提现金额</view>
<view class="content">
<view class="price">
<span> </span>
<u-input v-model="price" placeholder="" type="number" />
</view>
<view class="all">
<view @click="handleAll" :style="{ color: $mainColor }">全部</view>
<view style="font-size: 24rpx; color: #999"
>可提现金额<span>{{ distributionData.canRebate | unitPrice }}</span
></view
>
</view>
</view>
</view>
<view class="submit" @click="cashd">提现</view>
</view>
</template>
<script>
import { distribution, cash } from "@/api/goods";
export default {
data() {
return {
price: 0,
distributionData: "",
};
},
mounted() {
this.init();
},
methods: {
cashd() {
this.price = this.price + "";
console.log(typeof this.price);
if (this.$u.test.amount(parseInt(this.price))) {
cash({ price: this.price }).then((res) => {
if(res.data.success){
uni.showToast({
title: '提现成功!',
duration: 2000,
icon:"none"
});
setTimeout(()=>{
uni.navigateBack({
delta: 1
});
},1000)
}
});
} else {
uni.showToast({
title: "请输入正确金额",
duration: 2000,
icon: "none",
});
}
},
handleAll() {
this.price = this.distributionData.canRebate;
},
/**
* 初始化推广商品
*/
init() {
uni.showLoading({
title: "加载中",
});
distribution().then((res) => {
if (res.data.result) {
this.distributionData = res.data.result;
}
uni.hideLoading();
});
},
},
};
</script>
<style lang="scss" scoped>
/deep/ .u-input__input,
.u-input {
font-size: 80rpx !important;
height: 102rpx !important;
}
/deep/ .u-input__input{
height: 100%;
font-size: 80rpx;
}
.content {
display: flex;
> .price {
width: 60%;
margin: 20rpx 0;
font-size: 80rpx;
display: flex;
}
> .all {
justify-content: center;
width: 40%;
display: flex;
flex-direction: column;
align-items: flex-end;
}
}
.withdrawal-list {
margin: 20rpx 0;
background: #fff;
padding: 16rpx 32rpx;
}
.title {
font-size: 35rpx;
}
.submit {
margin: 80rpx auto;
width: 94%;
background: $light-color;
height: 90rpx;
color: #fff;
border-radius: 10rpx;
text-align: center;
line-height: 90rpx;
}
</style>