diff --git a/src/permission.js b/src/permission.js index 6034239..7113b17 100644 --- a/src/permission.js +++ b/src/permission.js @@ -6,6 +6,7 @@ import 'nprogress/nprogress.css' import {getToken} from '@/utils/auth' import {isRelogin} from '@/utils/request' + NProgress.configure({showSpinner: false}) const whiteList = ['/login', '/register'] diff --git a/src/router/index.js b/src/router/index.js index a35c89a..dc4d7a1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -86,6 +86,18 @@ export const constantRoutes = [ meta: {title: '商品详情', icon: 'dashboard', affix: true} } ] + },{ + path: '', + component: Layout, + redirect: 'shopindex', + children: [ + { + path: 'shopindex', + component: () => import('@/views/shopCart/info/detail/index'), + name: 'shopindex', + meta: {title: '购物车', icon: 'dashboard', affix: true} + } + ] }, // { // path: '/gb', diff --git a/src/views/product/info/detail/index.vue b/src/views/product/info/detail/index.vue index f4a99f0..f501f83 100644 --- a/src/views/product/info/detail/index.vue +++ b/src/views/product/info/detail/index.vue @@ -83,7 +83,7 @@ - + @@ -95,7 +95,7 @@ - 加入购物车 + 加入购物车 立即购买 @@ -121,16 +121,6 @@ {{attributeMap[attributeInfo.id]}} - - - - {{attributeMap[attributeInfo.id]}} - - - - @@ -200,6 +190,15 @@ export default { } }, methods:{ + addCart(){ + addInfo(this.form).then(responser => { + console.log(responser) + }) + }, + // ShopingCardAdd(){ + // console.log("用户信息",this.receivedShop) + // this.$router.push('shopCart/info/detail') + // }, updateNum() { this.num = this.price * this.form.num console.log("qqqqq",this.num) @@ -221,7 +220,7 @@ export default { }, selectRuleSku(){ - let ruleSize =this.receivedShop.ruleAttrAddModelList.length + let ruleSize =this.receivedShop.ruleAttrModelList.length let sku = ""; for (let index = 0 ; ;index++){ sku +=this.form['rule'+index] @@ -230,6 +229,7 @@ export default { } sku += "-"; } + this.form.projectSku=sku; this.checkSkuInfo= this.receivedShop.projectSkuInfoList.find(skuInfo => skuInfo.sku === sku) console.log("sdf",this.checkSkuInfo) console.log("ppp",this.checkSkuInfo.price) @@ -246,13 +246,13 @@ export default { let key =productAttributeInfo.attributeId; this.attributeMap[key] = productAttributeInfo["value"] }) - - let ruleAttrLength = this.receivedShop.ruleAttrAddModelList.length; + this.form.projectId= this.receivedShop.projectInfo.id + let ruleAttrLength = this.receivedShop.ruleAttrModelList.length; console.log("hieng",ruleAttrLength) for (let index = 0 ;index < ruleAttrLength ;index++){ this.form["rule"+index] = null } - console.log("shjo",this.receivedShop.ruleAttrAddModelList) + console.log("shjo",this.receivedShop.ruleAttrModelList) this.initSku() }) }, @@ -270,12 +270,12 @@ export default { // this.attributeMap[key] = productAttributeInfo["value"] // }) // - // let ruleAttrLength = this.receivedShop.ruleAttrAddModelList.length; + // let ruleAttrLength = this.receivedShop.ruleAttrModelList.length; // console.log("hieng",ruleAttrLength) // for (let index = 0 ;index < ruleAttrLength ;index++){ // this.form["rule"+index] = null // } - // console.log("shjo",this.receivedShop.ruleAttrAddModelList) + // console.log("shjo",this.receivedShop.ruleAttrModelList) // this.initSku() // }, }, diff --git a/src/views/product/info/index.vue b/src/views/product/info/index.vue index a085e02..1866b0b 100644 --- a/src/views/product/info/index.vue +++ b/src/views/product/info/index.vue @@ -780,7 +780,6 @@ export default { handleUpdate(row) { this.reset(); const id = row.id || this.ids - getInfo(id).then(response => { console.log("response",response) this.respData = response.data.asProductAttributeInfos diff --git a/src/views/shopCart/info/detail/index.vue b/src/views/shopCart/info/detail/index.vue new file mode 100644 index 0000000..438eecc --- /dev/null +++ b/src/views/shopCart/info/detail/index.vue @@ -0,0 +1,103 @@ + + +