|
|
|
@ -371,7 +371,8 @@ |
|
|
|
|
<image :src="$picUrl+'/static/toTop.png?=1'"></image> |
|
|
|
|
</view> |
|
|
|
|
<view v-if="isTodo"> |
|
|
|
|
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :goods="goods" :addressResult='addressResult' |
|
|
|
|
<SkuPopup v-model="showSkuPopup" :skuMode="skuMode" :activeTimeId='activeTimeId' |
|
|
|
|
:sharpGoodsId='sharpGoodsId' :goodSource='1' :goods="goods" :addressResult='addressResult' |
|
|
|
|
@getSku='onGetSku' @addCart="onAddCart" /> |
|
|
|
|
</view> |
|
|
|
|
<setPrice ref="setRange" @getprice="getprice" /> |
|
|
|
@ -428,13 +429,13 @@ |
|
|
|
|
openDialog: false, |
|
|
|
|
goodsId: '', |
|
|
|
|
activeTimeId: '', |
|
|
|
|
sharpGoodsId:'', |
|
|
|
|
sharpGoodsId: '', |
|
|
|
|
goods: { |
|
|
|
|
skuList: [] |
|
|
|
|
}, |
|
|
|
|
suggestGoodsList: [], |
|
|
|
|
userInfo: {}, |
|
|
|
|
activeInfo:{}, |
|
|
|
|
activeInfo: {}, |
|
|
|
|
addressList: [], |
|
|
|
|
addressInfo: {}, |
|
|
|
|
serveList: [], |
|
|
|
@ -467,14 +468,11 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
console.log(options) |
|
|
|
|
const that = this; |
|
|
|
|
that.options = options; |
|
|
|
|
let result = uni.getStorageSync("addressResult") |
|
|
|
|
this.addressResult = result ? result.address_component : this.addressResult |
|
|
|
|
this.isPre = options.isPre ? options.isPre : null |
|
|
|
|
// 记录query参数 |
|
|
|
|
// this.onRecordQuery(options) |
|
|
|
|
const scene = getSceneData(options) |
|
|
|
|
this.sharpGoodsId = options.sharpGoodsId ? parseInt(options.sharpGoodsId) : parseInt(scene.sharpGoodsId) |
|
|
|
|
this.activeTimeId = options.activeTimeId ? options.activeTimeId : null |
|
|
|
@ -490,17 +488,7 @@ |
|
|
|
|
that.selectShop.price = that.selectShop.price / 100 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
if (uni.getStorageSync('AccessToken')) { |
|
|
|
|
this.getAddressList() |
|
|
|
|
this.isLogin = true; |
|
|
|
|
this.userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
} else { |
|
|
|
|
this.isLogin = false; |
|
|
|
|
this.userInfo = {} |
|
|
|
|
} |
|
|
|
|
console.log(this.userInfo) |
|
|
|
|
}, |
|
|
|
|
onShow() {}, |
|
|
|
|
onPageScroll(e) { |
|
|
|
|
if (e.scrollTop <= 200) { // 当滚动到顶部且向下滑动时为true |
|
|
|
|
this.isTop = false |
|
|
|
@ -774,6 +762,7 @@ |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
address.defaultId().then(res => { |
|
|
|
|
if (res.status == 200) { |
|
|
|
|
that.getGoodsStockInfor(); |
|
|
|
|
for (var i = 0; i < that.addressList.length; i++) { |
|
|
|
|
if (res.data.defaultId == that.addressList[i].address_id) { |
|
|
|
|
that.addressInfo = that.addressList[i]; |
|
|
|
@ -788,8 +777,6 @@ |
|
|
|
|
this.addressResult.district = this.addressInfo.region ? this.addressInfo |
|
|
|
|
.region.region : (this.addressResult ? this.addressResult.district : |
|
|
|
|
'江苏省'); |
|
|
|
|
|
|
|
|
|
that.getGoodsStockInfor(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -837,7 +824,6 @@ |
|
|
|
|
} |
|
|
|
|
this.skuMode = skuMode |
|
|
|
|
this.showSkuPopup = true |
|
|
|
|
console.log("choseSku", this.goods) |
|
|
|
|
}, |
|
|
|
|
copyNum(msg) { |
|
|
|
|
uni.setClipboardData({ |
|
|
|
@ -882,8 +868,8 @@ |
|
|
|
|
SharpGoodsApi.detail(that.activeTimeId, that.sharpGoodsId) |
|
|
|
|
.then(result => { |
|
|
|
|
let info = result.data.goods; |
|
|
|
|
that.activeInfo=result.data.active |
|
|
|
|
that.goodsId=info.goods_id |
|
|
|
|
that.activeInfo = result.data.active |
|
|
|
|
that.goodsId = info.goods_id |
|
|
|
|
that.goods.skuList = []; |
|
|
|
|
that.godds = {} |
|
|
|
|
info.goods_images1 = [] |
|
|
|
@ -927,6 +913,14 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 在商品id回来之后请求 |
|
|
|
|
if (uni.getStorageSync('AccessToken')) { |
|
|
|
|
this.getAddressList() |
|
|
|
|
this.isLogin = true; |
|
|
|
|
this.userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
} else { |
|
|
|
|
this.isLogin = false; |
|
|
|
|
this.userInfo = {} |
|
|
|
|
} |
|
|
|
|
this.getSuggestGoods() |
|
|
|
|
this.getServeList() |
|
|
|
|
this.cityInfo = uni.getStorageSync("cityInfo"); |
|
|
|
|