分销商品列表-分销账户信息

pull/29/head
落日晚风 2023-12-18 17:58:00 +08:00
parent 4cb256af6c
commit 4a487b5894
9 changed files with 801 additions and 771 deletions

View File

@ -5,15 +5,9 @@
<view class="ss-flex ss-row-between card-box-header">
<view class="ss-flex">
<view class="header-title ss-m-r-16">账户信息</view>
<button
class="ss-reset-button look-btn ss-flex"
@tap="state.showMoney = !state.showMoney"
>
<uni-icons
:type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'"
color="#A57A55"
size="20"
></uni-icons>
<button class="ss-reset-button look-btn ss-flex" @tap="state.showMoney = !state.showMoney">
<uni-icons :type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'" color="#A57A55"
size="20"></uni-icons>
</button>
</view>
<view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')">
@ -24,21 +18,21 @@
<!-- 收益 -->
<view class="card-content ss-flex">
<view class="ss-flex-1 ss-flex-col ss-col-center">
<view class="item-title">总收益()</view>
<view class="item-title">当前佣金()</view>
<view class="item-detail">
{{ state.showMoney ? agentInfo.total_income || '0.00' : '***' }}
{{ state.showMoney ? userInfo.brokeragePrice || '0.00' : '***' }}
</view>
</view>
<view class="ss-flex-1 ss-flex-col ss-col-center">
<view class="item-title">的佣金()</view>
<view class="item-title">昨天的佣金()</view>
<view class="item-detail">
{{ state.showMoney ? userInfo.commission || '0.00' : '***' }}
{{ state.showMoney ? userInfo.yesterdayPrice || '0.00' : '***' }}
</view>
</view>
<view class="ss-flex-1 ss-flex-col ss-col-center">
<view class="item-title">我的消费()</view>
<view class="item-title">累计已提()</view>
<view class="item-detail">
{{ state.showMoney ? userInfo.total_consume || '0.00' : '***' }}
{{ state.showMoney ? userInfo.withdrawPrice || '0.00' : '***' }}
</view>
</view>
</view>
@ -48,7 +42,11 @@
<script setup>
import sheep from '@/sheep';
import { computed, reactive } from 'vue';
import {
computed,
reactive,
onMounted
} from 'vue';
const userInfo = computed(() => sheep.$store('user').userInfo);
const agentInfo = computed(() => sheep.$store('user').agentInfo);
@ -56,6 +54,10 @@
const state = reactive({
showMoney: false,
});
onMounted(async () => {
let res = await sheep.$api.commission.getSummary();
userInfo = res.data;
})
</script>
<style lang="scss" scoped>
@ -67,27 +69,33 @@
border-radius: 12rpx;
z-index: 3;
position: relative;
.account-card-box {
background: #ffefd6;
.card-box-header {
padding: 0 30rpx;
height: 72rpx;
box-shadow: 0px 2px 6px #f2debe;
.header-title {
font-size: 24rpx;
font-weight: 500;
color: #a17545;
line-height: 30rpx;
}
.cicon-play-arrow {
color: #a17545;
font-size: 24rpx;
line-height: 30rpx;
}
}
.card-content {
height: 190rpx;
background: #fdfae9;
.item-title {
font-size: 24rpx;
font-weight: 500;
@ -95,6 +103,7 @@
line-height: 30rpx;
margin-bottom: 24rpx;
}
.item-detail {
font-size: 36rpx;
font-family: OPPOSANS;

View File

@ -11,12 +11,8 @@
<view class="user-name">{{ userInfo.nickname }}</view>
<view class="user-info-box ss-flex">
<view class="tag-box ss-flex" v-if="agentInfo.level_info">
<image
v-if="agentInfo.level_info?.image"
class="tag-img"
:src="sheep.$url.cdn(agentInfo.level_info?.image)"
mode="aspectFill"
>
<image v-if="agentInfo.level_info?.image" class="tag-img"
:src="sheep.$url.cdn(agentInfo.level_info?.image)" mode="aspectFill">
</image>
<text class="tag-title">{{ agentInfo.level_info?.name }}</text>
</view>
@ -31,12 +27,15 @@
<script setup>
import sheep from '@/sheep';
import { computed, reactive } from 'vue';
import {
computed,
reactive
} from 'vue';
const userInfo = computed(() => sheep.$store('user').userInfo);
const agentInfo = computed(() => sheep.$store('user').agentInfo);
const headerBg = sheep.$url.css('/static/img/shop/commission/background.png');
console.log(userInfo);
const state = reactive({
showMoney: false,
});
@ -74,6 +73,7 @@
.card-top {
box-sizing: border-box;
padding-bottom: 34rpx;
.user-name {
font-size: 32rpx;
font-weight: bold;

View File

@ -2,53 +2,42 @@
<template>
<s-layout title="推广商品" :onShareAppMessage="state.shareInfo">
<view class="goods-item ss-m-20" v-for="item in state.pagination.data" :key="item.id">
<s-goods-item
size="lg"
:img="item.image"
:title="item.title"
:subTitle="item.subtitle"
:price="item.price[0]"
:originPrice="item.original_price"
priceColor="#333"
@tap="sheep.$router.go('/pages/goods/index', { id: item.id })"
>
<s-goods-item size="lg" :img="item.picUrl" :title="item.name" :subTitle="item.subtitle" :price="item.price"
:originPrice="item.original_price" priceColor="#333"
@tap="sheep.$router.go('/pages/goods/index', { id: item.id })">
<template #rightBottom>
<view class="ss-flex ss-row-between">
<view class="commission-num">预计佣金{{ item.commission }}</view>
<button
class="ss-reset-button share-btn ui-BG-Main-Gradient"
@tap.stop="onShareGoods(item)"
>
<button class="ss-reset-button share-btn ui-BG-Main-Gradient" @tap.stop="onShareGoods(item)">
分享赚
</button>
</view>
</template>
</s-goods-item>
</view>
<s-empty
v-if="state.pagination.total === 0"
icon="/static/goods-empty.png"
text="暂无推广商品"
></s-empty>
<s-empty v-if="state.pagination.total === 0" icon="/static/goods-empty.png" text="暂无推广商品"></s-empty>
<!-- 加载更多 -->
<uni-load-more
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
contentdown: '上拉加载更多',
}"
@tap="loadmore"
/>
}" @tap="loadmore" />
</s-layout>
</template>
<script setup>
import sheep from '@/sheep';
import $share from '@/sheep/platform/share';
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import { computed, reactive } from 'vue';
import {
onLoad,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive
} from 'vue';
import _ from 'lodash';
import { showShareModal } from '@/sheep/hooks/useModal';
import {
showShareModal
} from '@/sheep/hooks/useModal';
const state = reactive({
pagination: {
@ -62,8 +51,7 @@
});
function onShareGoods(goodsInfo) {
state.shareInfo = $share.getShareInfo(
{
state.shareInfo = $share.getShareInfo({
title: goodsInfo.title,
image: sheep.$url.cdn(goodsInfo.image),
desc: goodsInfo.subtitle,
@ -71,31 +59,29 @@
page: '2',
query: goodsInfo.id,
},
},
{
}, {
type: 'goods', //
title: goodsInfo.title, //
image: sheep.$url.cdn(goodsInfo.image), //
price: goodsInfo.price[0], //
original_price: goodsInfo.original_price, //
},
);
}, );
showShareModal();
}
async function getGoodsList(page = 1, list_rows = 8) {
state.pagination.current_page = page;
state.loadStatus = 'loading';
let res = await sheep.$api.commission.goods({
list_rows,
page,
pageSize: list_rows,
pageNo: page,
});
if (res.error === 0) {
let orderList = _.concat(state.pagination.data, res.data.data);
if (res.code === 0) {
let orderList = _.concat(state.pagination.data, res.data.list);
state.pagination = {
...res.data,
data: orderList,
};
if (state.pagination.current_page < state.pagination.last_page) {
if (state.pagination.data.length < state.pagination.total) {
state.loadStatus = 'more';
} else {
state.loadStatus = 'noMore';

View File

@ -1,15 +1,12 @@
<!-- 分销订单 -->
<template>
<s-layout title="分销订单" :class="state.scrollTop ? 'order-warp' : ''" navbar="inner">
<view
class="header-box"
:style="[
<view class="header-box" :style="[
{
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
paddingTop: Number(statusBarHeight + 108) + 'rpx',
},
]"
>
]">
<!-- 团队数据总览 -->
<view class="team-data-box ss-flex ss-col-center ss-row-between">
<view class="data-card">
@ -76,12 +73,7 @@
<!-- tab -->
<su-sticky bgColor="#fff">
<su-tabs
:list="tabMaps"
:scrollable="false"
:current="state.currentTab"
@change="onTabsChange"
>
<su-tabs :list="tabMaps" :scrollable="false" :current="state.currentTab" @change="onTabsChange">
</su-tabs>
</su-sticky>
@ -103,14 +95,9 @@
<view class="order-time">{{ item.create_time }}</view>
</view>
</view>
<s-goods-item
class="border-bottom"
:img="item.order_item.goods_image"
:title="item.order_item.goods_title"
:skuText="item.order_item.goods_sku_text"
:price="item.order_item.goods_price"
:num="item.order_item.goods_num"
>
<s-goods-item class="border-bottom" :img="item.order_item.goods_image"
:title="item.order_item.goods_title" :skuText="item.order_item.goods_sku_text"
:price="item.order_item.goods_price" :num="item.order_item.goods_num">
<template #rightBottom>
<view class="ss-flex commission-box ss-row-between ss-m-t-10">
<view class="ss-flex">
@ -128,14 +115,9 @@
<s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单">
</s-empty>
<!-- 加载更多 -->
<uni-load-more
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
contentdown: '上拉加载更多',
}"
@tap="loadmore"
/>
}" @tap="loadmore" />
</view>
<!-- </view> -->
</s-layout>
@ -143,10 +125,18 @@
<script setup>
import sheep from '@/sheep';
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import { computed, reactive } from 'vue';
import {
onLoad,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive
} from 'vue';
import _ from 'lodash';
import { onPageScroll } from '@dcloudio/uni-app';
import {
onPageScroll
} from '@dcloudio/uni-app';
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
@ -171,8 +161,7 @@
scrollTop: false,
});
const tabMaps = [
{
const tabMaps = [{
name: '全部',
value: 'all',
},
@ -228,7 +217,11 @@
}
async function getAgentInfo() {
const { error, data, msg } = await sheep.$api.commission.agent();
const {
error,
data,
msg
} = await sheep.$api.commission.agent();
if (error === 0) {
state.agentInfo = data;
}
@ -260,6 +253,7 @@
background: v-bind(headerBg) no-repeat,
linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
background-size: 750rpx 100%;
//
.team-data-box {
.data-card {

28
project.config.json Normal file
View File

@ -0,0 +1,28 @@
{
"appid": "wxd4da84f87dcafd80",
"compileType": "miniprogram",
"libVersion": "3.2.4",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}

View File

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "uni3",
"setting": {
"compileHotReLoad": true
}
}

View File

@ -41,10 +41,11 @@ export default {
method: 'GET',
params,
}),
// 分销商品
goods: (params) =>
request({
url: 'commission/goods',
url: '/app-api/product/spu/page',
method: 'GET',
params,
}),
@ -62,4 +63,9 @@ export default {
method: 'POST',
data,
}),
getSummary: (data) =>
request({
url: '/app-api/trade/brokerage-user/get-summary',
method: 'GET',
}),
};

View File

@ -128,7 +128,7 @@ http.interceptors.response.use(
// 成功时的提示
if (
(response.data.error === 0 || response.data.code === 0) &&
( response.data.msg !== '' || response.config.custom.successMsg !== '' ) &&
(response.data.msg !== '' || response.config.custom.successMsg !== '') &&
response.config.custom.showSuccess
) {
uni.showToast({
@ -215,8 +215,8 @@ const request = (config) => {
}
// TODO 芋艿:额外拼接
if (config.url.indexOf('/app-api/') >= 0) {
// config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
// config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
}
return http.middleware(config);
};