jufubao-base 1.0.437 → 1.0.438-beta2
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.
- package/.claude/settings.local.json +9 -0
- package/package.json +1 -1
- package/src/components/JfbBaseCardConsumpCode/Api.js +39 -0
- package/src/components/JfbBaseCardConsumpCode/Attr.js +31 -0
- package/src/components/JfbBaseCardConsumpCode/JfbBaseCardConsumpCode.vue +489 -0
- package/src/components/JfbBaseCardConsumpCode/JfbBaseCardConsumpCodeLess.less +79 -0
- package/src/components/JfbBaseCardConsumpCode/JfbBaseCardConsumpCodeMixin.js +30 -0
- package/src/components/JfbBaseCardConsumpCode/Mock.js +71 -0
- package/get.package.path.js +0 -22
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* @description 接口配置,
|
|
4
|
+
* 在设置方法名字当时候,别忘记加上【模块名字】:Card
|
|
5
|
+
* @type {*[]}
|
|
6
|
+
*/
|
|
7
|
+
module.exports = [
|
|
8
|
+
{
|
|
9
|
+
mapFnName: 'getListEntryCardBind',
|
|
10
|
+
isRule: false,
|
|
11
|
+
title: '获得绑定卡',
|
|
12
|
+
prefix: 'list',
|
|
13
|
+
path: '/card/v1/card-bind/list-bind-card',
|
|
14
|
+
params: {},
|
|
15
|
+
disabled: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
mapFnName: 'getBaseByIdCardDetail',
|
|
19
|
+
isRule: false,
|
|
20
|
+
title: '获得绑定的卡详情',
|
|
21
|
+
prefix: 'detal',
|
|
22
|
+
path: '/card/v1/card-bind/get-bind-card',
|
|
23
|
+
params: {
|
|
24
|
+
card_number: ['卡号', 'String', '必选'],
|
|
25
|
+
},
|
|
26
|
+
disabled: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
mapFnName: 'getCardYue',
|
|
30
|
+
isRule: false,
|
|
31
|
+
title: '获得绑定的卡剩余点数',
|
|
32
|
+
prefix: 'yue',
|
|
33
|
+
path: '/card/v1/card-bind/get-bind-card-points',
|
|
34
|
+
params: {
|
|
35
|
+
card_number: ['卡号', 'String', '必选'],
|
|
36
|
+
},
|
|
37
|
+
disabled: true,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import { dataVal } from "@/utils/AttrTools";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description 当表单组件中有联动操作时候,使用方法进行返回
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
style: [],
|
|
9
|
+
content: (data, gValue, gColor, oldData={}) => {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
ele: 'title',
|
|
13
|
+
label: '展示内容',
|
|
14
|
+
size: 'small',
|
|
15
|
+
groupKey:'content',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: '消费标题',
|
|
19
|
+
ele: 'el-input',
|
|
20
|
+
valueKey: 'takeTitleName',
|
|
21
|
+
value: dataVal({ data, key: 'takeTitleName', dValue: '本店支持「展码」买单', gValue }),
|
|
22
|
+
groupKey: 'content',
|
|
23
|
+
className: 'input80',
|
|
24
|
+
labelInline: true,
|
|
25
|
+
inline: false,
|
|
26
|
+
placeholder: "输入消费标题"
|
|
27
|
+
},
|
|
28
|
+
].filter(i=>i)
|
|
29
|
+
},
|
|
30
|
+
advanced: [],
|
|
31
|
+
};
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="jfb-base-card-consump-code"
|
|
4
|
+
@click="handleEditxSelect"
|
|
5
|
+
:class="{ editx : isEditx && active }"
|
|
6
|
+
>
|
|
7
|
+
<!--#ifdef H5-->
|
|
8
|
+
<view
|
|
9
|
+
class="jfb-base-card-consump-code__edit"
|
|
10
|
+
:class="{ editx : isEditx && active }"
|
|
11
|
+
v-if="isEditx && active"
|
|
12
|
+
>
|
|
13
|
+
<view class="jfb-base-card-consump-code__edit-icon" @click="delEdit">删除</view>
|
|
14
|
+
</view>
|
|
15
|
+
<!-- #endif -->
|
|
16
|
+
<view class="jfb-base-card-consump-code__body">
|
|
17
|
+
<view class="body-qrcode">
|
|
18
|
+
<view class="barcode_title">{{ takeTitleName }}</view>
|
|
19
|
+
<template v-if="info">
|
|
20
|
+
<view class="barcode_wrap">
|
|
21
|
+
<view>
|
|
22
|
+
<image mode="aspectFit" :src="info.barcode"></image>
|
|
23
|
+
</view>
|
|
24
|
+
</view>
|
|
25
|
+
<view class="qrcode_wrap" style="position: relative">
|
|
26
|
+
<image
|
|
27
|
+
:style="{width: '280rpx', height: '280rpx'}"
|
|
28
|
+
:src="info.card_qrcode"
|
|
29
|
+
></image>
|
|
30
|
+
<image v-if="isBrandLogo" class="logo-icon" :src="brandLogo"></image>
|
|
31
|
+
</view>
|
|
32
|
+
<view class="refresh_tip">
|
|
33
|
+
<view v-if="timeStr">{{ timeStr }}后自动刷新</view>
|
|
34
|
+
</view>
|
|
35
|
+
<view class="refresh_wrap" @click="handleRefresh">
|
|
36
|
+
<xd-font-icon
|
|
37
|
+
icon="iconmian-loading"
|
|
38
|
+
:size="32"
|
|
39
|
+
color="#666666"
|
|
40
|
+
style="margin-right:10rpx"
|
|
41
|
+
></xd-font-icon> 刷新二维码
|
|
42
|
+
</view>
|
|
43
|
+
</template>
|
|
44
|
+
<view v-else>
|
|
45
|
+
<xd-no-data height="600rpx" :scaleSize="2">
|
|
46
|
+
<view class="empty_txt">
|
|
47
|
+
{{ card_number ? '卡券信息加载失败,请稍后重试' : '暂无可用票券' }}
|
|
48
|
+
</view>
|
|
49
|
+
</xd-no-data>
|
|
50
|
+
</view>
|
|
51
|
+
<view class="qrcode_choose" v-if="info" @click="handleChooseCard">
|
|
52
|
+
<view class="qrcode_choose_name">
|
|
53
|
+
<xd-font-icon style="margin-right: 24rpx;" size="32" icon="iconpiao"></xd-font-icon>{{ card_name }}
|
|
54
|
+
</view>
|
|
55
|
+
<view class="qrcode_choose_icon">
|
|
56
|
+
<view>切换票券</view>
|
|
57
|
+
<xd-font-icon style="margin-left: 4rpx;" size="22" icon="iconxiangyou_xian"></xd-font-icon>
|
|
58
|
+
</view>
|
|
59
|
+
</view>
|
|
60
|
+
<xd-down-drawer
|
|
61
|
+
:show.sync="showCardDialog"
|
|
62
|
+
height="50vh"
|
|
63
|
+
>
|
|
64
|
+
<view class="drawer_content">
|
|
65
|
+
<view class="ticket_title">使用票券</view>
|
|
66
|
+
<view class="ticket_tab">
|
|
67
|
+
<view
|
|
68
|
+
v-for="item in cardTypeData"
|
|
69
|
+
:key="item.value"
|
|
70
|
+
:style="[show_type === item.value ? activityType : '']"
|
|
71
|
+
@click="handleChangeType(item.value)"
|
|
72
|
+
>{{ item.label }}</view>
|
|
73
|
+
</view>
|
|
74
|
+
<view class="ticket_content">
|
|
75
|
+
<view class="ticket_list" :key="renderChecked" v-if="showCardList.length">
|
|
76
|
+
<view
|
|
77
|
+
class="ticket_item"
|
|
78
|
+
v-for="ticket in showCardList"
|
|
79
|
+
@click="handlerTicketSelect(!checkedCards.includes(ticket.card_number), ticket)"
|
|
80
|
+
:key="ticket.card_number"
|
|
81
|
+
>
|
|
82
|
+
<view class="_header">
|
|
83
|
+
<view class="flex align-center">
|
|
84
|
+
<xd-font-icon
|
|
85
|
+
style="margin-right: 8rpx;"
|
|
86
|
+
icon="iconkaquan"
|
|
87
|
+
color="#ffc65d"
|
|
88
|
+
size="32"
|
|
89
|
+
></xd-font-icon>
|
|
90
|
+
{{ ticket.card_type_name }}
|
|
91
|
+
</view>
|
|
92
|
+
<xd-radio
|
|
93
|
+
:isClickEvent="false"
|
|
94
|
+
:isOld="false"
|
|
95
|
+
:value="checkedCards.includes(ticket.card_number)"
|
|
96
|
+
:disabled="ticket.is_valid === 'N' || ticket.card_point == 0"
|
|
97
|
+
></xd-radio>
|
|
98
|
+
</view>
|
|
99
|
+
<view class="_cont">
|
|
100
|
+
<view style="margin-right: 30rpx;">ID:{{ ticket.card_number }}</view>
|
|
101
|
+
<view>有效期至:{{ ticket.end_time }}</view>
|
|
102
|
+
</view>
|
|
103
|
+
<view class="_footer">
|
|
104
|
+
<view class="_item">
|
|
105
|
+
<text>剩余:</text>
|
|
106
|
+
<xd-unit
|
|
107
|
+
:price="ticket.card_point"
|
|
108
|
+
:isOld="false"
|
|
109
|
+
:font-size="24"
|
|
110
|
+
:icon-size="0.3"
|
|
111
|
+
:unit="ticket.unit || ''"
|
|
112
|
+
></xd-unit>
|
|
113
|
+
</view>
|
|
114
|
+
<view
|
|
115
|
+
v-if="ticket.card_use_point"
|
|
116
|
+
class="_item text-primary"
|
|
117
|
+
>
|
|
118
|
+
<text>使用:</text>
|
|
119
|
+
<xd-unit
|
|
120
|
+
:price="ticket.card_use_point"
|
|
121
|
+
:isOld="false"
|
|
122
|
+
:font-size="24"
|
|
123
|
+
:icon-size="0.3"
|
|
124
|
+
:unit="ticket.unit || ''"
|
|
125
|
+
></xd-unit>
|
|
126
|
+
<view v-if="ticket['card_discount_use_point'] > 0" class="discount">已优惠:{{ ticket['card_discount_use_point'] }}</view>
|
|
127
|
+
</view>
|
|
128
|
+
</view>
|
|
129
|
+
</view>
|
|
130
|
+
</view>
|
|
131
|
+
<view v-else>
|
|
132
|
+
<xd-no-data height="600rpx" :scaleSize="2">
|
|
133
|
+
<view class="empty_txt">
|
|
134
|
+
暂无可用票券
|
|
135
|
+
</view>
|
|
136
|
+
</xd-no-data>
|
|
137
|
+
</view>
|
|
138
|
+
<view class="bottom_btn" v-if="showCardDialog" :style="{bottom: (layoutInfo.bottom || 0) + 'rpx'}">
|
|
139
|
+
<xd-button
|
|
140
|
+
width="670rpx"
|
|
141
|
+
type="primary"
|
|
142
|
+
radius="40rpx"
|
|
143
|
+
v-if="checkedCards.length"
|
|
144
|
+
@click="handleChooseConfirm"
|
|
145
|
+
>确定</xd-button>
|
|
146
|
+
<xd-button
|
|
147
|
+
width="670rpx"
|
|
148
|
+
type="primary"
|
|
149
|
+
radius="40rpx"
|
|
150
|
+
v-else
|
|
151
|
+
:disabled="true"
|
|
152
|
+
@click="handleChooseConfirm"
|
|
153
|
+
>确定</xd-button>
|
|
154
|
+
</view>
|
|
155
|
+
</view>
|
|
156
|
+
</view>
|
|
157
|
+
</xd-down-drawer>
|
|
158
|
+
</view>
|
|
159
|
+
</view>
|
|
160
|
+
</view>
|
|
161
|
+
</template>
|
|
162
|
+
|
|
163
|
+
<script>
|
|
164
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
165
|
+
import XdNoData from "@/components/XdNoData/XdNoData";
|
|
166
|
+
import XdDownDrawer from "@/components/XdDownDrawer/XdDownDrawer";
|
|
167
|
+
import XdRadio from "@/components/XdRadio/XdRadio";
|
|
168
|
+
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
169
|
+
import XdButton from "@/components/XdButton/XdButton";
|
|
170
|
+
import { jfbRootExec } from "@/utils/xd.event";
|
|
171
|
+
import JfbBaseCardConsumpCodeMixin from "./JfbBaseCardConsumpCodeMixin";
|
|
172
|
+
import { gCPVal } from "@/utils/xd.base";
|
|
173
|
+
import componentsMixins from "@/mixins/componentsMixins";
|
|
174
|
+
import extsMixins from "@/mixins/extsMixins";
|
|
175
|
+
import { Base64 } from "js-base64";
|
|
176
|
+
|
|
177
|
+
export default {
|
|
178
|
+
name: "JfbBaseCardConsumpCode",
|
|
179
|
+
components: {
|
|
180
|
+
XdFontIcon,
|
|
181
|
+
XdNoData,
|
|
182
|
+
XdDownDrawer,
|
|
183
|
+
XdRadio,
|
|
184
|
+
XdUnit,
|
|
185
|
+
XdButton
|
|
186
|
+
},
|
|
187
|
+
mixins: [
|
|
188
|
+
componentsMixins, extsMixins, JfbBaseCardConsumpCodeMixin
|
|
189
|
+
],
|
|
190
|
+
data() {
|
|
191
|
+
return {
|
|
192
|
+
takeTitleName: '本店支持「展码」买单',
|
|
193
|
+
info: null,
|
|
194
|
+
timeStr: "",
|
|
195
|
+
timeer: null,
|
|
196
|
+
date: 2, //时间底数
|
|
197
|
+
time: 2, //时间幂指数
|
|
198
|
+
refrushTimeer: null,
|
|
199
|
+
maxTime: 30, //最大执行时间幂指数
|
|
200
|
+
card_name: '请选择票券',
|
|
201
|
+
showCardList: [],
|
|
202
|
+
showCardDialog: false,
|
|
203
|
+
renderChecked: 'renderChecked',
|
|
204
|
+
chooseData: [],
|
|
205
|
+
checkedCards: [],
|
|
206
|
+
cardTypeData: [
|
|
207
|
+
{label: '已绑票券', value: 'normal'},
|
|
208
|
+
{label: '优惠券', value: 'coupon'},
|
|
209
|
+
],
|
|
210
|
+
show_type: 'normal', //normal:已绑定卡券 coupon: 优惠券
|
|
211
|
+
card_number: '',
|
|
212
|
+
|
|
213
|
+
//品牌logo
|
|
214
|
+
//#ifdef H5
|
|
215
|
+
brandLogo: '//img.jufubao.cn/common/jufubao_logo.png?v=1.0.0',
|
|
216
|
+
//#endif
|
|
217
|
+
//#ifdef MP-WEIXIN
|
|
218
|
+
brandLogo: 'https://img.jufubao.cn/common/jufubao_logo.png?v=1.0.0',
|
|
219
|
+
//#endif
|
|
220
|
+
isBrandLogo: false,
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
computed: {
|
|
224
|
+
activityType() {
|
|
225
|
+
return {
|
|
226
|
+
color: '#E5010E',
|
|
227
|
+
borderBottom: '6rpx solid #E5010E'
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
watch: {
|
|
232
|
+
container(value, oldValue) {
|
|
233
|
+
if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
234
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
created() {
|
|
238
|
+
this.init(this.container);
|
|
239
|
+
},
|
|
240
|
+
methods: {
|
|
241
|
+
/**
|
|
242
|
+
* @description 监听页面进入,开始拉取展码数据
|
|
243
|
+
* @param options {object} 页面参数
|
|
244
|
+
*/
|
|
245
|
+
onJfbLoad(options) {
|
|
246
|
+
if (options["x-params"]) {
|
|
247
|
+
try {
|
|
248
|
+
let params = JSON.parse(Base64.decode(options["x-params"]));
|
|
249
|
+
if (params["qrcode_logo"]) this.brandLogo = params["qrcode_logo"];
|
|
250
|
+
} catch (e) {
|
|
251
|
+
console.warn(options["x-params"]);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
this.card_number = options.card_number;
|
|
255
|
+
if (this.card_number) {
|
|
256
|
+
this.dataInit();
|
|
257
|
+
} else {
|
|
258
|
+
//未带卡号入参时,拉取可用票券列表并默认选中登录卡
|
|
259
|
+
this.getCardList(true);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
/**
|
|
263
|
+
* @description 拉取当前卡号的展码数据
|
|
264
|
+
*/
|
|
265
|
+
dataInit() {
|
|
266
|
+
if (!this.card_number) return;
|
|
267
|
+
this.detail();
|
|
268
|
+
this.refrush();
|
|
269
|
+
if (this.$configProject.isPreview) {
|
|
270
|
+
this.timeStr = "01分19秒"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
/**
|
|
274
|
+
* @description 监听事件变化
|
|
275
|
+
* @param container {object} 业务组件对象自己
|
|
276
|
+
*/
|
|
277
|
+
init(container) {
|
|
278
|
+
this.takeTitleName = gCPVal(container, 'takeTitleName', '本店支持「展码」买单');
|
|
279
|
+
},
|
|
280
|
+
/**
|
|
281
|
+
* @description 获取可切换的票券列表
|
|
282
|
+
* @param autoSelect {Boolean} 是否自动选中登录卡(未带卡号入参时使用)
|
|
283
|
+
*/
|
|
284
|
+
getCardList(autoSelect = false) {
|
|
285
|
+
jfbRootExec("getListEntryCardBind", {
|
|
286
|
+
vm: this,
|
|
287
|
+
data: {
|
|
288
|
+
is_all: 'Y',
|
|
289
|
+
is_show_entry_settings: 'N',
|
|
290
|
+
show_type: this.show_type
|
|
291
|
+
}
|
|
292
|
+
}).then(res => {
|
|
293
|
+
this.showCardList = (res && res.list) || [];
|
|
294
|
+
|
|
295
|
+
if (autoSelect) {
|
|
296
|
+
//默认选中登录卡,没有登录卡则取第一张
|
|
297
|
+
if (this.showCardList.length) {
|
|
298
|
+
let loginCard = this.showCardList.filter(item => item.is_login === 'Y');
|
|
299
|
+
let ticket = loginCard.length > 0 ? loginCard[0] : this.showCardList[0];
|
|
300
|
+
this.handlerTicketSelect(true, ticket);
|
|
301
|
+
this.handleChooseConfirm();
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
//回显当前正在使用的票券
|
|
305
|
+
let curTicket = this.showCardList.find(item => item.card_number === this.card_number);
|
|
306
|
+
this.chooseData = curTicket ? [curTicket] : [];
|
|
307
|
+
this.checkedCards = this.chooseData.map(item => item.card_number);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
this.renderChecked = Date.now();
|
|
311
|
+
}).catch(err => {});
|
|
312
|
+
},
|
|
313
|
+
handleRefresh() {
|
|
314
|
+
this.clearAllTimer();
|
|
315
|
+
this.dataInit();
|
|
316
|
+
},
|
|
317
|
+
handleChooseCard() {
|
|
318
|
+
this.showCardDialog = true;
|
|
319
|
+
this.getCardList();
|
|
320
|
+
},
|
|
321
|
+
handlerTicketSelect(flat, ticket) {
|
|
322
|
+
if (flat) {
|
|
323
|
+
this.chooseData = [ticket];
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
this.chooseData = [];
|
|
327
|
+
}
|
|
328
|
+
this.checkedCards = this.chooseData.map(item => item.card_number);
|
|
329
|
+
},
|
|
330
|
+
handleChangeType(type) {
|
|
331
|
+
if (this.show_type === type) return;
|
|
332
|
+
this.show_type = type;
|
|
333
|
+
this.getCardList();
|
|
334
|
+
},
|
|
335
|
+
handleChooseConfirm() {
|
|
336
|
+
if (!this.chooseData.length) return;
|
|
337
|
+
this.clearAllTimer();
|
|
338
|
+
this.card_number = this.chooseData[0].card_number;
|
|
339
|
+
this.dataInit();
|
|
340
|
+
this.showCardDialog = false;
|
|
341
|
+
},
|
|
342
|
+
/**
|
|
343
|
+
* @description 获取卡详情
|
|
344
|
+
*/
|
|
345
|
+
detail() {
|
|
346
|
+
jfbRootExec("getBaseByIdCardDetail", {
|
|
347
|
+
vm: this,
|
|
348
|
+
data: {card_number: this.card_number},
|
|
349
|
+
})
|
|
350
|
+
.then((res) => {
|
|
351
|
+
if (res && res.card_point) {
|
|
352
|
+
res["card_point"] = this.$xdUniHelper.divisionFloatNumber(res.card_point, 100);
|
|
353
|
+
}
|
|
354
|
+
if (res && res.other_card_point) {
|
|
355
|
+
res["other_card_point"] = this.$xdUniHelper.divisionFloatNumber(res.other_card_point, 100);
|
|
356
|
+
}
|
|
357
|
+
//展示品牌logo
|
|
358
|
+
if (res["is_show_qrcode_logo"] === "Y") {
|
|
359
|
+
this.isBrandLogo = true;
|
|
360
|
+
}
|
|
361
|
+
this.info = res;
|
|
362
|
+
this.card_name = '已选卡号' + res.card_number;
|
|
363
|
+
this.showCardDialog = false;
|
|
364
|
+
if (!this.$configProject.isPreview) {
|
|
365
|
+
this.setInval(this.info.card_qrcode_expire);
|
|
366
|
+
}
|
|
367
|
+
})
|
|
368
|
+
.catch((err) => {
|
|
369
|
+
console.error(err);
|
|
370
|
+
});
|
|
371
|
+
},
|
|
372
|
+
/**
|
|
373
|
+
* @description 二维码过期倒计时
|
|
374
|
+
* @param time {Number} 过期秒数
|
|
375
|
+
*/
|
|
376
|
+
setInval(time) {
|
|
377
|
+
if (this.timeer) clearInterval(this.timeer);
|
|
378
|
+
this.timeer = setInterval(() => {
|
|
379
|
+
if (time <= 0) {
|
|
380
|
+
this.timeStr = "00分00秒";
|
|
381
|
+
clearInterval(this.timeer);
|
|
382
|
+
this.detail();
|
|
383
|
+
} else {
|
|
384
|
+
time--;
|
|
385
|
+
let f = Math.floor(time / 60);
|
|
386
|
+
f = f < 10 ? "0" + f : f;
|
|
387
|
+
let m = time % 60;
|
|
388
|
+
m = m < 10 ? "0" + m : m;
|
|
389
|
+
this.timeStr = `${f}分${m}秒`;
|
|
390
|
+
}
|
|
391
|
+
}, 1000);
|
|
392
|
+
},
|
|
393
|
+
/**
|
|
394
|
+
* @description 轮询刷新卡剩余点数
|
|
395
|
+
*/
|
|
396
|
+
refrush() {
|
|
397
|
+
if (this.time >= this.maxTime) {
|
|
398
|
+
clearTimeout(this.refrushTimeer);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
this.time++;
|
|
402
|
+
let time = this.time >= 5 ? 32 * 1000 : Math.pow(this.date, this.time) * 1000;
|
|
403
|
+
this.refrushTimeer = setTimeout(() => {
|
|
404
|
+
jfbRootExec("getCardYue", {
|
|
405
|
+
vm: this,
|
|
406
|
+
data: {
|
|
407
|
+
card_number: this.card_number,
|
|
408
|
+
},
|
|
409
|
+
})
|
|
410
|
+
.then((res) => {
|
|
411
|
+
let refrushInfo = this.$xdUniHelper.cloneDeep(this.info);
|
|
412
|
+
if (res && res !== null && Object.keys(res).length > 0) {
|
|
413
|
+
if (res.card_point) {
|
|
414
|
+
refrushInfo.card_point = this.$xdUniHelper.divisionFloatNumber(
|
|
415
|
+
res.card_point,
|
|
416
|
+
100
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
if (res.other_card_point) {
|
|
420
|
+
refrushInfo.other_card_point =
|
|
421
|
+
this.$xdUniHelper.divisionFloatNumber(
|
|
422
|
+
res.other_card_point,
|
|
423
|
+
100
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
this.info = refrushInfo;
|
|
429
|
+
this.refrush();
|
|
430
|
+
})
|
|
431
|
+
.catch();
|
|
432
|
+
}, time);
|
|
433
|
+
},
|
|
434
|
+
/**
|
|
435
|
+
* @description 清除所有定时器
|
|
436
|
+
*/
|
|
437
|
+
clearAllTimer() {
|
|
438
|
+
this.timeStr = "";
|
|
439
|
+
if (this.timeer) {
|
|
440
|
+
clearInterval(this.timeer);
|
|
441
|
+
this.timeer = null;
|
|
442
|
+
}
|
|
443
|
+
if (this.refrushTimeer) {
|
|
444
|
+
clearTimeout(this.refrushTimeer);
|
|
445
|
+
this.refrushTimeer = null;
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
onJfbScroll(options) {
|
|
449
|
+
console.log('event.onJfbScroll', options)
|
|
450
|
+
},
|
|
451
|
+
onJfbReachBottom(options) {
|
|
452
|
+
console.log('event.onJfbReachBottom', options)
|
|
453
|
+
},
|
|
454
|
+
onJfbShow(options) {
|
|
455
|
+
console.log('event.onJfbShow', options)
|
|
456
|
+
//从其他页面返回时,二维码已失效且定时器已被清理,重新拉取展码数据
|
|
457
|
+
if (!this.card_number) return;
|
|
458
|
+
this.clearAllTimer();
|
|
459
|
+
this.dataInit();
|
|
460
|
+
},
|
|
461
|
+
onJfbHide(options) {
|
|
462
|
+
this.clearAllTimer();
|
|
463
|
+
},
|
|
464
|
+
onJfbUnload(options) {
|
|
465
|
+
this.clearAllTimer();
|
|
466
|
+
},
|
|
467
|
+
onJfbBack(options) {
|
|
468
|
+
this.clearAllTimer();
|
|
469
|
+
},
|
|
470
|
+
onJfbUpdate(...data) {
|
|
471
|
+
console.log('event.onJfbUpdate', data)
|
|
472
|
+
},
|
|
473
|
+
onJfbCustomEvent(options) {
|
|
474
|
+
console.log('event.onJfbReachBottom', options)
|
|
475
|
+
},
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
</script>
|
|
480
|
+
|
|
481
|
+
<style scoped lang="less">
|
|
482
|
+
@import "./JfbBaseCardConsumpCodeLess.less";
|
|
483
|
+
|
|
484
|
+
.jfb-base-card-consump-code {
|
|
485
|
+
&__body{
|
|
486
|
+
position: relative;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @desc 获取绝对路径完整地址
|
|
3
|
+
* @param @path
|
|
4
|
+
**/
|
|
5
|
+
//例如:https://image.jufubao.cn/20220501010108/image/bg/default_gonghui_bg.png
|
|
6
|
+
@basePath: 'business/';
|
|
7
|
+
@doMain: '//sandbox-img.jufubao.cn/';
|
|
8
|
+
|
|
9
|
+
.getBusinessImageUrl(@path, @size: 'size8') {
|
|
10
|
+
@url: "@{doMain}@{basePath}@{path}?x-oss-process=style/@{size}";
|
|
11
|
+
background-image: url(@url);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//start
|
|
15
|
+
.jfb-base-card-consump-code {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
|
|
18
|
+
&__body{
|
|
19
|
+
position: relative;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
z-index: 2
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.editx,&.editx:hover {
|
|
25
|
+
position: relative;
|
|
26
|
+
min-height: unit(100, rpx);
|
|
27
|
+
z-index: 3;
|
|
28
|
+
&::after {
|
|
29
|
+
border: 2rpx dashed blue;
|
|
30
|
+
content: " ";
|
|
31
|
+
position: absolute;
|
|
32
|
+
top:0;
|
|
33
|
+
left:0;
|
|
34
|
+
bottom:0;
|
|
35
|
+
right:0;
|
|
36
|
+
z-index: 4;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
&__edit {
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
position: absolute;
|
|
46
|
+
right: unit(0, rpx);
|
|
47
|
+
top: unit(-52, rpx);
|
|
48
|
+
height: unit(50, rpx);
|
|
49
|
+
line-height: unit(50, rpx);
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
align-items: center;
|
|
53
|
+
background: rgba(0, 0, 0, .6);
|
|
54
|
+
border-radius: unit(10, rpx);
|
|
55
|
+
box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
|
|
56
|
+
color: #fff;
|
|
57
|
+
font-size: unit(22, rpx);
|
|
58
|
+
|
|
59
|
+
&-icon{
|
|
60
|
+
padding: 0 unit(20, rpx);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.editx {
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//end
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/**notPreview**/
|
|
73
|
+
.jfb-base-card-consump-code {
|
|
74
|
+
//&:before {
|
|
75
|
+
//content: " ";
|
|
76
|
+
//display: table;
|
|
77
|
+
//}
|
|
78
|
+
}
|
|
79
|
+
/**endNotPreview**/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
//@AttrImport
|
|
5
|
+
import Attr from "./Attr";
|
|
6
|
+
//@EndAttrImport
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
//#ifdef H5
|
|
13
|
+
|
|
14
|
+
//@AttrData
|
|
15
|
+
Attr:{}, //对外开发编辑属性
|
|
16
|
+
//@EndAttrData
|
|
17
|
+
|
|
18
|
+
// #endif
|
|
19
|
+
cssRoot: 'jfb-base-card-consump-code'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
created() {
|
|
23
|
+
|
|
24
|
+
//@AttrDataCreated
|
|
25
|
+
this.Attr = this.$xdUniHelper.customClone(Attr);
|
|
26
|
+
//@EndAttrDataCreated
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
getCardYue: {},
|
|
5
|
+
getListEntryCardBind: {
|
|
6
|
+
list: [
|
|
7
|
+
{
|
|
8
|
+
card_number: "101001000008586",
|
|
9
|
+
card_type_name: "聚福宝福卡测试蛋糕",
|
|
10
|
+
end_time: "2027-07-31",
|
|
11
|
+
card_point: 99432830,
|
|
12
|
+
is_bind_card: true,
|
|
13
|
+
is_valid: "Y",
|
|
14
|
+
is_login: "Y",
|
|
15
|
+
unit: "点",
|
|
16
|
+
show_name: "聚福宝福卡测试蛋糕",
|
|
17
|
+
card_use_rule: "可凭本券到蛋糕(勿改)、电影(勿改)使用",
|
|
18
|
+
consume_type: "1",
|
|
19
|
+
is_auto_use: "N"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
card_number: "101001000009318",
|
|
23
|
+
card_type_name: "聚福宝福卡(点12位)",
|
|
24
|
+
end_time: "2027-03-31",
|
|
25
|
+
card_point: 98700,
|
|
26
|
+
is_bind_card: true,
|
|
27
|
+
is_valid: "Y",
|
|
28
|
+
is_login: "N",
|
|
29
|
+
unit: "点",
|
|
30
|
+
show_name: "聚福宝福卡(点12位)",
|
|
31
|
+
card_use_rule: "可凭本券到电影(勿改)、商城(对应百货)(勿改)、蛋糕(勿改)使用",
|
|
32
|
+
consume_type: "1",
|
|
33
|
+
is_auto_use: "N"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
card_number: "101001000009382",
|
|
37
|
+
card_type_name: "满50减50",
|
|
38
|
+
end_time: "2030-08-31",
|
|
39
|
+
card_point: 848815,
|
|
40
|
+
is_bind_card: true,
|
|
41
|
+
is_valid: "N",
|
|
42
|
+
is_login: "N",
|
|
43
|
+
unit: "点",
|
|
44
|
+
show_name: "满50减50",
|
|
45
|
+
card_use_rule: "满50减50",
|
|
46
|
+
consume_type: "2",
|
|
47
|
+
is_auto_use: "N"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
getBaseByIdCardDetail: {
|
|
52
|
+
is_show_qrcode_logo: "Y",
|
|
53
|
+
card_number: "101001000008586",
|
|
54
|
+
card_point: 99432830,
|
|
55
|
+
card_type_name: "聚福宝福卡测试蛋糕",
|
|
56
|
+
end_time: "2027-07-31",
|
|
57
|
+
card_status: "Y",
|
|
58
|
+
card_status_name: "开启",
|
|
59
|
+
card_qrcode: "//sandbox-apis.jufubao.cn/common/v1/image/qrcode?code_content=h.161.ktrd9ie2jnbkdb8",
|
|
60
|
+
barcode: "//sandbox-apis.jufubao.cn/common/v1/image/barcode?code_content=h.161.ktrd9ie2jnbkdb8",
|
|
61
|
+
card_qrcode_expire: 600,
|
|
62
|
+
unit: "点",
|
|
63
|
+
main_business_code_name: "蛋糕(勿改)",
|
|
64
|
+
other_card_point: 4073,
|
|
65
|
+
is_exchange: "N",
|
|
66
|
+
exchange_card_type_name: "福券",
|
|
67
|
+
exchange_card_point: 18330,
|
|
68
|
+
card_point_type: 2,
|
|
69
|
+
request_id: "ce26274fa52c8412"
|
|
70
|
+
}
|
|
71
|
+
}
|
package/get.package.path.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description 第三方库
|
|
5
|
-
* @param threePackagePath {String} 第三方库所在项目路径存放路径路
|
|
6
|
-
* @param packname {String} 包名字
|
|
7
|
-
* @returns {string|*}
|
|
8
|
-
*/
|
|
9
|
-
const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
|
|
10
|
-
if(packname === 'gxd-commands-bussiness') {
|
|
11
|
-
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (packname === 'gxd-uni-library-editx') {
|
|
15
|
-
return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
module.exports = {
|
|
21
|
-
getPackagePath
|
|
22
|
-
}
|