Commit 81cb1b8d authored by Mac's avatar Mac

提交

parent 2c1f00a6
......@@ -55,7 +55,7 @@
"sdkConfigs" : {
"share" : {
"weixin" : {
"appid" : "wxacd9f8cc3480d29e",
"appid" : "wxcf0727a7c78b501e",
"UniversalLinks" : ""
}
}
......@@ -66,7 +66,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wxacd9f8cc3480d29e",
"appid" : "wxcf0727a7c78b501e",
"setting" : {
"urlCheck" : false,
"minified" : false
......
......@@ -404,7 +404,7 @@
<view style="width: 100%;height: 15px;background: #FAF8F9;" ></view>
<view class="comment" style="padding-bottom: 80px;">
<view class="title-t" >
<view style="display: flex;flex-direction: row;justify-content: space-between;" @click="gocomment()">
<view style="display: flex;flex-direction: row;justify-content: space-between;width: 100%;" @click="gocomment()">
评价{{count>0?'('+count+')':''}}
<u-icon name="arrow" :size="30" color="#666666"></u-icon>
</view>
......
......@@ -272,11 +272,8 @@
}
</style>
<template>
<scroll-view class='storeDetails'
:scroll-y="true"
@scroll="scrollHandler"
@scrolltoupper="scrollTopHandler"
:scroll-top="intoscrollTop"
<view class='storeDetails'
>
<view class="details-box u-skeleton" >
......@@ -380,6 +377,7 @@
</view>
</view>
<view style="width: 100%;height: 15px;background: #FAF8F9;"></view>
<!-- tabs的切换 -->
<view class="store-tabs">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" :active-color="mc"></u-tabs>
......@@ -497,8 +495,6 @@
<h-parse :content="detailContent" @navigate="clickDescription"></h-parse>
</view>
</view>
<u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>
......@@ -511,7 +507,7 @@
@closeBtn="closeBtn"
></coupon>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</scroll-view>
</view>
</template>
<script>
......@@ -659,39 +655,71 @@
this.secondary = this.$uiConfig.secondary;
this.nav = uni.getMenuButtonBoundingClientRect().top;
this.headStyle.paddingTop = this.nav +'px';
uni.createSelectorQuery().select(".headStatus").boundingClientRect(data=>{//目标节点
if(data && data.height){
this.headH = data.height
}
}).exec();
uni.createSelectorQuery().select(".store-tabs").boundingClientRect(data=>{
if(data && data.top){
this.stickyH = data.top
}
}).exec();
uni.createSelectorQuery().select(".setmeal-box").boundingClientRect(data=>{
if(data && data.top){
this.setmealH = data.top
}
}).exec();
uni.createSelectorQuery().select(".designer").boundingClientRect(data=>{
if(data && data.top){
this.designerH = data.top
}
}).exec();
uni.createSelectorQuery().select(".richtext").boundingClientRect(data=>{
if(data && data.top){
this.richtextH = data.top
},
onReady(){
setTimeout(()=>{
this.$utils.getRect('.setmeal-box').then(res => {
if(res && res.top){
this.setmealH = res.top
}
})
this.$utils.getRect('.designer').then(res => {
if(res && res.top){
this.designerH = res.top
}
})
this.$utils.getRect('.comment').then(res => {
if(res && res.top){
this.commentH = res.top
}
})
this.$utils.getRect('.richtext').then(res => {
if(res && res.top){
this.richtextH = res.top
}
})
},1000)
},
onPageScroll(e){
// console.log(e)
this.scrollTop = e.scrollTop;
if(this.scrollTop>=this.stickyH-this.headH){
this.showSticky=true
}
if(this.stickyH-this.headH>this.scrollTop){
this.showSticky=false
}
},
mounted() {
this.$utils.getRect('.headStatus').then(res => {
if(res && res.height){
this.headH = res.height
}
}).exec();
uni.createSelectorQuery().select(".comment").boundingClientRect(data=>{
if(data && data.top){
this.commentH = data.top
})
this.$utils.getRect('.store-tabs').then(res => {
if(res && res.top){
this.stickyH = res.top
}
}).exec();
})
},
methods:{
getRect(){
return uni.createSelectorQuery().select(selector).boundingClientRect(data=>{
if(data && data.top){
this.stickyH = data.top
}
}).exec();
},
init() {
this.loading = true;
this.request2(
......@@ -771,15 +799,7 @@
if(this.stickyH-this.headH>this.scrollTop){
this.showSticky=false
}
// if(this.scrollTop >this.setmealH+40 &&this.scrollTop<this.designerH){
// this.current= 0;
// }else if(this.scrollTop >this.designerH+40 && this.scrollTop<this.richtextH){
// this.current= 1;
// }else if(this.scrollTop >this.richtextH+40 && this.scrollTop<this.commentH){
// this.current= 2;
// }else if(this.scrollTop >this.commentH+40 ){
// this.current= 3;
// }
//this.$forceUpdate();
},
scrollTopHandler() {
......@@ -788,26 +808,30 @@
goback(){
uni.navigateBack({})
},
change(e){
this.current= e;
let scrollTop= 0;
let that = this
if(e==0){
scrollTop=this.setmealH
uni.pageScrollTo({
scrollTop: that.setmealH - that.headH -40-30
})
}else if(e==1){
scrollTop=this.designerH
uni.pageScrollTo({
scrollTop: that.designerH - that.headH -40-30
})
}else if(e==2){
scrollTop=this.richtextH
uni.pageScrollTo({
scrollTop: that.commentH - that.headH -40-30
})
}else if(e==3){
scrollTop=this.commentH
uni.pageScrollTo({
scrollTop: that.richtextH - that.headH -40-30
})
}
this.$nextTick(function() {
this.showSticky=true
setTimeout(()=>{
this.intoscrollTop = scrollTop - this.headH -40-30;
},100)
});
},
gophone(){
uni.makePhoneCall({
......
......@@ -3,9 +3,10 @@ export default {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.0.110:8200"
// Vue.prototype.host2 = "https://mallApi.oytour.com"
Vue.prototype.host2 = "http://192.168.1.5:8088"
// Vue.prototype.host2 = "http://192.168.1.5:8088"
// Vue.prototype.host2 = "http://192.168.1.21"
// Vue.prototype.host2 = "http://192.168.1.27:8200"
Vue.prototype.host2 = "http://192.168.1.27:8200"
Vue.prototype.request = function(param, success, failed) {
//网络请求
uni.request({
......@@ -39,8 +40,8 @@ export default {
'content-type': "application/json"
},
data: {
MallBaseId: 1,
TenantId: 1,
MallBaseId: 2,
TenantId: 12,
OpenId: this.GetOpenId().OpenId,
UserId: this.GetOpenId().UserId,
SmallShopsId: this.GetOpenId().SmallShopsId,
......@@ -114,8 +115,8 @@ export default {
}
// 获取小程序APPID
Vue.prototype.GetMiniAppId = function() {
return 'wxacd9f8cc3480d29e'
// return 'wxcf0727a7c78b501e' //旅小友
// return 'wxacd9f8cc3480d29e'
return 'wxcf0727a7c78b501e' //旅小友
// return 'wx01350b305d45a63e' //饭粒汪
}
......
......@@ -17,9 +17,22 @@ function SystemInfo(){//获取屏幕宽高
})
return SystemInfo
}
function getRect(selector){//获取元素的信息
return new Promise((resolve) => {
let view = uni.createSelectorQuery().select(selector);
view.fields({
size: true,
rect: true,
scrollOffset:true
}, (res) => {
resolve(res);
}).exec();
})
}
export default {
calcContentHeight,
SystemInfo
SystemInfo,
getRect
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment