diff --git a/components/collect-btn/collect-btn.vue b/components/collect-btn/collect-btn.vue new file mode 100644 index 0000000..69ac02c --- /dev/null +++ b/components/collect-btn/collect-btn.vue @@ -0,0 +1,80 @@ + + + + + \ No newline at end of file diff --git a/pages.json b/pages.json index 5fb6d4e..55d0260 100644 --- a/pages.json +++ b/pages.json @@ -1,6 +1,7 @@ { "easycom": { - "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" + "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue", + "^collect-btn$": "@/components/collect-btn/collect-btn.vue" }, "pages": [{ "path": "pages/shouye/index", diff --git a/pages/shouye/detail.vue b/pages/shouye/detail.vue index 791353a..3991780 100644 --- a/pages/shouye/detail.vue +++ b/pages/shouye/detail.vue @@ -37,16 +37,12 @@ - - - - 收藏 - - - - - + @@ -136,7 +132,6 @@ - @@ -518,7 +498,6 @@ - @@ -817,19 +796,8 @@ } }, - toggleCollect() { - this.req({ - url: 'addCollect', - data: { - goods_id: this.pageData.goods.id, - goods_num: this.pageData.goods.num - }, - success: res => { - if (res.status == 1) { - this.doRefresh() - } - } - }) + onCollectionChanged() { + this.doRefresh() }, toBag() { @@ -1232,33 +1200,6 @@ } } - &-shoucang { - width: 65rpx; - height: 95rpx; - position: absolute; - right: 0; - top: 232rpx; - box-sizing: border-box; - // background: url($imgurl+'/common/shoucang.png') no-repeat 0 0 / 100% 100%; - - >image { - width: 64rpx; - height: 64rpx; - // margin-top: 22rpx; - } - - >text { - width: 100%; - text-align: center; - font-weight: 400; - font-size: 20rpx; - color: #FFFFFF; - margin-top: 4rpx; - // line-height: 66rpx; - text-shadow: #000 1px 0 0, #000 0 1px 0, #000 -1px 0 0, #000 0 -1px 0; - } - } - &-footer { width: 750rpx; position: absolute;