jufubao-third 1.0.23-beta1 → 1.0.23-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.
@@ -0,0 +1,12 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(node -e ' *)",
5
+ "Bash(npx esbuild *)",
6
+ "Bash(npx vue-template-compiler *)",
7
+ "Bash(node -e \"const fs=require\\('fs'\\);const compiler=require\\('/Users/zxd/Workspaces/jufubao-third/node_modules/@vue/compiler-sfc'\\);const {parse,compileTemplate}=compiler;const r=parse\\(fs.readFileSync\\('/Users/zxd/Workspaces/jufubao-third/src/components/JfbThirdRideLand/JfbThirdRideLand.vue','utf8'\\)\\);const t=compileTemplate\\({source:r.descriptor.template.content,filename:'x.vue'}\\);console.log\\(t.errors.length===0?'Vue template OK':'ERR '+JSON.stringify\\(t.errors\\)\\)\")",
8
+ "Bash(node *)",
9
+ "Bash(grep -i \"^vue$\")"
10
+ ]
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-third",
3
- "version": "1.0.23-beta1",
3
+ "version": "1.0.23-beta4",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件第三方购物平台包",
6
6
  "main": "index.js",
@@ -0,0 +1,100 @@
1
+ 'use strict';
2
+
3
+ import {dataVal,getAttrPathMsg} from "@/utils/AttrTools";
4
+
5
+ /**
6
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
7
+ */
8
+ export default {
9
+ style: [],
10
+ content: (data={},gValue={},gColor={},oldData) => {
11
+ const cashierURL = getAttrPathMsg(data , 'cashierURL', '收银台');
12
+ return [
13
+ //===base=========
14
+ {
15
+ ele: 'title',
16
+ label: '基础',
17
+ size: 'small',
18
+ groupKey:'content',
19
+ },
20
+ {
21
+ label: '渠道配置',
22
+ ele: 'xd-site-select-list',
23
+ labelInline: true,
24
+ valueKey: 'channelApi',
25
+ value: dataVal({data, key:'channelApi', dValue:'', gValue}),
26
+ placeholder: '请选择渠道配置',
27
+ multiple: false,
28
+ className: 'input100',
29
+ groupKey:'content',
30
+ handleCustom({action, data}) {
31
+ XdBus.getParentApi('getOptionsSettingList')({
32
+ setting_id: 'third_channels_webhook',
33
+ key: Date.now()
34
+ })
35
+ .then(res => {
36
+ data.cb(res.list)
37
+ })
38
+ .catch(error => {
39
+ console.error(error);
40
+ });
41
+ },
42
+ rules: [
43
+ {
44
+ required: false,
45
+ validator: (rule, value, callback) => {
46
+ if(!value) callback('请选择渠道配置')
47
+ else callback()
48
+ },
49
+ trigger: 'blur'
50
+ }
51
+ ],
52
+ },
53
+ {
54
+ label: '',
55
+ ele: 'el-input',
56
+ type: 'text',
57
+ groupKey: 'content',
58
+ valueKey: 'channelApiBase',
59
+ value: 'v2.0',
60
+ hidden: true,
61
+ },
62
+
63
+ //===advanced=========
64
+ {
65
+ label: cashierURL.label,
66
+ ele: 'xd-select-pages-path',
67
+ valueKey: cashierURL['key'],
68
+ groupKey:'advanced',
69
+ placeholder: cashierURL.hold,
70
+ value: cashierURL.path,
71
+ labelInline:true,
72
+ className: 'input100',
73
+ setting: {
74
+ mode:'new',
75
+ router: XdBus.getParentApi('getPagesTree'),
76
+ },
77
+ inline: false,
78
+ },
79
+ {
80
+ label: '版本号:',
81
+ ele: 'el-input',
82
+ type: 'text',
83
+ groupKey: 'advanced',
84
+ valueKey: 'version',
85
+ value: 'v2.0',
86
+ hidden: true,
87
+ },
88
+ {
89
+ label: '过滤引用模版字段:',
90
+ ele: 'el-input',
91
+ type: 'text',
92
+ groupKey: 'advanced',
93
+ valueKey: 'refFilterKey',
94
+ value: '[]',
95
+ hidden: true,
96
+ },
97
+ ].filter(i=>i)
98
+ },
99
+ advanced: [],
100
+ };
@@ -0,0 +1,156 @@
1
+ <template>
2
+ <view
3
+ class="jfb-third-open-embedded-mp"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-third-open-embedded-mp__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-third-open-embedded-mp__edit-icon" @click.stop="delEdit">
14
+ <xd-font-icon icon="iconshanchu-01" color="#fff" size="30"></xd-font-icon>
15
+ </view>
16
+ </view>
17
+ <!-- #endif -->
18
+ <view class="jfb-third-open-embedded-mp__body">
19
+ <view class="pop" :style="[noDataStyleComp]">开启半屏小程序中转组件便编辑(占位),在线上此模块不显</view>
20
+ </view>
21
+ </view>
22
+ </template>
23
+
24
+ <script>
25
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
26
+ import JfbThirdOpenEmbeddedMpMixin from "./JfbThirdOpenEmbeddedMpMixin";
27
+ import { gCPVal } from "@/utils/xd.base";
28
+ import componentsMixins from "@/mixins/componentsMixins";
29
+ import extsMixins from "@/mixins/extsMixins";
30
+ import {mapState,mapMutations} from "vuex";
31
+ import {getNoUrl} from "@/utils/nourl";
32
+ import Color from "color";
33
+
34
+ export default {
35
+ name: "JfbThirdOpenEmbeddedMp",
36
+ components: {
37
+ XdFontIcon
38
+ },
39
+ mixins: [
40
+ componentsMixins, extsMixins, JfbThirdOpenEmbeddedMpMixin
41
+ ],
42
+ data() {
43
+ return {
44
+ backgroundColor: '',//提示信息背景
45
+ isPreview: false,
46
+
47
+ //基础
48
+ channelApi:'',
49
+
50
+
51
+ //高级
52
+ cashierURL:'',
53
+ }
54
+ },
55
+ computed:{
56
+ ...mapState(['extraData']),
57
+
58
+ noDataStyleComp(){
59
+ let height = '66rpx';
60
+ if(!this.isPreview) height = 0;
61
+ return {
62
+ backgroundColor:this.backgroundColor,
63
+ color:this.warningColor,
64
+ minHeight: height,
65
+ textAlign: 'center',
66
+ lineHeight: height,
67
+ fontSize: '24rpx',
68
+ padding: '16rpx',
69
+ overflow: 'hidden'
70
+ }
71
+ },
72
+
73
+ apiUrlComp(){
74
+ let urlObj = this.channelApi.split('@@');
75
+ let url = urlObj[0];
76
+ let method = urlObj[1] || 'get';
77
+ return {url,method}
78
+ }
79
+ },
80
+ watch: {
81
+ container(value, oldValue) {
82
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
83
+ if (this.$configProject['isPreview']) this.init(value)
84
+ },
85
+ extraData:{
86
+ deep: true,
87
+ handler(value){
88
+ this.requestApi(value)
89
+ }
90
+ }
91
+ },
92
+ created() {
93
+ this.backgroundColor = Color(this.warningColor).alpha(0.2).toString();
94
+ this.isPreview = this.$configProject['isPreview'];
95
+
96
+ this.init(this.container);
97
+ },
98
+ methods: {
99
+ ...mapMutations(['setExtraData']),
100
+
101
+ /**
102
+ * @description 请求三方接口
103
+ */
104
+ requestApi(params){
105
+ //if(this.isPreview ) return;
106
+ this.$xdShowLoading({});
107
+ let {url ,method} = this.apiUrlComp;
108
+ let apiParams = { url };
109
+ if(method === 'get') apiParams.params = params;
110
+ else apiParams.data = params;
111
+
112
+ //打包模式
113
+ getNoUrl(apiParams)
114
+ .then(res => {
115
+ //处理返回数据
116
+ // debugger
117
+ this.$xdUniHelper.navigateTo({
118
+ url: this.cashierURL + `?main_order_id=${res.main_order_id}`
119
+ })
120
+ })
121
+ .catch(error => {
122
+ debugger
123
+ console.log(error)
124
+ });
125
+
126
+ },
127
+
128
+ /**
129
+ * @description 监听事件变化
130
+ * @param container {object} 业务组件对象自己
131
+ */
132
+ init(container) {
133
+ this.channelApi = gCPVal(container, 'channelApi', '');
134
+ this.cashierURL = gCPVal(container, 'cashierURL', {value: 'cashierURL'}).value;
135
+ },
136
+
137
+ onJfbLoad(){
138
+ // setTimeout(()=>{
139
+ // this.setExtraData({a:1,b:2});
140
+ // }, 2000)
141
+ }
142
+
143
+ }
144
+ }
145
+
146
+ </script>
147
+
148
+ <style scoped lang="less">
149
+ @import "./JfbThirdOpenEmbeddedMpLess.less";
150
+
151
+ .jfb-third-open-embedded-mp {
152
+ &__body{
153
+
154
+ }
155
+ }
156
+ </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-third-open-embedded-mp {
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: var(--preview-z-index);
37
+ cursor: pointer;
38
+ }
39
+
40
+ }
41
+
42
+
43
+ &__edit {
44
+ cursor: pointer;
45
+ position: absolute;
46
+ right: unit(0, rpx);
47
+ top: unit(0, rpx);
48
+ height: unit(50, rpx);
49
+ z-index: 100;
50
+ display: flex;
51
+ justify-content: center;
52
+ align-items: center;
53
+ background: rgba(0, 0, 0, .4);
54
+ border-radius: 0 0 0 20rpx;
55
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
56
+ color: #fff;
57
+ font-size: unit(22, rpx);
58
+ padding: 0 6rpx 0 6px;
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-third-open-embedded-mp {
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-third-open-embedded-mp'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }