1
0
forked from dyf/APP

Compare commits

...

3 Commits

Author SHA1 Message Date
f94efa54de Merge branch 'main' of http://47.107.152.87:3000/dyf/APP 2025-07-11 15:57:01 +08:00
ceeb4772ca 操作视频,增删改查,接口联调 2025-07-11 15:56:50 +08:00
cf3ed73568 11 2025-07-11 14:35:18 +08:00
11 changed files with 1666 additions and 1668 deletions

View File

@ -8,6 +8,8 @@ export function fileInfo(params) {
data: params data: params
}) })
} }
// 删除 // 删除
export function fileDelete(ids) { export function fileDelete(ids) {
return request({ return request({

View File

@ -0,0 +1,32 @@
import request from '@/utils/request'
// 视频列表
export function listOperationVideos(params) {
return request({
url: '/app/operationVideo/listOperationVideos',
method: 'GET',
data: params
})
}
// 添加
export function addOperationVideo(data) {
return request({
url: '/app/operationVideo/addOperationVideo',
method: 'post',
data
})
}
// 编辑
export function editOperationVideo(data) {
return request({
url: '/app/operationVideo/editOperationVideo',
method: 'post',
data
})
}
// 删除视频列表
export function deleteOperationVideo(ids) {
return request({
url: `/app/operationVideo/deleteOperationVideo/${ids}`,
method: 'delete',
})
}

View File

@ -58,6 +58,7 @@
}, },
/* ios */ /* ios */
"ios" : { "ios" : {
"appid": "uni.app.UNIA21EF43",
"privacyDescription" : { "privacyDescription" : {
"NSBluetoothPeripheralUsageDescription" : "需要蓝牙访问权限,用于设备通信", "NSBluetoothPeripheralUsageDescription" : "需要蓝牙访问权限,用于设备通信",
"NSBluetoothAlwaysUsageDescription" : "需要蓝牙访问权限,用于设备通信" "NSBluetoothAlwaysUsageDescription" : "需要蓝牙访问权限,用于设备通信"

View File

@ -69,7 +69,7 @@
{ {
"path": "pages/common/addvideo/index", "path": "pages/common/addvideo/index",
"style": { "style": {
"navigationBarTitleText": "添加" "navigationStyle": "custom"
} }
}, },
// 操作说明 // 操作说明

View File

@ -1,5 +1,7 @@
<template> <template>
<view class="device-page"> <view>
<custom-navbar :title="navTitle" :showBack="true" backgroundColor="#202020" color="#FFFFFF"></custom-navbar>
<view class="device-page" :style="{ paddingTop: navBarHeight + 'px' }">
<!-- 表单内容 --> <!-- 表单内容 -->
<view class="form-content"> <view class="form-content">
<!-- 名称输入框 --> <!-- 名称输入框 -->
@ -36,15 +38,23 @@
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
import {
addOperationVideo,
editOperationVideo
} from '@/api/common/operationVideo/index.js'
export default { export default {
data() { data() {
return { return {
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
navTitle: '添加',
name: '', name: '',
videoLink: '', videoLink: '',
showModal: false showModal: false,
deviceID: "",
id: ''
}; };
}, },
methods: { methods: {
@ -66,13 +76,56 @@
}) })
return false return false
} }
this.showModal = true let data = {
uni.navigateBack() videoName: this.name,
videoUrl: this.videoLink,
deviceId: this.deviceID,
id: this.id
}
// 添加编辑
const apiMethod = this.editData ? editOperationVideo : addOperationVideo;
console.log('apiMethod:', apiMethod);
apiMethod(data).then(res => {
if (res.code == 200) {
this.showModal = true;
setTimeout(() => {
uni.navigateBack();
}, 1500);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
}).catch(err => {
uni.showToast({
title: '网络请求失败',
icon: 'none'
});
});
}, },
// 确定提示框 // 确定提示框
handleBtn() { handleBtn() {
this.showModal = false this.showModal = false
} }
},
onLoad(options) {
if (options.item) {
// 解析传递过来的item对象
this.editData = JSON.parse(decodeURIComponent(options.item));
// 回显数据
this.name = this.editData.videoName || '';
this.videoLink = this.editData.videoUrl || '';
this.deviceID = this.editData.deviceId || '';
this.id = this.editData.id
// 修改导航标题
this.navTitle = '编辑';
} else if (options.id) {
this.deviceID = options.id;
this.navTitle = '添加';
this.editData = null; // 明确设置为 null
}
} }
}; };
</script> </script>

View File

@ -139,7 +139,8 @@
// 获取图片列表 // 获取图片列表
callOtherApi() { callOtherApi() {
let data = { let data = {
deviceId: this.deviceID deviceId: this.deviceID,
fileType: '1' //文件类型(1:操作说明2:产品参数)
} }
fileInfo(data).then((res) => { fileInfo(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {

View File

@ -7,14 +7,14 @@
<uni-swipe-action> <uni-swipe-action>
<block v-for="(item, index) in videoList" :key="index"> <block v-for="(item, index) in videoList" :key="index">
<uni-swipe-action-item :right-options="item.showConfirm ? confirmOptions : deleteOptions" <uni-swipe-action-item :right-options="item.showConfirm ? confirmOptions : deleteOptions"
@click="handleSwipeClick($event, index)" class="content"> @click="handleSwipeClick($event, index,item)" class="content">
<view class="image-box" @click="openVideoUrl(item.url)"> <view class="image-box" @click="openVideoUrl(item.videoUrl)">
<view class="deviceIMG"> <view class="deviceIMG">
<image src="/static/images/video.png" mode="" class="video"></image> <image src="/static/images/video.png" mode="" class="video"></image>
</view> </view>
<view class=""> <view class="">
<view class="file-title">{{item.title}}</view> <view class="file-title">{{item.videoName}}</view>
<view class="file-baidu">{{item.url}}</view> <view class="file-baidu">{{item.videoUrl}}</view>
</view> </view>
</view> </view>
<image src="/static/images/cires.png" class="circle"></image> <image src="/static/images/cires.png" class="circle"></image>
@ -30,12 +30,17 @@
</template> </template>
<script> <script>
import {
listOperationVideos,
deleteOperationVideo
} from '@/api/common/operationVideo/index.js'
export default { export default {
data() { data() {
return { return {
navTitle: '操作视频',
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight, navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
videoList: [], videoList: [],
deviceID: '',
deleteOptions: [{ deleteOptions: [{
text: '编辑', text: '编辑',
style: { style: {
@ -68,27 +73,46 @@
// 添加视频 // 添加视频
addvideo() { addvideo() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/6170/addvideo/index' url: `/pages/common/addvideo/index??id=${this.deviceID}`
}) })
}, },
// 处理滑动按钮点击 // 处理滑动按钮点击
handleSwipeClick(e, index) { handleSwipeClick(e, index, item) {
console.log(item, 'eeeee');
const { const {
content content
} = e; } = e;
// 如果是确认删除操作 // 如果是确认删除操作
if (content.text === '确认删除') { if (content.text === '确认删除') {
this.videoList.splice(index, 1); let ids = item.id
let data ={
ids:item.id
}
deleteOperationVideo(ids).then((res) => {
if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '删除成功', title: res.msg,
icon: 'success' icon: 'success'
}); });
return; this.getData()
} else {
uni.showToast({
title: res.msg,
icon: 'success'
});
}
})
// return;
} }
// 编辑操作 // 编辑操作
if (content.text === '编辑') { if (content.text === '编辑') {
this.editVideo(this.videoList[index].id); console.log('编辑');
uni.navigateTo({
url: `/pages/common/addvideo/index?item=${encodeURIComponent(JSON.stringify(item))}`
});
} }
// 删除操作 // 删除操作
else if (content.text === '删除') { else if (content.text === '删除') {
@ -103,12 +127,6 @@
} }
}, },
// 编辑视频
editVideo(id) {
uni.navigateTo({
url: `/pages/6170/editVideo/index?id=${id}`
});
},
// 打开视频URL // 打开视频URL
openVideoUrl(url) { openVideoUrl(url) {
console.log(url, 'url333'); console.log(url, 'url333');
@ -127,6 +145,29 @@
}); });
} }
}, },
getData() {
let data = {
deviceId: this.deviceID
}
listOperationVideos(data).then((res) => {
console.log(res, 'resss');
if (res.code == 200) {
this.videoList = res.data
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
}
},
onShow() {
this.getData()
},
onLoad(options) {
this.deviceID = options.id
} }
} }
</script> </script>

View File

@ -139,7 +139,8 @@
// 获取图片列表 // 获取图片列表
callOtherApi() { callOtherApi() {
let data = { let data = {
deviceId: this.deviceID deviceId: this.deviceID,
fileType: '2' //文件类型(1:操作说明2:产品参数)
} }
fileInfo(data).then((res) => { fileInfo(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {

View File

@ -1,8 +1,8 @@
var isReady=false;var onReadyCallbacks=[]; var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[]; var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/common/login/index","pages/common/index/index","pages/common/user/index","pages/common/scan/scan","pages/common/qrcode/qrcode","pages/common/send/index","pages/common/userAgreement/index","pages/common/privacyAgreement/index","pages/common/aboutUs/index","pages/6170/deviceControl/index","pages/6170/operationVideo/index","pages/6170/addvideo/index","pages/6170/editVideo/index","pages/common/operatingInstruct/index","pages/common/productDes/index","pages/6155/index","pages/6155/bluetooth/bluetooth"],"window":{"navigationBarTextStyle":"white","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#121212","backgroundColor":"#121212"},"tabBar":{"color":"#fff","selectedColor":"#BBE600","backgroundColor":"#202020","list":[{"pagePath":"pages/common/index/index","text":"我的设备","iconPath":"/static/tabs/device.png","selectedIconPath":"/static/tabs/device-HL.png"},{"pagePath":"pages/common/user/index","text":"我的","iconPath":"/static/tabs/my.png","selectedIconPath":"/static/tabs/my-HL.png"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"JingQuan","compilerVersion":"4.64","entryPagePath":"pages/common/login/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; var __uniConfig = {"pages":["pages/common/login/index","pages/common/index/index","pages/common/user/index","pages/common/scan/scan","pages/common/qrcode/qrcode","pages/common/send/index","pages/common/userAgreement/index","pages/common/privacyAgreement/index","pages/common/aboutUs/index","pages/6170/deviceControl/index","pages/common/operationVideo/index","pages/common/addvideo/index","pages/common/operatingInstruct/index","pages/common/productDes/index","pages/6155/index","pages/6155/bluetooth/bluetooth"],"window":{"navigationBarTextStyle":"white","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#121212","backgroundColor":"#121212"},"tabBar":{"color":"#fff","selectedColor":"#BBE600","backgroundColor":"#202020","list":[{"pagePath":"pages/common/index/index","text":"我的设备","iconPath":"/static/tabs/device.png","selectedIconPath":"/static/tabs/device-HL.png"},{"pagePath":"pages/common/user/index","text":"我的","iconPath":"/static/tabs/my.png","selectedIconPath":"/static/tabs/my-HL.png"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"JingQuan","compilerVersion":"4.64","entryPagePath":"pages/common/login/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/common/login/index","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/common/scan/scan","meta":{},"window":{"navigationBarTitleText":"扫描"}},{"path":"/pages/common/qrcode/qrcode","meta":{},"window":{"navigationBarTitleText":"扫描到的设备"}},{"path":"/pages/common/send/index","meta":{},"window":{"navigationBarTitleText":"发送信息"}},{"path":"/pages/common/userAgreement/index","meta":{},"window":{"navigationBarTitleText":"用户协议"}},{"path":"/pages/common/privacyAgreement/index","meta":{},"window":{"navigationBarTitleText":"隐私协议"}},{"path":"/pages/common/aboutUs/index","meta":{},"window":{"navigationBarTitleText":"关于我们"}},{"path":"/pages/6170/deviceControl/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6170/operationVideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6170/addvideo/index","meta":{},"window":{"navigationBarTitleText":"添加"}},{"path":"/pages/6170/editVideo/index","meta":{},"window":{"navigationBarTitleText":"编辑视频"}},{"path":"/pages/common/operatingInstruct/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/productDes/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6155/index","meta":{},"window":{"navigationBarTitleText":"6155"}},{"path":"/pages/6155/bluetooth/bluetooth","meta":{},"window":{"navigationStyle":"custom"}}]; var __uniRoutes = [{"path":"/pages/common/login/index","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/common/scan/scan","meta":{},"window":{"navigationBarTitleText":"扫描"}},{"path":"/pages/common/qrcode/qrcode","meta":{},"window":{"navigationBarTitleText":"扫描到的设备"}},{"path":"/pages/common/send/index","meta":{},"window":{"navigationBarTitleText":"发送信息"}},{"path":"/pages/common/userAgreement/index","meta":{},"window":{"navigationBarTitleText":"用户协议"}},{"path":"/pages/common/privacyAgreement/index","meta":{},"window":{"navigationBarTitleText":"隐私协议"}},{"path":"/pages/common/aboutUs/index","meta":{},"window":{"navigationBarTitleText":"关于我们"}},{"path":"/pages/6170/deviceControl/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/operationVideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/addvideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/operatingInstruct/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/productDes/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6155/index","meta":{},"window":{"navigationBarTitleText":"6155"}},{"path":"/pages/6155/bluetooth/bluetooth","meta":{},"window":{"navigationStyle":"custom"}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}}); service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long