第一次提交

This commit is contained in:
wangxiaowei
2025-06-11 10:21:51 +08:00
commit 52932d54b1
2341 changed files with 185283 additions and 0 deletions

246
pages/agent/apply/apply.vue Normal file
View File

@ -0,0 +1,246 @@
<template>
<view class="apply-agent">
<view class="banner d-c-c d-c" v-if="top_background!=''">
<image :src="top_background" mode="aspectFill"></image>
</view>
<!--申请成功-->
<template v-if="!is_applying ">
<view class="form-wrap p30 f30">
<view class="p30 d-c-c gray3 f36 fb">
{{words.apply.words.title.value || ''}}
</view>
<form @submit="formSubmit" @reset="formReset">
<view class="form-item border-b">
<view class="field-name">邀请人</view>
{{referee_name || ''}}
</view>
<view class="form-item border-b">
<view class="field-name">姓名</view>
<input class="flex-1 ml20" name="name" type="text" value="" placeholder-class="grary"
placeholder="请输入姓名" />
</view>
<view class="form-item border-b">
<view class="field-name">手机号</view>
<input class="flex-1 ml20" name="mobile" type="number" value="" placeholder-class="grary"
placeholder="请输入手机" />
</view>
<view class="d-s-c p-20-0 f24">
<checkbox-group @change="changeFunc">
<checkbox style="transform:scale(0.7)" value="checkbox" :checked="is_read" />
</checkbox-group>
<text>我已阅读并了解</text>
<text class="red" @click="isPopup=true">
{{ words.apply.words.license.value || '' }}
</text>
</view>
<view class="d-c-c mt30">
<button class="btn-red" form-type="submit">{{ words.apply.words.submit.value || '' }}</button>
</view>
</form>
</view>
</template>
<!--分销商审核中-->
<template v-if="is_applying">
<view class="d-c-c pt30">
<image style="width: 532rpx;height: 340rpx;margin: 0 auto;" src="/static/agen_applay.png" mode=""></image>
</view>
<view class="p-30-0 d-c-c gray9 f26">
{{ words.apply.words.wait_audit.value || '' }}
</view>
<view class="p30 mt30 d-c-c">
<button type="primary" class="btn-red"
@click="gotoShop">{{ words.apply.words.goto_mall.value || '' }}</button>
</view>
</template>
<!--协议-->
<Popup :show="isPopup" msg="申请协议">
<view class="agreement-content f28 lh150">
{{agreement}}
</view>
<view class="ww100 pt20 d-c-c">
<button type="primary" class="btn-red" @click="isPopup=false">我已阅读</button>
</view>
</Popup>
</view>
</template>
<script>
import Popup from '@/components/uni-popup.vue'
export default {
components: {
Popup
},
data() {
return {
/*弹窗是否打开*/
isPopup: false,
/*是否阅读了规则*/
is_read: false,
agreement: '',
is_applying: false,
referee_name: '',
words: {},
is_agent: '',
/*顶部背景*/
top_background: '',
/*小程序订阅消息*/
temlIds: [],
}
},
mounted() {
/*数据*/
this.getData();
},
methods: {
/*获取数据*/
getData() {
let self = this;
uni.showLoading({
title: '加载中'
})
self._get('user.agent/apply', {
platform: self.getPlatform(),
referee_id: uni.getStorageSync('referee_id')
}, function(res) {
uni.hideLoading();
self.top_background = res.data.background;
self.is_applying = res.data.is_applying;
self.referee_name = res.data.referee_name != null ? res.data.referee_name : '平台';
self.is_agent = res.data.is_agent;
self.words = res.data.words;
self.temlIds = res.data.template_arr;
self.agreement = res.data.license;
/*设置标题*/
uni.setNavigationBarTitle({
title: self.words.apply.title.value
});
if (self.is_agent) {
uni.navigateBack({});
}
});
},
/*申请*/
formSubmit: function(e) {
let formdata = e.detail.value;
formdata.referee_id = uni.getStorageSync('referee_id');
let self = this;
if (formdata.name == '') {
uni.showToast({
title: '请输入姓名!',
icon: 'none'
});
return;
}
if (formdata.mobile.length == '') {
uni.showToast({
title: '请输入手机号!',
icon: 'none'
});
return;
}
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(formdata.mobile)) {
uni.showToast({
title: '手机有误,请重填!',
icon: 'none'
});
return;
}
if (!self.is_read) {
uni.showToast({
title: '请同意协议!',
icon: 'none'
});
return;
}
let callback = function() {
uni.showLoading({
title: '正在提交',
mask: true
})
self._post('plus.agent.apply/submit', formdata, function(res) {
uni.hideLoading();
uni.showToast({
title: '申请成功'
});
self.getData();
});
};
self.subMessage(self.temlIds, callback);
},
/*去商城看看*/
gotoShop() {
uni.switchTab({
url: '/pages/index/index'
})
},
/*同意协议*/
changeFunc(e) {
if (e.target.value.length > 0) {
this.is_read = true;
} else {
this.is_read = false;
}
}
}
}
</script>
<style>
page{
background-color: #FFFFFF;
}
.apply-agent .banner {
background-repeat: no-repeat;
background-size: 100%;
}
.apply-agent .banner image {
width: 750rpx;
height: 348rpx;
}
.form-wrap {
background: #FFFFFF;
box-shadow: 0 0 8rpx 0 rgba(0, 0, 0, .2);
}
.form-item {
padding: 20rpx 0;
/* margin-bottom: 20rpx; */
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 28rpx;
height: 100rpx;
box-sizing: border-box;
}
.form-item .field-name {
width: 180rpx;
}
.form-item input {
font-size: 28rpx;
}
.agreement-content {
max-height: 60vh;
overflow-y: auto;
}
.apply-agent .btn-red {
width: 600rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
background: #FF5649;
border-color: #FF5649;
}
</style>

View File

@ -0,0 +1,301 @@
<template>
<view class="apply-cash" v-if="!loadding">
<!--申请成功-->
<view class="form-wrap f30">
<form @submit="formSubmit" @reset="formReset">
<view class="p-0-20 pt30 txje">
{{ words.cash_apply.words.money.value }}<text class="f26 gray9 ml30">{{ words.cash_apply.words.min_money.value+agent.settlement.min_money+'元' }}</text>
</view>
<view class="p-0-20 ">
<view class="withd-bc">
<view class="withd-bct">
<view style="height: 100%;display: flex;align-items: center;">
<text style="font-size: 48rpx;"></text>
<input class="tx-inpt" name="money" v-model="money" type="number" />
</view>
</view>
<view class="withd-bcb">
{{ words.cash_apply.words.capital.value }}{{agent.agent.money}},<text @click="getAll" style="color: #0479FF;">全部提现</text>
</view>
</view>
</view>
<view class="p20 f32 gray3 txbt">提现方式</view>
<view class="form-item p20">
<view class="ww100">
<template v-if="hasType('10')">
<view class="p-30-0 border-b">
<view class="d-b-c" :class="withdraw_type==10?'active':''" @click="TabType(10)">
<view class="d-s-c flex-1">
<image style="width: 28rpx;height: 28rpx;margin-right: 22rpx;" src="/static/wx.png" mode=""></image>
<text class="f26 gray3">微信支付</text>
</view>
<text class="icon iconfont icon-xuanze"></text>
</view>
</view>
</template>
<template v-if="hasType('20')">
<view class="p-30-0 border-b">
<view class="d-b-c" :class="withdraw_type==20?'active':''" @click="TabType(20)">
<view class="d-s-c flex-1">
<image style="width: 28rpx;height: 28rpx;margin-right: 22rpx;" src="/static/zfb.png" mode=""></image>
<text class="f26 gray3">支付宝</text>
</view>
<text class="icon iconfont icon-xuanze"></text>
</view>
<template v-if="withdraw_type==20">
<view class="mt20">
<input class="p20 border-tb" name="alipay_name" type="text" value="" placeholder-class="grary" placeholder="请输入姓名" />
</view>
<view class="mt20">
<input class="p20 border-tb" name="alipay_account" type="text" value="" placeholder-class="grary" placeholder="请输入支付宝账号" />
</view>
</template>
</view>
</template>
<template v-if="hasType('30')">
<view class="p-30-0 border-b">
<view class="d-b-c" :class="withdraw_type==30?'active':''" @click="TabType(30)">
<view class="d-s-c flex-1">
<image style="width: 28rpx;height: 22rpx;margin-right: 22rpx;" src="/static/yinxingqia.png" mode=""></image>
<text class="f26 gray3">银行卡</text>
</view>
<text class="icon iconfont icon-xuanze"></text>
</view>
<template v-if="withdraw_type==30">
<view class="mt20">
<input class="p20 border-tb" name="bank_account" type="text" value="" placeholder-class="grary" placeholder="请输入姓名" />
</view>
<view class="mt20">
<input class="p20 border-tb" name="bank_name" type="text" value="" placeholder-class="grary" placeholder="请输入开户行名称/地址" />
</view>
<view class="mt20">
<input class="p20 border-tb" name="bank_card" type="text" value="" placeholder-class="grary" placeholder="请输入银行卡号" />
</view>
</template>
</view>
</template>
</view>
</view>
<view class="d-c-c mt60" style="border: 16rpx solid #F2F2F2">
<button type="primary" class="btn-red flex-1" form-type="submit">{{ words.cash_apply.words.submit.value }}</button>
</view>
</form>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
loadding: true,
/*是否加载完成*/
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500,
/*支付类别*/
withdraw_type: 10,
isData: false,
agent: {},
payType: [],
words: {},
/*小程序订阅消息*/
temlIds: [],
money: ''
}
},
mounted() {
/*获取数据*/
this.getData();
},
methods: {
/*获取数据*/
getData() {
let self = this;
uni.showLoading({
title: '加载中'
});
self.loadding = true;
self._get('user.agent/cash', {
platform: self.getPlatform()
}, function(res) {
self.agent = res.data;
self.words = res.data.words;
self.payType = self.agent.settlement.pay_type;
self.agent.isData = true;
self.temlIds = res.data.template_arr;
self.loadding = false;
uni.hideLoading();
});
},
/*切换提现方式*/
TabType(e) {
this.withdraw_type = e;
},
/*判断是否存在*/
hasType(e) {
if (this.payType.indexOf(e) != -1) {
return true;
} else {
return false;
}
},
getAll() {
this.money = this.agent.agent.money;
},
/*申请*/
formSubmit: function(e) {
let self = this;
var formdata = e.detail.value;
formdata.pay_type = self.withdraw_type;
var data = JSON.stringify(formdata);
let callback = function() {
uni.showLoading({
title: '正在提交',
mask: true
})
self._post('plus.agent.cash/submit', {
data: data
}, function(data) {
uni.hideLoading();
uni.showToast({
title: '申请成功',
duration: 2000,
icon: 'success'
});
uni.navigateBack(-1);
});
}
self.subMessage(self.temlIds, callback);
},
}
}
</script>
<style>
page {
background-color: #F2F2F2;
}
.txje {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 16rpx;
}
.apply-cash {
/* padding-top: 16rpx; */
}
.form-wrap {
/* border-radius: 20rpx; */
background: #FFFFFF;
/* box-shadow: 0 0 16rpx 0 rgba(0, 0, 0, .2); */
}
.form-item {
margin-bottom: 20rpx;
display: flex;
justify-content: flex-start;
align-items: center;
font-size: 28rpx;
}
.form-item .field-name {
width: 140rpx;
}
.form-item input {
font-size: 28rpx;
}
.txbt {
border-top: 16rpx solid #F2F2F2;
}
.form-item .text-price {
padding: 0 10rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
border: 1px solid #CCCCCC;
}
.agreement-content {
max-height: 60vh;
overflow-y: auto;
}
.iconfont.icon-xuanze {
font-size: 30rpx;
}
.form-item .active .iconfont.icon-xuanze {
color: #FF5649;
}
.apply-cash .btn-red {
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
background: #FF5649;
border-color: #FF5649;
border: none;
font-size: 32rpx;
}
.withd-b {
background-color: #FFFFFF;
margin-bottom: 97rpx;
}
.withd-bct {
height: 92rpx;
padding-top: 59rpx;
padding-right: 49rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1rpx solid #d0d0d0;
}
.tx-inpt {
background-color: #FFFFFF;
font-size: 48rpx;
line-height: 92rpx;
}
.withd-bcb {
font-size: 26rpx;
color: #999999;
padding: 27rpx 0 49rpx 0;
}
.withdrawal-btn {
margin: 0 30rpx;
background-color: #f36a24;
height: 60rpx;
line-height: 60rpx;
color: #FFFFFF;
text-align: center;
border-radius: 30rpx;
padding: 0;
font-size: 24rpx;
}
.border-tb{
border: none;
border-top: 1rpx solid #eeeeee;
border-bottom: 1rpx solid #eeeeee;
}
</style>

View File

@ -0,0 +1,198 @@
<template>
<view>
<!--切换-->
<view class="top-tabbar">
<view :class="state_active == item.value? 'tab-item active' : 'tab-item'" @click="stateFunc(item.value)"
v-for="(item,index) in tableList" :key="index">{{item.text}}</view>
</view>
<!--列表-->
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
@scrolltoupper="scrolltoupperFunc" @scrolltolower="scrolltolowerFunc">
<view class="p-0-30 bg-white mt20">
<view class="d-b-c border-b p-20-0" v-for="(item,index) in tableData" :key="index">
<view class="d-s-s f-w d-c flex-1 ">
<text class="f28 mb16">提现</text>
<text class="gray9 f22">{{item.create_time}}</text>
</view>
<view>
<view class="tr" :class="item.apply_status.text=='审核通过'?'green':'gray9'">
{{ item.apply_status.text }}
</view>
<view class="red ml20">¥{{ item.money }}</view>
</view>
</view>
<!--<view class="">
<view class="bottom-refresh">
<view class="d-c-c p30" v-if="tableData.length && no_more">
<text class="gray3">亲, 没有更多了</text>
</view>
<view v-if="loading" class="d-c-c p30">
<text class="gray3">加载中...</text>
</view>
</view>
</view>-->
<!-- 没有记录 -->
<view class="d-c-c p30" v-if="tableData.length==0 && !loading">
<text class="iconfont icon-wushuju"></text>
<text class="cont">亲,暂无相关记录哦</text>
</view>
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
</view>
</scroll-view>
</view>
</template>
<script>
import uniLoadMore from "@/components/uni-load-more.vue";
export default {
components: {
uniLoadMore
},
data() {
return {
/*手机高度*/
phoneHeight: 0,
/*可滚动视图区域高度*/
scrollviewHigh: 0,
/*状态选中*/
state_active: -1,
/*数据列表*/
tableData: [],
no_more: false,
loading: true,
/*最后一页码数*/
last_page: 0,
/*当前页面*/
page: 1,
/*每页条数*/
list_rows: 20,
tableList: [],
}
},
computed: {
/*加载中状态*/
loadingType() {
if (this.loading) {
return 1;
} else {
if (this.tableData.length != 0 && this.no_more) {
return 2;
} else {
return 0;
}
}
}
},
mounted() {
/*初始化*/
this.init();
/*获取数据*/
this.getData();
},
methods: {
/*初始化*/
init() {
let self = this;
uni.getSystemInfo({
success(res) {
self.phoneHeight = res.windowHeight;
// 计算组件的高度
let view = uni.createSelectorQuery().select('.top-tabbar');
view.boundingClientRect(data => {
let h = self.phoneHeight - data.height;
self.scrollviewHigh = h;
}).exec();
}
});
},
/*获取数据*/
getData() {
let self = this;
let page = self.page;
self.loading = true;
let list_rows = self.list_rows;
self._get('plus.agent.cash/lists', {
status: self.state_active,
page: page || 1,
list_rows: list_rows,
}, function(data) {
self.loading = false;
// 导航栏数据
self.tableList = [{
value: -1,
text: data.data.words.cash_list.words.all.value,
}, {
value: 10,
text: data.data.words.cash_list.words.apply_10.value,
}, {
value: 20,
text: data.data.words.cash_list.words.apply_20.value,
},
{
value: 40,
text: data.data.words.cash_list.words.apply_40.value,
},
{
value: 30,
text: data.data.words.cash_list.words.apply_30.value,
}
];
self.tableData = self.tableData.concat(data.data.list.data);
self.last_page = data.data.list.last_page;
if (data.data.list.last_page <= 1) {
self.no_more = true;
return false;
}
});
},
/*切换*/
stateFunc(e) {
let self = this;
if (e != self.state_active) {
self.tableData = [];
self.page = 1;
self.state_active = e;
self.getData();
}
},
/*可滚动视图区域到顶触发*/
scrolltoupperFunc() {
console.log('滚动视图区域到顶');
},
/*可滚动视图区域到底触发*/
scrolltolowerFunc() {
let self = this;
if (self.page < self.last_page) {
self.page++;
self.getData();
}
self.no_more = true;
}
}
}
</script>
<style lang="scss">
.tab-item {
font-size: 28rpx;
}
.tab-item.active {
font-weight: normal;
font-size: 28rpx;
}
.tab-item.active::after {
width: 57rpx;
height: 6rpx;
background-color: #ff5649;
}
</style>

