This commit is contained in:
2025-05-06 11:36:14 +08:00
parent ef99f9377c
commit 5325281fb4
7 changed files with 97 additions and 16 deletions

View File

@@ -4,6 +4,10 @@
{ {
"playground" : "standard", "playground" : "standard",
"type" : "uni-app:app-ios" "type" : "uni-app:app-ios"
},
{
"playground" : "standard",
"type" : "uni-app:app-android"
} }
] ]
} }

View File

@@ -3,8 +3,15 @@ import {defineAsyncComponent, ref} from "vue";
import XNav from "../../components/XNav.vue"; import XNav from "../../components/XNav.vue";
import XNoticeBar from "../../components/XNoticeBar.vue"; import XNoticeBar from "../../components/XNoticeBar.vue";
// #ifdef APP-PLUS
import AliPay from "./components/AliPay.vue";
import BankPay from "./components/BankPay.vue";
// #endif
// #ifndef APP-PLUS
const AliPay = defineAsyncComponent(() => import('./components/AliPay.vue')); const AliPay = defineAsyncComponent(() => import('./components/AliPay.vue'));
const BankPay = defineAsyncComponent(() => import('./components/BankPay.vue')); const BankPay = defineAsyncComponent(() => import('./components/BankPay.vue'));
// #endif
const currentTab = ref(0); const currentTab = ref(0);
const tabs = [ const tabs = [

View File

@@ -1,40 +1,63 @@
<script setup> <script setup>
import goodsIcon from '../../static/icons/goodsIcon.png'; import goodsIcon from '../../static/icons/goodsIcon.png';
import XNav from "../../components/XNav.vue"; import XNav from "../../components/XNav.vue";
import {ref, onMounted, defineAsyncComponent} from 'vue'; import {defineAsyncComponent, getCurrentInstance, nextTick, onMounted, reactive, ref} from 'vue';
import {onLoad} from "@dcloudio/uni-app"; import {onLoad} from "@dcloudio/uni-app";
import XLink from "../../components/XLink.vue"; import XLink from "../../components/XLink.vue";
import XNoticeBar from "../../components/XNoticeBar.vue"; import XNoticeBar from "../../components/XNoticeBar.vue";
import XImage from "../../components/XImage.vue"; import XImage from "../../components/XImage.vue";
import fmt from "../../static/images/fmt.png"; import fmt from "../../static/images/fmt.png";
// #ifdef APP-PLUS
import TaskDetails from "./components/TaskDetails.vue";
import CollectMaterials from "./components/CollectMaterials.vue";
import MyBackfill from "./components/MyBackfill.vue";
import ReviewCommunication from "./components/ReviewCommunication.vue";
// #endif
// #ifndef APP-PLUS
const TaskDetails = defineAsyncComponent(() => import('./components/TaskDetails.vue'));
const CollectMaterials = defineAsyncComponent(() => import('./components/CollectMaterials.vue'));
const MyBackfill = defineAsyncComponent(() => import('./components/MyBackfill.vue'));
const ReviewCommunication = defineAsyncComponent(() => import('./components/ReviewCommunication.vue'));
// #endif
const details = ref(null); const details = ref(null);
const mainDetailsRef = ref(); const mainDetailWidth = ref(0);
const currentTabs = ref(0); const currentTabs = ref(0);
const tabs = [ const tabs = reactive([
{ {
name: "任务详情", name: "任务详情",
component: defineAsyncComponent(() => import('./components/TaskDetails.vue')), component: TaskDetails,
}, },
{ {
name: "领取素材", name: "领取素材",
component: defineAsyncComponent(() => import('./components/CollectMaterials.vue')), component: CollectMaterials,
}, },
{ {
name: "我的回填", name: "我的回填",
component: defineAsyncComponent(() => import('./components/MyBackfill.vue')), component: MyBackfill,
}, },
{ {
name: "审核沟通", name: "审核沟通",
component: defineAsyncComponent(() => import('./components/ReviewCommunication.vue')), component: ReviewCommunication,
}, },
]; ]);
onLoad((options) => { onLoad((options) => {
const {id} = options; const {id} = options;
}); });
onMounted(() => { onMounted(() => {
nextTick(() => {
const instancs = getCurrentInstance();
uni.createSelectorQuery()
.in(instancs)
.select("#mainDetailBox")
.boundingClientRect()
.exec((result) => {
mainDetailWidth.value = result[0].width;
})
});
}) })
</script> </script>
@@ -84,12 +107,12 @@ onMounted(() => {
</view> </view>
</view> </view>
<view ref="mainDetailsRef" class="rounded-[16rpx] bg-[#fff] main-details overflow-hidden"> <view id="mainDetailBox" class="rounded-[16rpx] bg-[#fff] main-details overflow-hidden">
<tui-tabs <tui-tabs
v-if="mainDetailsRef?.$el?.clientWidth" v-if="mainDetailWidth"
:tabs="tabs" :tabs="tabs"
:currentTab="currentTabs" :currentTab="currentTabs"
:width="mainDetailsRef?.$el?.clientWidth" :width="mainDetailWidth"
@change="({index})=>currentTabs=index"> @change="({index})=>currentTabs=index">
</tui-tabs> </tui-tabs>

View File

@@ -13,9 +13,17 @@ import XNav from "../../components/XNav.vue";
import CreditScore from "../../components/CreditScore.vue"; import CreditScore from "../../components/CreditScore.vue";
import {toPage} from "../../utils/uils.js"; import {toPage} from "../../utils/uils.js";
// #ifdef APP-PLUS
import MyTeam from "./components/MyTeam.vue";
import Inviter from "./components/Inviter.vue";
import AccompanyingMentor from "./components/AccompanyingMentor.vue";
// #endif
// #ifndef APP-PLUS
const MyTeam = defineAsyncComponent(() => import('./components/MyTeam.vue')); const MyTeam = defineAsyncComponent(() => import('./components/MyTeam.vue'));
const Inviter = defineAsyncComponent(() => import('./components/Inviter.vue')); const Inviter = defineAsyncComponent(() => import('./components/Inviter.vue'));
const AccompanyingMentor = defineAsyncComponent(() => import('./components/AccompanyingMentor.vue')); const AccompanyingMentor = defineAsyncComponent(() => import('./components/AccompanyingMentor.vue'));
// #endif
const tabCur = ref('MyTeam'); const tabCur = ref('MyTeam');
const tabs = [ const tabs = [

View File

@@ -4,9 +4,18 @@ import Right from "../../static/icons/right.png";
import Avatar from "../../static/images/Avatar.png"; import Avatar from "../../static/images/Avatar.png";
import XNav from "../../components/XNav.vue"; import XNav from "../../components/XNav.vue";
// #ifdef APP-PLUS
import EditWxCode from './components/EditWxCode.vue';
import EditPhone from './components/EditPhone.vue';
import EditPassWord from './components/EditPassWord.vue';
// #endif
// #ifndef APP-PLUS
const EditWxCode = defineAsyncComponent(() => import('./components/EditWxCode.vue')); const EditWxCode = defineAsyncComponent(() => import('./components/EditWxCode.vue'));
const EditPhone = defineAsyncComponent(() => import('./components/EditPhone.vue')); const EditPhone = defineAsyncComponent(() => import('./components/EditPhone.vue'));
const EditPassWord = defineAsyncComponent(() => import('./components/EditPassWord.vue')); const EditPassWord = defineAsyncComponent(() => import('./components/EditPassWord.vue'));
// #endif
const showTool = ref(false); const showTool = ref(false);
const tool = ref('EditWxCode'); const tool = ref('EditWxCode');

View File

@@ -45,16 +45,39 @@ export const copy = (context) => {
} }
export const download = (urls) => { export const download = (urls) => {
const promises = urls.map((url, index) => new Promise((resolve, reject) => { // #ifndef APP-PLUS
const promises1 = urls.map(url => new Promise((resolve, reject) => {
const iframe = document.createElement('iframe'); const iframe = document.createElement('iframe');
iframe.src = url; iframe.src = url;
iframe.style.display = 'none'; iframe.style.display = 'none';
document.body.appendChild(iframe); document.body.appendChild(iframe);
resolve(true); resolve(true);
})); }));
Promise.all(promises).then(res => { Promise.all(promises1).then(() => {
console.log(res); showToast('保存成功');
}).catch(err => { }).catch(() => {
console.log(err); showToast('保存失败');
}); });
// #endif
// #ifdef APP-PLUS
const promises2 = urls.map(v => new Promise((resolve, reject) => {
urls.forEach(v => {
uni.downloadFile({
url: v,
success: () => {
resolve(true);
},
fail: () => {
reject(false);
}
})
})
}));
Promise.all(promises2).then(() => {
showToast('保存成功');
}).catch(() => {
showToast('保存失败');
});
// #endif
} }

View File

@@ -7,4 +7,11 @@ export default defineConfig({
uni.default(), uni.default(),
tailwindcss(), tailwindcss(),
], ],
css: {
preprocessorOptions: {
scss: {
silenceDeprecations: ['legacy-js-api'],
}
}
},
}) })