Commit 81cb1b8d authored by Mac's avatar Mac

提交

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