jufubao-base 1.0.56-beta3 → 1.0.56-beta4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.56-beta3",
3
+ "version": "1.0.56-beta4",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description API模型
5
+ * 建议:Ffff=>模块 Xxxx=>自定义名字
6
+ * 获取单记录(getByIdFfffXxxx)
7
+ * 获取列表记录(getByListFfffXxxx)
8
+ * 添加列表记录(addFfffXxxxx)
9
+ * 删除列表记录(removeFfffXxxxx|deleteFfffXxxx)
10
+ * 更新列表记录(updateFfffXxxxx)
11
+ * @type {*[]}
12
+ */
13
+ module.exports = [
14
+ {
15
+ mapFnName: 'getListCardBind',
16
+ isRule: false,
17
+ title: '获得绑定卡',
18
+ prefix: 'list',
19
+ path: '/card/v1/card-bind/list-bind-card',
20
+ params: {},
21
+ disabled: true,
22
+ },
23
+ {
24
+ mapFnName: 'loginCardBind',
25
+ isRule: false,
26
+ title: '登录卡',
27
+ prefix: 'login',
28
+ path: '/card/v1/card-bind/login-card',
29
+ data: {
30
+ card_number: ['卡号', 'String', '必选'],
31
+ },
32
+ disabled: true,
33
+ },
34
+ {
35
+ mapFnName: 'getListBaseNewsContent', //自定义方法名字(必选)
36
+ title: '获取内容',
37
+ path: '/cms/v1/news-content',
38
+ isRule: false,
39
+ params: {
40
+ scene: ['使用场景', 'String', '选填'],
41
+ container_id: ['插件ID', 'String', '必填'],
42
+ page_id: ['页面ID', 'String', '必填'],
43
+ page_size: ['记录条数', 'Number', '必填', 1],
44
+ code: ['业务线id', 'String', '选填'],
45
+ },
46
+ isConsole: true,
47
+ disabled: true,
48
+ },
49
+ ];
@@ -0,0 +1,311 @@
1
+ 'use strict';
2
+
3
+ export default {
4
+ style: [],
5
+ advanced: [],
6
+ content: [
7
+ {
8
+ label: "票券布局",
9
+ ele: "xd-radio",
10
+ valueKey: "cardLayout",
11
+ value: "1",
12
+ list: [
13
+ {label: "布局1", value: "1"},
14
+ {label: "布局2", value: "2"},
15
+ ]
16
+ },
17
+ {
18
+ label: '票券登陆文案:',
19
+ ele: 'el-input',
20
+ type: 'text',
21
+ valueKey: 'login_name',
22
+ value: '',
23
+ placeholder: '请输入票券登陆文案',
24
+ className: 'input80',
25
+ inline: false,
26
+ notice: '当未设置文案时候,前台页面显示为"<span style="color:red">登录</span>"'
27
+ },
28
+ {
29
+ label: '失效卡列表地址:', //label
30
+ ele: 'xd-select-pages-path', //package 名称
31
+ valueKey: 'disabled_url', //form[valueKey]
32
+ placeholder: '请选择失效卡列表地址',
33
+ value: null,
34
+ setting: {
35
+ router: XdBus.getParentApi('getPagesTree'),
36
+ },
37
+ inline: false,
38
+ },
39
+ {
40
+ label: '卡券详情地址:', //label
41
+ ele: 'xd-select-pages-path', //package 名称
42
+ valueKey: 'detail_url', //form[valueKey]
43
+ placeholder: '请选择卡券详情地址',
44
+ value: null,
45
+ setting: {
46
+ router: XdBus.getParentApi('getPagesTree'),
47
+ },
48
+ inline: false,
49
+ },
50
+ {
51
+ label: '卡券转换地址:', //label
52
+ ele: 'xd-select-pages-path', //package 名称
53
+ valueKey: 'change_url', //form[valueKey]
54
+ placeholder: '请选择卡券转换地址',
55
+ value: null,
56
+ setting: {
57
+ router: XdBus.getParentApi('getPagesTree'),
58
+ },
59
+ inline: false,
60
+ },
61
+ {
62
+ label: '卡券绑定地址:', //label
63
+ ele: 'xd-select-pages-path', //package 名称
64
+ valueKey: 'bind_url', //form[valueKey]
65
+ placeholder: '请选择卡券绑定地址',
66
+ value: null,
67
+ setting: {
68
+ router: XdBus.getParentApi('getPagesTree'),
69
+ },
70
+ inline: false,
71
+ },
72
+ {
73
+ label: '卡券绑定确认地址:', //label
74
+ ele: 'xd-select-pages-path', //package 名称
75
+ valueKey: 'confirm_url', //form[valueKey]
76
+ placeholder: '请选择卡券绑定确认地址',
77
+ value: null,
78
+ setting: {
79
+ router: XdBus.getParentApi('getPagesTree'),
80
+ },
81
+ inline: false,
82
+ },
83
+ {
84
+ label: '综合福利入口页:',
85
+ ele: 'xd-select-pages-path',
86
+ valueKey: 'allEntryPath',
87
+ placeholder: '请选择综合福利入口页',
88
+ value: null,
89
+ setting: {
90
+ router: XdBus.getParentApi('getPagesTree'),
91
+ },
92
+ inline: false,
93
+ },
94
+ {
95
+ label: '提示内容:',
96
+ ele: 'xd-site-news',
97
+ valueKey: 'notice',
98
+ value: null,
99
+ className: 'input70',
100
+ setting: {
101
+ config: {
102
+ sort: true,
103
+ maxlen: 100,
104
+ action: 'aliyun',
105
+ size: 5,
106
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
107
+ uploadType: 'aliyun',
108
+ type: ['jpg', 'png', 'jpeg']
109
+ },
110
+ },
111
+ handleCustom({action, data}) {
112
+ if (data && data.params) {
113
+ //当一个插件中出现使用内容分类时候需要设置code值,在页面引用时候容器id + code进行拼接
114
+ //data.params = Object.assign({}, data.params, {code: 'g_test_id'});
115
+ }
116
+
117
+ //获取返回参数(场景类型名称为必填)
118
+ let loading = XdBus.getParentApi('loading')({});
119
+
120
+ //获取显示内容
121
+ if (action === 'screen') {
122
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_bucket_content_tip'})
123
+ .then(res => {
124
+ loading.close();
125
+ data.cb(res['list'])
126
+ })
127
+ .catch(error => {
128
+ console.error(error);
129
+ loading.close();
130
+ });
131
+
132
+ }
133
+
134
+ //获取返回参数(广告位高度必选项)
135
+ if (action === 'getNewsInfo') {
136
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
137
+ .then(res => {
138
+ loading.close()
139
+ data.cb({list: res.list, selectId: res.selected})
140
+ })
141
+ .catch(error => {
142
+ loading.close()
143
+ console.error(error);
144
+ });
145
+ }
146
+
147
+ //获取产品业务线列表
148
+ if (action === 'namespace') {
149
+ XdBus.getParentApi('getOptionsNamespaces')({})
150
+ .then(res => {
151
+ loading.close()
152
+ data.cb(res['list'])
153
+ })
154
+ .catch(error => {
155
+ loading.close()
156
+ console.error(error);
157
+ });
158
+ }
159
+
160
+ //使用内容分类
161
+ if (action === 'cmsPublishEditxContent') {
162
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
163
+ .then(res => {
164
+ console.log('cmsPublishEditxContent', res)
165
+ loading.close();
166
+ data.cb(res)
167
+ })
168
+ .catch(error => {
169
+ loading.close();
170
+ console.error(error);
171
+ });
172
+ }
173
+
174
+ //位置列表
175
+ if (action === 'getListPostion') {
176
+ XdBus.getParentApi('getListNewsPosition')(data.params)
177
+ .then(res => {
178
+ loading.close();
179
+ data.cb(res)
180
+ })
181
+ .catch(error => {
182
+ loading.close();
183
+ console.error(error);
184
+ });
185
+ }
186
+
187
+ //位置创建
188
+ if (action === 'addPostion') {
189
+ XdBus.getParentApi('addNewsPosition')(data.params)
190
+ .then(res => {
191
+ loading.close();
192
+ data.cb(true)
193
+ })
194
+ .catch(error => {
195
+ console.error(error);
196
+ loading.close();
197
+ data.cb(false)
198
+ });
199
+ }
200
+
201
+ //位置编辑
202
+ if (action === 'editPostion') {
203
+ XdBus.getParentApi('updateNewsPosition')(data.params)
204
+ .then(res => {
205
+ loading.close();
206
+ data.cb(true)
207
+ })
208
+ .catch(error => {
209
+ console.error(error);
210
+ loading.close();
211
+ data.cb(false)
212
+ });
213
+ }
214
+
215
+ //位置删除
216
+ if (action === 'deleltePostion') {
217
+ XdBus.getParentApi('deleteNewsPosition')(data.params)
218
+ .then(res => {
219
+ loading.close();
220
+ data.cb(true)
221
+ })
222
+ .catch(error => {
223
+ console.error(error);
224
+ loading.close();
225
+ data.cb(false)
226
+ });
227
+ }
228
+
229
+ //获取广告位内容列表
230
+ if (action === 'getListContent') {
231
+ XdBus.getParentApi('getListNewsContent')(data.params)
232
+ .then(res => {
233
+ loading.close();
234
+ data.cb(res)
235
+ })
236
+ .catch(error => {
237
+ loading.close();
238
+ console.error(error);
239
+ });
240
+ }
241
+
242
+ //广告内容创建
243
+ if (action === 'addContent') {
244
+ XdBus.getParentApi('addNewsContent')(data.params)
245
+ .then(res => {
246
+ loading.close();
247
+ data.cb(true)
248
+ })
249
+ .catch(error => {
250
+ console.error(error);
251
+ loading.close();
252
+ data.cb(false)
253
+ });
254
+ }
255
+
256
+ //广告内容编辑
257
+ if (action === 'editContent') {
258
+ XdBus.getParentApi('updateNewsContent')(data.params)
259
+ .then(res => {
260
+ loading.close();
261
+ data.cb(true)
262
+ })
263
+ .catch(error => {
264
+ console.error(error);
265
+ loading.close();
266
+ data.cb(false)
267
+ });
268
+ }
269
+
270
+ //广告内容删除
271
+ if (action === 'deleteContent') {
272
+ XdBus.getParentApi('deleteNewsContent')(data.params)
273
+ .then(res => {
274
+ loading.close();
275
+ data.cb(true)
276
+ })
277
+ .catch(error => {
278
+ console.error(error);
279
+ loading.close();
280
+ data.cb(false)
281
+ });
282
+ }
283
+
284
+ //内容发布
285
+ if (action === 'publish') {
286
+ console.log('publish', data.params)
287
+ XdBus.getParentApi('cmsPublishContent')(data.params)
288
+ .then(res => {
289
+ loading.close();
290
+ data.cb(res)
291
+ })
292
+ .catch(error => {
293
+ loading.close();
294
+ console.error(error);
295
+ });
296
+ }
297
+
298
+ //通知页面进行刷新
299
+ if (action === 'update') {
300
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
301
+ loading.close()
302
+ }
303
+ },
304
+ inline: false,
305
+ notice: '',
306
+ rules: [
307
+ {required: true, message: '请配置温馨提示内容', trigger: 'change'},
308
+ ],
309
+ },
310
+ ],
311
+ };
@@ -0,0 +1,742 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-card-entry"
4
+ @click="handleEditxSelect"
5
+ :class="{
6
+ editx: isEditx && active,
7
+ noBorder: noBorder,
8
+ }"
9
+ >
10
+ <!--#ifdef H5-->
11
+ <view
12
+ class="jfb-base-card-entry__edit"
13
+ :class="{ editx: isEditx && active }"
14
+ v-if="isEditx && active && !noBorder"
15
+ >
16
+ <view class="jfb-base-card-entry__edit-icon" @click="delEdit">删除</view>
17
+ </view>
18
+ <!-- #endif -->
19
+ <view class="jfb-base-card-entry__body">
20
+ <view class="jfb-base-card-entry__body-cut">
21
+ <template v-if="isWx">
22
+ <view
23
+ class="jfb-base-card-entry__body-cut-item"
24
+ @click="handleScan"
25
+ :style="{
26
+ background: cutIndex === 1 ? mainColor : '#fff',
27
+ borderColor: mainColor,
28
+ color: cutIndex === 1 ? '#fff' : mainColor,
29
+ }"
30
+ >
31
+ <xd-font-icon
32
+ style="margin-bottom: 15rpx"
33
+ size="80"
34
+ icon="iconsaoma"
35
+ ></xd-font-icon>
36
+ <view>使用扫码绑定</view>
37
+ </view>
38
+ <view
39
+ class="jfb-base-card-entry__body-cut-item"
40
+ @click="handleToLink(bindUrl)"
41
+ :style="{
42
+ background: cutIndex === 2 ? mainColor : '#fff',
43
+ borderColor: mainColor,
44
+ color: cutIndex === 2 ? '#fff' : mainColor,
45
+ }"
46
+ >
47
+ <xd-font-icon
48
+ style="margin-bottom: 15rpx"
49
+ size="80"
50
+ icon="iconyuechi"
51
+ ></xd-font-icon>
52
+ <view>券号密码绑定</view>
53
+ </view>
54
+ </template>
55
+ <template v-else>
56
+ <view
57
+ class="jfb-base-card-entry__body-cut-item one"
58
+ @click="handleToLink(bindUrl)"
59
+ :style="{
60
+ background: cutIndex === 2 ? mainColor : '#fff',
61
+ borderColor: mainColor,
62
+ color: cutIndex === 2 ? '#fff' : mainColor,
63
+ }"
64
+ >
65
+ <xd-font-icon size="40" icon="iconyuechi"></xd-font-icon>
66
+ <view>券号密码绑定</view>
67
+ </view>
68
+ </template>
69
+ </view>
70
+ <view class="jfb-base-card-entry__body-line"></view>
71
+ <view
72
+ class="jfb-base-card-entry__body-notice"
73
+ :style="{ background: noticeBackgroundColor }"
74
+ v-if="notice"
75
+ >
76
+ <xd-notice-bar
77
+ :showIcon="true"
78
+ :scrollable="true"
79
+ :speed="20"
80
+ :fontSize="24"
81
+ :height="70"
82
+ :is-no-bgc="false"
83
+ >
84
+ <template>
85
+ <view v-html="notice"></view>
86
+ </template>
87
+ </xd-notice-bar>
88
+ </view>
89
+ <view
90
+ v-if="noticeStatus && isPreview && notice === ''"
91
+ class="jfb-base-card-entry__body-notice"
92
+ :style="{
93
+ background: noticeBackgroundColor,
94
+ textAlign: 'center',
95
+ color: dangerColor,
96
+ fontSize: 26 + 'rpx',
97
+ }"
98
+ >
99
+ 该组件未配置数据,因此改模块在正式环境将不显示</view
100
+ >
101
+ <view class="jfb-base-card-entry__body-tab">
102
+ <view
103
+ @click="tabIndex = 1"
104
+ :style="{
105
+ color: tabIndex === 1 ? '#fff' : '#B8B7BE',
106
+ background: tabIndex === 1 ? mainColor : '#fff',
107
+ }"
108
+ >已绑定票券</view>
109
+ <view
110
+ v-if="changeList.length > 0"
111
+ @click="tabIndex = 2"
112
+ :style="{
113
+ color: tabIndex === 2 ? '#fff' : '#B8B7BE',
114
+ background: tabIndex === 2 ? mainColor : '#fff',
115
+ }"
116
+ >
117
+ 可转换票券
118
+ </view>
119
+ </view>
120
+ <view
121
+ class="jfb-base-card-entry__body-tips"
122
+ :style="{ color: mainColor }"
123
+ v-if="tabIndex === 2"
124
+ >*目前仅支持电影票兑换券进行转换</view
125
+ >
126
+ <view
127
+ v-if="tabIndex === 2 || tabIndex === 1"
128
+ class="jfb-base-card-entry__body-card"
129
+ >
130
+ <template v-if="cardLayout === '1'">
131
+ <view
132
+ v-for="(item, index) in showList"
133
+ :key="index"
134
+ @click="handleBindLogin(item)"
135
+ class="jfb-base-card-entry__body-card-item"
136
+ >
137
+ <view class="jfb-base-card-entry__body-card-item-left">
138
+ <xd-font-icon
139
+ size="100"
140
+ :color="mainColor"
141
+ icon="iconyouhuiquan1-011"
142
+ ></xd-font-icon>
143
+ <view>{{ tabIndex === 1 ? login_name : "转换" }}</view>
144
+ </view>
145
+ <view class="jfb-base-card-entry__body-card-item-right">
146
+ <view class="jfb-base-card-entry__body-card-item-right-top">
147
+ <view>
148
+ <xd-font-icon
149
+ icon="iconkaquan"
150
+ size="38"
151
+ :style="{marginRight: '18rpx'}"
152
+ :color="mainColor"
153
+ ></xd-font-icon>
154
+ <view>{{ item.card_type_name }}</view>
155
+ </view>
156
+ <view>
157
+ <view>{{ item.card_number }}</view>
158
+ <view>有效期至:{{ item.end_time }}</view>
159
+ </view>
160
+ </view>
161
+ <view class="jfb-base-card-entry__body-card-item-right-bottom">
162
+ <view class="jfb-base-card-entry__body-card-item-right-bottom-info">
163
+ <view
164
+ class="jfb-base-card-entry__body-card-item-right-bottom-info-residue"
165
+ >
166
+ 剩余{{ item.unit }}数:{{ item.card_point }}{{ item.unit }}
167
+ </view>
168
+ <view
169
+ v-if="item.other_card_point && item.card_point_type !== 1"
170
+ class="jfb-base-card-entry__body-card-item-right-bottom-info-deduction"
171
+ >
172
+ 购买其他物品可抵:{{ item.other_card_point }}
173
+ </view>
174
+ </view>
175
+ <view
176
+ @click.stop="toDetail(item)"
177
+ :style="{ background: mainColor }"
178
+ >查看</view
179
+ >
180
+ </view>
181
+ </view>
182
+ </view>
183
+ </template>
184
+ <template v-else>
185
+ <xd-card-v2
186
+ :login-name="login_name"
187
+ v-for="(item, index) in showList"
188
+ :mainColor="mainColor"
189
+ :key="index"
190
+ :cardInfo="item"
191
+ :tabIndex="tabIndex"
192
+ @toDetail="toDetail(item)"
193
+ @bindLogin="handleBindLogin(item)">
194
+ </xd-card-v2>
195
+ </template>
196
+ </view>
197
+ <view v-if="showDisabled==='Y'" @click="handleToDisabled" class="jfb-base-card-entry__body-disabled">
198
+ 已失效票券>>>
199
+ </view>
200
+ </view>
201
+ <view class="jfb-base-card-entry__body-dialog" v-if="dialogEvent">
202
+ <view class="jfb-base-card-entry__body-dialog-content">
203
+ <image
204
+ class="jfb-base-card-entry__body-dialog-content-img"
205
+ alt=""
206
+ :src="popup"
207
+ ></image>
208
+ <xd-font-icon
209
+ icon="icondanchuangguanbi_xian"
210
+ width="52"
211
+ height="52"
212
+ size="26"
213
+ color="#fff"
214
+ class="jfb-base-card-entry-entry__body-dialog-content-close"
215
+ @click="dialogEvent = false"
216
+ ></xd-font-icon>
217
+ </view>
218
+ </view>
219
+ </view>
220
+ </template>
221
+
222
+ <script>
223
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
224
+ import XdButton from "@/components/XdButton/XdButton";
225
+ import XdCardV2 from "@/components/XdCardV2/XdCardV2";
226
+ import { jfbRootExec } from "@/utils/xd.event";
227
+ import JfbBaseCardEntryMixin from "./JfbBaseCardEntryMixin";
228
+ import componentsMixins from "@/mixins/componentsMixins";
229
+ import extsMixins from "@/mixins/extsMixins";
230
+ import { mapState, mapActions } from "vuex";
231
+ import { getContainerPropsValue, isWechat } from "@/utils/xd.base";
232
+ import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar";
233
+ import { Base64 } from "js-base64";
234
+ const Color = require("color");
235
+
236
+ export default {
237
+ name: "JfbBaseCardEntry",
238
+ components: {
239
+ XdFontIcon,
240
+ XdButton,
241
+ XdNoticeBar,
242
+ XdCardV2
243
+ },
244
+ mixins: [componentsMixins, extsMixins, JfbBaseCardEntryMixin],
245
+ computed: {
246
+ ...mapState({
247
+ jwxSDK: (state) => state.jwxSDK,
248
+ jfbAuthorize: (state) => state.jfbAuthorize,
249
+ }),
250
+ },
251
+ watch: {
252
+ tabIndex(newVal, oldVal) {
253
+ if (newVal === 1) {
254
+ this.showList = this.cardList;
255
+ } else {
256
+ this.showList = this.changeList;
257
+ }
258
+ },
259
+ container(value) {
260
+ this.init(value)
261
+ }
262
+ },
263
+ data() {
264
+ return {
265
+ //提示文案
266
+ noticeBackgroundColor: "",
267
+ notice: "",
268
+ isPreview: false,
269
+ noticeStatus: false,
270
+
271
+ isWx: true,
272
+ cutIndex: 1,
273
+ tabIndex: 1,
274
+ isBack: null, //是否使用返回键
275
+ cardList: [],
276
+ showList: [],
277
+ changeList: [],
278
+ disableList: [],
279
+ inCallback: null, //内部跳转地址
280
+
281
+ //页面跳转地址
282
+ login_name:'',//登陆文案
283
+ changeUrl: "",
284
+ bindUrl: "",
285
+ detailUrl: "",
286
+ confirmUrl: "",
287
+ allEntryPath: "", //综合福利入口页
288
+ disabledUrl: "",
289
+ cardLayout: "1", //票券布局
290
+
291
+ showDisabled: 'Y',
292
+
293
+ dialogEvent: false,
294
+ // is_show_change: false,
295
+ popup:
296
+ "https://img.zcool.cn/community/01784158abe781a801219c77e981ee.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100",
297
+ };
298
+ },
299
+ created() {
300
+ this.init(this.container);
301
+ this.noticeBackgroundColor = Color(this.warningColor).alpha(0.2).toString();
302
+ this.isPreview = this.$configProject.isPreview;
303
+
304
+
305
+ //#ifdef H5
306
+ this.isWx = isWechat();
307
+ if (!this.$configProject.isPreview) {
308
+ jfbRootExec("getH5WxAuthorize", {
309
+ vm: this,
310
+ data: {site_id: "wx_pub"},
311
+ })
312
+ .then()
313
+ .catch(error=>{
314
+ this.$xdAlert({
315
+ content: error,
316
+ });
317
+ })
318
+ }
319
+ // #endif
320
+
321
+ },
322
+ methods: {
323
+ init(container){
324
+ //设置
325
+ this.cardLayout = getContainerPropsValue(container,"content.cardLayout","1");
326
+ this.changeUrl = getContainerPropsValue(container,"content.change_url",{value: ""}).value;
327
+ this.disabledUrl = getContainerPropsValue(container,"content.disabled_url",{value: ""}).value;
328
+ this.bindUrl = getContainerPropsValue(container,"content.bind_url",{value: ""}).value;
329
+ this.detailUrl = getContainerPropsValue(container,"content.detail_url",{value: ""}).value;
330
+ this.confirmUrl = getContainerPropsValue(container,"content.confirm_url",{value: ""}).value;
331
+ this.allEntryPath = getContainerPropsValue(container,"content.allEntryPath",{value: ""}).value;
332
+ this.login_name = getContainerPropsValue(container, "content.login_name", "登录");
333
+ },
334
+ handleToLink(path) {
335
+ this.$xdUniHelper.navigateTo({
336
+ url: path,
337
+ });
338
+ },
339
+
340
+ getContent() {
341
+ jfbRootExec("getListBaseNewsContent", {
342
+ vm: this,
343
+ data: {
344
+ page_id: this.pageAttr["page_id"], //页面ID
345
+ container_id: this.containerId, //组件ID
346
+ limit: 1,
347
+ },
348
+ })
349
+ .then((res) => {
350
+ if (res.list.length > 0) {
351
+ this.notice = res.list[0].content;
352
+ this.noticeStatus = true;
353
+ }
354
+ })
355
+ .catch((error) => {
356
+ console.error(error);
357
+ });
358
+ },
359
+
360
+ /**
361
+ * @description 扫码绑定
362
+ */
363
+ handleScan() {
364
+ try {
365
+ //#ifdef H5
366
+ if (this.jwxSDK !== null) {
367
+ this.jwxSDK.scanQRCode({
368
+ needResult: 1,
369
+ scanType: ["qrCode"],
370
+ success: (res) => {
371
+ this.$xdUniHelper.navigateTo({
372
+ url: `${this.confirmUrl}?qrcode=${encodeURIComponent(
373
+ res.resultStr
374
+ )}`,
375
+ });
376
+ },
377
+ fail: (error) => {
378
+ if (typeof error === 'string') error = {error: error}
379
+ if (window['jwxJfbSDKParams']) error = Object.assign(error, window['jwxJfbSDKParams'])
380
+ this.$xdLog.setARMSError(error)
381
+ }
382
+ });
383
+ }
384
+ //#endif
385
+ //#ifdef MP-WEIXIN
386
+ uni.scanCode({
387
+ scanType: ["qrCode"],
388
+ success: (res) => {
389
+ this.$xdUniHelper.navigateTo({
390
+ url: `${this.confirmUrl}?qrcode=${encodeURIComponent(res.result)}`,
391
+ });
392
+ },
393
+ fail: (error) => {
394
+ this.$xdLog.setARMSError(error)
395
+ },
396
+ });
397
+ //#endif
398
+ } catch (err) {
399
+ this.$xdLog.setARMSError(err)
400
+ }
401
+ },
402
+
403
+ handleToDisabled() {
404
+ this.$xdUniHelper.navigateTo({
405
+ url: `${this.disabledUrl}`,
406
+ });
407
+ },
408
+
409
+ /**
410
+ * @description 已绑定卡登录
411
+ * @param item
412
+ */
413
+ handleBindLogin(item) {
414
+ if (this.tabIndex === 1) {
415
+ console.log("bindCardLogin", this.inCallback);
416
+
417
+ //无效卡
418
+ if (item["is_valid"] !== "Y") {
419
+ console.log(
420
+ item,
421
+ item["is_valid"],
422
+ item["is_valid"] !== "Y",
423
+ "itemitem"
424
+ );
425
+ return;
426
+ }
427
+ this.$xdShowLoading({});
428
+ jfbRootExec("loginCardBind", {
429
+ vm: this,
430
+ data: { card_number: item["card_number"] },
431
+ })
432
+ .then((res) => {
433
+ console.log(res);
434
+ this.$xdHideLoading();
435
+ //#ifdef MP-WEIXIN
436
+ if (this.jfbAuthorize !== null) {
437
+ this.jfbAuthorize.setToken("card", res["card_token"], {
438
+ expires: res["card_expire_in"] / 60 / 60,
439
+ });
440
+ }
441
+ //#endif
442
+
443
+ if (this.$configProject.isPreview) {
444
+ console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
445
+ } else {
446
+ this.$xdUniHelper.redirectTo({
447
+ url: this.inCallback,
448
+ });
449
+ }
450
+ })
451
+ .catch((res) => {
452
+ this.$xdHideLoading();
453
+ });
454
+ } else {
455
+ this.$xdUniHelper.navigateTo(
456
+ {
457
+ url: `${this.changeUrl}?card_number=${item["card_number"]}`,
458
+ },
459
+ false
460
+ );
461
+ }
462
+ },
463
+ toDetail(item) {
464
+ this.$xdUniHelper.navigateTo(
465
+ {
466
+ url: `${this.detailUrl}?card_number=${item["card_number"]}`,
467
+ },
468
+ false
469
+ );
470
+ },
471
+
472
+ onJfbLoad(options) {
473
+ let { inCallback } = options;
474
+ if (inCallback) {
475
+ this.$storage.set("inCallback", inCallback, 0.05);
476
+ inCallback = Base64.decode(inCallback);
477
+ } else {
478
+ inCallback = this.$storage.get("inCallback");
479
+ if (inCallback) {
480
+ inCallback = Base64.decode(inCallback);
481
+ }
482
+ }
483
+
484
+ //登陆成功调整地址优先级
485
+ this.inCallback = inCallback || this.allEntryPath || this.settings.index;
486
+ this.getContent();
487
+
488
+ this.getCardList(options);
489
+ },
490
+
491
+ getCardList(options) {
492
+ let params = {is_all: 'Y'};
493
+ if(options['jfb_business_code']) {
494
+ params['card_business_code'] = options['jfb_business_code'];
495
+ }
496
+ this.$xdShowLoading({});
497
+ jfbRootExec("getListCardBind", {
498
+ vm: this,
499
+ data: params
500
+ })
501
+ .then((res) => {
502
+ this.showDisabled = res.is_show_invalid_card_entrance;
503
+ res.list = res.list.map((item) => {
504
+ return {
505
+ ...item,
506
+ card_point: this.$xdUniHelper.divisionFloatNumber(
507
+ item.card_point,
508
+ 100
509
+ ),
510
+ other_card_point: this.$xdUniHelper.divisionFloatNumber(
511
+ item.other_card_point,
512
+ 100
513
+ ),
514
+ };
515
+ });
516
+ this.cardList = res.list.filter((item) => {
517
+ return item["is_valid"] === "Y";
518
+ });
519
+ this.disableList = res.list.filter((item) => {
520
+ return item["is_valid"] === "N";
521
+ });
522
+ this.changeList = this.cardList.filter((item) => {
523
+ return item["is_exchange"] === "Y";
524
+ });
525
+ this.showList = this.cardList;
526
+ this.$xdHideLoading();
527
+ })
528
+ .catch(() => this.$xdHideLoading());
529
+ },
530
+
531
+ onShow(options) {
532
+ this.onJfbLoad(options);
533
+ },
534
+
535
+ onJfbUpdate(data) {
536
+ this.getContent();
537
+ },
538
+
539
+ onJfbBack(options) {
540
+ this.$xdUniHelper.navigateBack();
541
+ },
542
+ },
543
+ };
544
+ </script>
545
+
546
+ <style scoped lang="less">
547
+ @import "./JfbBaseCardEntryLess.less";
548
+
549
+ .jfb-base-card-entry {
550
+ border: 1px dashed rgba(0, 0, 0, 0);
551
+ box-sizing: border-box;
552
+
553
+ &__body {
554
+ padding: unit(55, rpx) unit(35, rpx);
555
+ color: #333;
556
+
557
+ &-dialog {
558
+ position: fixed;
559
+ top: 0;
560
+ bottom: 0;
561
+ right: 0;
562
+ left: 0;
563
+ z-index: 9999;
564
+ background: rgba(0, 0, 0, 0.4);
565
+
566
+ &-content {
567
+ display: flex;
568
+ width: 100%;
569
+ height: 100%;
570
+ flex-direction: column;
571
+ justify-content: center;
572
+ align-items: center;
573
+
574
+ &-close {
575
+ margin-top: unit(20, rpx);
576
+ width: unit(52 / @scale, rpx);
577
+ height: unit(52 / @scale, rpx);
578
+ border: unit(5, rpx) solid #fff;
579
+ border-radius: 50%;
580
+ overflow: hidden;
581
+ }
582
+
583
+ &-img {
584
+ width: unit(680, rpx);
585
+ height: 80%;
586
+ border-radius: unit(20, rpx);
587
+ }
588
+ }
589
+ }
590
+
591
+ &-cut {
592
+ display: flex;
593
+ align-items: center;
594
+ justify-content: space-between;
595
+
596
+ &-item {
597
+ border: unit(6, rpx) solid;
598
+ font-size: unit(36, rpx);
599
+ color: #fe7a63ff;
600
+ border-radius: unit(16, rpx);
601
+ width: unit(308, rpx);
602
+ height: unit(182, rpx);
603
+ display: flex;
604
+ flex-direction: column;
605
+ align-items: center;
606
+ justify-content: center;
607
+
608
+ &.one {
609
+ width: 100%;
610
+ flex-direction: row;
611
+ height: unit(100, rpx);
612
+ align-items: center;
613
+ justify-content: center;
614
+
615
+ & > view {
616
+ font-size: unit(36, rpx);
617
+ margin-left: unit(10, rpx);
618
+ }
619
+ }
620
+ }
621
+ }
622
+
623
+ &-line {
624
+ width: 120%;
625
+ height: unit(4, rpx);
626
+ background: #eee;
627
+ margin: unit(60, rpx) unit(-35, rpx) 0 unit(-35, rpx);
628
+ }
629
+
630
+ &-notice {
631
+ margin: 0 unit(-35, rpx) 0 unit(-35, rpx);
632
+ padding: unit(22, rpx) unit(35, rpx);
633
+ line-height: unit(70, rpx);
634
+ }
635
+
636
+ &-tab {
637
+ display: flex;
638
+ align-items: center;
639
+ font-size: unit(28, rpx);
640
+ margin-bottom: unit(46, rpx);
641
+ margin-top: unit(46, rpx);
642
+
643
+ & > view {
644
+ // width: unit(214, rpx);
645
+ // height: unit(60, rpx);
646
+ padding: unit(5, rpx) unit(22, rpx);
647
+ text-align: center;
648
+ line-height: unit(60, rpx);
649
+ margin-right: unit(30, rpx);
650
+ border-radius: unit(60, rpx);
651
+ }
652
+ }
653
+
654
+ &-tips {
655
+ font-size: unit(20, rpx);
656
+ margin-bottom: unit(46, rpx);
657
+ }
658
+
659
+ &-card {
660
+ &-item {
661
+ display: flex;
662
+ align-items: center;
663
+ justify-content: flex-start;
664
+ border: unit(2, rpx) solid #eeeeee;
665
+ border-radius: unit(20, rpx);
666
+ margin-bottom: unit(30, rpx);
667
+ background: #fff;
668
+
669
+ &-left {
670
+ width: unit(200, rpx);
671
+ display: flex;
672
+ flex-direction: column;
673
+ align-items: center;
674
+ justify-content: center;
675
+ font-size: unit(24, rpx);
676
+ }
677
+
678
+ &-right {
679
+ flex: 1;
680
+ border-left: unit(2, rpx) solid #eeeeeeff;
681
+
682
+ &-top {
683
+ border-bottom: unit(2, rpx) solid #eeeeeeff;
684
+ padding: unit(30, rpx) unit(40, rpx);
685
+
686
+ & > view:nth-child(1) {
687
+ display: flex;
688
+ font-size: unit(28, rpx);
689
+ margin-bottom: unit(18, rpx);
690
+ }
691
+
692
+ & > view:nth-child(2) {
693
+ font-size: unit(24, rpx);
694
+ color: #666;
695
+
696
+ & > view:nth-child(1) {
697
+ margin-right: unit(30, rpx);
698
+ }
699
+ }
700
+ }
701
+
702
+ &-bottom {
703
+ display: flex;
704
+ justify-content: space-between;
705
+ align-items: center;
706
+ padding: unit(20, rpx) unit(40, rpx);
707
+
708
+ &-info {
709
+ &-residue {
710
+ font-size: unit(24, rpx);
711
+ margin-bottom: unit(8, rpx);
712
+ }
713
+
714
+ &-deduction {
715
+ font-size: unit(24, rpx);
716
+ color: #666;
717
+ }
718
+ }
719
+
720
+ & > view:nth-child(2) {
721
+ width: unit(80, rpx);
722
+ height: unit(40, rpx);
723
+ border-radius: unit(40, rpx);
724
+ font-size: unit(22, rpx);
725
+ color: #fff;
726
+ text-align: center;
727
+ line-height: unit(40, rpx);
728
+ padding: unit(5, rpx) unit(9, rpx);
729
+ }
730
+ }
731
+ }
732
+ }
733
+ }
734
+
735
+ &-disabled {
736
+ font-size: unit(28, rpx);
737
+ color: #b8b7be;
738
+ margin-bottom: unit(30, rpx);
739
+ }
740
+ }
741
+ }
742
+ </style>
@@ -0,0 +1,80 @@
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-entry {
16
+ border: 1px dashed rgba(0, 0, 0, 0);
17
+ box-sizing: border-box;
18
+ min-height: unit(100, rpx);
19
+
20
+ &__body{
21
+ position: relative;
22
+ overflow: hidden;
23
+ z-index: 2
24
+ }
25
+
26
+ &.editx {
27
+ position: relative;
28
+ border: 1px dashed blue;
29
+ box-sizing: border-box;
30
+ z-index: 3
31
+
32
+ }
33
+
34
+ &:hover {
35
+ border: 1px dashed blue;
36
+ }
37
+
38
+ &.noBorder {
39
+ border-color: rgba(0,0,0,0);
40
+ border-width: 0;
41
+ }
42
+
43
+
44
+ &__edit {
45
+ cursor: pointer;
46
+ position: absolute;
47
+ right: unit(0, rpx);
48
+ top: unit(-52, rpx);
49
+ height: unit(50, rpx);
50
+ line-height: unit(50, rpx);
51
+ display: flex;
52
+ justify-content: center;
53
+ align-items: center;
54
+ background: rgba(0, 0, 0, .6);
55
+ border-radius: unit(10, rpx);
56
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
57
+ color: #fff;
58
+ font-size: unit(22, rpx);
59
+
60
+ &-icon{
61
+ padding: 0 unit(20, rpx);
62
+ }
63
+
64
+ &.editx {
65
+ box-sizing: border-box;
66
+
67
+ }
68
+ }
69
+ }
70
+ //end
71
+
72
+
73
+ /**notPreview**/
74
+ .jfb-base-card-entry {
75
+ &:before {
76
+ content: " ";
77
+ display: table;
78
+ }
79
+ }
80
+ /**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-entry'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -0,0 +1,113 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ getListCardBind: {
5
+ "is_show_invalid_card_entrance": "Y",
6
+ "list": [{
7
+ "card_number": "101001000005195",
8
+ "card_point": 100000000,
9
+ "card_type_name": "聚福宝福卡测试蛋糕",
10
+ "unit": "点",
11
+ "end_time": "2024-10-31 23:59:59",
12
+ "is_valid": "Y",
13
+ "main_product_name": "",
14
+ "other_card_point": 0,
15
+ "is_exchange": "N"
16
+ }, {
17
+ "card_number": "101001000005193",
18
+ "card_point": 99963600,
19
+ "card_type_name": "聚福宝福卡测试蛋糕",
20
+ "unit": "次",
21
+ "end_time": "2024-10-31 23:59:59",
22
+ "is_valid": "Y",
23
+ "main_product_name": "",
24
+ "other_card_point": 0,
25
+ "is_exchange": "N"
26
+ }, {
27
+ "card_number": "101001000005184",
28
+ "card_point": 100000000,
29
+ "card_type_name": "聚福宝福卡测试蛋糕",
30
+ "unit": "",
31
+ "end_time": "2024-10-31 23:59:59",
32
+ "is_valid": "Y",
33
+ "main_product_name": "",
34
+ "other_card_point": 0,
35
+ "is_exchange": "N"
36
+ }, {
37
+ "card_number": "101001000005185",
38
+ "card_point": 99631000,
39
+ "card_type_name": "聚福宝福卡测试蛋糕",
40
+ "unit": "点",
41
+ "end_time": "2024-10-31 23:59:59",
42
+ "is_valid": "Y",
43
+ "main_product_name": "",
44
+ "other_card_point": 0,
45
+ "is_exchange": "N"
46
+ }, {
47
+ "card_number": "101001000006990",
48
+ "card_point": 1400,
49
+ "card_type_name": "聚福宝福卡测试蛋糕",
50
+ "unit": "",
51
+ "end_time": "2025-05-03 23:59:59",
52
+ "is_valid": "Y",
53
+ "main_product_name": "",
54
+ "other_card_point": 0,
55
+ "is_exchange": "N"
56
+ }, {
57
+ "card_number": "171004000000012",
58
+ "card_point": 0,
59
+ "card_type_name": "聚福宝测试C40",
60
+ "unit": "次",
61
+ "end_time": "2025-05-03 23:59:59",
62
+ "is_valid": "Y",
63
+ "main_product_name": "",
64
+ "other_card_point": 0,
65
+ "is_exchange": "Y"
66
+ }, {
67
+ "card_number": "101001000006989",
68
+ "card_point": 3600,
69
+ "card_type_name": "聚福宝福卡测试蛋糕",
70
+ "unit": "",
71
+ "end_time": "2025-05-03 23:59:59",
72
+ "is_valid": "Y",
73
+ "main_product_name": "",
74
+ "other_card_point": 0,
75
+ "is_exchange": "N"
76
+ }, {
77
+ "card_number": "171004000000011",
78
+ "card_point": 0,
79
+ "card_type_name": "聚福宝测试C40",
80
+ "unit": "次",
81
+ "end_time": "2025-05-03 23:59:59",
82
+ "is_valid": "Y",
83
+ "main_product_name": "",
84
+ "other_card_point": 0,
85
+ "is_exchange": "Y"
86
+ }, {
87
+ "card_number": "101001000005479",
88
+ "card_point": 10000000,
89
+ "card_type_name": "聚福宝福卡测试蛋糕",
90
+ "unit": "点",
91
+ "end_time": "2024-02-03 23:59:59",
92
+ "is_valid": "Y",
93
+ "main_product_name": "",
94
+ "other_card_point": 0,
95
+ "is_exchange": "N"
96
+ }, {
97
+ "card_number": "101001000005478",
98
+ "card_point": 1000000,
99
+ "card_type_name": "聚福宝福卡测试蛋糕",
100
+ "unit": "点",
101
+ "end_time": "2024-02-23 23:59:59",
102
+ "is_valid": "Y",
103
+ "main_product_name": "",
104
+ "other_card_point": 0,
105
+ "is_exchange": "N"
106
+ }], "request_id": "dd73b058e5de1e90"
107
+ },
108
+ loginCardBind: {
109
+ "card_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhM2U4YjQ5OWEwNzUwN2EyIiwiaWF0IjoxNjc0OTYzODE3LjY2OTM1MywiZXhwIjoxNjc1MDIwNTc3LjY2OTM1MywiY2FyZF9udW1iZXIiOiIxMDEwMDEwMDAwMDUxOTUiLCJjYXJkX3R5cGVfbmFtZSI6IjZJR2E1NmFQNWE2ZDU2YVA1WTJoNXJXTDZLK1Y2SnVMNTdPViIsInByaWNlIjoxMDAsIm9ubGluZV9wcmljZSI6MTAwLCJ1c2Vfc2NlbmNlIjozLCJidXNpbmVzc19jb2RlcyI6IjAsMSwyLDMsNCJ9.LsoBJq4pC_gSc1jZRwDhD2rAfOf1DMCy29VHomGiqYE",
110
+ "card_expire_in": 56760,
111
+ "request_id": "8fde2506c426a55d"
112
+ },
113
+ }