Browse Source

add user_id param for api goods-detail

Jeffry Yu 7 years ago
parent
commit
73f7832302
1 changed files with 8 additions and 8 deletions
  1. 8 8
      Album/js/main.js

+ 8 - 8
Album/js/main.js

xqd xqd xqd xqd xqd
@@ -126,6 +126,7 @@ let startx = 0
 let starty = 0
 //agent_id
 let agent_id = 0
+let user_id = 0
 //状态 1 只选择热销 2 只选择最新上市 3只选择一个风格 4 同时选择热销和最新上市 5同时选择热销和风格 6同时选择最新上市和风格 7全选 0全不选
 let status = 0
 let style = 0
@@ -898,14 +899,7 @@ function callback3(res) {
 }
 function getGoodsDetail(callback4, GoodsSource) {
   //如果所点击的区域没有商品展示,那么不进入详情界面
-  let ur = 'https://t6.9026.com/api/album/goods-detail?store_id=1&agent_id=' + agent_id + '&goods_id='
-  try {
-    ur = ur + GoodsSource[flag3].id
-  } catch (e) {
-    console.log(e.message)
-    Detailstatus = false
-    // reStart()
-  }
+  let ur = 'https://t6.9026.com/api/album/goods-detail'
   wx.showLoading({
     title: 'loading',
   })
@@ -913,6 +907,10 @@ function getGoodsDetail(callback4, GoodsSource) {
   wx.request({
     url: ur,
     data: {
+      store_id: 1,
+      agent_id: agent_id,
+      goods_id: GoodsSource[flag3].id,
+      user_id: user_id
     },
     method: 'GET',
     success: function (res) {
@@ -983,6 +981,7 @@ function UserLogin() {
               if (is_agent == 1) {
                 isAgent = true
                 agent_id = res.data.data.d.data.agent_id
+                user_id = res.data.data.d.data.user_id
                 wx.hideLoading()
                 getFLDsource(callback1, url)
               }
@@ -991,6 +990,7 @@ function UserLogin() {
                 var test = wx.getLaunchOptionsSync()
                 console.log(test)
                 agent_id = test.query.agent_id
+                user_id = res.data.data.d.data.user_id
                 if (agent_id == undefined)
                   agent_id = 0
                 console.log(agent_id)