多个bug修改
This commit is contained in:
parent
e4b7646da9
commit
35dca559d3
|
|
@ -7,8 +7,8 @@
|
||||||
"type" : "uni-app:app-ios"
|
"type" : "uni-app:app-ios"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"customPlaygroundType" : "device",
|
"customPlaygroundType" : "local",
|
||||||
"playground" : "standard",
|
"playground" : "custom",
|
||||||
"type" : "uni-app:app-android"
|
"type" : "uni-app:app-android"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"apps": [],
|
"apps": [],
|
||||||
"details": [
|
"details": [
|
||||||
{
|
{
|
||||||
"appID": "wx5b1c0c8d01ded35d",
|
"appID": "wx17eef65c270b4869",
|
||||||
"paths": ["*"]
|
"paths": ["*"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@
|
||||||
"payment" : {
|
"payment" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"__platform__" : [ "ios", "android" ],
|
"__platform__" : [ "ios", "android" ],
|
||||||
"appid" : "wx2381a791a52a402d",
|
"appid" : "wx17eef65c270b4869",
|
||||||
"UniversalLinks" : "https://app.mrrweb.com.cn/"
|
"UniversalLinks" : "https://app.mrrweb.com.cn/"
|
||||||
},
|
},
|
||||||
"appleiap" : {},
|
"appleiap" : {},
|
||||||
|
|
@ -117,7 +117,7 @@
|
||||||
},
|
},
|
||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx2381a791a52a402d",
|
"appid" : "wx17eef65c270b4869",
|
||||||
"UniversalLinks" : "https://app.mrrweb.com.cn/"
|
"UniversalLinks" : "https://app.mrrweb.com.cn/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
},
|
},
|
||||||
"oauth" : {
|
"oauth" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx2381a791a52a402d",
|
"appid" : "wx17eef65c270b4869",
|
||||||
"UniversalLinks" : "https://app.mrrweb.com.cn/"
|
"UniversalLinks" : "https://app.mrrweb.com.cn/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +197,7 @@
|
||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wxb486b10a60d2c78d",
|
"appid" : "wx17eef65c270b4869",
|
||||||
"privacy" : {
|
"privacy" : {
|
||||||
"requiredPrivateInfos" : [ "getBackgroundFetchData" ]
|
"requiredPrivateInfos" : [ "getBackgroundFetchData" ]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
1200
pages/shop/pay.vue
1200
pages/shop/pay.vue
File diff suppressed because it is too large
Load Diff
|
|
@ -369,6 +369,7 @@
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '上传中'
|
title: '上传中'
|
||||||
})
|
})
|
||||||
|
console.log(this.formData,'=============================');
|
||||||
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 {
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,14 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="titles-right">
|
<view class="titles-right">
|
||||||
<text class="titles-text">展示位置及拍摄技巧</text>
|
<text class="titles-text">展示位置及拍摄技巧</text>
|
||||||
|
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/b153e8d5-37b1-4205-a4a1-9f6603f30c2a.png" mode="widthFix" style="width: 24rpx;margin-top: 2rpx;margin-left: 6rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="container-card" v-for="(item,index) in cardList[type]" :key="index">
|
<view class="container-card" v-for="(item,index) in cardList[type]" :key="index">
|
||||||
<view class="card-header flex-row-center-between">
|
<view class="card-header flex-row-center-between">
|
||||||
<text class="card-title">{{ item.title }}</text>
|
<text class="card-title">{{ item.title }}</text>
|
||||||
<view class="card-header-right" @click="goList(item.id)">
|
<view class="card-header-right" @click="goList(item.id)">
|
||||||
<text class="card-header-right-text">查看详情</text>
|
<text class="card-header-right-text">查看全部</text>
|
||||||
<image class="card-header-right-img" src="/static/images/icons/right_gray14.png"></image>
|
<image class="card-header-right-img" src="/static/images/icons/right_gray14.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -142,6 +143,7 @@
|
||||||
return obj
|
return obj
|
||||||
},
|
},
|
||||||
goList(id) {
|
goList(id) {
|
||||||
|
console.log(id,'ididididididi');
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/shop/photoAlbum/videoList?id=${id}&type=${this.type}`
|
url: `/pages/shop/photoAlbum/videoList?id=${id}&type=${this.type}`
|
||||||
});
|
});
|
||||||
|
|
@ -156,7 +158,7 @@
|
||||||
},
|
},
|
||||||
goAdd(id, item) {
|
goAdd(id, item) {
|
||||||
if (this.type == 1) {
|
if (this.type == 1) {
|
||||||
if ( this.imgVideoList[id] && this.imgVideoList[id].length >= 20) {
|
if ( this.imgVideoList[id] && this.imgVideoList[id].length >= 21) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '最多上传20张图片',
|
title: '最多上传20张图片',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
|
@ -255,6 +257,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.titles-right {
|
.titles-right {
|
||||||
|
display: flex;
|
||||||
.titles-text {
|
.titles-text {
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
|
||||||
|
|
@ -1,486 +1,496 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<custom-navbar title="店铺图片" :leftImg="'/static/images/back.png'" :showUser="true" backgroundColor="#fff"
|
<custom-navbar :title="pagestitle" :leftImg="'/static/images/back.png'" :showUser="true" backgroundColor="#fff"
|
||||||
titleColor="#000" borderBottom="none">
|
titleColor="#000" borderBottom="none">
|
||||||
<template #right>
|
<template #right>
|
||||||
<text class="custom-right" @click="toggleManage">{{ isManage ? '取消' : '管理' }}</text>
|
<text class="custom-right" @click="toggleManage">{{ isManage ? '取消' : '管理' }}</text>
|
||||||
</template>
|
</template>
|
||||||
</custom-navbar>
|
</custom-navbar>
|
||||||
<view class="review">
|
<view class="review">
|
||||||
<view class="review-title">
|
<view class="review-title">
|
||||||
<text class="review-title-text">添加环境图片,吸引更多顾客到店消费</text>
|
<text class="review-title-text">添加{{pagestitle}},吸引更多顾客到店消费</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="container-card">
|
<view class="container-card">
|
||||||
|
|
||||||
<view class="card-content flex-row-center" v-if="type==1">
|
<view class="card-content flex-row-center" v-if="type==1">
|
||||||
<view class="card-content-page">{{ imgVideoList.length }}/20张</view>
|
<view class="card-content-page" v-if="class_type!=1">{{ imgVideoList.length }}/20张</view>
|
||||||
<view class="content-default" @click="goAdd(class_type)"
|
<view class="content-default" @click="goAdd(class_type)"
|
||||||
v-if="!(class_type == 1 && imgVideoList && imgVideoList.length)">
|
v-if="!(class_type == 1 && imgVideoList && imgVideoList.length)">
|
||||||
<image class="content-default-img" src="/static/images/icons/addPhoto.png"></image>
|
<image class="content-default-img" src="/static/images/icons/addPhoto.png"></image>
|
||||||
<text class="content-default-text">添加照片</text>
|
<text class="content-default-text">添加照片</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content-photo" v-for="(item2,index2) in imgVideoList" :key="index2" v-if="imgVideoList"
|
<view class="content-photo" v-for="(item2,index2) in imgVideoList" :key="index2" v-if="imgVideoList"
|
||||||
@click="isManage ? toggleSelect(index2) : goAdd(class_type,item2)">
|
@click="isManage ? toggleSelect(index2) : goAdd(class_type,item2)">
|
||||||
<!-- 选择框 -->
|
<!-- 选择框 -->
|
||||||
<image class="content-photo-select" v-if="isManage"
|
<image class="content-photo-select" v-if="isManage"
|
||||||
:src="selectedItems.includes(index2) ? '/static/images/icons/yes_icon.png' : '/static/images/icons/no_icon2.png'">
|
:src="selectedItems.includes(index2) ? '/static/images/icons/yes_icon.png' : '/static/images/icons/no_icon2.png'">
|
||||||
</image>
|
</image>
|
||||||
<image class="content-photo-img" mode="aspectFill" :src="getItem(item2).url"></image>
|
<image class="content-photo-img" mode="aspectFill" :src="getItem(item2).url"></image>
|
||||||
<view class="content-photo-title">
|
<view class="content-photo-title">
|
||||||
{{ getItem(item2).name }}
|
{{ getItem(item2).name }}
|
||||||
</view>
|
</view>
|
||||||
<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>
|
||||||
<text class="photo-mask-text">审核中…</text>
|
<text class="photo-mask-text">审核中…</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>
|
||||||
<view class="card-content-page">{{ imgVideoList.length }}/10张</view>
|
<view class="card-content-page">{{ imgVideoList.length }}/10张</view>
|
||||||
<view class="content-default content-default2" @click="goAdd(class_type)"
|
<view class="content-default content-default2" @click="goAdd(class_type)"
|
||||||
v-if="!(class_type == 1 && imgVideoList && imgVideoList.length)">
|
v-if="!(class_type == 1 && imgVideoList && imgVideoList.length)">
|
||||||
<image class="content-default-img" src="/static/images/icons/addPhoto.png"></image>
|
<image class="content-default-img" src="/static/images/icons/addPhoto.png"></image>
|
||||||
<text class="content-default-text">添加视频</text>
|
<text class="content-default-text">添加视频</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content-photo content-video" v-for="(item2,index2) in imgVideoList" :key="index2"
|
<view class="content-photo content-video" v-for="(item2,index2) in imgVideoList" :key="index2"
|
||||||
v-if="imgVideoList" @click="isManage ? toggleSelect(index2) : goAdd(class_type,item2)">
|
v-if="imgVideoList" @click="isManage ? toggleSelect(index2) : goAdd(class_type,item2)">
|
||||||
<!-- 选择框 -->
|
<!-- 选择框 -->
|
||||||
<image class="content-photo-select" v-if="isManage"
|
<image class="content-photo-select" v-if="isManage"
|
||||||
:src="selectedItems.includes(index2) ? '/static/images/icons/yes_icon.png' : '/static/images/icons/no_icon2.png'">
|
:src="selectedItems.includes(index2) ? '/static/images/icons/yes_icon.png' : '/static/images/icons/no_icon2.png'">
|
||||||
</image>
|
</image>
|
||||||
<image class="content-photo-video" mode="aspectFill" :src="getItem(item2).url"></image>
|
<image class="content-photo-video" mode="aspectFill" :src="getItem(item2).url"></image>
|
||||||
<view class="content-photo-title">
|
<view class="content-photo-title">
|
||||||
{{ getItem(item2).name }}
|
{{ getItem(item2).name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="content-photo-play">
|
<view class="content-photo-play">
|
||||||
<image class="content-photo-play-img" mode="aspectFill" src="/static/images/icons/play.png">
|
<image class="content-photo-play-img" mode="aspectFill" src="/static/images/icons/play.png">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<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>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imgVideoList: [],
|
imgVideoList: [],
|
||||||
type: 2, //1图片 2视频
|
type: 2, //1图片 2视频
|
||||||
class_type: 4, //1主(图片/视频) 2环境(图片/视频) 3作品(图片/视频) 4其它(图片/视频)
|
class_type: 4, //1主(图片/视频) 2环境(图片/视频) 3作品(图片/视频) 4其它(图片/视频)
|
||||||
isManage: false, // 管理模式状态
|
isManage: false, // 管理模式状态
|
||||||
selectedItems: [] // 选中的项索引数组
|
selectedItems: [], // 选中的项索引数组
|
||||||
}
|
pagestitle: "店铺图片"
|
||||||
},
|
}
|
||||||
async onShow() {
|
},
|
||||||
await this.getList()
|
async onShow() {
|
||||||
},
|
await this.getList()
|
||||||
async onLoad(options) {
|
},
|
||||||
if (options.type) {
|
async onLoad(options) {
|
||||||
this.type = options.type
|
console.log(options, '查看option');
|
||||||
}
|
if (options.type) {
|
||||||
if (options.id) {
|
this.type = options.type
|
||||||
this.class_type = options.id
|
}
|
||||||
}
|
if (options.id) {
|
||||||
},
|
this.class_type = options.id
|
||||||
methods: {
|
if (this.class_type == 2) {
|
||||||
// 切换管理/取消模式
|
this.pagestitle = "环境图片"
|
||||||
toggleManage() {
|
} else if (this.class_type == 3) {
|
||||||
this.isManage = !this.isManage;
|
this.pagestitle = "作品图片"
|
||||||
if (!this.isManage) {
|
} else if (this.class_type == 4) {
|
||||||
this.selectedItems = []; // 退出管理模式时清空选中项
|
this.pagestitle = "其它图片"
|
||||||
}
|
} else {
|
||||||
},
|
this.pagestitle = "店铺图片"
|
||||||
// 切换选中状态
|
}
|
||||||
toggleSelect(index) {
|
}
|
||||||
console.log(1111, index)
|
},
|
||||||
if (this.selectedItems.includes(index)) {
|
methods: {
|
||||||
// 已选中,移除
|
// 切换管理/取消模式
|
||||||
this.selectedItems = this.selectedItems.filter(i => i !== index);
|
toggleManage() {
|
||||||
} else {
|
this.isManage = !this.isManage;
|
||||||
// 未选中,添加
|
if (!this.isManage) {
|
||||||
this.selectedItems.push(index);
|
this.selectedItems = []; // 退出管理模式时清空选中项
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 批量删除
|
// 切换选中状态
|
||||||
async handleDelete() {
|
toggleSelect(index) {
|
||||||
// 收集选中项的ID
|
console.log(1111, index)
|
||||||
let deleteIds = this.selectedItems.map(index => this.imgVideoList[index].id);
|
if (this.selectedItems.includes(index)) {
|
||||||
let auth_ids = this.selectedItems.map(index => this.imgVideoList[index].auth_id).filter(item =>
|
// 已选中,移除
|
||||||
item !== 0);
|
this.selectedItems = this.selectedItems.filter(i => i !== index);
|
||||||
console.log(1111, deleteIds, auth_ids, [1, 6])
|
} else {
|
||||||
try {
|
// 未选中,添加
|
||||||
const res = await request.post("/sj/imgVideo/del", {
|
this.selectedItems.push(index);
|
||||||
ids: deleteIds,
|
}
|
||||||
auth_ids: auth_ids
|
},
|
||||||
});
|
// 批量删除
|
||||||
if (res.code == 200) {
|
async handleDelete() {
|
||||||
// 重新获取列表
|
// 收集选中项的ID
|
||||||
await this.getList();
|
let deleteIds = this.selectedItems.map(index => this.imgVideoList[index].id);
|
||||||
// 退出管理模式
|
let auth_ids = this.selectedItems.map(index => this.imgVideoList[index].auth_id).filter(item =>
|
||||||
this.isManage = false;
|
item !== 0);
|
||||||
this.selectedItems = [];
|
console.log(1111, deleteIds, auth_ids, [1, 6])
|
||||||
} else {
|
try {
|
||||||
uni.showToast({
|
const res = await request.post("/sj/imgVideo/del", {
|
||||||
title: '删除失败',
|
ids: deleteIds,
|
||||||
icon: 'none'
|
auth_ids: auth_ids
|
||||||
});
|
});
|
||||||
}
|
if (res.code == 200) {
|
||||||
} catch (err) {
|
// 重新获取列表
|
||||||
uni.showToast({
|
await this.getList();
|
||||||
title: '删除失败',
|
// 退出管理模式
|
||||||
icon: 'none'
|
this.isManage = false;
|
||||||
});
|
this.selectedItems = [];
|
||||||
}
|
} else {
|
||||||
},
|
uni.showToast({
|
||||||
goAdd(id, item) {
|
title: '删除失败',
|
||||||
if (this.isManage) return; // 管理模式下禁止跳转
|
icon: 'none'
|
||||||
if (this.type == 1) {
|
});
|
||||||
if (this.imgVideoList.length >= 20) {
|
}
|
||||||
uni.showToast({
|
} catch (err) {
|
||||||
title: '最多上传20张图片',
|
uni.showToast({
|
||||||
icon: 'none',
|
title: '删除失败',
|
||||||
duration: 2000
|
icon: 'none'
|
||||||
});
|
});
|
||||||
return
|
}
|
||||||
}
|
},
|
||||||
} else if (this.type == 2) {
|
goAdd(id, item) {
|
||||||
if (this.imgVideoList.length >= 10) {
|
if (this.isManage) return; // 管理模式下禁止跳转
|
||||||
uni.showToast({
|
if (this.type == 1) {
|
||||||
title: '最多上传10张视频',
|
if (this.imgVideoList.length >= 20) {
|
||||||
icon: 'none',
|
uni.showToast({
|
||||||
duration: 2000
|
title: '最多上传20张图片',
|
||||||
});
|
icon: 'none',
|
||||||
return
|
duration: 2000
|
||||||
}
|
});
|
||||||
}
|
return
|
||||||
if (!id) {
|
}
|
||||||
uni.showToast({
|
} else if (this.type == 2) {
|
||||||
title: '参数异常,无法上传',
|
if (this.imgVideoList.length >= 10) {
|
||||||
icon: 'none',
|
uni.showToast({
|
||||||
duration: 2000
|
title: '最多上传10张视频',
|
||||||
});
|
icon: 'none',
|
||||||
return;
|
duration: 2000
|
||||||
}
|
});
|
||||||
let url = `/pages/shop/photoAlbum/addPhoto?id=${id}&type=${this.type}`;
|
return
|
||||||
if (item) {
|
}
|
||||||
url += `&item=${encodeURIComponent(JSON.stringify(item))}`;
|
}
|
||||||
}
|
if (!id) {
|
||||||
uni.navigateTo({
|
uni.showToast({
|
||||||
url: url
|
title: '参数异常,无法上传',
|
||||||
});
|
icon: 'none',
|
||||||
},
|
duration: 2000
|
||||||
getItem(item) {
|
});
|
||||||
let obj = {
|
return;
|
||||||
name: "",
|
}
|
||||||
url: ""
|
let url = `/pages/shop/photoAlbum/addPhoto?id=${id}&type=${this.type}`;
|
||||||
}
|
if (item) {
|
||||||
if (item.apply_state == 1) {
|
url += `&item=${encodeURIComponent(JSON.stringify(item))}`;
|
||||||
obj.url = item.auth_url
|
}
|
||||||
obj.name = item.auth_name
|
uni.navigateTo({
|
||||||
} else {
|
url: url
|
||||||
obj.url = item.url || item.auth_url
|
});
|
||||||
obj.name = item.name || item.auth_name
|
},
|
||||||
}
|
getItem(item) {
|
||||||
if (item.type == 2) {
|
let obj = {
|
||||||
obj.url = obj.url + `?x-oss-process=video/snapshot,t_1000,m_fast,f_jpg,w_600,ar_auto`
|
name: "",
|
||||||
}
|
url: ""
|
||||||
return obj
|
}
|
||||||
},
|
if (item.apply_state == 1) {
|
||||||
async getList() {
|
obj.url = item.auth_url
|
||||||
try {
|
obj.name = item.auth_name
|
||||||
const res = await request.post("/sj/imgVideo/list", {
|
} else {
|
||||||
type: this.type,
|
obj.url = item.url || item.auth_url
|
||||||
class_type: this.class_type
|
obj.name = item.name || item.auth_name
|
||||||
});
|
}
|
||||||
// 核心修复:逐层可选链保护 + 兜底空数组,彻底避免属性访问错误
|
if (item.type == 2) {
|
||||||
this.imgVideoList = res.code === 200 ?
|
obj.url = obj.url + `?x-oss-process=video/snapshot,t_1000,m_fast,f_jpg,w_600,ar_auto`
|
||||||
res.data?.list?.[this.type]?.[this.class_type] || [] :
|
}
|
||||||
[];
|
return obj
|
||||||
} catch (err) {
|
},
|
||||||
// 网络错误、接口报错等所有异常的兜底处理
|
async getList() {
|
||||||
console.error("获取媒体列表失败:", err);
|
try {
|
||||||
this.imgVideoList = [];
|
const res = await request.post("/sj/imgVideo/list", {
|
||||||
}
|
type: this.type,
|
||||||
}
|
class_type: this.class_type
|
||||||
}
|
});
|
||||||
}
|
// 核心修复:逐层可选链保护 + 兜底空数组,彻底避免属性访问错误
|
||||||
</script>
|
this.imgVideoList = res.code === 200 ?
|
||||||
|
res.data?.list?.[this.type]?.[this.class_type] || [] : [];
|
||||||
<style lang="less">
|
} catch (err) {
|
||||||
.container {
|
// 网络错误、接口报错等所有异常的兜底处理
|
||||||
.custom-right {
|
console.error("获取媒体列表失败:", err);
|
||||||
font-weight: 500;
|
this.imgVideoList = [];
|
||||||
font-size: 26rpx;
|
}
|
||||||
color: #333333;
|
}
|
||||||
line-height: 37rpx;
|
}
|
||||||
text-align: left;
|
}
|
||||||
font-style: normal;
|
</script>
|
||||||
white-space: nowrap;
|
|
||||||
}
|
<style lang="less">
|
||||||
|
.container {
|
||||||
.review {
|
.custom-right {
|
||||||
background: rgba(255, 250, 218, 1);
|
font-weight: 500;
|
||||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
font-size: 26rpx;
|
||||||
margin: 20rpx;
|
color: #333333;
|
||||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
line-height: 37rpx;
|
||||||
|
text-align: left;
|
||||||
.review-title {
|
font-style: normal;
|
||||||
margin-bottom: 6rpx;
|
white-space: nowrap;
|
||||||
|
}
|
||||||
.review-title-text {
|
|
||||||
font-weight: 400;
|
.review {
|
||||||
font-size: 24rpx;
|
background: rgba(255, 250, 218, 1);
|
||||||
color: #835225;
|
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||||
line-height: 33rpx;
|
margin: 20rpx;
|
||||||
text-align: left;
|
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||||
font-style: normal;
|
|
||||||
}
|
.review-title {
|
||||||
}
|
margin-bottom: 6rpx;
|
||||||
|
|
||||||
}
|
.review-title-text {
|
||||||
|
font-weight: 400;
|
||||||
.container-card {
|
font-size: 24rpx;
|
||||||
border-radius: 20rpx;
|
color: #835225;
|
||||||
margin: 20rpx;
|
line-height: 33rpx;
|
||||||
padding: 20rpx 20rpx 30rpx 20rpx;
|
text-align: left;
|
||||||
background: #fff;
|
font-style: normal;
|
||||||
transform: translateY(-30rpx);
|
}
|
||||||
|
}
|
||||||
.card-header {
|
|
||||||
margin-bottom: 20rpx;
|
}
|
||||||
|
|
||||||
.card-title {
|
.container-card {
|
||||||
font-weight: 500;
|
border-radius: 20rpx;
|
||||||
font-size: 28rpx;
|
margin: 20rpx;
|
||||||
color: #1D2129;
|
padding: 20rpx 20rpx 30rpx 20rpx;
|
||||||
line-height: 48rpx;
|
background: #fff;
|
||||||
text-align: left;
|
transform: translateY(-30rpx);
|
||||||
font-style: normal;
|
|
||||||
}
|
.card-header {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
.card-header-right {
|
|
||||||
.card-header-right-text {
|
.card-title {
|
||||||
font-weight: 400;
|
font-weight: 500;
|
||||||
font-size: 22rpx;
|
font-size: 28rpx;
|
||||||
color: #999999;
|
color: #1D2129;
|
||||||
line-height: 30rpx;
|
line-height: 48rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header-right-img {
|
.card-header-right {
|
||||||
width: 8rpx;
|
.card-header-right-text {
|
||||||
height: 16rpx;
|
font-weight: 400;
|
||||||
margin-left: 7rpx;
|
font-size: 22rpx;
|
||||||
}
|
color: #999999;
|
||||||
}
|
line-height: 30rpx;
|
||||||
}
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
.card-content {
|
}
|
||||||
gap: 14rpx;
|
|
||||||
flex-wrap: wrap;
|
.card-header-right-img {
|
||||||
|
width: 8rpx;
|
||||||
.card-content-page {
|
height: 16rpx;
|
||||||
font-weight: 400;
|
margin-left: 7rpx;
|
||||||
font-size: 24rpx;
|
}
|
||||||
color: #999999;
|
}
|
||||||
line-height: 33rpx;
|
}
|
||||||
text-align: left;
|
|
||||||
font-style: normal;
|
.card-content {
|
||||||
width: 100%;
|
gap: 14rpx;
|
||||||
}
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.content-default {
|
.card-content-page {
|
||||||
width: 214rpx;
|
font-weight: 400;
|
||||||
height: 214rpx;
|
font-size: 24rpx;
|
||||||
background: #F5F5F5;
|
color: #999999;
|
||||||
border-radius: 20rpx;
|
line-height: 33rpx;
|
||||||
display: flex;
|
text-align: left;
|
||||||
flex-direction: column;
|
font-style: normal;
|
||||||
align-items: center;
|
width: 100%;
|
||||||
justify-content: center;
|
}
|
||||||
|
|
||||||
|
.content-default {
|
||||||
.content-default-img {
|
width: 214rpx;
|
||||||
width: 42rpx;
|
height: 214rpx;
|
||||||
height: 35rpx;
|
background: #F5F5F5;
|
||||||
margin-bottom: 8rpx;
|
border-radius: 20rpx;
|
||||||
}
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
.content-default-text {
|
align-items: center;
|
||||||
font-weight: 400;
|
justify-content: center;
|
||||||
font-size: 22rpx;
|
|
||||||
color: #666666;
|
|
||||||
line-height: 30rpx;
|
.content-default-img {
|
||||||
text-align: left;
|
width: 42rpx;
|
||||||
font-style: normal;
|
height: 35rpx;
|
||||||
display: block;
|
margin-bottom: 8rpx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
.content-default-text {
|
||||||
.content-default2 {
|
font-weight: 400;
|
||||||
width: 328rpx;
|
font-size: 22rpx;
|
||||||
height: 186rpx;
|
color: #666666;
|
||||||
background: #F5F5F5;
|
line-height: 30rpx;
|
||||||
border-radius: 17rpx;
|
text-align: left;
|
||||||
}
|
font-style: normal;
|
||||||
|
display: block;
|
||||||
.content-photo {
|
}
|
||||||
box-sizing: border-box;
|
}
|
||||||
width: 214rpx;
|
|
||||||
height: 214rpx;
|
.content-default2 {
|
||||||
border-radius: 20rpx;
|
width: 328rpx;
|
||||||
position: relative;
|
height: 186rpx;
|
||||||
overflow: hidden;
|
background: #F5F5F5;
|
||||||
|
border-radius: 17rpx;
|
||||||
// 选择框样式
|
}
|
||||||
.content-photo-select {
|
|
||||||
position: absolute;
|
.content-photo {
|
||||||
top: 12rpx;
|
box-sizing: border-box;
|
||||||
right: 14rpx;
|
width: 214rpx;
|
||||||
width: 36rpx;
|
height: 214rpx;
|
||||||
height: 36rpx;
|
border-radius: 20rpx;
|
||||||
z-index: 999;
|
position: relative;
|
||||||
}
|
overflow: hidden;
|
||||||
|
|
||||||
.content-photo-img {
|
// 选择框样式
|
||||||
width: 214rpx;
|
.content-photo-select {
|
||||||
height: 214rpx;
|
position: absolute;
|
||||||
border-radius: 20rpx;
|
top: 12rpx;
|
||||||
}
|
right: 14rpx;
|
||||||
|
width: 36rpx;
|
||||||
.content-photo-video {
|
height: 36rpx;
|
||||||
width: 328rpx;
|
z-index: 999;
|
||||||
height: 186rpx;
|
}
|
||||||
border-radius: 20rpx;
|
|
||||||
}
|
.content-photo-img {
|
||||||
|
width: 214rpx;
|
||||||
.content-photo-title {
|
height: 214rpx;
|
||||||
background: rgba(51, 51, 51, 0.6);
|
border-radius: 20rpx;
|
||||||
padding: 6rpx 0 4rpx 0;
|
}
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
.content-photo-video {
|
||||||
right: 0;
|
width: 328rpx;
|
||||||
bottom: 0;
|
height: 186rpx;
|
||||||
font-weight: 400;
|
border-radius: 20rpx;
|
||||||
font-size: 15rpx;
|
}
|
||||||
color: #CACACA;
|
|
||||||
line-height: 21rpx;
|
.content-photo-title {
|
||||||
text-align: center;
|
background: rgba(51, 51, 51, 0.6);
|
||||||
font-style: normal;
|
padding: 6rpx 0 4rpx 0;
|
||||||
}
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
.content-photo-play {
|
right: 0;
|
||||||
width: 25rpx;
|
bottom: 0;
|
||||||
height: 25rpx;
|
font-weight: 400;
|
||||||
position: absolute;
|
font-size: 15rpx;
|
||||||
right: 10rpx;
|
color: #CACACA;
|
||||||
top: 6rpx;
|
line-height: 21rpx;
|
||||||
|
text-align: center;
|
||||||
.content-photo-play-img {
|
font-style: normal;
|
||||||
width: 25rpx;
|
}
|
||||||
height: 25rpx;
|
|
||||||
}
|
.content-photo-play {
|
||||||
}
|
width: 25rpx;
|
||||||
|
height: 25rpx;
|
||||||
.content-photo-mask {
|
position: absolute;
|
||||||
position: absolute;
|
right: 10rpx;
|
||||||
left: 0;
|
top: 6rpx;
|
||||||
right: 0;
|
|
||||||
top: 0;
|
.content-photo-play-img {
|
||||||
bottom: 0;
|
width: 25rpx;
|
||||||
background: rgba(0, 0, 0, 0.3);
|
height: 25rpx;
|
||||||
display: flex;
|
}
|
||||||
align-items: center;
|
}
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
.content-photo-mask {
|
||||||
border-radius: 20rpx;
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
.photo-mask-img {
|
right: 0;
|
||||||
width: 36rpx;
|
top: 0;
|
||||||
height: 36rpx;
|
bottom: 0;
|
||||||
margin-bottom: 8rpx;
|
background: rgba(0, 0, 0, 0.3);
|
||||||
}
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
.photo-mask-text {
|
justify-content: center;
|
||||||
font-weight: 400;
|
flex-direction: column;
|
||||||
font-size: 24rpx;
|
border-radius: 20rpx;
|
||||||
color: #FFFFFF;
|
|
||||||
line-height: 33rpx;
|
.photo-mask-img {
|
||||||
text-align: left;
|
width: 36rpx;
|
||||||
font-style: normal;
|
height: 36rpx;
|
||||||
}
|
margin-bottom: 8rpx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
.photo-mask-text {
|
||||||
.content-video {
|
font-weight: 400;
|
||||||
width: 328rpx;
|
font-size: 24rpx;
|
||||||
height: 186rpx;
|
color: #FFFFFF;
|
||||||
}
|
line-height: 33rpx;
|
||||||
}
|
text-align: left;
|
||||||
}
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.container-buttons {
|
|
||||||
position: fixed;
|
.content-video {
|
||||||
left: 0;
|
width: 328rpx;
|
||||||
right: 0;
|
height: 186rpx;
|
||||||
bottom: 0;
|
}
|
||||||
padding: 30rpx 0;
|
}
|
||||||
background: #FFFFFF;
|
}
|
||||||
gap: 60rpx;
|
}
|
||||||
|
|
||||||
.container-buttons-cancel {
|
|
||||||
width: 278rpx;
|
.container-buttons {
|
||||||
height: 98rpx;
|
position: fixed;
|
||||||
border-radius: 49rpx;
|
left: 0;
|
||||||
border: 1rpx solid #E8101E;
|
right: 0;
|
||||||
font-weight: 400;
|
bottom: 0;
|
||||||
font-size: 32rpx;
|
padding: 30rpx 0;
|
||||||
color: #E8101E;
|
background: #FFFFFF;
|
||||||
text-align: center;
|
gap: 60rpx;
|
||||||
font-style: normal;
|
|
||||||
}
|
.container-buttons-cancel {
|
||||||
|
width: 278rpx;
|
||||||
.container-buttons-sure {
|
height: 98rpx;
|
||||||
width: 278rpx;
|
border-radius: 49rpx;
|
||||||
height: 98rpx;
|
border: 1rpx solid #E8101E;
|
||||||
background: #E8101E;
|
font-weight: 400;
|
||||||
border-radius: 49rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 400;
|
color: #E8101E;
|
||||||
font-size: 32rpx;
|
text-align: center;
|
||||||
color: #FFFFFF;
|
font-style: normal;
|
||||||
text-align: center;
|
}
|
||||||
font-style: normal;
|
|
||||||
}
|
.container-buttons-sure {
|
||||||
|
width: 278rpx;
|
||||||
.container-buttons-sure2 {
|
height: 98rpx;
|
||||||
width: 710rpx;
|
background: #E8101E;
|
||||||
height: 98rpx;
|
border-radius: 49rpx;
|
||||||
background: #E8101E;
|
font-weight: 400;
|
||||||
border-radius: 49rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 400;
|
color: #FFFFFF;
|
||||||
font-size: 38rpx;
|
text-align: center;
|
||||||
color: #FFFFFF;
|
font-style: normal;
|
||||||
text-align: left;
|
}
|
||||||
font-style: normal;
|
|
||||||
}
|
.container-buttons-sure2 {
|
||||||
}
|
width: 710rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: #E8101E;
|
||||||
|
border-radius: 49rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 38rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -173,7 +173,7 @@ const uploadFile = async (file, userId, type, uploadType) => {
|
||||||
let imageType;
|
let imageType;
|
||||||
if (uploadType == 'image') {
|
if (uploadType == 'image') {
|
||||||
//imageType = file.path.split('.')
|
//imageType = file.path.split('.')
|
||||||
imageType = file.name.split('.')
|
imageType = file.path.split('.')
|
||||||
} else if (uploadType == 'video') {
|
} else if (uploadType == 'video') {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
imageType = file.name.split('.')
|
imageType = file.name.split('.')
|
||||||
|
|
@ -252,7 +252,9 @@ const uploadToOss = (file, ossConfig, name, uploadType) => {
|
||||||
if (uploadType == 'image') {
|
if (uploadType == 'image') {
|
||||||
path = file.path
|
path = file.path
|
||||||
// 获取文件扩展名并设置 Content-Type
|
// 获取文件扩展名并设置 Content-Type
|
||||||
|
console.log('111111');
|
||||||
const ext = file.path.split('.').pop().toLowerCase()
|
const ext = file.path.split('.').pop().toLowerCase()
|
||||||
|
console.log('33333333');
|
||||||
const mimeTypes = {
|
const mimeTypes = {
|
||||||
jpg: 'image/jpeg',
|
jpg: 'image/jpeg',
|
||||||
jpeg: 'image/jpeg',
|
jpeg: 'image/jpeg',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue