FLEX alert.show() flag 详细值

本文详细解析了ActionScript中Alert.show()方法的flags属性,包括其功能、使用方式以及按钮组合的详细说明。通过实例演示如何灵活运用此属性,实现不同场景下的提示框功能。
Alert.show()里面有多个属性,其中排在第三是flags,这个属性作用是在弹出的Alert提示框里面显示那一个或多个按钮,文档和书籍一般只写该属性可以自由组合 Alert.OK, Alert.CANCEL ,Alert.YES ,Alert.NO四个选项,并用“|”分隔,其实也可以用数字编号代替的,用数字编号更为简便,以下是编号对应的按钮组合表,一共有16个数字编号(其实只有15种组合)。
1- Alert.YES
2- Alert.NO
3- Alert.YES | Alert.NO
4- Alert.OK
5- Alert.OK | Alert.YES
6- Alert.OK | Alert.NO
7- Alert.OK | Alert.YES | Alert.NO
8- Alert.CANCEL
9- Alert.YES | Alert.CANCEL
10- Alert.NO | Alert.CANCEL
11- Alert.YES | Alert.NO | Alert.CANCEL
12- Alert.OK | Alert.CANCEL
13- Alert.OK | Alert.YES | Alert.CANCEL
14- Alert.OK | Alert.NO | Alert.CANCEL
15- Alert.OK | Alert.YES | Alert.NO | Alert.CANCEL
16- Alert.OK (和4一样)
17开始返回到1重新按顺序循环………..而flags属性不填写的话一般默认值为Alert.OK,也就是4或16。

例子:

