storeBelieveInLight 1 year ago
parent
commit
78ee2f3008
1 changed files with 71 additions and 67 deletions
  1. 71 67
      shop/services/setting.vue

+ 71 - 67
shop/services/setting.vue

@@ -18,13 +18,13 @@
18 18
 			<view class="">
19 19
 				商户分润比例
20 20
 			</view>
21
-			<view class="setting-shehi-bili">
22
-				
23
-				<!-- <view class="process-zhuti-yi-input"> -->
24
-					<!-- <picker class="process-zhuti-yi-picker" @change="changeFenRunBiLi" :value="FenRunBiLiListindex" :range="fenRunList" :range-key="'num'"> -->
25
-						<!-- <view v-if="FenRunBiLiListindex === 1" class="uni-input int-col">30%</view> -->
26
-			<!-- 			<view class="uni-input">{{fenRunList[FenRunBiLiListindex].num}}</view>
27
-					</picker> -->
21
+			<view class="setting-shehi-bili">
22
+				
23
+				<!-- <view class="process-zhuti-yi-input"> -->
24
+					<!-- <picker class="process-zhuti-yi-picker" @change="changeFenRunBiLi" :value="FenRunBiLiListindex" :range="fenRunList" :range-key="'num'"> -->
25
+						<!-- <view v-if="FenRunBiLiListindex === 1" class="uni-input int-col">30%</view> -->
26
+			<!-- 			<view class="uni-input">{{fenRunList[FenRunBiLiListindex].num}}</view>
27
+					</picker> -->
28 28
 				<!-- </view> -->
29 29
 				<input style="width: 30px;" maxlength="3" v-model="systemConfig.value" value=""
30 30
 					@input="inputphone" />%
@@ -45,7 +45,7 @@
45 45
 <script>
46 46
 	import {
47 47
 		queyrConfig,
48
-		updateShopBonusSetting,
48
+		updateShopBonusSetting,
49 49
 		getShopBonusSetting
50 50
 	} from '@/commit/config.js'
51 51
 	export default {
@@ -54,27 +54,27 @@
54 54
 				// value: "20",
55 55
 				systemConfig: [],
56 56
 				merid: '',
57
-				key: "base_commission",
58
-				
59
-				fenRunList: [{num:'30%'},{num:'35%'},{num:'40%'},{num:'45%'},{num:'50%'},{num:'55%'},{num:'60%'},{num:'65%'},{num:'70%'},{num:'75%'},{num:'80%'},{num:'85%'},{num:'90%'},{num:'95%'},{num:'100%'}],
60
-				paramsList:[
61
-					{shop_bonus_rate:30,yanglao_rate:5},
62
-					{shop_bonus_rate:35,yanglao_rate:6},
63
-					{shop_bonus_rate:40,yanglao_rate:7},
64
-					{shop_bonus_rate:45,yanglao_rate:8},
65
-					{shop_bonus_rate:50,yanglao_rate:9},
66
-					{shop_bonus_rate:55,yanglao_rate:10},
67
-					{shop_bonus_rate:60,yanglao_rate:11},
68
-					{shop_bonus_rate:65,yanglao_rate:12},
69
-					{shop_bonus_rate:70,yanglao_rate:13},
70
-					{shop_bonus_rate:75,yanglao_rate:14},
71
-					{shop_bonus_rate:80,yanglao_rate:15},
72
-					{shop_bonus_rate:85,yanglao_rate:16},
73
-					{shop_bonus_rate:90,yanglao_rate:17},
74
-					{shop_bonus_rate:95,yanglao_rate:18},
75
-					{shop_bonus_rate:100,yanglao_rate:19}
76
-				],
77
-				FenRunBiLiListindex: 0
57
+				key: "base_commission",
58
+				
59
+				fenRunList: [{num:'30%'},{num:'35%'},{num:'40%'},{num:'45%'},{num:'50%'},{num:'55%'},{num:'60%'},{num:'65%'},{num:'70%'},{num:'75%'},{num:'80%'},{num:'85%'},{num:'90%'},{num:'95%'},{num:'100%'}],
60
+				paramsList:[
61
+					{shop_bonus_rate:30,yanglao_rate:5},
62
+					{shop_bonus_rate:35,yanglao_rate:6},
63
+					{shop_bonus_rate:40,yanglao_rate:7},
64
+					{shop_bonus_rate:45,yanglao_rate:8},
65
+					{shop_bonus_rate:50,yanglao_rate:9},
66
+					{shop_bonus_rate:55,yanglao_rate:10},
67
+					{shop_bonus_rate:60,yanglao_rate:11},
68
+					{shop_bonus_rate:65,yanglao_rate:12},
69
+					{shop_bonus_rate:70,yanglao_rate:13},
70
+					{shop_bonus_rate:75,yanglao_rate:14},
71
+					{shop_bonus_rate:80,yanglao_rate:15},
72
+					{shop_bonus_rate:85,yanglao_rate:16},
73
+					{shop_bonus_rate:90,yanglao_rate:17},
74
+					{shop_bonus_rate:95,yanglao_rate:18},
75
+					{shop_bonus_rate:100,yanglao_rate:19}
76
+				],
77
+				FenRunBiLiListindex: 0
78 78
 				
79 79
 			}
