003-004
This commit is contained in:
parent
8066f80b0c
commit
32dd0a94d2
|
|
@ -39,6 +39,7 @@
|
|||
<view class="service-price">
|
||||
<text v-if="dataItem.team_buy_id">{{`团购价: `}}</text>¥<text
|
||||
style="font-size: 34rpx;">{{ dataItem.order_money }}</text>
|
||||
<text class="service-price-line">{{ dataItem.line_money }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -258,6 +259,15 @@
|
|||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
|
||||
.service-price-line {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
margin-left: 10rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.service-type {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -35,6 +35,7 @@
|
|||
<view class="service-price" >
|
||||
<text v-if="dataItem.team_buy_id">{{`团购价: `}}</text>¥<text
|
||||
style="font-size: 34rpx;">{{ dataItem.order_money }}</text>
|
||||
<text class="service-price-line">{{ dataItem.line_money }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -285,6 +286,14 @@
|
|||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
.service-price-line {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
margin-left: 10rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.service-type {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
<view class="service-price">
|
||||
<text v-if="dataItem.team_buy_id">{{`团购价: `}}</text>¥<text
|
||||
style="font-size: 34rpx;">{{ dataItem.order_money }}</text>
|
||||
<text class="service-price-line">{{ dataItem.line_money }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -258,6 +259,14 @@
|
|||
line-height: 34rpx;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
.service-price-line {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 34rpx;
|
||||
margin-left: 10rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.service-type {
|
||||
|
|
|
|||
|
|
@ -105,7 +105,9 @@
|
|||
<view class="per-cont">便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中所需内容。</view>
|
||||
</view>
|
||||
|
||||
<video v-show="videoPlay" :src="videoUrl" controls id="myvideo" style="height: 0;width: 0;" @fullscreenchange="screenChange"></video>
|
||||
<video v-show="videoPlay" :src="videoUrl" controls id="myvideo" style="height: 0; width: 0; position: absolute; top: -999rpx; left: -999rpx;"
|
||||
@fullscreenchange="screenChange"></video>
|
||||
<uv-divider></uv-divider>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -120,6 +122,7 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
videoContext:null,
|
||||
videoPlay: false,
|
||||
videoUrl: "",
|
||||
disabled: false,
|
||||
|
|
@ -201,10 +204,13 @@
|
|||
},
|
||||
methods: {
|
||||
screenChange(e) {
|
||||
|
||||
let fullScreen = e.detail.fullScreen; // 值true为进入全屏,false为退出全屏
|
||||
console.log(e, "全屏");
|
||||
if (!fullScreen) {
|
||||
//退出全屏
|
||||
this.videoContext.pause()
|
||||
plus.screen.lockOrientation('portrait-primary');
|
||||
this.videoPlay = false; // 隐藏播放盒子
|
||||
}
|
||||
},
|
||||
|
|
@ -220,8 +226,8 @@
|
|||
direction: 90
|
||||
});
|
||||
this.videoContext.play();
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
async submitPhoto() {
|
||||
// 1. 防连点核心逻辑:如果正在提交中,直接return阻止后续执行
|
||||
|
|
@ -366,7 +372,8 @@
|
|||
if (this.formData.type == 1) {
|
||||
res = await uploadImage.handleUpload(this.userInfo.id, 3);
|
||||
} else {
|
||||
res = await uploadImage.handleUpload(this.userInfo.id, 3, ['album', 'camera'], 'video');
|
||||
res = await uploadImage.handleUpload(this.userInfo.id, 3, ['album', 'camera'],
|
||||
'video');
|
||||
}
|
||||
console.log('上传单张图片', res)
|
||||
this.formData.url = res;
|
||||
|
|
@ -420,7 +427,8 @@
|
|||
// 1. 检查权限
|
||||
// const { granted } = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
this.nowQer = 'xc';
|
||||
const xc = await permissionUtils.checkPermission('photo_library', '需要相册权限用于上传照片');
|
||||
const xc = await permissionUtils.checkPermission('photo_library',
|
||||
'需要相册权限用于上传照片');
|
||||
this.nowQer = 'xj';
|
||||
const xj = await permissionUtils.checkPermission('camera', '需要相机权限用于拍摄照片');
|
||||
this.isShowPer = false;
|
||||
|
|
@ -439,8 +447,10 @@
|
|||
if (!confirm) return;
|
||||
|
||||
// 3. 请求权限
|
||||
const result1 = await permissionUtils.requestPermission('photo_library', '我们需要访问您的相册以上传图片/视频');
|
||||
const result2 = await permissionUtils.requestPermission('camera', '我们需要访问您的相机以上传图片/视频');
|
||||
const result1 = await permissionUtils.requestPermission('photo_library',
|
||||
'我们需要访问您的相册以上传图片/视频');
|
||||
const result2 = await permissionUtils.requestPermission('camera',
|
||||
'我们需要访问您的相机以上传图片/视频');
|
||||
if (result1 && result2) {
|
||||
this.openCamera();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@
|
|||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/time.png"></image>
|
||||
<text class="photo-mask-text">审核中…</text>
|
||||
</view>
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==3">
|
||||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/close2.png"></image>
|
||||
<view class="photo-mask-text">已驳回</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-content flex-row-center" v-else>
|
||||
|
|
@ -57,11 +61,11 @@
|
|||
<!-- <video class="content-photo-video" loop="true" :controls="false" :autoplay="true" :muted="true"
|
||||
:src="item2.url || item2.auth_url">
|
||||
</video> -->
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==1">
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==1">
|
||||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/time.png"></image>
|
||||
<view class="photo-mask-text">审核中…</view>
|
||||
</view>
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==3">
|
||||
<view class="content-photo-mask" v-if="item2.apply_state==3">
|
||||
<image class="photo-mask-img" mode="aspectFill" src="/static/images/icons/close2.png"></image>
|
||||
<view class="photo-mask-text">已驳回</view>
|
||||
</view>
|
||||
|
|
@ -115,7 +119,7 @@
|
|||
await this.getList()
|
||||
},
|
||||
async onLoad(options) {
|
||||
if(options.type){
|
||||
if (options.type) {
|
||||
this.type = options.type
|
||||
}
|
||||
},
|
||||
|
|
@ -151,7 +155,25 @@
|
|||
// });
|
||||
},
|
||||
goAdd(id, item) {
|
||||
console.log(11111, id)
|
||||
if (this.type == 1) {
|
||||
if ( this.imgVideoList[id] && this.imgVideoList[id].length >= 20) {
|
||||
uni.showToast({
|
||||
title: '最多上传20张图片',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
} else if (this.type == 2) {
|
||||
if ( this.imgVideoList[id] && this.imgVideoList[id].length >= 10) {
|
||||
uni.showToast({
|
||||
title: '最多上传10张视频',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
// 1. 原有逻辑:分类id为空,拦截提示
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
|
|
@ -186,14 +208,19 @@
|
|||
});
|
||||
},
|
||||
async getList() {
|
||||
await request.post("/sj/imgVideo/list", {
|
||||
type: this.type
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.imgVideoList = res.data.list[this.type]
|
||||
}
|
||||
|
||||
})
|
||||
try {
|
||||
const res = await request.post("/sj/imgVideo/list", {
|
||||
type: this.type
|
||||
});
|
||||
// 核心修复:保留imgVideoList对象结构,可选链避免属性不存在,默认值确保始终为对象
|
||||
this.imgVideoList = res.data?.list?.[this.type] || {};
|
||||
// 若接口返回格式为res.data.list[this.type]是对应类型的id数据,需调整为:
|
||||
// this.imgVideoList = res.data?.list?.[this.type] || {};
|
||||
} catch (err) {
|
||||
// 网络错误等异常处理,确保imgVideoList始终为对象
|
||||
console.error("获取图片/视频列表失败:", err);
|
||||
this.imgVideoList = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="container-card">
|
||||
|
||||
|
||||
<view class="card-content flex-row-center" v-if="type==1">
|
||||
<view class="card-content-page">{{ imgVideoList.length }}/20张</view>
|
||||
<view class="content-default" @click="goAdd(class_type)"
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="container-buttons flex-row-center-center" v-if="isManage">
|
||||
<view class="container-buttons flex-row-center-center" v-if="isManage">
|
||||
<view class="container-buttons-sure2 flex-row-center-center" @click="handleDelete">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -121,18 +121,15 @@
|
|||
async handleDelete() {
|
||||
// 收集选中项的ID
|
||||
let deleteIds = this.selectedItems.map(index => this.imgVideoList[index].id);
|
||||
let auth_ids = this.selectedItems.map(index => this.imgVideoList[index].auth_id).filter(item => item !== 0);
|
||||
console.log(1111,deleteIds,auth_ids,[1,6])
|
||||
let auth_ids = this.selectedItems.map(index => this.imgVideoList[index].auth_id).filter(item =>
|
||||
item !== 0);
|
||||
console.log(1111, deleteIds, auth_ids, [1, 6])
|
||||
try {
|
||||
const res = await request.post("/sj/imgVideo/del", {
|
||||
ids: deleteIds,
|
||||
auth_ids:auth_ids
|
||||
auth_ids: auth_ids
|
||||
});
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success'
|
||||
});
|
||||
// 重新获取列表
|
||||
await this.getList();
|
||||
// 退出管理模式
|
||||
|
|
@ -153,8 +150,8 @@
|
|||
},
|
||||
goAdd(id, item) {
|
||||
if (this.isManage) return; // 管理模式下禁止跳转
|
||||
if(this.type==1){
|
||||
if(this.imgVideoList.length>=20){
|
||||
if (this.type == 1) {
|
||||
if (this.imgVideoList.length >= 20) {
|
||||
uni.showToast({
|
||||
title: '最多上传20张图片',
|
||||
icon: 'none',
|
||||
|
|
@ -162,8 +159,8 @@
|
|||
});
|
||||
return
|
||||
}
|
||||
}else if(this.type==2){
|
||||
if(this.imgVideoList.length>=10){
|
||||
} else if (this.type == 2) {
|
||||
if (this.imgVideoList.length >= 10) {
|
||||
uni.showToast({
|
||||
title: '最多上传10张视频',
|
||||
icon: 'none',
|
||||
|
|
@ -206,14 +203,20 @@
|
|||
return obj
|
||||
},
|
||||
async getList() {
|
||||
await request.post("/sj/imgVideo/list", {
|
||||
type: this.type,
|
||||
class_type: this.class_type
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.imgVideoList = res.data.list[this.type][this.class_type]
|
||||
}
|
||||
})
|
||||
try {
|
||||
const res = await request.post("/sj/imgVideo/list", {
|
||||
type: this.type,
|
||||
class_type: this.class_type
|
||||
});
|
||||
// 核心修复:逐层可选链保护 + 兜底空数组,彻底避免属性访问错误
|
||||
this.imgVideoList = res.code === 200 ?
|
||||
res.data?.list?.[this.type]?.[this.class_type] || [] :
|
||||
[];
|
||||
} catch (err) {
|
||||
// 网络错误、接口报错等所有异常的兜底处理
|
||||
console.error("获取媒体列表失败:", err);
|
||||
this.imgVideoList = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -230,16 +233,16 @@
|
|||
font-style: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
.review {
|
||||
background: rgba(255, 250, 218, 1);
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
margin: 20rpx;
|
||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||
|
||||
|
||||
.review-title {
|
||||
margin-bottom: 6rpx;
|
||||
|
||||
|
||||
.review-title-text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
|
|
@ -249,7 +252,7 @@
|
|||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.container-card {
|
||||
|
|
@ -292,8 +295,8 @@
|
|||
.card-content {
|
||||
gap: 14rpx;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.card-content-page{
|
||||
|
||||
.card-content-page {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
|
|
|
|||
Loading…
Reference in New Issue