This commit is contained in:
闫世杰 2023-08-03 17:31:20 +08:00
parent f7ae651016
commit c0bb5d5f96
5 changed files with 415 additions and 96 deletions

View File

@ -219,13 +219,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "ArtRace/raceWork",
"style": {
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "ArtRace/raceWork",
"style": {
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "ConfirmOrder/ConfirmOrder",
"style": {
@ -634,6 +634,21 @@
"enablePullDownRefresh": false
}
},
// -
{
"path": "xxgl/upload",
"style": {
"navigationBarTitleText": "图片上传",
"enablePullDownRefresh": false
}
}, // -
{
"path": "xxgl/uploadShow",
"style": {
"navigationBarTitleText": "查看图片",
"enablePullDownRefresh": false
}
},
// 线
{
"path": "xskz/index",

View File

@ -1,42 +1,44 @@
<template>
<view class="im" >
<image v-for=" (v,i) in imgArr" class="imgSt" :src="v" mode=""></image>
</view>
<view class="im">
<image
v-for="(v, i) in imgArr"
class="imgSt"
:src="v"
mode=""
:key="i"
></image>
</view>
</template>
<script>
export default {
data() {
return {
imgArr:[]
};
},
onLoad(op) {
console.log("ddddd",op.imgstring);
let imgarrs=[]
op.imgstring.split(",").forEach(function(eml,index){
imgarrs.push(eml)
})
this.imgArr=imgarrs
console.log("ar",imgarrs);
}
}
export default {
data() {
return {
imgArr: [],
};
},
onLoad(op) {
let imgarrs = [];
op.imgstring.split(",").forEach(function (eml, index) {
imgarrs.push(eml);
});
this.imgArr = imgarrs;
console.log("ar", imgarrs);
},
};
</script>
<style lang="scss">
.imgSt{
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
overflow: hidden;
margin: 0 10rpx;
.imgSt {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
overflow: hidden;
margin: 0 10rpx;
}
page{
padding-top: 24rpx;
width: calc(100% - 32rpx);
margin: 0 auto;
page {
padding-top: 24rpx;
width: calc(100% - 32rpx);
margin: 0 auto;
}
</style>

View File

@ -29,7 +29,8 @@
<view v-if="tabNum == 1">
<view class="art_act_itm" v-for="(item, i) in issueList" :key="i">
<image
:src="item.enclosure"
:src="item.photos.split(',')[0]"
alt="图片加载错误"
mode=""
@click="goActDeat(item.id, 1)"
></image>
@ -45,19 +46,25 @@
<view class="title">
{{ item.title }}
</view>
<view class="tag_sta_end" v-if="item.state == '3'"> 已完成 </view>
<view class="tag_sta_fail" v-if="item.state == '4'">
<view class="tag_sta_end" v-if="item.state == '2'"> 已完成 </view>
<!-- <view class="tag_sta_fail" v-if="item.state == '4'">
未接单
</view>
<view
</view> -->
<!-- <view
class="tag_sta_going"
v-if="item.state == '1' || item.state == '0'"
>
进行中
</view> -->
<view class="tag_sta_end" v-if="item.state == '1'"> 待评价 </view>
<view class="tag_sta_end" v-if="item.state == '0'">
图片待上传
</view>
<view class="tag_sta_end" v-if="item.state == '2'"> 待评价 </view>
</view>
<view class="act_time"> 活动时间 {{ item.startTime }} </view>
<view class="act_time">
活动时间 {{ onDate(item.startTime) }} -
{{ onDate(item.endTime) }}
</view>
<view
class="but_box"
style="margin-top: 20rpx"
@ -71,7 +78,7 @@
icon="photo-fill"
shape="circle"
text="已传图片"
@click="touploadedimg(item.images)"
@click="touploadedimg(item.id)"
>
</u-button>
</view>
@ -160,11 +167,7 @@
<view v-if="tabNum == 2">
<view class="art_act_itm" v-for="(item, i) in receivingList" :key="i">
<image
@click="goActDeat(item.id)"
:src="item.enclosure"
mode=""
></image>
<image @click="goActDeat(item.id)" :src="item.photos" mode=""></image>
<view class="bottom_part" style="padding: 0 12px">
<view
class="ddd"
@ -183,7 +186,10 @@
进行中
</view>
</view>
<view class="act_time"> 活动时间 {{ item.startTime }} </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"
@ -406,6 +412,33 @@ export default {
});
});
},
onDate(time) {
let date = new Date(time);
return date.toLocaleString();
},
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;
},
// receiveevlaue(id) {
// this.showShoudao = true;
// this.http
@ -617,36 +650,7 @@ export default {
// });
// }
// },
// 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 = [];
@ -681,19 +685,7 @@ export default {
// url: `/pagesA/my/evaluated?id=` + id,
// });
// },
close() {
this.show = false;
},
closeRecive() {
this.showShoudao = false;
},
undone(val) {
this.undoneId = val;
this.showS = true;
},
closeS() {
this.showS = false;
},
// sureS() {
// this.http
// .request("/hallUser/undone?id=" + this.undoneId, {}, "POST")
@ -786,6 +778,7 @@ image {
}
.act_time {
margin: 26rpx 0;
height: 34rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;

250
src/pagesD/xxgl/upload.vue Normal file
View File

@ -0,0 +1,250 @@
<template>
<view>
<view class="wanShan">
<view class="data_itm_box" style="padding: 32rpx">
<view class="data_itm">
<view class="data_itm_key label_t"> 图片上传 </view>
</view>
<u-upload
class="upload"
accept="image"
width="172rpx"
height="172rpx"
:fileList="fileList3"
@afterRead="afterRead"
@delete="deletePic"
name="3"
multiple
>
<image
style="width: 172rpx; height: 172rpx"
src="../../static/improveData/jia.png"
></image>
</u-upload>
</view>
</view>
<view class="operation">
<button type="default" class="next" @click="submit">确定</button>
</view>
<view class="zhan_w">
<!-- zhanwei -->
</view>
</view>
</template>
<script>
import http from "../../request/interface.js";
export default {
data() {
return {
fileList3: [], //
id: "",
};
},
onLoad(option) {
this.id = option.id;
},
methods: {
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1);
},
//
async afterRead(event) {
// mutiple true , file
let lists = [].concat(event.file);
let fileListLen = this[`fileList${event.name}`].length;
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: "uploading",
message: "上传中",
});
});
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url);
let item = this[`fileList${event.name}`][fileListLen];
this[`fileList${event.name}`].splice(
fileListLen,
1,
Object.assign(item, {
status: "success",
message: "",
url: result,
})
);
fileListLen++;
}
},
uploadFilePromise(url) {
let token = uni.getStorageSync("token");
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: http.config.baseUrl + "/file/upload",
filePath: url,
name: "file",
formData: {
user: "test",
},
header: {
"X-Token": token,
},
success: (res) => {
if (JSON.parse(res.data).code == 200) {
setTimeout(() => {
resolve(JSON.parse(res.data).data.path);
}, 1000);
} else {
uni.showToast({
title: JSON.parse(res.data).message,
icon: "none",
});
this.fileList3.pop();
}
},
});
});
},
submit() {
let image = [];
this.fileList3.forEach(function (item) {
image.push(item.url);
});
let data = image.join(",");
console.log(data);
this.http
.request(
"/artCountryside/addPhotos?id=" + this.id + "&photos=" + data,
{},
"POST"
)
.then((res) => {
if (res.code == 200) {
uni.navigateBack();
}
})
.catch((e) => {
uni.showToast({
title: e.data.message,
icon: "none",
});
});
},
},
};
</script>
<style lang="scss">
/* page {
background-color: #F5F5F5;
}
*/
.p32 {
padding: 20rpx !important;
}
.WenYiUpload {
margin-top: 16rpx;
}
.te /deep/ .u-form-item__body__right__content__slot {
flex-wrap: wrap !important;
}
image {
width: 100%;
height: 100%;
}
.upload {
padding-top: 32rpx;
}
.data_itm_box {
padding: 32rpx 0rpx;
.chen_itm {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
.right_img_box {
width: 80rpx;
height: 80rpx;
margin-left: 16rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
margin-bottom: 16rpx;
border: 1px solid transparent;
padding: 0 32rpx;
background-color: #ffffff;
.data_itm {
.label_t {
font-size: 28rpx;
color: $black;
font-weight: 600;
}
}
.xie {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
}
.upload_box {
width: 166rpx;
height: 166rpx;
margin-left: 32rpx;
position: relative;
background-color: #f8f8f8;
margin-bottom: 64rpx;
}
}
.operation {
display: flex;
justify-content: space-between;
align-items: center;
padding: 32rpx 32rpx 48rpx;
position: fixed;
left: 0;
bottom: 0;
right: 0;
background-color: #ffffff;
box-shadow: 0px -4px 10px 1px rgba(192, 192, 192, 0.12);
z-index: 99;
.next {
width: calc(100% - 48rpx);
height: 80rpx;
line-height: 80rpx;
background-color: #99241b;
color: #fff;
font-size: 32rpx;
font-weight: 600;
border: none;
button {
&::after {
border: none;
}
}
}
}
.zhan_w {
height: 160rpx;
}
</style>

View File

@ -0,0 +1,59 @@
<template>
<view class="im">
<image
v-for="(v, i) in imgArr"
class="imgSt"
:src="v"
mode=""
:key="i"
></image>
</view>
</template>
<script>
export default {
data() {
return {
id: "",
imgArr: [],
};
},
onLoad(query) {
this.id = query.id;
// let imgarrs = [];
// op.imgstring.split(",").forEach(function (eml, index) {
// imgarrs.push(eml);
// });
// this.imgArr = imgarrs;
},
onShow() {
this.onInfo();
},
methods: {
onInfo() {
this.http
.request(`/artCountryside/details`, { id: this.id }, "GET")
.then((res) => {
if (res.code == 200) {
this.imgArr = res.data.photos.split(",");
}
});
},
},
};
</script>
<style lang="scss">
.imgSt {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
overflow: hidden;
margin: 0 10rpx;
}
page {
padding-top: 24rpx;
width: calc(100% - 32rpx);
margin: 0 auto;
}
</style>