Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 30278bbc
authored
Oct 27, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改样式
1 parent
b8cea721
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
162 additions
and
113 deletions
pages/checkProduct/checkProduct.js
pages/checkProduct/checkProduct.wxml
pages/tab/index/components/product/product.js
pages/tab/index/components/product/product.scss
pages/tab/index/components/product/product.wxml
pages/checkProduct/checkProduct.js
View file @
30278bb
...
@@ -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()
...
...
pages/checkProduct/checkProduct.wxml
View file @
30278bb
...
@@ -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/index/components/product/product.js
View file @
30278bb
// 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,16 +442,20 @@ Component({
...
@@ -407,16 +442,20 @@ 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
});
});
},
},
},
},
});
});
\ No newline at end of file
\ No newline at end of file
pages/tab/index/components/product/product.scss
View file @
30278bb
...
@@ -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/index/components/product/product.wxml
View file @
30278bb
<!-- 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">
<scroll-view class="nav-wrap" scroll-x="{{true}}" wx:if="{{!isShare && origin =='home'}}">
特色产品
<block wx:for="{{navList}}" wx:key="index">
<block wx:if="{{phone}}">
<text class='nav {{activeNavIdx==index ? "active-nav": ""}}' bindtap="changeNav" data-index="{{index}}">{{item}}</text>
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
</block>
<image src="{{IMGURL}}share-phone.png" class="icon"></image>
</scroll-view>
请联系我
<view class="prod-item">
{{phone}}
<view class="prod-card">
</view>
<view class="card-img">
</block>
<!-- <text class="img-desc">轻改类</text>
</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}}discovery_prod1.png" /> -->
<image src="{{IMGURL}}prod/{{senceData[actNum].productList[activeNavIdx].img}}.png" />
<image src="{{IMGURL}}prod/{{senceData[actNum].productList[activeNavIdx].img}}.png" />
</view>
</view>
<view class="prod-info">
<view class="prod-info">
<text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text>
<text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text>
<!-- senceData[actNum]['productList'][activeNavIdx].changeSale || -->
<!-- senceData[actNum]['productList'][activeNavIdx].changeSale || -->
<text class="sale" wx:if="{{ actNum!=4}}" decode="{{true}}">{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}} <text class="sale-num">{{senceData[actNum]['productList'][activeNavIdx].varType == 1? senceData[actNum]['productList'][activeNavIdx].flow : senceData[actNum]['productList'][activeNavIdx].sale}}</text>
<text class="sale" wx:if="{{ actNum!=4}}" decode="{{true}}">{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}} <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" wx:if="{{ actNum!=4}}"
decode="{{true}}">预估收益 <text class="earnings-num">¥{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
<text class="earnings" wx:if="{{ actNum!=4}}"
decode="{{true}}">预估收益 <text class="earnings-num">¥{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
</text>
</text>
</view>
</view>
<view class="share-btn" wx:if="{{!isShare && origin =='home' && actNum!=4}}" bindtap="onShareFn">
<view class="share-btn" wx:if="{{!isShare && origin =='home' && actNum!=4}}" bindtap="onShareFn">
<image class="icon" src="{{IMGURL}}share.png" />
<image class="icon" src="{{IMGURL}}share.png" />
<text>分享</text>
<text>分享</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<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"
</view>
openScroll="{{true}}"
tab="{{tab}}"
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
index="{{curTabIdx}}"
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}">
bindclick="changeTab"
<block wx:for="{{tab}}" wx:key="index">
productHeight
<!-- 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>
<!-- wx:if="{{index!=5}}" -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<!-- style="{height:{{allHeight}}px}" scroll-y="{{true}}" bindscroll="scrolltoupper"-->
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
<scroll-view
<view class="video-list">
class="project-img"
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
scroll-into-view="{{intoViewId}}"
<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}}" />
<block wx:for="{{tab}}" wx:key="index">
<view class="video-text">{{item.name}}</view>
<!-- wx:if="{{showVideo && index==5 && tab.length < 5}}" -->
</view>
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index != 5}}">
</block>
<!-- wx:if="{{index!=5}}" -->
<!-- <view class="video-tips">- 如需开通请咨询客服 -</view> -->
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
</view>
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
</view>
<view class="video-list">
<!-- wx:if="{{ actNum != 2 && index == 4}}" -->
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<!-- wx:if="{{isShare && actNum != 2 && index == 4}}" -->
<view class="video-item">
<!-- wx:if="{{ isShare && actNum != 2 && index == 4}}" -->
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" />
<button wx:if="{{ isShare && isAuthphone && !getMoreBtn && index == 4}}" class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
<view class="video-text">{{item.name}}</view>
点击查看更多详情
</view>
</button>
</block>
</view>
<!-- <view class="video-tips">- 如需开通请咨询客服 -</view> -->
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}" wx:if="{{index == 5 && outshowVideo}}">
</view>
<!-- wx:if="{{index!=5}}" -->
</view>
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}scene{{actNum+1}}{{index+1}}.png" />
<!-- wx:if="{{ actNum != 2 && index == 4}}" -->
<view class="video-bg" wx:if="{{!isShare && index==5 && senceData[actNum].videoList.length}}">
<!-- wx:if="{{isShare && actNum != 2 && index == 4}}" -->
<view class="video-list">
<!-- wx:if="{{ isShare && actNum != 2 && index == 4}}" -->
<block wx:for="{{senceData[actNum].videoList}}" wx:key="i">
<button
<view class="video-item">
wx:if="{{ isShare && isAuthphone && !getMoreBtn && index == 4}}"
<view class="download" bindtap="downVideo" data-url="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}">视频下载</view>
class="more-btn"
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}" />
data-index="{{index}}"
<view class="video-text">{{item.name}}</view>
bindgetphonenumber="getUserInfo"
</view>
open-type="getPhoneNumber"
</block>
>
</view>
点击查看更多详情
</view>
</button>
</view>
</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
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment