分销-砍价
parent
d6cf64be1e
commit
ab77874aa5
89
pages.json
89
pages.json
|
@ -6,8 +6,7 @@
|
||||||
"^su-(.*)": "@/sheep/ui/su-$1/su-$1.vue"
|
"^su-(.*)": "@/sheep/ui/su-$1/su-$1.vue"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"aliasPath": "/",
|
"aliasPath": "/",
|
||||||
"style": {
|
"style": {
|
||||||
|
@ -85,11 +84,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [{
|
||||||
{
|
|
||||||
"root": "pages/goods",
|
"root": "pages/goods",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "商品详情"
|
"navigationBarTitleText": "商品详情"
|
||||||
|
@ -153,8 +150,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/order",
|
"root": "pages/order",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "detail",
|
"path": "detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "订单详情"
|
"navigationBarTitleText": "订单详情"
|
||||||
|
@ -243,8 +239,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/user",
|
"root": "pages/user",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "info",
|
"path": "info",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的信息"
|
"navigationBarTitleText": "我的信息"
|
||||||
|
@ -342,8 +337,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/commission",
|
"root": "pages/commission",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分销"
|
"navigationBarTitleText": "分销"
|
||||||
|
@ -414,13 +408,34 @@
|
||||||
"title": "我的团队",
|
"title": "我的团队",
|
||||||
"group": "分销商城"
|
"group": "分销商城"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "promoter",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "推广人排行榜"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"auth": true,
|
||||||
|
"sync": true,
|
||||||
|
"title": "推广人排行榜",
|
||||||
|
"group": "分销商城"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "commission-ranking",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "佣金排行榜"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"auth": true,
|
||||||
|
"sync": true,
|
||||||
|
"title": "佣金排行榜",
|
||||||
|
"group": "分销商城"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/app",
|
"root": "pages/app",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "sign",
|
"path": "sign",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "签到中心"
|
"navigationBarTitleText": "签到中心"
|
||||||
|
@ -431,13 +446,11 @@
|
||||||
"title": "签到中心",
|
"title": "签到中心",
|
||||||
"group": "应用"
|
"group": "应用"
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/public",
|
"root": "pages/public",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "setting",
|
"path": "setting",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "系统设置"
|
"navigationBarTitleText": "系统设置"
|
||||||
|
@ -486,8 +499,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/coupon",
|
"root": "pages/coupon",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "list",
|
"path": "list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "领券中心"
|
"navigationBarTitleText": "领券中心"
|
||||||
|
@ -514,8 +526,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/chat",
|
"root": "pages/chat",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "客服"
|
"navigationBarTitleText": "客服"
|
||||||
|
@ -526,13 +537,11 @@
|
||||||
"title": "客服",
|
"title": "客服",
|
||||||
"group": "客服"
|
"group": "客服"
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/pay",
|
"root": "pages/pay",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "收银台"
|
"navigationBarTitleText": "收银台"
|
||||||
|
@ -596,8 +605,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"root": "pages/activity",
|
"root": "pages/activity",
|
||||||
"pages": [
|
"pages": [{
|
||||||
{
|
|
||||||
"path": "groupon/detail",
|
"path": "groupon/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "拼团详情"
|
"navigationBarTitleText": "拼团详情"
|
||||||
|
@ -648,6 +656,28 @@
|
||||||
"title": "秒杀活动",
|
"title": "秒杀活动",
|
||||||
"group": "营销活动"
|
"group": "营销活动"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "bargainingList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "砍价列表"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"sync": true,
|
||||||
|
"title": "砍价列表",
|
||||||
|
"group": "营销活动"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "bargainingDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "砍价详情"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"sync": true,
|
||||||
|
"title": "砍价详情",
|
||||||
|
"group": "营销活动"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -660,8 +690,7 @@
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
},
|
},
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"list": [
|
"list": [{
|
||||||
{
|
|
||||||
"pagePath": "pages/index/index"
|
"pagePath": "pages/index/index"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,372 @@
|
||||||
|
<template>
|
||||||
|
<s-layout title='砍价列表'>
|
||||||
|
<view style='background-color: red;height:100vh;'>
|
||||||
|
<view class='bargain-list'>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (state.navH/2) +'rpx'"
|
||||||
|
v-if="state.returnShow">
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- 砍价记录的概要 -->
|
||||||
|
<view class='header'>
|
||||||
|
<view class="pic">
|
||||||
|
<view class='swipers'>
|
||||||
|
<swiper :indicator-dots="state.indicatorDots" :autoplay="state.autoplay" interval="2500"
|
||||||
|
duration="500" vertical="true" circular="true">
|
||||||
|
<block v-for="(item,index) in state.bargainSuccessList" :key='index'>
|
||||||
|
<swiper-item>
|
||||||
|
<view class="acea-row row-middle" style='display:flex'>
|
||||||
|
<image :src="item.avatar" class="mr9"></image>
|
||||||
|
<view class='mr9 nickName'>{{ item.nickname }}</view>
|
||||||
|
<text class='mr9'>拿了</text>
|
||||||
|
<view class='line1'>{{ item.activityName }}</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</block>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tit">已有{{ state.bargainTotal }}人砍成功</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 砍价活动列表 -->
|
||||||
|
<view class='list'>
|
||||||
|
<block v-for="(item,index) in state.bargainList" :key="index">
|
||||||
|
<view style='display:flex' class='item acea-row row-between-wrapper'
|
||||||
|
@tap="openSubscribe('/pages/activity/bargainingDetail?id='+ item.id)">
|
||||||
|
<view class='pictrue'>
|
||||||
|
<image :src='item.picUrl'></image>
|
||||||
|
</view>
|
||||||
|
<view class='text acea-row row-column-around'>
|
||||||
|
<view class='name line2'>{{ item.name }}</view>
|
||||||
|
<view class="acea-row" style="margin-bottom: 14rpx;display:flex">
|
||||||
|
<s-count-down :tipText="' '" :bgColor="state.bgColor" :dayText="':'" :hourText="':'"
|
||||||
|
:minuteText="':'" :secondText="' '" :datatime="item.endTime / 1000"
|
||||||
|
:isDay="true" />
|
||||||
|
<text class="txt">后结束</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.stock === 0">
|
||||||
|
<view style="font-size: 22rpx;"
|
||||||
|
@tap="openSubscribe('/pages/activity/goods_bargain_details/index?id='+ item.id +'&startBargainUid='+ uid)">
|
||||||
|
已售罄</view>
|
||||||
|
</view>
|
||||||
|
<view class='money font-color'>最低: ¥<text
|
||||||
|
class='price'>{{ fen2yuan(item.bargainMinPrice) }}</text></view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.stock > 0" class='cutBnt bg-color'>参与砍价</view>
|
||||||
|
<view v-if="item.stock === 0" class='cutBnt bg-color-hui'>已售罄</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<view class='loadingicon acea-row row-center-wrapper' v-if='state.bargainList.length > 0'
|
||||||
|
style='text-align: center;'>
|
||||||
|
<text class='loading iconfont icon-jiazai' :hidden='!loading'></text>{{state.loadTitle}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</s-layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
|
import sheep from '@/sheep';
|
||||||
|
import _ from 'lodash';
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
onReachBottom
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
import {
|
||||||
|
useDurationTime
|
||||||
|
} from '@/sheep/hooks/useGoods';
|
||||||
|
import {
|
||||||
|
showShareModal
|
||||||
|
} from '@/sheep/hooks/useModal';
|
||||||
|
import {
|
||||||
|
isEmpty
|
||||||
|
} from 'lodash';
|
||||||
|
|
||||||
|
const state = reactive({
|
||||||
|
navH: '',
|
||||||
|
returnShow: true,
|
||||||
|
|
||||||
|
// ========== 砍价记录概要的相关变量 ==========
|
||||||
|
bargainTotal: 0,
|
||||||
|
bargainSuccessList: [],
|
||||||
|
autoplay: true,
|
||||||
|
indicatorDots: false,
|
||||||
|
|
||||||
|
// ========== 砍价活动的相关变量 ==========
|
||||||
|
bargainList: [],
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
loading: false,
|
||||||
|
loadend: false,
|
||||||
|
bgColor: {
|
||||||
|
'bgColor': '#E93323',
|
||||||
|
'Color': '#fff',
|
||||||
|
'width': '44rpx',
|
||||||
|
'timeTxtwidth': '16rpx',
|
||||||
|
'isDay': true
|
||||||
|
},
|
||||||
|
loadTitle: '加载更多',
|
||||||
|
});
|
||||||
|
|
||||||
|
function getBargainHeader() {
|
||||||
|
sheep.$api.activity.getBargainRecordSummary().then(res => {
|
||||||
|
state.bargainTotal = res.data.successUserCount;
|
||||||
|
state.bargainSuccessList = res.data.successList;
|
||||||
|
}).catch(err => {
|
||||||
|
return state.$util.Tips({
|
||||||
|
title: err
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBargainList() {
|
||||||
|
if (state.loadend || state.loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state.loading = true;
|
||||||
|
state.loadTitle = '';
|
||||||
|
sheep.$api.activity.getBargainActivityPage({
|
||||||
|
pageNo: state.page,
|
||||||
|
pageSize: state.limit
|
||||||
|
}).then(res => {
|
||||||
|
const list = res.data.list;
|
||||||
|
const bargainList = _.concat(state.bargainList, list);
|
||||||
|
const loadend = list.length < state.limit;
|
||||||
|
state.loadend = loadend;
|
||||||
|
state.loading = false;
|
||||||
|
state.loadTitle = loadend ? '已全部加载' : '加载更多';
|
||||||
|
// this.$set(this, 'bargainList', bargainList);
|
||||||
|
state.bargainList = res.data.list
|
||||||
|
// this.$set(this, 'page', this.page + 1);
|
||||||
|
state.page = state.page + 1;
|
||||||
|
}).catch(res => {
|
||||||
|
state.loading = false;
|
||||||
|
state.loadTitle = '加载更多';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function openSubscribe(e) {
|
||||||
|
console.log(e)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: page,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
let page = e;
|
||||||
|
// #ifndef MP
|
||||||
|
uni.navigateTo({
|
||||||
|
url: page
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在加载',
|
||||||
|
})
|
||||||
|
openBargainSubscribe().then(res => {
|
||||||
|
uni.hideLoading();
|
||||||
|
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
onLoad(function() {
|
||||||
|
getBargainHeader();
|
||||||
|
getBargainList();
|
||||||
|
})
|
||||||
|
|
||||||
|
onReachBottom(() => {
|
||||||
|
getBargainList();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 工具函数
|
||||||
|
function fen2yuan(price) {
|
||||||
|
return (price / 100.0).toFixed(2)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='scss' scoped>
|
||||||
|
page,
|
||||||
|
.page-app {
|
||||||
|
background-color: #e93323 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-color {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mr9 {
|
||||||
|
margin-right: 9rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swipers {
|
||||||
|
height: 100%;
|
||||||
|
width: 76%;
|
||||||
|
margin: auto;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
swiper {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line1 {
|
||||||
|
width: 195rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .icon-xiangzuo {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #fff;
|
||||||
|
position: fixed;
|
||||||
|
left: 30rpx;
|
||||||
|
z-index: 99;
|
||||||
|
transform: translateY(-20%);
|
||||||
|
height: 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .header {
|
||||||
|
/* TODO 芋艿:此处原来采用base64 但是过长编辑到小程序卡死 目前采用网络地址 需解决 */
|
||||||
|
background-image: url('https://huizhizao-1314830814.cos.ap-shanghai.myqcloud.com/huizhizao-1314830814/bdc8a9210710b83bcd88a14703f440fc7091792706b5cb71b54361488a547298.png');
|
||||||
|
babackground-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 420rpx;
|
||||||
|
|
||||||
|
.acea-row {
|
||||||
|
height: 50rpx;
|
||||||
|
line-height: 50rpx;
|
||||||
|
left: 50rpx;
|
||||||
|
|
||||||
|
.nickName {
|
||||||
|
width: 65rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pic {
|
||||||
|
width: 478rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
/* TODO 芋艿:此处原来是本地地址小程序不支持,需改为线上 */
|
||||||
|
background-image: url('https://huizhizao-1314830814.cos.ap-shanghai.myqcloud.com/huizhizao-1314830814/d111ac53e1390618f22fcc03e415bcd584b3f409ae52421aef95c2ab9b02aa30.png');
|
||||||
|
babackground-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tit {
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 304rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item {
|
||||||
|
position: relative;
|
||||||
|
height: 250rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding: 30rpx 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .pictrue {
|
||||||
|
width: 190rpx;
|
||||||
|
height: 190rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .pictrue image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .text {
|
||||||
|
width: 432rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
|
.txt {
|
||||||
|
font-size: 22rpx;
|
||||||
|
margin-left: 4rpx;
|
||||||
|
color: #666666;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .text .name {
|
||||||
|
width: 100%;
|
||||||
|
height: 68rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .text .num {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .text .num .iconfont {
|
||||||
|
font-size: 35rpx;
|
||||||
|
margin-right: 7rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .text .money {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .text .money .price {
|
||||||
|
font-size: 38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .cutBnt {
|
||||||
|
position: absolute;
|
||||||
|
width: 162rpx;
|
||||||
|
height: 52rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 52rpx;
|
||||||
|
right: 24rpx;
|
||||||
|
bottom: 30rpx;
|
||||||
|
background: linear-gradient(90deg, #FF7931 0%, #E93323 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .item .cutBnt .iconfont {
|
||||||
|
margin-right: 8rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bargain-list .list .load {
|
||||||
|
font-size: 24rpx;
|
||||||
|
height: 85rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 85rpx;
|
||||||
|
}
|
||||||
|
</style>
|
File diff suppressed because one or more lines are too long
|
@ -8,61 +8,42 @@
|
||||||
<text class="cicon-forward"></text>
|
<text class="cicon-forward"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view
|
<scroll-view scroll-y="true" @scrolltolower="loadmore" class="scroll-box log-scroll"
|
||||||
scroll-y="true"
|
scroll-with-animation="true">
|
||||||
@scrolltolower="loadmore"
|
|
||||||
class="scroll-box log-scroll"
|
|
||||||
scroll-with-animation="true"
|
|
||||||
>
|
|
||||||
<view v-if="state.pagination.data">
|
<view v-if="state.pagination.data">
|
||||||
<view
|
<view class="log-item-box ss-flex ss-row-between" v-for="item in state.pagination.data" :key="item.id">
|
||||||
class="log-item-box ss-flex ss-row-between"
|
|
||||||
v-for="item in state.pagination.data"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<view class="log-item-wrap">
|
<view class="log-item-wrap">
|
||||||
<view class="log-item ss-flex ss-ellipsis-1 ss-col-center">
|
<view class="log-item ss-flex ss-ellipsis-1 ss-col-center">
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<image
|
<image v-if="item.oper_type === 'user'" class="log-img"
|
||||||
v-if="item.oper_type === 'user'"
|
:src="sheep.$url.cdn(item.oper?.avatar)" mode="aspectFill"></image>
|
||||||
class="log-img"
|
<image v-else-if="item.oper_type === 'admin'" class="log-img"
|
||||||
:src="sheep.$url.cdn(item.oper?.avatar)"
|
|
||||||
mode="aspectFill"
|
|
||||||
></image>
|
|
||||||
<image
|
|
||||||
v-else-if="item.oper_type === 'admin'"
|
|
||||||
class="log-img"
|
|
||||||
:src="sheep.$url.static('/static/img/shop/avatar/default_user.png')"
|
:src="sheep.$url.static('/static/img/shop/avatar/default_user.png')"
|
||||||
mode="aspectFill"
|
mode="aspectFill"></image>
|
||||||
></image>
|
<image v-else class="log-img"
|
||||||
<image
|
:src="sheep.$url.static('/static/img/shop/avatar/notice.png')" mode="aspectFill">
|
||||||
v-else
|
</image>
|
||||||
class="log-img"
|
|
||||||
:src="sheep.$url.static('/static/img/shop/avatar/notice.png')"
|
|
||||||
mode="aspectFill"
|
|
||||||
></image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="log-text ss-ellipsis-1">{{ item.remark }}</view>
|
<view class="log-text ss-ellipsis-1">{{ item.title }} {{item.price/100}}元</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="log-time">{{ dayjs(item.create_time).fromNow() }}</text>
|
<text class="log-time">{{ dayjs(item.createTime).fromNow() }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
<uni-load-more
|
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" color="#333333"
|
||||||
v-if="state.pagination.total > 0"
|
@tap="loadmore" />
|
||||||
:status="state.loadStatus"
|
|
||||||
color="#333333"
|
|
||||||
@tap="loadmore"
|
|
||||||
/>
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { computed, reactive } from 'vue';
|
import {
|
||||||
|
computed,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
@ -77,16 +58,18 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getLog(page = 1) {
|
async function getLog(page = 1) {
|
||||||
const res = await sheep.$api.commission.log({
|
state.pagination.current_page = page
|
||||||
|
const res = await sheep.$api.commission.order({
|
||||||
page,
|
page,
|
||||||
});
|
});
|
||||||
if (res.error === 0) {
|
console.log(res, '下面的数据')
|
||||||
let list = _.concat(state.pagination.data, res.data.data);
|
if (res.code === 0) {
|
||||||
|
let list = _.concat(state.pagination.data, res.data.list);
|
||||||
state.pagination = {
|
state.pagination = {
|
||||||
...res.data,
|
...res.data,
|
||||||
data: list,
|
data: list,
|
||||||
};
|
};
|
||||||
if (state.pagination.current_page < state.pagination.last_page) {
|
if (state.pagination.data.length < state.pagination.total) {
|
||||||
state.loadStatus = 'more';
|
state.loadStatus = 'more';
|
||||||
} else {
|
} else {
|
||||||
state.loadStatus = 'noMore';
|
state.loadStatus = 'noMore';
|
||||||
|
@ -111,25 +94,30 @@
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.header-box {
|
.header-box {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 76rpx;
|
height: 76rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.header-bg {
|
.header-bg {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 76rpx;
|
height: 76rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 20rpx;
|
left: 20rpx;
|
||||||
top: 24rpx;
|
top: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cicon-forward {
|
.cicon-forward {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -137,6 +125,7 @@
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-scroll {
|
.log-scroll {
|
||||||
height: 600rpx;
|
height: 600rpx;
|
||||||
background: #fdfae9;
|
background: #fdfae9;
|
||||||
|
@ -146,6 +135,7 @@
|
||||||
|
|
||||||
.log-item-box {
|
.log-item-box {
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
.log-time {
|
.log-time {
|
||||||
// margin-left: 30rpx;
|
// margin-left: 30rpx;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
|
@ -9,17 +9,9 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-list ss-flex ss-flex-wrap">
|
<view class="menu-list ss-flex ss-flex-wrap">
|
||||||
<view
|
<view v-for="(item, index) in state.menuList" :key="index" class="item-box ss-flex-col ss-col-center"
|
||||||
v-for="(item, index) in state.menuList"
|
@tap="sheep.$router.go(item.path)">
|
||||||
:key="index"
|
<image class="menu-icon ss-m-b-10" :src="sheep.$url.static(item.img)" mode="aspectFill"></image>
|
||||||
class="item-box ss-flex-col ss-col-center"
|
|
||||||
@tap="sheep.$router.go(item.path)"
|
|
||||||
>
|
|
||||||
<image
|
|
||||||
class="menu-icon ss-m-b-10"
|
|
||||||
:src="sheep.$url.static(item.img)"
|
|
||||||
mode="aspectFill"
|
|
||||||
></image>
|
|
||||||
<view>{{ item.title }}</view>
|
<view>{{ item.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -46,12 +38,16 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import {
|
||||||
import { computed, reactive } from 'vue';
|
onLoad
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
menuList: [
|
menuList: [{
|
||||||
{
|
|
||||||
img: '/static/img/shop/commission/commission_icon1.png',
|
img: '/static/img/shop/commission/commission_icon1.png',
|
||||||
title: '我的团队',
|
title: '我的团队',
|
||||||
path: '/pages/commission/team',
|
path: '/pages/commission/team',
|
||||||
|
@ -71,22 +67,31 @@
|
||||||
title: '推广商品',
|
title: '推广商品',
|
||||||
path: '/pages/commission/goods',
|
path: '/pages/commission/goods',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
img: '/static/img/shop/commission/commission_icon5.png',
|
// img: '/static/img/shop/commission/commission_icon5.png',
|
||||||
title: '我的资料',
|
// title: '我的资料',
|
||||||
path: '/pages/commission/apply',
|
// path: '/pages/commission/apply',
|
||||||
isAgentFrom: true,
|
// isAgentFrom: true,
|
||||||
},
|
// },
|
||||||
|
// todo @芋艿:邀请海报需要登录后的个人数据
|
||||||
{
|
{
|
||||||
img: '/static/img/shop/commission/commission_icon7.png',
|
img: '/static/img/shop/commission/commission_icon7.png',
|
||||||
title: '邀请海报',
|
title: '邀请海报',
|
||||||
path: 'action:showShareModal',
|
path: 'action:showShareModal',
|
||||||
|
}, {
|
||||||
|
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||||
|
title: '推广人排行榜',
|
||||||
|
path: '/pages/commission/promoter',
|
||||||
|
}, {
|
||||||
|
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||||
|
title: '佣金排行榜',
|
||||||
|
path: '/pages/commission/commission-ranking',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
img: '/static/img/shop/commission/commission_icon8.png',
|
// img: '/static/img/shop/commission/commission_icon8.png',
|
||||||
title: '分享记录',
|
// title: '分享记录',
|
||||||
path: '/pages/commission/share-log',
|
// path: '/pages/commission/share-log',
|
||||||
},
|
// },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -101,25 +106,30 @@
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-box {
|
.header-box {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 76rpx;
|
height: 76rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.header-bg {
|
.header-bg {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 76rpx;
|
height: 76rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 20rpx;
|
left: 20rpx;
|
||||||
top: 24rpx;
|
top: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cicon-forward {
|
.cicon-forward {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -133,6 +143,7 @@
|
||||||
background: #fdfae9;
|
background: #fdfae9;
|
||||||
border-radius: 0 0 12rpx 12rpx;
|
border-radius: 0 0 12rpx 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-box {
|
.item-box {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
|
|
|
@ -19,8 +19,13 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { onShow } from '@dcloudio/uni-app';
|
import {
|
||||||
import { computed, reactive } from 'vue';
|
onShow
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
import commissionInfo from './components/commission-info.vue';
|
import commissionInfo from './components/commission-info.vue';
|
||||||
import accountInfo from './components/account-info.vue';
|
import accountInfo from './components/account-info.vue';
|
||||||
import commissionLog from './components/commission-log.vue';
|
import commissionLog from './components/commission-log.vue';
|
||||||
|
@ -43,7 +48,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getAgentInfo() {
|
async function getAgentInfo() {
|
||||||
const { error, data } = await sheep.$store('user').getAgentInfo();
|
const {
|
||||||
|
error,
|
||||||
|
data
|
||||||
|
} = await sheep.$store('user').getAgentInfo();
|
||||||
if (error !== 0) {
|
if (error !== 0) {
|
||||||
state.error = error;
|
state.error = error;
|
||||||
state.errorData = data;
|
state.errorData = data;
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
},
|
},
|
||||||
]">
|
]">
|
||||||
<!-- 团队数据总览 -->
|
<!-- 团队数据总览 -->
|
||||||
<view class="team-data-box ss-flex ss-col-center ss-row-between">
|
<view class="team-data-box ss-flex ss-col-center ss-row-between" style="width:100%">
|
||||||
<view class="data-card">
|
<view class="data-card" style="width:100%">
|
||||||
<view class="total-item">
|
<view class="total-item" style="width:100%">
|
||||||
<view class="item-title">团队订单数量(单)</view>
|
<view class="item-title" style='text-align: center;'>累计推广订单(单)</view>
|
||||||
<view class="total-num">
|
<view class="total-num" style='text-align: center;'>
|
||||||
{{ state.agentInfo.child_order_count_all || 0 }}
|
{{ state.totals||state.pagination.total|| 0 }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="category-item ss-flex">
|
<!-- <view class="category-item ss-flex">
|
||||||
<view class="ss-flex-1">
|
<view class="ss-flex-1">
|
||||||
<view class="item-title">一级订单</view>
|
<view class="item-title">一级订单</view>
|
||||||
<view class="category-num">
|
<view class="category-num">
|
||||||
|
@ -29,9 +29,9 @@
|
||||||
{{ state.agentInfo.child_order_count_2 || 0 }}
|
{{ state.agentInfo.child_order_count_2 || 0 }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<!-- <view class="data-card">
|
||||||
<view class="data-card">
|
|
||||||
<view class="total-item">
|
<view class="total-item">
|
||||||
<view class="item-title">团队订单金额(元)</view>
|
<view class="item-title">团队订单金额(元)</view>
|
||||||
<view class="total-num">
|
<view class="total-num">
|
||||||
|
@ -52,10 +52,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- 自购 -->
|
<!-- 自购 -->
|
||||||
<view class="direct-box ss-flex ss-row-between">
|
<!-- <view class="direct-box ss-flex ss-row-between">
|
||||||
<view class="direct-item">
|
<view class="direct-item">
|
||||||
<view class="item-title">自购分销订单数量(单)</view>
|
<view class="item-title">自购分销订单数量(单)</view>
|
||||||
<view class="item-value">
|
<view class="item-value">
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
{{ state.agentInfo.child_order_money_0 || '0.00' }}
|
{{ state.agentInfo.child_order_money_0 || '0.00' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- tab -->
|
<!-- tab -->
|
||||||
|
@ -131,7 +131,7 @@
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
reactive
|
reactive,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import {
|
import {
|
||||||
|
@ -149,10 +149,11 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
totals: 0,
|
||||||
pagination: {
|
pagination: {
|
||||||
data: [],
|
data: [],
|
||||||
current_page: 1,
|
current_page: 1,
|
||||||
total: 1,
|
total: '',
|
||||||
last_page: 1,
|
last_page: 1,
|
||||||
},
|
},
|
||||||
loadStatus: '',
|
loadStatus: '',
|
||||||
|
@ -170,24 +171,24 @@
|
||||||
// value: 'no'
|
// value: 'no'
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
name: '已计入',
|
name: '待结算',
|
||||||
value: 'yes',
|
value: 'yes',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '已扣除',
|
name: '已结算',
|
||||||
value: 'back',
|
value: 'back',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: '已取消',
|
// name: '已取消',
|
||||||
value: 'cancel',
|
// value: 'cancel',
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
// 切换选项卡
|
// 切换选项卡
|
||||||
function onTabsChange(e) {
|
function onTabsChange(e) {
|
||||||
state.pagination = {
|
state.pagination = {
|
||||||
data: [],
|
data: [],
|
||||||
current_page: 1,
|
current_page: 1,
|
||||||
total: 1,
|
total: 0,
|
||||||
last_page: 1,
|
last_page: 1,
|
||||||
};
|
};
|
||||||
state.currentTab = e.index;
|
state.currentTab = e.index;
|
||||||
|
@ -196,19 +197,24 @@
|
||||||
|
|
||||||
// 获取订单列表
|
// 获取订单列表
|
||||||
async function getOrderList(page = 1, list_rows = 5) {
|
async function getOrderList(page = 1, list_rows = 5) {
|
||||||
|
// todo @芋艿:没有测试数据,还需对接请求参数,和返回的数据字段
|
||||||
state.loadStatus = 'loading';
|
state.loadStatus = 'loading';
|
||||||
let res = await sheep.$api.commission.order({
|
let res = await sheep.$api.commission.order({
|
||||||
type: tabMaps[state.currentTab].value,
|
// type: tabMaps[state.currentTab].value,
|
||||||
list_rows,
|
pageSize: list_rows,
|
||||||
page,
|
pageNo: page,
|
||||||
|
// status
|
||||||
|
// bizType
|
||||||
});
|
});
|
||||||
if (res.error === 0) {
|
if (res.code === 0) {
|
||||||
let orderList = _.concat(state.pagination.data, res.data.data);
|
let orderList = _.concat(state.pagination.data, res.data.list);
|
||||||
state.pagination = {
|
state.pagination = {
|
||||||
...res.data,
|
...res.data,
|
||||||
data: orderList,
|
data: orderList,
|
||||||
};
|
};
|
||||||
if (state.pagination.current_page < state.pagination.last_page) {
|
state.totals = res.data.total;
|
||||||
|
console.log(state)
|
||||||
|
if (state.pagination.data.length < state.totals) {
|
||||||
state.loadStatus = 'more';
|
state.loadStatus = 'more';
|
||||||
} else {
|
} else {
|
||||||
state.loadStatus = 'noMore';
|
state.loadStatus = 'noMore';
|
||||||
|
@ -228,7 +234,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getAgentInfo();
|
// getAgentInfo();
|
||||||
getOrderList();
|
getOrderList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,23 +1,17 @@
|
||||||
<!-- 页面 -->
|
<!-- 页面 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout title="我的团队" :class="state.scrollTop ? 'team-wrap' : ''" navbar="inner">
|
<s-layout title="我的团队" :class="state.scrollTop ? 'team-wrap' : ''" navbar="inner">
|
||||||
<view
|
<view class="header-box" :style="[
|
||||||
class="header-box"
|
|
||||||
:style="[
|
|
||||||
{
|
{
|
||||||
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
||||||
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
||||||
},
|
},
|
||||||
]"
|
]">
|
||||||
>
|
|
||||||
<!-- 推荐人 -->
|
<!-- 推荐人 -->
|
||||||
<view v-if="userInfo.parent_user" class="referrer-box ss-flex ss-col-center">
|
<view v-if="userInfo.parent_user" class="referrer-box ss-flex ss-col-center">
|
||||||
推荐人:
|
推荐人:
|
||||||
<image
|
<image class="referrer-avatar ss-m-r-10" :src="sheep.$url.cdn(userInfo.parent_user.avatar)"
|
||||||
class="referrer-avatar ss-m-r-10"
|
mode="aspectFill">
|
||||||
:src="sheep.$url.cdn(userInfo.parent_user.avatar)"
|
|
||||||
mode="aspectFill"
|
|
||||||
>
|
|
||||||
</image>
|
</image>
|
||||||
{{ userInfo.parent_user.nickname }}
|
{{ userInfo.parent_user.nickname }}
|
||||||
</view>
|
</view>
|
||||||
|
@ -26,16 +20,18 @@
|
||||||
<view class="data-card">
|
<view class="data-card">
|
||||||
<view class="total-item">
|
<view class="total-item">
|
||||||
<view class="item-title">团队总人数(人)</view>
|
<view class="item-title">团队总人数(人)</view>
|
||||||
<view class="total-num">{{ agentInfo.child_user_count_all || 0 }}</view>
|
<view class="total-num">
|
||||||
|
{{ (state.getSummary.firstBrokerageUserCount+ state.getSummary.secondBrokerageUserCount)|| 0 }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="category-item ss-flex">
|
<view class="category-item ss-flex">
|
||||||
<view class="ss-flex-1">
|
<view class="ss-flex-1">
|
||||||
<view class="item-title">一级成员</view>
|
<view class="item-title">一级成员</view>
|
||||||
<view class="category-num">{{ agentInfo.child_user_count_1 || 0 }}</view>
|
<view class="category-num">{{ state.getSummary.firstBrokerageUserCount || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex-1">
|
<view class="ss-flex-1">
|
||||||
<view class="item-title">二级成员</view>
|
<view class="item-title">二级成员</view>
|
||||||
<view class="category-num">{{ agentInfo.child_user_count_2 || 0 }}</view>
|
<view class="category-num">{{ state.getSummary.secondBrokerageUserCount || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -59,26 +55,17 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="list-box">
|
<view class="list-box">
|
||||||
<uni-list :border="false">
|
<uni-list :border="false">
|
||||||
<uni-list-chat
|
<uni-list-chat v-for="item in state.pagination.data" :key="item.id" :avatar-circle="true"
|
||||||
v-for="item in state.pagination.data"
|
:title="item.nickname" :avatar="sheep.$url.cdn(item.avatar)"
|
||||||
:key="item.id"
|
:note="filterUserNum(item.agent?.child_user_count_1)">
|
||||||
:avatar-circle="true"
|
|
||||||
:title="item.nickname"
|
|
||||||
:avatar="sheep.$url.cdn(item.avatar)"
|
|
||||||
:note="filterUserNum(item.agent?.child_user_count_1)"
|
|
||||||
>
|
|
||||||
<view class="chat-custom-right">
|
<view class="chat-custom-right">
|
||||||
<view v-if="item.agent?.level_info" class="tag-box ss-flex ss-col-center">
|
<view v-if="item.avatar" class="tag-box ss-flex ss-col-center">
|
||||||
<image
|
<image class="tag-img" :src="sheep.$url.cdn(item.avatar)" mode="aspectFill">
|
||||||
class="tag-img"
|
|
||||||
:src="sheep.$url.cdn(item.agent.level_info.image)"
|
|
||||||
mode="aspectFill"
|
|
||||||
>
|
|
||||||
</image>
|
</image>
|
||||||
<text class="tag-title">{{ item.agent.level_info.name }}</text>
|
<text class="tag-title">{{ item.nickname }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<text
|
||||||
<text class="time-text">{{ item.create_time }}</text>
|
class="time-text">{{ sheep.$helper.timeFormat(item.brokerageTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
|
||||||
</view>
|
</view>
|
||||||
</uni-list-chat>
|
</uni-list-chat>
|
||||||
</uni-list>
|
</uni-list>
|
||||||
|
@ -90,10 +77,18 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
import {
|
||||||
import { computed, reactive } from 'vue';
|
onLoad,
|
||||||
|
onReachBottom
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { onPageScroll } from '@dcloudio/uni-app';
|
import {
|
||||||
|
onPageScroll
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
|
|
||||||
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
||||||
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
||||||
|
@ -108,6 +103,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
getSummary: {},
|
||||||
pagination: {
|
pagination: {
|
||||||
data: [],
|
data: [],
|
||||||
current_page: 1,
|
current_page: 1,
|
||||||
|
@ -126,17 +122,25 @@
|
||||||
|
|
||||||
async function getTeamList(page = 1, list_rows = 8) {
|
async function getTeamList(page = 1, list_rows = 8) {
|
||||||
state.loadStatus = 'loading';
|
state.loadStatus = 'loading';
|
||||||
|
// nickname: this.nickname,
|
||||||
|
|
||||||
|
|
||||||
let res = await sheep.$api.commission.team({
|
let res = await sheep.$api.commission.team({
|
||||||
list_rows,
|
pageSize: list_rows,
|
||||||
page,
|
pageNo: page,
|
||||||
|
level: '1',
|
||||||
|
'sortingField.order': 'desc',
|
||||||
|
'sortingField.field': 'userCount',
|
||||||
|
nickname: ''
|
||||||
});
|
});
|
||||||
if (res.error === 0) {
|
console.log(res, '分销团队列表');
|
||||||
let orderList = _.concat(state.pagination.data, res.data.data);
|
if (res.code === 0) {
|
||||||
|
let orderList = _.concat(state.pagination.data, res.data.list);
|
||||||
state.pagination = {
|
state.pagination = {
|
||||||
...res.data,
|
...res.data,
|
||||||
data: orderList,
|
data: orderList,
|
||||||
};
|
};
|
||||||
if (state.pagination.current_page < state.pagination.last_page) {
|
if (state.pagination.data.length < state.pagination.total) {
|
||||||
state.loadStatus = 'more';
|
state.loadStatus = 'more';
|
||||||
} else {
|
} else {
|
||||||
state.loadStatus = 'noMore';
|
state.loadStatus = 'noMore';
|
||||||
|
@ -146,6 +150,8 @@
|
||||||
|
|
||||||
onLoad(async () => {
|
onLoad(async () => {
|
||||||
getTeamList();
|
getTeamList();
|
||||||
|
let res = await sheep.$api.commission.getSummary();
|
||||||
|
state.getSummary = res.data;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 加载更多
|
// 加载更多
|
||||||
|
@ -171,6 +177,7 @@
|
||||||
background: v-bind(headerBg) no-repeat,
|
background: v-bind(headerBg) no-repeat,
|
||||||
linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
|
linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
|
||||||
background-size: 750rpx 100%;
|
background-size: 750rpx 100%;
|
||||||
|
|
||||||
// 团队信息总览
|
// 团队信息总览
|
||||||
.team-data-box {
|
.team-data-box {
|
||||||
.data-card {
|
.data-card {
|
||||||
|
@ -207,10 +214,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-box {
|
.list-box {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-custom-right {
|
.chat-custom-right {
|
||||||
.time-text {
|
.time-text {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
|
|
|
@ -6,22 +6,16 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="modal-content ss-flex-1 ss-p-b-100">
|
<view class="modal-content ss-flex-1 ss-p-b-100">
|
||||||
<radio-group @change="onChange">
|
<radio-group @change="onChange">
|
||||||
<label
|
<label class="container-list ss-p-l-34 ss-p-r-24 ss-flex ss-col-center ss-row-center"
|
||||||
class="container-list ss-p-l-34 ss-p-r-24 ss-flex ss-col-center ss-row-center"
|
v-for="(item, index) in typeList" :key="index">
|
||||||
v-for="(item, index) in typeList"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<view class="container-icon ss-flex ss-m-r-20">
|
<view class="container-icon ss-flex ss-m-r-20">
|
||||||
<image :src="sheep.$url.static(item.icon)" />
|
<image :src="sheep.$url.static(item.icon)" />
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex-1">{{ item.title }}</view>
|
<view class="ss-flex-1">{{ item.title }}</view>
|
||||||
|
|
||||||
<radio
|
<radio :value="item.value" color="var(--ui-BG-Main)"
|
||||||
:value="item.value"
|
:checked="item.value === state.currentValue" />
|
||||||
color="var(--ui-BG-Main)"
|
<!-- :disabled="!methods.includes(item.value)" -->
|
||||||
:checked="item.value === state.currentValue"
|
|
||||||
:disabled="!methods.includes(item.value)"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</radio-group>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
|
@ -33,7 +27,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, onBeforeMount, nextTick } from 'vue';
|
import {
|
||||||
|
reactive,
|
||||||
|
onBeforeMount,
|
||||||
|
nextTick
|
||||||
|
} from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -52,23 +50,22 @@
|
||||||
});
|
});
|
||||||
const emits = defineEmits(['update:modelValue', 'change', 'close']);
|
const emits = defineEmits(['update:modelValue', 'change', 'close']);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
currentValue: '',
|
currentValue: '0',
|
||||||
});
|
});
|
||||||
const typeList = [
|
const typeList = [{
|
||||||
{
|
// icon: '/static/img/shop/pay/wechat.png',
|
||||||
icon: '/static/img/shop/pay/wechat.png',
|
title: '工商银行',
|
||||||
title: '微信零钱',
|
value: '0',
|
||||||
value: 'wechat',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: '/static/img/shop/pay/alipay.png',
|
// icon: '/static/img/shop/pay/alipay.png',
|
||||||
title: '支付宝账户',
|
title: '建设银行',
|
||||||
value: 'alipay',
|
value: '1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: '/static/img/shop/pay/bank.png',
|
// icon: '/static/img/shop/pay/bank.png',
|
||||||
title: '银行卡转账',
|
title: '农业',
|
||||||
value: 'bank',
|
value: '2',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const getWalletAccountInfo = async () => {
|
const getWalletAccountInfo = async () => {
|
||||||
|
|
|
@ -1,43 +1,49 @@
|
||||||
<template>
|
<template>
|
||||||
<s-layout title="申请提现" class="withdraw-wrap" navbar="inner">
|
<s-layout title="申请提现" class="withdraw-wrap" navbar="inner">
|
||||||
<!-- <view class="page-bg"></view> -->
|
<!-- <view class="page-bg"></view> -->
|
||||||
<view
|
<!-- <view class="wallet-num-box ss-flex ss-col-center ss-row-between" :style="[
|
||||||
class="wallet-num-box ss-flex ss-col-center ss-row-between"
|
|
||||||
:style="[
|
|
||||||
{
|
{
|
||||||
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
|
||||||
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
paddingTop: Number(statusBarHeight + 108) + 'rpx',
|
||||||
},
|
},
|
||||||
]"
|
]">
|
||||||
>
|
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="num-title">可提现金额(元)</view>
|
<view class="num-title">可提现金额(元)</view>
|
||||||
<view class="wallet-num">{{ userInfo.commission }}</view>
|
<view class="wallet-num">{{ userInfo.commission }}</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/withdraw-log')"
|
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/withdraw-log')">提现记录</button>
|
||||||
>提现记录</button
|
</view> -->
|
||||||
>
|
|
||||||
</view>
|
|
||||||
<!-- 提现输入卡片-->
|
<!-- 提现输入卡片-->
|
||||||
<view class="draw-card">
|
<view class="draw-card">
|
||||||
<view class="card-title">提现金额</view>
|
<view class="card-title">提现金额</view>
|
||||||
<view class="input-box ss-flex ss-col-center border-bottom">
|
<view class="input-box ss-flex ss-col-center border-bottom">
|
||||||
<view class="unit">¥</view>
|
<view class="unit">¥</view>
|
||||||
<uni-easyinput
|
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.amount" type="number"
|
||||||
:inputBorder="false"
|
placeholder="请输入提现金额" />
|
||||||
class="ss-flex-1 ss-p-l-10"
|
</view>
|
||||||
v-model="state.amount"
|
<view class="card-title">持卡人</view>
|
||||||
type="number"
|
<view class="input-box ss-flex ss-col-center border-bottom">
|
||||||
placeholder="请输入提现金额"
|
<view class="unit"></view>
|
||||||
/>
|
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.name"
|
||||||
|
placeholder="请输入持卡人姓名" />
|
||||||
|
</view>
|
||||||
|
<view class="card-title">卡号</view>
|
||||||
|
<view class="input-box ss-flex ss-col-center border-bottom">
|
||||||
|
<view class="unit"></view>
|
||||||
|
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.accountNo"
|
||||||
|
placeholder="请输卡号" />
|
||||||
</view>
|
</view>
|
||||||
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30">
|
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30">
|
||||||
<view class="name">提现至</view>
|
<view class="name">选择银行</view>
|
||||||
<view class="bank-list ss-flex ss-col-center" @tap="onAccountSelect(true)">
|
<view class="bank-list ss-flex ss-col-center" @tap="onAccountSelect(true)">
|
||||||
<view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
|
<view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
|
||||||
|
<view v-if="state.accountInfo.type === '0'" class="empty-text">工商银行</view>
|
||||||
|
<view v-if="state.accountInfo.type === '1'" class="empty-text">建设银行</view>
|
||||||
|
<view v-if="state.accountInfo.type === '2'" class="empty-text">农业银行</view>
|
||||||
|
<!-- <view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
|
||||||
<view v-if="state.accountInfo.type === 'wechat'" class="empty-text">微信零钱</view>
|
<view v-if="state.accountInfo.type === 'wechat'" class="empty-text">微信零钱</view>
|
||||||
<view v-if="state.accountInfo.type === 'alipay'" class="empty-text">支付宝账户</view>
|
<view v-if="state.accountInfo.type === 'alipay'" class="empty-text">支付宝账户</view>
|
||||||
<view v-if="state.accountInfo.type === 'bank'" class="empty-text">银行卡转账</view>
|
<view v-if="state.accountInfo.type === 'bank'" class="empty-text">银行卡转账</view> -->
|
||||||
<text class="cicon-forward"></text>
|
<text class="cicon-forward"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -45,10 +51,10 @@
|
||||||
<view class="placeholder-text" v-if="state.accountInfo.account_name">
|
<view class="placeholder-text" v-if="state.accountInfo.account_name">
|
||||||
{{ state.accountInfo.account_header }}|{{ state.accountInfo.account_name }}
|
{{ state.accountInfo.account_header }}|{{ state.accountInfo.account_name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="placeholder-text" v-else>暂无提现账户</view>
|
<!-- <view class="placeholder-text" v-else>暂无提现账户</view>
|
||||||
<button class="add-btn ss-reset-button" @tap="onAccountEdit(true)">
|
<button class="add-btn ss-reset-button" @tap="onAccountEdit(true)">
|
||||||
{{ state.accountInfo.account_name ? '修改' : '添加' }}
|
{{ state.accountInfo.account_name ? '修改' : '添加' }}
|
||||||
</button>
|
</button> -->
|
||||||
</view>
|
</view>
|
||||||
<button class="ss-reset-button save-btn ui-BG-Main-Gradient ui-Shadow-Main" @tap="onConfirm">
|
<button class="ss-reset-button save-btn ui-BG-Main-Gradient ui-Shadow-Main" @tap="onConfirm">
|
||||||
确认提现
|
确认提现
|
||||||
|
@ -58,39 +64,45 @@
|
||||||
<!-- 提现说明 -->
|
<!-- 提现说明 -->
|
||||||
<view class="draw-notice">
|
<view class="draw-notice">
|
||||||
<view class="title ss-m-b-30">提现说明</view>
|
<view class="title ss-m-b-30">提现说明</view>
|
||||||
<view class="draw-list" v-for="(rule, index) in state.rulesList" :key="index">
|
<!-- <view class="draw-list" v-for="(rule, index) in state.rulesList" :key="index">
|
||||||
{{ index + 1 }}.{{ rule }}
|
{{ index + 1 }}.{{ rule }}
|
||||||
|
</view>-->
|
||||||
|
<view class="draw-list">
|
||||||
|
当前可提现金额:<text>¥{{state.userGet.brokeragePrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="draw-list">
|
||||||
|
冻结佣金:<text>¥{{state.userGet.frozenPrice}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="draw-list">
|
||||||
|
说明:每笔佣金冻结期为0天,到期后可提现
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 选择提现账户 -->
|
<!-- 选择提现账户 -->
|
||||||
<account-type-select
|
<account-type-select :show="state.accountSelect" @close="onAccountSelect(false)" round="10"
|
||||||
:show="state.accountSelect"
|
v-model="state.accountInfo" :methods="state.rules.methods" />
|
||||||
@close="onAccountSelect(false)"
|
|
||||||
round="10"
|
|
||||||
v-model="state.accountInfo"
|
|
||||||
:methods="state.rules.methods"
|
|
||||||
/>
|
|
||||||
<!-- 编辑账户信息 -->
|
<!-- 编辑账户信息 -->
|
||||||
<account-info-modal
|
<account-info-modal v-if="state.accountInfo.type" v-model="state.accountInfo" :show="state.accountEdit"
|
||||||
v-if="state.accountInfo.type"
|
@close="onAccountEdit(false)" round="10" />
|
||||||
v-model="state.accountInfo"
|
|
||||||
:show="state.accountEdit"
|
|
||||||
@close="onAccountEdit(false)"
|
|
||||||
round="10"
|
|
||||||
/>
|
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, reactive, onBeforeMount } from 'vue';
|
import {
|
||||||
|
computed,
|
||||||
|
reactive,
|
||||||
|
onBeforeMount
|
||||||
|
} from 'vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import accountTypeSelect from './components/account-type-select.vue';
|
import accountTypeSelect from './components/account-type-select.vue';
|
||||||
import accountInfoModal from './components/account-info-modal.vue';
|
import accountInfoModal from './components/account-info-modal.vue';
|
||||||
import { onPageScroll } from '@dcloudio/uni-app';
|
import {
|
||||||
|
onPageScroll
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
|
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
|
||||||
onPageScroll(() => {});
|
onPageScroll(() => {});
|
||||||
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
|
||||||
|
|
||||||
function filterRules(rules) {
|
function filterRules(rules) {
|
||||||
let list = [];
|
let list = [];
|
||||||
let str1 = '';
|
let str1 = '';
|
||||||
|
@ -122,6 +134,9 @@
|
||||||
const userStore = sheep.$store('user');
|
const userStore = sheep.$store('user');
|
||||||
const userInfo = computed(() => userStore.userInfo);
|
const userInfo = computed(() => userStore.userInfo);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
userGet: {},
|
||||||
|
accountNo: '',
|
||||||
|
name: '',
|
||||||
amount: '',
|
amount: '',
|
||||||
type: '',
|
type: '',
|
||||||
accountInfo: {},
|
accountInfo: {},
|
||||||
|
@ -149,35 +164,43 @@
|
||||||
|
|
||||||
const onConfirm = async () => {
|
const onConfirm = async () => {
|
||||||
let payload = {
|
let payload = {
|
||||||
money: state.amount,
|
accountNo: state.accountNo,
|
||||||
...state.accountInfo,
|
name: state.name,
|
||||||
|
bankName: state.accountInfo.type,
|
||||||
|
type: '2',
|
||||||
|
price: state.amount * 100
|
||||||
};
|
};
|
||||||
|
console.log(payload);
|
||||||
|
// return;
|
||||||
|
// if (payload.money > userInfo.commission || payload.money <= 0) {
|
||||||
|
// sheep.$helper.toast('请输入正确的提现金额');
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
if (payload.money > userInfo.commission || payload.money <= 0) {
|
// if (!payload.type) {
|
||||||
sheep.$helper.toast('请输入正确的提现金额');
|
// sheep.$helper.toast('请选择提现方式');
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!payload.type) {
|
// if (!payload.account_name || !payload.account_header || !payload.account_no) {
|
||||||
sheep.$helper.toast('请选择提现方式');
|
// sheep.$helper.toast('请完善您的账户信息');
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!payload.account_name || !payload.account_header || !payload.account_no) {
|
// if (sheep.$platform.name === 'H5' && payload.type === 'wechat') {
|
||||||
sheep.$helper.toast('请完善您的账户信息');
|
// sheep.$helper.toast('请使用微信浏览器操作');
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (sheep.$platform.name === 'H5' && payload.type === 'wechat') {
|
let {
|
||||||
sheep.$helper.toast('请使用微信浏览器操作');
|
code,
|
||||||
return;
|
msg,
|
||||||
}
|
data
|
||||||
|
} = await sheep.$api.pay.withdraw.apply(payload);
|
||||||
let { error, msg, data } = await sheep.$api.pay.withdraw.apply(payload);
|
if (code === -1) {
|
||||||
if (error === -1) {
|
|
||||||
sheep.$platform.useProvider('wechat').bind();
|
sheep.$platform.useProvider('wechat').bind();
|
||||||
}
|
}
|
||||||
if (error === 0) {
|
if (code === 0) {
|
||||||
userStore.getInfo();
|
userStore.getInfo();
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '操作成功',
|
title: '操作成功',
|
||||||
|
@ -192,15 +215,20 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getWithdrawRules() {
|
async function getWithdrawRules() {
|
||||||
let { error, data } = await sheep.$api.pay.withdraw.rules();
|
let {
|
||||||
|
error,
|
||||||
|
data
|
||||||
|
} = await sheep.$api.pay.withdraw.rules();
|
||||||
if (error === 0) {
|
if (error === 0) {
|
||||||
state.rules = data;
|
state.rules = data;
|
||||||
state.rulesList = filterRules(state.rules);
|
state.rulesList = filterRules(state.rules);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(async () => {
|
||||||
getWithdrawRules();
|
getWithdrawRules();
|
||||||
|
let res = await sheep.$api.pay.withdraw.userGet();
|
||||||
|
state.userGet = res.data
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,21 +4,15 @@
|
||||||
<view class="header-box ss-flex ss-row-center ss-col-center">
|
<view class="header-box ss-flex ss-row-center ss-col-center">
|
||||||
<view class="card-box ui-BG-Main ui-Shadow-Main">
|
<view class="card-box ui-BG-Main ui-Shadow-Main">
|
||||||
<view class="card-head ss-flex ss-col-center">
|
<view class="card-head ss-flex ss-col-center">
|
||||||
<view class="card-title ss-m-r-10">我的佣金(元)</view>
|
<view class="card-title ss-m-r-10">当前佣金(元)</view>
|
||||||
<view
|
<view @tap="state.showMoney = !state.showMoney" class="ss-eye-icon"
|
||||||
@tap="state.showMoney = !state.showMoney"
|
:class="state.showMoney ? 'cicon-eye' : 'cicon-eye-off'"></view>
|
||||||
class="ss-eye-icon"
|
|
||||||
:class="state.showMoney ? 'cicon-eye' : 'cicon-eye-off'"
|
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex ss-row-between ss-col-center ss-m-t-30">
|
<view class="ss-flex ss-row-between ss-col-center ss-m-t-30">
|
||||||
<view class="money-num">{{ state.showMoney ? userInfo.commission : '*****' }}</view>
|
<view class="money-num">{{ state.showMoney ? state.userInfo.withdrawPrice : '*****' }}</view>
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<view class="ss-m-r-20">
|
<view class="ss-m-r-20">
|
||||||
<button
|
<button class="ss-reset-button withdraw-btn" @tap="sheep.$router.go('/pages/pay/withdraw')">
|
||||||
class="ss-reset-button withdraw-btn"
|
|
||||||
@tap="sheep.$router.go('/pages/pay/withdraw')"
|
|
||||||
>
|
|
||||||
提现
|
提现
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
@ -30,15 +24,15 @@
|
||||||
|
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<view class="loading-money">
|
<view class="loading-money">
|
||||||
<view class="loading-money-title">待入账佣金</view>
|
<view class="loading-money-title">冻结佣金</view>
|
||||||
<view class="loading-money-num">{{
|
<view class="loading-money-num">{{
|
||||||
state.showMoney ? agentInfo.pending_reward || '0.00' : '*****'
|
state.showMoney ? state.userInfo.frozenPrice || '0.00' : '*****'
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="loading-money ss-m-l-100">
|
<view class="loading-money ss-m-l-100">
|
||||||
<view class="loading-money-title">可提现佣金</view>
|
<view class="loading-money-title">可提现佣金</view>
|
||||||
<view class="loading-money-num">{{
|
<view class="loading-money-num">{{
|
||||||
state.showMoney ? userInfo.commission || '0.00' : '*****'
|
state.showMoney ? state.userInfo.brokeragePrice || '0.00' : '*****'
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -47,12 +41,7 @@
|
||||||
<su-sticky>
|
<su-sticky>
|
||||||
<!-- 统计 -->
|
<!-- 统计 -->
|
||||||
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
<view class="filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between">
|
||||||
<uni-datetime-picker
|
<uni-datetime-picker v-model="state.data" type="daterange" @change="onChangeTime" :end="state.today">
|
||||||
v-model="state.data"
|
|
||||||
type="daterange"
|
|
||||||
@change="onChangeTime"
|
|
||||||
:end="state.today"
|
|
||||||
>
|
|
||||||
<button class="ss-reset-button date-btn">
|
<button class="ss-reset-button date-btn">
|
||||||
<text>{{ dateFilterText }}</text>
|
<text>{{ dateFilterText }}</text>
|
||||||
<text class="cicon-drop-down ss-seldate-icon"></text>
|
<text class="cicon-drop-down ss-seldate-icon"></text>
|
||||||
|
@ -60,87 +49,61 @@
|
||||||
</uni-datetime-picker>
|
</uni-datetime-picker>
|
||||||
|
|
||||||
<view class="total-box">
|
<view class="total-box">
|
||||||
<view class="ss-m-b-10">总收入¥{{ state.pagination.income.toFixed(2) }}</view>
|
<!-- <view class="ss-m-b-10">总收入¥{{ state.pagination.income.toFixed(2) }}</view> -->
|
||||||
<view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view>
|
<!-- <view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<su-tabs
|
<su-tabs :list="tabMaps" @change="onChangeTab" :scrollable="false" :current="state.currentTab"></su-tabs>
|
||||||
:list="tabMaps"
|
|
||||||
@change="onChangeTab"
|
|
||||||
:scrollable="false"
|
|
||||||
:current="state.currentTab"
|
|
||||||
></su-tabs>
|
|
||||||
</su-sticky>
|
</su-sticky>
|
||||||
<s-empty
|
<s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无数据"></s-empty>
|
||||||
v-if="state.pagination.total === 0"
|
|
||||||
icon="/static/data-empty.png"
|
|
||||||
text="暂无数据"
|
|
||||||
></s-empty>
|
|
||||||
<!-- 转余额弹框 -->
|
<!-- 转余额弹框 -->
|
||||||
<su-popup
|
<su-popup :show="state.showModal" type="bottom" round="20" @close="state.showModal = false" showClose>
|
||||||
:show="state.showModal"
|
|
||||||
type="bottom"
|
|
||||||
round="20"
|
|
||||||
@close="state.showModal = false"
|
|
||||||
showClose
|
|
||||||
>
|
|
||||||
<view class="ss-p-x-20 ss-p-y-30">
|
<view class="ss-p-x-20 ss-p-y-30">
|
||||||
<view class="model-title ss-m-b-30 ss-m-l-20">转余额</view>
|
<view class="model-title ss-m-b-30 ss-m-l-20">转余额</view>
|
||||||
<view class="model-subtitle ss-m-b-100 ss-m-l-20">将您的佣金转到余额中继续消费</view>
|
<view class="model-subtitle ss-m-b-100 ss-m-l-20">将您的佣金转到余额中继续消费</view>
|
||||||
<view class="input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20">
|
<view class="input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20">
|
||||||
<view class="unit">¥</view>
|
<view class="unit">¥</view>
|
||||||
<uni-easyinput
|
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.amount" type="number"
|
||||||
:inputBorder="false"
|
placeholder="请输入金额" />
|
||||||
class="ss-flex-1 ss-p-l-10"
|
|
||||||
v-model="state.amount"
|
|
||||||
type="number"
|
|
||||||
placeholder="请输入金额"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<button
|
<button class="ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main" @tap="onConfirm">
|
||||||
class="ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main"
|
|
||||||
@tap="onConfirm"
|
|
||||||
>
|
|
||||||
确定
|
确定
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</su-popup>
|
</su-popup>
|
||||||
<!-- 钱包记录 -->
|
<!-- 钱包记录 -->
|
||||||
<view v-if="state.pagination.total > 0">
|
<view v-if="state.pagination.total > 0">
|
||||||
<view
|
<view class="wallet-list ss-flex border-bottom" v-for="item in state.pagination.data" :key="item.id">
|
||||||
class="wallet-list ss-flex border-bottom"
|
|
||||||
v-for="item in state.pagination.data"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<view class="list-content">
|
<view class="list-content">
|
||||||
<view class="title-box ss-flex ss-row-between ss-m-b-20">
|
<view class="title-box ss-flex ss-row-between ss-m-b-20">
|
||||||
<text class="title ss-line-1"
|
<!-- {{ item.memo ? '-' + item.memo : '' }} -->
|
||||||
>{{ item.event_text }}{{ item.memo ? '-' + item.memo : '' }}</text
|
<text class="title ss-line-1">{{ item.title }}</text>
|
||||||
>
|
|
||||||
<view class="money">
|
<view class="money">
|
||||||
<text v-if="item.amount >= 0" class="add">+{{ item.amount }}</text>
|
<text v-if="item.amount >= 0" class="add">+{{ item.price }}</text>
|
||||||
<text v-else class="minus">{{ item.amount }}</text>
|
<text v-else class="minus">{{ item.price }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="time">{{ item.create_time }}</text>
|
<text class="time">{{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <u-gap></u-gap> -->
|
<!-- <u-gap></u-gap> -->
|
||||||
<uni-load-more
|
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
|
||||||
v-if="state.pagination.total > 0"
|
|
||||||
:status="state.loadStatus"
|
|
||||||
:content-text="{
|
|
||||||
contentdown: '上拉加载更多',
|
contentdown: '上拉加载更多',
|
||||||
}"
|
}" />
|
||||||
/>
|
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, reactive } from 'vue';
|
import {
|
||||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
computed,
|
||||||
|
reactive
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
onReachBottom
|
||||||
|
} from '@dcloudio/uni-app';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
@ -157,6 +120,7 @@
|
||||||
income: 0,
|
income: 0,
|
||||||
};
|
};
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
userInfo: {},
|
||||||
showMoney: false,
|
showMoney: false,
|
||||||
date: [],
|
date: [],
|
||||||
currentTab: 0,
|
currentTab: 0,
|
||||||
|
@ -166,19 +130,18 @@
|
||||||
today: '',
|
today: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const tabMaps = [
|
const tabMaps = [{
|
||||||
{
|
name: '分佣',
|
||||||
name: '全部',
|
|
||||||
value: 'all',
|
value: 'all',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '收入',
|
name: '提现',
|
||||||
value: 'income',
|
value: 'income',
|
||||||
},
|
}
|
||||||
{
|
// {
|
||||||
name: '支出',
|
// name: '支出',
|
||||||
value: 'expense',
|
// value: 'expense',
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||||
|
|
||||||
|
@ -192,24 +155,27 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getLogList(page = 1, list_rows = 8) {
|
async function getLogList(page = 1, list_rows = 4) {
|
||||||
state.loadStatus = 'loading';
|
state.loadStatus = 'loading';
|
||||||
let res = await sheep.$api.user.wallet.log({
|
let ress = await sheep.$api.commission.getSummary();
|
||||||
type: 'commission',
|
state.userInfo = ress.data;
|
||||||
tab: tabMaps[state.currentTab].value,
|
let res = await sheep.$api.user.wallet.log3({
|
||||||
list_rows,
|
// type: 'commission',
|
||||||
page,
|
// tab: tabMaps[state.currentTab].value,
|
||||||
date: appendTimeHMS(state.date),
|
pageSize: list_rows,
|
||||||
|
pageNo: page,
|
||||||
|
// date: appendTimeHMS(state.date),
|
||||||
});
|
});
|
||||||
if (res.error === 0) {
|
if (res.code === 0) {
|
||||||
let list = _.concat(state.pagination.data, res.data.list.data);
|
let list = _.concat(state.pagination.data, res.data.list);
|
||||||
state.pagination = {
|
state.pagination = {
|
||||||
...res.data.list,
|
current_page: page,
|
||||||
|
...res.data,
|
||||||
data: list,
|
data: list,
|
||||||
income: res.data.income,
|
// income: res.data.income,
|
||||||
expense: res.data.expense,
|
// expense: res.data.expense,
|
||||||
};
|
};
|
||||||
if (state.pagination.current_page < state.pagination.last_page) {
|
if (state.pagination.data.length < state.pagination.total) {
|
||||||
state.loadStatus = 'more';
|
state.loadStatus = 'more';
|
||||||
} else {
|
} else {
|
||||||
state.loadStatus = 'noMore';
|
state.loadStatus = 'noMore';
|
||||||
|
@ -245,20 +211,27 @@
|
||||||
content: '确认把您的佣金转入到余额钱包中?',
|
content: '确认把您的佣金转入到余额钱包中?',
|
||||||
success: async function(res) {
|
success: async function(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
const { error } = await sheep.$api.commission.transfer({
|
const {
|
||||||
|
error
|
||||||
|
} = await sheep.$api.commission.transfer({
|
||||||
amount: state.amount,
|
amount: state.amount,
|
||||||
});
|
});
|
||||||
if (error === 0) {
|
if (error === 0) {
|
||||||
state.showModal = false;
|
state.showModal = false;
|
||||||
sheep.$store('user').getInfo();
|
sheep.$store('user').getInfo();
|
||||||
onChangeTab({ index: 0 });
|
onChangeTab({
|
||||||
|
index: 0
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async function getAgentInfo() {
|
async function getAgentInfo() {
|
||||||
const { code, data } = await sheep.$store('user').getAgentInfo();
|
const {
|
||||||
|
code,
|
||||||
|
data
|
||||||
|
} = await sheep.$store('user').getAgentInfo();
|
||||||
}
|
}
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
state.today = dayjs().format('YYYY-MM-DD');
|
state.today = dayjs().format('YYYY-MM-DD');
|
||||||
|
@ -354,6 +327,7 @@
|
||||||
|
|
||||||
.loading-money {
|
.loading-money {
|
||||||
margin-top: 56rpx;
|
margin-top: 56rpx;
|
||||||
|
|
||||||
.loading-money-title {
|
.loading-money-title {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
|
@ -60,5 +60,21 @@ export default {
|
||||||
url: '/app-api/member/sign-in/record/get-summary',
|
url: '/app-api/member/sign-in/record/get-summary',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}),
|
}),
|
||||||
|
getBargainRecordSummary: () =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/promotion/bargain-record/get-summary',
|
||||||
|
method: 'GET',
|
||||||
|
}),
|
||||||
|
getBargainActivityPage: () =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/promotion/bargain-activity/page',
|
||||||
|
method: 'GET',
|
||||||
|
}),
|
||||||
|
getBargainActivityDetail: (params) =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/promotion/bargain-activity/get-detail',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
|
|
||||||
};
|
};
|
|
@ -37,7 +37,7 @@ export default {
|
||||||
// 分销订单
|
// 分销订单
|
||||||
order: (params) =>
|
order: (params) =>
|
||||||
request({
|
request({
|
||||||
url: 'commission/order',
|
url: '/app-api/trade/brokerage-record/page',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params,
|
params,
|
||||||
}),
|
}),
|
||||||
|
@ -52,7 +52,7 @@ export default {
|
||||||
// 我的团队
|
// 我的团队
|
||||||
team: (params) =>
|
team: (params) =>
|
||||||
request({
|
request({
|
||||||
url: 'commission/agent/team',
|
url: '/app-api/trade/brokerage-user/child-summary-page',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params,
|
params,
|
||||||
}),
|
}),
|
||||||
|
@ -68,4 +68,22 @@ export default {
|
||||||
url: '/app-api/trade/brokerage-user/get-summary',
|
url: '/app-api/trade/brokerage-user/get-summary',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}),
|
}),
|
||||||
|
getBrokerageRankNumber: (params) =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/trade/brokerage-user/get-rank-by-price',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
|
getBrokerageRankList: (params) =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/trade/brokerage-user/rank-page-by-price',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
|
getRanklist: (params) =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/trade/brokerage-user/rank-page-by-user-count',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
};
|
};
|
|
@ -32,13 +32,23 @@ export default {
|
||||||
}),
|
}),
|
||||||
apply: (data) =>
|
apply: (data) =>
|
||||||
request({
|
request({
|
||||||
url: 'withdraw/apply',
|
url: '/app-api/trade/brokerage-withdraw/create',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
custom: {
|
custom: {
|
||||||
loadingMsg: '申请中',
|
loadingMsg: '申请中',
|
||||||
auth: true,
|
// auth: true,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
userGet: (params) =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/trade/brokerage-user/get',
|
||||||
|
method: 'GET',
|
||||||
|
params,
|
||||||
|
// custom: {
|
||||||
|
// loadingMsg: '申请中',
|
||||||
|
// auth: true,
|
||||||
|
// },
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
};
|
};
|
|
@ -2,17 +2,19 @@ import request from '@/sheep/request';
|
||||||
|
|
||||||
const DiyTemplateApi = {
|
const DiyTemplateApi = {
|
||||||
// TODO 芋艿:测试
|
// TODO 芋艿:测试
|
||||||
getUsedDiyTemplate: () => {
|
// getUsedDiyTemplate: () => {
|
||||||
return request({
|
// return request({
|
||||||
url: '/app-api/promotion/diy-template/used',
|
// url: '/app-api/promotion/diy-template/used',
|
||||||
method: 'GET',
|
// method: 'GET',
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
getDiyTemplate: (id) => {
|
getDiyTemplate: (id) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/app-api/promotion/diy-template/get',
|
url: '/app-api/promotion/diy-template/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { id }
|
params: {
|
||||||
|
id
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -293,6 +293,13 @@ export default {
|
||||||
params,
|
params,
|
||||||
custom: {},
|
custom: {},
|
||||||
}),
|
}),
|
||||||
|
log3: (params) =>
|
||||||
|
request({
|
||||||
|
url: '/app-api/trade/brokerage-record/page',
|
||||||
|
// url: 'pay/wallet-transaction/page',
|
||||||
|
method: 'GET',
|
||||||
|
params,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
account: {
|
account: {
|
||||||
info: (params) =>
|
info: (params) =>
|
||||||
|
|
|
@ -0,0 +1,173 @@
|
||||||
|
<template>
|
||||||
|
<view class="time" :style="justifyLeft">
|
||||||
|
<text class="" v-if="tipText">{{ tipText }}</text>
|
||||||
|
<text class="styleAll p6" v-if="isDay === true"
|
||||||
|
:style="{background:bgColor.bgColor,color:bgColor.Color}">{{ day }}{{bgColor.isDay?'天':''}}</text>
|
||||||
|
<text class="timeTxt" v-if="dayText"
|
||||||
|
:style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ dayText }}</text>
|
||||||
|
<text class="styleAll" :class='isCol?"timeCol":""'
|
||||||
|
:style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ hour }}</text>
|
||||||
|
<text class="timeTxt" v-if="hourText" :class='isCol?"whit":""'
|
||||||
|
:style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ hourText }}</text>
|
||||||
|
<text class="styleAll" :class='isCol?"timeCol":""'
|
||||||
|
:style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ minute }}</text>
|
||||||
|
<text class="timeTxt" v-if="minuteText" :class='isCol?"whit":""'
|
||||||
|
:style="{width:bgColor.timeTxtwidth,color:bgColor.bgColor}">{{ minuteText }}</text>
|
||||||
|
<text class="styleAll" :class='isCol?"timeCol":""'
|
||||||
|
:style="{background:bgColor.bgColor,color:bgColor.Color,width:bgColor.width}">{{ second }}</text>
|
||||||
|
<text class="timeTxt" v-if="secondText">{{ secondText }}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "countDown",
|
||||||
|
props: {
|
||||||
|
justifyLeft: {
|
||||||
|
type: String,
|
||||||
|
default: ""
|
||||||
|
},
|
||||||
|
//距离开始提示文字
|
||||||
|
tipText: {
|
||||||
|
type: String,
|
||||||
|
default: "倒计时"
|
||||||
|
},
|
||||||
|
dayText: {
|
||||||
|
type: String,
|
||||||
|
default: "天"
|
||||||
|
},
|
||||||
|
hourText: {
|
||||||
|
type: String,
|
||||||
|
default: "时"
|
||||||
|
},
|
||||||
|
minuteText: {
|
||||||
|
type: String,
|
||||||
|
default: "分"
|
||||||
|
},
|
||||||
|
secondText: {
|
||||||
|
type: String,
|
||||||
|
default: "秒"
|
||||||
|
},
|
||||||
|
datatime: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
isDay: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
isCol: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
bgColor: {
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
day: "00",
|
||||||
|
hour: "00",
|
||||||
|
minute: "00",
|
||||||
|
second: "00"
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created: function() {
|
||||||
|
this.show_time();
|
||||||
|
},
|
||||||
|
mounted: function() {},
|
||||||
|
methods: {
|
||||||
|
show_time: function() {
|
||||||
|
let that = this;
|
||||||
|
|
||||||
|
function runTime() {
|
||||||
|
//时间函数
|
||||||
|
let intDiff = that.datatime - Date.parse(new Date()) / 1000; //获取数据中的时间戳的时间差;
|
||||||
|
let day = 0,
|
||||||
|
hour = 0,
|
||||||
|
minute = 0,
|
||||||
|
second = 0;
|
||||||
|
if (intDiff > 0) {
|
||||||
|
//转换时间
|
||||||
|
if (that.isDay === true) {
|
||||||
|
day = Math.floor(intDiff / (60 * 60 * 24));
|
||||||
|
} else {
|
||||||
|
day = 0;
|
||||||
|
}
|
||||||
|
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
|
||||||
|
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
|
||||||
|
second =
|
||||||
|
Math.floor(intDiff) -
|
||||||
|
day * 24 * 60 * 60 -
|
||||||
|
hour * 60 * 60 -
|
||||||
|
minute * 60;
|
||||||
|
if (hour <= 9) hour = "0" + hour;
|
||||||
|
if (minute <= 9) minute = "0" + minute;
|
||||||
|
if (second <= 9) second = "0" + second;
|
||||||
|
that.day = day;
|
||||||
|
that.hour = hour;
|
||||||
|
that.minute = minute;
|
||||||
|
that.second = second;
|
||||||
|
} else {
|
||||||
|
that.day = "00";
|
||||||
|
that.hour = "00";
|
||||||
|
that.minute = "00";
|
||||||
|
that.second = "00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
runTime();
|
||||||
|
setInterval(runTime, 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.p6 {
|
||||||
|
padding: 0 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.styleAll {
|
||||||
|
/* color: #fff; */
|
||||||
|
font-size: 24rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
text-align: center;
|
||||||
|
/* padding: 0 6rpx; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeTxt {
|
||||||
|
text-align: center;
|
||||||
|
/* width: 16rpx; */
|
||||||
|
height: 36rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.whit {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
color: #fc4141;
|
||||||
|
margin: 0 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeCol {
|
||||||
|
/* width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-align:center;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: #fff;
|
||||||
|
font-size: 24rpx; */
|
||||||
|
color: #E93323;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -215,8 +215,8 @@ const request = (config) => {
|
||||||
}
|
}
|
||||||
// TODO 芋艿:额外拼接
|
// TODO 芋艿:额外拼接
|
||||||
if (config.url.indexOf('/app-api/') >= 0) {
|
if (config.url.indexOf('/app-api/') >= 0) {
|
||||||
// config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
|
config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
|
||||||
config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
|
// config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
|
||||||
}
|
}
|
||||||
return http.middleware(config);
|
return http.middleware(config);
|
||||||
};
|
};
|
||||||
|
|
|
@ -215,9 +215,9 @@ const request = (config) => {
|
||||||
// TODO 芋艿:额外拼接
|
// TODO 芋艿:额外拼接
|
||||||
if (config.url.indexOf('/app-api/') >= 0) {
|
if (config.url.indexOf('/app-api/') >= 0) {
|
||||||
// 设置接口地址
|
// 设置接口地址
|
||||||
// config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
|
config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
|
||||||
// config.url = 'https://app.test.huizhizao.vip/prod-api' + config.url; // 调用【云端】
|
// config.url = 'https://app.test.huizhizao.vip/prod-api' + config.url; // 调用【云端】
|
||||||
config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
|
// config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
|
||||||
}
|
}
|
||||||
return http.middleware(config);
|
return http.middleware(config);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue