提交 d0009b1e 编写于 作者: 刘英杰's avatar 刘英杰

V20241009 优化保存

上级 26c0dba7
流水线 #29731 已通过 ,包含阶段
in 45 second
# Vue 3 + Vite # 场地管理-移动端
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. ## 单点方式:/et?type=test
\ No newline at end of file
## Recommended IDE Setup
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
<script setup>
//活动详情页卡片,传入数组循环生成卡片 一个数组生成一个卡片
const props = defineProps({
array: Array,
nmt: Boolean,
nmb: Boolean,
})
import {showImagePreview} from 'vant';
function imagePreview(All, index) {
//获取评价图片数组 遍历得到预览结构
let image = []
All.map((cur, inde) => {
image.push(window.location.origin + cur.path)
})
showImagePreview({
images: image,
startPosition: index,
});
}
</script>
<template> <template>
<!-- 活动管理详细内容中的卡片--> <!-- 活动管理详细内容中的卡片-->
...@@ -53,28 +75,7 @@ ...@@ -53,28 +75,7 @@
</div> </div>
</div> </div>
</template> </template>
<script setup>
//活动详情页卡片,传入数组循环生成卡片 一个数组生成一个卡片
const props = defineProps({
array: Array,
nmt: Boolean,
nmb: Boolean,
})
import {showImagePreview} from 'vant';
function imagePreview(All, index) {
//获取评价图片数组 遍历得到预览结构
let image = []
All.map((cur, inde) => {
image.push(window.location.origin + cur.path)
})
showImagePreview({
images: image,
startPosition: index,
});
}
</script>
<style scoped> <style scoped>
</style> </style>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<script setup> <script setup>
import router from "../router/index.js"; import router from "../router/index.js";
import {getCurrentInstance, ref, defineProps, defineEmits} from "vue"; import {getCurrentInstance, ref, defineProps, defineEmits} from "vue";
import * as hooks from '@/hooks/index.js'
const props = defineProps({ const props = defineProps({
path: { path: {
...@@ -34,10 +35,9 @@ const props = defineProps({ ...@@ -34,10 +35,9 @@ const props = defineProps({
} }
}) })
const emit = defineEmits(['searchFun', 'searchPeople']) const emit = defineEmits(['searchFun', 'searchPeople'])
const asc = getCurrentInstance().appContext.config.globalProperties
function back() { function back() {
asc.hooks.go2Router(props.path) hooks.go2Router(props.path)
} }
const search = ref('') const search = ref('')
......
import router from "../router/index.js"; import router from "../router/index.js";
import * as images from '../states/index.js' import * as images from '../states/index.js'
import {showConfirmDialog, showNotify} from "vant"; import {closeToast, showConfirmDialog, showFailToast, showLoadingToast, showNotify, showSuccessToast} from "vant";
import 'vant/lib/index.css'; import 'vant/lib/index.css';
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import * as api from '../util/request/dist/controller/index.js' import * as api from '../util/request/dist/controller/index.js'
...@@ -32,7 +32,45 @@ export const go2Router = (path) => { ...@@ -32,7 +32,45 @@ export const go2Router = (path) => {
}) })
} }
export async function myEncapsulationFunction(fun) { export async function myEncapsulationFunction(fun, isShowSuccessText = false, loadingText = '正在提交') {
/**
* isShowSuccessText=>true||false
*
* */
const toast = showLoadingToast({
duration: 0,
forbidClick: true,
message: loadingText,
});
let res = await fun()
if (isShowSuccessText) return toast.close();
try {
switch (res.code) {
case 1 :
toast.close()
showSuccessToast({
message: res.msg
})
setTimeout(() => closeToast(), 1500)
break;
default :
toast.close()
showFailToast({
message: res.msg_detail
})
setTimeout(() => closeToast(), 1500)
}
return res
} catch (e) {
toast.close()
showFailToast({
message: res.msg_detail
})
setTimeout(() => closeToast(), 1500)
}
}
/*export async function myEncapsulationFunction(fun) {
// Spin.show() // Spin.show()
let res = await fun() let res = await fun()
try { try {
...@@ -48,7 +86,7 @@ export async function myEncapsulationFunction(fun) { ...@@ -48,7 +86,7 @@ export async function myEncapsulationFunction(fun) {
} catch (e) { } catch (e) {
showNotify({type: 'danger', message: res.msg_detail || '报错,无msg_detail'}); showNotify({type: 'danger', message: res.msg_detail || '报错,无msg_detail'});
} }
} }*/
export function getInitListRequest(fun) { export function getInitListRequest(fun) {
try { try {
......
...@@ -109,7 +109,6 @@ const getToken = async () => { ...@@ -109,7 +109,6 @@ const getToken = async () => {
} }
onMounted(() => { onMounted(() => {
getToken() getToken()
}) })
</script> </script>
...@@ -14,7 +14,7 @@ import * as api from '../api/index.js' ...@@ -14,7 +14,7 @@ import * as api from '../api/index.js'
import {CheckLoginTest} from "../api/index.js"; import {CheckLoginTest} from "../api/index.js";
const router = useRouter() const router = useRouter();
const getTokenAction = async (date) => { const getTokenAction = async (date) => {
//ASC PC端 //ASC PC端
const res = await api.SSOPC(date) const res = await api.SSOPC(date)
...@@ -122,7 +122,6 @@ const getToken = async () => { ...@@ -122,7 +122,6 @@ const getToken = async () => {
} }
onMounted(() => { onMounted(() => {
getToken() getToken()
}) })
</script> </script>
...@@ -117,17 +117,7 @@ ...@@ -117,17 +117,7 @@
</van-tabbar> </van-tabbar>
</div> </div>
</div> </div>
<!-- <van-popup-->
<!-- v-model:show="show"-->
<!-- closeable-->
<!-- position="bottom"-->
<!-- :style="{ height: '80%' }"-->
<!-- >-->
<!-- <template #default>-->
<!-- <slot name="content"></slot>-->
<!-- </template>-->
<!-- </van-popup>-->
<cs-pop-up v-if="objKey.data.borrowAKey" @borrowAKeyFalse="(e)=> objKey.data.borrowAKey = false"> <cs-pop-up v-if="objKey.data.borrowAKey" @borrowAKeyFalse="(e)=> objKey.data.borrowAKey = false">
<template v-slot:default> <template v-slot:default>
1231 1231
......
...@@ -529,12 +529,14 @@ const getSelectArray = () => { ...@@ -529,12 +529,14 @@ const getSelectArray = () => {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
})
}, true, '加载中...')
} }
function onSubmit() { function onSubmit() {
......
...@@ -96,12 +96,13 @@ function pageChange(e) { ...@@ -96,12 +96,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
...@@ -385,8 +385,8 @@ function pageChange(e) { ...@@ -385,8 +385,8 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data.map(cur => { init.data.array = res.response.data.map(cur => {
return { return {
showPopover: false, showPopover: false,
...@@ -394,8 +394,9 @@ function getData() { ...@@ -394,8 +394,9 @@ function getData() {
} }
}) })
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
function inKey(item) { function inKey(item) {
......
...@@ -242,12 +242,13 @@ function pageChange(e) { ...@@ -242,12 +242,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
...@@ -383,8 +383,8 @@ function pageChange(e) { ...@@ -383,8 +383,8 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data.map(cur => { init.data.array = res.response.data.map(cur => {
return { return {
showPopover: false, showPopover: false,
...@@ -392,8 +392,9 @@ function getData() { ...@@ -392,8 +392,9 @@ function getData() {
} }
}) })
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
function inKey(item) { function inKey(item) {
......
...@@ -176,12 +176,13 @@ function pageChange(e) { ...@@ -176,12 +176,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
...@@ -171,12 +171,13 @@ function pageChange(e) { ...@@ -171,12 +171,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
<div class="w-screen h-screen bg-gray-100 box-border"> <div class="w-screen h-screen bg-gray-100 box-border">
<!-- header--> <!-- header-->
<cs-header :path="'myActivity'"></cs-header> <cs-header :path="'myActivity'"></cs-header>
<!-- content--> <!-- content-->
<div class="w-full h-[calc(100vh-109px)] p-3 overflow-y-auto"> <div class="w-full h-[calc(100vh-109px)] p-3 overflow-y-auto">
<cs-card v-for="(item,index) in arrry" :key="index"> <cs-card v-for="(item,index) in arrry" :key="index">
...@@ -13,7 +11,6 @@ ...@@ -13,7 +11,6 @@
<template v-slot:default> <template v-slot:default>
<div class="w-full flex justify-end"> <div class="w-full flex justify-end">
<van-button class="w-[48%]" plain size="small" type="primary">查看评价</van-button> <van-button class="w-[48%]" plain size="small" type="primary">查看评价</van-button>
</div> </div>
</template> </template>
</cs-card> </cs-card>
......
...@@ -753,8 +753,8 @@ function getTextData(item) { ...@@ -753,8 +753,8 @@ function getTextData(item) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data.map(cur => { init.data.array = res.response.data.map(cur => {
return { return {
showPopover: false, showPopover: false,
...@@ -763,8 +763,9 @@ function getData() { ...@@ -763,8 +763,9 @@ function getData() {
} }
}) })
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
function onSubmit() { function onSubmit() {
......
<!--评价上传 照片组件-->
<template>
<div class="w-[70px] h-[70px] flex items-center
justify-center bg-gray-100 border
border-dashed border-gray-300" @click="chooseImage">
<van-icon name="photograph"/>
</div>
</template>
<script setup>
import * as api from '../../../../api/index.js';
import wx from "weixin-js-sdk";
import {showDialog, showSuccessToast} from "vant";
import * as hooks from "../../../../hooks/index.js";
import * as API from '../../../../util/request/dist/controller/index.js'
import {onMounted, defineEmits} from "vue";
const emit = defineEmits(['getCommentImage'])
function wxScanCode() {
// 微信初始化配置
const params = {
url: window.location.href.replace(window.location.hash, ""),
};
api.GetWxConfig(params).then((result) => {
let data = result;
wx.config({
debug: false,
appId: data.appId, // 必填,公众号的唯一标识
timestamp: data.timeStamp, // 必填,生成签名的时间戳
nonceStr: data.nonceStr, // 必填,生成签名的随机串
signature: data.signature, // 必填,签名,见附录1
jsApiList: ["chooseImage", "checkJsApi", "uploadImage", "downloadImage", "getLocalImgData"],
});
wx.ready(() => {
console.log("设备已经可以使用");
});
wx.error(function (res) {
console.log("设备已经无法使用");
});
});
}
// 扫码
function chooseImage() {
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
wx.getLocalImgData({
localId: localIds[0], // 图片的localID
success: function (resp) {
var localData = resp.localData; // localData是图片的base64数据,可以用img标签显示
if (localData.indexOf("data:image") != 0) {
//判断是否有这样的头部
localData = "data:image/jpeg;base64," + localData;
}
localData = localData
// .replace(/\r|\n/g, "")
.replace("data:image/jgp", "data:image/jpeg");
const blobBin = atob(localData.split(",")[1]);
let data = [];
for (var i = 0; i < blobBin.length; i++) {
data.push(blobBin.charCodeAt(i));
}
const type = localData.split(";")[0].split(":")[1];
const name = `image.${localData.split(";")[0].split(":")[1].split("/")[1]}`;
let fileBlob = new Blob([new Uint8Array(data)], {type: type});
const file = new File([fileBlob], name, {type: type});
afterRead(file); //base64 转化为 文件类型
},
error: function (e) {
console.err('上传错误', e)
},
});
}
});
}
function afterRead(file) {
//上传图篇 转回父组件
hooks.myEncapsulationFunction(async () => {
let fl = new FormData()
fl.append('file', file)
const res = await API.postApiCommonFileUpload(fl)
if (res.code === 1) {
// init.comment.formValidate.file_list.push(res.response)
emit('getCommentImage', res)
}
return res
})
}
onMounted(() => {
wxScanCode()
})
</script>
<style>
</style>
...@@ -172,6 +172,26 @@ ...@@ -172,6 +172,26 @@
<!-- </van-cell>--> <!-- </van-cell>-->
<!-- </van-cell-group>--> <!-- </van-cell-group>-->
<!-- </div>--> <!-- </div>-->
<div class="mb-3 w-full">
<van-cell-group inset>
<van-cell @click="gotoPath('myRemainToBeEvaluated')" is-link class="w-full h-[50px] flex items-center">
<template #icon>
<img
class="w-[18px] h-[18px] mr-2"
:src="dpj"
/>
</template>
<template #title>
<span>待评价</span>
</template>
<template #value>
{{ init.count.finish }}
</template>
</van-cell>
</van-cell-group>
</div>
<div class="mb-3 w-full"> <div class="mb-3 w-full">
<van-cell-group inset> <van-cell-group inset>
<van-cell @click="gotoPath('myOver')" is-link class="w-full h-[50px] flex items-center"> <van-cell @click="gotoPath('myOver')" is-link class="w-full h-[50px] flex items-center">
......
...@@ -535,12 +535,13 @@ const getSelectArray = () => { ...@@ -535,12 +535,13 @@ const getSelectArray = () => {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
function onSubmit() { function onSubmit() {
......
...@@ -97,12 +97,13 @@ function pageChange(e) { ...@@ -97,12 +97,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
......
...@@ -259,12 +259,13 @@ function pageChange(e) { ...@@ -259,12 +259,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
async function adjust(item) { async function adjust(item) {
......
<!--活动数据--> <!--活动数据-->
<!--dtCard 三种值 value、tag、image--> <!--dtCard 三种值 value、tag、image-->
<template> <template>
<div class=" <div
class="
w-full w-full
min-h-[calc(100%-54px)] min-h-[calc(100%-54px)]
overflow-y-auto overflow-y-auto
...@@ -11,22 +13,23 @@ ...@@ -11,22 +13,23 @@
"> ">
<dt-card v-for="(item,index) in init.array" :array="item" :key="index"></dt-card> <dt-card v-for="(item,index) in init.array" :key="index" :array="item"></dt-card>
</div> </div>
<!-- 生成借用钥匙二维码--> <!-- 生成借用钥匙二维码-->
<div v-if="props.showButton" @click="inKey(init.info)" class=" w-[110px] h-10 sticky bottom-10 ml-auto "> <div v-if="props.showButton" class=" w-[110px] h-10 sticky bottom-10 ml-auto " @click="inKey(init.info)">
<van-button round type="primary"> <van-button round type="primary">
{{ ['借用二维码', '归还二维码', '已归还钥匙'][init.info.key_state] }} {{ ['借用二维码', '归还二维码', '已归还钥匙'][init.info.key_state] }}
</van-button> </van-button>
</div> </div>
<van-dialog v-model:show="init.key.show" title="钥匙信息二维码"> <van-dialog v-model:show="init.key.show" title="钥匙信息二维码">
<div class="flex justify-center items-center w-full "> <div class="flex justify-center items-center w-full ">
<vue-qr :text="init.key.src" :size="200"></vue-qr> <vue-qr :size="200" :text="init.key.src"></vue-qr>
</div> </div>
<template #footer> <template #footer>
<div class="w-full h-[60px] flex justify-center items-center border border-solid"> <div class="w-full h-[60px] flex justify-center items-center border border-solid">
<van-button style="width: 90%" type="primary" round block @click="init.key.show = false;">关闭</van-button> <van-button block round style="width: 90%" type="primary" @click="init.key.show = false;">关闭</van-button>
</div> </div>
</template> </template>
</van-dialog> </van-dialog>
...@@ -183,14 +186,14 @@ function getDtItem(keyUse, initKeyArray) { ...@@ -183,14 +186,14 @@ function getDtItem(keyUse, initKeyArray) {
function getData() { function getData() {
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
let commodity = '' let commodity = ''
api.getApiCommodityGetCommodityTrackStr({activity_id: props.id}).then(res1 => { return api.getApiCommodityGetCommodityTrackStr({activity_id: props.id}).then(res1 => {
commodity = res1.response commodity = res1.response
return res1
}).finally(() => { }).finally(() => {
api.getApiActivityGetActivityInfo({id: props.id}).then(res => { api.getApiActivityGetActivityInfo({id: props.id}).then(res => {
if (res.response) { if (res.response) {
nextTick(() => { nextTick(() => {
//渲染完成 传值给父组件 //渲染完成 传值给父组件
emit('getInitObject', res.response.card) emit('getInitObject', res.response.card)
...@@ -205,14 +208,11 @@ function getData() { ...@@ -205,14 +208,11 @@ function getData() {
//通过init.keyArray 遍历 得到数据数组 顺序插入init.array //通过init.keyArray 遍历 得到数据数组 顺序插入init.array
init.array[index] = getDtItem(cur, init.data.keys) init.array[index] = getDtItem(cur, init.data.keys)
}) })
init.info = res.response //获取活动信息生成要是二维码 init.info = res.response //获取活动信息生成要是二维码
} }
}) })
}) })
}, true, '加载中...')
})
} }
function inKey(item) { function inKey(item) {
......
<!--评价--> <!--评价-->
<template> <template>
<div class=" <div
v-if="!!init.array.length"
class="
w-full w-full
min-h-[calc(100%-54px)] min-h-[calc(100%-54px)]
overflow-y-auto overflow-y-auto
...@@ -10,8 +12,8 @@ ...@@ -10,8 +12,8 @@
"> ">
<dt-card v-for="(item,index) in init.array" :key="index" :array="item"></dt-card> <dt-card v-for="(item,index) in init.array" :key="index" :array="item"></dt-card>
</div> </div>
<van-empty v-else description="暂无数据"/>
</template> </template>
<script setup> <script setup>
import {onMounted, defineProps, getCurrentInstance, reactive} from "vue"; import {onMounted, defineProps, getCurrentInstance, reactive} from "vue";
...@@ -77,8 +79,8 @@ function getDtItem(keyUse, initKeyArray) { ...@@ -77,8 +79,8 @@ function getDtItem(keyUse, initKeyArray) {
function getData() { function getData() {
//初始化数据 //初始化数据
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.getApiEvaluateGetEvaluateList({activity_id: props.id}).then(res => { return api.getApiEvaluateGetEvaluateList({activity_id: props.id}).then(res => {
if (res.response) { if (res.response) {
let array = [] let array = []
res.response.map((item, index) => { res.response.map((item, index) => {
...@@ -97,8 +99,9 @@ function getData() { ...@@ -97,8 +99,9 @@ function getData() {
//获取处理完的数组 //获取处理完的数组
init.array = array init.array = array
} }
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
<!--活动详情 钥匙--> <!--活动详情 钥匙-->
<template> <template>
<div class=" <div
v-if="!!init.array.length"
class="
w-full w-full
min-h-[calc(100%-54px)] min-h-[calc(100%-54px)]
overflow-y-auto overflow-y-auto
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
<dt-card v-for="(item,index) in init.array" :key="index" :array="item"></dt-card> <dt-card v-for="(item,index) in init.array" :key="index" :array="item"></dt-card>
</div> </div>
<van-empty v-else description="暂无数据"/>
</template> </template>
<script setup> <script setup>
import {onMounted, defineProps, getCurrentInstance, reactive} from "vue"; import {onMounted, defineProps, getCurrentInstance, reactive} from "vue";
...@@ -77,8 +79,8 @@ function getDtItem(keyUse, initKeyArray) { ...@@ -77,8 +79,8 @@ function getDtItem(keyUse, initKeyArray) {
function getData() { function getData() {
//初始化数据 //初始化数据
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.getApiKeyGetKeyTrackInfoByActivity({ return api.getApiKeyGetKeyTrackInfoByActivity({
activity_id: props.id activity_id: props.id
}).then(res => { }).then(res => {
if (res.response) { if (res.response) {
...@@ -103,8 +105,9 @@ function getData() { ...@@ -103,8 +105,9 @@ function getData() {
] ]
) )
} }
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
<!--参与人--> <!--参与人-->
<template> <template>
<div class=" <div
class="
w-full w-full
min-h-[calc(100%-54px)] min-h-[calc(100%-54px)]
overflow-y-auto overflow-y-auto
...@@ -249,8 +251,8 @@ async function getPeopleList() { ...@@ -249,8 +251,8 @@ async function getPeopleList() {
function getData() { function getData() {
//初始化数据 //初始化数据
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.getApiActivityGetParticipantList({ return api.getApiActivityGetParticipantList({
activity_id: props.id, activity_id: props.id,
page_index: init.page.page_index, page_index: init.page.page_index,
page_size: init.page.page_size page_size: init.page.page_size
...@@ -281,8 +283,9 @@ function getData() { ...@@ -281,8 +283,9 @@ function getData() {
//获取id数组 用于删除. //获取id数组 用于删除.
init.idArray = idArray init.idArray = idArray
} }
return res
}) })
}) }, true, '加载中...')
} }
const isa = computed(() => { const isa = computed(() => {
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<template> <template>
<div class=" <div
v-if="!!init.array.length"
class="
w-full w-full
min-h-[calc(100%-54px)] min-h-[calc(100%-54px)]
overflow-y-auto overflow-y-auto
...@@ -18,7 +20,7 @@ ...@@ -18,7 +20,7 @@
</van-step> </van-step>
</van-steps> </van-steps>
</div> </div>
<van-empty v-else description="暂无数据"/>
</template> </template>
<script setup> <script setup>
import {onMounted, defineProps, getCurrentInstance, reactive} from "vue"; import {onMounted, defineProps, getCurrentInstance, reactive} from "vue";
...@@ -84,14 +86,15 @@ function getDtItem(keyUse, initKeyArray) { ...@@ -84,14 +86,15 @@ function getDtItem(keyUse, initKeyArray) {
function getData() { function getData() {
//初始化数据 //初始化数据
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.getApiActivityGetActivityTrackList({activity_id: props.id}).then(res => { return api.getApiActivityGetActivityTrackList({activity_id: props.id}).then(res => {
if (res.response) { if (res.response) {
//获取处理完的数组 //获取处理完的数组
init.array = res.response init.array = res.response
} }
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
...@@ -4,24 +4,29 @@ ...@@ -4,24 +4,29 @@
<div class="w-full h-[calc(100vh)] overflow-y-auto "> <div class="w-full h-[calc(100vh)] overflow-y-auto ">
<!-- header--> <!-- header-->
<div class="w-full h-[54px] bg-white flex"> <div class="w-full h-[54px] bg-white flex">
<div @click="back" class="w-[13%] bg-white h-full text-[28px] text-gray-400 flex items-center justify-center"> <div class="w-[13%] bg-white h-full text-[28px] text-gray-400 flex items-center justify-center" @click="back">
<van-icon class="" name="arrow-left"/> <van-icon class="" name="arrow-left"/>
</div> </div>
<div class="w-[87%] h-full"> <div class="w-[87%] h-full">
<van-tabs v-model:active="active" @change="tabChange" swipeable> <van-tabs v-model:active="active" swipeable @change="tabChange">
<van-tab v-for="(item,index) in tabArray" :title="item" :key="index"> <van-tab v-for="(item,index) in tabArray" :key="index" :title="item"/>
</van-tab>
</van-tabs> </van-tabs>
</div> </div>
</div> </div>
<!-- content_content--> <!-- content_content-->
<csActivityData @getInitObject="getInitObject" v-if="active ===0" :id="asc.$route.query.id" <!-- 活动详情-->
:showButton="asc.$route.query.show"/> <csActivityData v-if="active ===0" :id="asc.$route.query.id" :showButton="asc.$route.query.show"
<csPlayers :activityPeopleCard="activityPeopleCard" v-if="active ===1" :id="asc.$route.query.id"/> @getInitObject="getInitObject"/>
<!-- 参与人详情-->
<csPlayers v-if="active ===1" :id="asc.$route.query.id" :activityPeopleCard="activityPeopleCard"/>
<!-- 钥匙详情-->
<csKey v-if="active ===2" :id="asc.$route.query.id"/> <csKey v-if="active ===2" :id="asc.$route.query.id"/>
<!-- 管理员评论-->
<csComment v-if="active ===3" :id="asc.$route.query.id"/> <csComment v-if="active ===3" :id="asc.$route.query.id"/>
<csTrack v-if="active ===4" :id="asc.$route.query.id"/> <!-- 学生评论-->
<csComment v-if="active ===4" :id="asc.$route.query.id"/>
<!-- 活动轨迹-->
<csTrack v-if="active ===5" :id="asc.$route.query.id"/>
</div> </div>
<!-- footer--> <!-- footer-->
<!-- <cs-page></cs-page>--> <!-- <cs-page></cs-page>-->
...@@ -39,7 +44,8 @@ const tabArray = ref([ ...@@ -39,7 +44,8 @@ const tabArray = ref([
'活动数据', '活动数据',
'参与人', '参与人',
'钥匙', '钥匙',
'评论', '管理员评论',
'学生评论',
'轨迹', '轨迹',
]) ])
const back = () => { const back = () => {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<van-form class="mt-3"> <van-form class="mt-3">
<van-cell-group> <van-cell-group>
<!-- 场地类型选择器--> <!-- 场地类型选择器-->
<van-field <van-field
v-model="init.placeTypeText" v-model="init.placeTypeText"
is-link is-link
...@@ -138,7 +138,6 @@ ...@@ -138,7 +138,6 @@
placeholder="请选择物资" placeholder="请选择物资"
@click="init.commodity = true" @click="init.commodity = true"
:error-message="init.commodityTextError" :error-message="init.commodityTextError"
/> />
<van-cell v-if="init.radio === '1'"> <van-cell v-if="init.radio === '1'">
{{ init.commodityText }} {{ init.commodityText }}
...@@ -147,7 +146,6 @@ ...@@ -147,7 +146,6 @@
<template #content> <template #content>
<div class="w-full h-[90%] bg-gray-100 overflow-y-auto "> <div class="w-full h-[90%] bg-gray-100 overflow-y-auto ">
<Tree :data="init.commodityArray" show-checkbox @on-check-change="checkChange"></Tree> <Tree :data="init.commodityArray" show-checkbox @on-check-change="checkChange"></Tree>
</div> </div>
<div class="w-full h-[10%] flex items-center justify-center p-3 shadow-gray-600 shadow"> <div class="w-full h-[10%] flex items-center justify-center p-3 shadow-gray-600 shadow">
<van-button class="w-[95%]" round @click="init.commodity = false">关闭</van-button> <van-button class="w-[95%]" round @click="init.commodity = false">关闭</van-button>
...@@ -297,10 +295,14 @@ function validateTime(start, end) { ...@@ -297,10 +295,14 @@ function validateTime(start, end) {
}) })
array = _.cloneDeep(check.data.list) array = _.cloneDeep(check.data.list)
return array.splice(startIndex, endIndex - startIndex + 1).length return array.splice(startIndex, endIndex - startIndex + 1).length
} }
const checkTreeArray = ref([]);
function checkChange(all, item) { function checkChange(all, item) {
/*checkTreeArray.value = all
checkTreeArray.value.splice(checkTreeArray.value.indexOf('1001'), 1)
console.log("🚀🚀checkTreeArray.value🚀,", checkTreeArray.value)*/
//选中物资树遍历获取ID //选中物资树遍历获取ID
let array = [] let array = []
init.commodityText = '' init.commodityText = ''
...@@ -308,7 +310,6 @@ function checkChange(all, item) { ...@@ -308,7 +310,6 @@ function checkChange(all, item) {
all.map((cur, index) => { all.map((cur, index) => {
array.push(cur.id) array.push(cur.id)
index !== 0 ? init.commodityText = init.commodityText + '_' + cur.title : init.commodityText = init.commodityText + cur.title index !== 0 ? init.commodityText = init.commodityText + '_' + cur.title : init.commodityText = init.commodityText + cur.title
}) })
formValidate.data.commodity_list = array formValidate.data.commodity_list = array
} }
......
...@@ -368,12 +368,13 @@ function pageChange(e) { ...@@ -368,12 +368,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
function getQuickComment() { function getQuickComment() {
......
...@@ -166,12 +166,13 @@ function pageChange(e) { ...@@ -166,12 +166,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<!-- header--> <!-- header-->
<cs-header @searchFun="searchFun"></cs-header> <cs-header @searchFun="searchFun"></cs-header>
<!-- content--> <!-- content-->
<div class="w-full h-[calc(100vh-109px)] p-3 overflow-y-auto"> <div class="w-full h-[calc(100vh-109px)] p-3 overflow-y-auto">
<div v-for="(item,index) in init.data.array" :key="index"> <div v-for="(item,index) in init.data.array" :key="index">
...@@ -198,12 +197,13 @@ function pageChange(e) { ...@@ -198,12 +197,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
onMounted(() => { onMounted(() => {
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
<van-button @click="init.comment.show = true;init.comment.formValidate.activity_id = item.id" <van-button @click="init.comment.show = true;init.comment.formValidate.activity_id = item.id"
class="w-[48%]" plain size="small" type="primary">评价 class="w-[48%]" plain size="small" type="primary">评价
</van-button> </van-button>
<van-button @click="detail(item.id)" class="w-[48%] text-gray-600" plain size="small">详情</van-button> <van-button @click="detail(item.id)" class="w-[48%] text-gray-600" plain size="small">详情</van-button>
</template> </template>
</cs-card> </cs-card>
</div> </div>
...@@ -67,7 +65,6 @@ ...@@ -67,7 +65,6 @@
<!-- </van-field>--> <!-- </van-field>-->
<van-field name="uploader" label="图片上传"> <van-field name="uploader" label="图片上传">
<template #input> <template #input>
<div class="w-full h-full flex items-center flex-wrap text-wrap box-border "> <div class="w-full h-full flex items-center flex-wrap text-wrap box-border ">
<div class=" w-full min-h-[80px] flex flex-wrap "> <div class=" w-full min-h-[80px] flex flex-wrap ">
<!-- <div class=" m-1 w-[70px] h-[70px] bg-blue-600 border border-dashed border-gray-300 ">--> <!-- <div class=" m-1 w-[70px] h-[70px] bg-blue-600 border border-dashed border-gray-300 ">-->
...@@ -112,7 +109,7 @@ ...@@ -112,7 +109,7 @@
<div class="w-full min-h-[200px] text-wrap flex flex-wrap content-start"> <div class="w-full min-h-[200px] text-wrap flex flex-wrap content-start">
<div @click="getCommentContent(item.content)" v-for="(item,index) in init.comment.commentArray" <div @click="getCommentContent(item.content)" v-for="(item,index) in init.comment.commentArray"
:key="index" :key="index"
class="w-fit h-[25px] border-solid active:bg-blue-50 class="w-fit min-h-[25px] border-solid box-border p-1 active:bg-blue-50
border flex items-center rounded-[20px] mr-2 mb-2"> border flex items-center rounded-[20px] mr-2 mb-2">
{{ item.content }} {{ item.content }}
</div> </div>
...@@ -353,12 +350,13 @@ function pageChange(e) { ...@@ -353,12 +350,13 @@ function pageChange(e) {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
function getQuickComment() { function getQuickComment() {
......
...@@ -634,12 +634,13 @@ const getSelectArray = () => { ...@@ -634,12 +634,13 @@ const getSelectArray = () => {
function getData() { function getData() {
//初始化方法查询 //初始化方法查询
hooks.getInitListRequest(() => { hooks.myEncapsulationFunction(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => { return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data init.data.array = res.response.data
searchCondition.data.total = res.response.data_count searchCondition.data.total = res.response.data_count
return res
}) })
}) }, true, '加载中...')
} }
const watchArray = [ const watchArray = [
......
...@@ -148,7 +148,6 @@ ...@@ -148,7 +148,6 @@
</template> </template>
<template #value> <template #value>
{{ init.count.unevaluate }} {{ init.count.unevaluate }}
</template> </template>
</van-cell> </van-cell>
<!-- <van-cell @click="gotoPath('rated')" is-link class="w-full h-[50px] flex items-center">--> <!-- <van-cell @click="gotoPath('rated')" is-link class="w-full h-[50px] flex items-center">-->
...@@ -163,7 +162,6 @@ ...@@ -163,7 +162,6 @@
<!-- </template>--> <!-- </template>-->
<!-- <template #value>--> <!-- <template #value>-->
<!-- {{ init.count.evaluate }}--> <!-- {{ init.count.evaluate }}-->
<!-- </template>--> <!-- </template>-->
<!-- </van-cell>--> <!-- </van-cell>-->
</van-cell-group> </van-cell-group>
......
...@@ -43,7 +43,7 @@ export const myActivity = [ ...@@ -43,7 +43,7 @@ export const myActivity = [
component: () => import('../pages/myActivity/compontes/rated.vue'), component: () => import('../pages/myActivity/compontes/rated.vue'),
}, },
{ {
//待评价 //我的待评价
name: 'myRemainToBeEvaluated', name: 'myRemainToBeEvaluated',
path: '/myRemainToBeEvaluated', path: '/myRemainToBeEvaluated',
component: () => import('../pages/myActivity/compontes/remainToBeEvaluated.vue'), component: () => import('../pages/myActivity/compontes/remainToBeEvaluated.vue'),
......
...@@ -43,11 +43,12 @@ export const routerArray = [ ...@@ -43,11 +43,12 @@ export const routerArray = [
component: () => import('../pages/welcome/compontes/rated.vue'), component: () => import('../pages/welcome/compontes/rated.vue'),
}, },
{ {
//待评价 //管理员待评价
name: 'remainToBeEvaluated', name: 'remainToBeEvaluated',
path: '/remainToBeEvaluated', path: '/remainToBeEvaluated',
component: () => import('../pages/welcome/compontes/remainToBeEvaluated.vue'), component: () => import('../pages/welcome/compontes/remainToBeEvaluated.vue'),
}, },
{ {
//使用中 //使用中
name: 'useing', name: 'useing',
......
import axios from 'axios'; import axios from 'axios';
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import {showToast, showNotify} from 'vant'; import {showToast, showNotify, closeToast} from 'vant';
import 'vant/es/notify/style' import 'vant/es/notify/style'
import 'vant/es/toast/style'; import 'vant/es/toast/style';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
...@@ -13,7 +13,7 @@ const axiosInstance = axios.create({ ...@@ -13,7 +13,7 @@ const axiosInstance = axios.create({
// baseURL: 'https://asc.hnasct.cn/DutyManagement', // baseURL: 'https://asc.hnasct.cn/DutyManagement',
baseURL: '/placemanage', // 默认地址代理转换为··域名·· 请求地址为 域名 + baseURL + 动态传入URL baseURL: '/placemanage', // 默认地址代理转换为··域名·· 请求地址为 域名 + baseURL + 动态传入URL
timeout: 30 * 1000, // 设置请求超时时间,单位为毫秒 timeout: 30 * 1000, // 设置请求超时时间,单位为毫秒
// headers: { // headers: {
// //
// 'Content-Type': 'application/json' , // 'Content-Type': 'application/json' ,
...@@ -68,18 +68,16 @@ axiosInstance.interceptors.response.use( ...@@ -68,18 +68,16 @@ axiosInstance.interceptors.response.use(
switch (response.data.code) { switch (response.data.code) {
//鉴别code 是否为1 //鉴别code 是否为1
case 1 : case 1 :
return response.data return response.data
default : default :
switch (response.data.code !== void 0) { switch (response.data.code !== void 0) {
//鉴别 code 是否定义 定义则接口报错 无code表示微信初始化接口数据 //鉴别 code 是否定义 定义则接口报错 无code表示微信初始化接口数据
case true: case true:
// 危险通知
showNotify({type: 'danger', message: response.data.msg_detail}); showNotify({type: 'danger', message: response.data.msg_detail});
break; closeToast();
return response.data
case false: case false:
return response.data return response.data
} }
break break
} }
......
...@@ -3,6 +3,7 @@ import vue from '@vitejs/plugin-vue' ...@@ -3,6 +3,7 @@ import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'; import Components from 'unplugin-vue-components/vite';
import {VantResolver} from 'unplugin-vue-components/resolvers'; import {VantResolver} from 'unplugin-vue-components/resolvers';
import path from 'path'; // 关键代码
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
...@@ -12,6 +13,13 @@ export default defineConfig({ ...@@ -12,6 +13,13 @@ export default defineConfig({
resolvers: [VantResolver()], resolvers: [VantResolver()],
}), }),
], ],
resolve: {
//src => @
alias: {
// 关键代码
'@': path.resolve(__dirname, './src')
}
},
base: './', base: './',
server: { server: {
// host: "0.0.0.0", // host: "0.0.0.0",
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或