jufubao-base 1.0.237-beta1 → 1.0.237-beta11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseBalance/Api.js +46 -0
  3. package/src/components/JfbBaseBalance/Attr.js +316 -0
  4. package/src/components/JfbBaseBalance/JfbBaseBalance.vue +334 -0
  5. package/src/components/JfbBaseBalance/JfbBaseBalanceLess.less +79 -0
  6. package/src/components/JfbBaseBalance/JfbBaseBalanceMixin.js +30 -0
  7. package/src/components/JfbBaseBalance/Mock.js +9 -0
  8. package/src/components/JfbBaseCodeOpenVip/Api.js +35 -0
  9. package/src/components/JfbBaseCodeOpenVip/Attr.js +281 -0
  10. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVip.vue +251 -0
  11. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipLess.less +79 -0
  12. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipMixin.js +30 -0
  13. package/src/components/JfbBaseCodeOpenVip/Mock.js +13 -0
  14. package/src/components/JfbBaseConsumpCode/Api.js +133 -0
  15. package/src/components/JfbBaseConsumpCode/Attr.js +61 -0
  16. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCode.vue +1016 -0
  17. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeLess.less +79 -0
  18. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeMixin.js +30 -0
  19. package/src/components/JfbBaseConsumpCode/Mock.js +22 -0
  20. package/src/components/JfbBaseFastLink/Attr.js +12 -1
  21. package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +66 -0
  22. package/src/components/JfbBaseHeader/Attr.js +82 -0
  23. package/src/components/JfbBaseHeader/JfbBaseHeader.vue +47 -1
  24. package/src/components/JfbBaseHeaderColumn/Attr.js +82 -0
  25. package/src/components/JfbBaseHeaderColumn/JfbBaseHeaderColumn.vue +48 -2
  26. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +11 -0
  27. package/src/components/JfbBaseNoticeDialog/Api.js +1 -1
  28. package/src/components/JfbBaseNoticeDialog/Attr.js +26 -0
  29. package/src/components/JfbBaseNoticeDialog/JfbBaseNoticeDialog.vue +27 -8
  30. package/src/components/JfbBaseNoticeGroup/Api.js +23 -0
  31. package/src/components/JfbBaseNoticeGroup/Attr.js +237 -0
  32. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroup.vue +174 -0
  33. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroupLess.less +79 -0
  34. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroupMixin.js +30 -0
  35. package/src/components/JfbBaseNoticeGroup/Mock.js +13 -0
  36. package/src/components/JfbBaseOpenVip/Api.js +39 -0
  37. package/src/components/JfbBaseOpenVip/Attr.js +331 -0
  38. package/src/components/JfbBaseOpenVip/JfbBaseOpenVip.vue +457 -0
  39. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipLess.less +79 -0
  40. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipMixin.js +30 -0
  41. package/src/components/JfbBaseOpenVip/Mock.js +7 -0
  42. package/src/components/JfbBaseOpenVip/XdVipList.vue +131 -0
  43. package/src/components/JfbBaseOpenVipCard/Api.js +58 -0
  44. package/src/components/JfbBaseOpenVipCard/Attr.js +48 -0
  45. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCard.vue +111 -0
  46. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardLess.less +79 -0
  47. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardMixin.js +30 -0
  48. package/src/components/JfbBaseOpenVipCard/Mock.js +13 -0
  49. package/src/components/JfbBaseOpenVipDetail/Api.js +35 -0
  50. package/src/components/JfbBaseOpenVipDetail/Attr.js +37 -0
  51. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetail.vue +234 -0
  52. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailLess.less +79 -0
  53. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailMixin.js +30 -0
  54. package/src/components/JfbBaseOpenVipDetail/Mock.js +15 -0
  55. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +125 -20
  56. package/src/components/JfbBasePay/Attr.js +52 -0
  57. package/src/components/JfbBasePay/JfbBasePay.vue +14 -4
  58. package/src/components/JfbBasePay/Mock.js +0 -9
  59. package/src/components/JfbBasePersonalData/Api.js +26 -0
  60. package/src/components/JfbBasePersonalData/Attr.js +13 -0
  61. package/src/components/JfbBasePersonalData/JfbBasePersonalData.vue +198 -0
  62. package/src/components/JfbBasePersonalData/JfbBasePersonalDataLess.less +79 -0
  63. package/src/components/JfbBasePersonalData/JfbBasePersonalDataMixin.js +30 -0
  64. package/src/components/JfbBasePersonalData/Mock.js +13 -0
  65. package/src/components/JfbBasePhoneLogin/JfbBasePhoneLogin.vue +9 -0
  66. package/src/components/JfbBasePointsCard/Api.js +18 -0
  67. package/src/components/JfbBasePointsCard/Attr.js +187 -0
  68. package/src/components/JfbBasePointsCard/JfbBasePointsCard.vue +212 -0
  69. package/src/components/JfbBasePointsCard/JfbBasePointsCardLess.less +79 -0
  70. package/src/components/JfbBasePointsCard/JfbBasePointsCardMixin.js +30 -0
  71. package/src/components/JfbBasePointsCard/Mock.js +5 -0
  72. package/src/components/JfbBasePointsDetail/Api.js +48 -0
  73. package/src/components/JfbBasePointsDetail/Attr.js +305 -0
  74. package/src/components/JfbBasePointsDetail/JfbBasePointsDetail.vue +267 -0
  75. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailLess.less +79 -0
  76. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailMixin.js +30 -0
  77. package/src/components/JfbBasePointsDetail/Mock.js +6 -0
  78. package/src/components/JfbBasePoster/Attr.js +1 -1
  79. package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +2 -2
  80. package/src/components/JfbBasePosterGroup/Api.js +22 -0
  81. package/src/components/JfbBasePosterGroup/Attr.js +156 -0
  82. package/src/components/JfbBasePosterGroup/JfbBasePosterGroup.vue +268 -0
  83. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupLess.less +79 -0
  84. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupMixin.js +30 -0
  85. package/src/components/JfbBasePosterGroup/Mock.js +13 -0
  86. package/src/components/JfbBaseSavingDetail/Api.js +41 -0
  87. package/src/components/JfbBaseSavingDetail/Attr.js +70 -0
  88. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +714 -0
  89. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailLess.less +79 -0
  90. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailMixin.js +30 -0
  91. package/src/components/JfbBaseSavingDetail/Mock.js +10 -0
  92. package/src/components/JfbBaseSavingDetail/components/echarts.min.js +26 -0
  93. package/src/components/JfbBaseSavingDetail/components/echarts.vue +254 -0
  94. package/src/components/JfbBaseSavingDetail/components/wx-canvas.js +105 -0
  95. package/src/components/JfbBaseShare/Api.js +20 -0
  96. package/src/components/JfbBaseShare/Attr.js +14 -0
  97. package/src/components/JfbBaseShare/JfbBaseShare.vue +272 -0
  98. package/src/components/JfbBaseShare/JfbBaseShareLess.less +79 -0
  99. package/src/components/JfbBaseShare/JfbBaseShareMixin.js +30 -0
  100. package/src/components/JfbBaseShare/Mock.js +16 -0
  101. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +12 -22
  102. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +12 -1
  103. package/src/components/JfbBaseTfkSearch/Mock.js +51 -3
  104. package/src/components/JfbBaseTfkSearch/listMixins.js +2 -1
  105. package/src/components/JfbBaseUserInfo/Attr.js +175 -11
  106. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +337 -115
  107. package/src/components/JfbBaseUserOrder/Attr.js +16 -0
  108. package/src/components/JfbBaseUserOrder/JfbBaseUserOrder.vue +11 -2
  109. package/src/components/JfbBaseWithDrawAgain/Api.js +41 -0
  110. package/src/components/JfbBaseWithDrawAgain/Attr.js +92 -0
  111. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgain.vue +334 -0
  112. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainLess.less +79 -0
  113. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainMixin.js +30 -0
  114. package/src/components/JfbBaseWithDrawAgain/Mock.js +10 -0
  115. package/src/components/JfbBaseWithDrawRecord/Api.js +19 -0
  116. package/src/components/JfbBaseWithDrawRecord/Attr.js +79 -0
  117. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecord.vue +233 -0
  118. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordLess.less +79 -0
  119. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordMixin.js +30 -0
  120. package/src/components/JfbBaseWithDrawRecord/Mock.js +7 -0
  121. package/src/components/JfbBaseWithdraw/Api.js +48 -0
  122. package/src/components/JfbBaseWithdraw/Attr.js +328 -0
  123. package/src/components/JfbBaseWithdraw/JfbBaseWithdraw.vue +261 -0
  124. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawLess.less +79 -0
  125. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawMixin.js +30 -0
  126. package/src/components/JfbBaseWithdraw/Mock.js +7 -0
  127. package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +10 -0
