Commit 3f853f67 by 杨北旺

Merge branch 'v3.0' into ybw_dev_3.0

2 parents 96813cfa eb03e61d
......@@ -66,6 +66,12 @@ class ActivityApi {
...data
})
}
getActivityVisitorList(data) {
return api.post({
method: `scrm.api.busassistant.activity.createQrCode`,
...data
})
}
}
export default ActivityApi
\ No newline at end of file
......@@ -83,6 +83,22 @@
color: #C1C2C3;
}
.list-nothing.to-bottom::after{
content: '- 到 底 了 -'
}
.list-loading{
width: 100%;
padding: 8rpx 0 30rpx;
text-align: center;
font-size: 28rpx;
color: #C1C2C3;
}
.list-loading::after{
content: '正在加载中'
}
.list-nothing .icon {
width: 320rpx;
height: 320rpx;
......
......@@ -90,6 +90,7 @@
padding: 24rpx 32rpx;
margin: 20rpx;
height: 128rpx;
margin-bottom: 30rpx;
image{
width: 128rpx;
height: 128rpx;
......
// packageActivity/pages/taskDetail/taskDetail.js
import index_const from "~/pages/tab/index/index_const"
import ActivityApi from '~/api/activityApi/index'
import { IMG_URL } from "~/utils/constantData"
Page({
/**
......@@ -27,13 +26,15 @@ Page({
userStorage
})
if (Object.keys(options).length && options.missionId) {
console.log(options)
id = options.missionId
this.getActiveTaskDetail(id)
} else {
wx.$router.getData(e => {
id = e.missionId
this.getActiveTaskDetail(id)
})
}
wx.$router.getData(missionId => {
id = missionId
this.getActiveTaskDetail(id)
})
this.sharePath = `packageActivity/pages/shareTaskDetail/shareTaskDetail?missionId=${id}`
},
......@@ -61,7 +62,7 @@ Page({
detailInfo: res,
materialTypeArr: typeArr
})
this.shareImage = res.imgUrlList[0] ? res.imgUrlList[0].url : `${IMGURL}share_task_default_img.png`
this.shareImage = res.imgUrlList[0] ? res.imgUrlList[0].url : `${this.data.IMGURL}share_task_default_img.png`
this.shareTitle = res.activityName || '门店助手'
})
},
......@@ -211,8 +212,8 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow() {
onShow(options) {
console.log(options)
},
/**
......
......@@ -21,6 +21,7 @@
border-radius: 12px;
padding: 24rpx 32rpx;
height: 128rpx;
margin-bottom: 30rpx;
image{
width: 128rpx;
height: 128rpx;
......
......@@ -5,7 +5,6 @@
display: flex;
flex-flow: column;
background: #fff;
justify-content: center;
align-items: center;
.time-box{
width: 100%;
......
// pages/checkProduct/checkProduct.js
// const navStyle = "background-color: transparent;";
import { IMG_URL } from "~/utils/constantData.js";
const navStyle = "background-color: #fff";
import { senceData } from "~/pages/tab/discovery/constant/data";
import Draw from "~/utils/Draw.js";
import { IMG_URL } from "~/utils/constantData.js";
import ActivityApi from '~/api/activityApi/index'
const IMGURL = IMG_URL
Page({
/**
* 页面的初始数据
......@@ -12,8 +12,44 @@ Page({
navStyle,
headerHeight: 0,
senceData,
actNum: 3,
// 模态框
isShow: true,
btnList: [
{
src: `${IMGURL}wechat.png`,
name: "微信转发",
},
{
src: `${IMGURL}down.png`,
name: "下载为海报",
},
],
imgHeightArr: [
[1110, 1290, 596, 744, 490, 1532],
[2168, 1290, 596, 830, 490, 752],
[1110, 1290, 596, 984, 490],
[678, 1266, 1398, 830, 490, 1666],
],
posterUrl: "", //海报url
},
observers: {
actNum: function (actNum) {
let imgList = [
`${IMGURL}index/scene${actNum + 1}1.png`,
`${IMGURL}index/scene${actNum + 1}2.png`,
`${IMGURL}index/scene${actNum + 1}3.png`,
`${IMGURL}index/scene${actNum + 1}4.png`,
`${IMGURL}index/scene${actNum + 1}5.png`,
];
if (actNum != 2) {
imgList.push(`${IMGURL}index/scene${actNum + 1}6.png`);
}
this.setData({
imgList,
});
},
},
navbarReady(e) {
let {
......@@ -32,15 +68,52 @@ Page({
navStyle: scrollTop == 0 ? navStyle : `background-color:${color};`
})
},
modelcloseFn(e) {
// 分享按钮
sharehandle() {
this.setData({
isShow: e.detail,
isShow: true,
});
},
// 分享按钮
sharehandle() {
handleClick(e) {
let { index } = e.currentTarget.dataset;
switch (index) {
case 0:
this.wechatFn();
break;
case 1:
this.download();
break;
}
},
// 微信转发
wechatFn() {
// this.data.onShareAppMessage()
this.modelClose();
},
// 下载海报
download() {
if(this.data.posterUrl){
wx.saveImageToPhotosAlbum({
filePath: this.data.posterUrl, //仅为示例,并非真实的资源
success (res) {
console.log('res: ', res);
wx.$api.showToast('图片下载成功!')
}
})
}
this.modelClose();
},
//模态框关闭
modelClose() {
this.setData({
isShow: true,
isShow: false
});
},
// 图片加载事件
onloadFn(event) {
this.setData({
imgHeight: (event.detail.height * 0.2).toFixed(0),
});
},
onRouter(options) {
......@@ -52,7 +125,56 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// actNum,activeNavIdx
if(this.data.isShow){
let { actNum } = this.data;
let img = `${IMGURL}scene/longpic${actNum + 1}.png`
wx.showLoading({
title: '加载图片中',
})
wx.getImageInfo({
src: img,
success:(res)=> {
ActivityApi.getActivityVisitorList({
actNum, activeNavIdx: 0
}).then(response => {
let imgW = res.width/5, imgH =res.height/5;
this.setData({
imgH: (imgH/imgW)*450
})
let drawFun = new Draw({
width: imgW,
height: imgH
});
let imgList = [
{
x: 0,
y: 0,
width: imgW,
height: imgH,
url: img,
},
{
x:imgW-64,
y: imgH-496-64,
width: 64,
height: 64,
url: response, //二维码
},
];
drawFun.begin({
imageList: imgList,
}).then(resp => {
console.log('posterUrl.path',resp)
this.setData({
posterUrl: resp.path,
});
wx.hideLoading()
})
console.log(response,'response')
})
}
})
}
},
/**
......
{
"usingComponents": {
"product": "../tab/discovery/components/product/product",
"shareModel":"../tab/discovery/components/shareModel/shareModel"
"product": "../tab/discovery/components/product/product"
},
"navigationBarTitleText": "特色产品",
"onReachBottomDistance": 10,
......
/* pages/checkProduct/checkProduct.wxss */
page{
background-color: #fff;
}
.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: 450rpx;
height: 622rpx;
// background-color: red;
overflow: auto;
.img {
width: 100%;
// height: auto;
height: 60%;
background-color: #fff;
}
}
.btns {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 308rpx;
background: #ffffff;
border-radius: 16rpx 16rpx 0 0;
.top {
display: flex;
justify-content: space-around;
.btn {
padding-top: 32rpx;
}
.img {
display: block;
margin: 0 auto 16rpx;
width: 80rpx;
height: 80rpx;
}
.name {
font-size: 24rpx;
color: #323436;
text-align: center;
line-height: 32rpx;
}
.btn-wechat{
width: auto;
margin: 0;
padding: 0;
background-color: #fff;
&::after{
border:none;
}
}
}
.btom {
margin: 36rpx auto 0;
width: 686rpx;
height: 88rpx;
line-height: 88rpx;
border: 2rpx solid #eeeeee;
border-radius: 8rpx;
text-align: center;
}
}
}
\ No newline at end of file
......@@ -6,4 +6,28 @@
<product actNum="{{actNum}}" senceData="{{senceData}}" isShare="{{true}}"/>
<!-- 分享弹框 -->
<shareModel actNum="{{actNum}}" isShow="{{isShow}}" bindmodelclose="modelcloseFn" />
<view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap" wx:if="{{posterUrl}}">
<image class="img" style="height:{{imgH}}rpx" src="{{posterUrl}}" bindload="onloadFn" />
<!-- <block wx:for="{{imgList}}" wx:key="*this">
<image class="img" src="{{item}}"/>
</block> -->
</view>
<view class="btns" wx:if="{{posterUrl}}">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<block wx:if="{{index == 0}}">
<button open-type="share" class="btn-wechat">
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
</button>
</block>
<block wx:else>
<image class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
</block>
</view>
</view>
<view class="btom" bindtap="modelClose">取消</view>
</view>
</view>
......@@ -8,12 +8,18 @@ Component({
/**
* 组件的属性列表
*/
options: {
addGlobalClass: true
},
behaviors: [imgUrlMixin],
properties: {
activeList: {
type: Array,
observer(newVal) {
}
},
nothing: {
type: Boolean
}
},
......@@ -106,7 +112,7 @@ Component({
filterJumpUrl(id) {
const userStorage = wx.$storage.get('userInfo')
return `${domain}/scrm-wx-merchant-activity/#/?id=${id}&merchantId=${userStorage.merchantId}&shareStaffUuid=${userStorage.uuid}&shareStaffName=${this.toUnicode(userStorage.name)}&shareStaffType=2&sharedTime=${Date.now()}`
return `http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-lwk/#/crowdfunding?id=${id}&merchantId=${userStorage.merchantId}&shareStaffUuid=${userStorage.uuid}&shareStaffName=${this.toUnicode(userStorage.name)}&shareStaffType=2&sharedTime=${Date.now()}`
},
// 分享活动(复制链接)
......
......@@ -33,4 +33,7 @@
</view>
</view>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing to-bottom"></view>
</block>
</view>
......@@ -8,11 +8,17 @@ Component({
/**
* 组件的属性列表
*/
options: {
addGlobalClass: true
},
behaviors: [imgUrlMixin],
properties: {
activityList: {
type: Array,
value: []
},
nothing: {
type: Boolean
}
},
......
......@@ -43,4 +43,7 @@
</view>
</view>
</block>
<block wx:if="{{nothing}}">
<view class="list-nothing to-bottom"></view>
</block>
</view>
......@@ -161,6 +161,10 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.setData({
activePageNum: 1,
pageNum: 1
})
this.getData(true)
},
......
......@@ -4,6 +4,6 @@
"activity-diagnosis": "./components/activityDiagnosis/activityDiagnosis"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"onReachBottomDistance": 100,
"enablePullDownRefresh": true
}
......@@ -10,7 +10,7 @@
}
.layout {
position: relative;
position: relative;
.bg-box {
width: 100%;
overflow: hidden;
......@@ -26,7 +26,8 @@
}
}
.content {
position: relative;
position: relative;
overflow: hidden;
.tab-box {
display: flex;
height: 112rpx;
......
......@@ -24,13 +24,13 @@
<!-- 活动中 -->
<view class="active-content" hidden="{{tabIndex != 0}}">
<block>
<active-box activeList="{{activeList}}"></active-box>
<active-box activeList="{{activeList}}" nothing="{{nothing}}"></active-box>
</block>
</view>
<!-- 活动诊断 -->
<view class="activity-diag-content" hidden="{{tabIndex != 1}}">
<block>
<activity-diagnosis activityList="{{activityEndList}}"></activity-diagnosis>
<activity-diagnosis activityList="{{activityEndList}}" nothing="{{nothing}}"></activity-diagnosis>
</block>
</view>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!