Browse Source

1.添加/admin** 后台管理页面映射。2.店铺首页商品推荐图片显示调整。3.立即购买和加入购物车初步调整。

yangc 8 years ago
parent
commit
fdbdf96528
2 changed files with 24 additions and 9 deletions
  1. 23 8
      components/common/buyOrCar/buyComponent.vue
  2. 1 1
      nuxt.config.js

+ 23 - 8
components/common/buyOrCar/buyComponent.vue

@@ -25,10 +25,17 @@
               this.$http.post('trade/order/buyNow', [{
                 uuid: this.item.uuid,
                 batchCode: this.item.batchCode,
-                number: this.item.minBuyQty
+                number: this.item.minBuyQty,
+                storeid: this.item.storeid,
+                currencyName: this.item.currencyName
               }])
                 .then(response => {
-                  window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
+          //        window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
+                  if (response.data.message) {
+                    this.$message.error(response.data.message)
+                  } else {
+                    window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.data.orderid)
+                  }
                 }, err => {
                   console.log(err)
                 })
@@ -37,15 +44,23 @@
               this.$http.post('trade/cart/add', {
                 uuid: this.item.uuid,
                 batchCode: this.item.batchCode,
-                number: this.item.minBuyQty
+                number: this.item.minBuyQty,
+                storeid: this.item.storeid,
+                currencyName: this.item.currencyName
               })
                 .then(response => {
-                  console.log(response.data)
                   if (response.data.success) {
-                    this.$message({
-                      message: '添加购物车成功',
-                      type: 'success'
-                    })
+                    if (response.data.message) {
+                      this.$message({
+                        message: response.data.message,
+                        type: 'success'
+                      })
+                    } else {
+                      this.$message({
+                        message: '添加购物车成功',
+                        type: 'success'
+                      })
+                    }
                   } else {
                     this.$message.error(response.data.message)
                     // console.log(response.data.message)

+ 1 - 1
nuxt.config.js

@@ -106,5 +106,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**']
 }