update
This commit is contained in:
@@ -236,6 +236,13 @@ const system = {
|
|||||||
data: {id}
|
data: {id}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
acceptTask: async (data) => {
|
||||||
|
return request({
|
||||||
|
method: MethodsENUM.POST,
|
||||||
|
url: "/task/acceptTask",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default system;
|
export default system;
|
||||||
|
|||||||
148
src/components/AcceptAssignmentModal.vue
Normal file
148
src/components/AcceptAssignmentModal.vue
Normal 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>
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import timeIcon from "../static/icons/time.png";
|
import timeIcon from "../static/icons/time.png";
|
||||||
|
import {ref} from "vue";
|
||||||
|
|
||||||
const modalValue = defineModel();
|
const modalValue = defineModel();
|
||||||
const {placeholder, fields} = defineProps({
|
const DateTimeRef = ref();
|
||||||
|
const {placeholder, fields, type} = defineProps({
|
||||||
placeholder: {
|
placeholder: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "请选择时间",
|
default: "请选择时间",
|
||||||
@@ -10,23 +12,33 @@ const {placeholder, fields} = defineProps({
|
|||||||
fields: {
|
fields: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'day'
|
default: 'day'
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: Number,
|
||||||
|
default: 2
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const success = ({detail: {value}}) => {
|
const open = () => {
|
||||||
modalValue.value = value;
|
DateTimeRef.value.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
const success = ({result}) => {
|
||||||
|
modalValue.value = result;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<picker mode="date" :class="[!$slots.default ? 'x-date-input' : '']" @change="success" :fields="fields">
|
<view :class="[!$slots.default ? 'x-date-input' : '']">
|
||||||
<view v-if="!$slots.default" class="!flex items-center justify-center gap-[20rpx]">
|
<view v-if="!$slots.default" class="!flex items-center justify-center gap-[20rpx]" @click="open">
|
||||||
<image class="!size-[24rpx]" :src="timeIcon"></image>
|
<image class="!size-[24rpx]" :src="timeIcon"></image>
|
||||||
<text v-if="!modalValue" class="text-[#666]">{{ placeholder }}</text>
|
<text v-if="!modalValue" class="text-[#666]">{{ placeholder }}</text>
|
||||||
<text class="test-24r" v-else>{{ modalValue }}</text>
|
<text class="test-24r" v-else>{{ modalValue }}</text>
|
||||||
</view>
|
</view>
|
||||||
<slot v-else></slot>
|
<slot v-else></slot>
|
||||||
</picker>
|
</view>
|
||||||
|
|
||||||
|
<tui-datetime ref="DateTimeRef" :type="type" @confirm="success"></tui-datetime>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const list = reactive([]);
|
|||||||
const modelValue = defineModel();
|
const modelValue = defineModel();
|
||||||
|
|
||||||
const change = ({detail: {value}}) => {
|
const change = ({detail: {value}}) => {
|
||||||
modelValue.value = list[value].id;
|
modelValue.value = list.filter(v => !v.hidden)[value].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
15
src/enum/PlatformENUM.js
Normal file
15
src/enum/PlatformENUM.js
Normal 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;
|
||||||
@@ -24,7 +24,7 @@ function useTableQuery({
|
|||||||
|
|
||||||
const pagination = reactive({
|
const pagination = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 20,
|
pageSize: 9,
|
||||||
total: 0
|
total: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import XUpload from "../../components/XUpload.vue";
|
|||||||
import {reactive} from "vue";
|
import {reactive} from "vue";
|
||||||
import {backPage, showToast} from "../../utils/uils.js";
|
import {backPage, showToast} from "../../utils/uils.js";
|
||||||
import {onLoad} from "@dcloudio/uni-app";
|
import {onLoad} from "@dcloudio/uni-app";
|
||||||
|
import XDateRange from "../../components/XDateRange.vue";
|
||||||
|
import XDateTime from "../../components/XDateTime.vue";
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
status: null,
|
status: null,
|
||||||
@@ -67,6 +69,9 @@ onLoad((options) => {
|
|||||||
<x-form-item label="账号状态">
|
<x-form-item label="账号状态">
|
||||||
<x-select v-model:model-value="form.status" :api="Api.system.getAccountStatus"></x-select>
|
<x-select v-model:model-value="form.status" :api="Api.system.getAccountStatus"></x-select>
|
||||||
</x-form-item>
|
</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-form-item label="主页截图">
|
||||||
<x-upload v-model:files="form.homepage"></x-upload>
|
<x-upload v-model:files="form.homepage"></x-upload>
|
||||||
</x-form-item>
|
</x-form-item>
|
||||||
|
|||||||
@@ -104,7 +104,9 @@ onMounted(() => {
|
|||||||
|
|
||||||
<scroll-view
|
<scroll-view
|
||||||
@refresherpulling="initFetchData()"
|
@refresherpulling="initFetchData()"
|
||||||
@scrolltolower="pagination.page++"
|
@scrolltolower="() => {
|
||||||
|
console.log('触发')
|
||||||
|
}"
|
||||||
class="h-[calc(100vh-200rpx)]"
|
class="h-[calc(100vh-200rpx)]"
|
||||||
scroll-y>
|
scroll-y>
|
||||||
<view class="relative overflow-hidden bg-b-r !pb-[34rpx]">
|
<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]">
|
<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>
|
<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>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {useUserStore} from "../../pinia/UserStore/index.js";
|
|||||||
const UserStore = useUserStore();
|
const UserStore = useUserStore();
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
mobile: '15709267061',
|
mobile: '17502997128',
|
||||||
password: '123456',
|
password: '123456',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import Api from "../../api/index.js";
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import XPrompt from "../../components/XPrompt.vue";
|
import XPrompt from "../../components/XPrompt.vue";
|
||||||
import {numberToCharacter} from "../../utils/uils.js";
|
import {numberToCharacter} from "../../utils/uils.js";
|
||||||
|
import AcceptAssignmentModal from "../../components/AcceptAssignmentModal.vue";
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
// #endif
|
// #endif
|
||||||
@@ -348,11 +349,12 @@ onMounted(() => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view
|
<accept-assignment-modal v-if="details.is_use === 0" :details="details">
|
||||||
v-if="details.is_use === 0"
|
<view
|
||||||
class="bg-[var(--primary-color)] rounded-[8rpx] py-[26rpx] text-[#fff] !flex justify-center items-center">
|
class="bg-[var(--primary-color)] rounded-[8rpx] py-[26rpx] text-[#fff] !flex justify-center items-center">
|
||||||
接受任务
|
接受任务
|
||||||
</view>
|
</view>
|
||||||
|
</accept-assignment-modal>
|
||||||
|
|
||||||
<view
|
<view
|
||||||
v-else
|
v-else
|
||||||
|
|||||||
BIN
src/static/images/缺省图.png
Normal file
BIN
src/static/images/缺省图.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -21,7 +21,7 @@ request.interceptors.request.use(
|
|||||||
config.headers['Access-Token'] = token;
|
config.headers['Access-Token'] = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('请求拦截器', config.data);
|
console.log(`请求拦截器${config.url}`, config.data);
|
||||||
|
|
||||||
if (!config.UN_AES) {
|
if (!config.UN_AES) {
|
||||||
const {context, iv} = AESCrypto.encrypt(JSON.stringify(config.data));
|
const {context, iv} = AESCrypto.encrypt(JSON.stringify(config.data));
|
||||||
@@ -42,7 +42,6 @@ request.interceptors.request.use(
|
|||||||
// 响应拦截器
|
// 响应拦截器
|
||||||
request.interceptors.response.use((response) => {
|
request.interceptors.response.use((response) => {
|
||||||
const {data: {msg, code, data}, config: {url}} = response;
|
const {data: {msg, code, data}, config: {url}} = response;
|
||||||
console.log('接口返回', response)
|
|
||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
const {logout} = useUserStore();
|
const {logout} = useUserStore();
|
||||||
logout();
|
logout();
|
||||||
|
|||||||
Reference in New Issue
Block a user