Commit 30278bbc by 李伟康

修改样式

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