@@ -0,0 +1,714 @@
1
+ <template>
2
+ <view class="jfb-base-saving-detail" @click="handleEditxSelect" :class="{ editx : isEditx && active }">
3
+ <!--#ifdef H5-->
4
+ <view class="jfb-base-saving-detail__edit" :class="{ editx : isEditx && active }" v-if="isEditx && active">
5
+ <view class="jfb-base-saving-detail__edit-icon" @click="delEdit">删除</view>
6
+ </view>
7
+ <!-- #endif -->
8
+ <view class="jfb-base-saving-detail__body">
9
+ <scroll-view scroll-x="true">
10
+ <view class="tab_list" :style="[tabStyleComp]">
11
+ <view class="tab_item" v-for="(tab, i) in tabs" :key="tab.value" :style="{
12
+ color: i === tabIndex? titleActColor : titleColor,
13
+ }" @click="switchTab(i)">
14
+ {{tab.label}}
15
+ <view v-if="i === tabIndex" class="check" :style="{background: titleActColor
16
+ }"></view>
17
+ <view class="check" v-else></view>
18
+ </view>
19
+
20
+ </view>
21
+ </scroll-view>
22
+ <view v-if="tab==='month'">
23
+ <view style="width: 710rpx;margin: 0 auto;borderRadius: 20rpx;background:#FFF">
24
+ <view class="jfb-base-saving-detail__body-month">
25
+ <view @click="handleLastMonth">上一月</view>
26
+ <view>{{monthDateRange}}</view>
27
+ <view class="monthDisabled" v-if="disabledMonth">下一月</view>
28
+ <view v-else @click="handleNextMonth">下一月</view>
29
+ </view>
30
+ <view style="width: 710rpx;height: 480rpx">
31
+ <echarts ref="monthEcharts" :option="option" canvasId="monthEcharts"></echarts>
32
+ </view>
33
+ <view class="jfb-base-saving-detail__body-block"></view>
34
+ </view>
35
+ </view>
36
+ <view v-if="tab==='year'">
37
+ <view style="width: 710rpx;margin: 0 auto;borderRadius: 20rpx;background:#FFF">
38
+ <view class="jfb-base-saving-detail__body-cycle">{{yearDateRange}}</view>
39
+ <view style="width: 710rpx;height: 480rpx">
40
+ <echarts ref="yearEcharts" :option="option" canvasId="yearEcharts"></echarts>
41
+ </view>
42
+ <view class="jfb-base-saving-detail__body-block"></view>
43
+ </view>
44
+ </view>
45
+ <view v-if="tab==='total'">
46
+ <view style="width: 710rpx;margin: 0 auto;borderRadius: 20rpx;background:#FFF">
47
+ <view class="jfb-base-saving-detail__body-cycle">{{totalDateRange}}</view>
48
+ <view style="width: 710rpx;height: 480rpx">
49
+ <echarts ref="totalEcharts" :option="option" canvasId="totalEcharts"></echarts>
50
+ </view>
51
+ <view class="jfb-base-saving-detail__body-block"></view>
52
+ </view>
53
+ </view>
54
+ <view class="jfb-base-saving-detail__body-product">
55
+ <view class="jfb-base-saving-detail__body-product-title">
56
+ <view> {{tab==='month'? `${getYearAndMonth(monthDateRange).month}月结算明细` :'购物'}}</view>
57
+ <view>已省:{{getAmout(saveAmount)}}</view>
58
+ </view>
59
+ <view v-if="productList.length>0">
60
+ <view v-for="(item,index) in productList" :key="index" class="jfb-base-saving-detail__body-product-item">
61
+ <image :src="item.product_image">
62
+ </image>
63
+ <view class="jfb-base-saving-detail__body-product-item-info">
64
+ <view class="jfb-base-saving-detail__body-product-item-info-name">{{item.product_name}}</view>
65
+ <view class="jfb-base-saving-detail__body-product-item-info-time">
66
+ <view>{{item.order_time}}</view>
67
+ <view>{{item.product_num}}件</view>
68
+ </view>
69
+ <view class="jfb-base-saving-detail__body-product-item-info-price">
70
+ <view>合计节省</view>
71
+ <view :style="{color:mainColor}">{{getAmout(item.saving_amount)}}</view>
72
+ </view>
73
+ </view>
74
+ </view> 
75
+ </view>
76
+ <XdNoData v-else></XdNoData>
77
+ </view>
78
+ </view>
79
+ </view>
80
+ </template>
81
+
82
+ <script>
83
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
84
+ import XdNoData from "@/components/XdNoData/XdNoData";
85
+ import { jfbRootExec } from "@/utils/xd.event";
86
+ import JfbBaseSavingDetailMixin from "./JfbBaseSavingDetailMixin";
87
+ import { getContainerPropsValue } from "@/utils/xd.base";
88
+ import echarts from './components/echarts.vue'
89
+ import componentsMixins from "@/mixins/componentsMixins";
90
+ import extsMixins from "@/mixins/extsMixins";
91
+ import getServiceUrl from "@/common/getServiceUrl";
92
+
93
+ export default {
94
+ name: "JfbBaseSavingDetail",
95
+ components: {
96
+ XdFontIcon,
97
+ echarts,
98
+ XdNoData
99
+ },
100
+ mixins: [
101
+ componentsMixins, extsMixins, JfbBaseSavingDetailMixin
102
+ ],
103
+ data() {
104
+ return {
105
+ tabs: [
106
+ {
107
+ label: '月度',
108
+ value: 'month'
109
+ },
110
+ {
111
+ label: '年度',
112
+ value: 'year'
113
+ },
114
+ {
115
+ label: '累计',
116
+ value: 'total'
117
+ }
118
+ ],
119
+ //标题
120
+ titleBgc: '',
121
+ titleColor: '',
122
+ titleActColor: '',
123
+ titlePadding: '',
124
+ tabPadding: '',
125
+ tabIndex: 0,
126
+ tab: 'month',
127
+ option: null,
128
+ monthDateRange: '',
129
+ yearDateRange: '',
130
+ totalDateRange: '',
131
+ saveAmount: 0, //节省金额
132
+ productList: [],
133
+ hasNext: true,
134
+ page_token: 1,
135
+ }
136
+ },
137
+ computed: {
138
+ tabStyleComp() {
139
+ return {
140
+ background: this.titleBgc,
141
+ marginBottom: this.titlePadding + 'rpx',
142
+ padding: this.getMarginAndPadding(this.tabPadding, { top: 40, right: 0, bottom: 40, left: 0 }),
143
+ }
144
+ },
145
+ disabledMonth(){
146
+ let month = new Date().getMonth() + 1
147
+ return this.getYearAndMonth(this.monthDateRange).month==month
148
+ }
149
+ },
150
+ watch: {
151
+ container(value, oldValue) {
152
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
153
+ if (this.$configProject['isPreview']) this.init(value)
154
+ },
155
+ tab(value, oldValue) {
156
+ //请求数据
157
+ if (value === 'month') {
158
+ this.getMonthData()
159
+ } else if (value === 'year') {
160
+ this.getYearData()
161
+ } else if (value === 'total') {
162
+ this.getTotalData()
163
+ }
164
+ this.hasNext = true;
165
+ this.page_token = 1
166
+ this.monthDateRange = ""
167
+ }
168
+ },
169
+ created() {
170
+ this.init(this.container);
171
+ },
172
+ methods: {
173
+ onJfbLoad(options) {
174
+ if (this.tab === 'month') {
175
+ this.getMonthData()
176
+ } else if (this.tab === 'year') {
177
+ this.getYearData()
178
+ } else if (this.tab === 'total') {
179
+ this.getTotalData()
180
+ }
181
+ },
182
+ getMonthData() {
183
+ let data = {}
184
+ if (this.monthDateRange) {
185
+ data.year = this.getYearAndMonth(this.monthDateRange).year
186
+ data.month = this.getYearAndMonth(this.monthDateRange).month
187
+ }
188
+ jfbRootExec('getMonthSavingDetail', {
189
+ vm: this,
190
+ data: data,
191
+ }).then(res => {
192
+ let list = res.list.map(item => {
193
+ item["order_time"] = this.$xdUniHelper.getDate(
194
+ item["order_time"] * 1000
195
+ ).fullTime;
196
+ item.product_image = getServiceUrl(item.product_image)
197
+ return item;
198
+ })
199
+ const textColor = '#999'
200
+ const seriesData = res.record_months.map(item => {
201
+ return this.getAmout(item.value)
202
+ })
203
+ const xAxisList = res.record_months.map(item => {
204
+ return item.label
205
+ })
206
+ this.option = {
207
+
208
+ tooltip: {
209
+ trigger: 'axis'
210
+ },
211
+ grid: {
212
+ top: '15%',
213
+ left: '15%',
214
+ right: '15%',
215
+ bottom: '15%',
216
+ containLabel: false
217
+ },
218
+ xAxis: {
219
+ type: 'category',
220
+ data: xAxisList,
221
+ axisLabel: {
222
+ // 坐标轴字体颜色
223
+ color: textColor,
224
+ fontSize: 10,
225
+ },
226
+ axisLine: {
227
+ show: false
228
+ },
229
+ axisLine: {
230
+ show: false,
231
+ },
232
+ axisTick: { //y轴刻度线
233
+ show: false
234
+ },
235
+ splitLine: {
236
+ // 网格
237
+ show: false
238
+ },
239
+ boundaryGap: false
240
+ },
241
+ yAxis: {
242
+ type: 'value',
243
+ min: 0,
244
+ nameTextStyle: {
245
+ color: textColor,
246
+ fontSize: 10,
247
+ padding: [0, 0, 0, 80]
248
+ },
249
+ axisLabel: {
250
+ // 坐标轴字体颜色
251
+ color: textColor,
252
+ fontSize: 10
253
+ },
254
+ axisLine: {
255
+ show: false,
256
+ },
257
+ axisTick: { //y轴刻度线
258
+ show: false
259
+ },
260
+ splitLine: {
261
+ // 网格
262
+ show: true,
263
+ lineStyle: {
264
+ color: '#CCCCCC',
265
+ type: 'dashed'
266
+ }
267
+ }
268
+ },
269
+
270
+ series: [
271
+ {
272
+ name: '成绩(分)',
273
+ type: 'line',
274
+ symbol: 'circle',
275
+ symbolSize: 10,
276
+ smooth: true,
277
+ z: 1,
278
+ itemStyle: {
279
+ color: '#5487FF'
280
+ },
281
+ lineStyle: {
282
+ color: '#5487FF'
283
+ },
284
+ data: seriesData
285
+ }
286
+ ]
287
+ };
288
+ this.monthDateRange = res.date_range
289
+ this.saveAmount = res.save_amount
290
+ this.hasNext = res.next_page_token !== "";
291
+ if (this.page_token === 1) {
292
+ this.productList = list
293
+ } else {
294
+ this.productList = this.productList.concat(list);
295
+ }
296
+ })
297
+ },
298
+ getYearData() {
299
+ jfbRootExec('getYearSavingDetail', {
300
+ vm: this,
301
+ data: {},
302
+ }).then(res => {
303
+ let list = res.list.map(item => {
304
+ item["order_time"] = this.$xdUniHelper.getDate(
305
+ item["order_time"] * 1000
306
+ ).fullTime;
307
+ item.product_image = getServiceUrl(item.product_image)
308
+ return item;
309
+ })
310
+ // 最大值
311
+ let max = this.getAmout(res.total_amount);
312
+ // 数量
313
+ let value = this.getAmout(res.save_amount);
314
+ // 计算
315
+ let rate = Math.round((value * 1000) / max)||0;
316
+ this.option = {
317
+ backgroundColor: '#fff', // 设置图表区域的背景颜色
318
+ borderRadius: 10, // 设置图表区域的圆角
319
+ title: [
320
+ {
321
+ text: '{a|周期已省}\n{b|' + rate + '}', // 显示标题
322
+ show: true, // 是否显示
323
+ x: 'center', // x轴位置
324
+ y: 'center', // y轴位置
325
+ textStyle: { // 样式配置
326
+ rich: {
327
+ a: {
328
+ fontSize: 16,
329
+ fontWeight: 'normal',
330
+ color: '#666',
331
+ padding: [0, 0, 10, 0], // 边距
332
+ },
333
+ b: {
334
+ fontSize: 40,
335
+ fontWeight: 700,
336
+ color: '#000'
337
+ },
338
+ },
339
+ },
340
+ },
341
+ ],
342
+ polar: {
343
+ center: ['50%', '50%'],
344
+ radius: ['60%', '75%'],
345
+ },
346
+ angleAxis: {
347
+ max: max,
348
+ startAngle: 90, // 开始的角度
349
+ show: false,
350
+ },
351
+ radiusAxis: {
352
+ type: 'category',
353
+ show: true,
354
+ axisLabel: {
355
+ show: false, // 是否显示标签
356
+ },
357
+ axisLine: {
358
+ show: false, // 是否显示轴线
359
+ },
360
+ axisTick: {
361
+ show: false, // 是否显示刻度
362
+ },
363
+ },
364
+ series: [
365
+ {
366
+ name: '',
367
+ type: 'bar',
368
+ roundCap: true,
369
+ showBackground: true,
370
+ backgroundStyle: {
371
+ color: '#f5f5f5',
372
+ },
373
+ data: [value],
374
+ coordinateSystem: 'polar',
375
+ itemStyle: {
376
+ normal: {
377
+ color: this.mainColor,
378
+ },
379
+ },
380
+ },
381
+ ],
382
+ };
383
+ this.yearDateRange = res.date_range
384
+ this.saveAmount = res.save_amount
385
+ this.hasNext = res.next_page_token !== "";
386
+ if (this.page_token === 1) {
387
+ this.productList = list
388
+ } else {
389
+ this.productList = this.productList.concat(list);
390
+ }
391
+ })
392
+ },
393
+ getTotalData() {
394
+ jfbRootExec('getTotalSavingDetail', {
395
+ vm: this,
396
+ data: {},
397
+ }).then(res => {
398
+ let list = res.list.map(item => {
399
+ item["order_time"] = this.$xdUniHelper.getDate(
400
+ item["order_time"] * 1000
401
+ ).fullTime;
402
+ item.product_image = getServiceUrl(item.product_image)
403
+ return item;
404
+ })
405
+ let max = this.getAmout(res.total_amount);
406
+ // 数量
407
+ let value = this.getAmout(res.save_amount);
408
+ // 计算
409
+ let rate = Math.round((value * 1000) / max)||0;
410
+ this.option = {
411
+ backgroundColor: '#fff', // 设置图表区域的背景颜色
412
+ borderRadius: 10, // 设置图表区域的圆角
413
+ title: [
414
+ {
415
+ text: '{a|周期已省}\n{b|' + rate + '}', // 显示标题
416
+ show: true, // 是否显示
417
+ x: 'center', // x轴位置
418
+ y: 'center', // y轴位置
419
+ textStyle: { // 样式配置
420
+ rich: {
421
+ a: {
422
+ fontSize: 16,
423
+ fontWeight: 'normal',
424
+ color: '#666',
425
+ padding: [0, 0, 10, 0], // 边距
426
+ },
427
+ b: {
428
+ fontSize: 40,
429
+ fontWeight: 700,
430
+ color: '#000'
431
+ },
432
+ },
433
+ },
434
+ },
435
+ ],
436
+ polar: {
437
+ center: ['50%', '50%'],
438
+ radius: ['60%', '75%'],
439
+ },
440
+ angleAxis: {
441
+ max: max,
442
+ startAngle: 90, // 开始的角度
443
+ show: false,
444
+ },
445
+ radiusAxis: {
446
+ type: 'category',
447
+ show: true,
448
+ axisLabel: {
449
+ show: false, // 是否显示标签
450
+ },
451
+ axisLine: {
452
+ show: false, // 是否显示轴线
453
+ },
454
+ axisTick: {
455
+ show: false, // 是否显示刻度
456
+ },
457
+ },
458
+ series: [
459
+ {
460
+ name: '',
461
+ type: 'bar',
462
+ roundCap: true,
463
+ showBackground: true,
464
+ backgroundStyle: {
465
+ color: '#f5f5f5',
466
+ },
467
+ data: [value],
468
+ coordinateSystem: 'polar',
469
+ itemStyle: {
470
+ normal: {
471
+ color: this.mainColor,
472
+ },
473
+ },
474
+ },
475
+ ],
476
+ };
477
+ this.totalDateRange = res.date_range
478
+ this.saveAmount = res.save_amount
479
+ this.hasNext = res.next_page_token !== "";
480
+ if (this.page_token === 1) {
481
+ this.productList = list
482
+ } else {
483
+ this.productList = this.productList.concat(list);
484
+ }
485
+ })
486
+ },
487
+ /**
488
+ * @description 监听事件变化
489
+ * @param container {object} 业务组件对象自己
490
+ */
491
+ init(container) {
492
+ //标题
493
+ this.titleBgc = getContainerPropsValue(container, 'content.titleBgc', '#ffff');
494
+ this.titlePadding = getContainerPropsValue(container, 'content.titlePadding', 20);
495
+ this.tabPadding = getContainerPropsValue(container, 'content.tabPadding', { top: 40, right: 0, bottom: 40, left: 0 });
496
+ this.titleColor = getContainerPropsValue(container, 'content.titleColor', '#666');
497
+ this.titleActColor = getContainerPropsValue(container, 'content.titleActColor', this.mainColor);
498
+ },
499
+ switchTab(i) {
500
+ this.tab = this.tabs[i].value;
501
+ this.tabIndex = i;
502
+ },
503
+ getAmout(amount) {
504
+ return this.$xdUniHelper.divisionFloatNumber(amount, 100)||0
505
+ },
506
+ getYearAndMonth(dateStr) {
507
+ // 将输入的日期字符串转换为Date对象
508
+ const date = new Date(dateStr.replace("年", "-").replace("月", "-01"));
509
+
510
+ // 获取年份和月份
511
+ const year = date.getFullYear();
512
+ const month = String(date.getMonth() + 1);
513
+
514
+ return {
515
+ year: year,
516
+ month: month
517
+ };
518
+ },
519
+ formatDate(date) {
520
+ const year = date.getFullYear();
521
+ const month = String(date.getMonth() + 1);
522
+ return `${year}年${month}月`;
523
+ },
524
+ handleLastMonth() {
525
+ const dateRange = new Date(this.monthDateRange.replace("年", "-").replace("月", "-01"));
526
+ // 获取上一个月的日期范围
527
+ const previousMonth = new Date(dateRange);
528
+ previousMonth.setMonth(dateRange.getMonth() - 1);
529
+ const previousMonthStart = new Date(previousMonth.getFullYear(), previousMonth.getMonth(), 1);
530
+ const previousMonthEnd = new Date(previousMonth.getFullYear(), previousMonth.getMonth() + 1, 0);
531
+ this.monthDateRange = this.formatDate(previousMonthStart)
532
+ this.getMonthData()
533
+ },
534
+ handleNextMonth() {
535
+ const dateRange = new Date(this.monthDateRange.replace("年", "-").replace("月", "-01"));
536
+ // 获取下一个月的日期范围
537
+ const nextMonth = new Date(dateRange);
538
+ nextMonth.setMonth(dateRange.getMonth() + 1);
539
+ const nextMonthStart = new Date(nextMonth.getFullYear(), nextMonth.getMonth(), 1);
540
+ const nextMonthEnd = new Date(nextMonth.getFullYear(), nextMonth.getMonth() + 1, 0);
541
+ this.monthDateRange = this.formatDate(nextMonthEnd)
542
+ this.getMonthData()
543
+ },
544
+ onJfbScroll(options) {
545
+ console.log('event.onJfbScroll', options)
546
+ },
547
+ onJfbReachBottom(options) {
548
+ if (this.hasNext) {
549
+ this.page_token = this.next_page_token;
550
+ if (this.tab === 'month') {
551
+ this.getMonthData()
552
+ } else if (this.tab === 'year') {
553
+ this.getYearData()
554
+ } else if (this.tab === 'total') {
555
+ this.getTotalData()
556
+ }
557
+ }
558
+ },
559
+ onJfbShow(options) {
560
+ console.log('event.onJfbShow', options)
561
+ },
562
+ onJfbHide(options) {
563
+ console.log('event.onJfbHide', options)
564
+ },
565
+ onJfbBack(options) {
566
+ console.log('event.onJfbBack', options)
567
+ },
568
+ onJfbUpdate(...data) {
569
+ console.log('event.onJfbUpdate', data)
570
+ },
571
+ onJfbCustomEvent(options) {
572
+ console.log('event.onJfbReachBottom', options)
573
+ },
574
+ }
575
+ }
576
+
577
+ </script>
578
+
579
+ <style scoped lang="less">
580
+ @import "./JfbBaseSavingDetailLess.less";
581
+
582
+ .jfb-base-saving-detail {
583
+ &__body {
584
+ .tab_list {
585
+ display: flex;
586
+ justify-content: space-around;
587
+ align-items: center;
588
+ white-space: nowrap;
589
+
590
+ .tab_item {
591
+ flex: 1;
592
+ display: flex;
593
+ align-items: center;
594
+ justify-content: center;
595
+ flex-direction: column;
596
+ color: #666666;
597
+ font-size: unit(32, rpx);
598
+ white-space: nowrap;
599
+ }
600
+
601
+ .check {
602
+ width: 60rpx;
603
+ height: 6rpx;
604
+ margin-top: 12rpx;
605
+ }
606
+ }
607
+
608
+ &-cycle {
609
+ font-size: 32rpx;
610
+ color: #999;
611
+ text-align: center;
612
+ padding-top: 40rpx;
613
+ }
614
+
615
+ &-block {
616
+ height: 40rpx;
617
+ width: 100%;
618
+ }
619
+
620
+ &-month {
621
+ display: flex;
622
+ align-items: center;
623
+ justify-content: space-around;
624
+ padding: 40rpx 24rpx 20rpx 24rpx;
625
+
626
+ &>view:first-child,
627
+ &>view:last-child {
628
+ font-size: 28rpx;
629
+ color: #999999;
630
+ padding: 12rpx 60rpx;
631
+ background: #F5F5F5;
632
+ border-radius: 40rpx;
633
+ }
634
+
635
+ &>view:nth-child(2) {
636
+ font-size: 32rpx;
637
+ color: #999;
638
+ }
639
+ }
640
+
641
+ &-product {
642
+ border-radius: 20rpx;
643
+ background: #fff;
644
+ margin: 20rpx;
645
+
646
+ &-title {
647
+ font-size: 28rpx;
648
+ display: flex;
649
+ align-items: center;
650
+ justify-content: space-between;
651
+ padding: 24rpx;
652
+ border-bottom: 2rpx solid #eee;
653
+
654
+ &>view:first-child {
655
+ color: #333;
656
+ font-weight: 500;
657
+ }
658
+
659
+ &>view:nth-child(2) {
660
+ color: #999999;
661
+ font-size: 24rpx;
662
+ }
663
+ }
664
+
665
+ &-item {
666
+ display: flex;
667
+ padding: 26rpx;
668
+ border-bottom: 2rpx solid #eee;
669
+
670
+ &>image {
671
+ width: 200rpx;
672
+ height: 200rpx;
673
+ margin-right: 32rpx;
674
+ flex-shrink: 0;
675
+
676
+ }
677
+
678
+ &-info {
679
+ flex: 1;
680
+ &-name {
681
+ font-size: 28rpx;
682
+ color: #333333;
683
+ .uni-max-cut(2, 80);
684
+ }
685
+
686
+ &-time {
687
+ display: flex;
688
+ align-items: center;
689
+ justify-content: space-between;
690
+ font-size: 24rpx;
691
+ color: #999999;
692
+ margin: 40rpx 0 12rpx 0;
693
+ }
694
+
695
+ &-price {
696
+ display: flex;
697
+ align-items: center;
698
+ justify-content: space-between;
699
+ font-size: 24rpx;
700
+
701
+ &>view:nth-child(2) {
702
+ font-weight: 500;
703
+ }
704
+ }
705
+ }
706
+ }
707
+ }
708
+ .monthDisabled{
709
+ background: #FCFCFC !important;
710
+ color: #EEEEEE !important;
711
+ }
712
+ }
713
+ }
714
+ </style>