update api
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user