1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <!-- Buy.vue -->
- <template>
- <view class="div main-content" v-if="detailInfo">
- <flex-line :is-link="true" :show-border="true" @click.native="changeCartState()">
- <view class="div"
- :class="{'isopacity':!activeBuy}"
- >
- <view class="p" v-if="number <= 0">
- 请选择购买数量分类
- </view>
- <view class="p" v-if="number > 0">
- 已选数量{{ number }}
- </view>
- </view>
- </flex-line>
- </view>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- import FlexLine from '../../../flexLine'
- export default {
- components: { FlexLine },
- data () {
- return {}
- },
- computed: {
- ...mapState({
- number: state => state.pointsgoods.number,
- detailInfo: state => state.pointsgoods.detailInfo
- })
- },
- created () {},
- methods: {
- ...mapMutations({
- saveCartState: 'saveCartState',
- changeType: 'changeType'
- }),
- activeBuy: function () {
- if (this.detailInfo.pgoods_storage > 0) {
- return true
- } else {
- return false
- }
- },
- changeCartState () {
- this.saveCartState(true)
- this.changeType('加入购物车')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .main-content{padding:0 $pageSpace;background-color: #fff;}
- .isopacity {
- opacity: 0.5;
- }
- </style>
|