update api

This commit is contained in:
2020-06-29 17:24:57 +08:00
parent 905022e6e4
commit dce6d3a1b8
19 changed files with 280 additions and 87 deletions

View File

@@ -1,5 +1,5 @@
<template>
<view class="item" @click="addCart">
<view class="item" @click="toDetailsPage">
<image :src="info.goods_image" class="img"></image>
<view class="info">
<text class="title u-line-1">{{ info.goods_name }}</text>
@@ -15,14 +15,11 @@ export default {
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) {
toDetailsPage() {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.info.goods_id
}
})
}