jufubao-base 1.0.243-beta201 → 1.0.243-beta202

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