update api

This commit is contained in:
2020-06-29 08:47:37 +08:00
parent 28e80b49ff
commit 905022e6e4
9 changed files with 209 additions and 79 deletions

View File

@@ -4,7 +4,6 @@
商品推荐
</view>
<view class="label">
<text>分类名称</text>
<text v-for="item in classifyList" :key="item.gc_id">{{ item.gc_name }}</text>
</view>
<view class="item">

View File

@@ -1,6 +1,6 @@
<template>
<view class="item">
<image :src="$u.http.config.baseUrl + info.goods_image" class="img"></image>
<view class="item" @click="addCart">
<image :src="info.goods_image" class="img"></image>
<view class="info">
<text class="title u-line-1">{{ info.goods_name }}</text>
<text class="jianjie u-line-2">{{ info.goods_advword }}</text>
@@ -13,7 +13,20 @@ export default {
name:"item",
props: {
info: Object
}
},
methods: {
addCart() {
console.log(1);
this.$u.api.addCart({
goods_id: this.info.goods_id,
quantity: 1
}).then((res)=>{
if (res.errCode == 0) {
}
})
}
},
}
</script>
<style lang="scss" scoped>