Commit 17897fd7 by 匡雅琴

详情页面接口联调

1 parent 3e0e90bb
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
type: String type: String
}, },
defaultValue: { defaultValue: {
type: String || Number type: [String, Number]
} }
}, },
directives: { directives: {
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.defaultValue, '00000000'); console.log(this.defaultValue,this.dataList, '00000000');
const { valueName, isObject, dataList, defaultValue } = this const { valueName, isObject, dataList, defaultValue } = this
this.value = defaultValue || (isObject ? dataList[0][valueName] : dataList[0]) this.value = defaultValue || (isObject ? dataList[0][valueName] : dataList[0])
}, },
......
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-07 11:23:06
* @LastEditors: huyue
* @LastEditTime: 2023-07-31 10:09:08
*/
export default {
data() {
return {
month: ''
}
},
watch: {
month: {
immediate: true,
handler(newval) {
this && this.init && this.init(newval)
}
}
}
}
...@@ -35,49 +35,49 @@ export default { ...@@ -35,49 +35,49 @@ export default {
{ {
name: '总场次', name: '总场次',
valueName: 'activityNum', valueName: 'activityNum',
value: '1700', value: '0',
unit: '场', unit: '场',
unitType: 'right' unitType: 'right'
}, },
{ {
name: '进行中场次', name: '进行中场次',
valueName: 'inProgressNum', valueName: 'inProgressNum',
value: '1700', value: '0',
unit: '场', unit: '场',
unitType: 'right' unitType: 'right'
}, },
{ {
name: '已完成场次', name: '已完成场次',
valueName: 'completedNum', valueName: 'completedNum',
value: '1700', value: '0',
unit: '场', unit: '场',
unitType: 'right' unitType: 'right'
}, },
{ {
name: '产值', name: '产值',
valueName: 'outputvalue', valueName: 'outputvalue',
value: '1700', value: '0',
unit: '¥', unit: '¥',
unitType: 'left' unitType: 'left'
}, },
{ {
name: '订单数', name: '订单数',
valueName: 'orderNum', valueName: 'orderNum',
value: '550', value: '0',
unit: '单', unit: '单',
unitType: 'right' unitType: 'right'
}, },
{ {
name: '转化率', name: '转化率',
valueName: 'conversionRate', valueName: 'conversionRate',
value: '80', value: '0',
unit: '%', unit: '%',
unitType: 'right' unitType: 'right'
}, },
{ {
name: '退单率', name: '退单率',
valueName: 'chargebackRate', valueName: 'chargebackRate',
value: '20', value: '0',
unit: '%', unit: '%',
unitType: 'right' unitType: 'right'
} }
...@@ -85,15 +85,17 @@ export default { ...@@ -85,15 +85,17 @@ export default {
} }
}, },
created() { created() {
this.getGLOverview() this.$bus.$on('crowdFundingMonth', data => {
this.getGLOverview(data)
})
}, },
mounted() {}, mounted() {},
methods: { methods: {
async getGLOverview() { async getGLOverview(Month) {
const _result = await this.api.crowdFunding.getGLOverview({Month: '2023-08'}) const _result = await this.api.crowdFunding.getGLOverview({ Month })
console.log(_result, '999'); console.log(_result, '999')
const _dataList = _result.data.dataList[0] const _dataList = _result.data.dataList[0]
this.crowdfundList.forEach(item => { this.crowdfundList.forEach(item => {
item.value = _dataList[item.valueName] item.value = _dataList[item.valueName]
......
...@@ -27,10 +27,8 @@ ...@@ -27,10 +27,8 @@
</template> </template>
<script> <script>
// import { crowdFundMixin } from '@/mixins'
export default { export default {
name: 'MainTab', name: 'MainTab',
// mixins: [crowdFundMixin],
props: { props: {
tabList: { tabList: {
type: Array, type: Array,
...@@ -59,6 +57,7 @@ export default { ...@@ -59,6 +57,7 @@ export default {
this.dataList = _result.data.dataList this.dataList = _result.data.dataList
this.defaultMonth = this.month = this.dataList[0].statMonth this.defaultMonth = this.month = this.dataList[0].statMonth
console.log(this.defaultMonth, '+++++') console.log(this.defaultMonth, '+++++')
this.$bus.$emit('crowdFundingMonth', this.defaultMonth)
}, },
// tab切换 // tab切换
changeTab(index) { changeTab(index) {
...@@ -71,6 +70,7 @@ export default { ...@@ -71,6 +70,7 @@ export default {
selectVal(val) { selectVal(val) {
console.log(val) console.log(val)
this.defaultMonth = this.month = val.statMonth this.defaultMonth = this.month = val.statMonth
this.$bus.$emit('crowdFundingMonth', this.defaultMonth)
this.switchMonth() this.switchMonth()
}, },
clickOutside() { clickOutside() {
......
...@@ -38,25 +38,29 @@ export default { ...@@ -38,25 +38,29 @@ export default {
} }
}, },
created() { created() {
this.getMerchantRank() this.$bus.$on('crowdFundingMonth', data => {
this.getMerchantRank(data)
})
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 获取 产值、转换率、退单率 门店排名 // 获取 产值、转换率、退单率 门店排名
async getMerchantRank() { async getMerchantRank(Month) {
const _result = await this.api.crowdFunding.getMerchantRank({ Month: '2023-08' }) const _result = await this.api.crowdFunding.getMerchantRank({ Month })
console.log(_result, '121212') console.log(_result, '121212')
this.dataList = _result.data.dataList[0] this.dataList = _result.data.dataList[0]
this.merchantRankList = this.dataList.outputRank this.merchantRankList = this.dataList.outputRank
}, },
// 跳转售后众筹二级页面 // 跳转售后众筹二级页面
goDetailPage(item) { goDetailPage(item) {
console.log(item);
const routeData = this.$router.resolve({ const routeData = this.$router.resolve({
name: 'crowdfundingDetail', name: 'crowdfundingDetail',
query: { query: {
item merchantName: item.merchantName,
merchantid: item.merchantId
} }
}) })
window.open(routeData.href, '_blank') window.open(routeData.href, '_blank')
......
...@@ -48,15 +48,17 @@ export default { ...@@ -48,15 +48,17 @@ export default {
} }
}, },
created() { created() {
this.getPaymentModel() this.$bus.$on('crowdFundingMonth', data => {
this.getPaymentModel(data)
})
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 获取 产值、转换率、退单率 门店排名 // 获取 产值、转换率、退单率 门店排名
async getPaymentModel() { async getPaymentModel(Month) {
const _result = await this.api.crowdFunding.getPaymentModel({ Month: '2023-08' }) const _result = await this.api.crowdFunding.getPaymentModel({ Month })
console.log(_result, '4545455') console.log(_result, '4545455')
this.dataList = _result.data.dataList[0] this.dataList = _result.data.dataList[0]
this.paymentData = this.dataList.totalData this.paymentData = this.dataList.totalData
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<DateTab :dateList="dateList" @changeDate="changeDate" class="date-tab"></DateTab> <DateTab :dateList="dateList" @changeDate="changeDate" class="date-tab"></DateTab>
<Calendar v-show="showCalendar" @customerSelect="customerSelect"></Calendar> <Calendar v-show="showCalendar" @customerSelect="customerSelect"></Calendar>
</div> </div>
<ActivityTable class="activity-table" :tableData="tableData" :dataTotal="dataTotal"></ActivityTable> <ActivityTable class="activity-table" :tableData="tableData" :dataTotal="dataTotal" @sizeChange="sizeChange" @pageChange="pageChange"></ActivityTable>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,6 +18,12 @@ export default { ...@@ -18,6 +18,12 @@ export default {
components: { components: {
ActivityTable ActivityTable
}, },
props: {
merchantid: {
type: [String, Number],
default: ''
}
},
data() { data() {
return { return {
dateList: ['近3个月', '近6个月', '近1年', '自定义'], dateList: ['近3个月', '近6个月', '近1年', '自定义'],
...@@ -25,7 +31,9 @@ export default { ...@@ -25,7 +31,9 @@ export default {
dataTotal: 0, dataTotal: 0,
showCalendar: false, showCalendar: false,
start: '', start: '',
end: '' end: '',
pageNum: 1,
pageSize: 10
} }
}, },
created() { created() {
...@@ -76,10 +84,11 @@ export default { ...@@ -76,10 +84,11 @@ export default {
// 获取活动明细 // 获取活动明细
async getActivityDetail() { async getActivityDetail() {
const _params = { const _params = {
MerchantId: '44205761', MerchantId: this.merchantid,
start: this.start, start: this.start,
end: this.end, end: this.end,
pageNum: 1 pageNum: this.pageNum,
pageSize: this.pageSize
} }
const _result = await this.api.crowdFunding.getActivityDetail(_params) const _result = await this.api.crowdFunding.getActivityDetail(_params)
console.log(_result, '66666'); console.log(_result, '66666');
...@@ -101,6 +110,14 @@ export default { ...@@ -101,6 +110,14 @@ export default {
} }
const currentdate = year + '-' + month + '-' + day const currentdate = year + '-' + month + '-' + day
return currentdate return currentdate
},
sizeChange(size) {
this.pageSize = size
this.getActivityDetail()
},
pageChange(num) {
this.pageNum = num
this.getActivityDetail()
} }
} }
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<div> <div>
<el-table :data="tableData" style="width: 100%" :header-cell-style="{ color: '#ffffff', fontSize: '14px', height: '4.44vh', background: '#244888' }" :row-class-name="tableRowClassName"> <el-table :data="tableData" style="width: 100%" :header-cell-style="{ color: '#ffffff', fontSize: '14px', height: '4.44vh', background: '#244888' }" :row-class-name="tableRowClassName">
<el-table-column label="序号" width="60"> <el-table-column label="序号" width="60">
<!-- <template slot-scope="scope"> <template slot-scope="scope">
{{searchData.pageSize * (searchData.pageNo - 1) + (scope.$index + 1)}} {{ curPageSize * (currentPage - 1) + (scope.$index + 1) }}
</template> --> </template>
</el-table-column> </el-table-column>
<el-table-column prop="activityName" label="活动名称" width="180"></el-table-column> <el-table-column prop="activityName" label="活动名称" width="180"></el-table-column>
<el-table-column prop="startTime" label="活动时间" width="210"></el-table-column> <el-table-column prop="startTime" label="活动时间" width="210"></el-table-column>
...@@ -60,10 +60,12 @@ export default { ...@@ -60,10 +60,12 @@ export default {
}, },
handleSizeChange(e) { handleSizeChange(e) {
console.log(e) console.log(e)
this.curPageSize = e
this.$emit('sizeChange', e) this.$emit('sizeChange', e)
}, },
handleCurrentChange(e) { handleCurrentChange(e) {
console.log(e) console.log(e)
this.currentPage = e
this.$emit('pageChange', e) this.$emit('pageChange', e)
} }
} }
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
<img class="img-statictic" src="../../assets/images/curve.png" alt="" /> <img class="img-statictic" src="../../assets/images/curve.png" alt="" />
</template> </template>
<template #conversionRate="{ conversionRate }"> <template #conversionRate="{ conversionRate }">
<el-progress class="conversion-progress" :percentage="conversionRate.value" :stroke-width="18"></el-progress> <el-progress class="conversion-progress" :percentage="Number(conversionRate.value)" :stroke-width="18"></el-progress>
</template> </template>
<template #chargebackRate="{ chargebackRate }"> <template #chargebackRate="{ chargebackRate }">
<el-progress class="reject-progress" :percentage="chargebackRate.value" :stroke-width="18"></el-progress> <el-progress class="reject-progress" :percentage="Number(chargebackRate.value)" :stroke-width="18"></el-progress>
</template> </template>
</StatisticsBox> </StatisticsBox>
<!-- 活动数据明细 --> <!-- 活动数据明细 -->
<ActivityDetail class="activity-detail"></ActivityDetail> <ActivityDetail class="activity-detail" :merchantid="merchantid"></ActivityDetail>
</div> </div>
</template> </template>
</view-container> </view-container>
...@@ -39,6 +39,8 @@ export default { ...@@ -39,6 +39,8 @@ export default {
return { return {
percentage: 20, percentage: 20,
conversionColor: '', conversionColor: '',
merchantName: '',
merchantid: '',
merchantList: [], merchantList: [],
merchantListObj: { merchantListObj: {
labelName: 'merchantName', labelName: 'merchantName',
...@@ -96,8 +98,26 @@ export default { ...@@ -96,8 +98,26 @@ export default {
} }
}, },
created() { created() {
this.tabObject = this.$route.query
console.log(this.tabObject, 'this.tabObject');
const { merchantid, merchantName } = this.$route.query
this.merchantName = merchantName
this.merchantid = merchantid
this.getMerchant() this.getMerchant()
this.getMerchantOverview() this.getMerchantOverview(merchantid)
this.$bus.$on('selectVal', data => {
console.log(data, 'dta');
this.$router.replace({
path: '/crowdfundingDetail',
query: {
merchantName: data.merchantName,
merchantid: data.merchantid
}
})
this.merchantid = data.merchantid
this.getMerchantOverview(data.merchantid)
})
}, },
mounted() {}, mounted() {},
...@@ -108,8 +128,8 @@ export default { ...@@ -108,8 +128,8 @@ export default {
console.log(_result, '888') console.log(_result, '888')
this.merchantList = _result.data.dataList this.merchantList = _result.data.dataList
}, },
async getMerchantOverview() { async getMerchantOverview(MerchantId) {
const _result = await this.api.crowdFunding.getMerchantOverview({ MerchantId: '44205761' }) const _result = await this.api.crowdFunding.getMerchantOverview({ MerchantId })
console.log(_result, '999') console.log(_result, '999')
const _dataList = _result.data.dataList[0] const _dataList = _result.data.dataList[0]
this.crowdfundingDetailList.forEach(item => { this.crowdfundingDetailList.forEach(item => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!