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