Commit 770a604d by 张立顺

新增页面刷新

1 parent 34682514
...@@ -650,7 +650,8 @@ Page({ ...@@ -650,7 +650,8 @@ Page({
}) })
let arrinx = arr.findIndex(e => e.clueType == 1 && e.starTag == 0) let arrinx = arr.findIndex(e => e.clueType == 1 && e.starTag == 0)
this.setData({ this.setData({
disLikeFlagIdx: arrinx disLikeFlagIdx: arrinx,
triggered: false
}) })
} }
}, },
...@@ -750,6 +751,19 @@ Page({ ...@@ -750,6 +751,19 @@ Page({
}) })
this.getPageApi(params) this.getPageApi(params)
}, },
// 下拉刷新
refreshList() {
// console.log('onPullDownRefresh: ');
let { clueParams } = this.data
this.getClueInit(clueParams)
// this.resetCluelist()
// this.onLoad()
wx.pro.showToast({
title: '刷新成功',
icon: 'loading',
duration: 1500
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
...@@ -763,18 +777,7 @@ Page({ ...@@ -763,18 +777,7 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {},
// console.log('onPullDownRefresh: ');
let { clueParams } = this.data
this.getClueInit(clueParams)
// this.resetCluelist()
// this.onLoad()
wx.pro.showToast({
title: '刷新成功',
icon: 'loading',
duration: 1500
})
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
......
...@@ -84,6 +84,38 @@ Component({ ...@@ -84,6 +84,38 @@ Component({
}) })
this.getTotalMerchantCount() this.getTotalMerchantCount()
}, },
refreshList() {
console.log('refreshList')
let { dataObj, userInfo, list, current } = this.data
let merchantId = list[current]['merchantId']
let selectName = list[current]['selectName'] || '累计'
const itemList = ['本月', '本日', '累计']
let index = itemList.findIndex(item => {
return item == selectName
})
const keyName = {
0: 'monthTime',
1: 'todayTime',
2: 'defaultTime'
}
let params = {
partnerMerchantId: userInfo.merchantId, // userInfo.merchantId
merchantIdList: [merchantId],
...dataObj[keyName[index]]
}
console.log('params', params)
this.getMerchantById(params)
.then(result => {
console.log(result)
this.setData({
triggered: false
})
wx.$api.showToast('刷新成功')
that.setMerchantObj(current, result, itemList[res.tapIndex], item)
})
.catch(err => {})
},
pickSheet(e) { pickSheet(e) {
let that = this let that = this
let { index, item } = e.currentTarget.dataset let { index, item } = e.currentTarget.dataset
...@@ -247,7 +279,7 @@ Component({ ...@@ -247,7 +279,7 @@ Component({
} else if ([1, 2].includes(sceneIdx)) { } else if ([1, 2].includes(sceneIdx)) {
// console.log(item['diagnoseList']) // console.log(item['diagnoseList'])
// item['showList'][index]['diagnoseList'] // item['showList'][index]['diagnoseList']
if (item['showList'][sceneIdx]['diagnoseList']) { if (item['showList'][sceneIdx]?.diagnoseList) {
swiperHeight = 735 swiperHeight = 735
} else { } else {
swiperHeight = 686 swiperHeight = 686
...@@ -286,7 +318,7 @@ Component({ ...@@ -286,7 +318,7 @@ Component({
console.log(item) console.log(item)
item = item[0] item = item[0]
let obj = {} let obj = {}
obj.selectName = selectName obj.selectName = selectName || oldItem.selectName
obj.totalMoney = item?.totalMoney || 0 obj.totalMoney = item?.totalMoney || 0
obj.totalOrder = item?.totalOrder || 0 obj.totalOrder = item?.totalOrder || 0
obj.merchantName = item?.merchantName obj.merchantName = item?.merchantName
...@@ -324,7 +356,7 @@ Component({ ...@@ -324,7 +356,7 @@ Component({
} else if ([1, 2].includes(list[current].startInd)) { } else if ([1, 2].includes(list[current].startInd)) {
let subscript = list[current]['startInd'] let subscript = list[current]['startInd']
let item = list[current]['showList'] let item = list[current]['showList']
if (item[subscript]['diagnoseList']) { if (item[subscript]?.diagnoseList) {
swiperHeight = 735 swiperHeight = 735
} else { } else {
swiperHeight = 686 swiperHeight = 686
...@@ -337,7 +369,8 @@ Component({ ...@@ -337,7 +369,8 @@ Component({
totalMoney: list[current].totalMoney || 0, totalMoney: list[current].totalMoney || 0,
totalOrder: list[current].totalOrder || 0, totalOrder: list[current].totalOrder || 0,
sceneIndx: list[current].startInd, sceneIndx: list[current].startInd,
swiperHeight swiperHeight,
current
}) })
// list[current].startInd == 0? '' // list[current].startInd == 0? ''
......
<!-- pages/tab/output/components/merchant/mrechant.wxml --> <!-- pages/tab/output/components/merchant/mrechant.wxml -->
<!-- hidden="{{true}}" --> <!-- hidden="{{true}}" -->
<view class="con" wx:if="{{list.length }}"> <scroll-view
<view class="statistics"> scroll-y="true"
<view class="totalOutputValue box"> class="list-wrap"
<view class="num">¥{{totalMoney}}</view> enable-back-to-top
<view class="label">总产值</view> refresher-enabled="{{true}}"
bindrefresherrefresh="refreshList"
refresher-threshold="104"
refresher-triggered="{{triggered}}">
<view class="con" wx:if="{{list.length }}">
<view class="statistics">
<view class="totalOutputValue box">
<view class="num">¥{{totalMoney}}</view>
<view class="label">总产值</view>
</view>
<view class="totalOrder box">
<view class="num">{{totalOrder}}</view>
<view class="label">订单数/笔</view>
</view>
</view> </view>
<view class="totalOrder box"> <!-- -->
<view class="num">{{totalOrder}}</view> <!-- 无门店 -->
<view class="label">订单数/笔</view> <!-- <merchantDataStatistics bind:swiperChange="swiperChange" /> -->
</view> <!-- sceneIndx==3? 'short': -->
</view> <!-- {{startInd ==4?'short':'full'}} -->
<!-- --> <swiper
<!-- 无门店 --> indicator-dots="{{list.length>1? indicatorDots:false}}"
<!-- <merchantDataStatistics bind:swiperChange="swiperChange" /> --> class="swiper "
<!-- sceneIndx==3? 'short': --> style="height:{{swiperHeight*2}}rpx"
<!-- {{startInd ==4?'short':'full'}} --> autoplay="{{autoplay}}"
<swiper bindchange="swiperChange"
indicator-dots="{{list.length>1? indicatorDots:false}}" interval="{{interval}}"
class="swiper " duration="{{duration}}">
style="height:{{swiperHeight*2}}rpx" <block wx:for="{{list}}" wx:key="*this">
autoplay="{{autoplay}}" <swiper-item>
bindchange="swiperChange" <view class="merchantDataStatistics-con">
interval="{{interval}}" <view class="contitle">
duration="{{duration}}"> <view class="name">{{item.merchantName}}</view>
<block wx:for="{{list}}" wx:key="*this"> <view
<swiper-item> class="select"
<view class="merchantDataStatistics-con"> data-index="{{index}}"
<view class="contitle"> data-item="{{item}}"
<view class="name">{{item.merchantName}}</view> bind:tap="pickSheet">
<view <view>{{item.selectName||'累计'}}</view>
class="select" <image
data-index="{{index}}" class="arrow {{isAct?'isAct':''}}"
data-item="{{item}}" webp
bind:tap="pickSheet"> src="{{IMAGES.arrow}}"
<view>{{item.selectName||'累计'}}</view> alt="" />
<image </view>
class="arrow {{isAct?'isAct':''}}"
webp
src="{{IMAGES.arrow}}"
alt="" />
</view> </view>
</view> <!-- <scene-select/> -->
<!-- <scene-select/> --> <view class="scene-box">
<view class="scene-box"> <!-- {{item.startInd + 1}} -->
<!-- {{item.startInd + 1}} --> <scene-box
<scene-box formData="{{item}}"
formData="{{item}}" data-index="{{index}}"
data-index="{{index}}" data-item="{{item}}"
data-item="{{item}}" bind:handleSceneChange="handleSceneChange"
bind:handleSceneChange="handleSceneChange" sceneActive="{{(item.startInd + 1)}}" />
sceneActive="{{(item.startInd + 1)}}" /> </view>
</view> <view class="outputValueCon " wx:if="{{!item.showNothingSceneCon && item.showList[item.startInd] }}">
<view class="outputValueCon " wx:if="{{!item.showNothingSceneCon && item.showList[item.startInd] }}"> <view class="title">产值图</view>
<view class="title">产值图</view> <view class="swiperCon" wx:if="{{item['showList']}}">
<view class="swiperCon" wx:if="{{item['showList']}}"> <view class="swiper-item ">
<view class="swiper-item "> <view class="fluuelCon">
<view class="fluuelCon"> <image class="bg-image" src="{{IMAGES.funnel}}" />
<image class="bg-image" src="{{IMAGES.funnel}}" /> <block
<block wx:for="{{item.startInd!=3? funnelList['start']: funnelList['end']}}"
wx:for="{{item.startInd!=3? funnelList['start']: funnelList['end']}}" wx:key="*this"
wx:key="*this" wx:for-index="ind"
wx:for-index="ind" wx:for-item="funneItem">
wx:for-item="funneItem"> <view class="funneItem">
<view class="funneItem"> <view class="label">{{funneItem['label']}}</view>
<view class="label">{{funneItem['label']}}</view> <view class="num">
<view class="num">{{item.showList[item.startInd][funneItem['key']]||0}}</view> {{item.showList[item.startInd][funneItem['key']]||0}}
</view> </view>
</block> </view>
</view> </block>
<!-- <block wx:for="{{items}}"></block> hidden="{{item.startInd ==3}}" -->
<view hidden="{{item.startInd ==3}}">
<!-- 统计 -->
<view class="merchantCount">
<view class="turnover">
<image class="img " webp src="{{IMAGES.money}}" />
<view class="num">{{item.showList[item.startInd]['totalMoney']||0}}</view>
<view class="label">营业额/¥</view>
</view>
<view class="customerUnitPrice">
<image class="img " webp src="{{IMAGES.paper}}" />
<view class="num">{{item.showList[item.startInd]['custUnitPrice']||0}}</view>
<view class="label">客单价/¥</view>
</view>
</view> </view>
<!-- 指标诊断 --> <!-- <block wx:for="{{items}}"></block> hidden="{{item.startInd ==3}}" -->
<view class="diagnosisCon" wx:if="{{item.showList[item.startInd]['diagnoseList'].length}}"> <view hidden="{{item.startInd ==3}}">
<view class="tipsIcon">指标诊断</view> <!-- 统计 -->
<swiper <view class="merchantCount">
class="tips" <view class="turnover">
autoplay="{{true}}" <image class="img " webp src="{{IMAGES.money}}" />
interval="{{5000}}" <view class="num">{{item.showList[item.startInd]['totalMoney']||0}}</view>
circular="{{true}}" <view class="label">营业额/¥</view>
duration="{{duration}}"> </view>
<block <view class="customerUnitPrice">
wx:for="{{item.showList[item.startInd]['diagnoseList']}}" <image class="img " webp src="{{IMAGES.paper}}" />
wx:key="*this" <view class="num">
wx:for-index="dgInd" {{item.showList[item.startInd]['custUnitPrice']||0}}
wx:for-item="dgItem"> </view>
<swiper-item>{{dgItem}}</swiper-item> <view class="label">客单价/¥</view>
</block> </view>
</swiper> </view>
<view> <!-- 指标诊断 -->
<!-- 日均升级客单价低于1000/低于上2个月平均日升级客单价的10%,建议梳理驻店销售的技能,以及加强与流量方的互动。 --> <view class="diagnosisCon" wx:if="{{item.showList[item.startInd]['diagnoseList'].length}}">
<view class="tipsIcon">指标诊断</view>
<swiper
class="tips"
autoplay="{{true}}"
interval="{{5000}}"
circular="{{true}}"
duration="{{duration}}">
<block
wx:for="{{item.showList[item.startInd]['diagnoseList']}}"
wx:key="*this"
wx:for-index="dgInd"
wx:for-item="dgItem">
<swiper-item>{{dgItem}}</swiper-item>
</block>
</swiper>
<view>
<!-- 日均升级客单价低于1000/低于上2个月平均日升级客单价的10%,建议梳理驻店销售的技能,以及加强与流量方的互动。 -->
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- <view wx:else>test</view> -->
</view>
<view wx:else class="emptyCon">
<image class="img" src="{{IMAGES.empty}}" />
</view> </view>
<!-- <view wx:else>test</view> -->
</view>
<view wx:else class="emptyCon">
<image class="img" src="{{IMAGES.empty}}" />
</view> </view>
</view> </swiper-item>
</swiper-item> </block>
</block> </swiper>
</swiper> <navigator
<navigator wx:if="{{swiperHeight>590}}"
wx:if="{{swiperHeight>590}}" class="navOhterApp"
class="navOhterApp" target="miniProgram"
target="miniProgram" open-type="navigate"
open-type="navigate" app-id="wx570d9331f9ace0bd"
app-id="wx570d9331f9ace0bd" version="release">
version="release"> <image src="{{IMAGES.link}}" webp class="linkImg" />
<image src="{{IMAGES.link}}" webp class="linkImg" /> 查看订单详情
查看订单详情 </navigator>
</navigator> </view>
</view> </scroll-view>
<nothingTipsCon wx:if="{{!list.length }}" /> <nothingTipsCon wx:if="{{!list.length }}" />
...@@ -16,7 +16,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -16,7 +16,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 2 let index = 3
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
...@@ -25,7 +25,7 @@ let index = 2 ...@@ -25,7 +25,7 @@ let index = 2
// console.log( systemInfo.platform); // console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion); // console.log(accountInfo.miniProgram.envVersion);
// 对比一下appkey // 对比一下appkey
console.log(); // console.log();
if (systemInfo.platform != 'devtools') { if (systemInfo.platform != 'devtools') {
// 判断预发布的appid 是强制锁定为4(预发布的地址) // 判断预发布的appid 是强制锁定为4(预发布的地址)
if (accountInfo.miniProgram.appId == 'wx24ebae5768e74138') { if (accountInfo.miniProgram.appId == 'wx24ebae5768e74138') {
......
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
csysfws a123456 csysfws a123456
生意助手小程序--生意助手2号 生意助手小程序--生意助手2号
账号:ssfwsa a123456 账号:ssfwsa a123456
csyfbfws01/a123456
\ No newline at end of file \ No newline at end of file
csyfbfws01/a123456
(线上)glcsxsfwsgc a123456
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!