//响应删除事件
private function doDelete():void
{
Alert.yesLabel="确定";
Alert.noLabel="取消";
Alert.show("是否确定删除选中记录?","删除记录",3,this,deleteCallBack);
}
//具体执行删除操作
private function deleteCallBack(event:CloseEvent):void
{
if(event.detail == Alert.YES)
{
Alert.okLabel="确定";
Alert.show("删除成功!");
}
}
Ext.define("StudentManagement.view.TrainingBatchGrid", { extend: "Ext.grid.Panel", alias: "widget.trainingbatchgrid", layout: "fit", columnLines: true, rowLines: true, isDblClick: false, forceFit: false, initComponent: function() { let me = this; me.deptId = me.app.getSelectedstudentrightgrid().deptId ; me.store = Ext.create("Ext.data.Store", { fields: ["code", "name", "alias", "description", "sortNumber"], autoLoad: true, proxy: { type: "ajax", url: SERVICE_URL + "training/setting/batch/list", extraParams: { start: null, limit: null, deptId: me.deptId }, reader: { type: "json", rootProperty: "data.data" } }, listeners: { load() { me.addEmptyRow("init"); } } }); me.columns = me.getColumns(); me.tbar = Ext.create("Ext.Toolbar", { items: [ { xtype: "label", style: "font-weight:normal;font-size: 18px;", text: "培训批次" }, "->", { xtype: "segmentedbutton", allowToggle: false, items: [ { xtype: "button", glyph: glyph.up, action: "up", handler: function() { me.moveItem(-1, me, "id"); } }, { xtype: "button", glyph: glyph.down, action: "down", handler: function() { me.moveItem(+1, me, "id"); } } ] }, { xtype: "button", glyph: glyph.add, handler: function() { me.addEmptyRow(); } }, { xtype: "button", glyph: glyph.trash_o, handler: function() { me.delRec(); } } ] }); me.cellediting = Ext.create("Ext.grid.plugin.CellEditing", { clicksToEdit: 2, autoCancel: false, listeners: { beforeedit: function(editor, context, eOpts) { if (context.field != "name" && Ext.isEmpty(context.record.get("name"))) { AimsUtils.windowAlert(me.up("window"), "请先填写批次名称!", 3); return false; } if (!["name", "userName"].includes(context.field) && Ext.isEmpty(context.record.get("userName"))) { AimsUtils.windowAlert(me.up("window"), "请填写招生负责人!", 3); return false; } return true; }, edit: function(editor, context) { let cellEdit = editor.getEditor(context.record, context.column).field; if (context.originalValue != context.value) { if (me.isSave(context.record)) { let gridSelec = context.record.data; let { id, name, userId, startDate, endDate } = gridSelec; let items = me.store.getData().items; let unique = items.find(item => item.get("id") != id && item.get("name") == name); if (unique) { AimsUtils.windowAlert(me.up("window"), "批次名称不能重复!", 3); return; } if (context.field == "startDate") { context.record.set("startDate", cellEdit.getRawValue()); endDate = new Date(startDate.getTime()); endDate.setFullYear(startDate.getFullYear() + 3); context.record.set("endDate", AimsUtils.dateFormat(endDate, "yyyy-MM-dd")); } let saveData = [ { id, name, userId, startDate, endDate, deptId: me.deptId, sortNumber: gridSelec.sortNumber || 1 } ]; if (!Ext.isEmpty(saveData[0].name) && !Ext.isEmpty(saveData[0].userId) && !Ext.isEmpty(saveData[0].startDate)) me.saveData(saveData, "POST", false); } } } } }); me.plugins = [me.cellediting]; me.callParent(); }, getColumns() { let me = this; let columns = [ { text: "批次名称", style: "text-align:center; color: darkgreen;", minWidth: 120, flex: 1, dataIndex: "name", editor: { xtype: "textfield", allowOnlyWhitespace: false } }, { text: "招生负责人", dataIndex: "userName", style: "text-align:center; color: darkgreen;", align: "left", editor: me.getNameEditor() }, { style: "text-align:center; color: darkgreen;", text: "开始时间", dataIndex: "startDate", width: 120, editor: { xtype: "datetimefield", format: "Y-m-d", editable: true } }, { style: "text-align:center;", text: "结束时间", dataIndex: "endDate", width: 120, editor: { xtype: "datetimefield", format: "Y-m-d", editable: true } } ]; return columns; }, addEmptyRow(status) { let me = this, store = me.getStore(), lastRec = store.last(), count = store.getCount(); // 为null 无记录时 let items = store.data.items; let add = true; if (items.length > 0) { for (let i = 0; i < items.length; i++) { let cont = items[i].data; if (!cont.id || cont.id.length != 32 || cont.id.includes("-")) { add = false; break; } } } if (Ext.isEmpty(lastRec) || me.isSave(lastRec)) { if (add) { let emptyData = {}, fields = store.getModel().getFields(); if (!Ext.isEmpty(fields)) { Ext.Array.forEach(fields, function(item, index) { emptyData[item.name] = null; }); } store.insert(count, emptyData); } } if (status == "init") { me.getSelectionModel().select(store.getCount() - 1); } }, isSave(rec) { let flag = true; let name = rec.get("name"); if (Ext.isEmpty(name)) { flag = false; } return flag; }, saveData(data, type, sortFlag) { let me = this; me.loadMask = new Ext.LoadMask({ msg: "保存中...", target: me }); me.loadMask.show(); Ext.Ajax.request({ url: SERVICE_URL + "training/setting/batch", method: type, scope: me, params: Ext.encode(data), success: function(response) { let responseData = Ext.decode(response.responseText); if (responseData.success == true) { if (sortFlag) { me.down("[action=up]").enable(); me.down("[action=down]").enable(); } else { AimsUtils.windowAlert(me.up("window"), "保存成功!", 4); let { id, sortNumber } = responseData.data[0]; me.getSelection()[0].set({ id, sortNumber }); me.getSelection()[0].commit(); me.addEmptyRow(); } me.loadMask.hide(); } }, failure: function(response, options) { let alertMessage = ""; if (sortFlag) { alertMessage = "排序失败!"; } else { alertMessage = "保存失败!"; } AimsUtils.windowAlert(me.up("window"), alertMessage, 3); me.loadMask.hide(); } }); }, delRec() { let me = this, store = me.getStore(), selRec = me.getSelection()[0]; if (Ext.isEmpty(selRec)) { AimsUtils.windowAlert(me.up("window"), "请选择要删除的记录!", 3); return; } let id = selRec.get("id"); if (Ext.isEmpty(id) || id.length != 32) { store.remove(selRec); } else { CommonComp.showConfirmWindow( me.app.application.vueNode, { remark: "确定删除吗?" }, () => { Ext.Ajax.request({ url: SERVICE_URL + `training/setting/batch/${id}`, method: "DELETE", scope: me, success: function(response) { let responseData = Ext.decode(response.responseText); if (responseData.success == true) { store.remove(selRec); } }, failure: function(response, options) { AimsUtils.windowAlert(me.up("window"), "删除失败!", 3); } }); } ); } }, getNameEditor: function() { let me = this; let url = `training/setting/teacher/list`; return { completeOnEnter: false, // 不触发Ext.Editor 的 onSpecialKey field: { xtype: "comboboxgridtree", pickerConfig: { width: 380, height: 300 }, valueField: "userName", displayField: "userName", rightColumnDataIndex: "userName", queryDelay: 100, leftCompConfig: { columns: [ { text: "姓名", style: "text-align: center;", textAlign: "start", minWidth: 70, flex: 1, dataIndex: "userName" }, { text: "性别", style: "text-align: center;", textAlign: "start", width: 60, dataIndex: "gender" } ], store: Ext.create("Ext.data.Store", { fields: ["userId", "userName", "gender"], pageSize: 10, autoLoad: false, proxy: { type: "ajax", url: SERVICE_URL + url, extraParams: { eliminateIds: [] }, reader: { type: "json", rootProperty: "data.data", totalProperty: "data.totalCount" } } }) }, matchFieldWidth: false, pageSize: 10, focusOnExpand: true, itemClickCb(rec) { let selRec = me.getSelection(); if (selRec.length > 0) { selRec[0].set("userId", rec.get("userId")); selRec[0].set("userName", rec.get("userName")); } } } }; }, // grid 移动排序 (调换排序号) moveItem(flag, _grid, idKey = "id") { let me = this, store = _grid.getStore(), count = store.getCount(), selMode = _grid.getSelectionModel(), selRec = selMode.getSelection()[0], selIndex, // 移动之后的数据index currIndex, tempRec, newRec, data = []; if (Ext.isEmpty(selRec)) { AimsUtils.windowAlert(me.up("window"), "请选择要排序的记录!", 3); return; } if (_grid.cellediting == null || !_grid.cellediting.editing) { let selCode = selRec.get(idKey); if (!Ext.isEmpty(selCode) && selCode.length === 32) { currIndex = store.indexOf(selRec); let currSortNumber = selRec.get("sortNumber"); selIndex = currIndex + flag; data[0] = { id: selCode, name: selRec.get("name"), sortNumber: null }; // 如果最后一行是空行 不参与排序 let last = store.getAt(count - 1); if (Ext.isEmpty(last.get(idKey)) || last.get(idKey).length != 32) { count = count - 1; } if (selIndex === count) { AimsUtils.windowAlert(me.up("window"), "已移动到最后一条记录!", 3); return; } else if (selIndex === -1) { AimsUtils.windowAlert(me.up("window"), "已移动到第一条记录!", 3); return; } tempRec = selRec; store.removeAt(currIndex); newRec = store.insert(selIndex, tempRec); selMode.select(newRec); // 定位到移动后的那一行 _grid.getView().focusRow(newRec[0]); let moveRec = store.getAt(currIndex); let moveSortNumber = moveRec.get("sortNumber"); data[0].sortNumber = moveSortNumber; data[1] = { id: moveRec.get(idKey), name: moveRec.get("name"), sortNumber: currSortNumber }; newRec[0].set({ sortNumber: moveSortNumber }); moveRec.set({ sortNumber: currSortNumber }); me.saveData(data, "POST", true); } } else { AimsUtils.windowAlert(me.up("window"), "当前行记录正在编辑,请编辑完成后移动!", 3); } } }); 1.培训批次结束时间默认3年,开始日期是2025年7月1号 结束日期应该是"2026-12-31",开始日期的前一天。2.允许修改结束时间,
07-15
使用recorder-core出现警告:SampleData似乎传入了未重置chunk 71>18,我的代码:<template> <div class="meeting-container"> <!-- 顶部导航栏 --> <div style="height: 24%"> <van-nav-bar left-arrow border style="background: dodgerblue" @click-left="$router.back()" > <template #left> <van-icon @click="this.$router.go(-1)" name="arrow-left" size="18" color="#fff"/> </template> </van-nav-bar> <div class="meeting-time"> <h2>网格晨会</h2> <van-tag plain style="border: white" color="#1E90FF" size="large">{{this.agenda}} </van-tag> </div> <div style="background: dodgerblue;;height: 50px"></div> </div> <div v-if="meetingOverFlag" style="height: 76%;width: 100%"> <!-- 主要内容区域 --> <div style="height:80%;width: 100%;"> <div class="recording-content"> <div style="width: 64px"> <div style="position: relative;margin-top: 40px;margin-bottom:15px;left: 7px;"> <div class="recording-content-top" :class="{'recording-content-top-animate':startRecordFlag}" style="z-index: 0;position: absolute;"> </div> <div class="recording-content-top" style="z-index: 4"> <van-icon size="25" name="volume" /> </div> </div> <span style="color: dodgerblue"> {{this.agendaOrder}}</span> </div> </div> <div class="recording-show"> <div style="padding-top: 30px"> <!-- 镜像模式频率直方图绘制区域 --> <div style=" display: inline-block; vertical-align: bottom"> <div style="height: 200px; width: 300px" ref="freqHistogram"></div> </div> </div> </div> <div class="time-container"> <div :style="{background:recordingBitColor}" style="width:25px;height: 25px;background: #63a35c;border-radius: 50%;margin-top: 18px;margin-right: 15px "></div> <div>{{ time }}</div> </div> </div> <span style="flex: 1"></span> <div class="record-bottom"> <div style="flex: 1"></div> <van-button v-if="flag" round block type="info" class="record-btn" @click="end" > 暂停 </van-button> <van-button id="startRecordingBtn" v-else round block type="info" class="record-btn" @click="start" > 继续 </van-button> <div style="flex: 1"></div> <van-button round block type="info" class="record-btn" @click="reset" > 结束会议 </van-button> <div style="flex: 1"></div> </div> </div> <span style="flex: 1"></span> <div v-if="!meetingOverFlag" style="color: red"> <h4>会议已结束</h4> <span>会议时长:{{time}}</span> </div> </div> </template> <script> import {NavBar, Icon, Panel, Button, Toast} from 'vant'; //必须引入的核心 import Recorder from 'recorder-core'; //引入mp3格式支持文件 import 'recorder-core/src/engine/mp3'; import 'recorder-core/src/engine/mp3-engine'; //录制wav格式支持 import 'recorder-core/src/engine/wav'; //频率直方图可视化插件 import 'recorder-core/src/extensions/frequency.histogram.view'; //FFT库,FrequencyHistogramView依赖 import 'recorder-core/src/extensions/lib.fft'; import meeting from "@/api/meeting"; import meetingApi from "@/api/meeting"; import {mapState} from "vuex"; export default { name: 'MeetingAgenda', data(){ return{ agenda:"", agendaOrder:"", flag: null, hour: 0, minute: 0, second: 0, time: "00:00:00", startRecordFlag:true,//开始录音标志位 recordingBitColor:'green',//录音显示标识 meetingOverFlag:true, //录音插件配置 rec: null, recBlob: null, freqHistogram: null, //录音上传 uploadChunks: [], // 存储上传的分块 currentChunkIndex: 0, // 当前上传的分块索引 meetingId: '', // 会议唯一标识 chunkSize: 1024 * 1024, // 分块大小1MB uploadInterval: null // 定时上传的定时器, } }, computed:{ ...mapState('baseInfo', ['userInfo', 'userRegions']) }, mounted() { console.log("userRegions",this.userRegions) this.meetingId = this.generateMeetingId(); this.agenda="随销" this.agendaOrder="第一议程" this.meetingTimer() console.log("user",this.userInfo) this.recOpen() }, methods: { // 生成会议唯一ID generateMeetingId() { return 'meeting_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9); }, meetingTimer() { setTimeout(() => { this.agenda = "直销" this.agendaOrder = "第二议程" }, 3000) setTimeout(() => this.toToast(20), 3000) setTimeout(() => this.toToast(30), 5000) setTimeout(() => this.toToast(50), 7000) }, //提示 toToast(minute) { let message = '' if (minute === 20) { message = '请开始第二议程,若已开始,则忽略该提示' } else if (minute === 30) { message = '请开始第二议程,若已开始,则忽略该提示' } else { message = '第二议程还剩<span style="color: yellow;">10</span>,请加快会议进度。若已议程进度,则忽略该提示。' } Toast({ type: "html", message: message, dangerouslyUseHTMLString: true }); }, //开始计时 start() { this.recStart() this.startRecordFlag = true this.recordingBitColor = 'green' // 开始定时上传 this.startUploadInterval(); this.flag = setInterval(() => { this.second = this.second + 1; if (this.second >= 60) { this.second = 0; this.minute = this.minute + 1; } if (this.minute >= 60) { this.minute = 0; this.hour = this.hour + 1; } this.time = this.complZero(this.hour) + ":" + this.complZero(this.minute) + ":" + this.complZero(this.second); }, 1000); }, // 开始定时上传 startUploadInterval() { // 每3秒上传一次 this.uploadInterval = setInterval(() => { this.uploadCurrentChunk(); }, 3000); }, // 上传当前录音数据 async uploadCurrentChunk() { if (!this.rec) return; // 获取当前录音数据(不停止录音) const buffers = this.rec.buffers; if (buffers.length === 0) return; // 改进的合并方法 const merged = this.mergeBuffers(buffers); // 转换为Blob const blob = new Blob([merged], {type: 'audio/wav'}); // 只有当数据足够大时才上传(例如>1mb) if (blob.size > this.chunkSize) { const base64Data = await this.blobToBase64(blob); this.uploadChunk(base64Data); // 清空已上传的缓冲区 this.rec.buffers = []; } }, blobToBase64(blob) { const reader = new FileReader(); reader.readAsDataURL(blob); return new Promise((resolve) => { reader.onloadend = () => { const dataUrl = reader.result; const base64Data = dataUrl.split(',')[1]; // 去除DataURL前缀 resolve(base64Data); }; }); }, // 合并缓冲区数据 mergeBuffers(buffers) { // 计算总长度 let totalLength = 0; buffers.forEach(buf => { totalLength += buf.length; }); // 创建合并后的缓冲区 const result = new Float32Array(totalLength); let offset = 0; // 合并所有缓冲区 buffers.forEach(buf => { result.set(buf, offset); offset += buf.length; }); return result; }, // 上传分块 uploadChunk(base64Data) { try { let userInfo={ opPhone:this.userInfo.user_mobile, cityId:"", areaLevel:"" } const payload = { meetingId: this.meetingId, chunkIndex: this.currentChunkIndex++, audioData: base64Data, }; const response = meetingApi.uploadRecordFile(payload); console.log('上传成功:', response); return response; } catch (error) { console.error('上传失败:', error); throw error; } }, //重新计时 reset() { this.recStop() this.meetingOverFlag=false window.clearInterval(this.flag); }, //暂停计时 end() { this.rec.pause(); this.flag = clearInterval(this.flag); if (this.uploadInterval) { clearInterval(this.uploadInterval); this.uploadInterval = null; } this.startRecordFlag = false this.recordingBitColor = '#777777' }, //补零 complZero(n) { return n < 10 ? "0" + n : "" + n; }, // 打开录音 recOpen() { return new Promise((resolve, reject) => { this.rec = Recorder({ type: 'mp3', bufferSampleRate: 16000, bitRate: 16, onProcess: (buffers, powerLevel, bufferDuration, bufferSampleRate) => { if (this.freqHistogram) { this.freqHistogram.input(buffers[buffers.length - 1], powerLevel, bufferSampleRate); } } }); if (!this.rec) { alert('当前浏览器不支持录音功能!'); reject(); return; } this.rec.open(() => { console.log('录音已打开'); this.$nextTick(() => { if (this.$refs.freqHistogram) { this.freqHistogram = Recorder.FrequencyHistogramView({ elem: this.$refs.freqHistogram, width: 320, height: 200, lineCount: 20, position: 0, minHeight: 1, stripeEnable: false, mirrorEnable: true, mirrorHeight: 0.5, linear: [0, "#1a73e8", 0.5, "#182374", 1, "rgba(255,102,0,1)"], fallDuration: 1000, stripeFallDuration: 1000, fontSize: 10, scale: 1, fadeIn: 0.3, fadeOut: 0.7 }); } }); resolve(); this.start(); }, (msg, isUserNotAllow) => { if (isUserNotAllow) { alert('请允许录音权限后重试!'); reject(); } }); }); }, //开始录音 recStart() { if (!this.rec) { console.error('未打开录音'); return; } // 确保可视化容器已初始化 if (!this.freqHistogram && this.$refs.freqHistogram) { this.initVisualizer(); } this.rec.start(); console.log('已开始录音'); }, // 提取可视化初始化逻辑 initVisualizer() { this.freqHistogram = Recorder.FrequencyHistogramView({ elem: this.$refs.freqHistogram, // ...保持原有配置 }) }, //结束录音 recStop() { if (!this.rec) { console.error('未打开录音'); return; } this.rec.stop((blob, duration) => { this.recBlob = blob; const localUrl = (window.URL || window.webkitURL).createObjectURL(blob); console.log('录音成功', blob, localUrl, '时长:' + duration + 'ms'); // 保存到本地 this.download(blob); this.rec.close(); this.rec = null; }, (err) => { console.error('结束录音出错:' + err); this.rec.close(); this.rec = null; }); }, // 保存录音文件到本地 download(blob) { // 创建下载链接 const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.style.display = 'none'; a.href = url; // 使用时间戳生成唯一文件名 const timestamp = new Date().toISOString().slice(0, 19).replace(/:/g, '-'); a.download = `recording_${timestamp}.mp3`; document.body.appendChild(a); a.click(); // 清理资源 setTimeout(() => { URL.revokeObjectURL(url); document.body.removeChild(a); }, 100); }, }, beforeDestroy() { if (this.rec) { this.rec.close(); this.rec = null; } if (this.uploadInterval) { clearInterval(this.uploadInterval); this.uploadInterval = null; } } } </script> <style scoped> .meeting-container { margin: 0; padding: 0; box-sizing: border-box; /* 确保边框和内边距计入宽高 */ height: 100vh; width: 100vw; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; } /* 自定义导航栏样式 */ .van-nav-bar { background-color: transparent; } .van-nav-bar__title { color: #fff; font-size: 18px; } .meeting-time { margin: 0; float: none; padding-top: 20px; text-align: center; background: dodgerblue; } .meeting-time h3 { font-size: 16px; margin-bottom: 8px; font-weight: normal; } .meeting-time p { font-size: 14px; margin: 0; } .recording-content{ display: flex; justify-content: center; .recording-content-top{ width: 50px; height: 50px; display: flex; justify-content: center; align-items: center; background:dodgerblue; border-radius: 50%; } .recording-content-top-animate{ animation-name: recording-start; animation-duration: 2s; animation-iteration-count: infinite; background: dodgerblue; } } @keyframes recording-start { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2); opacity: 0; } } .recording-show{ width: 100%; height: 55%; text-align: center; } .time-container{ height: 20%; width: 100%; color: #1a73e8; font-size: 50px; display: flex; justify-content: center; } /* 录音按钮样式 */ .record-bottom { height: 20%; bottom: 0; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); .record-btn { background-color: #1a73e8; border: none; width: 30%; height: 44px; line-height: 44px; font-size: 16px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3); } } .van-hairline--bottom:after { border-bottom-width: 0; } </style>
07-10
<template> <!-- 搜索 --> <page-meta :page-style="`overflow:${show ? 'hidden' : 'visible'};`"></page-meta> <view style="width: 100%; position: fixed; z-index: 1; background-color: #f2f2f2; height: 100%"></view> <view class="CSLC03" style="position: absolute; z-index: 2"> <wd-message-box /> <view class="Title"> <wd-navbar title="委托单查询" left-arrow @click-left="handleClickLeft" custom-class="wd_navbar"></wd-navbar> <!-- 搜索 --> <wd-icon name="search" size="40rpx" custom-class="Title_search" @click="show = true"></wd-icon> <wd-popup closable custom-class="wdpopup" lock-scroll v-model="show" position="bottom" custom-style="height:360rpx;" :safe-area-inset-bottom="true"> <view class="WDPOPUP"> <wd-picker custom-class="picker" label-width="23%" placeholder="请输入委托机构" label="委托机构" :columns="columnsbookId" v-model="inquire.__inqu_status__.data.bookId" /> <view class="content_message1"> <view class="message_title">物流委托单号</view> <input type="text" v-model="inquire.__inqu_status__.data.leEntrustMainId" placeholder="请输入物流委托单号" style="width: 70%" placeholder-style="color:#BFBFBF" /> </view> <view class="Button"> <button class="reset" @click="replacement">重置</button> <button class="confirm" @click="confirmQuery">确定</button> </view> </view> </wd-popup> </view> <view class="kuai"></view> <view class="CSLC03_content"> <wd-tabs v-model="tab" custom-class="WdTab" color="#3886FF" @click="handleClick"> <wd-tab title="执行中" name="ZX"> <view class="CARD"> <wd-card custom-class="CARD_card" v-for="(item, key) in resultZX" :key="key"> <view class="content" @click="CSLC0301(item)"> <view style="display: flex; width: 100%; padding: 0 20rpx;"> <view class="message_title_ton" style="width: 60%;font-size: 30rpx;font-weight: 800; color: #000"> {{ item.leEntrustMainId }} </view> <view class="message_name" style="width: 40%;font-size: 30rpx;font-weight: 800; color: #000"> {{ item.quantityPlan }} 吨 </view> </view> <view class="content_message"> <view class="message_title">委托方信息</view> <view class="message_name">{{ item.bookId }}</view> </view> <view class="content_message"> <view class="message_title">提货地址</view> <view class="message_name">{{ item.pickupLocation }}</view> </view> <view class="content_message"> <view class="message_title">收货地址</view> <view class="message_name">{{ item.consigneeCorpAddress }}</view> </view> <view class="content_message"> <view class="message_title">收获单位</view> <view class="message_name">{{ item.consigneeCorpName }}</view> </view> <view class="content_message"> <view class="message_title">收货联系人</view> <view class="message_name">{{ item.consignerContactName }}</view> </view> </view> </wd-card> <uni-load-more :status="statusZX"></uni-load-more> </view> </wd-tab> <wd-tab title="已结案" name="JA"> <view class="CARD"> <wd-card custom-class="CARD_card" v-for="(item, key) in resultJA" :key="key"> <view class="content" @click="CSLC0301(item)"> <view style="display: flex; width: 100%; padding: 0 20rpx;"> <view class="message_title_ton" style="width: 60%;font-size: 30rpx;font-weight: 800; color: #000"> {{ item.leEntrustMainId }} </view> <view class="message_name" style="width: 40%;font-size: 30rpx;font-weight: 800; color: #000"> {{ item.quantityPlan }} 吨 </view> </view> <view class="content_message"> <view class="message_title">委托方信息</view> <view class="message_name">{{ item.bookId }}</view> </view> <view class="content_message"> <view class="message_title">提货地址</view> <view class="message_name">{{ item.pickupLocation }}</view> </view> <view class="content_message"> <view class="message_title">收货地址</view> <view class="message_name">{{ item.consigneeCorpAddress }}</view> </view> <view class="content_message"> <view class="message_title">收获单位</view> <view class="message_name">{{ item.consigneeCorpName }}</view> </view> <view class="content_message"> <view class="message_title">收货联系人</view> <view class="message_name">{{ item.consignerContactName }}</view> </view> </view> </wd-card> <uni-load-more :status="statusJA"></uni-load-more> </view> </wd-tab> </wd-tabs> </view> </view> </template> <script setup> import { ref } from 'vue'; import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'; import { CS_LC_03_01 } from '@/pages/CS/JS/CSLC03.js'; import { useMessage } from '@/uni_modules/wot-design-uni'; //搜索 import { CSBaseGetCodeSets } from '@/utils/api/index.js'; const show = ref(false); var macrocode = ref({ __serviceInfo__: 'CSLC03.queryMain' }); const message = useMessage(); const alert = (A, URL) => { message .alert({ msg: A }) .then(() => { let str = A; let substr = '重新登录'; let contains = !!str && str.includes(substr); if (contains == true) { wx.removeStorage({ key: 'Token', success() { uni.reLaunch({ url: `/pages/login/login?URL=${URL}` }); } }); wx.removeStorage({ key: 'rsa' }); } else { uni.navigateBack(); } }); }; //总数据 var list = ref(); //执行中 var ZXCount = ref(); //已结案 var JACount = ref(); const statusZX = ref('more'); const statusJA = ref('more'); const tab = ref(0); //TAB标识 const flag = ref('ZX'); const handleClick = (event) => { flag.value = event.name; }; const resultZX = ref([]); const resultJA = ref([]); var URL = ref(''); var obj = ref({ __inqu_status__: { data: { entrustStatusStr: '' } }, __result__: { limit: 10, //每页10条数据 offset: 0 //第几页) } }); var obj1 = ref({ __inqu_status__: { data: { entrustStatusStr: '' } }, __result__: { limit: 10, //每页10条数据 offset: 0 //第几页) } }); // onLoad 接受 A 页面传递的参数 onLoad(() => { obj.value.__inqu_status__.data.entrustStatusStr = '10,20'; obj1.value.__inqu_status__.data.entrustStatusStr = '30'; //搜索 statusZX.value = 'loading'; //加载中状态 CS_LC_03_01_ZX(); statusJA.value = 'loading'; //加载中状态 CS_LC_03_01_JA(); // 搜索 CSBaseGetCodeSets(macrocode.value).then((result) => { // console.log(result, 'result'); if (result.__sys__.status >= 0) { columnsbookId.value = result.__codeSet__.bookId; // 委托机构 } else { var pages = getCurrentPages(); // 获取栈实例 let URL = pages[pages.length - 1].route; // 获取当前页面路由 alert(result.__sys__.msg, URL); } }); }); // 搜索 const columnsbookId = ref(); // 委托方机构 const inquire = ref({ __inqu_status__: { data: { bookId: '', // 委托方机构 leEntrustMainId: '' // 物流委托单号 } }, __result__: { limit: 10, //每页10条数据 offset: 0 //第几页) } }); // 查询重置 const replacement = () => { inquire.value.__inqu_status__.data.bookId = ''; // 委托方机构 inquire.value.__inqu_status__.data.leEntrustMainId = ''; // 物流委托单号 }; const switchover = ref(true); // 确认查询 const confirmQuery = () => { inquire.value.__result__.offset = 0; obj.value.__result__.offset = 0; obj1.value.__result__.offset = 0; if (inquire.value.__inqu_status__.data.bookId != '' || inquire.value.__inqu_status__.data.leEntrustMainId != '') { switchover.value = false; if (flag.value === 'ZX') { resultZX.value = []; statusZX.value = 'loading'; //加载中状态 confirmCS_LC_03_01_ZX_Query(); } if (flag.value === 'JA') { resultJA.value = []; statusJA.value = 'loading'; //加载中状态 confirmCS_LC_03_01_JA_Query(); } show.value = false; } else { switchover.value = true; if (flag.value === 'ZX') { resultZX.value = []; statusZX.value = 'loading'; //加载中状态 CS_LC_03_01_ZX(); } if (flag.value === 'JA') { resultJA.value = []; statusJA.value = 'loading'; //加载中状态 CS_LC_03_01_JA(); } show.value = false; } }; const confirmCS_LC_03_01_ZX_Query = async () => { await CS_LC_03_01(inquire.value).then(function(result) { if (result.__sys__.status >= 0) { ZXCount.value = result.__result__.count; // 总条数 list.value = result.__result__.data.sort(function(a, b) { return a.pageSort - b.pageSort; }); if (ZXCount.value <= 10 || YDCount.value == undefined) { statusZX.value = 'noMore'; //加载完状态 } resultZX.value = []; if (list.value.length != 0) { list.value.forEach((e) => { resultZX.value.push(e); }); } } else { var pages = getCurrentPages(); // 获取栈实例 let URL = pages[pages.length - 1].route; // 获取当前页面路由 alert(result.__sys__.msg, URL); } }); }; const confirmCS_LC_03_01_JA_Query = async () => { await CS_LC_03_01(inquire.value).then(function(result) { if (result.__sys__.status >= 0) { JACount.value = result.__result__.count; // 总条数 list.value = result.__result__.data.sort(function(a, b) { return a.pageSort - b.pageSort; }); if (JACount.value <= 10 || YDCount.value == undefined) { statusJA.value = 'noMore'; //加载完状态 } resultJA.value = []; if (list.value.length != 0) { list.value.forEach((e) => { resultJA.value.push(e); }); } } else { var pages = getCurrentPages(); // 获取栈实例 let URL = pages[pages.length - 1].route; // 获取当前页面路由 alert(result.__sys__.msg, URL); } }); }; const back = () => { const pages = getCurrentPages(); // 有可返回的页面则直接返回,uni.navigateBack 默认返回失败之后会自动刷新页面 ,无法继续返回 if (pages.length > 1) { uni.navigateBack(1); return; } else { uni.reLaunch({ url: '/pages/index/index' }); } return; }; const handleClickLeft = () => { if (URL.value == undefined || URL.value == '') { back(); } else { uni.reLaunch({ url: '/pages/index/index' }); } }; const CS_LC_03_01_ZX = async () => { await CS_LC_03_01(obj.value).then(function(result) { if (result.__sys__.status >= 0) { ZXCount.value = result.__result__.count; // 总条数 list.value = result.__result__.data.sort(function(a, b) { return a.pageSort - b.pageSort; }); if (ZXCount.value <= 10 || YDCount.value == undefined) { statusZX.value = 'noMore'; //加载完状态 } resultZX.value = []; if (list.value.length != 0) { list.value.forEach((e) => { resultZX.value.push(e); }); } } else { var pages = getCurrentPages(); // 获取栈实例 let URL = pages[pages.length - 1].route; // 获取当前页面路由 alert(result.__sys__.msg, URL); } }); }; const CS_LC_03_01_JA = async () => { await CS_LC_03_01(obj1.value).then(function(result) { if (result.__sys__.status >= 0) { JACount.value = result.__result__.count; // 总条数 list.value = result.__result__.data.sort(function(a, b) { return a.pageSort - b.pageSort; }); if (JACount.value <= 10 || YDCount.value == undefined) { statusJA.value = 'noMore'; //加载完状态 } resultJA.value = []; if (list.value.length != 0) { list.value.forEach((e) => { resultJA.value.push(e); }); } } else { var pages = getCurrentPages(); // 获取栈实例 let URL = pages[pages.length - 1].route; // 获取当前页面路由 alert(result.__sys__.msg, URL); } }); }; onReachBottom(() => { if (switchover.value == true) { if (flag.value === 'ZX') { let allTotalZX = obj.value.__result__.offset + obj.value.__result__.limit; if (allTotalZX < ZXCount.value && ZXCount.value > 10) { //当前条数小于总条数 则增加请求页数 obj.value.__result__.offset += obj.value.__result__.limit; statusZX.value = 'loading'; //加载中状态 CS_LC_03_01_ZX(); //调用加载数据方法 return; } else { // console.log('已加载全部数据') statusZX.value = 'noMore'; //加载完状态 return; } } if (flag.value === 'JA') { let allTotalJA = obj1.value.__result__.offset + obj1.value.__result__.limit; if (allTotalJA < JACount.value && JACount.value > 10) { //当前条数小于总条数 则增加请求页数 obj1.value.__result__.offset += obj1.value.__result__.limit; statusJA.value = 'loading'; //加载中状态 CS_LC_03_01_JA(); //调用加载数据方法 return; } else { // console.log('已加载全部数据') statusJA.value = 'noMore'; //加载完状态 return; } } } else if (switchover.value == false) { if (flag.value === 'ZX') { let allTotalZX = inquire.value.__result__.offset + inquire.value.__result__.limit; if (allTotalZX < ZXCount.value && ZXCount.value > 10) { //当前条数小于总条数 则增加请求页数 inquire.value.__result__.offset += inquire.value.__result__.limit; statusZX.value = 'loading'; //加载中状态 confirmCS_LC_03_01_ZX_Query(); //调用加载数据方法 return; } else { // console.log('已加载全部数据') statusZX.value = 'noMore'; //加载完状态 return; } } if (flag.value === 'JA') { let allTotalJA = inquire.value.__result__.offset + inquire.value.__result__.limit; if (allTotalJA < JACount.value && JACount.value > 10) { //当前条数小于总条数 则增加请求页数 inquire.value.__result__.offset += inquire.value.__result__.limit; statusJA.value = 'loading'; //加载中状态 confirmCS_LC_03_01_JA_Query(); //调用加载数据方法 return; } else { // console.log('已加载全部数据') statusJA.value = 'noMore'; //加载完状态 return; } } } }); const CSLC0301 = (item) => { uni.navigateTo({ url: `/pages/CS/LC/CSLC0301?leEntrustMainId=${item.leEntrustMainId}` }); }; const CSPC01 = (item) => { uni.navigateTo({ url: `/pages/CS/PC/CSPC01` }); }; </script> <style lang="scss" scoped> .CSLC03 { width: 100%; height: 100vh; box-sizing: border-box; background-color: #f2f2f2; .Title { position: fixed; width: 100%; top: 5.6%; z-index: 96; // 搜索 ::v-deep .Title_search { position: absolute; left: 15%; top: 22%; } .WDPOPUP { width: 100%; height: 100%; padding: 20rpx; box-sizing: border-box; color: #000; font-size: 27rpx; ::v-deep .wd-picker__label { font-size: 27rpx; color: #000; } ::v-deep .wd-picker__cell { padding: 15rpx 30rpx; border-bottom: 1rpx solid #ccc; box-sizing: border-box; } .content_message { width: 100%; display: flex; // margin: 10rpx 0; padding: 55rpx 30rpx 15rpx 30rpx; border-bottom: 1px solid #ccc; box-sizing: border-box; .message_title { width: 27%; } .message_name { width: 73%; padding-left: 15rpx; box-sizing: border-box; } } ::v-deep .picker { padding: 55rpx 0rpx 0rpx 0rpx; } .content_message1 { width: 100%; display: flex; // margin: 10rpx 0; padding: 15rpx 30rpx; border-bottom: 1px solid #ccc; box-sizing: border-box; .message_title { width: 27%; } .message_name { width: 73%; padding-left: 15rpx; box-sizing: border-box; } } .Button { width: 100%; display: flex; margin-top: 35rpx; .reset { width: 47%; background-color: #ffffff; color: black; } .confirm { width: 47%; background-color: #5572f6; color: white; } } } //搜索 } .kuai { position: fixed; z-index: 95; top: 0; width: 100%; height: 150rpx; background-color: #fff; } .CSLC03_content { width: 100%; height: 100%; padding: 160rpx 0rpx 0 0rpx; box-sizing: border-box; .CARD { position: relative; background: #f2f2f2; padding: 10rpx 0rpx 50rpx 0rpx; box-sizing: border-box; ::v-deep .CARD_card { margin: 20rpx 20rpx; // 调整卡片外边距与出库单一致 padding: 20rpx; // 增加内边距 box-sizing: border-box; .content { padding: 0 10rpx; // 内容区域增加左右内边距 .content_message { width: 100%; font-size: 25rpx; color: #000; display: flex; margin: 15rpx 0; // 调整行间距 padding: 0 10rpx; // 增加左右内边距 .message_title { width: 30%; font-weight: Regular; font-size: 26rpx; color: #8F959E; } .message_name { width: 70%; padding-left: 15rpx; box-sizing: border-box; color: #000; // 确保文字颜色为黑色 } } } } } } } </style> 我想让item.leEntrustMainId参考item.bookId对齐 item.bookId的左边距是正确的 完整代码发给我
05-23
<template> <div class="c-page page has-navbar" style="overflow-y: auto; height: 100vh;"> <Header :title="title"></Header> <div style="display: flex;flex-direction: column; padding: 20px; min-height: calc(100vh - 60px);"> <span v-if="cloudClassInfo" style="margin-bottom: 30px;text-align: center;"> <!-- {{ cloudClassInfo.name}} --> <div v-html="cloudClassInfo.name"></div> </span> <video v-if="cloudClassInfo && isVideo" controls name="media" id="playVedio" style="width: 100%; height: 300px;" x5-video-player-type="h5" x5-video-orientation="landscape"> <source v-bind:src="vedioUrl + cloudClassInfo.videoId" type="video/mp4" /> </video> <audio v-else-if="cloudClassInfo && isAudio" controls style="width: 100%; margin: 20px 0;"> <source :src="vedioUrl + cloudClassInfo.videoId" type="audio/mpeg"> </audio> <img v-else-if="cloudClassInfo && !isVideo" :src="vedioUrl + cloudClassInfo.videoId" style="width: 100%; object-fit: contain;" /> <span v-if="cloudClassInfo" style="margin-top: 20px;text-align: left;">{{ cloudClassInfo.remark }}</span> </div> <div class="buttomBox"> <div class="buttomBoxItem" @click="addCollect('收藏')" id="buttomBoxItem" style="" v-if="isCollected == 0"> <img class="buttomBoxItemImg" src="../../../static/收藏 -未收藏.png" style="width: 40px; height: 30px" /> <span>收藏</span> </div> <div class="buttomBoxItem" @click="addCollect('收藏')" id="buttomBoxItem" v-if="isCollected == 1"> <img class="buttomBoxItemImg" src="../../../static/收藏 -已收藏.png" style="width: 40px; height: 30px" /> <span>收藏</span> </div> <!-- <div class="buttomBoxItem" @click="addCollect('置顶')" id="buttomBoxItem" v-if="isPinned == 1"> <img class="buttomBoxItemImg" src="../../../static/置顶实色.png" style="width: 30px; height: 30px" /> <span>置顶</span> </div> <div class="buttomBoxItem" @click="addCollect('置顶')" id="buttomBoxItem" v-if="isPinned == 0"> <img class="buttomBoxItemImg" src="../../../static/置顶虚色.png" style="width: 30px; height: 30px" /> <span>置顶</span> </div> --> </div> </div> </template> <script> export default { data() { return { muted: true, // vedioUrl: 'http://192.168.0.27:9910/yyjl/2025-11-18%2F0cc54ded9cde4b9899d7953e9863b752', videoId: null, token: localStorage.getItem("token"), id: this.$route.query.id, title: this.$route.query.title, cloudClassInfo: null, vedioUrl: '/lgbsmp/api/v1/attachment/download?id=', baseUrl: "/lgbsmp/api/v1/attachment/download?id=", isCollected: 0, // 添加收藏状态,默认为0(未收藏) isPinned: 0, // 添加置顶状态,默认为0(未置顶) } }, computed: { isVideo() { if (!this.cloudClassInfo || !this.cloudClassInfo.url) return false; const videoFormats = ['video']; const url = this.cloudClassInfo.url.toLowerCase(); return videoFormats.some(format => url.includes(format)); }, isAudio() { if (!this.cloudClassInfo || !this.cloudClassInfo.url) return false; const audioFormats = ['audio']; const url = this.cloudClassInfo.url.toLowerCase(); return audioFormats.some(format => url.includes(format)); }, isPDF() { if (!this.cloudClassInfo || !this.cloudClassInfo.url) return false; return this.cloudClassInfo.url.toLowerCase().includes('pdf'); } }, created() { this.getList() }, methods: { getList() { // "/lgbsmp/api/v1/cloudClassroom?token=" + localStorage.getItem("token" //`/lgbsmp/api/v1/cloudClassroom/${this.id}&token=`+localStorage.getItem("token") this.$axios.get(`/lgbsmp/api/v1/cloudClassroom/${this.id}?token=` + localStorage.getItem("token"), { token: localStorage.getItem("token") }).then(res => { console.log("cloudClassroom", res) this.cloudClassInfo = res.data this.isCollected = res.data.collect; // 设置收藏状态 }); }, addCollect(flag) { console.log("通知ID", this.id); let id = this.id; //通知ID let userId = localStorage.getItem("userId"); //用户ID let collect = this.isCollected; // 初始化为当前收藏状态 let pinToTop = this.isPinned; // 初始化为当前置顶状态 // 根据传入的参数更新状态 if (flag === "收藏") { collect = collect === 0 ? 1 : 0; // 切换收藏状态 } else if (flag === "置顶") { pinToTop = pinToTop === 0 ? 1 : 0; // 切换置顶状态 } this.$axios .get( "/lgbsmp/api/v1/adviceCollectOrPinToTop?token=" + this.token + "&activityNoticeId=" + id + "&userId=" + userId + "&collect=" + collect + "&pinToTop=" + pinToTop ) .then((res) => { console.log("成功", res); if (res.resultCode == 200) { // 更新本地状态 if (flag === "收藏") { this.isCollected = collect; $toast.show(collect === 1 ? "收藏成功" : "取消收藏成功"); setTimeout(() => { $toast.hide(); }, 1500); // this.$toast(collect === 1 ? '收藏成功' : '取消收藏成功'); } else if (flag === "置顶") { this.isPinned = pinToTop; $toast.show(pinToTop === 1 ? "置顶成功" : "取消置顶成功"); setTimeout(() => { $toast.hide(); }, 1500); // this.$toast(pinToTop === 1 ? '置顶成功' : '取消置顶成功'); } } else { $toast.show(res.message || "操作失败"); setTimeout(() => { $toast.hide(); }, 1500); } }) .catch((err) => { console.error("失败", err); this.$toast("操作失败,请稍后重试"); }); }, }, } </script> <style scoped> .c-cell-panel { display: flex; flex-wrap: wrap; width: 100%; background-color: #f0f0f0; height: 100vh; } .c-icon-cell { width: 50%; padding: 10px; } .c-icon-cell img { width: 100%; } .c-cell-section { display: flex; flex-direction: column; width: 100%; } .c-cell-item { display: flex; flex-direction: row; align-items: center; justify-content: space-between; width: 95%; height: 60px; padding: 10px; background-color: #ffffff; border-radius: 10px; margin: 0 auto; margin-top: 20px; } .itemname { font-size: 17px; } .itemimg { width: 15px; height: 15px; } .video-container { width: 100%; padding: 20px; background-color: #ffffff; } .video-player { width: 50%; height: 50%; max-height: 60vh; object-fit: contain; } #playVedio { width: 80%; height: 350rpx; object-fit: contain; background-color: #000; } audio { width: 100%; margin: 20px 0; outline: none; } .buttomBox { display: flex; flex-direction: column; justify-content: flex-end; width: auto; position: fixed; right: 20px; bottom: 30px; background: rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); padding: 5px 0px; } .buttomBoxItem { display: flex; flex-direction: column; align-items: center; justify-content: center; } .buttomBox img { margin: 5px 3px; } iframe { width: 100%; height: 80vh; border: none; margin: 20px 0; } </style> 将 <audio v-else-if="cloudClassInfo && isAudio" controls style="width: 100%; margin: 20px 0;"> <source :src="vedioUrl + cloudClassInfo.videoId" type="audio/mpeg"> </audio>相关部分使用@ffmpeg/ffmpeg @ffmpeg/core 改写
最新发布
12-27
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值