Sfoglia il codice sorgente

Merge branch 'master' of https://git.bjtdba.com/shop/H5-Merchant

xialei 1 anno fa
parent
commit
95c3e654c9

+ 1 - 1
commit/requestPhp.js

@@ -7,7 +7,7 @@ export let baseURL = 'https://testapi.hxxfb.com/'
7 7
 const timeout = 50000
8 8
 // const token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuaHh4ZmIuY29tIiwiYXVkIjoiYXBpLmh4eGZiLmNvbSIsImlhdCI6MTc0MDM3MTM1NSwibmJmIjoxNzQwMzcxMzU1LCJleHAiOjE3NTExNzEzNTUsImp0aSI6WzI5OCwibWVyIl19.j2f8VwdwWY4zBpcijHntzUZ9YUms2SxChaVsYf7KnPs"
9 9
 // const token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzaG9wLmh4eGZiLmNvbSIsImF1ZCI6InNob3AuaHh4ZmIuY29tIiwiaWF0IjoxNzQwNTY5NDI3LCJuYmYiOjE3NDA1Njk0MjcsImV4cCI6MTc1MTM2OTQyNywianRpIjpbMzU0LCJtZXIiXX0.aZrICBozUFC0lvqxHgJMKFdhQlDHG1eC9UVAPzDHs5s"
10
-// const token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuaHh4ZmIuY29tIiwiYXVkIjoiYXBpLmh4eGZiLmNvbSIsImlhdCI6MTc0MDU3MTQ0OCwibmJmIjoxNzQwNTcxNDQ4LCJleHAiOjE3NTEzNzE0NDgsImp0aSI6WzM1NCwibWVyIl19.PVwYv71Gq9RxTxQclUoFMgc8cZt0ju3zQkxk6SGCQJw"
10
+// const token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ0ZXN0YXBpLmh4eGZiLmNvbSIsImF1ZCI6InRlc3RhcGkuaHh4ZmIuY29tIiwiaWF0IjoxNzQxNDA1MzY3LCJuYmYiOjE3NDE0MDUzNjcsImV4cCI6MTc1MjIwNTM2NywianRpIjpbMzEyOSwibWVyIl19.CQ206TpfwaY5mkwiETjAPWExLh1uh4mAf2Vy9uhvTRQ"
11 11
 const token = ""
12 12
 export const phpToken = uni.getStorageSync('phpToken') || token
13 13
 // 需要修改token,和根据实际修改请求头

+ 9 - 3
shop/productManagementModule/addProduct.vue

@@ -594,12 +594,18 @@ export default {
594 594
       this.formData.extension_type = val;
595 595
       const _this = this;
596 596
       this.attrValue[0].modules.forEach((item) => {
597
-        _this.$set(item, "value", _this.base_commission);
597
+        if (item.props === "extension_one") {
598
+          _this.$set(item, "value", _this.base_commission);
599
+        } else {
600
+          _this.$set(item, "value", item.value);
601
+        }
598 602
       });
603
+      this.priceDefault = "0.00"
599 604
     },
600 605
     changeInputHandle(ev, its, item, idx) {
601
-      if (its.props == "cost") {
602
-        let modulesData = item.modules[0];
606
+      if (its.props == "cost" || its.props == "extension_one") {
607
+        let modulesData =
608
+          item.modules.find((item) => item.props == "extension_one") || {};
603 609
         let extension_one =
604 610
           modulesData.props == "extension_one"
605 611
             ? modulesData.value

+ 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() {