main
fanfan 8 months ago
parent db53880497
commit 130c633330
  1. 25
      pages/goods/components/SkuPopup.vue
  2. 38
      pages/goods/seckillDetail.vue

@ -4,7 +4,8 @@
:addCartColor="appTheme.viceText" :addCartBackgroundColor="appTheme.viceBg"
:activedStyle="{ color: appTheme.mainBg, borderColor: appTheme.mainBg, backgroundColor: activedBtnBackgroundColor }"
@open="openSkuPopup" @close="closeSkuPopup" @add-cart="addCart" @buy-now="buyNow" @num-change='numChange'
@selected-old='selectedOld' buyNowText="立即购买" :maxBuyNum="maxBuyNum" :addressResult='addressResult' :stockValue='stockValue'/>
@selected-old='selectedOld' buyNowText="立即购买" :maxBuyNum="maxBuyNum" :addressResult='addressResult'
:stockValue='stockValue' />
</template>
<script>
@ -24,6 +25,18 @@
},
emits: ['update:modelValue'],
props: {
goodSource: {
Type: String || Number,
default: 0
},
activeTimeId: {
Type: String || Number,
default: null
},
sharpGoodsId: {
Type: String || Number,
default: null
},
//
modelValue: {
Type: Boolean,
@ -213,7 +226,7 @@
let that = this;
let params = {
list: [{
goods_id:selectShop.goods_id,
goods_id: selectShop.goods_id,
num: selectShop.buy_num
}],
province: that.addressResult ? that.addressResult.province : '江苏省',
@ -281,14 +294,16 @@
this.onChangeValue(false);
uni.$emit("onenPrice", selectShop)
return;
console.log(selectShop)
}
//
this.$navTo('pages/sureOrder/index', {
mode: 'buyNow',
mode: app.goodSource == 0 ? 'buyNow' : 'sharp',
goodsId: selectShop.goods_id,
goodsSkuId: selectShop.goods_sku_id,
goodsNum: selectShop.buy_num
goodsNum: selectShop.buy_num,
goodSource: app.goodSource,
activeTimeId: app.activeTimeId,
sharpGoodsId: app.sharpGoodsId,
})
//
this.onChangeValue(false)

@ -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");

Loading…
Cancel
Save