This commit is contained in:
2025-05-13 10:45:51 +08:00
parent ce0587d2b6
commit ddfd747704
12 changed files with 208 additions and 18 deletions

View File

@@ -236,6 +236,13 @@ const system = {
data: {id}
});
},
acceptTask: async (data) => {
return request({
method: MethodsENUM.POST,
url: "/task/acceptTask",
data: data
});
},
}
export default system;

View File

@@ -0,0 +1,148 @@
<script setup lang="ts">
import NULLICON from "../static/images/缺省图.png";
import XModal from "./XModal.vue";
import {getCurrentInstance, nextTick, onMounted, reactive, ref, watch} from "vue";
import PlatformENUM from "../enum/PlatformENUM";
import Api from "../api/index";
import {showToast} from "../utils/uils";
const {details} = defineProps({
details: {
type: Object,
default: {}
}
});
const show = ref(false);
const tabWidth = ref(0);
const selected = ref(null);
const po = reactive({
status: 0
});
const vo = reactive([]);
const tabs = [
{
id: 1,
name: '正常帐号'
},
{
id: 2,
name: '异常帐号'
},
{
id: 3,
name: '隐藏帐号'
},
];
const getData = async () => {
const {data} = await Api.system.myAccount({
status: po.status + 1
});
vo.length = 0;
vo.push(...data);
}
const change = (e) => {
po.status = e.index;
getData();
}
onMounted(() => {
nextTick(() => {
const instance = getCurrentInstance();
uni.createSelectorQuery()
.in(instance)
.select("#tabBox")
.boundingClientRect()
.exec((result) => {
console.log('我看看?', result[0])
tabWidth.value = result[0].width - 72;
})
});
})
watch(
() => show.value,
(val) => {
if (val) getData();
},
{deep: true}
)
const success = async () => {
const {msg} = await Api.system.acceptTask({
id: details.id,
account: selected.value,
});
showToast(msg);
show.value = false;
}
</script>
<template>
<view @click="show=true">
<slot></slot>
</view>
<x-modal
v-model:show="show"
width="calc(100% - 60rpx)">
<view class="box">
<view class="text-center test-32r">选择接受此任务的账号</view>
<view class="test-24r bg-[#FFF7E8] text-[#FF7D00] py-[16rpx] text-center !mt-[20rpx]">
任务接受后无法放弃逾期或失败会影响您的收益
</view>
<view id="tabBox" class="w-full !mt-[20rpx]">
<tui-tabs
v-if="tabWidth"
:tabs="tabs"
:width="tabWidth"
:currentTab="po.status"
@change="change">
</tui-tabs>
</view>
<view class="!mt-[20rpx] px-[16rpx]">
<template v-if="vo.length > 0">
<view
:key="index"
@click="v.is_use !== 0 ? selected = v.id : null"
v-for="(v, index) in vo"
class="!flex items-center py-[22rpx]">
<radio :checked="selected === v.id" :disabled="v.is_use === 0"></radio>
<image class="!size-[80rpx] rounded-[50%] overflow-hidden !ml-[34rpx]"
:src="PlatformENUM[v.platform_id]"></image>
<view class="!flex flex-col !ml-[16rpx]">
<view class="test-28r">{{ v.nickname }}</view>
<view class="text-[#86909C] test-24r">{{ v.account }}</view>
</view>
<view class="text-[#4E5969] test-24r bg-[#F2F3F5] rounded-[4rpx] !ml-auto"
v-if="v.is_use === 0">
今日已接其他任务
</view>
</view>
</template>
<template v-else>
<view class="!flex flex-col items-center pb-[50rpx]">
<image class="!size-[260rpx]" :src="NULLICON"></image>
<view class="test-28r">
可在我的账号管理中添加自媒体账号
</view>
</view>
</template>
</view>
<view class="!flex gap-[24rpx] !mt-[20rpx]">
<tui-button type="gray-primary" @click="show=false">取消</tui-button>
<tui-button @click="success">确定</tui-button>
</view>
</view>
</x-modal>
</template>
<style scoped lang="scss">
.box {
@apply px-[32rpx] py-[40rpx];
}
</style>

View File