288
pages/agent/index/index.vue Normal file
View File

@ -0,0 +1,288 @@
<template>
<view class="index-agent o-h" v-if="!loadding" :data-theme='theme()' :class="theme() || ''">
<!--头部图片-->
<view class="banner d-c-c d-c">
<image :src="top_background" mode="aspectFill"></image>
</view>
<!--是分销商-->
<template v-if="is_agent && isData">
<view class="info-top d-s-c">
<view class="info-ava">
<image class="info-avatar" :src="user.avatarUrl" mode="aspectFill"></image>
<view class="info-grade" v-if="agent.grade_id > 0">{{agent.grade.name}}</view>
</view>
<view class="white d-c d-c-s flex-1 pr">
<view class="mb20 f30 fb">{{ user.nickName}}</view>
<view class="f22">{{info_words.index.words.referee.value || ''}}:{{agent.referee ? agent.referee.nickName : '平台' }}</view>
</view>
</view>
<!--金额信息-->
<view class="agent-wrap pr m-0-20">
<view class="d-s-c p-30-0 top_dash">
<view class="flex-1 d-c-c d-c">
<view class="redF6">
<text class="f36 fb">{{ agent.money }}</text>
</view>
<view class="pt20 f24 gray6">{{ info_words.index.words.money.value }}</view>
</view>
<view class="flex-1 d-c-c d-c">
<view class="">
<text class="f36 fb">{{ agent.freeze_money }}</text>
</view>
<view class="pt20 f24 gray6">{{ info_words.index.words.freeze_money.value }}</view>
</view>
<view class="flex-1 d-c-c d-c">
<view class="">
<text class="f36 fb">{{ agent.total_money }}</text>
</view>
<view class="pt20 f24 gray6">{{ info_words.index.words.total_money.value }}</view>
</view>
</view>
<view class="d-c-c pt30">
<button type="primary" class="btn-gcred flex-1"
@click="gotoCash">{{ info_words.index.words.cash.value }}</button>
</view>
</view>
<!--图标入口-->
<view class="agent-wrap m-0-20 p30 d-s-c f-w mt20 bg-white">
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/cash/list/list')">
<view>
<image class="agent_index_img" src="../../../static/icon/icon-zijinmingxi.png" mode=""></image>
</view>
<text class="f24 gray6 mt20">{{ info_words.cash_list.title.value }}</text>
</view>
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/order/order')">
<view>
<image class="agent_index_img" src="../../../static/icon/icon-fenxiaodingdan.png" mode="">
</image>
</view>
<text class="f24 gray6 mt20">{{ info_words.order.title.value }}</text>
</view>
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/team/team')">
<view>
<image class="agent_index_img" src="../../../static/icon/icon-tuandui.png" mode=""></image>
</view>
<text class="f24 gray6 mt20">{{ info_words.team.title.value }}</text>
</view>
<view class="d-c-c d-c flex-1" @click="gotoPage('/pages/agent/qrcode/qrcode')">
<view>
<image class="agent_index_img" src="../../../static/icon/icon-erweima.png" mode=""></image>
</view>
<text class="f24 gray6 mt20">{{ info_words.qrcode.title.value }}</text>
</view>
</view>
</template>
<!--不是分销商-->
<template v-if="!is_agent && isData">
<view class="no-agent" style="margin-top: 348rpx;">
<image class="no-agent-image" src="/static/agent_no.png" mode=""></image>
<view class="mt50 p-0-20 gray9 f30 tc">{{ info_words.index.words.not_agent.value }}</view>
<view class="p30 mt30">
<button type="primary" class="btn-gcred "
@click="applyagent">{{ info_words.index.words.apply_now.value }}</button>
</view>
</view>
</template>
</view>
</template>
<script>
export default {
data() {
return {
/*是否加载完成*/
loadding: true,
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500,
/*0不是分销商1分销商申请中2已经是分销商*/
is_agent: false,
isData: false,
agent: {},
/*顶部背景*/
top_background: '',
/*基本信息*/
info_words: {},
words: {},
user: {},
titel: ''
};
},
onLoad(e) {
if (e.is_agent) {
this.is_agent = e.is_agent;
}
},
onShow() {
uni.showLoading({
title: '加载中'
});
/*获取个人中心数据*/
this.getData();
},
methods: {
/*获取数据*/
getData() {
let self = this;
self._get('user.agent/center', {}, function(data) {
self.info_words = data.data.words;
self.titel = data.data.words.index.title.value;
uni.setNavigationBarTitle({
title: self.titel
});
self.is_agent = data.data.is_agent;
self.top_background = data.data.background;
self.agent = data.data.agent;
self.user = data.data.user;
self.isData = true;
self.loadding = false;
uni.hideLoading();
});
},
/*申请分销商*/
applyagent() {
this.gotoPage('/pages/agent/apply/apply');
},
/*去商城逛逛*/
gotoShop() {
this.gotoPage('/pages/index/index')
},
/*去提现*/
gotoCash() {
this.gotoPage('/pages/agent/cash/apply/apply');
},
goback() {
uni.navigateBack();
}
}
};
</script>
<style lang="scss">
page {
background-color: #f9f9f9;
}
.index-agent .banner {
position: absolute;
width: 750rpx;
height: 348rpx;
z-index: 0;
/* padding-bottom: 60rpx; */
background-repeat: no-repeat;
background-size: 100%;
}
.index-agent .banner image {
width: 100%;
}
.no-agent {
// padding-top: 190rpx;
}
.no-agent-image {
padding-top: 20rpx;
margin: 0 auto;
}
.no-agent-image image {
width: 532rpx;
height: 340rpx;
}
.agent-wrap {
background: #FFFFFF;
background-size: 100% 100%;
padding: 31rpx 25rpx 36rpx 25rpx;
box-shadow: 0px 8rpx 3rpx 0px rgba(6,0,1,0.03);
border-radius: 20rpx;
}
.index-agent .agent-wrap .iconfont {
font-size: 60rpx;
}
.index-agent .btn-gcred {
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
background: #FF5649;
border-color: #FF5649;
}
.reg180 {
padding-right: 20rpx;
text-align: right;
transform: rotateY(180deg);
position: absolute;
bottom: 0;
}
.icon-jiantou {
color: #FFFFFF;
font-size: 30rpx;
}
.head_top {
position: absolute;
width: 100%;
height: 30px;
line-height: 30px;
color: #FFFFFF;
font-size: 32rpx;
z-index: 2;
}
.top_dash {
padding-bottom: 9px;
}
.agent_index_img {
width: 78rpx;
height: 78rpx;
}
.info-top{
padding: 74rpx 0 63rpx 44rpx;
}
.info-ava {
width: 108rpx;
height: 108rpx;
border-radius: 50%;
position: relative;
margin-right: 30rpx;
}
.info-avatar {
width: 108rpx;
height: 108rpx;
border-radius: 50%;
}
.info-grade {
min-width: 114rpx;
height: 30rpx;
line-height: 30rpx;
padding: 0 22rpx;
box-sizing: border-box;
font-size: 18rpx;
color: #ffffff;
background: #FFC519;
box-shadow: 0px 3rpx 7rpx 0px rgba(0, 0, 0, 0.15);
border-radius: 15rpx;
text-align: center;
white-space: nowrap;
position: absolute;
left: 0;
right: 0;
bottom: -16rpx;
z-index: 2;
}
</style>

