Commit 6fa1f008 by 张晓玮

Merge branch 'v3.0' into 'zhangxw_dev_3.0'

V3.0

See merge request !63
2 parents 29d6bc78 f03d6aea
...@@ -40,11 +40,11 @@ Page({ ...@@ -40,11 +40,11 @@ Page({
errMsg errMsg
}) { }) {
console.error(errMsg) console.error(errMsg)
this.reLogin() this.reLogin(errMsg)
} }
}, },
/**获取loginToken */ /**获取loginToken */
reLogin(message) { reLogin(message = '') {
wx.showModal({ wx.showModal({
content: message || '获取loginToken失败', content: message || '获取loginToken失败',
confirmText: '重试', confirmText: '重试',
...@@ -86,7 +86,7 @@ Page({ ...@@ -86,7 +86,7 @@ Page({
if (res.code == '0'){ if (res.code == '0'){
this.toLogin(detail) this.toLogin(detail)
}else{ }else{
wx.$api.showToast(message || '系统异常') wx.$api.showToast(res.message || '系统异常')
} }
}) })
}, },
...@@ -131,7 +131,9 @@ Page({ ...@@ -131,7 +131,9 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
let data = JSON.parse(decodeURIComponent(options.data)) let data = JSON.parse(decodeURIComponent(options.data))
console.log(data)
let {staffName, fileUrl, merchantId, type} = data let {staffName, fileUrl, merchantId, type} = data
// staffName = 'fishing'
let linkParams = { let linkParams = {
staffName, staffName,
merchantId, merchantId,
......
...@@ -57,6 +57,12 @@ Page({ ...@@ -57,6 +57,12 @@ Page({
}, },
setRouteParams(obj){ setRouteParams(obj){
const {actNum, activeNavIdx, fromLocal} = obj const {actNum, activeNavIdx, fromLocal} = obj
let name = wx.$storage.get('userInfo') ? wx.$storage.get('userInfo').name : ''
this.shareTitle = `${name}给你分享一个${senceData[actNum].productList[activeNavIdx].proName}~`
this.shareQuery = `actNum=${actNum}&activeNavIdx=${activeNavIdx}`
wx.setNavigationBarTitle({
title: senceData[actNum].name || '特色产品'
})
this.setData({ this.setData({
actNum, actNum,
activeNavIdx, activeNavIdx,
...@@ -69,12 +75,12 @@ Page({ ...@@ -69,12 +75,12 @@ Page({
let { actNum,activeNavIdx } = this.data; let { actNum,activeNavIdx } = this.data;
let img = `${IMGURL}scene/longpic${actNum + 1}.png` let img = `${IMGURL}scene/longpic${actNum + 1}.png`
wx.showLoading({ wx.showLoading({
title: '图片加载中', title: '海报生成中...',
}) })
wx.getImageInfo({ wx.getImageInfo({
src: img, src: img,
success:(res)=> { success:(res)=> {
let imgW = res.width/5, imgH =res.height/5; let imgW = res.width/4, imgH =res.height/4;
let drawFun = new Draw({ let drawFun = new Draw({
width: imgW, width: imgW,
height: imgH height: imgH
...@@ -87,36 +93,41 @@ Page({ ...@@ -87,36 +93,41 @@ Page({
scene: `actNum=${actNum}&activeNavIdx=${activeNavIdx}`, scene: `actNum=${actNum}&activeNavIdx=${activeNavIdx}`,
path: 'pages/checkProduct/checkProduct' path: 'pages/checkProduct/checkProduct'
} }
let qrcodeH = actNum==3? 68: 100
commonApi.createQrcode(params).then(response => { commonApi.createQrcode(params).then(response => {
let qrcode = response?.data if(response?.data){
this.setData({ let qrcode = response?.data
imgH: (imgH/imgW)*450
})
let arr = [456,222,0,496]
let imgList = [
{
x: 0,
y: 0,
width: imgW,
height: imgH,
url: img,
},
{
x:imgW-64,
y: imgH-arr[actNum]-64,
width: 64,
height: 64,
url: qrcode, //二维码
},
];
drawFun.begin({
imageList: imgList,
}).then(resp => {
this.setData({ this.setData({
posterUrl: resp.path, imgH: (imgH/imgW)*450
}); })
wx.hideLoading() let arr = [0,0,0,0]
}) let imgList = [
{
x: 0,
y: 0,
width: imgW,
height: imgH,
url: img,
},
{
x:imgW-qrcodeH,
y: imgH-arr[actNum]-qrcodeH,
width: qrcodeH,
height: qrcodeH,
url: qrcode, //二维码
},
];
drawFun.begin({
imageList: imgList,
}).then(resp => {
this.setData({
posterUrl: resp.path,
});
wx.hideLoading()
})
}else{
wx.$api.showToast('接口异常')
}
}) })
} }
}) })
...@@ -177,12 +188,6 @@ Page({ ...@@ -177,12 +188,6 @@ Page({
wx.nextTick(()=>{ wx.nextTick(()=>{
let { actNum, activeNavIdx, scene } = this.options let { actNum, activeNavIdx, scene } = this.options
// let name = wx.$storage.get('staff_name') || (wx.$storage.get('userInfo') ? wx.$storage.get('userInfo').name : '') // let name = wx.$storage.get('staff_name') || (wx.$storage.get('userInfo') ? wx.$storage.get('userInfo').name : '')
let name = wx.$storage.get('userInfo') ? wx.$storage.get('userInfo').name : ''
this.shareTitle = `${name}给你分享一个${senceData[actNum].productList[activeNavIdx].proName}~`
this.shareQuery = `actNum=${actNum}&activeNavIdx=${activeNavIdx}`
wx.setNavigationBarTitle({
title: senceData[actNum].name || '特色产品'
})
if(scene){ if(scene){
let qrcodeQuery = decodeURIComponent(scene) let qrcodeQuery = decodeURIComponent(scene)
let id = qrcodeQuery.split('=').pop() let id = qrcodeQuery.split('=').pop()
......
...@@ -9,7 +9,7 @@ page{ ...@@ -9,7 +9,7 @@ page{
bottom: 0; bottom: 0;
right: 0; right: 0;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
z-index: 1; z-index: 2;
.img-wrap { .img-wrap {
position: absolute; position: absolute;
top: 20%; top: 20%;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<!-- 分享弹框 --> <!-- 分享弹框 -->
<view class="share-wrap" wx:if="{{isShow && fromLocal==1}}"> <view class="share-wrap" wx:if="{{isShow && fromLocal==1}}">
<view class="img-wrap" wx:if="{{posterUrl}}"> <view class="img-wrap" wx:if="{{posterUrl}}">
<image class="img" style="height:{{imgH}}rpx" src="{{posterUrl}}" bindload="onloadFn" /> <image class="img" style="height:{{imgH}}rpx" src="{{posterUrl}}" />
<!-- <block wx:for="{{imgList}}" wx:key="*this"> <!-- <block wx:for="{{imgList}}" wx:key="*this">
<image class="img" src="{{item}}"/> <image class="img" src="{{item}}"/>
</block> --> </block> -->
......
...@@ -86,15 +86,20 @@ Component({ ...@@ -86,15 +86,20 @@ Component({
curTabIdx: idx curTabIdx: idx
}) })
}, },
download() { downVideo(e) {
let {url} = e.target.dataset
console.log(url)
wx.$api.showToast('正在下载视频...')
wx.downloadFile({ wx.downloadFile({
url: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/video/digital_card_30s.mp4', url:url,
success (res) { success (res) {
console.log(res,111)
if (res.statusCode === 200) { if (res.statusCode === 200) {
wx.saveVideoToPhotosAlbum({ wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath, filePath: res.tempFilePath,
success (res) { success (res) {
wx.$api.showToast('保存成功!') wx.$api.showToast('下载成功!')
} }
}) })
} }
......
...@@ -153,9 +153,8 @@ ...@@ -153,9 +153,8 @@
} }
.project-img { .project-img {
height: 1200rpx;
white-space: nowrap; white-space: nowrap;
.img-item { .img-item {
position: relative; position: relative;
width: 100%; width: 100%;
...@@ -302,11 +301,19 @@ ...@@ -302,11 +301,19 @@
.video-item { .video-item {
width: calc(50% - 12rpx); width: calc(50% - 12rpx);
margin-bottom: 32rpx; margin-bottom: 32rpx;
position: relative;
}
.download{
position: absolute;
top: 8rpx;
right: 8rpx;
z-index: 1;
width: 50rpx;
height: 50rpx;
} }
.video-item video { .video-item video {
width: 100%; width: 100%;
height: 588rpx; height: 590rpx;
border: 1rpx dashed #AFB0B2;
} }
.video-item:nth-child(even) { .video-item:nth-child(even) {
margin-left: 22rpx; margin-left: 22rpx;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text> <text class="title">{{senceData[actNum].productList[activeNavIdx].proName}}</text>
<text class="sale" decode="{{true}}">{{senceData[actNum]['productList'][activeNavIdx].varType == 1 ? '三年售后存量数':'新车销量'}}&nbsp;<text class="sale-num">{{senceData[actNum]['productList'][activeNavIdx].changeSale || 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].changeSale || 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"><text style="font-size: 24rpx; margin-right: 4rpx;">¥</text>{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
</text> </text>
</view> </view>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</view> </view>
</view> </view>
<view class="project-wrap"> <view class="project-wrap">
<view style="position: sticky;top: {{headerHeight}}px ;z-index: 1;background-color: #F5F7FB;"> <view style="position: sticky;top: {{headerHeight}}px ;z-index: 2;background-color: #F5F7FB;">
<tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab> <tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab>
</view> </view>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}"> <scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,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">
<image class="download" mode="widthFix" src="{{IMGURL}}download.png" bindtap="downVideo" data-url="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}"></image>
<video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}"></video> <video poster="{{videoBaseUrl}}video/{{item.posterUrl}}.png?v={{img_version}}" title="{{item.name}}" src="{{videoBaseUrl}}video/{{item.videoUrl}}.mp4?v={{img_version}}"></video>
<view class="video-text">{{item.name}}</view> <view class="video-text">{{item.name}}</view>
</view> </view>
......
...@@ -27,23 +27,22 @@ page{ ...@@ -27,23 +27,22 @@ page{
position: fixed; position: fixed;
right: 0; right: 0;
top: 900rpx; top: 900rpx;
width: 80px;
height: 80px;
border-radius: 50%;
z-index: 1;
}
.applyAct{
top: 750rpx;
width: 64px; width: 64px;
height: 64px; height: 64px;
border-radius: 50%;
z-index: 3;
right: 15rpx; right: 15rpx;
} }
.chat{
top: 750rpx;
}
/* 测算 */ /* 测算 */
.calculate { .calculate {
position: fixed; position: fixed;
right: 0; right: 0;
top: 1100rpx; top: 1050rpx;
z-index: 3;
} }
.icon-calculate { .icon-calculate {
...@@ -60,7 +59,7 @@ page{ ...@@ -60,7 +59,7 @@ page{
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: rgba(45,45,51,0.50); background-color: rgba(45,45,51,0.50);
z-index: 1; z-index: 4;
.dialog-box { .dialog-box {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
......
...@@ -66,6 +66,6 @@ ...@@ -66,6 +66,6 @@
</view> </view>
<!-- 在线客服 --> <!-- 在线客服 -->
<image class="chat" src="{{IMGURL}}customer_service.png" bindtap="goConsult" /> <image wx:if="{{showPage}}" class="chat" src="{{IMGURL}}customer_service.png" bindtap="goConsult" />
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!