Commit 7c76bf04 by chenwq

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

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