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

This commit is contained in:
lnn19986213 2023-08-07 10:53:37 +08:00
commit b81d2f99f8
1 changed files with 243 additions and 236 deletions

View File

@ -111,22 +111,23 @@
display: flex;
justify-content: space-between;
align-items: center;
">
<view class="title">
{{ item.title }}
</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_going" v-if="item.state == '1'">
进行中
</view>
</view>
<view class="act_time">
活动时间 {{ onDate(item.startTime) }} -
{{ onDate(item.endTime) }}
</view>
<view class="but_box" style="margin-top: 20rpx">
<!-- <view
"
>
<view class="title">
{{ item.title }}
</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_going" v-if="item.state == '1'">
进行中
</view>
</view>
<view class="act_time">
活动时间 {{ onDate(item.startTime) }} -
{{ onDate(item.endTime) }}
</view>
<view class="but_box" style="margin-top: 20rpx">
<!-- <view
style="width: 236rpx; margin: 0 10rpx"
v-if="item.state == '0'"
>
@ -206,226 +207,232 @@
</template>
<script>
export default {
data() {
return {
showShoudao: false,
show: false,
showS: false,
count: 4,
value: 2,
rate2: 2,
total: 0,
score: [{
name: "jack",
star: 0,
}, ],
starvalue: 0,
orderList: [],
tabNum: 1,
pingjiaobj: {},
baomingpingjia: [],
starsvalue: 0,
page: 1,
size: 20,
current: null,
isAdmin: null, //
isVillageAdmin: null, //
issueList: [],
receivingList: [],
evaluate: "",
id: "",
};
},
onShow() {
this.isAdmin = uni.getStorageSync("isAdmin");
this.isVillageAdmin = uni.getStorageSync("isVillageAdmin");
this.tabNum = this.isAdmin ? 1 : this.isVillageAdmin ? 2 : null;
this.clickTab(this.tabNum);
},
//
onPullDownRefresh() {
this.clickTab(this.tabNum);
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
//
onReachBottom() {
if (this.current > this.page) {
this.page++;
this.moreOrder();
}
},
methods: {
clickTab(num) {
this.receivingList = [];
this.issueList = [];
this.tabNum = num;
this.page = 1;
if (num == 1) {
this.myPosts();
} else if (num == 2) {
this.myArtCountryside();
}
},
myArtCountryside() {
let obj = {
page: this.page,
size: this.size,
};
this.http
.request("/artCountryside/myArtCountryside", obj, "GET")
.then((res) => {
if (res.code == 200) {
this.receivingList = [...this.receivingList, ...res.data.records];
this.page = res.data.current;
this.current = res.data.current;
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
myPosts() {
let obj = {
page: this.page,
size: this.size,
};
this.http
.request("/artCountryside/myPosts", obj, "GET")
.then((res) => {
if (res.code == 200) {
this.issueList = [...this.issueList, ...res.data.records];
this.page = res.data.current;
this.current = res.data.current;
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
onDate(time) {
let date = new Date(time);
return date.toLocaleString();
},
onPhoto(photo) {
let src = "";
if (photo) {
let list = photo.split(",");
src = list[0];
}
return src;
},
toUpimgPage(id) {
uni.navigateTo({
url: `/pagesD/xxgl/upload?id=${id}`,
});
},
touploadedimg(id) {
uni.navigateTo({
url: `/pagesD/xxgl/uploadShow?id=${id}`,
});
},
close() {
this.show = false;
},
closeRecive() {
this.showShoudao = false;
},
undone(val) {
this.undoneId = val;
this.showS = true;
},
closeS() {
this.showS = false;
},
pingjia(id) {
this.id = id;
this.show = true;
},
onSubmit() {
if (this.id == "") {
this.show = false;
return;
}
this.http
.request(
`/artCountryside/evaluate?id=${this.id}&evaluate=${this.evaluate}`, {},
"POST"
)
.then((res) => {
if (res.code == 200) {
uni.showToast({
title: "评价成功",
});
this.show = false;
this.moreOrder(true);
this.id = "";
this.evaluate = "";
} else {
uni.showToast({
title: err.data.message,
icon: "none",
});
}
})
.catch((err) => {
uni.showToast({
title: err.data.message,
icon: "none",
});
});
},
moreOrder(page = null) {
if (page) {
this.page = 1;
}
if (this.tabNum == 1) {
this.myPosts();
} else if (this.tabNum == 2) {
this.myArtCountryside();
}
},
// 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",
// });
// });
// },
//
export default {
data() {
return {
showShoudao: false,
show: false,
showS: false,
count: 4,
value: 2,
rate2: 2,
total: 0,
score: [
{
name: "jack",
star: 0,
},
],
starvalue: 0,
orderList: [],
tabNum: 1,
pingjiaobj: {},
baomingpingjia: [],
starsvalue: 0,
page: 1,
size: 20,
current: null,
isAdmin: null, //
isVillageAdmin: null, //
issueList: [],
receivingList: [],
evaluate: "",
id: "",
};
},
onShow() {
this.isAdmin = uni.getStorageSync("isAdmin");
this.isVillageAdmin = uni.getStorageSync("isVillageAdmin");
this.tabNum = this.isAdmin ? 1 : this.isVillageAdmin ? 2 : null;
this.clickTab(this.tabNum);
},
//
onPullDownRefresh() {
this.clickTab(this.tabNum);
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
},
//
onReachBottom() {
if (this.current > this.page) {
this.page++;
this.moreOrder();
}
},
methods: {
clickTab(num) {
this.orderList = [];
this.receivingList = [];
this.issueList = [];
this.tabNum = num;
this.page = 1;
if (num == 1) {
this.myPosts();
} else if (num == 2) {
this.myArtCountryside();
}
},
myArtCountryside() {
let obj = {
page: this.page,
size: this.size,
};
this.http
.request("/artCountryside/myArtCountryside", obj, "GET")
.then((res) => {
if (res.code == 200) {
this.receivingList = [...this.receivingList, ...res.data.records];
this.page = res.data.current;
this.current = res.data.current;
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
myPosts() {
let obj = {
page: this.page,
size: this.size,
};
this.http
.request("/artCountryside/myPosts", obj, "GET")
.then((res) => {
if (res.code == 200) {
this.issueList = [...this.issueList, ...res.data.records];
this.page = res.data.current;
this.current = res.data.current;
}
})
.catch((err) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
onDate(time) {
let date = new Date(time);
return date.toLocaleString();
},
onPhoto(photo) {
let src = "";
if (photo) {
let list = photo.split(",");
src = list[0];
}
return src;
},
toUpimgPage(id) {
uni.navigateTo({
url: `/pagesD/xxgl/upload?id=${id}`,
});
},
touploadedimg(id) {
uni.navigateTo({
url: `/pagesD/xxgl/uploadShow?id=${id}`,
});
},
close() {
this.id = "";
this.show = false;
},
closeRecive() {
this.id = "";
this.showShoudao = false;
},
undone(val) {
this.undoneId = val;
this.showS = true;
},
closeS() {
this.showS = false;
},
pingjia(id) {
this.id = id;
this.show = true;
},
onSubmit() {
if (this.id == "") {
this.show = false;
return;
}
this.http
.request(
`/artCountryside/evaluate?id=${this.id}&evaluate=${this.evaluate}`,
{},
"POST"
)
.then((res) => {
if (res.code == 200) {
uni.showToast({
title: "评价成功",
});
this.show = false;
this.moreOrder(true);
this.id = "";
this.evaluate = "";
} else {
uni.showToast({
title: err.data.message,
icon: "none",
});
}
})
.catch((err) => {
uni.showToast({
title: err.data.message,
icon: "none",
});
});
},
moreOrder(page = null) {
if (page) {
this.page = 1;
}
if (this.tabNum == 1) {
this.myPosts();
} else if (this.tabNum == 2) {
this.myArtCountryside();
}
},
// 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",
// });
// });
// },
//
// cancleBM(id) {
// let that = this;