Pārlūkot izejas kodu

设置分润更改

xialei 1 gadu atpakaļ
vecāks
revīzija
2d99c7f3a8
1 mainītis faili ar 30 papildinājumiem un 20 dzēšanām
  1. 30 20
      shop/services/setting.vue

+ 30 - 20
shop/services/setting.vue

@@ -20,14 +20,14 @@
20
 			</view>
20
 			</view>
21
 			<view class="setting-shehi-bili">
21
 			<view class="setting-shehi-bili">
22
 				
22
 				
23
-				<view class="process-zhuti-yi-input">
24
-					<picker class="process-zhuti-yi-picker" @change="changeFenRunBiLi" :value="FenRunBiLiListindex" :range="fenRunList" :range-key="'num'">
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> -->
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
-				</view>
29
-				<!-- <input style=" text-align: center;" maxlength="3" v-model="systemConfig.value" value=""
30
-					@input="inputphone" /> -->
26
+			<!-- 			<view class="uni-input">{{fenRunList[FenRunBiLiListindex].num}}</view>
27
+					</picker> -->
28
+				<!-- </view> -->
29
+				<input style=" text-align: center;" maxlength="3" v-model="systemConfig.value" value=""
30
+					@input="inputphone" />
31
 				<!-- <view class="" style="margin-right: 150rpx;">
31
 				<!-- <view class="" style="margin-right: 150rpx;">
32
 					30%
32
 					30%
33
 				</view> -->
33
 				</view> -->
@@ -83,6 +83,8 @@
83
 		onShow() {
83
 		onShow() {
84
 			let selectmerchant = uni.getStorageSync('selectmerchant')
84
 			let selectmerchant = uni.getStorageSync('selectmerchant')
85
 			this.merid = selectmerchant.merId
85
 			this.merid = selectmerchant.merId
86
+			console.log('xxxxxxxxxxxx')
87
+			console.log(selectmerchant.merId)
86
 			this.queyrConfig()
88
 			this.queyrConfig()
87
 			this.getFenRun()
89
 			this.getFenRun()
88
 		},
90
 		},
@@ -118,8 +120,8 @@
118
 			
120
 			
119
 			// 获取门店分润比例
121
 			// 获取门店分润比例
120
 			getFenRun() {
122
 			getFenRun() {
121
-				getShopBonusSetting({mer_id: this.merId}).then(res => {
122
-					console.log('-------->', res)
123
+				getShopBonusSetting({mer_id: this.merid}).then(res => {
124
+					console.log('--------xxx>', res.data)
123
 				}).catch(error => {
125
 				}).catch(error => {
124
 					
126
 					
125
 				})
127
 				})
@@ -128,29 +130,37 @@
128
 			addto() {
130
 			addto() {
129
 				
131
 				
130
 				let params = {
132
 				let params = {
131
-					value: JSON.stringify(this.paramsList[this.FenRunBiLiListindex]),
133
+					// value: JSON.stringify(this.paramsList[this.FenRunBiLiListindex]),
134
+					value: this.systemConfig.value,
132
 					mer_id: this.merid
135
 					mer_id: this.merid
133
 				}
136
 				}
137
+				
138
+				if(this.systemConfig.value < 5){
139
+					uni.showToast({
140
+						title: '不得小于百分之5',
141
+						icon: "error"
142
+					})
143
+				}
144
+				
145
+				if(this.systemConfig.value > 100){
146
+					uni.showToast({
147
+						title: '不得大于百分之100',
148
+						icon: "error"
149
+					})
150
+				}
134
 				
151
 				
135
 				// 修改门店分润值
152
 				// 修改门店分润值
136
 				updateShopBonusSetting(params).then(res => {
153
 				updateShopBonusSetting(params).then(res => {
137
-					
138
-					
139
 					console.log('params = ',params, 'res = ',res)
154
 					console.log('params = ',params, 'res = ',res)
140
-					
141
-					if (res.data.status == 200) {
142
-						
143
-						
144
-						
155
+					if (res.statusCode == 200) {
145
 						uni.showToast({
156
 						uni.showToast({
146
-							title: res.data.message,
157
+							title: '设置成功',
147
 							icon: 'success',
158
 							icon: 'success',
148
 						})
159
 						})
149
 					}
160
 					}
150
 				}, fail => {
161
 				}, fail => {
151
 					console.log(fail)
162
 					console.log(fail)
152
-				})
153
-				
163
+				})
154
 			},
164
 			},
155
 			topgi() {
165
 			topgi() {
156
 				uni.switchTab({
166
 				uni.switchTab({