jufubao-base 1.0.298 → 1.0.300

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.298",
3
+ "version": "1.0.300",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -1,108 +1,20 @@
1
1
  'use strict';
2
+ import style from "./cusAttr/style";
3
+ import advanced from "./cusAttr/advanced";
4
+ import content from "./cusAttr/content";
2
5
 
3
6
  /**
4
7
  * @description 当表单组件中有联动操作时候,使用方法进行返回
5
8
  */
6
9
  export default {
7
10
  style: [],
8
- content: (data) => {
11
+ advanced: [],
12
+ content: (data, gValue, gColor, oldData={})=>{
13
+
9
14
  return [
10
- {
11
- label: "是否展示优先支付账户:",
12
- ele: "xd-radio",
13
- valueKey: "isShowPaySoft",
14
- value: data.isShowPaySoft || "N",
15
- groupKey: "content",
16
- list: [
17
- { label: "展示", value: "Y" },
18
- { label: "不展示", value: "N" }
19
- ]
20
- },
21
- {
22
- label: '背景图片:', //label
23
- ele: 'xd-upload', //package 名称
24
- valueKey: 'bodyBgImg', //form[valueKey]
25
- value: data.bodyBgImg || null, //v-model
26
- defaultValue: data.bodyBgImg || null, //默认图片对象
27
- groupKey: "content",
28
- slot: true, //按钮是否使用slot
29
- oneWidth: 200, //单个图片显示宽度
30
- oneHeight: 350, //单个图片显示高度
31
- elinputClassName: 'input40',
32
- tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
33
- type: ['jpg', 'png', 'jpeg'],
34
- styleType: 'one', //其值:one=>单文件上传 auth=>证件正反面上传 list=>多文件上传
35
- uploadType: 'aliyun', //''=>API服务上传 qiniu=>七牛云OSS上传 aliyun=> 阿里云OSS上传
36
- size: 5, //5M
37
- action: 'aliyun',
38
- sort: true, //当上传图片列表时候,是否启用排序
39
- maxlen: 100, //当上传图片列表时候,最大数量数量
40
- rules: [
41
- { required: true, message: '请上传图片', trigger: ['blur', 'change'] },
42
- ]
43
- },
44
- {
45
- label: '开通路径:',
46
- groupKey:'advanced',
47
- className: 'input100',
48
- ele: 'xd-select-pages-path',
49
- valueKey: 'openPath',
50
- value: data['openPath'] || null,
51
- setting: {
52
- router: XdBus.getParentApi('getPagesTree')
53
- },
54
- },
55
- {
56
- label: '切换门店路径:',
57
- groupKey:'advanced',
58
- className: 'input100',
59
- ele: 'xd-select-pages-path',
60
- valueKey: 'shopPath',
61
- value: data['shopPath'] || null,
62
- setting: {
63
- router: XdBus.getParentApi('getPagesTree')
64
- },
65
- },
66
- {
67
- label: '支付成功跳转路径:',
68
- ele: 'xd-select-pages-path',
69
- valueKey: 'successPath',
70
- value: data.successPath || null,
71
- placeholder: '请选择支付成功跳转路径',
72
- className: 'input100',
73
- groupKey:'advanced',
74
- setting: {
75
- router: XdBus.getParentApi('getPagesTree')
76
- },
77
- inline: false,
78
- },
79
- {
80
- label: '核销支付路径:',
81
- ele: 'xd-select-pages-path',
82
- valueKey: 'cash_pay_path',
83
- placeholder: '请选择核销支付路径',
84
- value: data.cash_pay_path || null,
85
- className: 'input100',
86
- groupKey:'advanced',
87
- setting: {
88
- router: XdBus.getParentApi('getPagesTree')
89
- },
90
- inline: false,
91
- },
92
- {
93
- label: '选取城市路径:',
94
- ele: 'xd-select-pages-path',
95
- valueKey: 'cityPath',
96
- placeholder: '请选择选取城市路径',
97
- value: data.cityPath || null,
98
- className: 'input100',
99
- groupKey:'advanced',
100
- setting: {
101
- router: XdBus.getParentApi('getPagesTree')
102
- },
103
- inline: false,
104
- },
15
+ ...content(data, gValue,gColor,oldData),
16
+ ...style(data, gValue,gColor,oldData),
17
+ ...advanced(data),
105
18
  ].filter(i=>i)
106
19
  },
107
- advanced: [],
108
20
  };
@@ -0,0 +1,176 @@
1
+ 'use strict';
2
+ import { jfbRootExec } from "@/utils/xd.event";
3
+ export default {
4
+ data() {
5
+ return {
6
+ settle_tag_list: [],
7
+ settle_tag_list_status: false,
8
+ tag_id: "",
9
+ price: "",
10
+ total_price: "",
11
+ num: 1,
12
+ }
13
+ },
14
+ computed: {
15
+ curTag() {
16
+ return this.settle_tag_list.find(item => item.value === this.tag_id) || {}
17
+ },
18
+ curTagPrice() {
19
+ const curTag = this.curTag;
20
+ if (this.$xdUniHelper.isEmpty(curTag)) return 0;
21
+ if (curTag.is_static_price) {
22
+ return curTag.price_yuan;
23
+ } else {
24
+ return this.total_price;
25
+ }
26
+ },
27
+ },
28
+ methods: {
29
+ // 核销金额输入框事件
30
+ handlerPrice(e) {
31
+ this.$nextTick(() => {
32
+ this.total_price = e.detail.value.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1');
33
+ if (this.total_price > 10000) {
34
+ this.total_price = 10000
35
+ uni.showToast(
36
+ {
37
+ title: '核销金额不能超过10000',
38
+ icon: 'none'
39
+ }
40
+ )
41
+ }
42
+ })
43
+ },
44
+ //选卡弹出项
45
+ useCardPop(data) {
46
+ return new Promise((resolve, reject) => {
47
+ uni.showModal({
48
+ title: '提示',
49
+ content: data.msg,
50
+ // confirmText: data.confirm_text,
51
+ // cancelText: data.cancel_text,
52
+ success: function (res) {
53
+ if (res.confirm) {
54
+ resolve(2);
55
+ } else if (res.cancel) {
56
+ resolve();
57
+ }
58
+ },
59
+ fail: function (res) {
60
+ reject(res);
61
+ }
62
+ });
63
+ })
64
+ },
65
+ //聚好兑 - 创建临时订单数据,并跳转支付页面
66
+ toPayOrder(options = {}) {
67
+ let { tag_id, total_price, curTag, num = 1, shop_id } = this;
68
+ let err_tip = "";
69
+ if (!curTag.is_static_price) this.price = total_price;
70
+ if (curTag.is_static_price) {
71
+ if (total_price > 10000) {
72
+ err_tip = '金额不能超过10000'
73
+ }
74
+ }
75
+ let price = this.price;
76
+ if (!price) err_tip = "请填写正确的提货金额";
77
+ if (!tag_id) err_tip = "请选择结算标签";
78
+ if (err_tip) {
79
+ uni.showToast({
80
+ title: err_tip,
81
+ icon: 'none'
82
+ });
83
+ return false;
84
+ }
85
+ if (this.total_price == 0) {
86
+ uni.showToast(
87
+ {
88
+ title: '核销金额不能为0',
89
+ icon: 'none'
90
+ }
91
+ )
92
+ return
93
+ }
94
+ jfbRootExec("addConsumpCashierTempOrderData", {
95
+ vm: this,
96
+ data: {
97
+ shop_id: this.shop_id,
98
+ settle_tag_id: this.tag_id,
99
+ num: this.num,
100
+ settle_tag_price: this.curTagPrice,
101
+ total_price: this.total_price,
102
+ ...options
103
+ }
104
+ })
105
+ .then(res => {
106
+ if (res.confirm_notice) {
107
+ return this.useCardPop(res).then(data => {
108
+ if (data == 2) {
109
+ this.toPayOrder({
110
+ is_ignore_unique_check: "Y"
111
+ })
112
+ }
113
+ })
114
+ } else {
115
+ this.price = "";
116
+ let params = {
117
+ ...this.options,
118
+ price: price,
119
+ num: num,
120
+ tag: tag_id,
121
+ shop_id: shop_id,
122
+ cart_order_id: res.cart_order_id
123
+ };
124
+ params = this.$xdUniHelper.jsonToParams(params)
125
+ this.$xdUniHelper.navigateTo({
126
+ url: this.cashPayPath + `?${params}`
127
+ })
128
+ }
129
+ })
130
+ .catch(error => {
131
+ console.error(error);
132
+ })
133
+ },
134
+ //固定标签数量变化
135
+ handleNumberChange(num) {
136
+ let curTag = this.curTag;
137
+ this.total_price = this.$xdUniHelper.multiplyFloatNumber(curTag.price_yuan, num);
138
+ },
139
+ //选择核销标签
140
+ handlerTagRadio(item) {
141
+ this.tag_id = item.value;
142
+ this.canEdit = !item.is_static_price;
143
+ this.num = 1;
144
+ if (item.is_static_price) {
145
+ this.total_price = item.price_yuan
146
+ this.price = item.price_yuan
147
+ } else {
148
+ this.total_price = "";
149
+ this.price = "";
150
+ }
151
+ },
152
+ //门店核销 - 展示主界面数据 - 核销标签列表
153
+ getSettleTagList() {
154
+ this.$xdShowLoading({});
155
+
156
+ jfbRootExec("getConsumpSettleMainInfo", {
157
+ vm: this,
158
+ data: {
159
+ shop_id: this.shop_id,
160
+ }
161
+ }).then(res => {
162
+ this.$xdHideLoading();
163
+ const { settle_tag_list } = res;
164
+ this.settle_tag_list = settle_tag_list;
165
+ if (settle_tag_list.length > 0) {
166
+ this.handlerTagRadio(settle_tag_list[0]);
167
+ this.settle_tag_list_status = false;
168
+ }
169
+ else this.settle_tag_list_status = true;
170
+ }).catch(err => {
171
+ this.$xdHideLoading();
172
+ this.$xdLog.catch(error)
173
+ })
174
+ },
175
+ }
176
+ }