| | |
| | | </view> |
| | | <view style="width: 100%; height: env(safe-area-inset-bottom);"></view> |
| | | </view> |
| | | <Login ref="login" /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapState } from 'vuex' |
| | | import Login from '@/components/login/login.vue' |
| | | export default { |
| | | components: { Login }, |
| | | computed: { |
| | | ...mapState(['userInfo']) |
| | | }, |
| | |
| | | onLoad(option) { |
| | | this.id = option.id |
| | | this.getDetails() |
| | | this.cardNum() |
| | | |
| | | }, |
| | | onShow() { |
| | | if (this.userInfo) { |
| | | this.cardNum() |
| | | } |
| | | }, |
| | | methods: { |
| | | shoucang() { |
| | | if (!this.userInfo) { |
| | | this.$refs.login.open() |
| | | return |
| | | } |
| | | if (this.info.collectStatus === 1) { |
| | | this.$u.api.cancelbatch({ ids: this.info.id }) |
| | | .then(res => { |
| | |
| | | } |
| | | }, |
| | | submit() { |
| | | if (!this.userInfo) { |
| | | this.$refs.login.open() |
| | | return |
| | | } |
| | | let shop = [ |
| | | { |
| | | goodsNum: 1, |
| | |
| | | }) |
| | | }, |
| | | addCard(e) { |
| | | if (!this.userInfo) { |
| | | this.$refs.login.open() |
| | | return |
| | | } |
| | | this.$u.api.addCart({ |
| | | goodsId: e.id, |
| | | goodsSkuId: e.skuResponsesList[0].id, |
| | |
| | | }) |
| | | }, |
| | | toCard() { |
| | | if (!this.userInfo) { |
| | | this.$refs.login.open() |
| | | return |
| | | } |
| | | uni.navigateTo({ |
| | | url: '/pages/shopping-cart/shopping-cart' |
| | | }) |