【拼团商品详情】

1. 整理变量
pull/1/MERGE
YunaiV 2023-06-15 20:54:32 +08:00
parent 31c96a5c76
commit 31ead800b1
2 changed files with 99 additions and 127 deletions

View File

@ -123,14 +123,13 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 评论 TODO --> <!-- 评论 -->
<view class='userEvaluation borRadius14' id="past1"> <view class='userEvaluation borRadius14' id="past1">
<view class='title acea-row row-between-wrapper' :style="replyCount==0?'border-bottom-left-radius:14rpx;border-bottom-right-radius:14rpx;':''"> <view class='title acea-row row-between-wrapper' :style="replyCount===0?'border-bottom-left-radius:14rpx;border-bottom-right-radius:14rpx;':''">
<view>用户评价<i>({{replyCount}})</i></view> <view>用户评价<i>({{replyCount}})</i></view>
<navigator class='praise' hover-class='none' <navigator class='praise' hover-class='none'
:url='"/pages/users/goods_comment_list/index?productId="+storeInfo.productId'> :url='"/pages/users/goods_comment_list/index?productId="+spu.productId'>
<i>好评</i><text class='font-color'>{{ replyChance || 0}}%</text> <i>好评</i><text class='font-color'>{{ replyChance || 0}}%</text>
<text class='iconfont icon-jiantou'></text> <text class='iconfont icon-jiantou'></text>
</navigator> </navigator>
</view> </view>
@ -204,7 +203,7 @@
@iptCartNum="iptCartNum" @iptCartNum="iptCartNum"
@close="closeAttr" @close="closeAttr"
/> />
<!-- TODO 芋艿 --> <!-- 左侧的分销提示 -->
<shareRedPackets <shareRedPackets
:sharePacket="sharePacket" :sharePacket="sharePacket"
@listenerActionSheet="listenerActionSheet" @listenerActionSheet="listenerActionSheet"
@ -309,6 +308,10 @@
runningRecords: [], // runningRecords: [], //
AllIndex: 2, // runningRecords AllIndex: 2, // runningRecords
AllIndexDefault: 0, // AllIndex AllIndexDefault: 0, // AllIndex
circular: true, // 4
autoplay: true,
interval: 3000,
duration: 500,
// ========== ========== // ========== ==========
spu: {}, // SPU spu: {}, // SPU
@ -334,52 +337,37 @@
// ========== ========== // ========== ==========
userCollect: false, userCollect: false,
// TODO // ========== ==========
qrcodeSize: 600, //
circular: true, promotionCode: '', //
autoplay: true, imgTop: '', // base64
interval: 3000, errT: '', //
duration: 500, posters: false, //
productValue: [], weixinStatus: false, //
maxAllIndex: 0, canvasStatus: false, //
limitNum: 1, H5ShareBox: false, //
timeer: null, posterbackgd: '/static/images/posterbackgd.png', //
iSplus: false, storeImage: '', //
navH: "", actionSheetHidden: true, //
navList: ['商品', '评价', '详情'], posterImage: '', //
opacity: 0, sharePacket: { //
scrollY: 0,
topArr: [],
toView: '',
height: 0,
heightArr: [],
lock: false,
scrollTop: 0,
storeInfo: {},
imgUrls: [],
sharePacket: {
isState: true, // isState: true, //
}, },
posters: false, // ========== nav + scroll ==========
weixinStatus: false, returnShow: true, // []
posterImageStatus: false, homeTop: 20, // top
canvasStatus: false, // height: 0, // height
storeImage: '', // scrollY: 0, // Y
promotionCode: '', // scrollTop: 0, // top
posterImage: '', // lock: false, // scroll
posterbackgd: '/static/images/posterbackgd.png', topArr: [], // nav top
navActive: 0, heightArr: [], // nav height
actionSheetHidden: false, navH: "", // nav
attrTxt: '', opacity: 0, // nav
cart_num: '', navList: ['商品', '评价', '详情'],
isAuto: false, // navActive: 0, // navList
imgTop: '', storeInfo: {},
qrcodeSize: 600,
H5ShareBox: false, //
errT: '',
returnShow: true,
homeTop: 20
} }
}, },
watch: { watch: {
@ -394,19 +382,13 @@
}, },
//#endif //#endif
onLoad(options) { onLoad(options) {
let that = this
this.$store.commit("PRODUCT_TYPE", 'normal'); this.$store.commit("PRODUCT_TYPE", 'normal');
this.$nextTick(() => { //
// #ifdef MP uni.getSystemInfo({
const menuButton = uni.getMenuButtonBoundingClientRect(); success: res => {
const query = uni.createSelectorQuery().in(this); this.height = res.windowHeight
query //res.windowHeight:px*2rpx98
.select('#home') },
.boundingClientRect(data => {
this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
})
.exec();
// #endif
}); });
// #ifdef MP // #ifdef MP
this.navH = app.globalData.navHeight; this.navH = app.globalData.navHeight;
@ -414,54 +396,33 @@
// #ifndef MP // #ifndef MP
this.navH = 96; this.navH = 96;
// #endif // #endif
//
uni.getSystemInfo({ //
success: function(res) { if (!options.scene && !options.id){
that.height = res.windowHeight this.$util.Tips({
//res.windowHeight:px*2rpx98 title: '缺少参数无法查看商品'
}, }, {
url: '/pages/index/index'
}); });
if (options.hasOwnProperty('id') || options.scene) { return;
}
// id
if (options.scene) { // if (options.scene) { //
// TODO code
let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene)); let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue); let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
app.globalData.spread = mapeMpQrCodeValue.spread; app.globalData.spread = mapeMpQrCodeValue.spread;
this.id = mapeMpQrCodeValue.id; this.id = mapeMpQrCodeValue.id;
// TODO code
setTimeout(()=>{ setTimeout(()=>{
spread(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {}) spread(mapeMpQrCodeValue.spread).then(res => {}).catch(res => {})
}, 2000) }, 2000)
} else { } else {
this.id = options.id; this.id = options.id;
} }
if (this.isLogin) {
//
this.combinationDetail(); this.combinationDetail();
} else {
// #ifdef H5 || APP-PLUS
try {
uni.setStorageSync('comGoodsId', options.id);
} catch (e) {}
// #endif
this.$Cache.set('login_back_url',
`/pages/activity/goods_combination_details/index?id=${options.id}&spread=${options.pid?options.pid:0}`
);
toLogin();
}
} else {
try {
let val = uni.getStorageSync('comGoodsId');
if (val != '') {
this.id = val
this.combinationDetail();
}
} catch (e) {
uni.showToast({
title: '参数错误',
icon: 'none',
duration: 1000,
mask: true,
})
}
}
}, },
//#ifdef MP //#ifdef MP
onShareAppMessage() { onShareAppMessage() {
@ -472,6 +433,20 @@
}; };
}, },
//#endif //#endif
onReady() {
this.$nextTick(() => {
// top
// #ifdef MP
const menuButton = uni.getMenuButtonBoundingClientRect();
const query = uni.createSelectorQuery().in(this);
query.select('#home')
.boundingClientRect(data => {
this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
})
.exec();
// #endif
});
},
methods: { methods: {
// ========== ========== // ========== ==========
combinationDetail() { combinationDetail() {

View File

@ -252,7 +252,6 @@
posters: false, // posters: false, //
weixinStatus: false, // weixinStatus: false, //
canvasStatus: false, // canvasStatus: false, //
imagePath: '', //
H5ShareBox: false, // H5ShareBox: false, //
posterbackgd: '/static/images/posterbackgd.png', // posterbackgd: '/static/images/posterbackgd.png', //
storeImage: '', // storeImage: '', //
@ -330,7 +329,6 @@
return; return;
} }
// id // id
if (options.hasOwnProperty('id') || options.scene){
if (options.scene) { // if (options.scene) { //
// TODO code // TODO code
let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene)); let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
@ -344,7 +342,6 @@
} else { } else {
this.id = options.id; this.id = options.id;
} }
}
// //
this.getSeckillDetail(); this.getSeckillDetail();