This commit is contained in:
老叶
2021-10-14 11:06:44 +08:00
parent cd09c9e5c4
commit 3807777954
22 changed files with 486 additions and 425 deletions
+2
View File
@@ -7,6 +7,7 @@
.bg-666{background-color:#666;}
.bg-999{background-color:#999;}
.bg-333{background-color:#333;}
.bg-1a{background-color: #1a1a1a;}
.bg-36afa2{background-color:#36afa2;}
.bg-f9394d{background-color:#f9394d;}
@@ -20,6 +21,7 @@
.bg-fff-op50{background-color:rgba(255,255,255,.5);}
.bg-fff-op80{background-color:rgba(255,255,255,.8);}
.bg-fff-op90{background-color:rgba(255,255,255,.9);}
.bg-fff-op95{background-color:rgba(255,255,255,.95);}
.bg-000-gradual-30-60{background-image:linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.6));}
.bg-2f3346-1a1c26{background-image:linear-gradient(#2f3346,#1a1c26);}
+1
View File
@@ -20,6 +20,7 @@
.img-250x250{width:250rpx;height:250rpx;box-sizing:border-box;}
.img-250x445{width:250rpx;height:445rpx;box-sizing:border-box;}
.img-750x250{width:750rpx;height:250rpx;box-sizing:border-box;}
.img-750x422{width:100%;height:422rpx;box-sizing:border-box;}
.img-h-200{height:200rpx;box-sizing:border-box;}
.img-w-260{width:260rpx;box-sizing:border-box;}
+1
View File
@@ -67,6 +67,7 @@
.img-center-middle-100{position:absolute;top:50%;left:50%;max-width:100%;max-height:100%;transform:translate(-50%,-50%);}
.fiximg{max-width:100%;}
.box-shadow-000-3-5{box-shadow:0 0 3rpx rgba(0,0,0,.05);}
.box-shadow-000-10-10{box-shadow:0 0 10rpx rgba(0,0,0,.10);}
.box-shadow-000-10-15{box-shadow:0 0 10rpx rgba(0,0,0,.15);}
.box-shadow-000-20-8{box-shadow:0 0 20rpx rgba(0,0,0,.08);}
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -68,10 +68,14 @@ api = {
appXzStat: "app/xz/stat", //获取电话统计数据
appCity: "app/city", //获取系统配置城市
materialHome: "material/home", //素材首页
materialHomeTabs: "material/home/tabs", //推广素材_tab
materialHomeLists: "material/home/lists", //推广素材_lists
materialHomeTopic: "material/home/topic", //生成专题
materialTopic: "material/topic", //专题首页
materialHomeQrcode: "material/home/qrcode", //获取二维码
materialStatistics: 'material/statistics', //数据分析_首页
materialStatisticsCal: 'material/statistics/cal', //数据分析_累计数据
materialStatisticsChart: 'material/statistics/chart', //数据分析_图表
+31 -3
View File
@@ -446,10 +446,17 @@ apiQuery.getAppCity = function(params){
})
}
//素材首页
apiQuery.getMaterialHome = function(params){
//推广素材_tab
apiQuery.getMaterialHomeTabs = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHome, 2, params, "GET", resolve, reject)
HttpRequest(false, Config.api.materialHomeTabs, 2, params, "GET", resolve, reject)
})
}
//推广素材_lists
apiQuery.getMaterialHomeLists = function(params){
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialHomeLists, 2, params, "GET", resolve, reject)
})
}
@@ -474,4 +481,25 @@ apiQuery.getMaterialHomeQrcode = function(params){
})
}
//数据分析_首页
apiQuery.getMaterialStatistics = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialStatistics, 2, params, "GET", resolve, reject)
})
}
//数据分析_累计数据
apiQuery.getMaterialStatisticsCal = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialStatisticsCal, 2, params, "GET", resolve, reject)
})
}
//数据分析_图表
apiQuery.getMaterialStatisticsChart = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.materialStatisticsChart, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+15 -16
View File
@@ -33,7 +33,7 @@ Component({
//组件的初始数据
data: {
headImg:app.getStorageByKey("userInfo").headimg,
//headImg:app.getStorageByKey("userInfo").headimg,
defaultQrcode: _.config.imgUrl + 'common/qr.jpg',
imgs: [],
tempPosterPath: '',
@@ -48,7 +48,7 @@ Component({
observers: {
'isCreateQrcode': function (e) {
if (e) {
this.getAppUdataFcms()
this.getMaterialHomeQrcode()
}
},
'isShow': function (e) {
@@ -61,9 +61,9 @@ Component({
},
'customImg': function (e) {
if (e) {
this.setData({
headImg:app.getStorageByKey("userInfo").headimg,
})
// this.setData({
// headImg:app.getStorageByKey("userInfo").headimg,
// })
//头像
//this.getImageInfo(this.data.headImg, 4)
this.getImageInfo(this.data.customImg, 3)
@@ -97,17 +97,16 @@ Component({
},
//获取二维码
getAppUdataFcms() {
this.getImageInfo('https://img.liche.cn/liche/wx_8877c06d8591ac51.png', 2)
// _.apiQuery.getAppUdataFcms({
// id: this.data.qccodeid,
// }).then(res => {
// this.getImageInfo(res.data.img, 2)
// }).catch(res => {
// //this.getImageInfo(this.data.defaultQrcode, 2)
// })
getMaterialHomeQrcode() {
let params = {};
params['page'] = 'pages/special2/index';
params['scene'] = this.data.qccodeid+'_'+app.getStorageByKey("userInfo").biz_id;
params['width'] = 260;
_.apiQuery.getMaterialHomeQrcode(params).then(res => {
this.getImageInfo(res.data.url, 2)
}).catch(res => {
//this.getImageInfo(this.data.defaultQrcode, 2)
})
},
//自定义海报
+6 -8
View File
@@ -1,14 +1,12 @@
<!-- components/poster/index.wxml -->
<view class="poster fixed {{isShow?'show':'hide'}}">
<view class="poster-bg absolute top-0 bottom-0 left-0 right-0" bindtap="hidePoster"></view>
<view class="poster-main absolute top-0 bottom-0 left-0 right-0">
<view class="poster-main-img absolute box-center-middle">
<canvas canvas-id='postercanvas' class='canvas absolute box-center-middle' style="width:{{canvasInfo.width}};height:{{canvasInfo.height}}"></canvas>
<view wx:if="{{showOptBtn}}"><image class="block wp100 ulib-r10" wx:if="{{tempPosterPath}}" src="{{tempPosterPath}}" mode="widthFix" catchtap="preview" /></view>
<view class="mt40 fn-flex" wx:if="{{showOptBtn}}">
<button class="fn-flex-item bds-2-fff btn-no-bg font-32 color-fff ulib-r750 text-center ml20 mr20" catchtap="pushLink" data-url="/pages/distribute/special/index?iscall=0">专题预览</button>
<button class=" fn-flex-item btn-f9394d font-32 color-fff ulib-r750 text-center ml20 mr20" hover-class="btn-f9394d-hover" catchtap="saveToAblum">保存分享</button>
</view>
<view class="poster-main poster-main-img absolute box-center-middle">
<canvas canvas-id='postercanvas' class='canvas absolute box-center-middle' style="width:{{canvasInfo.width}};height:{{canvasInfo.height}}"></canvas>
<view wx:if="{{showOptBtn}}"><image class="block wp100 ulib-r10" wx:if="{{tempPosterPath}}" src="{{tempPosterPath}}" mode="widthFix" catchtap="preview" /></view>
<view class="mt40 fn-flex" wx:if="{{showOptBtn}}">
<button class="fn-flex-item bds-2-fff btn-no-bg font-32 color-fff ulib-r750 text-center ml20 mr20" catchtap="pushLink" data-url="/pages/distribute/special/index?id={{qccodeid}}">专题预览</button>
<button class=" fn-flex-item btn-f9394d font-32 color-fff ulib-r750 text-center ml20 mr20" hover-class="btn-f9394d-hover" catchtap="saveToAblum">保存分享</button>
</view>
</view>
</view>
+5 -16
View File
@@ -1,5 +1,4 @@
import Utils from '../../commons/js/utils/util'
const app = getApp()
Component({
/**
* 组件的属性列表
@@ -15,7 +14,7 @@ Component({
},
bgColor: {
type: String,
value: '#fe2643'
value: '#1a1a1a'
},
isShowBg: {
type: Boolean,
@@ -57,7 +56,7 @@ Component({
isShowRetBtn: true
})
}
if (Utils.getCurrentPath().url == 'pages/index/index') {
if (Utils.getCurrentPath().url == 'pages/index/index'||Utils.getCurrentPath().url == 'pages/login/index'||Utils.getCurrentPath().url == 'pages/customer/index'||Utils.getCurrentPath().url == 'pages/order/index'||Utils.getCurrentPath().url == 'pages/channel/index'||Utils.getCurrentPath().url == 'pages/dataAnalysis/index') {
this.setData({
isShowHomeBtn: true
})
@@ -89,19 +88,9 @@ Component({
})
},
home: function () {
// wx.switchTab({
// url: '/pages/index/index'
// })
if(app.getStorageByKey("userInfo").group_id==4){
wx.reLaunch({
url: '/pages/channel/index'
})
}else{
wx.reLaunch({
url: '/pages/index/index'
})
}
wx.switchTab({
url: '/pages/index/index'
})
}
}
})
+1 -1
View File
@@ -1,6 +1,6 @@
{
"component": true,
"usingComponents": {
"lcb-searchBar": "/components/searchBar/index"
"lc-searchBar": "/components/searchBar/index"
}
}
+3 -7
View File
@@ -1,5 +1,5 @@
<view>
<view class="fixed top-0 left-0 right-0 z-index-1" style="height: {{status + navHeight}}px;background-color:{{bgColor}}" wx:if="{{isShowBg}}"></view>
<view class="fixed top-0 left-0 right-0 z-index-2" style="height: {{status + navHeight}}px;background-color:{{bgColor}}" wx:if="{{isShowBg}}"></view>
<view class="fixed top-0 left-0 right-0 z-index-9999" style="height: {{status + navHeight}}px;">
<view style='height: {{status}}px;'></view>
<view class="relative" style='height:{{navHeight}}px;line-height:{{navHeight}}px;' wx:if="{{type=='home'}}">
@@ -12,16 +12,12 @@
<view class='relative' style='height:{{navHeight}}px;' wx:else>
<view class="absolute left-0 box-middle" style="width:80px;height:32px;margin-left:7px;box-sizing:border-box;" wx:if="{{!isShowRetBtn}}">
<view class="absolute left-0 box-middle pl15 pr15" bindtap='back'>
<i class="lcb-icon mr10 icon-fanhui" style="font-size:22px;color:{{txtColor}};"></i>
<i class="iconfont mr10 icon-fanhui" style="font-size:22px;color:{{txtColor}};"></i>
</view>
<!-- <view class="absolute top-0 bottom-0 mt15 mb15 box-center bls-ddd" style="width:10rpx;"></view> -->
<!-- <view class="absolute right-0 box-middle pl20 pr20" bindtap='home' wx:if="{{!isShowHomeBtn}}">
<i class="lcb-icon icon-shouye1" style="font-size:22px;color:{{txtColor}}"></i>
</view> -->
</view>
<view class="absolute left-0 box-middle" style="width:40px;height:32px;margin-left:7px;box-sizing:border-box;" wx:else>
<view class="absolute box-center-middle" bindtap='home' wx:if="{{!isShowHomeBtn}}">
<i class="lcb-icon icon-shouye1" style="font-size:22px;color:{{txtColor}}"></i>
<i class="iconfont icon-shouye1" style="font-size:22px;color:{{txtColor}}"></i>
</view>
</view>
<view class='navbarTitle absolute box-center-middle wp40 text-center text-nowrap text-bold' style="color:{{txtColor}};">{{titleText}}</view>
+8 -18
View File
@@ -12,6 +12,13 @@ Page({
})
}
//获取用户信息
_.apiQuery.getUserInfo().then(res => {
this.setData({
userInfo: res
})
})
wx.getSystemInfo({
success (res) {
if(res.system.indexOf('Android')>-1){
@@ -42,24 +49,7 @@ Page({
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
this.getDistributionHome()
},
//用户点击右上角分享
onShareAppMessage: function (res) {
let title = ''
let path = '/pages/mine/index'
let imageUrl = this.data.info.btn.shareImg
if (res.from === 'button') {
// 来自页面内转发按钮
title = '@'+this.data.nickname + this.data.info.btn.shareTitle
path = path + '?team=1&cf_uid=' + this.data.uid
}
return {
title: title,
path: path,
imageUrl: imageUrl
}
//this.getDistributionHome()
},
})
+1 -1
View File
@@ -17,7 +17,7 @@
</view>
</view>
<view class="mt30 inner40" bindtap="pushLink" data-url="lcb://navigateToMiniPrograms??appId=wx98e64c11aac45966@path=/pages/storeInfo/index">
<view class="mt30 inner40" bindtap="pushLink" data-url="lcb://navigateToMiniPrograms??appId=wx98e64c11aac45966@path=/pages/storeInfo/index?biz_id={{userInfo.biz_id}}">
<button class="btn-f9394d font-32 color-fff ulib-r750 text-center ml35 mr35 pt10 pb10">分享店铺</button>
</view>
+68 -90
View File
@@ -27,92 +27,65 @@ Page({
})
}
this.getContentSubCmsTabs()
//获取用户信息
_.apiQuery.getUserInfo().then(res => {
this.setData({
userInfo: res
})
})
this.getMaterialHomeTabs()
},
//推广素材tab
getContentSubCmsTabs(){
getMaterialHomeTabs(){
_.apiQuery.getMaterialHomeTabs().then(res => {
this.setData({
cate_list: res.data,
})
let res = {"code":200,"data":[{"id":4,"name":"狸车海报"},{"id":3,"name":"活动专题"},{"id":5,"name":"公号测评"},{"id":6,"name":"朋友圈"},{"id":7,"name":"其它"}],"msg":""}
this.setData({
cate_list: res.data,
})
this.getMaterialHomeLists()
this.getContentSubCms()
wx.stopPullDownRefresh() //停止下拉刷新
// _.apiQuery.getContentSubCmsTabs().then(res => {
// this.setData({
// cate_list: res.data,
// })
// this.getContentSubCms()
// wx.stopPullDownRefresh() //停止下拉刷新
// });
wx.stopPullDownRefresh() //停止下拉刷新
});
},
//cms列表
getContentSubCms() {
let res = {"code":200,"data":{"list":[{"id":"14","title":"我在狸车上看到一款超棒电动 汽车,赶紧来看看吧~","img":"https:\/\/img.liche.cn\/liche\/2021\/08\/498ae4b8baa293dd\/1ea396feac03223c.jpg","url":"\/pages\/mine\/index","e_time":"2024-08-02 23:59:59","target_id":"0","status":1,"btn_type":"1"}],"total":1},"msg":""}
getMaterialHomeLists() {
this.setData({
flag: this.data.flag - 1
load: false,
loading: true,
})
if (this.data.flag<1) {
let params = {};
params['page'] = this.data.pageNo;
params['size'] = 20;
params['type'] = this.data.cate_list[this.data.cateIndex].id;
_.apiQuery.getMaterialHomeLists(params).then(res => {
this.setData({
pageNo: this.data.pageNo + 1,
list: this.data.list.concat(res.data.list),
load: true,
loading: false,
flag: this.data.flag - 1
})
if (res.data.total == 0) {
if (this.data.flag<1) {
this.setData({
noData: true
})
} else if (this.data.list.length == res.data.total) {
this.setData({
end: true
show:res.data.show,
pageNo: this.data.pageNo + 1,
list: this.data.list.concat(res.data.list),
load: true,
loading: false,
})
if (res.data.total == 0) {
this.setData({
noData: true
})
} else if (this.data.list.length == res.data.total) {
this.setData({
end: true
})
}
}
}
wx.stopPullDownRefresh()
// this.setData({
// load: false,
// loading: true,
// })
// let params = {};
// params['page'] = this.data.pageNo;
// params['size'] = 20;
// params['position'] = this.data.cate_list[this.data.cateIndex].id;
// _.apiQuery.getContentSubCms(params).then(res => {
// this.setData({
// flag: this.data.flag - 1
// })
// if (this.data.flag<1) {
// this.setData({
// pageNo: this.data.pageNo + 1,
// list: this.data.list.concat(res.data.list),
// load: true,
// loading: false,
// })
// if (res.data.total == 0) {
// this.setData({
// noData: true
// })
// } else if (this.data.list.length == res.data.total) {
// this.setData({
// end: true
// })
// }
// }
// wx.stopPullDownRefresh()
// });
wx.stopPullDownRefresh()
});
},
//切换分类
@@ -128,7 +101,7 @@ Page({
cateIndex: e.currentTarget.dataset.index,
flag: this.data.flag + 1,
})
this.getContentSubCms()
this.getMaterialHomeLists()
}
},
@@ -136,7 +109,7 @@ Page({
showPoster(e){
let index = e.currentTarget.dataset.index
let that = this
if(that.data.list[index].status == 0){
if(that.data.list[index].if_add == 0){
that.setData({
showPoster:true,
currentIndex:index,
@@ -148,7 +121,7 @@ Page({
that.setData({
'poster.isCreateQrcode':true,
'poster.qrcodeid':that.data.list[index].id,
'poster.customPoster':that.data.list[index].img,
'poster.customPoster':that.data.list[index].cover,
'poster.slogan':that.data.list[index].title,
})
setTimeout(function(){
@@ -162,24 +135,29 @@ Page({
},
//生成海报
createSpecial(e){
putMaterialHomeTopic(e){
let that = this
wx.showLoading({
title: '正在生成中...',
})
that.setData({
showPoster:false,
'poster.isCreateQrcode':true,
'poster.qrcodeid':that.data.list[that.data.currentIndex].id,
'poster.customPoster':that.data.list[that.data.currentIndex].img,
'poster.slogan':that.data.list[that.data.currentIndex].title,
})
setTimeout(function(){
that.setData({
'poster.isShow': true
let params = {};
params['t_id'] = that.data.list[that.data.currentIndex].id;
_.apiQuery.putMaterialHomeTopic(params).then(res => {
wx.showLoading({
title: '正在生成中...',
})
wx.hideLoading()
},3000)
that.setData({
showPoster:false,
['list['+that.data.currentIndex+'].if_add']:1,
'poster.isCreateQrcode':true,
'poster.qrcodeid':that.data.list[that.data.currentIndex].id,
'poster.customPoster':that.data.list[that.data.currentIndex].cover,
'poster.slogan':that.data.list[that.data.currentIndex].title,
})
setTimeout(function(){
that.setData({
'poster.isShow': true
})
wx.hideLoading()
},3000)
});
},
//复制内容
@@ -214,7 +192,7 @@ Page({
loading: false,
flag: this.data.flag + 1
})
this.getContentSubCms()
this.getMaterialHomeLists()
},
//页面上拉触底事件的处理函数
@@ -223,7 +201,7 @@ Page({
this.setData({
flag: this.data.flag + 1
})
this.getContentSubCms()
this.getMaterialHomeLists()
},
})
+14 -17
View File
@@ -8,24 +8,21 @@
</view>
</view>
<view class="ml160">
<view class="fn-clear">
<view class="fn-clear" wx:if="{{show=='image'}}">
<block wx:for='{{list}}' wx:for-item='item' wx:key='index'>
<image bindtap="showPoster" data-index="{{index}}" class='block fn-fl mt30 ml30 img-250x445 box-shadow-000-3-5' lazy-load="{{true}}" mode="aspectFit" src="{{item.img}}"></image>
<image bindtap="showPoster" data-index="{{index}}" class='block fn-fl mt30 ml30 img-250x445 box-shadow-000-3-5' lazy-load="{{true}}" mode="aspectFit" src="{{item.cover}}"></image>
</block>
</view>
<view class="bg-fff mt30 ml30 mr30 inner30 box-shadow-000-10-10 ulib-r10">
<view class="font-32 color-666 line-height-16">哪吒V仅售28999元,立即预约马上试驾,还可享受5年电池质保~</view>
<view class="mt10 text-right">
<view class="inline-block bg-333 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750" bindtap="copyWord" data-tx="哪吒V仅售28999元,立即预约马上试驾,还可享受5年电池质保~">复制</view>
</view>
</view>
<view class="bg-fff mt30 ml30 mr30 inner30 box-shadow-000-10-10 ulib-r10">
<view class="font-32 color-666 line-height-16">哪吒V仅售28999元,立即预约马上试驾,还可享受5年电池质保~</view>
<view class="mt10 text-right">
<view class="inline-block bg-333 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750" bindtap="copyWord" data-tx="哪吒V仅售28999元,立即预约马上试驾,还可享受5年电池质保~">复制</view>
</view>
<view wx:if="{{show=='text'}}">
<block wx:for='{{list}}' wx:for-item='item' wx:key='index'>
<view class="bg-fff mt30 ml30 mr30 inner30 box-shadow-000-10-10 ulib-r10">
<view class="font-32 color-666 line-height-16">{{item.content}}</view>
<view class="mt10 text-right">
<view class="inline-block bg-333 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750" bindtap="copyWord" data-tx="{{item.content}}">复制</view>
</view>
</view>
</block>
</view>
<lcb-listmore isLoading='{{loading}}' isEnd='{{end&&list.length>6}}' isNoData='{{noData}}'></lcb-listmore>
@@ -37,11 +34,11 @@
<lcb-msg isShow="{{showPoster}}" isTransparent='{{true}}'>
<view slot="content">
<view style="width:580rpx;">
<image class="block wp100 ulib-r10" src="{{list[currentIndex].img}}" mode="widthFix" />
<image class="block wp100 ulib-r10" src="{{list[currentIndex].cover}}" mode="widthFix" />
</view>
<view class="mt40 fn-flex">
<button class="fn-flex-item bds-2-fff btn-no-bg font-32 color-fff ulib-r750 text-center ml20 mr20" bindtap="pushLink" data-url="/pages/distribute/special/index?iscall=0">专题预览</button>
<button class="fn-flex-item btn-f9394d font-32 color-fff ulib-r750 text-center ml20 mr20" hover-class="btn-f9394d-hover" catchtap="createSpecial">生成专题</button>
<button class="fn-flex-item bds-2-fff btn-no-bg font-32 color-fff ulib-r750 text-center ml20 mr20" bindtap="pushLink" data-url="/pages/distribute/special/index?id={{list[currentIndex].id}}">专题预览</button>
<button class="fn-flex-item btn-f9394d font-32 color-fff ulib-r750 text-center ml20 mr20" hover-class="btn-f9394d-hover" catchtap="putMaterialHomeTopic">生成专题</button>
</view>
</view>
</lcb-msg>
+115 -44
View File
@@ -1,66 +1,137 @@
// pages/distribute/special/index.js
import _ from '../../../commons/js/commons'
const app = getApp()
let flagForScroll = false
Page({
/**
* 页面的初始数据
*/
//页面的初始数据
data: {
navBar: {
title: '',
bgColor: '#fff',
isShowBg: false,
txtColor: '#fff'
},
flagForBarColor: 'fff',
isBindMobile:true,
isShowBindMobile:false,
banneractive:0,
info:'',
},
/**
* 生命周期函数--监听页面加载
*/
//生命周期函数--监听页面加载
onLoad: function (options) {
},
if (options.scene) { //二维码入口
let sceneArr = options.scene.split('_')
this.setData({
id:sceneArr[0],
biz_id:sceneArr[1],
})
} else { // 链接入口
for (let key in options) {
this.setData({
[key]: options[key]
})
}
}
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
flagForScroll = false
this.getMaterialTopic()
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//生命周期函数--监听页面显示
onShow(){
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ffffff'
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
//cms详细信息
getMaterialTopic() {
if (this.data.id) {
let that = this
let params = {};
params['id'] = this.data.id;
_.apiQuery.getMaterialTopic(params).then(res => {
that.setData({
info: res.data,
})
wx.stopPullDownRefresh()
})
} else {
_.utils.$toast('查无此信息')
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
//banner轮播点
bannerChange(e) {
let index = e.detail.current;
this.setData({
banneractive: index,
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//预约看车
putMaterialBiz(){
_.utils.$toast('预览专题不可报名')
},
onPageScroll(obj) {
if (obj.scrollTop > _.config.elementScrollTop && !flagForScroll) {
flagForScroll = true
this.setData({
//'navBar.title': this.data.info.title,
'navBar.isShowBg': true,
'navBar.txtColor': '#333',
flagForBarColor: '000'
})
wx.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#000000',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})
} else if (obj.scrollTop < _.config.elementScrollTop && flagForScroll) {
flagForScroll = false
this.setData({
'navBar.title': '',
'navBar.isShowBg': false,
'navBar.txtColor': '#fff',
flagForBarColor: 'fff'
})
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ffffff',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})
}
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
this.setData({
banneractive:0,
})
this.getMaterialTopic()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
+8 -1
View File
@@ -1,3 +1,10 @@
{
"usingComponents": {}
"enablePullDownRefresh": true,
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#333",
"backgroundColor": "#ffffff",
"backgroundColorTop": "#333",
"usingComponents": {
}
}
+35 -2
View File
@@ -1,2 +1,35 @@
<!--pages/distribute/special/index.wxml-->
<text>pages/distribute/special/index.wxml</text>
<lcb-navBar titleText="{{navBar.title}}" txtColor="{{navBar.txtColor}}" bgColor="{{navBar.bgColor}}" isShowBg="{{navBar.isShowBg}}"></lcb-navBar>
<block wx:if="{{info.type==2}}">
<view class='relative hp100 overflowhidden' wx:if="{{info.lists.length > 1}}" style="{{info.sign_up==1?'min-height:calc(100vh - 142rpx);':'min-height:100vh;'}}">
<swiper class='wp100 hp100' circular autoplay bindchange="bannerChange" style="{{info.sign_up==1?'min-height:calc(100vh - 142rpx);':'min-height:100vh;'}}">
<swiper-item wx:for='{{info.lists}}' class="relative hp100 img-middle-cover" style="background-image:url({{item.img}}); {{info.sign_up==1?'min-height:calc(100vh - 142rpx);':'min-height:100vh;'}}" wx:key='index' bindtap='pushLink' data-url='{{item.link}}'>
</swiper-item>
</swiper>
<view class="absolute left-0 right-0 bottom-0 mb30 text-center" style='height:45rpx' wx:if="{{info.lists.length > 1}}">
<block wx:for-items="{{info.lists}}" wx:for-index="j" wx:key='j'>
<view class="inline-block indicator-pin {{banneractive==j?'active':''}}"></view>
</block>
</view>
</view>
<view class='relative hp100 overflowhidden img-middle-cover' style="background-image:url({{info.lists[0].img}}); {{info.sign_up==1?'min-height:calc(100vh - 142rpx);':'min-height:100vh;'}}" wx:elif="{{info.lists.length == 1}}" bindtap='pushLink' data-url='{{info.lists[0].link}}'>
</view>
</block>
<block wx:elif="{{info.type==1}}">
<view class='relative overflowhidden'>
<block wx:for='{{info.lists}}' wx:key='index'>
<image class='block wp100' wx:if="{{item.video_type==2&&item.img}}" src="{{item.img}}" show-menu-by-longpress='true' lazy-load="{{true}}" mode="widthFix"></image>
<video class="block img-750x422" wx:elif="{{item.video_type==1&&item.video}}" src="{{item.video}}" poster="{{item.video_cover?item.video_cover:''}}" loop='{{false}}' custom-cache="{{false}}" object-fit='contain'></video>
</block>
</view>
</block>
<block wx:if="{{info.sign_up==1}}">
<view style="height:142rpx;"></view>
<view class="fixed left-0 right-0 bottom-0 pt20 pl40 pr40 pb40 bg-fff-op95">
<view class="pt20 pb20 bg-1a text-center font-32 color-fff ulib-r750" bindtap="putMaterialBiz" disabled="{{isSubmiting}}">预约看车</view>
</view>
</block>
+14 -1
View File
@@ -1 +1,14 @@
/* pages/distribute/special/index.wxss */
page{min-height:100%;}
.hp100{box-sizing:border-box;}
.indicator-pin {
margin: 0 6rpx;
width: 12rpx;
height:12rpx;
border-radius:12rpx;
background-color:#333;
transition: .5s all ease-in;
}
.indicator-pin.active {
background-color:#fff;
}
+87 -147
View File
@@ -3,19 +3,7 @@ import popularData from '../../../commons/js/lib/popularData';
import * as echarts from '../../../ecCanvas/components/ec-canvas/echarts';
const app = getApp()
let barChartData;
let lineChartData;
function barChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = barChartData
chart.setOption(option);
return chart;
}
function lineChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
@@ -31,29 +19,13 @@ function lineChart(canvas, width, height, dpr) {
Page({
data: {
imgUrl:_.config.imgUrl,
showBarChart:false,//是否显示Bar图表
ecBar:{},
materialArray: [],
materialobj: [],
materialIndex:-1,
dateTime:'',
calList: [],
showLineChart:false,//是否显示Line图表
ecLine:{},
storeArray: [],
storeobj: [],
storeIndex:0,
staffArray: [],
staffobj: [],
staffIndex:-1,
tabId:'1',
tab:[
{
id: 1,
title: '客户数据'
},
{
id: 2,
title: '订单数据'
},
],
custom:[],//客户数据
order:[],//订单数据
},
onLoad(options) {
@@ -62,13 +34,14 @@ Page({
[key]: options[key]
})
}
popularData.getDateLater(0,0).then(res => {
this.setData({
dateTime:res[0],
})
})
// popularData.getDateLater(0,0).then(res => {
// this.setData({
// dateTime:res[0],
// })
// })
this.getAppStatisticsOcust()
this.getMaterialStatistics()
this.getMaterialStatisticsChart()
},
@@ -76,99 +49,86 @@ Page({
},
//获取管理门店
getAppUserAdmins(){
let params = {};
params['biz_id'] = this.data.storeobj[this.data.storeIndex].id;
params['page'] = 1;
params['size'] = 1000;
_.apiQuery.getAppUserAdmins(params).then(res => {
let staffArray = []
res.data.list.forEach(item => {
staffArray.push(item.uname)
//数据分析_首页
getMaterialStatistics(){
_.apiQuery.getMaterialStatistics().then(res => {
wx.setNavigationBarTitle({
title:res.data.title,
})
let materialArray = []
res.data.topic_list.forEach(item => {
materialArray.push(item.title)
})
this.setData({
staffArray:staffArray,
staffobj: res.data.list,
biz_name:res.data.biz_name,
materialArray:materialArray,
materialobj: res.data.topic_list,
materialIndex:-1,
})
this.getMaterialStatisticsCal()
});
},
//数据分析_累计数据
getMaterialStatisticsCal(){
let params = {};
if(this.data.dateTime != ''){
params['day'] = this.data.dateTime;
}
if(this.data.materialIndex>-1){
params['t_id'] = this.data.materialobj[this.data.materialIndex].id;
}
_.apiQuery.getMaterialStatisticsCal(params).then(res => {
this.setData({
calList:res.data,
})
});
},
//数据分析-订单数据
getAppStatisticsOcust(){
getMaterialStatisticsChart(){
let res = {
"code":200,
"data":{
"stat_data":{
"tooltip":{"trigger":"axis"},
"legend":{
"top":"bottom",
"data":["浏览","客户","订单"]
},
"grid":{"top":"10%","left":"2%","right":"5%","bottom":"15%","containLabel":true},
"xAxis":{
"type":"category",
"boundaryGap":false,
"data":["1","2","3","4","5","6","7","8","9","10","11","12",]
},
"yAxis":{"type":"value"},
"series":[
{"name":"浏览","type":"line","stack":"总量","data":[2,3,4,3,6,7,2,3,4,3,6,7,],"smooth":true},
{"name":"客户","type":"line","stack":"总量","data":[3,6,7,3,6,7,3,6,7,3,6,7,],"smooth":true},
{"name":"订单","type":"line","stack":"总量","data":[5,2,1,5,2,1,5,2,1,5,2,1,],"smooth":true},
]
},
"season_data":[],
"season":3
},
"msg":""
}
lineChartData = res.data.stat_data
this.setData({
order:res.data.custom,
showLineChart:true,
['ecLine.onInit']:lineChart,
ecLine:{},
showLineChart:false,
})
wx.stopPullDownRefresh()
// let params = {};
// params['biz_id'] = this.data.storeobj[this.data.storeIndex].id;
// params['day'] = this.data.dateTime;
// if(this.data.staffIndex>-1){
// params['admin_id'] = this.data.staffobj[this.data.staffIndex].id;
let params = {};
// if(this.data.dateTime != ''){
// params['day'] = this.data.dateTime;
// }
// _.apiQuery.getAppStatisticsOcust(params).then(res => {
// if(this.data.materialIndex>-1){
// params['t_id'] = this.data.materialobj[this.data.materialIndex].id;
// }
_.apiQuery.getMaterialStatisticsChart(params).then(res => {
// lineChartData = res.data.stat_data
// this.setData({
// order:res.data.custom,
// showLineChart:true,
// ['ecLine.onInit']:lineChart,
// })
// wx.stopPullDownRefresh()
lineChartData = {
"tooltip":{"trigger":"axis"},
"legend":{
"top":"bottom",
"data":[]
},
"grid":{"top":"10%","left":"2%","right":"5%","bottom":"15%","containLabel":true},
"xAxis":{
"type":"category",
"boundaryGap":false,
"data":[]
},
"yAxis":{"type":"value"},
"series":[]
}
// });
},
lineChartData.legend.data = res.data.legend
lineChartData.xAxis.data = res.data.xAxis
lineChartData.series = res.data.series
//选择城市
changeCity(e) {
this.setData({
city_id:this.data.cityList[e.detail.value].city_id,
cityIndex: e.detail.value
})
this.getAppUserBizs()
},
this.setData({
showLineChart:true,
['ecLine.onInit']:lineChart,
})
//选择门店
changeStore(e) {
this.setData({
storeIndex: e.detail.value
})
this.getAppStatisticsOcust()
});
},
//日期选择
@@ -176,11 +136,15 @@ Page({
this.setData({
dateTime: e.detail.value,
})
if(this.data.tabId==1){
this.getAppStatisticsScust()
}else if(this.data.tabId==2){
this.getAppStatisticsOcust()
}
this.getMaterialStatisticsCal()
},
//选择素材
changeMaterial(e) {
this.setData({
materialIndex: e.detail.value
})
this.getMaterialStatisticsCal()
},
//推送链接
@@ -192,32 +156,8 @@ Page({
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
//this.getAppUserBizs()
this.getMaterialStatistics()
this.getMaterialStatisticsChart()
},
})
function getLineOption() {
return{
grid: {
top: '15%',
left: '2%',
right: '5%',
bottom: '5%',
containLabel: true
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月',]
},
yAxis: {
type: 'value'
},
series: [{
data: [20, 932, 901,],
type: 'line',
smooth: true
}]
};
}
})
+15 -31
View File
@@ -1,24 +1,24 @@
<view class="container">
<view class="inner30 img-top-cover" style="background-image:url({{imgUrl}}channel/theme.jpg);">
<!-- 管辖门店 -->
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="bg-f6 pt25 pb25 pl30 pr30 font-32 fn-clear ulib-r10">泉州鲤城区4s店</view>
<view class="bg-f6 pt25 pb25 pl30 pr30 font-32 fn-clear ulib-r10">{{biz_name}}</view>
<view class="mt20 bg-f6 pt25 pb25 pl30 pr30 font-32 fn-clear ulib-r10">
<view class="fn-fl">日期选择</view>
<picker class="fn-fr" mode="date" value="{{dateTime}}" bindchange="changeDate">
<view class="color-666">
<text>{{dateTime}}</text>
<text wx:if="{{dateTime == ''}}">全部</text>
<text wx:else>{{dateTime}}</text>
<i class="iconfont ml10 icon-gengduo font-26 color-999"></i>
</view>
</picker>
</view>
<view class="mt20 bg-f6 pt25 pb25 pl30 pr30 font-32 fn-clear ulib-r10">
<view class="fn-fl">素材选择</view>
<picker class="fn-fr" bindchange="changeStaff" value="{{staffIndex}}" range="{{staffArray}}">
<picker class="fn-fr" bindchange="changeMaterial" value="{{materialIndex}}" range="{{materialArray}}">
<view class="color-666">
<text wx:if="{{staffIndex == -1}}">全部</text>
<text wx:else>{{staffArray[staffIndex]}}</text>
<text wx:if="{{materialIndex == -1}}">全部</text>
<text wx:else>{{materialArray[materialIndex]}}</text>
<i class="iconfont ml10 icon-gengduo font-26 color-999"></i>
</view>
</picker>
@@ -28,36 +28,20 @@
<view>
<view class="mt40 inner30 pr0 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="fn-flex fn-flex-wrap pt20 pb30">
<block wx:for="{{calList}}" wx:key="index">
<view class="wp33 pr25">
<view class="relative pt15 pb15 pl75 bg-f6 ulib-r10 overflowhidden line-height-13">
<view class="absolute top-0 left-0 bottom-0 pl60 bg-999">
<i class="absolute box-center-middle iconfont font-30 color-fff icon-liulan"></i>
<view class="relative pt15 pb15 pl75 bg-f6 ulib-r10 overflowhidden line-height-13">
<view class="absolute top-0 left-0 bottom-0 pl60 bg-999">
<i class="absolute box-center-middle iconfont font-30 color-fff {{item.icon}}"></i>
</view>
<view class="font-28 text-bold">{{item.value}}</view>
<view class="font-22 color-666">{{item.name}}</view>
</view>
<view class="font-28 text-bold">233</view>
<view class="font-22 color-666">浏览次数</view>
</view>
</view>
<view class="wp33 pr25">
<view class="relative pt15 pb15 pl75 bg-f6 ulib-r10 overflowhidden line-height-13">
<view class="absolute top-0 left-0 bottom-0 pl60 bg-999">
<i class="absolute box-center-middle iconfont font-30 color-fff icon-baoming"></i>
</view>
<view class="font-28 text-bold">233</view>
<view class="font-22 color-666">报名客户</view>
</view>
</view>
<view class="wp33 pr25">
<view class="relative pt15 pb15 pl75 bg-f6 ulib-r10 overflowhidden line-height-13">
<view class="absolute top-0 left-0 bottom-0 pl60 bg-999">
<i class="absolute box-center-middle iconfont font-30 color-fff icon-dingdan"></i>
</view>
<view class="font-28 text-bold">12.23w</view>
<view class="font-22 color-666">订单客户</view>
</view>
</view>
</block>
</view>
<view class="relative height-500 mr30 z-index-0">
<view class="absolute wp100 height-500">
<view class="absolute wp100 height-500" wx:if="{{showLineChart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecLine }}"></ec-canvas>
</view>
</view>
+40 -18
View File
@@ -3,24 +3,6 @@ const app = getApp()
Page({
data: {
imgUrl:_.config.imgUrl,
list:[
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-zichan.png',
title:'我的资产',
url:'',
},
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sucai.png',
title:'我的素材',
url:'/pages/distribute/index',
},
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sezhi.png',
title:'账户设置',
url:'/pages/mine/install/index',
},
],
isShowAddStaff:false,
name:'',
mobile:'',
@@ -33,6 +15,46 @@ Page({
})
}
let list = []
if(this.data.source=='channel'){
list = [
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-zichan.png',
title:'我的资产',
url:'',
},
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sezhi.png',
title:'账户设置',
url:'/pages/mine/install/index',
},
]
}else if(this.data.source=='shop'){
list = [
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-zichan.png',
title:'我的资产',
url:'',
},
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sucai.png',
title:'我的素材',
url:'/pages/distribute/index',
},
{
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sezhi.png',
title:'账户设置',
url:'/pages/mine/install/index',
},
]
}
this.setData({
list:list,
})
this.getUserInfo()
wx.getSystemInfo({