shot.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570
  1. <template>
  2. <headerBar
  3. :title="configInfoStore.appModel === 1 ? '拍摄商品' : '处理图像'"
  4. showUser
  5. :menu="menu"
  6. />
  7. <hardware-check/>
  8. <div class="photography-page flex-col">
  9. <div class="main-container">
  10. <template v-if="configInfoStore.appModel === 1 ">
  11. <div class="content-wrapper flex-row">
  12. <!-- <img class="camera-image" referrerpolicy="no-referrer" src="@/assets/images/Photography/camera-icon.png" />-->
  13. <div class="step-number flex-col"><span class="text_22">1</span></div>
  14. <div class="step-one flex-col justify-between">
  15. <div class="step-header flex-row">
  16. <span class="step-title">第一步:获取商品货号</span>
  17. <img class="step-icon" referrerpolicy="no-referrer" src="@/assets/images/Photography/step1-icon.png" />
  18. <img class="step-divider" referrerpolicy="no-referrer"
  19. src="@/assets/images/Photography/step-divider-line.png" />
  20. </div>
  21. <div class="step-content flex-row justify-between">
  22. <div class="method-container flex-col">
  23. <div class="input-container flex-row">
  24. <el-input class="input-item" ref="goodsArtNo" v-model="goods_art_no" placeholder="请输入货号"> </el-input>
  25. </div>
  26. <div class="auto-method flex-row justify-between">
  27. <div class="text-method-tag flex-col"><span class="text_4">自动获取</span></div>
  28. <span class="method-description">用遥控器扫描商品资料二维码</span>
  29. </div>
  30. <div class="scan-method flex-row justify-between">
  31. <div class="remote-control flex-col">
  32. </div>
  33. <!-- <span class="scan-label">遥控器扫描键</span>-->
  34. </div>
  35. </div>
  36. <img class="remote-image" referrerpolicy="no-referrer"
  37. src="@/assets/images/Photography/remote-control.png" />
  38. </div>
  39. </div>
  40. <div class="step-number flex-col"><span class="text_22">2</span></div>
  41. <div class="step-two flex-col justify-between">
  42. <span class="step-title">第二步:启动拍摄(根据按遥控器左右键启动)</span>
  43. <div class="shooting-container flex-col">
  44. <div class="shooting-tips flex-row justify-between">
  45. <img class="info-icon" referrerpolicy="no-referrer" src="@/assets/images/Photography/info-icon.png" />
  46. <span class="tips-text">遥控左右按键可启动拍摄,中间按钮可在拍摄5张主图后解锁,用于拍摄自定义图</span>
  47. </div>
  48. <div class="wifi mar-top-20">
  49. <img referrerpolicy="no-referrer"
  50. src="@/assets/images/Photography/wifi.png" style="width: 60px" />
  51. </div>
  52. <div class="remote-control-wrap">
  53. <RemoteControl
  54. @onRemoteControl="onRemoteControl"
  55. />
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="last-photo" v-show="showlastPhoto" v-key="lastPhoto.file_path">
  61. <div>{{lastPhoto.action_name || ''}}</div>
  62. <el-image :src="getFilePath(lastPhoto.file_path)" fit="contain" ></el-image>
  63. </div>
  64. </template>
  65. <div class="history-section flex-col"
  66. :class="configInfoStore.appModel === 2 ? 'koutu-section' : ''"
  67. >
  68. <span class="history-title flex between">
  69. <div>拍摄记录</div>
  70. <div class="c-666 fs-12" v-if="goodsList.length" >
  71. <el-button :disabled="!(runLoading || takePictureLoading)" @click="oneClickStop" v-if="configInfoStore.appModel === 1" class="input-button" type="primary" size="mini">一键停止</el-button>
  72. <el-button :disabled="runLoading || takePictureLoading" @click="delAll" class="input-button" type="danger" size="mini">一键删除</el-button>
  73. </div>
  74. </span>
  75. <img class="divider-line" referrerpolicy="no-referrer" src="@/assets/images/Photography/divider-line.png" />
  76. <div class="history-warp">
  77. <div v-if="!goodsList.length" class="fs-14 c-666 mar-top-50">
  78. {{ loading ? '数据正在加载中,请稍候...' : '暂无数据,请先进行拍摄'}}
  79. </div>
  80. <div v-else class="history-item clearfix" v-for="item,index in goodsList" style="padding:10px;">
  81. <div class="flex between flex-item c-333">
  82. <div class="chaochu flex-item flex left">货号:{{ item.goods_art_no }}</div>
  83. <div >
  84. <!--
  85. <el-button :disabled="runLoading || takePictureLoading" size="small" plain >高级生成</el-button>
  86. -->
  87. <el-dropdown @command="handleGenerateCommand" :disabled="runLoading || takePictureLoading" >
  88. <el-button :disabled="runLoading || takePictureLoading" size="small" plain style="margin-right: 5px" >高级生成</el-button>
  89. <template #dropdown>
  90. <el-dropdown-menu>
  91. <el-dropdown-item
  92. v-for="menu in generate.children"
  93. @click.native="onGenerateCLick(menu,item)">{{ menu.name }}</el-dropdown-item>
  94. </el-dropdown-menu>
  95. </template>
  96. </el-dropdown>
  97. <el-button size="small" :disabled="runLoading || takePictureLoading" @click="delGoods({goods_art_nos:[item.goods_art_no]})">删除</el-button>
  98. </div>
  99. </div>
  100. <div class="flex between flex-item c-333" style="margin-top: 5px">
  101. <div class="c-999 fs-12">{{ getTime(item.action_time) }}</div>
  102. <el-button size="small" :disabled="runLoading || takePictureLoading" type="primary" @click="reTakePictureNos(item.goods_art_no,item)" plain v-if="configInfoStore.appModel === 1">重拍</el-button>
  103. </div>
  104. <div class="mar-top-10 clearfix history-item_image_wrap" style="width: 100%" >
  105. <component class="history-item_image"
  106. v-for="image,index in item.items"
  107. v-loading="!image.PhotoRecord.image_path && runAction.goods_art_no == item.goods_art_no"
  108. :is="image.PhotoRecord.image_path ? 'div' : 'p'"
  109. >
  110. <span class="tag">{{ image.action_name }}</span>
  111. <el-popover
  112. :popper-class="configInfoStore.appModel === 1 ? 'shot-image-popper' : 'koutu-image-popper'"
  113. :placement=" configInfoStore.appModel === 1 ? 'left' : 'right'"
  114. :hide-after="0"
  115. width="50%"
  116. offset="20"
  117. v-if="image.PhotoRecord.image_path"
  118. >
  119. <template #reference>
  120. <div class="flex el-image_view">
  121. <el-image :src="getFilePath(image.PhotoRecord.image_path)" fit="contain" >
  122. <template #error>
  123. <div class="image-slot"></div>
  124. </template>
  125. </el-image>
  126. <el-button :disabled="runLoading || takePictureLoading" class="reset-button" @click="reTakePicture(image.PhotoRecord)">重拍</el-button>
  127. </div>
  128. </template>
  129. <el-image :src="getFilePath(image.PhotoRecord.image_path)" fit="contain" >
  130. <template #error>
  131. <div class="image-slot"></div>
  132. </template>
  133. </el-image>
  134. </el-popover>
  135. <div class="flex el-image_view" v-else>
  136. <el-image :src="getFilePath(image.PhotoRecord.image_path)" fit="contain">
  137. <template #error>
  138. <div class="image-slot"></div>
  139. <el-button :disabled="runLoading || takePictureLoading" class="reset-button" @click="reTakePicture(image.PhotoRecord)">重拍</el-button>
  140. </template>
  141. </el-image>
  142. </div>
  143. </component>
  144. <div v-if="item.items.length < 5"
  145. v-for="item in (5 - item.items.length)"
  146. class="history-item_image"
  147. >
  148. <span class="tag" style="font-size: 12px;">暂未配置</span>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. <!-- 无数据 -->
  154. <!-- <div class="empty-state flex-col justify-between">
  155. <img
  156. class="empty-icon"
  157. referrerpolicy="no-referrer"
  158. src="@/assets/images/Photography/empty-state-icon.png"
  159. />
  160. <span class="empty-text">暂无数据</span>
  161. </div>-->
  162. <div v-if="goodsList.length" class="next-step button--primary1 flex-col" @click="openPhotographyDetail"><span
  163. class="next-step-text">{{ configInfoStore.appModel === 1 ? '开始生成' : '开始生成'}}</span></div>
  164. </div>
  165. </div>
  166. </div>
  167. </template>
  168. <script setup lang="ts">
  169. import headerBar from '@/components/header-bar/index.vue'
  170. import { ref, reactive, onMounted, onBeforeUnmount,watchEffect, computed} from 'vue'
  171. import icpList from '@/utils/ipc'
  172. import client from "@/stores/modules/client";
  173. import socket from "@/stores/modules/socket";
  174. import { ElMessage ,ElMessageBox } from 'element-plus'
  175. import { getFilePath,getRouterUrl } from '@/utils/appfun'
  176. import {useRouter} from "vue-router";
  177. import HardwareCheck from '@/components/check/index.vue'
  178. import checkInfo from "@/stores/modules/check";
  179. import RemoteControl from '@/views/RemoteControl/index'
  180. import generate from '@/utils/menus/generate'
  181. const loading = ref(false)
  182. const runLoading = ref(false)
  183. const takePictureLoading = ref(false)
  184. import useUserInfo from "@/stores/modules/user";
  185. const useUserInfoStore = useUserInfo();
  186. import configInfo from '@/stores/modules/config';
  187. const configInfoStore = configInfo();
  188. import qiehuan from '@/components/header-bar/assets/qiehuan.svg'
  189. const menu = computed(()=>{
  190. if(configInfoStore.appModel === 2){
  191. return [
  192. {
  193. type:'setting'
  194. },
  195. {
  196. name:'切换模式',
  197. click(){
  198. configInfoStore.updateAppModel(1)
  199. Router.push({
  200. name:'PhotographyCheck'
  201. })
  202. }
  203. },
  204. {
  205. ...generate
  206. },
  207. {
  208. type:'ota'
  209. }
  210. ]
  211. }
  212. if(useUserInfoStore.userInfo.brand_company_code === '1300'){
  213. return [
  214. {
  215. type:'setting'
  216. },
  217. {
  218. type:'developer'
  219. },
  220. {
  221. ...generate,
  222. },
  223. {
  224. type:'ota'
  225. }
  226. ]
  227. }
  228. return [
  229. {
  230. type:'setting'
  231. },
  232. {
  233. ...generate
  234. },
  235. {
  236. type:'ota'
  237. }
  238. ]
  239. })
  240. const clientStore = client();
  241. const Router = useRouter()
  242. /*const goodsList = ref([
  243. {
  244. "goods_art_no": "123456789",
  245. "items": [
  246. {
  247. "record_id":1,
  248. "image_deal_mode":0,
  249. "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0001.jpg",
  250. },
  251. {
  252. "record_id":2,
  253. "image_deal_mode":0,
  254. "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0002.jpg",
  255. },
  256. {
  257. "record_id":3,
  258. "image_deal_mode":0,
  259. "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0003.jpg",
  260. },
  261. {
  262. "record_id":4,
  263. "image_deal_mode":0,
  264. "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0004.jpg",
  265. },
  266. {
  267. "record_id":5,
  268. "image_deal_mode":0,
  269. "image_path": "C:\\Users\\Administrator\\Pictures\\digiCamControl\\Session1\\DSC_0005.jpg",
  270. }
  271. ]
  272. }
  273. ])*/
  274. const goodsList = ref([])
  275. const goods_art_no_tpl = ref('')
  276. const goods_art_no = ref('')
  277. const runAction = ref({
  278. "action": "",
  279. "goods_art_no": ""
  280. })
  281. // 初始化 WebSocket 状态管理
  282. const socketStore = socket()
  283. /**
  284. * 保存货号模板到货号变量中。
  285. */
  286. function saveGoodsArtNo(){
  287. if(goods_art_no_tpl.value){
  288. goods_art_no.value = goods_art_no_tpl.value
  289. ElMessage.success('商品货号'+goods_art_no.value+'获取成功,请在遥控器上按下左或右脚按键,启动拍摄')
  290. }
  291. }
  292. /**
  293. * 获取拍照记录。
  294. * @param params - 可选参数,用于分页或其他筛选条件。
  295. */
  296. async function getPhotoRecords(params?:{}) {
  297. if(loading.value) return;
  298. loading.value = true;
  299. clientStore.ipc.send(icpList.takePhoto.getPhotoRecords,{
  300. ...params,
  301. page:1,
  302. size:100,
  303. });
  304. clientStore.ipc.on(icpList.takePhoto.getPhotoRecords, (event, result) => {
  305. loading.value = false;
  306. if(result.code === 0){
  307. clientStore.ipc.removeAllListeners(icpList.takePhoto.getPhotoRecords);
  308. console.log('getPhotoRecords print_time:'+new Date().toLocaleString()) // 打印当前时间
  309. console.log('getPhotoRecords print_time:'+JSON.stringify(result.data.list)) // 打印当前时间
  310. goodsList.value = result.data.list
  311. if(isDelGoodsGetList.value){
  312. isDelGoodsGetList.value = false;
  313. return;
  314. }
  315. getLastPhotoRecord()
  316. }else if(result.msg) {
  317. ElMessage.error(result.msg)
  318. }
  319. });
  320. }
  321. /**
  322. * 执行拍照操作。
  323. * @param data - 包含拍摄所需的数据对象。
  324. */
  325. async function runGoods(data) {
  326. if(runLoading.value || takePictureLoading.value){
  327. ElMessage.error('拍摄程序正在运行,请稍候')
  328. return
  329. }
  330. await socketStore.connectSocket();
  331. socketStore.sendMessage({
  332. type: 'run_mcu',
  333. data,
  334. })
  335. runLoading.value = true;
  336. runAction.value.action = data.action
  337. runAction.value.goods_art_no = data.goods_art_no
  338. goods_art_no.value = ''
  339. goods_art_no_tpl.value = ''
  340. reNosObj.value.goods_art_no = null;
  341. reNosObj.value.action = null;
  342. clientStore.ipc.on(icpList.socket.message + '_run_mcu', (event, result) => {
  343. clientStore.ipc.removeAllListeners(icpList.socket.message + '_run_mcu');
  344. console.log('_run_mcu');
  345. console.log(result);
  346. if(result.code !== 0 && result.msg){
  347. ElMessage.error(result.msg)
  348. runLoading.value = false
  349. return;
  350. }else{
  351. ElMessage.success('开始拍摄,请稍后')
  352. }
  353. })
  354. }
  355. /**
  356. * 格式化时间字符串。
  357. * @param time - 原始时间字符串。
  358. * @returns 格式化后的时间字符串,若输入为空则返回 null。
  359. */
  360. const getTime = function(time){
  361. if(!time) return null
  362. return time.replace('T',' ').substr(5,11)
  363. }
  364. /**
  365. * 删除所有商品货号的历史记录。
  366. */
  367. async function delAll(){
  368. let params = goodsList.value.map(item=>item.goods_art_no)
  369. await ElMessageBox.confirm('确定要删除当下的历史记录吗?', '提示', {
  370. confirmButtonText: '确定',
  371. cancelButtonText: '取消',
  372. })
  373. del({goods_art_nos:params})
  374. }
  375. /**
  376. * 删除指定的商品货号。
  377. * @param params - 包含需要删除的货号列表的对象。
  378. */
  379. const delGoods = async function(params){
  380. await ElMessageBox.confirm('确定要删除货号:'+params.goods_art_nos[0]+'的拍摄数据吗?', '提示', {
  381. confirmButtonText: '确定',
  382. cancelButtonText: '取消',
  383. })
  384. del(params)
  385. }
  386. /**
  387. * 删除指定的商品货号。
  388. * @param params - 包含需要删除的货号列表的对象。
  389. */
  390. const isDelGoodsGetList = ref(false)
  391. const del = async function(params){
  392. clientStore.ipc.removeAllListeners(icpList.takePhoto.delectGoodsArts);
  393. clientStore.ipc.send(icpList.takePhoto.delectGoodsArts,params);
  394. clientStore.ipc.on(icpList.takePhoto.delectGoodsArts, (event, result) => {
  395. clientStore.ipc.removeAllListeners(icpList.takePhoto.delectGoodsArts);
  396. if(result.code === 0){
  397. isDelGoodsGetList.value =true
  398. ElMessage.info('货号删除成功')
  399. getPhotoRecords()
  400. if(reNosObj.value.goods_art_no){
  401. runGoods(
  402. {
  403. "action": reNosObj.value.action,
  404. "goods_art_no":reNosObj.value.goods_art_no
  405. })
  406. }
  407. }else if(result.msg) {
  408. ElMessage.error(result.msg)
  409. }
  410. });
  411. }
  412. //单个重拍
  413. const reTakePicture = async (img)=>{
  414. if(!img.id) return;
  415. await ElMessageBox.confirm('此操作会先删除此数据,需要继续吗?', '提示', {
  416. confirmButtonText: '确定',
  417. cancelButtonText: '取消',
  418. })
  419. runLoading.value = true;
  420. reNosObj.value.goods_art_no = img.goods_art_no
  421. reNosObj.value.action = 're_take_picture'
  422. let params = {
  423. id: img.action_id
  424. }
  425. clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigDetail);
  426. clientStore.ipc.send(icpList.setting.getDeviceConfigDetail, params);
  427. clientStore.ipc.on(icpList.setting.getDeviceConfigDetail, (event, result) => {
  428. console.log('getDeviceConfigDetail')
  429. console.log(result)
  430. if(result.code == 0 && result.data){
  431. clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigDetail);
  432. this_run_mcu_single(result.data)
  433. }else if(result.msg){
  434. runLoading.value = false;
  435. reNosObj.value.goods_art_no = ''
  436. reNosObj.value.action = ''
  437. ElMessage.error(result.msg)
  438. }
  439. });
  440. function this_run_mcu_single(data){
  441. clientStore.ipc.removeAllListeners(icpList.socket.message+'_run_mcu_single');
  442. socketStore.sendMessage({
  443. type: 'run_mcu_single',
  444. data: {
  445. camera_height: Number(data.camera_height),
  446. camera_angle: Number(data.camera_angle),
  447. led_switch:data.led_switch,
  448. id:0,
  449. mode_type:data.mode_type,
  450. turntable_position:Number(data.turntable_position),
  451. action_name:data.action_name || '测试',
  452. turntable_angle: Number(data.turntable_angle),
  453. shoe_upturn: Number(data.shoe_upturn),
  454. action_index:1,
  455. number_focus:0,
  456. take_picture:false,
  457. pre_delay:0,
  458. after_delay:0,
  459. }
  460. });
  461. clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, result) => {
  462. console.log('_run_mcu_single_row')
  463. clientStore.ipc.removeAllListeners(icpList.socket.message+'_run_mcu_single');
  464. this_re_take_picture()
  465. })
  466. }
  467. async function this_re_take_picture(){
  468. await ElMessageBox.alert('已复位到该视图下,请把鞋子摆放完毕之后,点击按钮开始重拍', '提示',{
  469. confirmButtonText:"开始重拍"
  470. })
  471. clientStore.ipc.removeAllListeners(icpList.socket.message + '_digicam_take_picture');
  472. socketStore.sendMessage({
  473. type: 'digicam_take_picture',
  474. "data":{"id":img.id,"goods_art_no":img.goods_art_no},
  475. })
  476. clientStore.ipc.on(icpList.socket.message + '_digicam_take_picture', (event, result) => {
  477. console.log('_digicam_take_picture')
  478. console.log(result)
  479. runLoading.value = false;
  480. if(result.code === 0){
  481. getPhotoRecords()
  482. setTimeout(()=>{
  483. showlastPhoto.value = false
  484. },6000)
  485. }else if(result.msg) {
  486. runLoading.value = false;
  487. reNosObj.value.goods_art_no = ''
  488. reNosObj.value.action = ''
  489. ElMessage.error(result.msg)
  490. }
  491. clientStore.ipc.removeAllListeners(icpList.socket.message + '_digicam_take_picture');
  492. })
  493. }
  494. }
  495. const reNosObj = ref({
  496. goods_art_no:null,
  497. action:null,
  498. })
  499. //货号重拍
  500. const reTakePictureNos = async (goods_art_no,item)=>{
  501. await ElMessageBox.confirm('此操作会先删除删除货号:'+goods_art_no+'的拍摄数据吗,需要继续吗?', '提示', {
  502. confirmButtonText: '确定',
  503. cancelButtonText: '取消',
  504. })
  505. reNosObj.value.goods_art_no = goods_art_no
  506. reNosObj.value.action = '执行左脚程序'
  507. console.log(item);
  508. if(item.items && typeof item.items === 'object' && item.items[0].PhotoRecord.image_deal_mode){
  509. reNosObj.value.action = '执行右脚程序'
  510. }
  511. del({goods_art_nos:[goods_art_no]})
  512. }
  513. /**
  514. * 检查是否可以进入下一步操作。
  515. */
  516. const next = async function(){
  517. if(runLoading.value){
  518. ElMessage.error('正在拍摄中,请稍候')
  519. return;
  520. }
  521. if(goodsList.length){
  522. ElMessage.error('请先拍摄商品。')
  523. return;
  524. }
  525. }
  526. const oneClickStop = ()=>{
  527. if(!(runLoading.value || takePictureLoading.value)){
  528. ElMessage.error('拍摄程序已结束,不需要单独停止!')
  529. return
  530. }else{
  531. socketStore.sendMessage({
  532. type: 'stop_action',
  533. })
  534. }
  535. }
  536. const goodsArtNo = ref()
  537. /**
  538. * 页面挂载时初始化事件监听器并获取初始数据。
  539. */
  540. onMounted(async () => {
  541. // 监听蓝牙扫描事件
  542. clientStore.ipc.on(icpList.socket.message + '_blue_tooth_scan', (event, result) => {
  543. console.log('_blue_tooth_scan')
  544. if (result.code === 0 && result.data?.data) {
  545. console.log(goods_art_no.value);
  546. if(!goods_art_no.value){
  547. ElMessage.error('请在左侧第一步中,先扫描货号或者手动输入货号!')
  548. goodsArtNo.value?.focus() // 聚焦输入框
  549. return;
  550. }
  551. runGoods({
  552. ...result.data?.data,
  553. goods_art_no: goods_art_no.value
  554. })
  555. }
  556. });
  557. /* window.addEventListener('storage', handleStorageEvent);*/
  558. await getPhotoRecords();
  559. // 监听图片处理完成事件
  560. clientStore.ipc.on(icpList.socket.message + '_image_process', (event, result) => {
  561. console.log('_image_process')
  562. console.log(result)
  563. getPhotoRecords()
  564. // 延迟两秒再获取一遍数据
  565. setTimeout(()=>{
  566. getPhotoRecords()
  567. },3000)
  568. })
  569. // 监听拍照完成事件
  570. clientStore.ipc.on(icpList.socket.message + '_photo_take', (event, result) => {
  571. console.log('_photo_take')
  572. console.log(result)
  573. if(result.status === 2 && result.msg.includes('执行完成')){
  574. getPhotoRecords()
  575. // 延迟两秒再获取一遍数据
  576. setTimeout(()=>{
  577. getPhotoRecords()
  578. },3000)
  579. takePictureLoading.value = false;
  580. return;
  581. }
  582. if(result.code !== 0 && result.msg){
  583. ElMessage.error(result.msg)
  584. takePictureLoading.value = false;
  585. }
  586. })
  587. // 监听一键停止
  588. clientStore.ipc.on(icpList.socket.message + '_stop_action', (event, result) => {
  589. console.log('_stop_action')
  590. console.log(result)
  591. oneClickStop()
  592. })
  593. // 监听一键停止结束
  594. clientStore.ipc.on(icpList.socket.message + '_run_mcu_stop', (event, result) => {
  595. console.log('_run_mcu_stop')
  596. runLoading.value = false;
  597. reNosObj.value.goods_art_no = ''
  598. reNosObj.value.action = ''
  599. runAction.value.goods_art_no = '';
  600. runAction.value.action = '';
  601. })
  602. // 监听拍照完成后的最终状态事件
  603. clientStore.ipc.on(icpList.socket.message + '_photo_take_finish', (event, result) => {
  604. console.log('_photo_take_finish')
  605. console.log(result)
  606. if(result.code === 0) {
  607. runLoading.value = false;
  608. runAction.value.goods_art_no = '';
  609. runAction.value.action = '';
  610. setTimeout(()=>{
  611. showlastPhoto.value = false
  612. },5000)
  613. }
  614. })
  615. // 监听手动触发拍照事件
  616. clientStore.ipc.on(icpList.socket.message + '_handler_take_picture', async (event, result) => {
  617. console.log('_handler_take_picture')
  618. console.log(result)
  619. if(result.code === 0){
  620. if(runLoading.value || takePictureLoading.value){
  621. ElMessage.error('拍摄程序正在运行,请稍候')
  622. return
  623. }
  624. ElMessage.success('正在拍摄中,请稍候')
  625. takePictureLoading.value = true;
  626. /* setTimeout(()=>{
  627. takePictureLoading.value = false;
  628. },3000)*/
  629. await socketStore.connectSocket();
  630. socketStore.sendMessage(result.data)
  631. getPhotoRecords()
  632. // 延迟两秒再获取一遍数据
  633. setTimeout(()=>{
  634. getPhotoRecords()
  635. },3000)
  636. }
  637. })
  638. })
  639. const onRemoteControl = (type)=>{
  640. if(type == 'take_picture'){
  641. if(runLoading.value || takePictureLoading.value){
  642. ElMessage.error('拍摄程序正在运行,请稍候')
  643. return
  644. }
  645. ElMessage.success('正在拍摄中,请稍候')
  646. socketStore.sendMessage({
  647. type: 'handler_take_picture',
  648. })
  649. return;
  650. }
  651. if(!goods_art_no.value){
  652. ElMessage.error('请在左侧第一步中,先扫描货号或者手动输入货号!')
  653. goodsArtNo.value?.focus() // 聚焦输入框
  654. return;
  655. }
  656. let action = '执行左脚程序'
  657. if(type === 'right') action = '执行右脚程序'
  658. runGoods({
  659. "action": action,
  660. "goods_art_no": goods_art_no.value,
  661. })
  662. }
  663. /*const handleStorageEvent = (e) => {
  664. if(e.key === 'run_mcu' && e.newValue){
  665. if(!goods_art_no.value){
  666. ElMessage.error('请先扫描货号或者手动输入货号!')
  667. localStorage.setItem('run_mcu','')
  668. return;
  669. }
  670. let action = '执行左脚程序'
  671. if(e.newValue === 'right') action = '执行右脚程序'
  672. runGoods({
  673. "action": action,
  674. "goods_art_no": goods_art_no.value,
  675. })
  676. localStorage.setItem('run_mcu','')
  677. }
  678. };*/
  679. const checkInfoStore = checkInfo()
  680. checkInfoStore.set_blue_tooth_scan_NO('')
  681. watchEffect(async ()=>{
  682. if(checkInfoStore.blue_tooth_scan_NO){
  683. ElMessage.success('商品货号'+checkInfoStore.blue_tooth_scan_NO+'获取成功,请在遥控器上按下左或右脚按键,启动拍摄')
  684. goods_art_no.value = checkInfoStore.blue_tooth_scan_NO
  685. checkInfoStore.set_blue_tooth_scan_NO('')
  686. }
  687. })
  688. /**
  689. * 页面卸载时移除所有事件监听器。
  690. */
  691. onBeforeUnmount(() => {
  692. clientStore.ipc.removeAllListeners(icpList.socket.message + '_blue_tooth_scan');
  693. clientStore.ipc.removeAllListeners(icpList.socket.message + '_image_process');
  694. clientStore.ipc.removeAllListeners(icpList.socket.message + '_run_mcu');
  695. clientStore.ipc.removeAllListeners(icpList.socket.message + '_photo_take');
  696. clientStore.ipc.removeAllListeners(icpList.socket.message + '_photo_take_finish');
  697. clientStore.ipc.removeAllListeners(icpList.socket.message + '_run_mcu_update');
  698. clientStore.ipc.removeAllListeners(icpList.socket.message + '_stop_action');
  699. clientStore.ipc.removeAllListeners(icpList.socket.message + '_smart_shooter_photo_take');
  700. clientStore.ipc.removeAllListeners(icpList.socket.message + '_run_mcu_stop');
  701. clientStore.ipc.removeAllListeners(icpList.socket.message + '_digicam_take_picture');
  702. /* window.removeEventListener('storage', handleStorageEvent);*/
  703. })
  704. /*
  705. * 打开最近一张拍摄图
  706. * */
  707. const lastPhoto = ref({})
  708. const showlastPhoto = ref(false)
  709. const getLastPhotoRecord = async ()=>{
  710. return;
  711. if(goodsList.value && goodsList.value.length === 0) return;
  712. clientStore.ipc.removeAllListeners(icpList.takePhoto.getLastPhotoRecord);
  713. clientStore.ipc.send(icpList.takePhoto.getLastPhotoRecord,);
  714. clientStore.ipc.on(icpList.takePhoto.getLastPhotoRecord, (event, result) => {
  715. console.log('getLastPhotoRecord')
  716. console.log(result)
  717. console.log(runAction.value)
  718. clientStore.ipc.removeAllListeners(icpList.takePhoto.getLastPhotoRecord);
  719. if(result.code === 0){
  720. if(lastPhoto.value?.image_path){
  721. if( lastPhoto.value?.image_path == result.data?.image_path) return;
  722. if(runAction.value.goods_art_no === result.data?.goods_art_no){
  723. showlastPhoto.value = true
  724. }
  725. }
  726. lastPhoto.value = result.data
  727. }else if(result.msg) {
  728. ElMessage.error(result.msg)
  729. }
  730. });
  731. }
  732. let smartShooterTimeout = null; // 在合适的位置定义一个全局变量用于保存定时器
  733. //拍照成功 SmartShooter
  734. clientStore.ipc.on(icpList.socket.message+'_smart_shooter_photo_take', async (event, result) => {
  735. console.log('_smart_shooter_photo_take');
  736. console.log(result);
  737. if(result.code === 0 && result.data?.photo_file_name){
  738. if (smartShooterTimeout) {
  739. clearTimeout(smartShooterTimeout);
  740. }
  741. smartShooterTimeout = setTimeout(() => {
  742. getPhotoRecords();
  743. }, 2000);
  744. }
  745. })
  746. // 监听拍照完成后的最终状态事件
  747. clientStore.ipc.on(icpList.socket.message + '_run_mcu_update', (event, result) => {
  748. console.log('run_mcu_updat print_time:'+new Date().toLocaleString()) // 打印当前时间
  749. console.log('run_mcu_update print_time:'+JSON.stringify(result))
  750. if(result.code === 0){
  751. if(result.data?.file_path){
  752. if( lastPhoto.value?.file_path == result.data?.file_path) return;
  753. if(runAction.value.goods_art_no === result.data?.goods_art_no){
  754. showlastPhoto.value = true
  755. goodsList.value.map(item=>{
  756. if(item.goods_art_no === result.data?.goods_art_no){
  757. console.log('========item');
  758. console.log(item);
  759. item.items[result.data.image_index].PhotoRecord.image_path = result.data?.file_path
  760. result.data.action_name = item.items[result.data.image_index].action_name
  761. setTimeout(()=>{
  762. item.items[result.data.image_index].PhotoRecord.image_path = result.data?.file_path
  763. },1000)
  764. console.log(item);
  765. console.log( goodsList.value);
  766. }
  767. })
  768. // getPhotoRecords()
  769. setTimeout(()=>{
  770. getPhotoRecords()
  771. },2000)
  772. }
  773. lastPhoto.value = result.data
  774. }
  775. }else if(result.msg) {
  776. ElMessage.error(result.msg)
  777. }
  778. })
  779. /**
  780. * 打开主图详情页面。
  781. */
  782. function openPhotographyDetail() {
  783. if(runLoading.value || takePictureLoading.value){
  784. ElMessage.error('正在拍摄中,请稍候')
  785. return;
  786. }
  787. const { href } = Router.resolve({
  788. name: 'PhotographyDetail',
  789. query:{
  790. goods_art_nos:goodsList.value.map(item=>item.goods_art_no),
  791. }
  792. })
  793. clientStore.ipc.removeAllListeners(icpList.utils.openMain);
  794. let params = {
  795. title: '主图与详情生成',
  796. width: 1000,
  797. height: 630,
  798. frame: true,
  799. id: "PhotographyDetail",
  800. url: getRouterUrl(href)
  801. }
  802. clientStore.ipc.send(icpList.utils.openMain, params);
  803. }
  804. /*高级生成*/
  805. const onGenerateCLick = (menu,item)=>{
  806. if(menu.name === '历史记录'){
  807. menu.click()
  808. return
  809. }
  810. const firstWithImagePath = item.items.find(
  811. (image) => image.PhotoRecord.image_path
  812. );
  813. if (firstWithImagePath) {
  814. menu.click({
  815. query:{
  816. image_path:firstWithImagePath.PhotoRecord.image_path
  817. }
  818. })
  819. } else {
  820. menu.click()
  821. }
  822. }
  823. </script>
  824. <style lang="scss">
  825. .shot-image-popper {
  826. width: calc(100vw - 370px) !important;
  827. left: 20px !important;
  828. top: 50px !important;
  829. height: calc(100vh - 70px) !important;
  830. transform: translate(0px, 0px) !important;
  831. .el-image {
  832. width: 100%;
  833. height:100%;
  834. display: block;
  835. .el-image__inner {
  836. width: 100%;
  837. height:100%;
  838. display: block;
  839. }
  840. }
  841. }
  842. </style>
  843. <style scoped lang="scss">
  844. .photography-page {
  845. background-color: rgba(255, 255, 255, 1);
  846. position: relative;
  847. .main-container {
  848. position: relative;
  849. display: flex;
  850. .content-wrapper {
  851. flex-grow: 1 ;
  852. position: relative;
  853. top: 0;
  854. left: 0;
  855. right: 0;
  856. bottom: 0;
  857. margin: auto;
  858. justify-content: center;
  859. .step-number {
  860. background-color: rgba(22, 119, 255, 1);
  861. border-radius: 50%;
  862. height: 32px;
  863. margin-top: 51px;
  864. width: 32px;
  865. .text_22 {
  866. width: 6px;
  867. height: 22px;
  868. overflow-wrap: break-word;
  869. color: rgba(255, 255, 255, 1);
  870. font-size: 14px;
  871. font-weight: NaN;
  872. text-align: right;
  873. white-space: nowrap;
  874. line-height: 22px;
  875. margin: 5px 0 0 13px;
  876. }
  877. }
  878. .step-one {
  879. width: 426px;
  880. height: 521px;
  881. margin: 55px 0 0 5px;
  882. .step-header {
  883. width: 391px;
  884. height: 24px;
  885. margin-left: 3px;
  886. .step-title {
  887. width: 160px;
  888. height: 24px;
  889. overflow-wrap: break-word;
  890. color: rgba(0, 0, 0, 0.85);
  891. font-size: 16px;
  892. font-family: PingFangSC-Medium;
  893. font-weight: 500;
  894. text-align: left;
  895. white-space: nowrap;
  896. line-height: 24px;
  897. }
  898. .step-icon {
  899. width: 32px;
  900. height: 20px;
  901. margin-top: 4px;
  902. }
  903. .step-divider {
  904. width: 191px;
  905. height: 1px;
  906. margin: 13px 0 0 8px;
  907. }
  908. }
  909. .step-content {
  910. width: 426px;
  911. height: 469px;
  912. margin-top: 28px;
  913. .method-container {
  914. background-color: rgba(247, 247, 247, 1);
  915. height: 484px;
  916. width: 353px;
  917. .auto-method {
  918. width: 253px;
  919. height: 24px;
  920. margin: 28px 0 0 14px;
  921. .text-method-tag {
  922. background-color: rgba(0, 174, 30, 1);
  923. height: 24px;
  924. width: 65px;
  925. .text_4 {
  926. width: 56px;
  927. height: 20px;
  928. overflow-wrap: break-word;
  929. color: rgba(255, 255, 255, 1);
  930. font-size: 14px;
  931. font-family: PingFangSC-Semibold;
  932. font-weight: 600;
  933. text-align: left;
  934. white-space: nowrap;
  935. line-height: 20px;
  936. margin: 2px 0 0 4px;
  937. }
  938. }
  939. .method-description {
  940. width: 182px;
  941. height: 20px;
  942. overflow-wrap: break-word;
  943. color: rgba(71, 71, 71, 1);
  944. font-size: 14px;
  945. font-family: PingFangSC-Semibold;
  946. font-weight: 600;
  947. text-align: left;
  948. white-space: nowrap;
  949. line-height: 20px;
  950. margin-top: 2px;
  951. }
  952. }
  953. .scan-method {
  954. width: 350px;
  955. height: 350px;
  956. margin: 10px;
  957. .remote-control {
  958. width: 350px;
  959. height: 350px;
  960. background: url(@/assets/images/Photography/left.png) 0px 0px no-repeat;
  961. background-size: 300px 300px;
  962. position: relative;
  963. .scan-button {
  964. background-color: rgba(0, 174, 30, 1);
  965. border-radius: 50%;
  966. width: 27px;
  967. height: 27px;
  968. margin: 27px 0 0 34px;
  969. }
  970. .scan-line {
  971. position: absolute;
  972. left: 52px;
  973. top: 40px;
  974. width: 112px;
  975. height: 1px;
  976. }
  977. }
  978. .scan-label {
  979. width: 96px;
  980. height: 22px;
  981. overflow-wrap: break-word;
  982. color: rgba(0, 174, 30, 1);
  983. font-size: 16px;
  984. font-family: PingFangSC-Semibold;
  985. font-weight: 600;
  986. text-align: left;
  987. white-space: nowrap;
  988. line-height: 22px;
  989. margin-top: 30px;
  990. }
  991. }
  992. .manual-method {
  993. width: 155px;
  994. height: 24px;
  995. margin: 53px 0 0 14px;
  996. .method-tag {
  997. background-color: rgba(0, 148, 174, 1);
  998. height: 24px;
  999. width: 65px;
  1000. .text_7 {
  1001. width: 56px;
  1002. height: 20px;
  1003. overflow-wrap: break-word;
  1004. color: rgba(255, 255, 255, 1);
  1005. font-size: 14px;
  1006. font-family: PingFangSC-Semibold;
  1007. font-weight: 600;
  1008. text-align: left;
  1009. white-space: nowrap;
  1010. line-height: 20px;
  1011. margin: 2px 0 0 4px;
  1012. }
  1013. }
  1014. .method-description {
  1015. width: 84px;
  1016. height: 20px;
  1017. overflow-wrap: break-word;
  1018. color: rgba(71, 71, 71, 1);
  1019. font-size: 14px;
  1020. font-family: PingFangSC-Semibold;
  1021. font-weight: 600;
  1022. text-align: left;
  1023. white-space: nowrap;
  1024. line-height: 20px;
  1025. margin-top: 2px;
  1026. }
  1027. }
  1028. .input-container {
  1029. width: calc(100% - 20px );
  1030. height: 36px;
  1031. margin: 20px 10px 0;
  1032. .input-item {
  1033. :deep(.el-input__inner){
  1034. height: 36px;
  1035. line-height: 36px;
  1036. }
  1037. }
  1038. }
  1039. }
  1040. .remote-image {
  1041. width: 61px;
  1042. height: 38px;
  1043. margin-top: 216px;
  1044. }
  1045. }
  1046. }
  1047. .step-two {
  1048. width: 384px;
  1049. height: 521px;
  1050. margin: 55px 0 0 7px;
  1051. .step-title {
  1052. width: 384px;
  1053. height: 24px;
  1054. overflow-wrap: break-word;
  1055. color: rgba(0, 0, 0, 0.85);
  1056. font-size: 16px;
  1057. font-family: PingFangSC-Medium;
  1058. font-weight: 500;
  1059. text-align: left;
  1060. white-space: nowrap;
  1061. line-height: 24px;
  1062. }
  1063. .shooting-container {
  1064. background-color: rgba(247, 247, 247, 1);
  1065. width: 353px;
  1066. height: 484px;
  1067. margin: 28px 0 0 2px;
  1068. .remote-control-wrap {
  1069. width: 353px;
  1070. height: 300px;
  1071. }
  1072. .shooting-tips {
  1073. width: 325px;
  1074. height: 40px;
  1075. margin: 12px 0 0 15px;
  1076. .info-icon {
  1077. width: 16px;
  1078. height: 16px;
  1079. margin-top: 2px;
  1080. }
  1081. .tips-text {
  1082. width: 302px;
  1083. height: 40px;
  1084. overflow-wrap: break-word;
  1085. color: rgba(255, 76, 0, 1);
  1086. font-size: 14px;
  1087. font-weight: NaN;
  1088. text-align: left;
  1089. line-height: 20px;
  1090. }
  1091. }
  1092. .left-foot-text {
  1093. width: 240px;
  1094. height: 22px;
  1095. overflow-wrap: break-word;
  1096. color: rgba(0, 174, 30, 1);
  1097. font-size: 16px;
  1098. font-family: PingFangSC-Semibold;
  1099. font-weight: 600;
  1100. text-align: left;
  1101. white-space: nowrap;
  1102. line-height: 22px;
  1103. margin: 36px 0 0 9px;
  1104. }
  1105. .remote-control-container {
  1106. position: relative;
  1107. width: 280px;
  1108. height: 298px;
  1109. margin: 9px 0 0 35px;
  1110. .remote-buttons {
  1111. width: 206px;
  1112. height: 233px;
  1113. background: url(@/assets/images/Photography/right-button.png) 100% no-repeat;
  1114. background-size: 100% 100%;
  1115. margin: 30px 0 0 37px;
  1116. .left-button {
  1117. background-color: rgba(0, 174, 30, 1);
  1118. border-radius: 50%;
  1119. width: 55px;
  1120. height: 55px;
  1121. margin: 91px 0 0 1px;
  1122. }
  1123. .right-button {
  1124. background-color: rgba(0, 148, 174, 1);
  1125. border-radius: 50%;
  1126. width: 55px;
  1127. height: 55px;
  1128. margin: 91px 2px 0 93px;
  1129. }
  1130. }
  1131. .left-button-image {
  1132. width: 40px;
  1133. height: 148px;
  1134. margin: 150px 0 0 -3px;
  1135. }
  1136. .right-button-image {
  1137. position: absolute;
  1138. left: 0;
  1139. top: 0;
  1140. width: 40px;
  1141. height: 148px;
  1142. }
  1143. }
  1144. .right-foot-text {
  1145. width: 240px;
  1146. height: 22px;
  1147. overflow-wrap: break-word;
  1148. color: rgba(0, 148, 174, 1);
  1149. font-size: 16px;
  1150. font-family: PingFangSC-Semibold;
  1151. font-weight: 600;
  1152. text-align: left;
  1153. white-space: nowrap;
  1154. line-height: 22px;
  1155. margin: 12px 0 18px 98px;
  1156. }
  1157. }
  1158. }
  1159. }
  1160. .camera-image {
  1161. position: absolute;
  1162. left: 620px;
  1163. top: 220px;
  1164. width: 111px;
  1165. height: 111px;
  1166. }
  1167. .step-number-two {
  1168. background-color: rgba(22, 119, 255, 1);
  1169. border-radius: 50%;
  1170. height: 32px;
  1171. width: 32px;
  1172. position: absolute;
  1173. left: 450px;
  1174. top: 51px;
  1175. .step-text {
  1176. width: 9px;
  1177. height: 22px;
  1178. overflow-wrap: break-word;
  1179. color: rgba(255, 255, 255, 1);
  1180. font-size: 14px;
  1181. font-weight: NaN;
  1182. text-align: right;
  1183. white-space: nowrap;
  1184. line-height: 22px;
  1185. margin: 5px 0 0 12px;
  1186. }
  1187. }
  1188. }
  1189. }
  1190. .history-section {
  1191. background-color: rgba(234, 236, 237, 1);
  1192. width: 332px;
  1193. height: calc(100vh - 30px);
  1194. &.koutu-section {
  1195. width: 100%;
  1196. .reset-button {
  1197. display: none !important;
  1198. }
  1199. }
  1200. .history-title {
  1201. width: calc(100% - 20px);
  1202. height: 22px;
  1203. overflow-wrap: break-word;
  1204. color: rgba(51, 51, 51, 1);
  1205. font-size: 16px;
  1206. font-family: PingFangSC-Semibold;
  1207. font-weight: 600;
  1208. text-align: center;
  1209. white-space: nowrap;
  1210. line-height: 22px;
  1211. margin: 9px 0 0 10px;
  1212. }
  1213. .divider-line {
  1214. width: 100%;
  1215. height: 1px;
  1216. margin-top: 9px;
  1217. }
  1218. .history-warp {
  1219. flex-grow: 1;
  1220. overflow: auto;
  1221. height: calc(100% - 125px);
  1222. .history-item {
  1223. .history-item_image_wrap {
  1224. padding-bottom: 20px;
  1225. border-bottom: 1px solid #CCCCCC;
  1226. }
  1227. .history-item_image {
  1228. .tag {
  1229. color: #bbb;
  1230. position: absolute;
  1231. left: 0;
  1232. right: 0;
  1233. top:50%;
  1234. margin-top: -15px;
  1235. line-height: 20px;
  1236. }
  1237. /* &:nth-child(1)::before{
  1238. content:"俯视图";
  1239. }
  1240. &:nth-child(2)::before{
  1241. content:"侧视图";
  1242. }
  1243. &:nth-child(3)::before{
  1244. content:"后视图";
  1245. }
  1246. &:nth-child(4)::before{
  1247. content:"鞋底";
  1248. }
  1249. &:nth-child(5)::before{
  1250. content:"内里";
  1251. }*/
  1252. position: relative;
  1253. width: 70px;
  1254. height: 70px;
  1255. float: left;
  1256. margin: 6px 0 0 6px;
  1257. background: #F7F7F7;
  1258. .el-image {
  1259. display: block;
  1260. width:100%;
  1261. height: 100%;
  1262. }
  1263. &:first-child {
  1264. width: 146px;
  1265. height: 146px;
  1266. }
  1267. &.el-loading-parent--relative{
  1268. ::v-deep {
  1269. .el-loading-mask { display: none}
  1270. }
  1271. }
  1272. }
  1273. .el-image_view {
  1274. display: flex;
  1275. width: 100%;
  1276. height: 100%;
  1277. .reset-button {
  1278. width: 40px;
  1279. text-align: center;
  1280. height: 20px;
  1281. position: absolute;
  1282. left:50%;
  1283. top:50%;
  1284. padding: 0px;
  1285. margin-left:-20px;
  1286. margin-top:-10px;
  1287. color: #ffffff;
  1288. font-size: 14px;
  1289. background: rgba(0,0,0,0.6);
  1290. border-radius: 12px;
  1291. display: none;
  1292. cursor: pointer;
  1293. }
  1294. &:hover {
  1295. .reset-button {
  1296. display: block;
  1297. }
  1298. }
  1299. }
  1300. p:first-of-type {
  1301. ::v-deep {
  1302. .el-loading-mask { display: block !important;}
  1303. }
  1304. }
  1305. }
  1306. }
  1307. .empty-state {
  1308. width: 56px;
  1309. height: 48px;
  1310. .empty-icon {
  1311. width: 32px;
  1312. height: 18px;
  1313. margin-left: 12px;
  1314. }
  1315. .empty-text {
  1316. width: 56px;
  1317. height: 20px;
  1318. overflow-wrap: break-word;
  1319. color: rgba(153, 153, 153, 1);
  1320. font-size: 14px;
  1321. font-weight: NaN;
  1322. text-align: left;
  1323. white-space: nowrap;
  1324. line-height: 20px;
  1325. margin-top: 10px;
  1326. }
  1327. }
  1328. .next-step {
  1329. height: 50px;
  1330. background-size: 100% 100%;
  1331. width: 100%;
  1332. line-height: 50px;
  1333. .next-step-text {
  1334. width: 100%;
  1335. overflow-wrap: break-word;
  1336. color: rgba(255, 255, 255, 1);
  1337. font-weight: NaN;
  1338. text-align: center;
  1339. white-space: nowrap;
  1340. }
  1341. }
  1342. }
  1343. .last-photo{
  1344. position: fixed;
  1345. left: 20px;
  1346. top: 50px;
  1347. bottom: 20px;
  1348. right: 350px;
  1349. z-index: 10;
  1350. }
  1351. </style>