Commit 96b7f10c by wuwx

Merge branch 'develop' of 192.168.3.233:saas_plus/business-assistant into develop

2 parents f7f72493 dc017aff
......@@ -66,12 +66,12 @@ Page({
},
init() {
const sessionId = getSessionId(),
wx.nextTick(() => {
const sessionId = getSessionId(),
{
url,
targetPath = url ? decodeURIComponent(url) : ''
} = this.options
wx.nextTick(() => {
let path = 'pages.index',
obj = {}
if (targetPath) obj.targetPath = targetPath
......@@ -84,7 +84,7 @@ Page({
path = setRouteData(targetPath).url
obj = setRouteData(targetPath).obj
}
wx.$router.reLaunch(path, obj)
wx.$router.redirectTo(path, obj)
} else this.autoLogin(obj)
})
} else this.autoLogin(obj)
......
......@@ -8,7 +8,10 @@ Component({
properties: {
orderObj: {
type: Object,
value: () => { }
value: () => { },
observer(n) {
this.dealStaffList()
}
},
},
......@@ -68,12 +71,6 @@ Component({
}]
},
lifetimes: {
attached() {
this.dealStaffList()
},
},
/**
* 组件的方法列表
*/
......@@ -81,8 +78,10 @@ Component({
dealStaffList() {
var list = this.data.orderObj
list && list.activityList.forEach(item => {
item.showStaffList = item.staffList.length > 10 ? item.staffList.slice(0, 10) : item.staffList
item.staffList = item.staffList.length > 10 ? item.staffList.slice(10) : []
// 0-未开始;1-活动中;2-已结束
let sliceNum = item.actStatus == 2 ? 3 : 10
item.showStaffList = item.staffList.length > sliceNum ? item.staffList.slice(0, sliceNum) : item.staffList
item.staffList = item.staffList.length > sliceNum ? item.staffList.slice(sliceNum) : []
})
this.setData({
orderObj: list
......
......@@ -128,6 +128,7 @@
.th,
.td {
width: calc((100% - 116rpx) / 4);
.icon-rank {
width: 24rpx;
height: 24rpx;
......@@ -137,6 +138,13 @@
}
}
.tr-no-data {
text-align: center;
height: 32rpx;
line-height: 32rpx;
padding-bottom: 16rpx;
}
.btn-more {
height: 56rpx;
line-height: 56rpx;
......
......@@ -48,9 +48,7 @@
</block>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}">查看更多</view>
</view>
<view class="tr" wx:else>
<view>暂无数据</view>
</view>
<view class="tr-no-data" wx:else>暂无数据</view>
</view>
</view>
<!-- 诊断 -->
......@@ -65,10 +63,6 @@
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
<!-- <view class="suggest-step">
<view class="step-label">建议2</view>
<view class="step-txt">触达车主人数太少,建议与4S店关键人沟通注册员工的转发执行情况。</view>
</view> -->
</view>
</view>
</view>
......
<!--packageOutput/pages/summary/components/outputTransform/outputTransform.wxml-->
<!-- packageOutput/pages/summary/components/outputTransform/outputTransform.wxml -->
<view class="layout">
<view class="block" wx:for="{{formDataList}}" wx:key="index">
<view>
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{formData[item.name] || 0}}
<text wx:if="{{item.suffix}}">{{item.suffix}}</text>
</view>
<view class="label">{{item.label}}</view>
</view>
<view class="block" wx:for="{{formDataList}}" wx:key="index">
<view>
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{formData[item.name] || 0}}
<text wx:if="{{item.suffix}}">{{item.suffix}}</text>
</view>
<view class="label">{{item.label}}</view>
</view>
</view>
<navigator class="link" target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release">
<image class="icon-link" src="{{IMGURL}}output/icon-link.png?v={{img_version}}"></image>
查看订单详情</navigator>
\ No newline at end of file
<navigator
version="trial"
class="link"
target="miniProgram"
open-type="navigate"
app-id="wx570d9331f9ace0bd"
version="release">
<image class="icon-link" src="{{IMGURL}}output/icon-link.png?v={{img_version}}" />
查看订单详情
</navigator>
......@@ -228,7 +228,6 @@ Page({
actList.forEach((item, idx) => {
var curItem = res.find(k => k.goodsCategoryCode == item.productCode)
if (curItem) {
console.log(curItem)
curItem.totalNum = curItem.activityList.length
curItem.activityList.forEach(k => {
// 删---
......@@ -241,14 +240,14 @@ Page({
// 0-未开始;1-活动中;2-已结束
if (new Date(k.startTime) > new Date()) {
k.actStatus = 0
k.interDays = parseInt((new Date().getTime(k.startTime) - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
k.interDays = parseInt((new Date(k.startTime).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
} else if (new Date(k.startTime) < new Date() < new Date(k.endTime)) {
k.actStatus = 1
k.interDays = parseInt((new Date().getTime() - new Date(k.startTime).getTime()) / (1000 * 60 * 60 * 24)) + 1
k.toEndDays = parseInt((new Date(k.endTime).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
} else if (new Date(k.endTime) < new Date()) {
k.actStatus = 2
k.interDays = parseInt((new Date().getTime(k.endTime) - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
k.interDays = parseInt((new Date(k.endTime).getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) + 1
}
k.suggestTxtList = []
k.suggestList = []
......@@ -299,7 +298,6 @@ Page({
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
wx.$router.getData(obj => {
console.log(obj)
var scene = {}
Object.keys(this.data.sceneObj).forEach(item => {
scene[item] = obj[item]
......@@ -311,8 +309,6 @@ Page({
})
this.getSceneProStatus(this.data.sceneCodeList[this.data.sceneActive - 1])
// this.getCustomerDetail()
// this.setCurActivity()
})
},
......@@ -323,47 +319,5 @@ Page({
wx.setNavigationBarTitle({
title: this.data.merchantInfo.merchantName,
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
......@@ -36,10 +36,12 @@
</view>
</view>
</view>
<view class="isFullSucreen btn" wx:if="{{sceneActive != 1}}">
<view wx:if="{{ activityList[activityActive].productStatus != 2 && !merchantInfo.isSuper}}" class="btn-blue" bindtap="handleJump">点击开通</view>
<view wx:if="{{sceneActive != 1}}">
<view class="isFullSucreen btn" wx:if="{{ activityList[activityActive].productStatus != 2 && !merchantInfo.isSuper}}">
<view class="btn-blue" bindtap="handleJump">点击开通</view>
</view>
</view>
<view class="isFullSucreen btn" wx:else>
<view class="isFullSucreen btn" wx:if="{{sceneActive == 1}}">
<view class="btn-disabled">点击开通</view>
</view>
</view>
\ No newline at end of file
......@@ -22,17 +22,18 @@ Page({
// IMG_URL: `${IMG_URL}index`,
btnList: [
{
src: `${IMG_URL}index/down.png`,
name: "下载海报",
},
{
src: `${IMG_URL}index/wechat.png`,
name: "微信转发",
name: "转发给好友",
},
// {
// src: `${IMG_URL}index/moments.png`,
// name: "朋友圈分享",
// },
{
src: `${IMG_URL}index/down.png`,
name: "下载为海报",
},
],
// 4种场景下图片所有的高 (单位 rpx)
imgHeightArr: [
......@@ -151,7 +152,19 @@ Page({
// if(actNum&&activeNavIdx)return
// 设置标题
this.shareTitle = `给你分享一个${senceData[actNum]?.productList[activeNavIdx].proName}~`;
let userInfoObj = wx.$storage.get('userInfo')
// #服务商账号#取该分享者商户的联系人字段,无则取商户简称,无则取商户全称
let name
if (userInfoObj.name) {
name = userInfoObj.name
}else if(userInfoObj.merchantName){
name = userInfoObj.merchantName
}else if(userInfoObj.merchantName){
//全称
name = userInfoObj.merchantName
}
this.shareTitle = `${name}给你分享一个活动${senceData[actNum]?.productList[activeNavIdx].proName},戳我参与~`;
this.getImgInfo(actNum)
this.setData({
......@@ -185,10 +198,10 @@ Page({
let { index } = e.currentTarget.dataset;
switch (index) {
case 0:
this.wechatFn();
this.download();
break;
case 1:
this.download();
this.wechatFn();
break;
}
},
......@@ -204,7 +217,7 @@ Page({
// let wx_user_info = wx.$storage.get("wx_user_info");
// console.log('wx_user_info: ', wx_user_info.appId);
wx.showLoading({
title: "下载中",
title: "海报生成中...",
});
let params = {
actNum,
......@@ -412,6 +425,7 @@ Page({
this.setData({
hasUserInfo: true,
});
let _this = this;
// 推荐使用 wx.getUserProfile 获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
......@@ -431,10 +445,23 @@ Page({
};
// console.log('obj',obj)
wx.$storage.set("wx_user_info", obj);
// this.onLoad(null);
_this.onLoad(null);
},
});
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
// console.log("滚动结束");
wx.$eventbus.emit('evt_page_scroll',{scrollTop:e.scrollTop})
}, 500);
};
})(),
/**
* 生命周期函数--监听页面初次渲染完成
......
......@@ -15,14 +15,15 @@
z-index: 2;
.img-wrap {
position: absolute;
top: 20%;
top: 15%;
left: 50%;
transform: translateX(-50%);
// width: 225px;
width: 60%;
height: 311px;
height: 54%;
// background-color: red;
overflow: auto;
border-radius: 16rpx;
.prod-item {
background-color: #f5f7fb;
.prod-item {
......@@ -105,48 +106,69 @@
background-color: #fff;
}
}
.btns {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 154px;
background: #ffffff;
border-radius: 8px 8px 0 0;
.top {
display: flex;
justify-content: space-around;
.btn {
padding-top: 16px;
}
.img {
display: block;
margin: 0 auto 8px;
width: 40px;
height: 40px;
}
.name {
font-size: 12px;
color: #323436;
text-align: center;
}
.btn-wechat {
width: auto;
margin: 0;
padding: 0;
background-color: #fff;
}
}
.btns-wrap {
padding-bottom: 84rpx;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 120rpx;
background: #ffffff;
z-index: 1;
// border-radius: 8px 8px 0 0;
.top {
display: flex;
justify-content: space-around;
.btn {
padding-top: 16px;
}
.btom {
margin: 18px auto 0;
width: 343px;
height: 44px;
line-height: 44px;
border: 1px solid #eeeeee;
border-radius: 4px;
.img {
display: block;
margin: 0 auto 8px;
width: 40px;
height: 40px;
}
// .name {
// font-size: 12px;
// color: #323436;
// text-align: center;
// }
.name0{
width: 256rpx;
height: 88rpx;
border: 1px solid #EEEEEE;
border-radius: 8rpx;
font-size: 28rpx;
color: #8A8C90;
text-align: center;
line-height:88rpx;
}
.name1{
width: 414rpx;
height: 88rpx;
background: #3666FE;
border-radius: 8rpx;
font-size: 28rpx;
color: #FFFFFF;
line-height:88rpx;
}
.btn-wechat {
width: auto;
margin: 0;
padding: 0;
background-color: #fff;
}
}
.btom {
margin: 18px auto 0;
width: 343px;
height: 44px;
line-height: 44px;
border: 1px solid #eeeeee;
border-radius: 4px;
text-align: center;
}
}
/* 用户授权 */
......@@ -156,6 +178,6 @@
left: 0;
right: 0;
bottom: 0;
z-index: 2;
z-index: 3;
background-color: transparent;
}
<!--pages/checkProduct/checkProduct.wxml-->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">{{senceData[actNum].productList[activeNavIdx].proName}}</navigation-bar>
<!-- pages/checkProduct/checkProduct.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
{{senceData[actNum].productList[activeNavIdx].proName}}
</navigation-bar>
<!-- <view style="height:{{headerHeight}}px">
</view> -->
<product stickyTop="{{headerHeight}}" class="productCon" style="padding-top:{{headerHeight}}px" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" bindauthorized="authorizedFn" />
<!-- style="padding-top:{{headerHeight}}px" -->
<product stickyTop="{{headerHeight}}" class="productCon" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" bindauthorized="authorizedFn" />
<!-- 分享弹框 -->
<!-- <shareModel actNum="{{actNum}}" isShow="{{isShow}}" bindmodelclose="modelcloseFn" /> -->
<view class="share-wrap" wx:if="{{isShow}}">
{{IMG_URL}}
<!-- <view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<!-- <text class="img-desc">轻改类</text>
<image src="{{IMGURL}}discovery_prod1.png" /> -->
<image src="{{IMG_URL}}index/prod/{{senceData[actNum].productList[activeNavIdx].img}}.png" />
</view>
<view class="prod-info">
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<image src="{{IMG_URL}}index/prod/{{senceData[actNum].productList[activeNavIdx].img}}.png" />
</view>
<view class="prod-info">
<text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text>
<!-- senceData[actNum]['productList'][activeNavIdx].changeSale || -->
<text class="sale" decode="{{true}}">{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}}&nbsp;<text class="sale-num">{{senceData[actNum]['productList'][activeNavIdx].varType == 1? senceData[actNum]['productList'][activeNavIdx].flow : senceData[actNum]['productList'][activeNavIdx].sale}}</text>
<text class="sale" decode="{{true}}">
{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}}&nbsp;
<text class="sale-num">
{{senceData[actNum]['productList'][activeNavIdx].varType == 1? senceData[actNum]['productList'][activeNavIdx].flow : senceData[actNum]['productList'][activeNavIdx].sale}}
</text>
</text>
<text class="earnings" decode="{{true}}">预估收益&nbsp;<text class="earnings-num">{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
<text class="earnings" decode="{{true}}">
预估收益&nbsp;
<text class="earnings-num">
{{senceData[actNum]['productList'][activeNavIdx].profit}}
</text>
</text>
</view>
<!-- <view class="" bindtap="downVideo" data-src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/video/360_AR.mp4?v=" hover-class="none" hover-stop-propagation="false">
视频下载
</view> -->
</view>
</view>
<image class="img" style="height:{{imgHeight}}px" src="{{IMG_URL}}index/longpic{{actNum+1}}.png" bindload="onloadFn" />
<!-- <block wx:for="{{imgList}}" wx:key="*this">
<image mode="widthFix" class="img" src="{{item}}"/>
</block> -->
</view>
</view>
</view>
<button></button>
<view class="btns">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<block wx:if="{{index == 0}}">
<button open-type="share" class="btn-wechat">
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
</button>
</block>
<block wx:else>
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
</block>
</view>
</view> -->
<!-- 用于图片加载事件 -->
<image class="img" src="{{IMG_URL}}index/longpic{{actNum+1}}.png" bindload="onloadFn" />
<view class="btns-wrap" wx:if="{{isShow}}">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<block wx:if="{{index == 1}}">
<button open-type="share" class="btn-wechat">
<view class="name{{index}}">{{item.name}}</view>
</button>
</block>
<block wx:else>
<view class="name{{index}}">{{item.name}}</view>
</block>
</view>
<view class="btom" bindtap="modelcloseFn">取消</view>
</view>
<!-- <view class="btom" bindtap="modelcloseFn">取消</view> -->
</view>
<!-- 授权昵称 -->
<!-- !hasUserInfo && !isShow -->
<view wx:if="{{!hasUserInfo && isShare && isAuthphone}}" class="user-profile" bindtap="getUserProfile"></view>
<view wx:if="{{!hasUserInfo && isShare && isAuthphone}}" class="user-profile" bindtap="getUserProfile"></view>
\ No newline at end of file
......@@ -49,9 +49,19 @@ Component({
* 组件的方法列表
*/
methods: {
navWebView(e) {
let { valueUrl } = e.currentTarget.dataset
wx.$router.jumpH5(valueUrl)
preView(e) {
let { valueurl } = e.currentTarget.dataset
// console.log(e)
// console.log(valueUrl)
// let urls = []
// urls.push(valueUrl)
// // wx.$router.jumpH5(valueUrl)
// console.log(urls)
// console.log([valueUrl])
wx.$api.previewImage({
urls: [valueurl],
current: valueurl
})
},
copyLink(e) {
console.log(e)
......
......@@ -37,7 +37,7 @@
<view class="warReportBox" wx:if="{{item.messageType == 2}}">
<view class="item">
<view class="label">当前产值</view>
<view class="num">{{item.currentValue}}元</view>
<view class="num">{{item.currentValue||'0.0'}}元</view>
</view>
</view>
<view class="warReportBox" wx:if="{{item.messageType == 3}}">
......@@ -47,12 +47,18 @@
</view>
<view class="item">
<view class="label">完成目标</view>
<view class="num">{{item.completeRate}}%</view>
<view class="num">{{item.completeRate}}</view>
</view>
</view>
<view class="warReportLink">
<view class="label">点击了解详情:</view>
<view class="link" data-valueUrl="{{item.valueUrl}}" bind:tap="navWebView">战报详情</view>
<view
class="link"
wx:if="{{item.valueUrl}}"
data-valueurl="{{item.valueUrl}}"
bind:tap="preView">
战报详情
</view>
</view>
</msg-box>
</scroll-view>
......@@ -83,15 +89,21 @@
</view>
<view class="cell" wx:if="{{item.messageType == 1}}">
<view class="label">开始时间:</view>
<view class="value">{{item.activityStartTime}}</view>
<view class="value">{{item.activityStartTime||'-'}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 1}}">
<view class="label">结算时间:</view>
<view class="value">{{item.activityEndTime}}</view>
<view class="value">{{item.activityEndTime||'-'}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 1}}">
<view class="label">活动链接:</view>
<view class="link" bind:tap="copyLink" data-url="{{item.activityUrl}}">点击复制活动链接</view>
<view
class="link"
wx:if="{{item.activityUrl}}"
bind:tap="copyLink"
data-url="{{item.activityUrl}}">
点击下载活动二维码
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="label">产品名称:</view>
......
......@@ -49,25 +49,64 @@ Component({
IMGURL: `${IMG_URL}index/`,
videoBaseUrl,
getMoreBtn:false,
showVideo:true //显示视频列表
showVideo:true, //显示视频列表
imgTopArr:[]
},
lifetimes: {
ready: function () {
if(!this.data.outshowVideo){
this.init();
this.getImgHeight();
console.log('ready')
//获取当前路径
let currentUrl = this.getCurrentPageUrl()
// console.log('currentUrl: ', currentUrl);
if(currentUrl == '/pages/tab/index/index'){
this.setData({
currentUrl:false
})
}
//监听页面滚动的距离
wx.$eventbus.on('evt_page_scroll',async (e)=>{
console.log(e)
// let heightTop = this.data.stickyTop// 90 场景高度,8 场景margin-bottom
// let prodArr = await this.getHeight('.prod-wrap')
// // console.log('prodArr: ', prodArr);
// heightTop += prodArr[0].height
// let imgArr = await this.getHeight('.img-item')
// // console.log('imgArr: ', imgArr);
// let imgHeightArr = []
// imgArr.reduce((pre,cur,index)=>{
// imgHeightArr.push(pre+cur.height)
// return pre+cur.height
// },heightTop)
let imgTopArr = this.data.imgTopArr
console.log('imgTopArr: ', imgTopArr);
if(imgTopArr.length == 0)return
wx.nextTick(()=>{
let idx = imgTopArr.findIndex(item => item > e.scrollTop)
if(idx>-1){
this.setData({
curTabIdx: idx
})
}
})
})
if(!this.data.outshowVideo){
this.setData({
showVideo:false
})
}
this.init();
this.getImgHeight();
//如果不是分享,初始化的时候调用函数
if (!this.data.isShare) {
// console.log(131546)
this.getMoreFn();
}
},
},
observers: {
actNum: function (newval, oldval) {
......@@ -112,7 +151,7 @@ Component({
activeNavIdx: 0,
});
// 每次切换场景,重新获取流程图高度
this.getImgHeight();
// this.getImgHeight();
this.getMoreFn();
// this
if(this.data.wrapactiveNavIdx){
......@@ -122,11 +161,16 @@ Component({
}
},
},
/**
* 组件的方法列表
*/
methods: {
getCurrentPageUrl() {
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const url = `/${currentPage.route}`
return url
},
async init() {
try {
const { data, code, message } = await USERAPI.wxCodeLogin();
......@@ -175,58 +219,98 @@ Component({
saleTextChange(e) {},
changeTab(e) {
let idx = e.detail;
this.setData({
intoViewId: `to-${idx}`,
});
let {imgTopArr,stickyTop} = this.data
console.log('idx: ', imgTopArr[idx],stickyTop);
// this.setData({
// intoViewId: `to-${idx}`,
// });
// wx.$eventbus.emit('evt_page_index',idx)
//判断当前路径
let currentUrl = this.getCurrentPageUrl()
if(currentUrl == '/pages/tab/index/index'){
wx.pageScrollTo({ scrollTop: imgTopArr[idx]-stickyTop+88+34})
}else{
wx.pageScrollTo({ scrollTop: (imgTopArr[idx]-stickyTop)})
}
},
// async changeTab(e){
// let idx = e.detail
// this.setData({
// intoViewId: `to-${idx}`
// })
// let heightTop = this.data.headerHeight + 90 - 16 - 46 // 90 场景高度,16 可能是误差 , 46 tab高度
// let prodArr = await this.getHeight('.prod-wrap')
// heightTop += prodArr[0].height
// let imgArr = await this.getHeight('.img-item')
// for(let i=0;i<idx;i++){
// heightTop += imgArr[i].height
// }
// wx.pageScrollTo({
// scrollTop: heightTop,
// duration: 0
// })
// },
getHeight(cla){
return new Promise((resolve,reject)=>{
let query = wx.createSelectorQuery().in(this)
query.selectAll(cla).boundingClientRect((rect) => {
resolve(rect)
}).exec()
})
},
changeNav(event) {
this.setData({
activeNavIdx: event.target.dataset.index,
});
},
scrolltoupper(event) {
console.log(event.detail.scrollHeight,event.detail.scrollTop)
const idx = this.data.heightArr.findIndex(
(item) => item > event.detail.scrollHeight
);
console.log('idx',idx)
this.setData({
curTabIdx: idx,
});
// scrolltoupper(event) {
// console.log(event.detail.scrollHeight,event.detail.scrollTop)
// const idx = this.data.heightArr.findIndex(
// (item) => item > event.detail.scrollHeight
// );
// console.log('idx',idx)
// this.setData({
// curTabIdx: idx,
// });
// console.log(this.data.curTabIdx1)
},
// // console.log(this.data.curTabIdx1)
// },
getImgHeight() {
let query = wx.createSelectorQuery().in(this);
let heightArr = [];
let imgTopArr = []
let s = 0;
let top
let _this = this
query
.selectAll(".img-item")
.boundingClientRect((react) => {
react.forEach((item) => {
s += item.height;
heightArr.push(s);
react.forEach((item,index) => {
console.log('item: ', item);
// if(index == 0){
// console.log('item top: ', item);
// top = item.top
// }
// s = s +item.height;
s = item.top
// heightArr.push(s);
imgTopArr.push(s)
});
this.data.heightArr = heightArr;
// console.log(heightArr[heightArr.length-1])
this.data.allHeight = heightArr[heightArr.length - 1];
// heightArr = heightArr.map((item)=>{
// item += top
// return item
// })
// this.data.heightArr = heightArr;
// // console.log(heightArr[heightArr.length-1])
// this.data.allHeight = heightArr[heightArr.length - 1];
// console.log('imgTopArr',imgTopArr)
_this.setData({
imgTopArr
})
})
.exec();
// let query = wx.createSelectorQuery().in(this);
// let heightArr = [];
// let s = 0;
// query
// .selectAll(".img-item")
// .boundingClientRect((react) => {
// react.forEach((item) => {
// // s += item.height;
// heightArr.push(item.top);
// });
// this.data.heightArr = heightArr;
// // console.log(heightArr[heightArr.length-1])
// this.data.allHeight = heightArr[heightArr.length - 1];
// })
// .exec();
},
// 获取用户信息
getUserInfo({ detail }) {
......
......@@ -348,9 +348,12 @@
.video-list {
display: flex;
flex-wrap: wrap;
padding: 0 32rpx;
padding: 0rpx 32rpx;
font-size: 0;
}
.check-prod .video-list{
padding-bottom: 140rpx;
}
.video-item {
position: relative;
width: calc(50% - 12rpx);
......
<!-- pages/tab/discovery/components/product/product.wxml -->
<view class="prod-wrap">
<view class="prod-wrap" >
<view class="big-title">特色产品</view>
<scroll-view class="nav-wrap" scroll-x="{{true}}" wx:if="{{!isShare && origin =='home'}}">
<block wx:for="{{navList}}" wx:key="index">
......@@ -28,7 +28,7 @@
</view>
</view>
</view>
<view class="project-wrap">
<view class="project-wrap {{currentUrl == ''? '':'check-prod'}}">
<!-- -->
<view class="stickyTab" style="top:{{isShare ? stickyTop+88 : stickyTop}}rpx">
<tab
......@@ -40,12 +40,11 @@
productHeight
/>
</view>
<!-- style="{height:{{allHeight}}px}" -->
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
<scroll-view
class="project-img"
scroll-into-view="{{intoViewId}}"
bindscroll="scrolltoupper"
scroll-y="{{true}}"
>
<block wx:for="{{tab}}" wx:key="index">
<!-- wx:if="{{showVideo && index==5 && tab.length < 5}}" -->
......
......@@ -247,7 +247,7 @@ var senceData = [
"sceneCode":"SC001",
productList: [
{
img: 'product-img1',
img: 'product-img9',
proName: '新能源0元换购',
price: '100',
// profit: '92.4万',
......
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import { senceData } from './constant/data'
const IMAGES = Object.freeze({
arrow: `${IMG_URL}/index/point.png`,
actArrow: `${IMG_URL}/index/actArrow.png`
})
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = '../../../images/'
......@@ -13,6 +16,7 @@ Page({
* 页面的初始数据
*/
data: {
IMAGES,
navStyle,
IMG_URL,
IMG_URLLocal,
......@@ -307,17 +311,17 @@ Page({
visible: false
})
// this.showCase();
if (!this.data.isFirst) {
// if (!this.data.isFirst) {
wx.showToast({
title: '测算结果已在页面内同步展示',
icon: 'none',
duration: 2000
})
} else {
this.setData({
isFirst: false
})
}
// } else {
// this.setData({
// isFirst: false
// })
// }
},
// // 获取场景下的产品类型
// getProductType(sceneIndex, tabIndex) {
......@@ -631,7 +635,18 @@ Page({
// console.log('this.data.tabBarStyle',this.data.tabBarStyle,this.data.headerHeight)
// })
},
onPageScroll: (function () {
let timer = null;
return function (e) {
// console.log("在滚动");
// 监听页面的滚动开始和结束
clearTimeout(timer);
timer = setTimeout(() => {
// console.log("滚动结束");
wx.$eventbus.emit('evt_page_scroll',{scrollTop:e.scrollTop})
}, 500);
};
})(),
/**
* 生命周期函数--监听页面隐藏
*/
......
......@@ -386,18 +386,18 @@ page {
position: fixed;
right: -4px;
top: 60%;
width: 60px;
height: 60px;
width: 64px;
height: 64px;
border-radius: 50%;
z-index: 2;
}
.output-value {
position: fixed;
right: 5px;
right: -2px;
top: 70%;
width: 40px;
height: 50px;
width: 64px;
height: 64px;
// border-radius: 50%;
z-index: 2;
}
......
......@@ -21,9 +21,25 @@ class NetWork {
})
} else {
if (this[ISCOMMECTED]) {
const thisPage = wx.$router.getPageInstance(),
options = Object.keys(thisPage.options)
this[ISCOMMECTED] = false
wx.showLoading()
this.refreshPage()
if (thisPage.noPageAuth) {
wx.showLoading()
this.refreshPage()
} else {
let url = `/${thisPage.route}`
if (options.length) {
let query = []
options.map(key => {
query.push(`${key}=${thisPage.options[key]}`)
})
url += `?${query.join('&')}`
}
wx.$router.redirectTo('login.loading', {
url
})
}
}
}
})
......
......@@ -115,7 +115,7 @@ class Share {
WXUSERINFO,
USERINFO
} = this.getCommonData(),
thisPage = wx.$router.getPageInstance()
thisPage = wx.$router.getPageInstance().options
query = `${query? `?${query}&`:'?'}merchantId=${thisPage.merchantId ||USERINFO.merchantId || ''}&shareOpenId=${thisPage.shareOpenId || WXUSERINFO.openId || ''}&sharePhone=${thisPage.sharePhone || USERINFO.phone || ''}`
return query
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!