Fix:2826 【商城小程序】农民店铺无法取消收藏,收藏时点取消图标未变更
This commit is contained in:
@@ -81,14 +81,14 @@
|
||||
:src="webUrl + '/icon/icon-star-on.png'"
|
||||
mode="scaleToFill"
|
||||
class="icon"
|
||||
@click="doneFavorite"
|
||||
@click="doneFavorite(store.hasFavorite)"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
:src="webUrl + '/icon/icon-star-off.png'"
|
||||
mode="scaleToFill"
|
||||
class="icon"
|
||||
@click="doneFavorite"
|
||||
@click="doneFavorite(store.hasFavorite)"
|
||||
/>
|
||||
<text>{{ store.favoriteCount }}</text>
|
||||
</view>
|
||||
@@ -340,7 +340,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getFarmerShop, setFarmerShopZan, getFarmerShopNews, setFarmerShopCollection } from '@/api/farmer'
|
||||
import { getFarmerShop, setFarmerShopZan, getFarmerShopNews, removeFarmerShopCollection, setFarmerShopCollection } from '@/api/farmer'
|
||||
import { postCountyFamousNewsZan, postCountyFamousNewsView } from '@/api/qianxian'
|
||||
import imgBox from '@/components/imageTypeSet/imagebox.vue'
|
||||
export default {
|
||||
@@ -514,11 +514,12 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
doneFavorite() {
|
||||
doneFavorite(has) {
|
||||
const api = !has ? setFarmerShopCollection : removeFarmerShopCollection
|
||||
const params = {
|
||||
farmerShopId: this.id
|
||||
}
|
||||
setFarmerShopCollection(params).then(res => {
|
||||
api(params).then(res => {
|
||||
this.getFarmerData()
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user