未登录用户允许访问商品详情页面
This commit is contained in:
@ -3,7 +3,7 @@ export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
|
|||||||
// export const VUE_APP_API_URL = 'http://139.186.134.205:9006/api'
|
// export const VUE_APP_API_URL = 'http://139.186.134.205:9006/api'
|
||||||
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api'
|
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api'
|
||||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||||
// export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api'
|
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'
|
||||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||||
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static'
|
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static'
|
||||||
|
@ -229,7 +229,7 @@ export default {
|
|||||||
StorePoster,
|
StorePoster,
|
||||||
ShareInfo,
|
ShareInfo,
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
shareInfoStatus: false,
|
shareInfoStatus: false,
|
||||||
weixinStatus: false,
|
weixinStatus: false,
|
||||||
@ -287,13 +287,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin', 'location']),
|
computed: mapGetters(['isLogin', 'location']),
|
||||||
mounted: function () {
|
mounted: function() {
|
||||||
this.$store.commit('get_to', 'goodcon')
|
this.$store.commit('get_to', 'goodcon')
|
||||||
let url = handleQrCode()
|
let url = handleQrCode()
|
||||||
if (!url) {
|
if (!url) {
|
||||||
url = handleUrlParam(getCurrentPageUrlWithArgs())
|
url = handleUrlParam(getCurrentPageUrlWithArgs())
|
||||||
}
|
}
|
||||||
this.coupons()
|
|
||||||
|
const token = cookie.get('login_status')
|
||||||
if (url && url.id) {
|
if (url && url.id) {
|
||||||
this.id = url.id
|
this.id = url.id
|
||||||
let urlSpread = parseInt(url.spread)
|
let urlSpread = parseInt(url.spread)
|
||||||
@ -303,7 +304,15 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.id = this._route.query.id
|
this.id = this._route.query.id
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isIntegral = url.isIntegral == 'true'
|
this.isIntegral = url.isIntegral == 'true'
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
this.productCon()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.coupons()
|
||||||
|
|
||||||
this.productCon()
|
this.productCon()
|
||||||
this.setOpenShare()
|
this.setOpenShare()
|
||||||
},
|
},
|
||||||
@ -318,7 +327,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onShareAppMessage: function () {
|
onShareAppMessage: function() {
|
||||||
return {
|
return {
|
||||||
title: this.storeInfo.storeName,
|
title: this.storeInfo.storeName,
|
||||||
imageUrl: this.storeInfo.image,
|
imageUrl: this.storeInfo.image,
|
||||||
@ -368,7 +377,7 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
showChang: function (data) {
|
showChang: function(data) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/map/index',
|
path: '/pages/map/index',
|
||||||
query: data,
|
query: data,
|
||||||
@ -377,23 +386,23 @@ export default {
|
|||||||
updateTitle() {
|
updateTitle() {
|
||||||
// document.title = this.storeInfo.storeName || this.$yroute.meta.title;
|
// document.title = this.storeInfo.storeName || this.$yroute.meta.title;
|
||||||
},
|
},
|
||||||
setShareInfoStatus: function () {
|
setShareInfoStatus: function() {
|
||||||
this.shareInfoStatus = !this.shareInfoStatus
|
this.shareInfoStatus = !this.shareInfoStatus
|
||||||
this.posters = false
|
this.posters = false
|
||||||
},
|
},
|
||||||
shareCode: function () {
|
shareCode: function() {
|
||||||
var that = this
|
var that = this
|
||||||
getProductCode(that.id).then(res => {
|
getProductCode(that.id).then(res => {
|
||||||
that.posterData.code = res.data.code
|
that.posterData.code = res.data.code
|
||||||
that.listenerActionSheet()
|
that.listenerActionSheet()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setPosterImageStatus: function () {
|
setPosterImageStatus: function() {
|
||||||
this.posterImageStatus = !this.posterImageStatus
|
this.posterImageStatus = !this.posterImageStatus
|
||||||
this.posters = false
|
this.posters = false
|
||||||
},
|
},
|
||||||
//产品详情接口;
|
//产品详情接口;
|
||||||
productCon: function () {
|
productCon: function() {
|
||||||
let that = this
|
let that = this
|
||||||
let from = this.location
|
let from = this.location
|
||||||
if (this.$deviceType == 'app') {
|
if (this.$deviceType == 'app') {
|
||||||
@ -453,7 +462,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//默认选中属性;
|
//默认选中属性;
|
||||||
DefaultSelect: function () {
|
DefaultSelect: function() {
|
||||||
let productAttr = this.attr.productAttr
|
let productAttr = this.attr.productAttr
|
||||||
let value = []
|
let value = []
|
||||||
for (let i = 0; i < productAttr.length; i++) {
|
for (let i = 0; i < productAttr.length; i++) {
|
||||||
@ -495,7 +504,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//购物车;
|
//购物车;
|
||||||
ChangeCartNum: function (changeValue) {
|
ChangeCartNum: function(changeValue) {
|
||||||
//changeValue:是否 加|减
|
//changeValue:是否 加|减
|
||||||
//获取当前变动属性
|
//获取当前变动属性
|
||||||
let productSelect = this.productValue[this.attrValue]
|
let productSelect = this.productValue[this.attrValue]
|
||||||
@ -528,29 +537,29 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//将父级向子集多次传送的函数合二为一;
|
//将父级向子集多次传送的函数合二为一;
|
||||||
changeFun: function (opt) {
|
changeFun: function(opt) {
|
||||||
if (typeof opt !== 'object') opt = {}
|
if (typeof opt !== 'object') opt = {}
|
||||||
let action = opt.action || ''
|
let action = opt.action || ''
|
||||||
let value = opt.value === undefined ? '' : opt.value
|
let value = opt.value === undefined ? '' : opt.value
|
||||||
this[action] && this[action](value)
|
this[action] && this[action](value)
|
||||||
},
|
},
|
||||||
//打开优惠券插件;
|
//打开优惠券插件;
|
||||||
couponTap: function () {
|
couponTap: function() {
|
||||||
let that = this
|
let that = this
|
||||||
that.coupons()
|
that.coupons()
|
||||||
that.coupon.coupon = true
|
that.coupon.coupon = true
|
||||||
},
|
},
|
||||||
changecoupon: function (msg) {
|
changecoupon: function(msg) {
|
||||||
this.coupon.coupon = msg
|
this.coupon.coupon = msg
|
||||||
this.coupons()
|
this.coupons()
|
||||||
},
|
},
|
||||||
currentcoupon: function (res) {
|
currentcoupon: function(res) {
|
||||||
let that = this
|
let that = this
|
||||||
that.coupon.coupon = false
|
that.coupon.coupon = false
|
||||||
that.$set(that.coupon.list[res], 'is_use', true)
|
that.$set(that.coupon.list[res], 'is_use', true)
|
||||||
},
|
},
|
||||||
//可领取优惠券接口;
|
//可领取优惠券接口;
|
||||||
coupons: function () {
|
coupons: function() {
|
||||||
let that = this,
|
let that = this,
|
||||||
q = {
|
q = {
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -562,18 +571,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//打开属性插件;
|
//打开属性插件;
|
||||||
selecAttrTap: function () {
|
selecAttrTap: function() {
|
||||||
this.attr.cartAttr = true
|
this.attr.cartAttr = true
|
||||||
this.isOpen = true
|
this.isOpen = true
|
||||||
},
|
},
|
||||||
changeattr: function (msg) {
|
changeattr: function(msg) {
|
||||||
// 修改了规格
|
// 修改了规格
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
this.attr.cartAttr = msg
|
this.attr.cartAttr = msg
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
},
|
},
|
||||||
//选择属性;
|
//选择属性;
|
||||||
ChangeAttr: function (res) {
|
ChangeAttr: function(res) {
|
||||||
// 修改了规格
|
// 修改了规格
|
||||||
|
|
||||||
let productSelect = this.productValue[res.value]
|
let productSelect = this.productValue[res.value]
|
||||||
@ -600,27 +609,27 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//收藏商品
|
//收藏商品
|
||||||
setCollect: function () {
|
setCollect: function() {
|
||||||
let that = this,
|
let that = this,
|
||||||
id = that.storeInfo.id,
|
id = that.storeInfo.id,
|
||||||
category = 'collect'
|
category = 'collect'
|
||||||
if (that.storeInfo.userCollect) {
|
if (that.storeInfo.userCollect) {
|
||||||
getCollectDel(id, category).then(function () {
|
getCollectDel(id, category).then(function() {
|
||||||
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
getCollectAdd(id, category).then(function () {
|
getCollectAdd(id, category).then(function() {
|
||||||
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 点击加入购物车按钮
|
// 点击加入购物车按钮
|
||||||
joinCart: function () {
|
joinCart: function() {
|
||||||
//0=加入购物车
|
//0=加入购物车
|
||||||
this.goCat(0)
|
this.goCat(0)
|
||||||
},
|
},
|
||||||
// 加入购物车;
|
// 加入购物车;
|
||||||
goCat: function (news) {
|
goCat: function(news) {
|
||||||
let that = this,
|
let that = this,
|
||||||
productSelect = that.productValue[this.attrValue]
|
productSelect = that.productValue[this.attrValue]
|
||||||
//打开属性
|
//打开属性
|
||||||
@ -649,7 +658,7 @@ export default {
|
|||||||
uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '',
|
uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '',
|
||||||
}
|
}
|
||||||
postCartAdd(q)
|
postCartAdd(q)
|
||||||
.then(function (res) {
|
.then(function(res) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
that.isOpen = false
|
that.isOpen = false
|
||||||
that.attr.cartAttr = false
|
that.attr.cartAttr = false
|
||||||
@ -691,7 +700,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取购物车数量
|
//获取购物车数量
|
||||||
getCartCount: function (isAnima) {
|
getCartCount: function(isAnima) {
|
||||||
let that = this
|
let that = this
|
||||||
const isLogin = that.isLogin
|
const isLogin = that.isLogin
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
@ -702,7 +711,7 @@ export default {
|
|||||||
//加入购物车后重置属性
|
//加入购物车后重置属性
|
||||||
if (isAnima) {
|
if (isAnima) {
|
||||||
that.animated = true
|
that.animated = true
|
||||||
setTimeout(function () {
|
setTimeout(function() {
|
||||||
that.animated = false
|
that.animated = false
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
@ -710,20 +719,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//立即购买;
|
//立即购买;
|
||||||
tapBuy: function () {
|
tapBuy: function() {
|
||||||
// 1=直接购买
|
// 1=直接购买
|
||||||
this.goCat(1)
|
this.goCat(1)
|
||||||
},
|
},
|
||||||
listenerActionSheet: function () {
|
listenerActionSheet: function() {
|
||||||
if (isWeixin() === true) {
|
if (isWeixin() === true) {
|
||||||
this.weixinStatus = true
|
this.weixinStatus = true
|
||||||
}
|
}
|
||||||
this.posters = true
|
this.posters = true
|
||||||
},
|
},
|
||||||
listenerActionClose: function () {
|
listenerActionClose: function() {
|
||||||
this.posters = false
|
this.posters = false
|
||||||
},
|
},
|
||||||
setOpenShare: function () {
|
setOpenShare: function() {
|
||||||
var data = this.storeInfo
|
var data = this.storeInfo
|
||||||
var href = this.location.href
|
var href = this.location.href
|
||||||
if (this.$deviceType == 'weixin') {
|
if (this.$deviceType == 'weixin') {
|
||||||
|
Reference in New Issue
Block a user