80 80
 		},
@@ -85,7 +85,7 @@
85 85
 			this.merid = selectmerchant.merId
86 86
 			console.log('xxxxxxxxxxxx')
87 87
 			console.log(selectmerchant.merId)
88
-			this.queyrConfig()
88
+			this.queyrConfig()
89 89
 			this.getFenRun()
90 90
 		},
91 91
 		methods: {
@@ -105,41 +105,44 @@
105 105
 			inputphone(e) {
106 106
 				const o = e.target;
107 107
 				const inputRule = /[^\d.]/g
108
+				
108 109
 				this.$nextTick(function() {
109
-					this.systemConfig.value = o.value.replace(inputRule, '');
110
+					let dataValue = o.value.replace(inputRule, '');
111
+					this.systemConfig.value = dataValue
112
+				})
113
+			},
114
+			
115
+			
116
+			// 切换门店分润比例
117
+			changeFenRunBiLi(select) {
118
+				
119
+				this.FenRunBiLiListindex = select.detail.value;
120
+				
121
+			},
122
+			
123
+			// 获取门店分润比例
124
+			getFenRun() {
125
+				getShopBonusSetting({mer_id: this.merid}).then(res => {
126
+					console.log('--------xxx>', res.data)
127
+				}).catch(error => {
128
+					
110 129
 				})
111
-			},
112
-			
113
-			
114
-			// 切换门店分润比例
115
-			changeFenRunBiLi(select) {
116
-				
117
-				this.FenRunBiLiListindex = select.detail.value;
118
-				
119
-			},
120
-			
121
-			// 获取门店分润比例
122
-			getFenRun() {
123
-				getShopBonusSetting({mer_id: this.merid}).then(res => {
124
-					console.log('--------xxx>', res.data)
125
-				}).catch(error => {
126
-					
127
-				})
128
-			},
130
+			},
129 131
 			
130
-			addto() {
131
-				
132
-				let params = {
132
+			addto() {
133
+				
134
+				let params = {
133 135
 					// value: JSON.stringify(this.paramsList[this.FenRunBiLiListindex]),
134
-					value: this.systemConfig.value,
135
-					mer_id: this.merid
136
-				}
136
+					value: this.systemConfig.value,
137
+					mer_id: this.merid
138
+				}
137 139
 				
138 140
 				if(this.systemConfig.value < 5){
139 141
 					uni.showToast({
140 142
 						title: '不得小于百分之5',
141 143
 						icon: "error"
142 144
 					})
145
+					return
143 146
 				}
144 147
 				
145 148
 				if(this.systemConfig.value > 100){
@@ -147,19 +150,20 @@
147 150
 						title: '不得大于百分之100',
148 151
 						icon: "error"
149 152
 					})
153
+					return
150 154
 				}
151
-				
152
-				// 修改门店分润值
153
-				updateShopBonusSetting(params).then(res => {
154
-					console.log('params = ',params, 'res = ',res)
155
-					if (res.statusCode == 200) {
156
-						uni.showToast({
157
-							title: '设置成功',
158
-							icon: 'success',
159
-						})
160
-					}
161
-				}, fail => {
162
-					console.log(fail)
155
+				
156
+				// 修改门店分润值
157
+				updateShopBonusSetting(params).then(res => {
158
+					console.log('params = ',params, 'res = ',res)
159
+					if (res.statusCode == 200) {
160
+						uni.showToast({
161
+							title: '设置成功',
162
+							icon: 'success',
163
+						})
164
+					}
165
+				}, fail => {
166
+					console.log(fail)
163 167
 				})
164 168
 			},
165 169
 			topgi() {