Browse Source

添加声音

shish 2 years ago
parent
commit
8b403aa634

+ 1 - 1
ghs/src/mixins/product2.js

@@ -310,7 +310,7 @@ export default {
 				currentNum = currentNum.toFixed(2)
 				console.log(currentCount+' '+currentNum)
 				if (Number(currentCount) > Number(currentNum)) {
-					//this.$util.noStockRemind()
+					this.noStockPlay()
 					this.$message({message: '库存不足哦',type: 'warning'})
 					return
 				}

BIN
ghs/src/static/hit.mp3


BIN
ghs/src/static/noStock.mp3


BIN
ghs/src/static/success1.mp3


BIN
ghs/src/static/success2.mp3


BIN
ghs/src/static/success3.mp3


+ 17 - 0
ghs/src/views/order/add.vue

@@ -16,6 +16,9 @@
         <span>删除:Delete</span>
         <span>删除所有:Page Down</span>
       </p>
+      <audio ref="hitPlay"><source src="@/static/hit.mp3" type="audio/mpeg"></audio>
+      <audio ref="noStockPlay"><source src="@/static/noStock.mp3" type="audio/mpeg"></audio>
+      <audio ref="successPlay"><source src="@/static/success1.mp3" type="audio/mpeg"></audio>
       <el-table ref="singleTable" :data="selectList" highlight-current-row style="width:84%" border :header-cell-style="{background:'#fdfdfd', color: '#01060a', fontWeight:800}" 
       class="tableBox active" @row-click="pickModifyItem" height="730">
         <el-table-column prop="id" label="编号" width="120" align="center"></el-table-column>
@@ -446,6 +449,18 @@ export default {
 
   },
   methods: {
+    hitPlay() {
+      const hitPlay = this.$refs.hitPlay;
+      hitPlay.play()
+    },
+    noStockPlay() {
+      const noStockPlay = this.$refs.noStockPlay;
+      noStockPlay.play()
+    },
+    successPlay() {
+      const successPlay = this.$refs.successPlay;
+      successPlay.play()
+    },
     delItem(current){
       let that = this
         that.$refs['itemSearchRef'].blur()
@@ -560,6 +575,7 @@ export default {
             that.$nextTick(()=>{
               that.selectList = [];
               that.diffList = []
+              that.successPlay()
               that.removeFromSaveDirect()
               that.showCommitPop = false;
               that.$notify({ title: '成功', message: '开单成功', type: 'success'})
@@ -695,6 +711,7 @@ export default {
       sumPrice = parseFloat(sumPrice.toFixed(2))
       currentItem = {...currentItem,bigCount:this.customData.bigCount,userPrice:this.customData.userPrice,smallCount:this.customData.smallCount,sumPrice:sumPrice}     
       this.replaceItemFn(currentItem,1,'add')
+      this.hitPlay()
       this.backToSearchItem();
     },
     backToSearchItem(){