Просмотр исходного кода

修改多规格确定按钮判断

xuqiaoying 3 лет назад
Родитель
Сommit
a0b669450c
2 измененных файлов с 8 добавлено и 4 удалено
  1. 2 2
      src/axios.js
  2. 6 2
      src/components/goodsItem/IndexSkuDialog.vue

+ 2 - 2
src/axios.js

@@ -4,9 +4,9 @@ import { Message } from 'element-ui'
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-export const BASE_URL = 'http://192.168.1.7:5055'    //dev
+// export const BASE_URL = 'http://192.168.1.7:5055'    //dev
 // export const BASE_URL = 'http://192.168.1.24:5055'    //dev
-// export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
+export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //测试
 export const tenantId = '867735392558919680'

+ 6 - 2
src/components/goodsItem/IndexSkuDialog.vue

@@ -34,7 +34,7 @@
                 </div>
             </div>
             <span slot="footer" class="dialog-footer">
-                <el-button type="primary" size="small" @click="confirms()">确 定</el-button>
+                <el-button type="primary" size="small" :disabled="Object.keys(skuItem).length == 0 || specList.length != isCheckSku" @click="confirms()">确 定</el-button>
             </span>
         </el-dialog>
     </div>
@@ -111,7 +111,6 @@ export default {
 							})
 						})
 					}
-                    console.log('this.specList :', this.specList )
 				}
 			}).catch(() => {
                 this.loading = false
@@ -152,9 +151,14 @@ export default {
                 this.loading = false
 				if (res.code == 200) {
 					this.skuItem = res.data || {}
+				} else {
+					this.skuItem = {}
+					this.$message.warning('该规格属性下没有设置商品')
 				}
 			}).catch((err) => {
                 this.loading = false
+				this.skuItem = {}
+				this.$message.warning('该规格属性下没有设置商品')
             })
 		},
         confirms() {