Commit 30278bbc by 李伟康

修改样式

1 parent b8cea721
......@@ -173,7 +173,8 @@ Page({
activeNavIdx,
// apiData,
outshowVideo,
isShow
isShow,
share_phone: options.sharePhone
// origin
// isShare
});
......@@ -451,6 +452,7 @@ Page({
activeNavIdx,
isShare: true,
outshowVideo: false, //显示视频列表
share_phone: options.sharePhone
});
// 发请求
console.log()
......
......@@ -6,7 +6,7 @@
</view> -->
<!-- style="padding-top:{{headerHeight}}px" -->
<product stickyTop="{{headerHeight}}" class="productCon" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" isShow="{{isShow}}" bindauthorized="authorizedFn" />
<product stickyTop="{{headerHeight}}" class="productCon" isAuthphone="{{isAuthphone}}" actNum="{{actNum}}" wrapactiveNavIdx="{{activeNavIdx}}" senceData="{{senceData}}" outshowVideo="{{outshowVideo}}" isShare="{{isShare}}" isShow="{{isShow}}" bindauthorized="authorizedFn" phone="{{share_phone}}" />
<!-- 分享弹框 -->
<!-- <view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
......
// pages/tab/discovery/components/product/product.js
// import {imgUrlMixin} from '~/mixins/index'
import { IMG_URL } from "~/utils/constantData.js";
import {
IMG_URL
} from "~/utils/constantData.js";
import USERAPI from "~/api/usersApi/index";
const videoBaseUrl =
"https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/";
......@@ -30,6 +32,7 @@ Component({
type: Boolean,
// value: false,
},
phone: String
},
/**
......@@ -187,6 +190,10 @@ Component({
* 组件的方法列表
*/
methods: {
phoneCall(e){
let { phone } = e.currentTarget.dataset
wx.$api.phoneCall(phone)
},
getCurrentPageUrl() {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
......@@ -195,12 +202,18 @@ Component({
},
async init() {
try {
const { data, code, message } = await USERAPI.wxCodeLogin();
const {
data,
code,
message
} = await USERAPI.wxCodeLogin();
if (code == "0") {
this.loginToken = data;
} else this.reLogin(message);
wx.hideLoading();
} catch ({ errMsg }) {
} catch ({
errMsg
}) {
console.error(errMsg);
this.reLogin();
}
......@@ -211,13 +224,17 @@ Component({
content: message || "获取loginToken失败",
confirmText: "重试",
confirmColor: "#3666FE",
}).then(({ confirm }) => {
}).then(({
confirm
}) => {
if (confirm) this.init();
});
},
// 视频下载
downVideo(e) {
let { url } = e.target.dataset;
let {
url
} = e.target.dataset;
console.log(url);
wx.$api.showToast("正在下载视频...");
wx.downloadFile({
......@@ -240,7 +257,10 @@ Component({
saleTextChange(e) {},
changeTab(e) {
let idx = e.detail;
let { imgTopArr, stickyTop } = this.data;
let {
imgTopArr,
stickyTop
} = this.data;
console.log("idx: ", imgTopArr[idx], stickyTop);
// this.setData({
// intoViewId: `to-${idx}`,
......@@ -251,10 +271,14 @@ Component({
console.log('currentUrl: ', currentUrl);
if (currentUrl == "/pages/tab/index/index") {
console.log(123546)
wx.pageScrollTo({ scrollTop: imgTopArr[idx] - stickyTop + 88 + 34 });
wx.pageScrollTo({
scrollTop: imgTopArr[idx] - stickyTop + 88 + 34
});
// wx.pageScrollTo({ scrollTop: imgTopArr[idx] - stickyTop });
} else {
wx.pageScrollTo({ scrollTop: imgTopArr[idx] - stickyTop });
wx.pageScrollTo({
scrollTop: imgTopArr[idx] - stickyTop
});
}
},
// async changeTab(e){
......@@ -340,7 +364,9 @@ Component({
.exec();
},
// 获取用户信息
getUserInfo({ detail }) {
getUserInfo({
detail
}) {
// console.log(detail);
if (!detail.code) return;
......@@ -350,9 +376,14 @@ Component({
// console.log(result)
let userInfo = wx.$storage.get("wx_user_info");
// console.log('userInfo: ', userInfo);
let { phone } = result;
let {
phone
} = result;
// console.log('phone: ', phone);
wx.$storage.set("wx_user_info", { ...userInfo, phone });
wx.$storage.set("wx_user_info", {
...userInfo,
phone
});
// }
setTimeout(() => {
this.triggerEvent("authorized", {
......@@ -368,7 +399,9 @@ Component({
});
this.getMoreFn();
})
.catch(({ errMsg }) => {
.catch(({
errMsg
}) => {
wx.$api.showToast(errMsg || "系统异常");
// this.setBtnLoading(false)
});
......@@ -376,7 +409,9 @@ Component({
// 图片流程5 点击往下获取更多
// 没登陆用户(登陆后解锁全部)
getMoreFn() {
let { actNum } = this.data;
let {
actNum
} = this.data;
// console.log("inactNumdex: ", actNum);
let tab = [
"场景说明",
......@@ -407,16 +442,20 @@ Component({
onShareFn() {
// this.triggerEvent('sharehandle')
// wx.$router.go('apply',1235)
let { actNum, activeNavIdx, apiData } = this.data;
let {
actNum,
activeNavIdx,
apiData
} = this.data;
wx.$router.go("checkProduct", {
actNum,
activeNavIdx,
apiData,
outshowVideo: true,
isShow:true
isShow: true
// origin:'home' //跟首页类似情况
// isShare: true
});
},
},
});
});
\ No newline at end of file
......@@ -5,12 +5,27 @@
}
.prod-wrap .big-title {
margin-left: 32rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 32rpx;
color: #323436;
padding-top: 32rpx;
padding: 32rpx 32rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
.phone {
font-weight: 400;
font-size: 24rpx;
color: #6C6C6C;
display: flex;
align-items: center;
.icon{
width: 40rpx;
height: 40rpx;
margin-right: 6rpx;
}
}
}
.prod-wrap .nav-wrap {
......@@ -400,10 +415,11 @@
}
.check-prod .img-item {
&:last-child{
&:last-child {
margin-bottom: 148rpx;
}
}
.video-item {
position: relative;
width: calc(50% - 12rpx);
......
<!-- pages/tab/discovery/components/product/product.wxml -->
<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">
<text class='nav {{activeNavIdx==index ? "active-nav": ""}}' bindtap="changeNav" data-index="{{index}}">{{item}}</text>
</block>
</scroll-view>
<view class="prod-item">
<view class="prod-card">
<view class="card-img">
<!-- <text class="img-desc">轻改类</text>
<view class="prod-wrap">
<view class="big-title">
特色产品
<block wx:if="{{phone}}">
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
<image src="{{IMGURL}}share-phone.png" class="icon"></image>
请联系我
{{phone}}
</view>
</block>
</view>
<scroll-view class="nav-wrap" scroll-x="{{true}}" wx:if="{{!isShare && origin =='home'}}">
<block wx:for="{{navList}}" wx:key="index">
<text class='nav {{activeNavIdx==index ? "active-nav": ""}}' bindtap="changeNav" data-index="{{index}}">{{item}}</text>
</block>
</scroll-view>
<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="{{IMGURL}}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" wx:if="{{ actNum!=4}}" 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" wx:if="{{ actNum!=4}}" decode="{{true}}">预估收益&nbsp;<text class="earnings-num">¥{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
</text>
</view>
<view class="share-btn" wx:if="{{!isShare && origin =='home' && actNum!=4}}" bindtap="onShareFn">
<image class="icon" src="{{IMGURL}}share.png" />
<text>分享</text>
</view>
</view>
</view>
<image src="{{IMGURL}}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" wx:if="{{ actNum!=4}}" 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" wx:if="{{ actNum!=4}}" decode="{{true}}">预估收益&nbsp;<text class="earnings-num">¥{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
</text>
</view>
<view class="share-btn" wx:if="{{!isShare && origin =='home' && actNum!=4}}" bindtap="onShareFn">
<image class="icon" src="{{IMGURL}}share.png" />
<text>分享</text>
</view>
</view>
</view>
</view>
<view class="project-wrap {{isShow ?'check-prod':''}}">
<!-- -->
<view class="stickyTab" style="top:{{isShare ? stickyTop+88 : stickyTop}}rpx">
<tab
outClassName="project-tab"
openScroll="{{true}}"
tab="{{tab}}"
index="{{curTabIdx}}"
bindclick="changeTab"
productHeight
/>
</view>
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
<scroll-view
class="project-img"
scroll-into-view="{{intoViewId}}"
>
<block wx:for="{{tab}}" wx:key="index">
<!-- wx:if="{{showVideo && index==5 && tab.length < 5}}" -->
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index != 5}}">
<!-- wx:if="{{index!=5}}" -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<view class="video-item">
<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>
</block>
<!-- <view class="video-tips">- 如需开通请咨询客服 -</view> -->
</view>
</view>
<!-- wx:if="{{ actNum != 2 && index == 4}}" -->
<!-- wx:if="{{isShare && actNum != 2 && index == 4}}" -->
<!-- wx:if="{{ isShare && actNum != 2 && index == 4}}" -->
<button
wx:if="{{ isShare && isAuthphone && !getMoreBtn && index == 4}}"
class="more-btn"
data-index="{{index}}"
bindgetphonenumber="getUserInfo"
open-type="getPhoneNumber"
>
点击查看更多详情
</button>
</view>
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index == 5 && outshowVideo}}">
<!-- wx:if="{{index!=5}}" -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<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}}" />
<view class="video-text">{{item.name}}</view>
</view>
</block>
</view>
</view>
</view>
<!-- -->
<view class="stickyTab" style="top:{{isShare ? stickyTop+88 : stickyTop}}rpx">
<tab outClassName="project-tab" openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab" productHeight />
</view>
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}">
<block wx:for="{{tab}}" wx:key="index">
<!-- wx:if="{{showVideo && index==5 && tab.length < 5}}" -->
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index != 5}}">
<!-- wx:if="{{index!=5}}" -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<view class="video-item">
<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>
</block>
<!-- <view class="video-tips">- 如需开通请咨询客服 -</view> -->
</view>
</view>
<!-- wx:if="{{ actNum != 2 && index == 4}}" -->
<!-- wx:if="{{isShare && actNum != 2 && index == 4}}" -->
<!-- wx:if="{{ isShare && actNum != 2 && index == 4}}" -->
<button wx:if="{{ isShare && isAuthphone && !getMoreBtn && index == 4}}" class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
点击查看更多详情
</button>
</view>
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index == 5 && outshowVideo}}">
<!-- wx:if="{{index!=5}}" -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
<view class="video-list">
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<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}}" />
<view class="video-text">{{item.name}}</view>
</view>
</block>
</view>
</view>
</view>
</block>
</scroll-view>
</view>
</block>
</scroll-view>
</view>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!