|
|
@@ -40,32 +40,92 @@
|
|
|
<div class="message-body"><a :href="list.attach" v-if="list.attach">规格书</a><span v-if="!list.attach">暂无规格书</span></div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
- <button class="btn btn-default btn-stroe">加入收藏</button>
|
|
|
+ <!-- <button class="btn btn-default btn-stroe">加入收藏</button>-->
|
|
|
+ <el-button type="text" v-if="!isShow && collectList" @click="dialogVisible = true,collect(list.id)" class="btn btn-default btn-stroe" style="line-height: 26px;">加入收藏</el-button>
|
|
|
+ <button class="btn btn-default btn-stroe" v-if="isShow && collectList" disabled="disabled">已收藏</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!--关注-->
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ size="tiny"
|
|
|
+ >
|
|
|
+ <h3 class="header-text">收藏成功!</h3>
|
|
|
+ <div class="focus modal-body">
|
|
|
+ <button type="button" @click="dialogVisible = false" class="btn" style="margin-left:25px;">关 闭</button>
|
|
|
+ <button type="button" class="focus-btn btn btn btn-info" style="margin-left:35px;">
|
|
|
+ <a href="/user#/browsingHistory" target="_blank">查看我的产品收藏</a>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import { ComponentMenu } from '~components/product'
|
|
|
export default {
|
|
|
name: 'ComponentDetail',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ dialogVisible: false,
|
|
|
+ isShow: false
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: {
|
|
|
lists () {
|
|
|
+ // console.log(this.$store.state.componentDetail.detail)
|
|
|
return this.$store.state.componentDetail.detail
|
|
|
},
|
|
|
list () {
|
|
|
return this.lists.data
|
|
|
+ },
|
|
|
+ collectList () {
|
|
|
+ let id = this.lists.data.properties[0].componentId
|
|
|
+ // console.log(this.lists.data)
|
|
|
+ let store = this.$store.state.product.common.collectList.data
|
|
|
+ var _this = this
|
|
|
+ if (store) {
|
|
|
+ for (var i = 0; i < store.length; i++) {
|
|
|
+ if (store[i].componentid === id) {
|
|
|
+ _this.isShow = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true
|
|
|
}
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.loadCollectList()
|
|
|
+ })
|
|
|
+ },
|
|
|
components: {
|
|
|
ComponentMenu
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ loadCollectList () {
|
|
|
+ this.$store.dispatch('product/saveStores')
|
|
|
+ },
|
|
|
+ collect (id) {
|
|
|
+ let kind = 2
|
|
|
+ this.$store.dispatch('product/saveEntity', {componentid: id, kind: kind})
|
|
|
+ this.isShow = true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
+ .header-text {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20px;
|
|
|
+ color: #008B00;
|
|
|
+ margin-top: 0;
|
|
|
+ }
|
|
|
+ .componentDetail .el-dialog__wrapper .focus-btn a{
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
.componentDetail .container {
|
|
|
width: 1190px;
|
|
|
padding: 0;
|