Commit 770a604d by 张立顺

新增页面刷新

1 parent 34682514
......@@ -650,7 +650,8 @@ Page({
})
let arrinx = arr.findIndex(e => e.clueType == 1 && e.starTag == 0)
this.setData({
disLikeFlagIdx: arrinx
disLikeFlagIdx: arrinx,
triggered: false
})
}
},
......@@ -750,6 +751,19 @@ Page({
})
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({
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
// console.log('onPullDownRefresh: ');
let { clueParams } = this.data
this.getClueInit(clueParams)
// this.resetCluelist()
// this.onLoad()
wx.pro.showToast({
title: '刷新成功',
icon: 'loading',
duration: 1500
})
},
onPullDownRefresh: function () {},
/**
* 用户点击右上角分享
......
......@@ -84,6 +84,38 @@ Component({
})
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) {
let that = this
let { index, item } = e.currentTarget.dataset
......@@ -247,7 +279,7 @@ Component({
} else if ([1, 2].includes(sceneIdx)) {
// console.log(item['diagnoseList'])
// item['showList'][index]['diagnoseList']
if (item['showList'][sceneIdx]['diagnoseList']) {
if (item['showList'][sceneIdx]?.diagnoseList) {
swiperHeight = 735
} else {
swiperHeight = 686
......@@ -286,7 +318,7 @@ Component({
console.log(item)
item = item[0]
let obj = {}
obj.selectName = selectName
obj.selectName = selectName || oldItem.selectName
obj.totalMoney = item?.totalMoney || 0
obj.totalOrder = item?.totalOrder || 0
obj.merchantName = item?.merchantName
......@@ -324,7 +356,7 @@ Component({
} else if ([1, 2].includes(list[current].startInd)) {
let subscript = list[current]['startInd']
let item = list[current]['showList']
if (item[subscript]['diagnoseList']) {
if (item[subscript]?.diagnoseList) {
swiperHeight = 735
} else {
swiperHeight = 686
......@@ -337,7 +369,8 @@ Component({
totalMoney: list[current].totalMoney || 0,
totalOrder: list[current].totalOrder || 0,
sceneIndx: list[current].startInd,
swiperHeight
swiperHeight,
current
})
// list[current].startInd == 0? ''
......
<!-- pages/tab/output/components/merchant/mrechant.wxml -->
<!-- hidden="{{true}}" -->
<view class="con" wx:if="{{list.length }}">
<view class="statistics">
<view class="totalOutputValue box">
<view class="num">¥{{totalMoney}}</view>
<view class="label">总产值</view>
<scroll-view
scroll-y="true"
class="list-wrap"
enable-back-to-top
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 class="totalOrder box">
<view class="num">{{totalOrder}}</view>
<view class="label">订单数/笔</view>
</view>
</view>
<!-- -->
<!-- 无门店 -->
<!-- <merchantDataStatistics bind:swiperChange="swiperChange" /> -->
<!-- sceneIndx==3? 'short': -->
<!-- {{startInd ==4?'short':'full'}} -->
<swiper
indicator-dots="{{list.length>1? indicatorDots:false}}"
class="swiper "
style="height:{{swiperHeight*2}}rpx"
autoplay="{{autoplay}}"
bindchange="swiperChange"
interval="{{interval}}"
duration="{{duration}}">
<block wx:for="{{list}}" wx:key="*this">
<swiper-item>
<view class="merchantDataStatistics-con">
<view class="contitle">
<view class="name">{{item.merchantName}}</view>
<view
class="select"
data-index="{{index}}"
data-item="{{item}}"
bind:tap="pickSheet">
<view>{{item.selectName||'累计'}}</view>
<image
class="arrow {{isAct?'isAct':''}}"
webp
src="{{IMAGES.arrow}}"
alt="" />
<!-- -->
<!-- 无门店 -->
<!-- <merchantDataStatistics bind:swiperChange="swiperChange" /> -->
<!-- sceneIndx==3? 'short': -->
<!-- {{startInd ==4?'short':'full'}} -->
<swiper
indicator-dots="{{list.length>1? indicatorDots:false}}"
class="swiper "
style="height:{{swiperHeight*2}}rpx"
autoplay="{{autoplay}}"
bindchange="swiperChange"
interval="{{interval}}"
duration="{{duration}}">
<block wx:for="{{list}}" wx:key="*this">
<swiper-item>
<view class="merchantDataStatistics-con">
<view class="contitle">
<view class="name">{{item.merchantName}}</view>
<view
class="select"
data-index="{{index}}"
data-item="{{item}}"
bind:tap="pickSheet">
<view>{{item.selectName||'累计'}}</view>
<image
class="arrow {{isAct?'isAct':''}}"
webp
src="{{IMAGES.arrow}}"
alt="" />
</view>
</view>
</view>
<!-- <scene-select/> -->
<view class="scene-box">
<!-- {{item.startInd + 1}} -->
<scene-box
formData="{{item}}"
data-index="{{index}}"
data-item="{{item}}"
bind:handleSceneChange="handleSceneChange"
sceneActive="{{(item.startInd + 1)}}" />
</view>
<view class="outputValueCon " wx:if="{{!item.showNothingSceneCon && item.showList[item.startInd] }}">
<view class="title">产值图</view>
<view class="swiperCon" wx:if="{{item['showList']}}">
<view class="swiper-item ">
<view class="fluuelCon">
<image class="bg-image" src="{{IMAGES.funnel}}" />
<block
wx:for="{{item.startInd!=3? funnelList['start']: funnelList['end']}}"
wx:key="*this"
wx:for-index="ind"
wx:for-item="funneItem">
<view class="funneItem">
<view class="label">{{funneItem['label']}}</view>
<view class="num">{{item.showList[item.startInd][funneItem['key']]||0}}</view>
</view>
</block>
</view>
<!-- <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>
<!-- <scene-select/> -->
<view class="scene-box">
<!-- {{item.startInd + 1}} -->
<scene-box
formData="{{item}}"
data-index="{{index}}"
data-item="{{item}}"
bind:handleSceneChange="handleSceneChange"
sceneActive="{{(item.startInd + 1)}}" />
</view>
<view class="outputValueCon " wx:if="{{!item.showNothingSceneCon && item.showList[item.startInd] }}">
<view class="title">产值图</view>
<view class="swiperCon" wx:if="{{item['showList']}}">
<view class="swiper-item ">
<view class="fluuelCon">
<image class="bg-image" src="{{IMAGES.funnel}}" />
<block
wx:for="{{item.startInd!=3? funnelList['start']: funnelList['end']}}"
wx:key="*this"
wx:for-index="ind"
wx:for-item="funneItem">
<view class="funneItem">
<view class="label">{{funneItem['label']}}</view>
<view class="num">
{{item.showList[item.startInd][funneItem['key']]||0}}
</view>
</view>
</block>
</view>
<!-- 指标诊断 -->
<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%,建议梳理驻店销售的技能,以及加强与流量方的互动。 -->
<!-- <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 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 wx:else>test</view> -->
</view>
<view wx:else class="emptyCon">
<image class="img" src="{{IMAGES.empty}}" />
</view>
<!-- <view wx:else>test</view> -->
</view>
<view wx:else class="emptyCon">
<image class="img" src="{{IMAGES.empty}}" />
</view>
</view>
</swiper-item>
</block>
</swiper>
<navigator
wx:if="{{swiperHeight>590}}"
class="navOhterApp"
target="miniProgram"
open-type="navigate"
app-id="wx570d9331f9ace0bd"
version="release">
<image src="{{IMAGES.link}}" webp class="linkImg" />
查看订单详情
</navigator>
</view>
</swiper-item>
</block>
</swiper>
<navigator
wx:if="{{swiperHeight>590}}"
class="navOhterApp"
target="miniProgram"
open-type="navigate"
app-id="wx570d9331f9ace0bd"
version="release">
<image src="{{IMAGES.link}}" webp class="linkImg" />
查看订单详情
</navigator>
</view>
</scroll-view>
<nothingTipsCon wx:if="{{!list.length }}" />
......@@ -16,7 +16,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 2
let index = 3
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......@@ -25,7 +25,7 @@ let index = 2
// console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion);
// 对比一下appkey
console.log();
// console.log();
if (systemInfo.platform != 'devtools') {
// 判断预发布的appid 是强制锁定为4(预发布的地址)
if (accountInfo.miniProgram.appId == 'wx24ebae5768e74138') {
......
......@@ -3,4 +3,5 @@
csysfws a123456
生意助手小程序--生意助手2号
账号:ssfwsa a123456
csyfbfws01/a123456
\ No newline at end of file
csyfbfws01/a123456
(线上)glcsxsfwsgc a123456
\ 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!