Commit 7c76bf04 by chenwq

场景月份置顶;门店筛选多选;跳转详情,月份一块带过去

1 parent 36b81c9b
......@@ -15,20 +15,20 @@ Page({
*/
data: {
IMGURL: IMG_URL,
isPc:true,
isPc: true,
merchantInfo: {},
tabList: [{
label: '精品升级-太阳膜',
width: '34%'
},
{
label: '售后众筹',
width: '25%'
},
{
label: '会员权益/升级',
width: '30%'
}
label: '精品升级-太阳膜',
width: '34%'
},
{
label: '售后众筹',
width: '25%'
},
{
label: '会员权益/升级',
width: '30%'
}
],
lineChart: {},
chartDataPie: {
......@@ -150,6 +150,7 @@ Page({
dateObj,
merchantInfo
} = this.data
console.log(dateObj)
let params = {
shopMerchantIdList: [merchantInfo.merchantId || 44211227],
isSuper: false,
......@@ -183,17 +184,17 @@ Page({
})
})
apiNameTendency(params).then(res => {
console.log(res, 'analysisTendency')
this.setData({
lineChart: {
firstOrderDate: res?.firstOrderDate?res?.firstOrderDate.replace('年','-').replace('月','-').replace('日',''):'',
diagnosticResults: res.diagnosticResults || '',
diagramList: res.diagramList || []
}
})
console.log(res, 'analysisTendency')
this.setData({
lineChart: {
firstOrderDate: res?.firstOrderDate ? res?.firstOrderDate.replace('年', '-').replace('月', '-').replace('日', '') : '',
diagnosticResults: res.diagnosticResults || '',
diagramList: res.diagramList || []
}
})
// 精品升级请求流量接口数据
!tabIndx && this.getTrafficInterfaceData(params)
})
// 精品升级请求流量接口数据
!tabIndx && this.getTrafficInterfaceData(params)
},
getTrafficInterfaceData(params) {
outputApi.analysisInviteRecord(params).then(res => {
......@@ -206,21 +207,21 @@ Page({
} = res
this.setData({
['chartDataPie.data']: [{
value: hadInvitedCount||0,
name: '已预约'
},
{
value: notInvitedCount||0,
name: '待预约'
},
{
value: cancelInvitedCount||0,
name: '取消预约'
},
{
value: expireReachCount||0,
name: '超时未到店'
},
value: hadInvitedCount || 0,
name: '已预约'
},
{
value: notInvitedCount || 0,
name: '待预约'
},
{
value: cancelInvitedCount || 0,
name: '取消预约'
},
{
value: expireReachCount || 0,
name: '超时未到店'
},
],
['chartDataPie.total']: hadInvitedCount + cancelInvitedCount + expireReachCount + notInvitedCount
})
......@@ -530,9 +531,9 @@ Page({
// wx.$router.back()
// },
onload() {
},
// 众筹-end
onRoute() {
console.log('onRoute')
......@@ -541,8 +542,10 @@ Page({
wx.$router.getData(obj => {
console.log(obj, 'obj')
this.setData({
merchantInfo: obj
merchantInfo: obj.info,
searchForm: obj.searchForm
})
this.rangeSelect({ detail: { date: { start: obj.searchForm.yearMonth, end: obj.searchForm.yearMonth }, type: 'dayType' } })
this.initData()
})
let that = this
......@@ -551,9 +554,9 @@ Page({
// windows | mac为pc端
// android | ios为手机端
console.log('getSystemInfo,', res);
if (['windows','mac'].includes(res.platform) ) {
if (['windows', 'mac'].includes(res.platform)) {
that.setData({
isPc:false
isPc: false
})
}
}
......
......@@ -73,7 +73,7 @@ Component({
pageLoaded: true,
userInfo
})
getMerchantListApi({serviceMerchantId: userInfo?.isSuper ? '' : userInfo?.subLoginUser?.merchantId}).then(res => {
getMerchantListApi({ serviceMerchantId: userInfo?.isSuper ? '' : userInfo?.subLoginUser?.merchantId }).then(res => {
let { code, data } = res
if (code == '0') {
this.setData({
......@@ -83,11 +83,15 @@ Component({
})
},
handleMerchantChange(e) {
let {merchantId, merchantName} = e.detail
console.log(e.detail, '000')
let { merchantList } = e.detail
let { formData } = this.data
const thisPage = wx.$router.getPageInstance()
formData.shopMerchantIds = merchantId ? [merchantId] : []
formData.shopMerchantNames = merchantName
// formData.shopMerchantIds = merchantId ? [merchantId] : []
// const idx = formData.shopMerchantIds.findIndex(item => item == merchantId)
// idx == -1 ? formData.shopMerchantIds.push(merchantId) : formData.shopMerchantIds.splice(idx, 1)
formData.shopMerchantIds = merchantList.map(item => item.merchantId)
formData.shopMerchantNames = merchantList[0].merchantName
this.setData({
formData
})
......
......@@ -92,8 +92,9 @@ Component({
})
},
jump(e) {
let { curInfo } = this.data
let { info } = e.currentTarget.dataset
wx.$router.go('packagesList.newSummary', info)
wx.$router.go('packagesList.newSummary', { info, searchForm: curInfo })
},
}
})
......@@ -67,7 +67,10 @@
}
.top {
position: relative;
position: sticky;
top: 0;
z-index: 99;
background-color: #FFFFFF;
padding: 32rpx 24rpx;
.num-month {
......
......@@ -87,8 +87,9 @@ Component({
})
},
jump(e) {
let { curInfo } = this.data
let { info } = e.currentTarget.dataset
wx.$router.go('packagesList.newSummary', info)
wx.$router.go('packagesList.newSummary', { info, searchForm: curInfo })
},
switchChange() {
this.setData({
......
......@@ -14,20 +14,16 @@ Component({
observer: function (n) {
if (n) {
let { merchantRange, selectInfo } = this.data
let activeIndex = merchantRange.findIndex(v => v.merchantId == selectInfo.shopMerchantIds[0])
if (merchantRange.length) merchantRange.unshift({merchantId: '', merchantName: '全部'})
// let activeIndex = merchantRange.findIndex(v => v.merchantId == selectInfo.shopMerchantIds[0])
if (merchantRange.length) merchantRange.unshift({ merchantId: '', merchantName: '全部' })
merchantRange.forEach((item, ind) => {
item.show = true
if (activeIndex == (ind - 1)) {
item.act = true
} else {
item.act = false
}
item.act = selectInfo.shopMerchantIds.includes(item.merchantId)
})
this.setData({
searchKeyword: '',
merchantRange,
selectedMerchantId: selectInfo?.shopMerchantIds[0] || ''
selectedMerchantIds: selectInfo?.shopMerchantIds.map(item => item.merchantId) || ''
})
}
}
......@@ -61,13 +57,10 @@ Component({
},
confirm() {
let { merchantRange, subIndex } = this.data
let actObj = merchantRange.find((item, index) => {
if (item.act) {
subIndex = index
}
let actObj = merchantRange.filter((item, index) => {
return item.act
})
if (!actObj) {
if (!actObj || (actObj && !actObj.length)) {
return wx.$api.showToast({
title: '请选择门店',
icon: 'error'
......@@ -80,31 +73,37 @@ Component({
}
},
changePicker(actObj) {
this.triggerEvent('merchantConfirm', {...actObj})
this.triggerEvent('merchantConfirm', { merchantList: actObj })
this.hidePopup()
},
select(e) {
let { index, target } = e.currentTarget.dataset
let { merchantRange } = this.data
let ids = []
merchantRange.forEach((item, ind) => {
if (index == ind) {
item.act = true
} else {
item.act = !item.act
}
// 选全部,门店置空;选中门店,全部置空
if ((index == 0 && ind != 0) || (index != 0 && ind == 0)) {
item.act = false
}
if(item.act) {
ids.push(item.merchantId)
}
})
this.setData({
merchantRange,
selectedMerchantId: target.merchantId
selectedMerchantIds: ids
})
},
search(e) {
let { merchantRange, selectedMerchantId } = this.data
let { merchantRange, selectedMerchantIds } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
merchantRange.forEach(item => {
item.act = false
item.show = item.merchantName?.includes(value)
if (item.merchantId == selectedMerchantId) item.act = true
if (selectedMerchantIds.includes(item.merchantId)) item.act = true
})
this.setData({
merchantRange
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!