shish 2 лет назад
Родитель
Сommit
dd401e465b
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      ghsApp/src/pagesPurchase/add.vue

+ 13 - 0
ghsApp/src/pagesPurchase/add.vue

@@ -58,6 +58,8 @@
 						<view v-if="customData.aboutPrice == 1" style="margin-top:16upx;text-align:center;color:blue;font-size:26upx;">单价为近似值</view>
 						<view v-else style="margin-top:16upx;text-align:center;font-size:26upx;">----</view>
 					</view>
+					<image @click="switchUnitType" :src="`${constant.imgUrl}/icon/switch/switch128.png`" mode="widthFix" 
+					style="width:60upx;height:60upx;position:absolute;top:32upx;left:30upx;" ></image>
 				</view>
 			</template>
 		</modal-module>
@@ -159,6 +161,17 @@ export default {
 		})
 	},
 	methods: {
+		switchUnitType(){
+			if(this.cgUnitType == 0){
+				this.cgUnitType = 1
+				this.customData.userPrice = parseFloat(this.customData.smallPrice)
+				this.customData.bigCount = null
+			}else{
+				this.cgUnitType = 0
+				this.customData.userPrice = parseFloat(this.customData.bigPrice)
+				this.customData.smallCount = null
+			}
+		},
 		totalPriceChange(){
 			if(Number(this.customData.totalPrice)>0){
 				if(this.cgUnitType == 0){