|
|
@@ -13,8 +13,10 @@
|
|
|
<p class="shop-name" v-if="storeInfo.storeName">{{storeInfo.storeName | nameFilter}}</p>
|
|
|
<p class="shop-name" v-else></p>
|
|
|
<div class="enter-store">
|
|
|
- <a v-if="isFocus == 'false' || typeof isFocus == 'object'" @click="focus(storeInfo.id, storeInfo.storeName)">关注店铺</a>
|
|
|
- <a v-if="isFocus == 'true'" class="focus">已关注</a>
|
|
|
+ <!--<a v-if="isFocus == 'false' || typeof isFocus == 'object'" @click="focus(storeInfo.id, storeInfo.storeName)">关注店铺</a>-->
|
|
|
+ <!--<a v-if="isFocus == 'true'" class="focus">已关注</a>-->
|
|
|
+ <a v-if="isFocus == 'false' || typeof isFocus == 'object'" @click="focusStore(storeInfo, $event)">关注店铺</a>
|
|
|
+ <a v-if="isFocus == 'true'" class="focus" @click="focusStore(storeInfo, $event)">已关注</a>
|
|
|
<a @click="goLink()">联系卖家</a>
|
|
|
</div>
|
|
|
<div class="share">
|
|
|
@@ -47,6 +49,18 @@
|
|
|
</button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="dialogInvisible"
|
|
|
+ size="tiny"
|
|
|
+ >
|
|
|
+ <h3 class="header-text">关注取消!</h3>
|
|
|
+ <div class="focus modal-body">
|
|
|
+ <button type="button" @click="dialogInvisible = false" class="btn" style="margin-left:25px;">关 闭</button>
|
|
|
+ <button type="button" @click="dialogInvisible = false" class="focus-btn btn btn btn-info" style="margin-left:35px;">
|
|
|
+ <a href="/user#/storeFocus" target="_blank">查看我的店铺关注</a>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<link-saler-box
|
|
|
:tel="tel"
|
|
|
v-if="showLinkBox"
|
|
|
@@ -65,6 +79,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
+ dialogInvisible: false,
|
|
|
showShare: false,
|
|
|
clipboard: {},
|
|
|
showLinkBox: false,
|
|
|
@@ -105,19 +120,42 @@ export default {
|
|
|
this.showShare = flag
|
|
|
this.showCate = flag
|
|
|
},
|
|
|
- focus (id, name) {
|
|
|
- if (!this.user.logged) {
|
|
|
+ focusStore: function (item) {
|
|
|
+ if (this.user.logged) {
|
|
|
+ if (this.isFocus === 'false' || typeof isFocus === 'object') {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.$store.dispatch('shop/StoreFocus', {storeName: item.storeName, storeid: item.id})
|
|
|
+ this.isFocus = 'true'
|
|
|
+ } else {
|
|
|
+ this.$http.post('/trade/storeFocus/delete/storeId', [item.id])
|
|
|
+ .then(response => {
|
|
|
+ this.dialogInvisible = true
|
|
|
+// alert(this.isFocus)
|
|
|
+ this.isFocus = 'false'
|
|
|
+// alert(this.isFocus)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
|
|
|
if (response.data) {
|
|
|
window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
|
|
|
}
|
|
|
})
|
|
|
- } else {
|
|
|
- this.dialogVisible = true
|
|
|
- this.$store.dispatch('shop/StoreFocus', {storeName: name, storeid: id})
|
|
|
- this.isFocus = true
|
|
|
}
|
|
|
},
|
|
|
+// focus (id, name) {
|
|
|
+// if (!this.user.logged) {
|
|
|
+// this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
|
|
|
+// if (response.data) {
|
|
|
+// window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
|
|
|
+// }
|
|
|
+// })
|
|
|
+// } else {
|
|
|
+// this.dialogVisible = true
|
|
|
+// this.$store.dispatch('shop/StoreFocus', {storeName: name, storeid: id})
|
|
|
+// this.isFocus = true
|
|
|
+// }
|
|
|
+// },
|
|
|
goLink: function () {
|
|
|
this.baseUtils.goLinkUser(this, this.storeInfo.enUU)
|
|
|
}
|