203
pages/agent/order/order.vue Normal file
View File

@ -0,0 +1,203 @@
<template>
<view >
<view class="top-tabbar">
<view :class="state_active == item.value? 'tab-item active' : 'tab-item'" @click="stateFunc(item.value)" v-for="(item,index) in tableList"
:key="index">{{item.text}}</view>
</view>
<!--列表-->
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
@scrolltolower="scrolltolowerFunc">
<view class=" ">
<view class="border-b p-0-30 bg-white pt10 mt20" v-for="(item,index) in tableData" :key="index">
<view class="d-b-c f24 item-top">
<text>订单号{{ item.order_master.order_no }}</text>
<text class="blue" v-if="item.is_settled==1"> 已结算</text>
<text class="green" v-else>未结算</text>
</view>
<view class="d-b-c item-center">
<view class="agent-order-photo">
<image :src="item.user.avatarUrl" mode="aspectFill"></image>
</view>
<view class="flex-1 ml20 f24">
<view class="d-b-c">
<text class="gray3 f28">{{ item.user.nickName }}</text>
<text class="gray3 f28" v-if="item.first_user_id == user_id ">+¥{{ item.first_money }}</text>
<text class="gray3 f28" v-if="item.second_user_id == user_id ">+¥{{ item.second_money }}</text>
<text class="gray3 f28" v-if="item.third_user_id == user_id ">+¥{{ item.third_money }}</text>
</view>
<view class="d-b-c">
<text class="gray9 f22">消费金额:¥{{ item.order_price }}</text>
</view>
</view>
</view>
<view class="item-bottom">
<text class="gray9">{{item.create_time}}</text>
</view>
</view>
<!-- 没有记录 -->
<view class="d-c-c p30" v-if="tableData.length==0 && !loading">
<text class="iconfont icon-wushuju"></text>
<text class="cont">亲,暂无相关记录哦</text>
</view>
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
</view>
</scroll-view>
</view>
</template>
<script>
import uniLoadMore from "@/components/uni-load-more.vue";
export default {
components: {
uniLoadMore
},
data() {
return {
/*手机高度*/
phoneHeight: 0,
/*可滚动视图区域高度*/
scrollviewHigh: 0,
/*状态选中*/
state_active: -1,
/*数据列表*/
tableData: [],
settled: -1,
page: 1,
no_more: false,
loading: true,
tableList: [],
list_rows: 15,
user_id: 0
}
},
computed: {
/*加载中状态*/
loadingType() {
if (this.loading) {
return 1;
} else {
if (this.tableData.length != 0 && this.no_more) {
return 2;
} else {
return 0;
}
}
}
},
mounted() {
/*初始化*/
this.init();
this.user_id = this.getUserId();
/*获取数据*/
this.getData();
},
methods: {
/*初始化*/
init() {
let self = this;
uni.getSystemInfo({
success(res) {
self.phoneHeight = res.windowHeight;
// 计算组件的高度
let view = uni.createSelectorQuery().select('.top-tabbar');
view.boundingClientRect(data => {
let h = self.phoneHeight - data.height;
self.scrollviewHigh = h;
}).exec();
}
});
},
/*获取数据*/
getData() {
let self = this;
self.loading = true;
self._get('plus.agent.order/lists', {
settled: self.state_active,
page: self.page || 1,
list_rows: self.list_rows,
}, function(data) {
self.loading = false;
// 导航栏数据
self.tableList = [{
value: -1,
text: data.data.words.order.words.all.value,
}, {
value: 0,
text: data.data.words.order.words.unsettled.value,
}, {
value: 1,
text: data.data.words.order.words.settled.value,
}];
self.tableData = self.tableData.concat(data.data.list.data);
self.last_page = data.data.list.last_page;
if (self.last_page <= 1) {
self.no_more = true;
}
});
},
/*切换*/
stateFunc(e) {
let self = this;
if(e!=self.state_active){
self.tableData = [];
self.page = 1;
self.state_active = e;
self.getData();
}
},
/*可滚动视图区域到底触发*/
scrolltolowerFunc() {
let self = this;
if (self.no_more) {
return;
}
self.page++;
if (self.page <= self.last_page) {
self.getData();
} else {
self.no_more = true;
}
}
}
}
</script>
<style lang="scss">
.agent-order-photo,
.agent-order-photo image {
width: 96rpx;
height: 96rpx;
border-radius: 50%;
}
.tab-item{
font-size: 28rpx;
}
.tab-item.active{
font-weight: normal;
font-size: 28rpx;
}
.tab-item.active::after{
width: 57rpx;
height: 6rpx;
background-color: #ff5649;
}
.item-top{
height: 54rpx;
line-height: 54rpx;
border-bottom: 1rpx solid #eeeeee;
color: #999999;
}
.item-bottom{
height: 73rpx;
line-height: 73rpx;
border-top: 1rpx solid #eeeeee;
}
.item-center{
height: 122rpx;
}
</style>

