提交 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.
## 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).
## 单点方式:/et?type=test
\ No newline at end of file
<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>
<!-- 活动管理详细内容中的卡片-->
......@@ -53,28 +75,7 @@
</div>
</div>
</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>
......@@ -22,6 +22,7 @@
<script setup>
import router from "../router/index.js";
import {getCurrentInstance, ref, defineProps, defineEmits} from "vue";
import * as hooks from '@/hooks/index.js'
const props = defineProps({
path: {
......@@ -34,10 +35,9 @@ const props = defineProps({
}
})
const emit = defineEmits(['searchFun', 'searchPeople'])
const asc = getCurrentInstance().appContext.config.globalProperties
function back() {
asc.hooks.go2Router(props.path)
hooks.go2Router(props.path)
}
const search = ref('')
......
import router from "../router/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 Cookies from "js-cookie";
import * as api from '../util/request/dist/controller/index.js'
......@@ -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()
let res = await fun()
try {
......@@ -48,7 +86,7 @@ export async function myEncapsulationFunction(fun) {
} catch (e) {
showNotify({type: 'danger', message: res.msg_detail || '报错,无msg_detail'});
}
}
}*/
export function getInitListRequest(fun) {
try {
......
......@@ -109,7 +109,6 @@ const getToken = async () => {
}
onMounted(() => {
getToken()
})
</script>
......@@ -14,7 +14,7 @@ import * as api from '../api/index.js'
import {CheckLoginTest} from "../api/index.js";
const router = useRouter()
const router = useRouter();
const getTokenAction = async (date) => {
//ASC PC端
const res = await api.SSOPC(date)
......@@ -122,7 +122,6 @@ const getToken = async () => {
}
onMounted(() => {
getToken()
})
</script>
......@@ -117,17 +117,7 @@
</van-tabbar>
</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">
<template v-slot:default>
1231
......
......@@ -529,12 +529,14 @@ const getSelectArray = () => {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
function onSubmit() {
......
......@@ -96,12 +96,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
......@@ -385,8 +385,8 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data.map(cur => {
return {
showPopover: false,
......@@ -394,8 +394,9 @@ function getData() {
}
})
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
function inKey(item) {
......
......@@ -242,12 +242,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
......@@ -383,8 +383,8 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data.map(cur => {
return {
showPopover: false,
......@@ -392,8 +392,9 @@ function getData() {
}
})
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
function inKey(item) {
......
......@@ -176,12 +176,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
......@@ -171,12 +171,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
......@@ -2,8 +2,6 @@
<div class="w-screen h-screen bg-gray-100 box-border">
<!-- header-->
<cs-header :path="'myActivity'"></cs-header>
<!-- content-->
<div class="w-full h-[calc(100vh-109px)] p-3 overflow-y-auto">
<cs-card v-for="(item,index) in arrry" :key="index">
......@@ -13,7 +11,6 @@
<template v-slot:default>
<div class="w-full flex justify-end">
<van-button class="w-[48%]" plain size="small" type="primary">查看评价</van-button>
</div>
</template>
</cs-card>
......
......@@ -753,8 +753,8 @@ function getTextData(item) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxUser(searchCondition.data).then(res => {
init.data.array = res.response.data.map(cur => {
return {
showPopover: false,
......@@ -763,8 +763,9 @@ function getData() {
}
})
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
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 @@
<!-- </van-cell>-->
<!-- </van-cell-group>-->
<!-- </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">
<van-cell-group inset>
<van-cell @click="gotoPath('myOver')" is-link class="w-full h-[50px] flex items-center">
......
......@@ -535,12 +535,13 @@ const getSelectArray = () => {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
function onSubmit() {
......
......@@ -97,12 +97,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
......
......@@ -259,12 +259,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
async function adjust(item) {
......
<!--活动数据-->
<!--dtCard 三种值 value、tag、image-->
<template>
<div class="
<div
class="
w-full
min-h-[calc(100%-54px)]
overflow-y-auto
......@@ -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 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">
{{ ['借用二维码', '归还二维码', '已归还钥匙'][init.info.key_state] }}
</van-button>
</div>
<van-dialog v-model:show="init.key.show" title="钥匙信息二维码">
<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>
<template #footer>
<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>
</template>
</van-dialog>
......@@ -183,14 +186,14 @@ function getDtItem(keyUse, initKeyArray) {
function getData() {
hooks.getInitListRequest(() => {
hooks.myEncapsulationFunction(() => {
let commodity = ''
api.getApiCommodityGetCommodityTrackStr({activity_id: props.id}).then(res1 => {
return api.getApiCommodityGetCommodityTrackStr({activity_id: props.id}).then(res1 => {
commodity = res1.response
return res1
}).finally(() => {
api.getApiActivityGetActivityInfo({id: props.id}).then(res => {
if (res.response) {
nextTick(() => {
//渲染完成 传值给父组件
emit('getInitObject', res.response.card)
......@@ -205,14 +208,11 @@ function getData() {
//通过init.keyArray 遍历 得到数据数组 顺序插入init.array
init.array[index] = getDtItem(cur, init.data.keys)
})
init.info = res.response //获取活动信息生成要是二维码
}
})
})
})
}, true, '加载中...')
}
function inKey(item) {
......
<!--评价-->
<template>
<div class="
<div
v-if="!!init.array.length"
class="
w-full
min-h-[calc(100%-54px)]
overflow-y-auto
......@@ -10,8 +12,8 @@
">
<dt-card v-for="(item,index) in init.array" :key="index" :array="item"></dt-card>
</div>
<van-empty v-else description="暂无数据"/>
</template>
<script setup>
import {onMounted, defineProps, getCurrentInstance, reactive} from "vue";
......@@ -77,8 +79,8 @@ function getDtItem(keyUse, initKeyArray) {
function getData() {
//初始化数据
hooks.getInitListRequest(() => {
api.getApiEvaluateGetEvaluateList({activity_id: props.id}).then(res => {
hooks.myEncapsulationFunction(() => {
return api.getApiEvaluateGetEvaluateList({activity_id: props.id}).then(res => {
if (res.response) {
let array = []
res.response.map((item, index) => {
......@@ -97,8 +99,9 @@ function getData() {
//获取处理完的数组
init.array = array
}
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
<!--活动详情 钥匙-->
<template>
<div class="
<div
v-if="!!init.array.length"
class="
w-full
min-h-[calc(100%-54px)]
overflow-y-auto
......@@ -11,7 +13,7 @@
<dt-card v-for="(item,index) in init.array" :key="index" :array="item"></dt-card>
</div>
<van-empty v-else description="暂无数据"/>
</template>
<script setup>
import {onMounted, defineProps, getCurrentInstance, reactive} from "vue";
......@@ -77,8 +79,8 @@ function getDtItem(keyUse, initKeyArray) {
function getData() {
//初始化数据
hooks.getInitListRequest(() => {
api.getApiKeyGetKeyTrackInfoByActivity({
hooks.myEncapsulationFunction(() => {
return api.getApiKeyGetKeyTrackInfoByActivity({
activity_id: props.id
}).then(res => {
if (res.response) {
......@@ -103,8 +105,9 @@ function getData() {
]
)
}
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
<!--参与人-->
<template>
<div class="
<div
class="
w-full
min-h-[calc(100%-54px)]
overflow-y-auto
......@@ -249,8 +251,8 @@ async function getPeopleList() {
function getData() {
//初始化数据
hooks.getInitListRequest(() => {
api.getApiActivityGetParticipantList({
hooks.myEncapsulationFunction(() => {
return api.getApiActivityGetParticipantList({
activity_id: props.id,
page_index: init.page.page_index,
page_size: init.page.page_size
......@@ -281,8 +283,9 @@ function getData() {
//获取id数组 用于删除.
init.idArray = idArray
}
return res
})
})
}, true, '加载中...')
}
const isa = computed(() => {
......
......@@ -2,7 +2,9 @@
<template>
<div class="
<div
v-if="!!init.array.length"
class="
w-full
min-h-[calc(100%-54px)]
overflow-y-auto
......@@ -18,7 +20,7 @@
</van-step>
</van-steps>
</div>
<van-empty v-else description="暂无数据"/>
</template>
<script setup>
import {onMounted, defineProps, getCurrentInstance, reactive} from "vue";
......@@ -84,14 +86,15 @@ function getDtItem(keyUse, initKeyArray) {
function getData() {
//初始化数据
hooks.getInitListRequest(() => {
api.getApiActivityGetActivityTrackList({activity_id: props.id}).then(res => {
hooks.myEncapsulationFunction(() => {
return api.getApiActivityGetActivityTrackList({activity_id: props.id}).then(res => {
if (res.response) {
//获取处理完的数组
init.array = res.response
}
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
......@@ -4,24 +4,29 @@
<div class="w-full h-[calc(100vh)] overflow-y-auto ">
<!-- header-->
<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"/>
</div>
<div class="w-[87%] h-full">
<van-tabs v-model:active="active" @change="tabChange" swipeable>
<van-tab v-for="(item,index) in tabArray" :title="item" :key="index">
</van-tab>
<van-tabs v-model:active="active" swipeable @change="tabChange">
<van-tab v-for="(item,index) in tabArray" :key="index" :title="item"/>
</van-tabs>
</div>
</div>
<!-- content_content-->
<csActivityData @getInitObject="getInitObject" 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"/>
<!-- 活动详情-->
<csActivityData v-if="active ===0" :id="asc.$route.query.id" :showButton="asc.$route.query.show"
@getInitObject="getInitObject"/>
<!-- 参与人详情-->
<csPlayers v-if="active ===1" :id="asc.$route.query.id" :activityPeopleCard="activityPeopleCard"/>
<!-- 钥匙详情-->
<csKey v-if="active ===2" :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>
<!-- footer-->
<!-- <cs-page></cs-page>-->
......@@ -39,7 +44,8 @@ const tabArray = ref([
'活动数据',
'参与人',
'钥匙',
'评论',
'管理员评论',
'学生评论',
'轨迹',
])
const back = () => {
......
......@@ -13,7 +13,7 @@
</div>
<van-form class="mt-3">
<van-cell-group>
<!-- 场地类型选择器-->
<!-- 场地类型选择器-->
<van-field
v-model="init.placeTypeText"
is-link
......@@ -138,7 +138,6 @@
placeholder="请选择物资"
@click="init.commodity = true"
:error-message="init.commodityTextError"
/>
<van-cell v-if="init.radio === '1'">
{{ init.commodityText }}
......@@ -147,7 +146,6 @@
<template #content>
<div class="w-full h-[90%] bg-gray-100 overflow-y-auto ">
<Tree :data="init.commodityArray" show-checkbox @on-check-change="checkChange"></Tree>
</div>
<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>
......@@ -297,10 +295,14 @@ function validateTime(start, end) {
})
array = _.cloneDeep(check.data.list)
return array.splice(startIndex, endIndex - startIndex + 1).length
}
const checkTreeArray = ref([]);
function checkChange(all, item) {
/*checkTreeArray.value = all
checkTreeArray.value.splice(checkTreeArray.value.indexOf('1001'), 1)
console.log("🚀🚀checkTreeArray.value🚀,", checkTreeArray.value)*/
//选中物资树遍历获取ID
let array = []
init.commodityText = ''
......@@ -308,7 +310,6 @@ function checkChange(all, item) {
all.map((cur, index) => {
array.push(cur.id)
index !== 0 ? init.commodityText = init.commodityText + '_' + cur.title : init.commodityText = init.commodityText + cur.title
})
formValidate.data.commodity_list = array
}
......
......@@ -368,12 +368,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
function getQuickComment() {
......
......@@ -166,12 +166,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
......@@ -4,7 +4,6 @@
<!-- header-->
<cs-header @searchFun="searchFun"></cs-header>
<!-- content-->
<div class="w-full h-[calc(100vh-109px)] p-3 overflow-y-auto">
<div v-for="(item,index) in init.data.array" :key="index">
......@@ -198,12 +197,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
onMounted(() => {
......
......@@ -17,9 +17,7 @@
<van-button @click="init.comment.show = true;init.comment.formValidate.activity_id = item.id"
class="w-[48%]" plain size="small" type="primary">评价
</van-button>
<van-button @click="detail(item.id)" class="w-[48%] text-gray-600" plain size="small">详情</van-button>
</template>
</cs-card>
</div>
......@@ -67,7 +65,6 @@
<!-- </van-field>-->
<van-field name="uploader" label="图片上传">
<template #input>
<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=" m-1 w-[70px] h-[70px] bg-blue-600 border border-dashed border-gray-300 ">-->
......@@ -112,7 +109,7 @@
<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"
: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">
{{ item.content }}
</div>
......@@ -353,12 +350,13 @@ function pageChange(e) {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
function getQuickComment() {
......
......@@ -634,12 +634,13 @@ const getSelectArray = () => {
function getData() {
//初始化方法查询
hooks.getInitListRequest(() => {
api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
hooks.myEncapsulationFunction(() => {
return api.postApiActivityGetActivityListByWxPlaceAdmin(searchCondition.data).then(res => {
init.data.array = res.response.data
searchCondition.data.total = res.response.data_count
return res
})
})
}, true, '加载中...')
}
const watchArray = [
......
......@@ -148,7 +148,6 @@
</template>
<template #value>
{{ init.count.unevaluate }}
</template>
</van-cell>
<!-- <van-cell @click="gotoPath('rated')" is-link class="w-full h-[50px] flex items-center">-->
......@@ -163,7 +162,6 @@
<!-- </template>-->
<!-- <template #value>-->
<!-- {{ init.count.evaluate }}-->
<!-- </template>-->
<!-- </van-cell>-->
</van-cell-group>
......
......@@ -43,7 +43,7 @@ export const myActivity = [
component: () => import('../pages/myActivity/compontes/rated.vue'),
},
{
//待评价
//我的待评价
name: 'myRemainToBeEvaluated',
path: '/myRemainToBeEvaluated',
component: () => import('../pages/myActivity/compontes/remainToBeEvaluated.vue'),
......
......@@ -43,11 +43,12 @@ export const routerArray = [
component: () => import('../pages/welcome/compontes/rated.vue'),
},
{
//待评价
//管理员待评价
name: 'remainToBeEvaluated',
path: '/remainToBeEvaluated',
component: () => import('../pages/welcome/compontes/remainToBeEvaluated.vue'),
},
{
//使用中
name: 'useing',
......
import axios from 'axios';
import Cookies from 'js-cookie'
import {showToast, showNotify} from 'vant';
import {showToast, showNotify, closeToast} from 'vant';
import 'vant/es/notify/style'
import 'vant/es/toast/style';
import dayjs from 'dayjs';
......@@ -13,7 +13,7 @@ const axiosInstance = axios.create({
// baseURL: 'https://asc.hnasct.cn/DutyManagement',
baseURL: '/placemanage', // 默认地址代理转换为··域名·· 请求地址为 域名 + baseURL + 动态传入URL
timeout: 30 * 1000, // 设置请求超时时间,单位为毫秒
// headers: {
//
// 'Content-Type': 'application/json' ,
......@@ -68,18 +68,16 @@ axiosInstance.interceptors.response.use(
switch (response.data.code) {
//鉴别code 是否为1
case 1 :
return response.data
default :
switch (response.data.code !== void 0) {
//鉴别 code 是否定义 定义则接口报错 无code表示微信初始化接口数据
case true:
// 危险通知
showNotify({type: 'danger', message: response.data.msg_detail});
break;
closeToast();
return response.data
case false:
return response.data
}
break
}
......
......@@ -3,6 +3,7 @@ import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import {VantResolver} from 'unplugin-vue-components/resolvers';
import path from 'path'; // 关键代码
// https://vitejs.dev/config/
export default defineConfig({
......@@ -12,6 +13,13 @@ export default defineConfig({
resolvers: [VantResolver()],
}),
],
resolve: {
//src => @
alias: {
// 关键代码
'@': path.resolve(__dirname, './src')
}
},
base: './',
server: {
// host: "0.0.0.0",
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或