操作说明,产品说明,接口联调对接
This commit is contained in:
@ -1,203 +0,0 @@
|
||||
<template>
|
||||
<view class="device-page">
|
||||
<!-- 表单内容 -->
|
||||
<view class="form-content">
|
||||
<!-- 名称输入框 -->
|
||||
<view class="input-group">
|
||||
<text class="label">名称</text>
|
||||
<input class="input" type="text" placeholder="请输入名称" v-model="name" />
|
||||
</view>
|
||||
|
||||
<!-- 视频链接输入框 -->
|
||||
<view class="input-group">
|
||||
<text class="label">视频链接</text>
|
||||
<input class="input" type="text" placeholder="请输入视频链接" v-model="videoLink" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保存按钮 -->
|
||||
<button class="save-button" @click="saveData">保 存</button>
|
||||
|
||||
<!--===================== 保存成功提示框================== -->
|
||||
<view class="agreement-mask" v-if="showModal">
|
||||
<!-- 上传画面弹窗 -->
|
||||
<view class="agreement-popupC">
|
||||
<view class="popup-content">
|
||||
<image src="/static/images/path2.png" mode="" class="path2"></image>
|
||||
<view class="popup-Title">
|
||||
<view>保存成功!</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 按钮组 -->
|
||||
<view class="popup-buttons">
|
||||
<button class="btn agreeBtn" @click="handleBtn">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
videoLink: '',
|
||||
showModal: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 保存
|
||||
saveData() {
|
||||
// 这里可以添加保存数据的逻辑,例如发送到服务器等
|
||||
console.log('保存数据:', this.name, this.videoLink);
|
||||
if (this.name == "") {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '名称不能为空'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.videoLink == '') {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '视频链接不为空'
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.showModal = true
|
||||
uni.navigateBack()
|
||||
},
|
||||
// 确定提示框
|
||||
handleBtn() {
|
||||
this.showModal = false
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.device-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
background-color: rgb(18, 18, 18);
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.form-content {
|
||||
flex: 1;
|
||||
/* padding: 20px; */
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.label {
|
||||
width: 70px;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
height: 96rpx;
|
||||
padding: 0 10px;
|
||||
background-color: rgb(26, 26, 26);
|
||||
color: #fff;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
/* 当输入框获得焦点时,更改边框颜色 */
|
||||
.input:focus {
|
||||
border-color: #7AC23C;
|
||||
/* 获得焦点时的边框颜色 */
|
||||
outline: none;
|
||||
/* 移除默认的outline样式 */
|
||||
}
|
||||
|
||||
.save-button {
|
||||
background-color: rgb(187, 230, 0);
|
||||
color: #232323;
|
||||
border: none;
|
||||
font-size: 24rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
left: 0rpx
|
||||
}
|
||||
|
||||
/* 遮罩层 */
|
||||
.agreement-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/* 弹窗主体 */
|
||||
.agreement-popup {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
background-color: rgb(42, 42, 42);
|
||||
border-radius: 60rpx 60rpx 0rpx 0rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
}
|
||||
|
||||
.popup-Title {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
padding: 20rpx 0rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.agreement-popupC {
|
||||
width: 60%;
|
||||
background-color: rgb(42, 42, 42);
|
||||
border-radius: 40rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid rgba(187, 230, 0, 0.3);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.path2 {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/* 通用按钮样式 */
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 32rpx;
|
||||
margin: 10rpx auto;
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
/* 同意按钮 */
|
||||
.agreeBtn {
|
||||
background-color: rgb(187, 230, 0);
|
||||
color: #232323;
|
||||
border: none;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<!-- 使用自定义导航栏 -->
|
||||
<custom-navbar :title="navTitle" :showBack="true" color="#FFFFFF" rightIcon="/static/images/path.png"
|
||||
@right-click="uploadStartup"></custom-navbar>
|
||||
@right-click="uploadStartup"></custom-navbar>
|
||||
<view class="device-detail-container" :style="{ paddingTop: navBarHeight + 'px' }">
|
||||
<!-- 设备电量信息 -->
|
||||
<view class="battery-section">
|
||||
@ -231,7 +231,8 @@
|
||||
lightModeB: false,
|
||||
lightModeC: false, //激光提示框
|
||||
items: [],
|
||||
isFormExpanded: true // 默认展开
|
||||
isFormExpanded: true, // 默认展开
|
||||
deviceID: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -314,17 +315,19 @@
|
||||
// 操纵说明
|
||||
operatingInst() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/6170/operatingInstruct/index'
|
||||
url: `/pages/common/operatingInstruct/index?id=${this.deviceID}`
|
||||
})
|
||||
},
|
||||
// 产品参数
|
||||
productparams() {
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/productDes/index?id=${this.deviceID}`
|
||||
})
|
||||
},
|
||||
// 操作视频
|
||||
operatingVideo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/6170/operationVideo/index'
|
||||
url: `/pages/common/operationVideo/index?id=${this.deviceID}`
|
||||
})
|
||||
|
||||
},
|
||||
@ -338,6 +341,10 @@
|
||||
handleDisagree() {
|
||||
this.lightModeC = false
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options.id) // 输出: 123
|
||||
this.deviceID = options.id
|
||||
}
|
||||
|
||||
}
|
||||
@ -549,7 +556,8 @@
|
||||
transform: translate(-17%, -100%);
|
||||
|
||||
}
|
||||
.uni-file-picker__container{
|
||||
|
||||
.uni-file-picker__container {
|
||||
width: 200rpx !important;
|
||||
border: 1px solid rgb(58, 58, 58);
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<text>编辑视频</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,350 +0,0 @@
|
||||
<template>
|
||||
<!-- 使用自定义导航栏 -->
|
||||
<view>
|
||||
<custom-navbar :title="navTitle" :showBack="true" backgroundColor="#202020" color="#FFFFFF" right-text="编辑"
|
||||
right-color="rgba(255, 255, 255, 0.87)" @right-click="handleEdit"></custom-navbar>
|
||||
<view class="device-page" :style="{ paddingTop: navBarHeight + 'px' }">
|
||||
<view class="pathContent">
|
||||
<image src="/static/images/path3.png" mode="" class="path3"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!--上传文件弹框 -->
|
||||
<view class="agreement-mask" v-if="opeartShow">
|
||||
<!-- 上传画面弹窗 -->
|
||||
<view class="agreement-popup">
|
||||
<!-- 标题 -->
|
||||
<view class="popup-title">编辑</view>
|
||||
<view class="popup-content">
|
||||
<view v-for="(item, index) in items" :key="index">
|
||||
<view class="item" :class="{'selected': index === selectedItemIndex}"
|
||||
@click="handleItemAction(index)"> <!-- 修改点击事件 -->
|
||||
<image :src="item.image" class="setIMG"></image>
|
||||
{{item.text}}
|
||||
<!-- 隐藏的文件输入(仅用于上传模式) -->
|
||||
<!-- <input v-if="index === 0" type="file" ref="fileInput" style="display: none"
|
||||
@change="onFileSelect"> -->
|
||||
<uni-file-picker v-if="index === 0" limit="1" file-mediatype="all"></uni-file-picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 按钮组 -->
|
||||
<view class="popup-buttons">
|
||||
<button class="agree" @click="handleupload">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="agreement-mask" v-if="opeartSuccess">
|
||||
<view class="agreement-popupC">
|
||||
<view class="popup-content">
|
||||
<image src="/static/images/path5.png" mode="" class="path2"></image>
|
||||
<view class="popup-Title">
|
||||
<view>上传成功!</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 按钮组 -->
|
||||
<view class="popup-buttons">
|
||||
<button class="btn agreeBtn" @click="handleBtn">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- =============删除文件,列表文件=============== -->
|
||||
<view class="agreement-mask" v-if="opeartDelect">
|
||||
<!-- 上传画面弹窗 -->
|
||||
<view class="agreement-popup">
|
||||
<view class="popup-title">删除文件</view>
|
||||
<view class="popup-content">
|
||||
<!-- 设备列表 -->
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<view class="device-card" v-for="(item, index) in delectList" :key="index"
|
||||
@click="toggleSelect(index)">
|
||||
<!-- 复选框 -->
|
||||
<view class="checkbox" :class="{ checked: item.checked }">
|
||||
<uni-icons v-if="item.checked" type="checkmarkempty" size="18"
|
||||
color="rgb(0, 0, 0)"></uni-icons>
|
||||
</view>
|
||||
<!-- 设备信息 -->
|
||||
<view class="device-content">
|
||||
<view class="device-header">
|
||||
<view class="device-name">
|
||||
<view>设备:001-00</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 按钮组 -->
|
||||
<view class="popup-buttons">
|
||||
<button class="agree" @click="handleopearBtn">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
navTitle: '操作说明',
|
||||
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
||||
opeartShow: false,
|
||||
items: [{
|
||||
text: '点击选择上传文件',
|
||||
selected: true,
|
||||
image: '/static/images/upload.png'
|
||||
},
|
||||
{
|
||||
text: '删除文件',
|
||||
selected: false,
|
||||
image: '/static/images/delete.png'
|
||||
}
|
||||
],
|
||||
selectedItemIndex: 0, // 默认选中第一个
|
||||
fileInput: false,
|
||||
opeartSuccess: false,
|
||||
opeartDelect: false,
|
||||
delectList: Array(6).fill().map((_, i) => ({
|
||||
id: `1321615${i}`,
|
||||
checked: false,
|
||||
showConfirm: false
|
||||
})),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 编辑
|
||||
handleEdit() {
|
||||
this.opeartShow = true
|
||||
},
|
||||
handleItemAction(index) {
|
||||
this.selectedItemIndex = index;
|
||||
if (index === 0) {
|
||||
// 调用 Uni-app 文件选择 API
|
||||
// uni.chooseFile({
|
||||
// count: 1, // 最多选择1个文件
|
||||
// success: (res) => {
|
||||
// const file = res.tempFiles[0];
|
||||
// this.items[0].text = `已选择: ${file.name}`;
|
||||
// this.selectedFile = file; // 存储文件对象
|
||||
// }
|
||||
// });
|
||||
} else {
|
||||
// 这里是走删除弹框列表
|
||||
this.opeartDelect = true //显示批量删除弹框列表
|
||||
this.opeartShow = false //隐藏编辑弹框
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onFileSelect(e) {
|
||||
const files = e.target.files;
|
||||
if (files.length > 0) {
|
||||
// 这里拿到文件对象,可以立即上传或显示文件名
|
||||
console.log("选择的文件:", files[0].name);
|
||||
// 示例:显示文件名在item.text中
|
||||
this.items[0].text = `已选择: ${files[0].name}`;
|
||||
}
|
||||
},
|
||||
// 确认
|
||||
handleupload() {
|
||||
this.opeartSuccess = true
|
||||
//this.opeartShow = false;
|
||||
},
|
||||
// 上传成功后确实弹框提示确认
|
||||
handleBtn() {
|
||||
this.opeartSuccess = false
|
||||
},
|
||||
toggleSelect(index) {
|
||||
this.delectList[index].checked = !this.delectList[index].checked
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 批量删除文件确认按钮
|
||||
handleopearBtn() {
|
||||
this.opeartDelect = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.device-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
background-color: rgb(18, 18, 18);
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.pathContent {
|
||||
background-color: rgb(52, 52, 52);
|
||||
width: 100%;
|
||||
min-height: 87vh;
|
||||
}
|
||||
|
||||
.files-button uni-button {
|
||||
background: red !important;
|
||||
position: absolute;
|
||||
left: 50rpx;
|
||||
top: 50rpx
|
||||
}
|
||||
|
||||
.path2 {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.popup-Title {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
padding: 20rpx 0rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.path3 {
|
||||
width: 172rpx;
|
||||
height: 114rpx;
|
||||
transform: translate(-50%, -50%);
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%
|
||||
}
|
||||
|
||||
/* 遮罩层 */
|
||||
.agreement-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/* 弹窗主体 */
|
||||
.agreement-popup {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
background-color: rgb(42, 42, 42);
|
||||
border-radius: 60rpx 60rpx 0rpx 0rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
}
|
||||
|
||||
.agreement-popupC {
|
||||
width: 70%;
|
||||
background-color: rgb(42, 42, 42);
|
||||
border-radius: 40rpx;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid rgba(187, 230, 0, 0.3);
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.agree {
|
||||
background-color: rgb(187, 230, 0);
|
||||
color: #232323;
|
||||
border: none;
|
||||
font-size: 24rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
left: 0rpx
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 10px;
|
||||
margin: 5px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.setIMG {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.item.selected {
|
||||
background-color: rgb(58, 58, 58);
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 通用按钮样式 */
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
border-radius: 40rpx;
|
||||
font-size: 32rpx;
|
||||
margin: 10rpx auto;
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
/* 同意按钮 */
|
||||
.agreeBtn {
|
||||
background-color: rgb(187, 230, 0);
|
||||
color: #232323;
|
||||
border: none;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
/* 删除文件,弹框列表样式文件
|
||||
*/
|
||||
.device-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.device-content {
|
||||
border-radius: 8rpx;
|
||||
background: rgba(58, 58, 58, 1);
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
width: 93%;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border: 2rpx solid rgba(255, 255, 255, 0.5);
|
||||
margin-right: 20rpx;
|
||||
border-radius: 4rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: -25rpx;
|
||||
}
|
||||
|
||||
.checkbox.checked {
|
||||
background-color: rgb(187, 230, 0);
|
||||
border-color: rgb(187, 230, 0);
|
||||
}
|
||||
</style>
|
@ -1,233 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 使用自定义导航栏 -->
|
||||
<custom-navbar :title="navTitle" :showBack="true" backgroundColor="#202020" color="#FFFFFF" right-text="编辑"
|
||||
right-color="rgba(255, 255, 255, 0.87)" @right-click="handleEdit"></custom-navbar>
|
||||
<view class="device-page" :style="{ paddingTop: navBarHeight + 'px' }">
|
||||
<scroll-view scroll-y>
|
||||
<uni-swipe-action >
|
||||
<block v-for="(item, index) in videoList" :key="index">
|
||||
<uni-swipe-action-item :right-options="item.showConfirm ? confirmOptions : deleteOptions"
|
||||
@click="handleSwipeClick($event, index)" class="content">
|
||||
<view class="image-box" @click="openVideoUrl(item.url)">
|
||||
<view class="deviceIMG">
|
||||
<image src="/static/images/video.png" mode="" class="video"></image>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="file-title">{{item.title}}</view>
|
||||
<view class="file-baidu">{{item.url}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<image src="/static/images/cires.png" class="circle"></image>
|
||||
</uni-swipe-action-item>
|
||||
</block>
|
||||
</uni-swipe-action>
|
||||
</scroll-view>
|
||||
<view class="content1" @click="addvideo">
|
||||
<image src="/static/images/path1.png" class="path1"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
navTitle: '操作视频',
|
||||
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
||||
videoList: [{
|
||||
id: 1,
|
||||
title: '使用教程1',
|
||||
url: 'https://www.bilibili.com/variety/?spm_id_from=333.1007.0.0',
|
||||
showConfirm: false
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '使用教程2',
|
||||
url: 'www.baidu.com',
|
||||
showConfirm: false
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '使用教程3',
|
||||
url: 'www.baidu.com',
|
||||
showConfirm: false
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '使用教程4',
|
||||
url: 'www.baidu.com',
|
||||
showConfirm: false
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: '使用教程5',
|
||||
url: 'www.baidu.com',
|
||||
showConfirm: false
|
||||
}
|
||||
],
|
||||
deleteOptions: [{
|
||||
text: '编辑',
|
||||
style: {
|
||||
backgroundColor: 'rgb(224, 147, 25)',
|
||||
borderRadius: '16px 0 0 16px',
|
||||
width: '160rpx',
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: 'rgb(240, 60, 60)',
|
||||
borderRadius: '0 16px 16px 0',
|
||||
width: '160rpx',
|
||||
},
|
||||
}
|
||||
],
|
||||
confirmOptions: [{
|
||||
text: '确认删除',
|
||||
style: {
|
||||
backgroundColor: 'rgb(240, 60, 60)',
|
||||
borderRadius: '16px',
|
||||
width: '280rpx',
|
||||
fontSize: '30rpx',
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 导航栏编辑按钮
|
||||
handleEdit() {
|
||||
uni.showToast({
|
||||
title: '点击了导航栏编辑',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
|
||||
// 添加视频
|
||||
addvideo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/6170/addvideo/index'
|
||||
})
|
||||
},
|
||||
|
||||
// 处理滑动按钮点击
|
||||
handleSwipeClick(e, index) {
|
||||
const {
|
||||
content
|
||||
} = e;
|
||||
// 如果是确认删除操作
|
||||
if (content.text === '确认删除') {
|
||||
this.videoList.splice(index, 1);
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 编辑操作
|
||||
if (content.text === '编辑') {
|
||||
this.editVideo(this.videoList[index].id);
|
||||
}
|
||||
// 删除操作
|
||||
else if (content.text === '删除') {
|
||||
// 只修改当前项的选项为确认删除
|
||||
this.$set(this.videoList[index], 'showConfirm', true);
|
||||
// 关闭其他项的确认状态
|
||||
this.videoList.forEach((item, i) => {
|
||||
if (i !== index && item.showConfirm) {
|
||||
this.$set(this.videoList[i], 'showConfirm', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑视频
|
||||
editVideo(id) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/6170/editVideo/index?id=${id}`
|
||||
});
|
||||
},
|
||||
// 打开视频URL
|
||||
openVideoUrl(url) {
|
||||
console.log(url, 'url333');
|
||||
// 检查URL是否包含协议头,如果没有则添加https://
|
||||
let fullUrl = url;
|
||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||
fullUrl = 'https://' + url;
|
||||
}
|
||||
//APP跳转方式
|
||||
if (plus) {
|
||||
plus.runtime.openURL(fullUrl, function(err) {
|
||||
uni.showToast({
|
||||
title: '打开链接失败',
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面整体样式 */
|
||||
.device-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
background-color: rgb(18, 18, 18);
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
background: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.content1 {
|
||||
height: 160rpx;
|
||||
background: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
line-height: 200rpx;
|
||||
}
|
||||
|
||||
.image-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.video {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.file-title {
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.file-baidu {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.path1 {
|
||||
width: 62rpx;
|
||||
height: 62rpx;
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 10rpx;
|
||||
height: 50rpx;
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 50rpx;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user