Commit 860a385d by 谢中龙

商品接口对接

parent 0913f62c
...@@ -34,11 +34,11 @@ wxService.page({ ...@@ -34,11 +34,11 @@ wxService.page({
}, },
goods : { goods : {
goodsTypeArr: [ goodsTypeArr: [
{ name: '最新', type: 2, active: true }, { name: '最新', type: 'new', active: true },
{ name: '最热🔥', type: 3, active: false }, { name: '最热🔥', type: 'hot', active: false },
{ name: '推荐👍', type: 1, active: false } { name: '推荐👍', type: 'recommend', active: false }
], ],
currentGoodsType: 2, currentGoodsType: 'new',
goodsList: [] goodsList: []
}, },
shareModel : { shareModel : {
...@@ -320,7 +320,8 @@ wxService.page({ ...@@ -320,7 +320,8 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '加载中..', title: '加载中..',
}); });
wxService.post(`/merchant/share/productBonus/buyer/findPage?pageNo=1&pageSize=3`, {}).then(res => { let order = this.data.goods.currentGoodsType;
wxService.post(`/merchant/share/productBonus/buyer/findPageOrder?pageNo=1&pageSize=3&order=${order}`, {}).then(res => {
if(res){ if(res){
let list = res.data.data.content ? res.data.data.content : []; let list = res.data.data.content ? res.data.data.content : [];
list.map(item => { list.map(item => {
......
...@@ -10,11 +10,11 @@ wxService.page({ ...@@ -10,11 +10,11 @@ wxService.page({
data: { data: {
goods: { goods: {
goodsTypeArr: [ goodsTypeArr: [
{ name: '最新', type: 2, active: true }, { name: '最新', type: 'new', active: true },
{ name: '最热🔥', type: 3, active: false }, { name: '最热🔥', type: 'hot', active: false },
{ name: '推荐👍', type: 1, active: false } { name: '推荐👍', type: 'recommend', active: false }
], ],
currentGoodsType: 2, currentGoodsType: 'new',
goodsList: [] goodsList: []
}, },
shareModelObj: { shareModelObj: {
...@@ -69,8 +69,8 @@ wxService.page({ ...@@ -69,8 +69,8 @@ wxService.page({
title: '加载中', title: '加载中',
mask: true mask: true
}); });
let order = this.data.goods.currentGoodsType;
wxService.post(`/merchant/share/productBonus/buyer/findPage?pageNo=1&pageSize=20`, {}).then(res => { wxService.post(`/merchant/share/productBonus/buyer/findPageOrder?pageNo=1&pageSize=20&order=${order}`, {}).then(res => {
if (res) { if (res) {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
......
...@@ -25,11 +25,11 @@ wxService.page({ ...@@ -25,11 +25,11 @@ wxService.page({
}, },
goods : { goods : {
goodsTypeArr: [ goodsTypeArr: [
{ name: '最新', type: 2, active: true }, { name: '最新', type: 'new', active: true },
{ name: '最热🔥', type: 3, active: false }, { name: '最热🔥', type: 'hot', active: false },
{ name: '推荐👍', type: 1, active: false } { name: '推荐👍', type: 'recommend', active: false }
], ],
currentGoodsType: 2, currentGoodsType: 'new',
goodsList: [] goodsList: []
}, },
...@@ -226,7 +226,12 @@ wxService.page({ ...@@ -226,7 +226,12 @@ wxService.page({
//获取商品列表 //获取商品列表
getGoodsList() { getGoodsList() {
wxService.post(`/merchant/share/productBonus/buyer/findPage?pageNo=1&pageSize=5`, {}).then(res => { wx.showLoading({
title: '加载中..',
});
let order = this.data.goods.currentGoodsType;
wxService.post(`/merchant/share/productBonus/buyer/findPageOrder?pageNo=1&pageSize=5&order=${order}`, {}).then(res => {
if (res) { if (res) {
let list = res.data.data.content ? res.data.data.content : []; let list = res.data.data.content ? res.data.data.content : [];
list.map(item => { list.map(item => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment