Commit ac073f6e by luyt

feat:添加分享弹框

1 parent 4871f402
...@@ -159,5 +159,8 @@ Component({ ...@@ -159,5 +159,8 @@ Component({
tab, tab,
}); });
}, },
onShareFn(){
this.triggerEvent('sharehandle')
}
}, },
}); });
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
<view class="prod-info"> <view class="prod-info">
<text class="title">360全景导航</text> <text class="title">360全景导航</text>
<text class="sale">新车销量 <text class="sale-num">{{senceData[actNum]['productList'][activeNavIdx].changeSale || senceData[actNum]['productList'][activeNavIdx].sale}}</text> <text class="sale">新车销量 <text class="sale-num">{{senceData[actNum]['productList'][activeNavIdx].sale}}</text>
</text> </text>
<text class="earnings">预估收益 <text class="earnings-num">{{senceData[actNum]['productList'][activeNavIdx].profit}}</text> <text class="earnings">预估收益 <text class="earnings-num">{{senceData[actNum]['productList'][activeNavIdx].profit}}</text>
</text> </text>
</view> </view>
<view class="share-btn"> <view class="share-btn" bindtap="onShareFn">
<image class="icon" src="{{IMGURL}}share.png" /> <image class="icon" src="{{IMGURL}}share.png" />
<text>分享</text> <text>分享</text>
</view> </view>
......
// pages/tab/index/components/shareModel/shareModel.js
import { IMG_URL } from "~/utils/constantData.js";
Component({
/**
* 组件的属性列表
*/
properties: {
actNum: Number, //场景选择
isShow: Boolean,
// //分享方法
// onShareAppMessage:Function,
// onShareTimeline:Function,
},
/**
* 组件的初始数据
*/
data: {
IMG_URL: `${IMG_URL}index`,
btnList: [
{
src: `${IMG_URL}index/wechat.png`,
name: "微信转发",
},
{
src: `${IMG_URL}index/moments.png`,
name: "朋友圈分享",
},
{
src: `${IMG_URL}index/down.png`,
name: "下载为海报",
},
],
// imgList
// imgList:[
// {
// src:`${IMG_URL}index/scene${actNum}1.png`,
// },
// ]
},
// observers:{
// // actNum:function(actNum) {
// // let imgList = [
// // `${IMG_URL}index/scene${actNum +1}1.png`,
// // `${IMG_URL}index/scene${actNum +1}2.png`,
// // `${IMG_URL}index/scene${actNum +1}3.png`,
// // `${IMG_URL}index/scene${actNum +1}4.png`,
// // `${IMG_URL}index/scene${actNum +1}5.png`,
// // ]
// // if(actNum != 2){
// // imgList.push(`${IMG_URL}index/scene${actNum +1}6.png`)
// // }
// // this.setData({
// // imgList
// // })
// // }
// },
/**
* 组件的方法列表
*/
methods: {
// 分享按钮
handleClick(e) {
let { index } = e.currentTarget.dataset;
switch (index) {
case 0:
this.wechatFn();
break;
case 1:
this.wechatFn();
break;
case 2:
this.download();
break;
}
},
// 微信转发
wechatFn() {
// this.data.onShareAppMessage()
this.modelClose();
},
// 朋友圈转发
momentsFn() {
// this.data.onShareTimeline()
this.modelClose();
},
// 下载海报
download() {
this.modelClose();
},
//模态框关闭
modelClose() {
this.triggerEvent("modelclose", false);
},
// 图片加载事件
onloadFn(event){
// console.log('event.detail',event.detail)
this.setData({
imgHeight: ((event.detail.height)*0.2).toFixed(0)
})
}
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/shareModel/shareModel.wxss */
.share-wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 1;
.img-wrap {
position: absolute;
top: 20%;
left: 50%;
transform: translateX(-50%);
width: 225px;
height: 311px;
// background-color: red;
overflow: auto;
.img {
width: 100%;
height: auto;
}
}
.btns {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 154px;
background: #ffffff;
border-radius: 8px 8px 0 0;
.top {
display: flex;
justify-content: space-around;
.btn {
padding-top: 16px;
}
.img {
display: block;
margin: 0 auto 8px;
width: 40px;
height: 40px;
}
.name {
font-size: 12px;
color: #323436;
text-align: center;
}
}
.btom {
margin: 18px auto 0;
width: 343px;
height: 44px;
line-height: 44px;
border: 1px solid #eeeeee;
border-radius: 4px;
text-align: center;
}
}
}
<!-- pages/tab/index/components/shareModel/shareModel.wxml -->
<view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
<image class="img" style="height:{{imgHeight}}px" src="{{IMG_URL}}/longpic{{actNum+1}}.png" bindload="onloadFn" />
</view>
<view class="btns">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
</view>
</view>
<view class="btom" bindtap="modelClose">取消</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -40,7 +40,7 @@ Page({ ...@@ -40,7 +40,7 @@ Page({
msg: "1.3 存量用户众筹", msg: "1.3 存量用户众筹",
}, },
], ],
actNum: 0, actNum: 0, //car 场景选择
tabIndx: 1, tabIndx: 1,
navList: ["看线索", "看产品"], navList: ["看线索", "看产品"],
typeList: ["联系电话", "意向客户", "线索来源", "重置"], typeList: ["联系电话", "意向客户", "线索来源", "重置"],
...@@ -161,7 +161,7 @@ Page({ ...@@ -161,7 +161,7 @@ Page({
// tabList: pageData.tabList, // tabList: pageData.tabList,
// 定义数据 // 定义数据
senceData: pageData.senceData, senceData: pageData.senceData,
changeSale: 0, //每次改变的销量 isShow:false,
}, },
//引导图 //引导图
...@@ -293,16 +293,13 @@ Page({ ...@@ -293,16 +293,13 @@ Page({
this.data.senceData.forEach((item, index) => { this.data.senceData.forEach((item, index) => {
item.productList.forEach((i, lastIndex) => { item.productList.forEach((i, lastIndex) => {
if (i.profit) { if (i.profit) {
// let name = `senceData[${index}].productList[${lastIndex}].profit`;
let sale = `senceData[${index}].productList[${lastIndex}].sale`; let sale = `senceData[${index}].productList[${lastIndex}].sale`;
let name = `senceData[${index}].productList[${lastIndex}].profit`; let name = `senceData[${index}].productList[${lastIndex}].profit`;
// let changeSale = `senceData[${index}].productList[${lastIndex}].changeSale`;
let profit = _this.formula(i.productType, sales, flow); let profit = _this.formula(i.productType, sales, flow);
console.log(name, profit); console.log(name, profit);
this.setData({ this.setData({
[name]: profit, [name]: profit,
[sale]:sales [sale]:sales
// [changeSale]: sales,
}); });
} }
}); });
...@@ -384,7 +381,7 @@ Page({ ...@@ -384,7 +381,7 @@ Page({
} }
console.log(profit.length); console.log(profit.length);
console.log(productType, sales, flow, profit); console.log(productType, sales, flow, profit);
if (profit.length > 6) { if (profit.length > 8) {
return (profit / 10000).toFixed(0) + "万"; return (profit / 10000).toFixed(0) + "万";
} else { } else {
return profit; return profit;
...@@ -405,6 +402,7 @@ Page({ ...@@ -405,6 +402,7 @@ Page({
}); });
return false; return false;
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -492,6 +490,18 @@ Page({ ...@@ -492,6 +490,18 @@ Page({
let { phone } = e.currentTarget.dataset; let { phone } = e.currentTarget.dataset;
wx.$api.setCopyData(phone); wx.$api.setCopyData(phone);
}, },
// 分项弹框关闭
modelcloseFn(e){
this.setData({
isShow: e.detail
})
},
// 分享按钮
sharehandle(){
this.setData(({
isShow: true
}))
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
...@@ -524,4 +534,5 @@ Page({ ...@@ -524,4 +534,5 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {}, onShareAppMessage: function () {},
onShareTimeline:function () {},
}); });
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"usingComponents": { "usingComponents": {
"product": "./components/product/product", "product": "./components/product/product",
"vas-toast": "./components/likeToast/likeToast", "vas-toast": "./components/likeToast/likeToast",
"chat":"./components/chat/chat" "chat": "./components/chat/chat",
"shareModel": "./components/shareModel/shareModel"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
<!-- 头部 --> <!-- 头部 -->
<view class="header-wrap" style="height:{{headerHeight}}rpx; background-image: url('{{IMG_URL}}index/head.png')"> <view class="header-wrap" style="height:{{headerHeight}}rpx; background-image: url('{{IMG_URL}}index/head.png')">
<view class="header"> <view class="header">
<tab tab="{{navList}}" itemWidth="{{'35%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" /> <tab
tab="{{navList}}"
itemWidth="{{'35%'}}"
index="{{tabIndx}}"
bindclick="changeTabIndx"
class="tabContainer"
/>
<view class="right" bindtap="gotoApply"> <view class="right" bindtap="gotoApply">
<image class="img" src="{{IMG_URL}}index/apply.png" /> <image class="img" src="{{IMG_URL}}index/apply.png" />
<view class="apply">申请业务</view> <view class="apply">申请业务</view>
...@@ -12,9 +18,20 @@ ...@@ -12,9 +18,20 @@
</view> </view>
</view> </view>
<!-- 托客户内容 --> <!-- 托客户内容 -->
<view class="content" wx:if="{{tabIndx == 1 }}" hover-class="none" hover-stop-propagation="false"> <view
class="content"
wx:if="{{tabIndx == 1 }}"
hover-class="none"
hover-stop-propagation="false"
>
<view class="scene"> <view class="scene">
<view class="item-wrap {{actNum== index ? 'act':''}}" data-num="{{index}}" bindtap="selectCar" wx:for="{{dataArr}}" wx:key="name"> <view
class="item-wrap {{actNum== index ? 'act':''}}"
data-num="{{index}}"
bindtap="selectCar"
wx:for="{{dataArr}}"
wx:key="name"
>
<view class="item"> <view class="item">
<image class="img" src="{{item.src}}" /> <image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
...@@ -22,12 +39,23 @@ ...@@ -22,12 +39,23 @@
</view> </view>
</view> </view>
</view> </view>
<product stickyTop="{{headerHeight}}" actNum="{{actNum}}" senceData="{{senceData}}" /> <product stickyTop="{{headerHeight}}" actNum="{{actNum}}" senceData="{{senceData}}" bindsharehandle="sharehandle"/>
</view> </view>
<!-- 看线索内容 --> <!-- 看线索内容 -->
<view class="clue" wx:if="{{tabIndx == 0 }}" hover-class="none" hover-stop-propagation="false"> <view
class="clue"
wx:if="{{tabIndx == 0 }}"
hover-class="none"
hover-stop-propagation="false"
>
<view class="types"> <view class="types">
<view class="type" wx:for="{{typeList}}" wx:key="*this" data-index="{{index}}" bindtap="filterTypeFn"> <view
class="type"
wx:for="{{typeList}}"
wx:key="*this"
data-index="{{index}}"
bindtap="filterTypeFn"
>
{{item}} {{item}}
<image class="point" wx:if="{{index != 3}}" src="{{IMG_URL}}index/point.png" /> <image class="point" wx:if="{{index != 3}}" src="{{IMG_URL}}index/point.png" />
</view> </view>
...@@ -36,38 +64,95 @@ ...@@ -36,38 +64,95 @@
<view class="msg" wx:for="{{clueList}}" wx:key="phone"> <view class="msg" wx:for="{{clueList}}" wx:key="phone">
<!-- 生意助手 --> <!-- 生意助手 -->
<view wx:if="{{item.source == 'customer'}}"> <view wx:if="{{item.source == 'customer'}}">
<image class="like" wx:if="{{item.like}}" src="{{IMG_URL}}index/like.png" data-type="like" data-outidx="{{index}}" bindtap="showToast" /> <image
<image class="like" wx:else src="{{IMG_URL}}index/dislike.png" data-type="dislike" data-outidx="{{index}}" bindtap="showToast" /> class="like"
wx:if="{{item.like}}"
src="{{IMG_URL}}index/like.png"
data-type="like"
data-outidx="{{index}}"
bindtap="showToast"
/>
<image
class="like"
wx:else
src="{{IMG_URL}}index/dislike.png"
data-type="dislike"
data-outidx="{{index}}"
bindtap="showToast"
/>
<view class="name" hover-class="none" hover-stop-propagation="false"> <view class="name" hover-class="none" hover-stop-propagation="false">
{{item.name}} {{item.name}}
<image class="avatar" src="{{IMG_URL}}index/avatar.png" /> <image class="avatar" src="{{IMG_URL}}index/avatar.png" />
</view> </view>
<view class="line" hover-class="none" hover-stop-propagation="false" /> <view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="want-more" style="height:{{item.getMoreFlag? 100: 'auto'}}px"> <view class="want-more" style="height:{{item.getMoreFlag? 100: 'auto'}}px">
<view class="record" wx:for="{{item.records}}" wx:key="id" wx:for-index="idx" wx:for-item="itemName"> <view
class="record"
wx:for="{{item.records}}"
wx:key="id"
wx:for-index="idx"
wx:for-item="itemName"
>
<view class="action-wrap"> <view class="action-wrap">
<view class="action" selectable="false" space="false" decode="false"> <view
class="action"
selectable="false"
space="false"
decode="false"
>
{{filterUtils.filterType(itemName.type)}}: {{filterUtils.filterType(itemName.type)}}:
</view> </view>
<view class="detail" selectable="false" space="false" decode="false"> <view
class="detail"
selectable="false"
space="false"
decode="false"
>
{{itemName.msg}} {{itemName.msg}}
</view> </view>
</view> </view>
<view class="time" selectable="false" space="false" decode="false"> <view
class="time"
selectable="false"
space="false"
decode="false"
>
{{itemName.time}} {{itemName.time}}
</view> </view>
</view> </view>
</view> </view>
<view class="want-btn" wx:if="{{item.records.length > 5}}" hover-class="none" hover-stop-propagation="false" data-outidx="{{index}}" bindtap="getMore"> <view
class="want-btn"
wx:if="{{item.records.length > 5}}"
hover-class="none"
hover-stop-propagation="false"
data-outidx="{{index}}"
bindtap="getMore"
>
{{ item.getMoreFlag ? '更多数据' : '收起数据'}} {{ item.getMoreFlag ? '更多数据' : '收起数据'}}
</view> </view>
<view class="info" hover-class="none" hover-stop-propagation="false"> <view class="info" hover-class="none" hover-stop-propagation="false">
<view class="phone-wrap"> <view class="phone-wrap">
<view class="phone">{{item.phone}}</view> <view class="phone">{{item.phone}}</view>
<image class="phone-img" data-phone="{{item.phone}}" bindtap="phoneCallFn" src="{{IMG_URL}}index/phone.png" /> <image
<image class="copy" data-phone="{{item.phone}}" bindtap="setCopyDataFn" src="{{IMG_URL}}index/copy.png" /> class="phone-img"
</view> data-phone="{{item.phone}}"
<view class="btn" hover-class="none" hover-stop-propagation="false" bindtap="gotoApply"> bindtap="phoneCallFn"
src="{{IMG_URL}}index/phone.png"
/>
<image
class="copy"
data-phone="{{item.phone}}"
bindtap="setCopyDataFn"
src="{{IMG_URL}}index/copy.png"
/>
</view>
<view
class="btn"
hover-class="none"
hover-stop-propagation="false"
bindtap="gotoApply"
>
+开店面 +开店面
</view> </view>
</view> </view>
...@@ -82,18 +167,39 @@ ...@@ -82,18 +167,39 @@
<view class="source" hover-class="none" hover-stop-propagation="false">通过门店助手申请</view> <view class="source" hover-class="none" hover-stop-propagation="false">通过门店助手申请</view>
</view> </view>
<view class="line" hover-class="none" hover-stop-propagation="false" /> <view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="record" wx:for="{{item.records}}" wx:key="id" wx:for-index="idx" wx:for-item="itemName"> <view
class="record"
wx:for="{{item.records}}"
wx:key="id"
wx:for-index="idx"
wx:for-item="itemName"
>
<view class="shop-record"> <view class="shop-record">
<view class="shop-action-wrap"> <view class="shop-action-wrap">
<view class="action-wrap"> <view class="action-wrap">
<view class="action" selectable="false" space="false" decode="false"> <view
class="action"
selectable="false"
space="false"
decode="false"
>
{{filterUtils.filterType(itemName.type)}}: {{filterUtils.filterType(itemName.type)}}:
</view> </view>
<view class="detail" selectable="false" space="false" decode="false"> <view
class="detail"
selectable="false"
space="false"
decode="false"
>
{{itemName.msg}} {{itemName.msg}}
</view> </view>
</view> </view>
<view class="time" selectable="false" space="false" decode="false"> <view
class="time"
selectable="false"
space="false"
decode="false"
>
{{itemName.time}} {{itemName.time}}
</view> </view>
</view> </view>
...@@ -105,10 +211,25 @@ ...@@ -105,10 +211,25 @@
<view class="info" hover-class="none" hover-stop-propagation="false"> <view class="info" hover-class="none" hover-stop-propagation="false">
<view class="phone-wrap"> <view class="phone-wrap">
<view class="phone">{{item.phone}}</view> <view class="phone">{{item.phone}}</view>
<image class="phone-img" data-phone="{{item.phone}}" bindtap="phoneCallFn" src="{{IMG_URL}}index/phone.png" /> <image
<image class="copy" data-phone="{{item.phone}}" bindtap="setCopyDataFn" src="{{IMG_URL}}index/copy.png" /> class="phone-img"
</view> data-phone="{{item.phone}}"
<view class="btn" hover-class="none" hover-stop-propagation="false" bindtap="gotoApply"> bindtap="phoneCallFn"
src="{{IMG_URL}}index/phone.png"
/>
<image
class="copy"
data-phone="{{item.phone}}"
bindtap="setCopyDataFn"
src="{{IMG_URL}}index/copy.png"
/>
</view>
<view
class="btn"
hover-class="none"
hover-stop-propagation="false"
bindtap="gotoApply"
>
开通活动 开通活动
</view> </view>
</view> </view>
...@@ -141,12 +262,26 @@ ...@@ -141,12 +262,26 @@
<view class="dialog-form"> <view class="dialog-form">
<view class="form-item"> <view class="form-item">
<view class="form-label">门店月平均新车销量</view> <view class="form-label">门店月平均新车销量</view>
<input class="form-input" bindfocus="focus" maxlength="8" name="sales" value="{{formData.sales}}" type="number" /> <input
class="form-input"
bindfocus="focus"
maxlength="8"
name="sales"
value="{{formData.sales}}"
type="number"
/>
<!-- <view class="form-unit">台</view> --> <!-- <view class="form-unit">台</view> -->
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-label">3年内售后存量用户</view> <view class="form-label">3年内售后存量用户</view>
<input class="form-input" bindfocus="focus" maxlength="8" name="flow" type="number" value="{{formData.flow}}" /> <input
class="form-input"
bindfocus="focus"
maxlength="8"
name="flow"
type="number"
value="{{formData.flow}}"
/>
<!-- <view class="form-unit">人</view> --> <!-- <view class="form-unit">人</view> -->
</view> </view>
<button class="dialog-btn" form-type="submit">提交测算</button> <button class="dialog-btn" form-type="submit">提交测算</button>
...@@ -155,4 +290,12 @@ ...@@ -155,4 +290,12 @@
</form> </form>
</view> </view>
</view> </view>
<!-- <chat></chat> -->
\ No newline at end of file \ No newline at end of file
<!-- 分享弹框 -->
<shareModel
actNum="{{actNum}}"
isShow="{{isShow}}"
bindmodelclose="modelcloseFn"
onShareAppMessage="{{onShareAppMessage}}"
onShareTimeline="{{onShareTimeline}}"
/>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!