@@ -1,8 +1,10 @@
<script setup>
import timeIcon from "../static/icons/time.png";
import {ref} from "vue";
const modalValue = defineModel();
const {placeholder, fields} = defineProps({
const DateTimeRef = ref();
const {placeholder, fields, type} = defineProps({
placeholder: {
type: String,
default: "请选择时间",
@@ -10,23 +12,33 @@ const {placeholder, fields} = defineProps({
fields: {
type: String,
default: 'day'
},
type: {
type: Number,
default: 2
}
});
const success = ({detail: {value}}) => {
modalValue.value = value;
const open = () => {
DateTimeRef.value.show();
}
const success = ({result}) => {
modalValue.value = result;
}
</script>
<template>
<picker mode="date" :class="[!$slots.default ? 'x-date-input' : '']" @change="success" :fields="fields">
<view v-if="!$slots.default" class="!flex items-center justify-center gap-[20rpx]">
<view :class="[!$slots.default ? 'x-date-input' : '']">
<view v-if="!$slots.default" class="!flex items-center justify-center gap-[20rpx]" @click="open">
<image class="!size-[24rpx]" :src="timeIcon"></image>
<text v-if="!modalValue" class="text-[#666]">{{ placeholder }}</text>
<text class="test-24r" v-else>{{ modalValue }}</text>
</view>
<slot v-else></slot>
</picker>
</view>
<tui-datetime ref="DateTimeRef" :type="type" @confirm="success"></tui-datetime>
</template>
<style lang="scss" scoped>

View File

@@ -18,7 +18,7 @@ const list = reactive([]);
const modelValue = defineModel();
const change = ({detail: {value}}) => {
modelValue.value = list[value].id;
modelValue.value = list.filter(v => !v.hidden)[value].id;
}
onMounted(() => {

15
src/enum/PlatformENUM.js Normal file
View File

@@ -0,0 +1,15 @@
import DYICON from "../static/icons/dy.png";
import KSICON from "../static/icons/ks.png";
import XHSICON from "../static/icons/xhs.png";
import SPHICON from "../static/icons/sph.png";
import TTICON from "../static/icons/tt.png";
const PlatformENUM = {
1: DYICON,
2: KSICON,
3: XHSICON,
4: SPHICON,
5: TTICON,
}
export default PlatformENUM;

View File

@@ -24,7 +24,7 @@ function useTableQuery({
const pagination = reactive({
page: 1,
pageSize: 20,
pageSize: 9,
total: 0
});

View File

@@ -9,6 +9,8 @@ import XUpload from "../../components/XUpload.vue";
import {reactive} from "vue";
import {backPage, showToast} from "../../utils/uils.js";
import {onLoad} from "@dcloudio/uni-app";
import XDateRange from "../../components/XDateRange.vue";
import XDateTime from "../../components/XDateTime.vue";
const form = reactive({
status: null,
@@ -67,6 +69,9 @@ onLoad((options) => {
<x-form-item label="账号状态">
<x-select v-model:model-value="form.status" :api="Api.system.getAccountStatus"></x-select>
</x-form-item>
<x-form-item label="恢复时间" v-if="form.status === 2">
<x-date-time :type="1" v-model:model-value="form.abnormaltime"></x-date-time>
</x-form-item>
<x-form-item label="主页截图">
<x-upload v-model:files="form.homepage"></x-upload>
</x-form-item>

View File

@@ -104,7 +104,9 @@ onMounted(() => {
<scroll-view
@refresherpulling="initFetchData()"
@scrolltolower="pagination.page++"
@scrolltolower="() => {
console.log('触发')
}"
class="h-[calc(100vh-200rpx)]"
scroll-y>
<view class="relative overflow-hidden bg-b-r !pb-[34rpx]">
@@ -160,7 +162,7 @@ onMounted(() => {
<view class="!flex flex-col gap-[20rpx] !mt-[20rpx] !px-[20rpx]">
<task-item v-for="i in vo.rows" :key="i.id" :data="i"></task-item>
<tui-loadmore v-if="loading" text="加载中..."></tui-loadmore>
<tui-loadmore v-if="loading" text="加载中..." :index="2"></tui-loadmore>
</view>
</scroll-view>
</template>

View File

@@ -9,7 +9,7 @@ import {useUserStore} from "../../pinia/UserStore/index.js";
const UserStore = useUserStore();
const form = reactive({
mobile: '15709267061',
mobile: '17502997128',
password: '123456',
});

View File

@@ -10,6 +10,7 @@ import Api from "../../api/index.js";
import dayjs from "dayjs";
import XPrompt from "../../components/XPrompt.vue";
import {numberToCharacter} from "../../utils/uils.js";
import AcceptAssignmentModal from "../../components/AcceptAssignmentModal.vue";
// #ifdef APP-PLUS
// #endif
@@ -348,11 +349,12 @@ onMounted(() => {
</view>
</view>
<view
v-if="details.is_use === 0"
class="bg-[var(--primary-color)] rounded-[8rpx] py-[26rpx] text-[#fff] !flex justify-center items-center">
接受任务
</view>
<accept-assignment-modal v-if="details.is_use === 0" :details="details">
<view
class="bg-[var(--primary-color)] rounded-[8rpx] py-[26rpx] text-[#fff] !flex justify-center items-center">
接受任务
</view>
</accept-assignment-modal>
<view
v-else

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -21,7 +21,7 @@ request.interceptors.request.use(
config.headers['Access-Token'] = token;
}
console.log('请求拦截器', config.data);
console.log(`请求拦截器${config.url}`, config.data);
if (!config.UN_AES) {
const {context, iv} = AESCrypto.encrypt(JSON.stringify(config.data));
@@ -42,7 +42,6 @@ request.interceptors.request.use(
// 响应拦截器
request.interceptors.response.use((response) => {
const {data: {msg, code, data}, config: {url}} = response;
console.log('接口返回', response)
if (code === 401) {
const {logout} = useUserStore();
logout();