Merge branch 'master' of git.zdool.com:xs/yyx/h5

This commit is contained in:
lnn19986213 2023-08-03 16:00:46 +08:00
commit f7ae651016
2 changed files with 480 additions and 573 deletions

View File

@ -93,7 +93,11 @@
</view> </view>
</view> </view>
<view class="content_bott_itm" @click="toCountryside()"> <view
class="content_bott_itm"
@click="toCountryside()"
v-if="isAdmin || isVillageAdmin"
>
<!-- @click="" --> <!-- @click="" -->
<view class="content_bott_wods"> 下乡管理 </view> <view class="content_bott_wods"> 下乡管理 </view>
<view class="content_bott_arrow"> <view class="content_bott_arrow">
@ -145,6 +149,8 @@ export default {
isUnread: false, isUnread: false,
statusHeight: 0, statusHeight: 0,
titleHeight: 90, titleHeight: 90,
isAdmin: null,
isVillageAdmin: null,
}; };
}, },
onReady() { onReady() {
@ -160,6 +166,8 @@ export default {
}, },
onShow() { onShow() {
this.getUserInfo(); this.getUserInfo();
this.isAdmin = uni.getStorageSync("isAdmin");
this.isVillageAdmin = uni.getStorageSync("isVillageAdmin");
}, },
methods: { methods: {
// //

View File

@ -1,6 +1,7 @@
<template> <template>
<view> <view>
<view <view
v-if="isAdmin || isVillageAdmin"
class="tabss" class="tabss"
style=" style="
display: flex; display: flex;
@ -25,13 +26,8 @@
</view> </view>
</view> </view>
<view class="main"> <view class="main">
<view <view v-if="tabNum == 1">
class="art_act_itm" <view class="art_act_itm" v-for="(item, i) in issueList" :key="i">
v-for="(item, i) in orderList"
:key="i"
v-if="tabNum == 1"
>
<!-- <image src="../../static/icon12.jpg" mode=""></image> -->
<image <image
:src="item.enclosure" :src="item.enclosure"
mode="" mode=""
@ -50,7 +46,9 @@
{{ item.title }} {{ item.title }}
</view> </view>
<view class="tag_sta_end" v-if="item.state == '3'"> 已完成 </view> <view class="tag_sta_end" v-if="item.state == '3'"> 已完成 </view>
<view class="tag_sta_fail" v-if="item.state == '4'"> 未接单 </view> <view class="tag_sta_fail" v-if="item.state == '4'">
未接单
</view>
<view <view
class="tag_sta_going" class="tag_sta_going"
v-if="item.state == '1' || item.state == '0'" v-if="item.state == '1' || item.state == '0'"
@ -59,7 +57,7 @@
</view> </view>
<view class="tag_sta_end" v-if="item.state == '2'"> 待评价 </view> <view class="tag_sta_end" v-if="item.state == '2'"> 待评价 </view>
</view> </view>
<view class="act_time"> 活动时间 {{ item.createdAt }} </view> <view class="act_time"> 活动时间 {{ item.startTime }} </view>
<view <view
class="but_box" class="but_box"
style="margin-top: 20rpx" style="margin-top: 20rpx"
@ -93,7 +91,11 @@
@click="undone(item.id)" @click="undone(item.id)"
v-if="item.state != '2' && item.state != '3'" v-if="item.state != '2' && item.state != '3'"
> >
<u-button color="#99241B" shape="circle" text="未完成"></u-button> <u-button
color="#99241B"
shape="circle"
text="未完成"
></u-button>
</view> </view>
<view <view
style="width: 236rpx; margin: 0 10rpx" style="width: 236rpx; margin: 0 10rpx"
@ -147,13 +149,17 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="!(issueList.length > 0)">
<view <u-empty
class="art_act_itm" mode="list"
v-for="(item, i) in orderList" icon="http://cdn.uviewui.com/uview/empty/list.png"
:key="i"
v-if="tabNum == 2"
> >
</u-empty>
</view>
</view>
<view v-if="tabNum == 2">
<view class="art_act_itm" v-for="(item, i) in receivingList" :key="i">
<image <image
@click="goActDeat(item.id)" @click="goActDeat(item.id)"
:src="item.enclosure" :src="item.enclosure"
@ -173,9 +179,11 @@
</view> </view>
<view class="tag_sta" v-if="item.state == '0'"> 已报名 </view> <view class="tag_sta" v-if="item.state == '0'"> 已报名 </view>
<view class="tag_sta_end" v-if="item.state == '2'"> 已完成 </view> <view class="tag_sta_end" v-if="item.state == '2'"> 已完成 </view>
<view class="tag_sta_going" v-if="item.state == '1'"> 进行中 </view> <view class="tag_sta_going" v-if="item.state == '1'">
进行中
</view> </view>
<view class="act_time"> 活动时间 {{ item.createdAt }} </view> </view>
<view class="act_time"> 活动时间 {{ item.startTime }} </view>
<view class="but_box" style="margin-top: 20rpx"> <view class="but_box" style="margin-top: 20rpx">
<view <view
style="width: 236rpx; margin: 0 10rpx" style="width: 236rpx; margin: 0 10rpx"
@ -200,6 +208,14 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="!(receivingList.length > 0)">
<u-empty
mode="list"
icon="http://cdn.uviewui.com/uview/empty/list.png"
>
</u-empty>
</view>
</view>
</view> </view>
<u-popup :show="showS" @close="closeS" mode="center" :round="10"> <u-popup :show="showS" @close="closeS" mode="center" :round="10">
<view style="width: 640rpx"> <view style="width: 640rpx">
@ -295,10 +311,6 @@
</view> </view>
</view> </view>
</u-modal> </u-modal>
<view v-if="!(orderList.length > 0)">
<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
</u-empty>
</view>
</view> </view>
</template> </template>
@ -327,9 +339,16 @@ export default {
starsvalue: 0, starsvalue: 0,
page: 1, page: 1,
size: 20, size: 20,
isAdmin: null, //
isVillageAdmin: null, //
issueList: [],
receivingList: [],
}; };
}, },
onShow() { onShow() {
this.isAdmin = uni.getStorageSync("isAdmin");
this.isVillageAdmin = uni.getStorageSync("isVillageAdmin");
this.tabNum = this.isAdmin ? 1 : this.isVillageAdmin ? 2 : null;
this.clickTab(this.tabNum); this.clickTab(this.tabNum);
}, },
// //
@ -352,7 +371,115 @@ export default {
if (num == 1) { if (num == 1) {
let that = this; let that = this;
this.myPosts(); this.myPosts();
} else if (num == 2) {
let that = this;
this.myArtCountryside();
}
},
myArtCountryside() {
this.http
.request("/artCountryside/myArtCountryside", {}, "GET")
.then((res) => {
if (res.code == 200) {
this.receivingList = res.data.records;
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
myPosts() {
this.http
.request("/artCountryside/myPosts", {}, "GET")
.then((res) => {
if (res.code == 200) {
this.issueList = res.data.records;
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
// receiveevlaue(id) {
// this.showShoudao = true;
// this.http
// .request("/hallUser/sdpj?id=" + id, {}, "POST")
// .then((res) => {
// if (res.code == 200) {
// this.starsvalue = res.data.evaluate;
// this.showShoudao = true;
// }
// })
// .catch((e) => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// });
// },
// done(id) {
// this.http
// .request("/hallUser/complete?id=" + id, {}, "POST")
// .then((res) => {
// if (res.code == 200) {
// this.clickTab(1);
// }
// })
// .catch((e) => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// });
// },
// pingjia(num, id) {
// this.show = true;
// this.pingjiaobj = this.orderList[num];
// let that = this;
// this.http
// .request("/hallUser/pjList?hallId=" + id, {}, "GET")
// .then((res) => {
// if (res.code == 200) {
// console.log("reg", res.data);
// this.baomingpingjia = res.data;
// }
// })
// .catch((e) => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// });
// },
// cancleBM(id) {
// let that = this;
// this.http
// .request("/hallUser/qxSingUp?hallId=" + id, {}, "POST")
// .then((res) => {
// if (res.code == 200) {
// this.clickTab(2);
// uni.showToast({
// title: "",
// icon: "none",
// });
// }
// })
// .catch((e) => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// });
// },
// moreOrder() {
// if (this.tabNum == 1) {
// let that = this;
// this.http // this.http
// .request( // .request(
// "/hallUser/ddgl", // "/hallUser/ddgl",
@ -393,10 +520,8 @@ export default {
// icon: "none", // icon: "none",
// }); // });
// }); // });
} else if (num == 2) { // } else if (this.tabNum == 2) {
let that = this; // let that = this;
this.myArtCountryside();
// this.http // this.http
// .request( // .request(
// "/hallUser/myHall", // "/hallUser/myHall",
@ -404,6 +529,7 @@ export default {
// "GET" // "GET"
// ) // )
// .then((res) => { // .then((res) => {
// if (res.code == 200) {
// if (res.data.records.length > 0) { // if (res.data.records.length > 0) {
// res.data.records.forEach(function (item) { // res.data.records.forEach(function (item) {
// if (item.enclosure) { // if (item.enclosure) {
@ -428,6 +554,7 @@ export default {
// } else if (res.data.records.length == 0) { // } else if (res.data.records.length == 0) {
// this.page--; // this.page--;
// } // }
// }
// }) // })
// .catch((e) => { // .catch((e) => {
// uni.showToast({ // uni.showToast({
@ -435,9 +562,8 @@ export default {
// icon: "none", // icon: "none",
// }); // });
// }); // });
// // } else if (this.tabNum == 3) {
} else if (num == 3) { // let that = this;
let that = this;
// this.http // this.http
// .request( // .request(
// "/hallUser/myHall?state=2", // "/hallUser/myHall?state=2",
@ -445,6 +571,7 @@ export default {
// "GET" // "GET"
// ) // )
// .then((res) => { // .then((res) => {
// if (res.code == 200) {
// if (res.data.records.length > 0) { // if (res.data.records.length > 0) {
// res.data.records.forEach(function (item) { // res.data.records.forEach(function (item) {
// if (item.enclosure) { // if (item.enclosure) {
@ -469,6 +596,74 @@ export default {
// } else if (res.data.records.length == 0) { // } else if (res.data.records.length == 0) {
// this.page--; // this.page--;
// } // }
// }
// })
// .catch((e) => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// });
// }
// },
// goActDeat(id, typEnum) {
// if (typEnum) {
// uni.navigateTo({
// url: `/pagesB/orderHall/orderHallDetails?id=${id}&isCheck=${typEnum}`,
// });
// } else {
// uni.navigateTo({
// url: `/pagesB/orderHall/orderHallDetails?id=${id}`,
// });
// }
// },
// toUpimgPage(id) {
// this.http
// .request("/hallUser/pjList?hallId=" + id, {}, "GET")
// .then((res) => {
// if (res.code == 200) {
// console.log("reg", res.data);
// if (res.data.length > 0) {
// uni.navigateTo({
// url: `/pagesA/my/imgUpload?id=` + id,
// });
// } else {
// uni.showToast({
// title: "",
// icon: "none",
// });
// }
// }
// })
// .catch((e) => {
// uni.showToast({
// title: e.data.message,
// icon: "none",
// });
// });
// },
// touploadedimg(imgstr) {
// uni.navigateTo({
// url: "/pagesA/my/uploadedImgShow?imgstring=" + imgstr,
// });
// },
// subEvalue(item) {
// let that = this;
// let arr = [];
// this.baomingpingjia.forEach(function (em, i) {
// arr.push({
// evaluate: em.evaluate,
// hallId: em.hallId,
// userId: em.userId,
// });
// });
// that.http
// .request("/hallUser/evaluate", arr, "POST")
// .then((res) => {
// if (res.code == 200) {
// that.clickTab(1);
// console.log("testdata", res);
// }
// }) // })
// .catch((e) => { // .catch((e) => {
// uni.showToast({ // uni.showToast({
@ -476,312 +671,16 @@ export default {
// icon: "none", // icon: "none",
// }); // });
// }); // });
}
},
myArtCountryside() {
this.http
.request("/artCountryside/myArtCountryside", {}, "GET")
.then((res) => {
if (res.code == 200) {
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
myPosts() {
this.http
.request("/artCountryside/myPosts", {}, "GET")
.then((res) => {
if (res.code == 200) {
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
receiveevlaue(id) {
this.showShoudao = true;
this.http
.request("/hallUser/sdpj?id=" + id, {}, "POST")
.then((res) => {
if (res.code == 200) {
this.starsvalue = res.data.evaluate;
this.showShoudao = true;
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
done(id) {
this.http
.request("/hallUser/complete?id=" + id, {}, "POST")
.then((res) => {
if (res.code == 200) {
this.clickTab(1);
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
pingjia(num, id) {
this.show = true;
this.pingjiaobj = this.orderList[num];
let that = this;
this.http
.request("/hallUser/pjList?hallId=" + id, {}, "GET")
.then((res) => {
if (res.code == 200) {
console.log("reg", res.data);
this.baomingpingjia = res.data;
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
cancleBM(id) {
let that = this;
this.http
.request("/hallUser/qxSingUp?hallId=" + id, {}, "POST")
.then((res) => {
if (res.code == 200) {
this.clickTab(2);
uni.showToast({
title: "成功",
icon: "none",
});
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
moreOrder() { // this.show = false;
if (this.tabNum == 1) { // console.log(this.score);
let that = this; // //
this.http // },
.request( // toEvlauedpg(id) {
"/hallUser/ddgl", // uni.navigateTo({
{ page: this.page, size: this.size }, // url: `/pagesA/my/evaluated?id=` + id,
"GET" // });
) // },
.then((res) => {
if (res.code == 200) {
if (res.data.records.length > 0) {
res.data.records.forEach(function (item) {
if (item.enclosure) {
let fileArr = item.enclosure.split(",");
let gs = fileArr[0].substr(fileArr[0].lastIndexOf(".") + 1);
if (
gs == "jpg" ||
gs == "jpeg" ||
gs == "png" ||
gs == "bmp" ||
gs == "gif" ||
gs == "tif" ||
gs == "tiff"
) {
item.enclosure = fileArr[0];
} else if (gs == "pdf") {
item.enclosure = "../../static/fileImg/pdfB.png";
}
}
that.orderList.push(item);
});
} else if (res.data.records.length == 0) {
this.page--;
}
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
} else if (this.tabNum == 2) {
let that = this;
this.http
.request(
"/hallUser/myHall",
{ page: this.page, size: this.size },
"GET"
)
.then((res) => {
if (res.code == 200) {
if (res.data.records.length > 0) {
res.data.records.forEach(function (item) {
if (item.enclosure) {
let fileArr = item.enclosure.split(",");
let gs = fileArr[0].substr(fileArr[0].lastIndexOf(".") + 1);
if (
gs == "jpg" ||
gs == "jpeg" ||
gs == "png" ||
gs == "bmp" ||
gs == "gif" ||
gs == "tif" ||
gs == "tiff"
) {
item.enclosure = fileArr[0];
} else if (gs == "pdf") {
item.enclosure = "../../static/fileImg/pdfB.png";
}
}
that.orderList.push(item);
});
} else if (res.data.records.length == 0) {
this.page--;
}
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
} else if (this.tabNum == 3) {
let that = this;
this.http
.request(
"/hallUser/myHall?state=2",
{ page: this.page, size: this.size },
"GET"
)
.then((res) => {
if (res.code == 200) {
if (res.data.records.length > 0) {
res.data.records.forEach(function (item) {
if (item.enclosure) {
let fileArr = item.enclosure.split(",");
let gs = fileArr[0].substr(fileArr[0].lastIndexOf(".") + 1);
if (
gs == "jpg" ||
gs == "jpeg" ||
gs == "png" ||
gs == "bmp" ||
gs == "gif" ||
gs == "tif" ||
gs == "tiff"
) {
item.enclosure = fileArr[0];
} else if (gs == "pdf") {
item.enclosure = "../../static/fileImg/pdfB.png";
}
}
that.orderList.push(item);
});
} else if (res.data.records.length == 0) {
this.page--;
}
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
}
},
goActDeat(id, typEnum) {
if (typEnum) {
uni.navigateTo({
url: `/pagesB/orderHall/orderHallDetails?id=${id}&isCheck=${typEnum}`,
});
} else {
uni.navigateTo({
url: `/pagesB/orderHall/orderHallDetails?id=${id}`,
});
}
},
toUpimgPage(id) {
this.http
.request("/hallUser/pjList?hallId=" + id, {}, "GET")
.then((res) => {
if (res.code == 200) {
console.log("reg", res.data);
if (res.data.length > 0) {
uni.navigateTo({
url: `/pagesA/my/imgUpload?id=` + id,
});
} else {
uni.showToast({
title: "无人接单",
icon: "none",
});
}
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
touploadedimg(imgstr) {
uni.navigateTo({
url: "/pagesA/my/uploadedImgShow?imgstring=" + imgstr,
});
},
subEvalue(item) {
let that = this;
let arr = [];
this.baomingpingjia.forEach(function (em, i) {
arr.push({
evaluate: em.evaluate,
hallId: em.hallId,
userId: em.userId,
});
});
that.http
.request("/hallUser/evaluate", arr, "POST")
.then((res) => {
if (res.code == 200) {
that.clickTab(1);
console.log("testdata", res);
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
this.show = false;
console.log(this.score);
//
},
toEvlauedpg(id) {
uni.navigateTo({
url: `/pagesA/my/evaluated?id=` + id,
});
},
close() { close() {
this.show = false; this.show = false;
}, },
@ -795,22 +694,22 @@ export default {
closeS() { closeS() {
this.showS = false; this.showS = false;
}, },
sureS() { // sureS() {
this.http // this.http
.request("/hallUser/undone?id=" + this.undoneId, {}, "POST") // .request("/hallUser/undone?id=" + this.undoneId, {}, "POST")
.then((res) => { // .then((res) => {
if (res.code == 200) { // if (res.code == 200) {
this.clickTab(this.tabNum); // this.clickTab(this.tabNum);
this.showS = false; // this.showS = false;
} // }
}) // })
.catch((e) => { // .catch((e) => {
uni.showToast({ // uni.showToast({
title: e.data.message, // title: e.data.message,
icon: "none", // icon: "none",
}); // });
}); // });
}, // },
}, },
}; };
</script> </script>