parent
dcbe6241f0
commit
ed2ea5876c
|
@ -59,7 +59,7 @@
|
||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "123",
|
"appid" : "wx63c280fe3248a3e7",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : true,
|
"urlCheck" : true,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue