Commit 80478e51 by 张立顺

bugfix

2 parents ecdd6625 fb7f082b
...@@ -138,6 +138,7 @@ Page({ ...@@ -138,6 +138,7 @@ Page({
console.log("分享options: ", options); console.log("分享options: ", options);
if (!options || utils.isEmptyObj(options)) return; if (!options || utils.isEmptyObj(options)) return;
// if(!Object.keys(options).includes('actNum'))return // if(!Object.keys(options).includes('actNum'))return
let {senceData} = this.data
//选中场景的index,和产品的index //选中场景的index,和产品的index
let { let {
...@@ -326,7 +327,7 @@ Page({ ...@@ -326,7 +327,7 @@ Page({
* 生命周期函数--监听页面加载 (扫码,分享链接) * 生命周期函数--监听页面加载 (扫码,分享链接)
*/ */
async onLoad(options) { async onLoad(options) {
this.getData() await this.getData()
console.log("分享options12255565: ", options); console.log("分享options12255565: ", options);
// actNum,activeNavIdx isShare // actNum,activeNavIdx isShare
if (!options || utils.isEmptyObj(options)) return; if (!options || utils.isEmptyObj(options)) return;
...@@ -338,12 +339,14 @@ Page({ ...@@ -338,12 +339,14 @@ Page({
isShare: true, isShare: true,
}); });
let ercodeParams = await this.analysisQRcode(options.scene); let ercodeParams = await this.analysisQRcode(options.scene);
options = utils.parseString(ercodeParams.scene); options = JSON.parse(ercodeParams.scene)
} }
let {senceData} = this.data
// 扫码进来 // 扫码进来
let { actNum, activeNavIdx, isShare } = options; let { actNum, activeNavIdx, isShare } = options;
if (isShare == "true") { console.log('actNum, activeNavIdx, isShare: ', actNum, activeNavIdx, isShare);
if (isShare) {
this.setData({ this.setData({
isShow: false, isShow: false,
}); });
...@@ -360,6 +363,7 @@ Page({ ...@@ -360,6 +363,7 @@ Page({
outshowVideo: false, //显示视频列表 outshowVideo: false, //显示视频列表
}); });
// 发请求 // 发请求
console.log()
let senceItem = senceData[actNum]; let senceItem = senceData[actNum];
let item = senceData[actNum]?.productList[activeNavIdx]; let item = senceData[actNum]?.productList[activeNavIdx];
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${ this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${
...@@ -389,7 +393,7 @@ Page({ ...@@ -389,7 +393,7 @@ Page({
} }
}, },
// 解析二维码回调 // 解析二维码回调
async analysisOption() {}, // async analysisOption() {},
// 解析扫码进来参数 // 解析扫码进来参数
async analysisQRcode(str) { async analysisQRcode(str) {
...@@ -437,7 +441,18 @@ Page({ ...@@ -437,7 +441,18 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow(options) {}, onShow(options) {
// wx.nextTick(()=>{
// let {senceData ,actNum, activeNavIdx} = this.data
// console.log('senceData: ', senceData,actNum,activeNavIdx);
// let item = senceData[actNum]?.productList[activeNavIdx].proName;
// console.log('item: ', item);
// wx.setNavigationBarTitle({
// title: item.proName,
// })
// })
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
/* pages/checkProduct/checkProduct.wxss */ /* pages/checkProduct/checkProduct.wxss */
.productCon{ .productCon {
box-sizing: border-box; box-sizing: border-box;
padding-top: 88px; padding-top: 88px;
display: block; display: block;
...@@ -23,6 +23,81 @@ ...@@ -23,6 +23,81 @@
height: 311px; height: 311px;
// background-color: red; // background-color: red;
overflow: auto; overflow: auto;
.prod-item {
background-color: #f5f7fb;
.prod-item {
padding: 0 32rpx 32rpx;
margin: 16rpx auto 0;
// background-color: #f5f7fb;
// border-radius: 48rpx 48rpx 0 0;
}
.prod-card {
display: flex;
height: 120rpx;
background-image: linear-gradient(1deg, #ffffff 10%, #fdfcff 100%);
border: 2rpx solid #ffffff;
// box-shadow: 0 8rpx 20rpx 0 rgba(197, 205, 235, 0.35);
border-radius: 20rpx;
padding: 0 24rpx;
// box-sizing: border-box;
position: relative;
}
.prod-card .card-img {
padding-top: 10rpx;
width: 100rpx;
height: 100rpx;
flex-shrink: 0;
border-radius: 4rpx;
}
.img-desc {
position: absolute;
width: 104rpx;
height: 40rpx;
line-height: 40rpx;
background: #d7f5eb;
border-radius: 4rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 24rpx;
color: #24b38c;
letter-spacing: 0;
text-align: center;
}
.prod-info {
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12rpx 0;
margin-left: 24rpx;
}
.prod-info > text {
display: block;
white-space: nowrap;
// height: 40rpx;
// line-height: 40rpx;
}
.prod-info .title {
font-weight: 500;
font-size: 16rpx;
color: #323436;
}
.prod-info .sale,
.prod-info .earnings {
font-size: 16rpx;
color: #7a8299;
}
.prod-info .sale-num {
font-size: 14rpx;
color: #323436;
}
.prod-info .earnings-num {
font-size: 14rpx;
font-weight: Bold;
color: #f35251;
}
}
.img { .img {
width: 100%; width: 100%;
// height: auto; // height: auto;
...@@ -55,7 +130,7 @@ ...@@ -55,7 +130,7 @@
color: #323436; color: #323436;
text-align: center; text-align: center;
} }
.btn-wechat{ .btn-wechat {
width: auto; width: auto;
margin: 0; margin: 0;
padding: 0; padding: 0;
......
<!--pages/checkProduct/checkProduct.wxml--> <!--pages/checkProduct/checkProduct.wxml-->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">特色产品</navigation-bar> <navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">{{senceData[actNum].productList[activeNavIdx].proName}}</navigation-bar>
<!-- <view style="height:{{headerHeight}}px"> <!-- <view style="height:{{headerHeight}}px">
</view> --> </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" /> <product stickyTop="{{headerHeight}}" class="productCon" style="padding-top:{{headerHeight}}px" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" bindauthorized="authorizedFn" />
<!-- 分享弹框 --> <!-- 分享弹框 -->
<!-- <shareModel actNum="{{actNum}}" isShow="{{isShow}}" bindmodelclose="modelcloseFn" /> --> <!-- <shareModel actNum="{{actNum}}" isShow="{{isShow}}" bindmodelclose="modelcloseFn" /> -->
<view class="share-wrap" wx:if="{{isShow}}"> <view class="share-wrap" wx:if="{{isShow}}">
{{IMG_URL}} {{IMG_URL}}
<view class="img-wrap"> <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">
<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>
<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" /> <image class="img" style="height:{{imgHeight}}px" src="{{IMG_URL}}index/longpic{{actNum+1}}.png" bindload="onloadFn" />
<!-- <block wx:for="{{imgList}}" wx:key="*this"> <!-- <block wx:for="{{imgList}}" wx:key="*this">
<image mode="widthFix" class="img" src="{{item}}"/> <image mode="widthFix" class="img" src="{{item}}"/>
......
...@@ -53,11 +53,7 @@ Component({ ...@@ -53,11 +53,7 @@ Component({
}, },
lifetimes: { lifetimes: {
ready: function () { ready: function () {
if(this.data.wrapactiveNavIdx){ console.log('window',window)
this.setData({
activeNavIdx:this.data.wrapactiveNavIdx
})
}
if(!this.data.outshowVideo){ if(!this.data.outshowVideo){
this.setData({ this.setData({
...@@ -116,6 +112,12 @@ Component({ ...@@ -116,6 +112,12 @@ Component({
// 每次切换场景,重新获取流程图高度 // 每次切换场景,重新获取流程图高度
this.getImgHeight(); this.getImgHeight();
this.getMoreFn(); this.getMoreFn();
// this
if(this.data.wrapactiveNavIdx){
this.setData({
activeNavIdx:this.data.wrapactiveNavIdx
})
}
}, },
}, },
...@@ -147,14 +149,26 @@ Component({ ...@@ -147,14 +149,26 @@ Component({
}, },
// 视频下载 // 视频下载
downVideo(e){ downVideo(e){
let {src} = e.currentTarget.dataset let {url} = e.target.dataset
console.log('src: ', src); console.log(url)
wx.saveVideoToPhotosAlbum({ wx.$api.showToast('正在下载视频...')
filePath: src, wx.downloadFile({
success (res) { url:url,
console.log('视频下载',res) success (res) {
} // console.log(res,111)
}) if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success (res) {
setTimeout(() =>{
wx.$api.showToast('下载成功!')
},2000)
}
})
}
}
})
}, },
saleTextChange(e) {}, saleTextChange(e) {},
changeTab(e) { changeTab(e) {
...@@ -169,9 +183,11 @@ wx.saveVideoToPhotosAlbum({ ...@@ -169,9 +183,11 @@ wx.saveVideoToPhotosAlbum({
}); });
}, },
scrolltoupper(event) { scrolltoupper(event) {
console.log(event.detail.scrollHeight,event.detail.scrollTop)
const idx = this.data.heightArr.findIndex( const idx = this.data.heightArr.findIndex(
(item) => item > event.detail.scrollTop (item) => item > event.detail.scrollHeight
); );
console.log('idx',idx)
this.setData({ this.setData({
curTabIdx: idx, curTabIdx: idx,
}); });
......
...@@ -119,24 +119,24 @@ ...@@ -119,24 +119,24 @@
.share-btn { .share-btn {
height: 56rpx; height: 56rpx;
line-height: 56rpx; line-height: 56rpx;
width: 124rpx;
background: #3666FE;
border-radius: 28rpx;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
background-image: linear-gradient(-60deg, #556af5 0%, #7197ff 100%);
border-radius: 12rpx;
color: #fff; color: #fff;
padding: 0 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
position: absolute; position: absolute;
right: 24rpx; right: 24rpx;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
.share-btn .icon { .share-btn .icon {
width: 24rpx; width: 32rpx;
height: 24rpx; height: 32rpx;
margin-right: 8rpx; margin-right: 2rpx;
} }
.project-wrap { .project-wrap {
...@@ -144,8 +144,8 @@ ...@@ -144,8 +144,8 @@
} }
.project-img { .project-img {
height: 1600rpx; // height: 1600rpx;
white-space: nowrap; // white-space: nowrap;
.img-item { .img-item {
position: relative; position: relative;
} }
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
} }
.stickyTab { .stickyTab {
position: sticky; position: sticky;
z-index: 1; z-index: 2;
background-color: #f5f7fb; background-color: #f5f7fb;
} }
// .out-tab{ // .out-tab{
...@@ -326,13 +326,22 @@ ...@@ -326,13 +326,22 @@
font-size: 0; font-size: 0;
} }
.video-item { .video-item {
position: relative;
width: calc(50% - 12rpx); width: calc(50% - 12rpx);
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.video-item video { .video-item video {
width: 100%; width: 100%;
height: 588rpx; height: 590rpx;
border: 1rpx dashed #AFB0B2; // border: 1rpx dashed #AFB0B2;
}
.video-item .download{
position: absolute;
top:0;
right: 2px;
font-size: 26rpx;
color: #666;
z-index: 1;
} }
.video-item:nth-child(even) { .video-item:nth-child(even) {
margin-left: 22rpx; margin-left: 22rpx;
......
...@@ -18,16 +18,13 @@ ...@@ -18,16 +18,13 @@
<!-- senceData[actNum]['productList'][activeNavIdx].changeSale || --> <!-- 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>
<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> </text>
</view> </view>
<view class="share-btn" wx:if="{{!isShare && origin =='home'}}" bindtap="onShareFn"> <view class="share-btn" wx:if="{{!isShare && origin =='home'}}" bindtap="onShareFn">
<image class="icon" src="{{IMGURL}}share.png" /> <image class="icon" src="{{IMGURL}}share.png" />
<text>分享</text> <text>分享</text>
</view> </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>
</view> </view>
</view> </view>
...@@ -86,6 +83,7 @@ ...@@ -86,6 +83,7 @@
<view class="video-list"> <view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i"> <block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<view class="video-item"> <view class="video-item">
<view class="download" bindtap="downVideo" data-url="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}">视频下载</view>
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" /> <video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" />
<view class="video-text">{{item.name}}</view> <view class="video-text">{{item.name}}</view>
</view> </view>
......
...@@ -343,11 +343,11 @@ Page({ ...@@ -343,11 +343,11 @@ Page({
break break
case 'protectMembrane': case 'protectMembrane':
// 漆面保护膜 // 漆面保护膜
profit = (flow * 0.05 * 3000 * 12).toFixed(0) profit = (sales * 0.05 * 3000 * 12).toFixed(0)
break break
case 'colorMembrane': case 'colorMembrane':
// 改色膜 // 改色膜
profit = (flow * 0.05 * 5000 * 12).toFixed(0) profit = (sales * 0.05 * 5000 * 12).toFixed(0)
break break
case 'digitBeauty': case 'digitBeauty':
// 数字化美容 // 数字化美容
......
...@@ -11,8 +11,12 @@ page { ...@@ -11,8 +11,12 @@ page {
width: 100%; width: 100%;
background-size: 100% 100%; background-size: 100% 100%;
margin-bottom: 32rpx; margin-bottom: 32rpx;
<<<<<<< HEAD
z-index: 1; z-index: 1;
=======
z-index: 2;
>>>>>>> fb7f082be258d6f0662707ea191b5cbbe45ef678
.header { .header {
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -385,7 +389,7 @@ page { ...@@ -385,7 +389,7 @@ page {
width: 60px; width: 60px;
height: 60px; height: 60px;
border-radius: 50%; border-radius: 50%;
z-index: 1; z-index: 2;
} }
.output-value { .output-value {
......
...@@ -134,11 +134,13 @@ const isEmptyObj = (obj) => { ...@@ -134,11 +134,13 @@ const isEmptyObj = (obj) => {
}; };
// 解析参数成对象 "actNum=1&activeNavIdx=0&isShare=true" // 解析参数成对象 "actNum=1&activeNavIdx=0&isShare=true"
const parseString = (str) => { const parseString = (str) => {
// console.log('str: ', str);
if (!str) return; if (!str) return;
let obj = {}; let obj = {};
let strArr = str.split("&"); let strArr = str.split("&");
// console.log('strArr: ', strArr);
strArr.forEach((item) => { strArr.forEach((item) => {
console.log("item: ", item); // console.log("item: ", item);
let keyArr = item.split("="); let keyArr = item.split("=");
obj[keyArr[0]] = keyArr[1]; obj[keyArr[0]] = keyArr[1];
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!