View File

@ -0,0 +1,112 @@
<template>
<view class="qrcode">
<image :src="qrcode_url" mode="widthFix"></image>
<view class="btns-wrap">
<!-- #ifdef MP || APP-PLUS -->
<button class="btn-red" type="default" @click="savePosterImg">保存图片</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="f34 tc ww100" type="default">长按保存图片</view>
<!-- #endif -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
qrcode_url: ''
}
},
mounted() {
/*获取数据*/
this.getData();
},
methods: {
/*获取数据*/
getData() {
let self = this;
uni.showLoading({
title: '加载中',
});
let source = self.getPlatform();
self._get('plus.agent.qrcode/poster', {
source: source
}, function(data) {
uni.hideLoading();
self.qrcode_url = data.data.qrcode;
});
},
/*保存图片*/
savePosterImg() {
let self = this;
uni.showLoading({
title: '加载中'
});
// 下载海报图片
uni.downloadFile({
url: self.qrcode_url,
success(res) {
uni.hideLoading();
// 图片保存到本地
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success(data) {
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
});
// 关闭商品海报
self.isCreatedImg = false;
},
fail(err) {
console.log(err.errMsg);
if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
uni.showToast({
title: '请允许访问相册后重试',
icon: 'none',
duration: 1000
});
setTimeout(() => {
uni.openSetting();
}, 1000);
}
},
complete(res) {
console.log('complete');
}
});
}
});
}
}
}
</script>
<style>
.qrcode{
}
.qrcode image {
width: 100%;
}
.btns-wrap {
position: fixed;
height: 88rpx;
right: 0;
bottom: 0;
left: 0;
display: flex;
z-index: 10;
}
.btns-wrap .btn-red{
width: 100%;
height: 88rpx;
line-height: 88rpx;
border-radius: 0;
}
</style>

219
pages/agent/team/team.vue Normal file
View File

@ -0,0 +1,219 @@
<template>
<view>
<view class="top-container">
<view class="top-tabbar">
<view v-for="(item,index) in tabList" :key="index"
:class="state_active == index ? 'tab-item active' : 'tab-item'" @click="stateFunc(index)">
{{item.text}}( {{item.total}})
</view>
</view>
<view class="total p-0-30 d-c-c f24">
团队总人数:
<text class="">{{teamTotal}}</text>
</view>
</view>
<!--列表-->
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
@scrolltolower="scrolltolowerFunc">
<view class="p-0-30 bg-white">
<view class="border-b p-20-0" v-for="(item,index) in tableData" :key="index">
<view class="d-b-c">
<view class="agent-team-photo">
<image :src="item.user.avatarUrl" mode="aspectFill"></image>
</view>
<view class="flex-1 ml20 f24">
<view class="d-b-c mb16">
<text class="f28 gray3">{{ item.user.nickName }}</text>
<view class="">
<text class="gray9">销售业绩:</text>
<text class="gray3">¥{{ item.user.expend_money }}</text>
</view>
</view>
<view class="d-b-c">
<text class="gray9">加入时间:{{ item.create_time }}</text>
<text class="gray9" v-if="item.agent">
{{ item.agent.first_num + item.agent.second_num + item.agent.third_num }}个成员</text>
</view>
</view>
</view>
</view>
<!-- 没有记录 -->
<view class="d-c-c p30" v-if="tableData.length==0 && !loading">
<text class="iconfont icon-wushuju"></text>
<text class="cont">亲,暂无相关记录哦</text>
</view>
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
</view>
</scroll-view>
</view>
</template>
<script>
import uniLoadMore from "@/components/uni-load-more.vue";
export default {
components: {
uniLoadMore
},
data() {
return {
/*手机高度*/
phoneHeight: 0,
/*可滚动视图区域高度*/
scrollviewHigh: 0,
/*状态选中*/
state_active: 0,
/*数据列表*/
tableData: [],
setting: [],
teamTotal: 0,
page: 1,
no_more: false,
tabList: [],
list_rows: 15,
loading: true,
}
},
computed: {
/*加载中状态*/
loadingType() {
if (this.loading) {
return 1;
} else {
if (this.tableData.length != 0 && this.no_more) {
return 2;
} else {
return 0;
}
}
}
},
mounted() {
/*初始化*/
this.init();
/*获取数据*/
this.getData();
},
methods: {
/*初始化*/
init() {
let self = this;
uni.getSystemInfo({
success(res) {
self.phoneHeight = res.windowHeight;
// 计算组件的高度
let view = uni.createSelectorQuery().select('.top-container');
view.boundingClientRect(data => {
let h = self.phoneHeight - data.height;
self.scrollviewHigh = h;
}).exec();
}
});
},
/*获取数据*/
getData() {
let self = this;
self.loading = true;
self._get('plus.agent.team/lists', {
level: self.state_active + 1,
page: self.page || 1,
list_rows: self.list_rows,
}, function(res) {
self.loading = false;
self.teamTotal = res.data.agent.first_num;
let data = res.data;
// 导航栏数据
self.tabList = [{
value: 1,
text: data.words.team.words.first.value,
total: data.agent.first_num
}];
if (data.setting.level >= 2) {
self.tabList.push({
value: 2,
text: data.words.team.words.second.value,
total: data.agent.second_num
});
self.teamTotal += data.agent.second_num;
}
if (data.setting.level == 3) {
self.tabList.push({
value: 3,
text: data.words.team.words.third.value,
total: data.agent.third_num
});
self.teamTotal += data.agent.third_num;
}
self.tableData = self.tableData.concat(data.list.data);
self.last_page = data.list.last_page;
if (self.last_page <= 1) {
self.no_more = true;
}
}, null, function() {
self.loading = false;
});
},
/*切换类别*/
stateFunc(e) {
let self = this;
if (e != self.state_active) {
self.tableData = [];
self.page = 1;
self.state_active = e;
self.getData();
}
},
/*可滚动视图区域到底触发*/
scrolltolowerFunc() {
let self = this;
if (self.no_more) {
return;
}
self.page++;
if (self.page <= self.last_page) {
self.getData();
} else {
self.no_more = true;
}
}
}
}
</script>
<style lang="scss">
.top-container .total {
height: 80rpx;
background-color: #fae1df;
color: #ff5649;
text-align: center;
}
.agent-team-photo,
.agent-team-photo image {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.tab-item {
font-size: 28rpx;
}
.tab-item.active {
font-weight: normal;
font-size: 28rpx;
}
.tab-item.active::after {
width: 57rpx;
height: 6rpx;
background-color: #ff5649;
}
</style>