【订单详情】

1. onLoad 的注释补全
2. onReady 的注释补全
pull/1/MERGE
YunaiV 2023-06-07 23:07:57 +08:00
parent dcbe6241f0
commit ed2ea5876c
2 changed files with 48 additions and 47 deletions

View File

@ -59,7 +59,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "123", "appid" : "wx63c280fe3248a3e7",
"setting" : { "setting" : {
"urlCheck" : true, "urlCheck" : true,
"minified" : true, "minified" : true,

View File

@ -15,7 +15,6 @@
<view id="home" class="home acea-row row-center-wrapper iconfont icon-xiangzuo" :class="opacity > 0.5?'on':''" <view id="home" class="home acea-row row-center-wrapper iconfont icon-xiangzuo" :class="opacity > 0.5?'on':''"
:style="{ top: homeTop + 'rpx' }" v-if="returnShow" @tap="returns"> :style="{ top: homeTop + 'rpx' }" v-if="returnShow" @tap="returns">
</view> </view>
<!-- <view class='iconfont icon-xiangzuo' :style="'top:'+navH/2+'rpx'" @tap='returns'></view> -->
<view> <view>
<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true" <scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true"
:style='"height:"+height+"px;"' @scroll="scroll"> :style='"height:"+height+"px;"' @scroll="scroll">
@ -384,7 +383,6 @@
weixinStatus: false, // TODO weixinStatus: false, // TODO
H5ShareBox: false, // TODO H5ShareBox: false, // TODO
activityH5: [], // TODO activityH5: [], // TODO
retunTop: true, // TODO
navH: "", // nav navH: "", // nav
navList: [], // nav navList: [], // nav
navActive: 0, // nav navActive: 0, // nav
@ -406,7 +404,7 @@
imagePath: '', // TODO imagePath: '', // TODO
imgTop: '', // TODO imgTop: '', // TODO
errT: '', // TODO errT: '', // TODO
homeTop: 20, // TODO homeTop: 20, // top
navbarRight: 0, // TODO navbarRight: 0, // TODO
returnShow: true, // // TODO returnShow: true, // // TODO
type: "" // TODO type: "" // TODO
@ -426,28 +424,28 @@
} }
}, },
onLoad(options) { onLoad(options) {
let that = this // nav
var pages = getCurrentPages(); const pages = getCurrentPages();
that.returnShow = pages.length !== 1; this.returnShow = pages.length !== 1;
if (pages.length <= 1) { this.navH = app.globalData.navHeight;
that.retunTop = false
}
that.navH = app.globalData.navHeight;
// #ifdef MP || APP-PLUS
// id
// TODO
setTimeout(()=>{
if(options.spread){
app.globalData.spread = options.spread;
spread(options.spread).then(res => {})
}
},2000)
// #endif
uni.getSystemInfo({ uni.getSystemInfo({
success: function(res) { success: ( res ) => {
that.height = res.windowHeight; this.height = res.windowHeight;
}, }
}); });
// #ifdef MP || APP-PLUS
// id
// TODO
setTimeout(()=>{
if(options.spread){
app.globalData.spread = options.spread;
spread(options.spread).then(res => {})
}
},2000)
// #endif
//
if (!options.scene && !options.id) { if (!options.scene && !options.id) {
this.$util.Tips({ this.$util.Tips({
title: '缺少参数无法查看商品' title: '缺少参数无法查看商品'
@ -456,46 +454,52 @@
}); });
return; return;
} }
if (options.hasOwnProperty('id') || options.scene) { let that = this
// id
if (options.hasOwnProperty('id') || options.scene) {
if (options.scene) { // if (options.scene) { //
let qrCodeValue = that.$util.getUrlParams(decodeURIComponent(options.scene)); // TODO code
let mapeMpQrCodeValue = that.$util.formatMpQrCodeData(qrCodeValue); let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
app.globalData.spread = mapeMpQrCodeValue.spread; app.globalData.spread = mapeMpQrCodeValue.spread;
this.id = mapeMpQrCodeValue.id; this.id = mapeMpQrCodeValue.id;
setTimeout(()=>{ // TODO code
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;
} }
options.type == undefined || options.type == null ? that.type = 'normal' : that.type = options.type; // type
that.$store.commit("PRODUCT_TYPE", that.type); if (options.type === undefined || options.type == null) {
this.type = 'normal'
} else {
this.type = options.type
}
this.$store.commit("PRODUCT_TYPE", that.type);
} }
//
this.getGoodsDetails(); this.getGoodsDetails();
if (true) {
return;
}
this.getCouponList(); this.getCouponList();
this.getProductReplyList(); this.getProductReplyList();
this.getProductReplyCount(); this.getProductReplyCount();
this.getGoods(); this.getGoods();
}, },
onReady() { onReady() {
this.$nextTick(function() { this.$nextTick(() => {
// top
// #ifdef MP // #ifdef MP
const menuButton = uni.getMenuButtonBoundingClientRect(); const menuButton = uni.getMenuButtonBoundingClientRect();
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
query query.select('#home')
.select('#home') .boundingClientRect(data => {
.boundingClientRect(data => {
this.homeTop = menuButton.top * 2 + menuButton.height - data.height; this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
}) })
.exec(); .exec();
// #endif
// #ifdef H5
// const clipboard = new ClipboardJS('.copy-data');
// clipboard.on('success', () => {
// this.$util.Tips({
// title: ''
// });
// });
// #endif // #endif
}); });
}, },
@ -627,7 +631,6 @@
} }
// //
if (item.activityH5 && item.activityH5.type == 1) { if (item.activityH5 && item.activityH5.type == 1) {
debugger
uni.redirectTo({ uni.redirectTo({
url: `/pages/activity/goods_seckill_details/index?id=${item.activityH5.id}` url: `/pages/activity/goods_seckill_details/index?id=${item.activityH5.id}`
}) })
@ -770,14 +773,13 @@
that.infoScroll(); that.infoScroll();
}, 500); }, 500);
// #ifdef MP // #ifdef MP
that.imgTop = res.data.productInfo.image that.imgTop = spu.picUrl
// #endif // #endif
// #ifndef H5 // #ifndef H5
that.downloadFilestoreImage(); that.downloadFilestoreImage();
// #endif // #endif
that.selectDefaultSku(); that.selectDefaultSku();
}).catch(err => { }).catch(err => {
//
return that.$util.Tips({ return that.$util.Tips({
title: err.toString() title: err.toString()
}, { }, {
@ -1055,7 +1057,6 @@
} }
// #endif // #endif
this.posters = true; this.posters = true;
} }
}, },
closePosters: function() { closePosters: function() {