ソースを参照

超级会员免运费修改

zhengjinyi 3 年 前
コミット
6eb87e3586
1 ファイル変更14 行追加12 行削除
  1. 14 12
      components/cm-module/creatOrder/freight.vue

+ 14 - 12
components/cm-module/creatOrder/freight.vue

@@ -3,7 +3,7 @@
 		 <!-- 运费信息 -->
 		<view class="invoice-freight">
 			<view class="freight-main">
-				<view class="freight-left">运费<text class="tips" v-if="freightData.postageFlag == 1">运费可选择到付哟~</text></view>
+				<view class="freight-left">运费<text class="tips" v-if="freightData.postageFlag == 1 && vipFlag!=1">运费可选择到付哟~</text></view>
 				<view class="freight-right" >
 					<view class="freight-text">{{freightText}}</view>
 					<view class="select" v-if="freightData.postageFlag == 1"  @click.stop="selectFreight">
@@ -32,7 +32,7 @@
 
 <script>
 	export default{
-		name:"freight",
+		name:'freight',
 		props:{
 			freightData:{
 				type:Object
@@ -51,7 +51,7 @@
 				userBeans:0,
 				deductionBeans:0,
 				freightBeansMoney:0,
-				
+				vipFlag:0
 			}
 		},
 		created(){
@@ -61,8 +61,10 @@
 
 		},
 		methods:{
-			initData(res) {
-				this.infoData = res;
+			async initData(res) {
+				const userInfo = await this.$api.getStorage()
+				this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
+				this.infoData = res
 				switch(res.postageFlag){
 					case 0:
 						this.freightText = '包邮'
@@ -108,7 +110,7 @@
 				}
 			},
 			selectFreight (){//切换运费
-				let self = this,value;
+				let self = this,value
 				uni.showActionSheet({
 				    itemList: self.optionList,
 				    success: function (res) {
@@ -150,19 +152,19 @@
 								postageFlag :self.postageFlag,
 								freightBeansMoney: self.freightBeansMoney
 							}
-						self.$emit('confirmFreight',obj);
+						self.$emit('confirmFreight',obj)
 				    },
 				    fail: function (res) {
-				        console.log(res.errMsg);
+				        console.log(res.errMsg)
 				    }
-				});
+				})
 			},
 			checkedBalabce(){//勾选使用采美豆抵扣
 				this.ischecked = !this.ischecked
-				this.$emit('confirmFreightBeans',this.ischecked);
+				this.$emit('confirmFreightBeans',this.ischecked)
 			},
 			orderPriceToFixed (value){
-				let price ='';
+				let price =''
 				if(value == '到付'){
 					price = value
 				}else{
@@ -175,7 +177,7 @@
 				this.selectClass = ''
 			},
 			showTip(){
-				this.$emit('showFreightAlert');
+				this.$emit('showFreightAlert')
 			},
 		}
 	}