Browse Source

未登录用户允许访问商品详情页面

zyh
Gao xiaosong 4 years ago
parent
commit
8aa46ec1d4
  1. 2
      config/index.js
  2. 71
      pages/shop/GoodsCon/index.vue

2
config/index.js

@ -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://192.168.31.223:8008/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_RESOURCES_URL = 'https://wx.yixiang.co/static'

71
pages/shop/GoodsCon/index.vue

@ -229,7 +229,7 @@ export default {
StorePoster,
ShareInfo,
},
data: function () {
data: function() {
return {
shareInfoStatus: false,
weixinStatus: false,
@ -287,13 +287,14 @@ export default {
}
},
computed: mapGetters(['isLogin', 'location']),
mounted: function () {
mounted: function() {
this.$store.commit('get_to', 'goodcon')
let url = handleQrCode()
if (!url) {
url = handleUrlParam(getCurrentPageUrlWithArgs())
}
this.coupons()
const token = cookie.get('login_status')
if (url && url.id) {
this.id = url.id
let urlSpread = parseInt(url.spread)
@ -303,7 +304,15 @@ export default {
} else {
this.id = this._route.query.id
}
this.isIntegral = url.isIntegral == 'true'
if (!token) {
this.productCon()
return
}
this.coupons()
this.productCon()
this.setOpenShare()
},
@ -318,7 +327,7 @@ export default {
},
},
methods: {
onShareAppMessage: function () {
onShareAppMessage: function() {
return {
title: this.storeInfo.storeName,
imageUrl: this.storeInfo.image,
@ -368,7 +377,7 @@ export default {
},
})
},
showChang: function (data) {
showChang: function(data) {
this.$yrouter.push({
path: '/pages/map/index',
query: data,
@ -377,23 +386,23 @@ export default {
updateTitle() {
// document.title = this.storeInfo.storeName || this.$yroute.meta.title;
},
setShareInfoStatus: function () {
setShareInfoStatus: function() {
this.shareInfoStatus = !this.shareInfoStatus
this.posters = false
},
shareCode: function () {
shareCode: function() {
var that = this
getProductCode(that.id).then(res => {
that.posterData.code = res.data.code
that.listenerActionSheet()
})
},
setPosterImageStatus: function () {
setPosterImageStatus: function() {
this.posterImageStatus = !this.posterImageStatus
this.posters = false
},
//
productCon: function () {
productCon: function() {
let that = this
let from = this.location
if (this.$deviceType == 'app') {
@ -453,7 +462,7 @@ export default {
})
},
//
DefaultSelect: function () {
DefaultSelect: function() {
let productAttr = this.attr.productAttr
let value = []
for (let i = 0; i < productAttr.length; i++) {
@ -495,7 +504,7 @@ export default {
}
},
//
ChangeCartNum: function (changeValue) {
ChangeCartNum: function(changeValue) {
//changeValue: |
//
let productSelect = this.productValue[this.attrValue]
@ -528,29 +537,29 @@ export default {
}
},
//
changeFun: function (opt) {
changeFun: function(opt) {
if (typeof opt !== 'object') opt = {}
let action = opt.action || ''
let value = opt.value === undefined ? '' : opt.value
this[action] && this[action](value)
},
//
couponTap: function () {
couponTap: function() {
let that = this
that.coupons()
that.coupon.coupon = true
},
changecoupon: function (msg) {
changecoupon: function(msg) {
this.coupon.coupon = msg
this.coupons()
},
currentcoupon: function (res) {
currentcoupon: function(res) {
let that = this
that.coupon.coupon = false
that.$set(that.coupon.list[res], 'is_use', true)
},
//
coupons: function () {
coupons: function() {
let that = this,
q = {
page: 1,
@ -562,18 +571,18 @@ export default {
})
},
//
selecAttrTap: function () {
selecAttrTap: function() {
this.attr.cartAttr = true
this.isOpen = true
},
changeattr: function (msg) {
changeattr: function(msg) {
//
console.log(msg)
this.attr.cartAttr = msg
this.isOpen = false
},
//
ChangeAttr: function (res) {
ChangeAttr: function(res) {
//
let productSelect = this.productValue[res.value]
@ -600,27 +609,27 @@ export default {
}
},
//
setCollect: function () {
setCollect: function() {
let that = this,
id = that.storeInfo.id,
category = 'collect'
if (that.storeInfo.userCollect) {
getCollectDel(id, category).then(function () {
getCollectDel(id, category).then(function() {
that.storeInfo.userCollect = !that.storeInfo.userCollect
})
} else {
getCollectAdd(id, category).then(function () {
getCollectAdd(id, category).then(function() {
that.storeInfo.userCollect = !that.storeInfo.userCollect
})
}
},
//
joinCart: function () {
joinCart: function() {
//0=
this.goCat(0)
},
//
goCat: function (news) {
goCat: function(news) {
let that = this,
productSelect = that.productValue[this.attrValue]
//
@ -649,7 +658,7 @@ export default {
uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '',
}
postCartAdd(q)
.then(function (res) {
.then(function(res) {
console.log(res)
that.isOpen = false
that.attr.cartAttr = false
@ -691,7 +700,7 @@ export default {
})
},
//
getCartCount: function (isAnima) {
getCartCount: function(isAnima) {
let that = this
const isLogin = that.isLogin
if (isLogin) {
@ -702,7 +711,7 @@ export default {
//
if (isAnima) {
that.animated = true
setTimeout(function () {
setTimeout(function() {
that.animated = false
}, 500)
}
@ -710,20 +719,20 @@ export default {
}
},
//
tapBuy: function () {
tapBuy: function() {
// 1=
this.goCat(1)
},
listenerActionSheet: function () {
listenerActionSheet: function() {
if (isWeixin() === true) {
this.weixinStatus = true
}
this.posters = true
},
listenerActionClose: function () {
listenerActionClose: function() {
this.posters = false
},
setOpenShare: function () {
setOpenShare: function() {
var data = this.storeInfo
var href = this.location.href
if (this.$deviceType == 'weixin') {

Loading…
Cancel
Save