@smart100/spu-web-plugin 0.0.30 → 0.0.31
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/dist/spu-web-plugin.mjs +22 -3
- package/package.json +2 -2
- package/src/utils.ts +5 -1
package/dist/spu-web-plugin.mjs
CHANGED
|
@@ -708,7 +708,7 @@ function _toPropertyKey$1(arg) {
|
|
|
708
708
|
return typeof key === "symbol" ? key : String(key);
|
|
709
709
|
}
|
|
710
710
|
|
|
711
|
-
var version = "0.0.
|
|
711
|
+
var version = "0.0.31";
|
|
712
712
|
|
|
713
713
|
/** Detect free variable `global` from Node.js. */
|
|
714
714
|
var freeGlobal$2 = typeof global == 'object' && global && global.Object === Object && global;
|
|
@@ -12106,6 +12106,7 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
|
|
|
12106
12106
|
_this.type = ''; // userName | departmentName
|
|
12107
12107
|
_this.mode = 'close'; // open | close
|
|
12108
12108
|
_this._isCanUseWxworkSuite = true;
|
|
12109
|
+
_this._topWWOpenData = null;
|
|
12109
12110
|
return _this;
|
|
12110
12111
|
}
|
|
12111
12112
|
_createClass(WxworksuiteBaseOpendata, [{
|
|
@@ -12129,10 +12130,15 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
|
|
|
12129
12130
|
_this2._isCanUseWxworkSuite = true;
|
|
12130
12131
|
if (_this2.wwopendataRef) {
|
|
12131
12132
|
if (topWWOpenData) {
|
|
12133
|
+
_this2._topWWOpenData = topWWOpenData;
|
|
12132
12134
|
topWWOpenData.bind(_this2.wwopendataRef);
|
|
12133
12135
|
// topWWOpenData.on('update', (event: any) => {
|
|
12134
12136
|
// const openid = event.detail.element.getAttribute('openid')
|
|
12135
12137
|
// console.log('渲染数据发生变更', event, openid)
|
|
12138
|
+
// if (this.type === 'departmentName') {
|
|
12139
|
+
// console.log('渲染数据发生变更', event)
|
|
12140
|
+
// console.log('渲染数据发生变更', openid)
|
|
12141
|
+
// }
|
|
12136
12142
|
// })
|
|
12137
12143
|
topWWOpenData.on('error', function (event) {
|
|
12138
12144
|
// console.error('获取数据失败', event)
|
|
@@ -12154,7 +12160,19 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
|
|
|
12154
12160
|
return _connectedCallback.apply(this, arguments);
|
|
12155
12161
|
}
|
|
12156
12162
|
return connectedCallback;
|
|
12157
|
-
}()
|
|
12163
|
+
}()
|
|
12164
|
+
}, {
|
|
12165
|
+
key: "updated",
|
|
12166
|
+
value: function updated(changedProperties) {
|
|
12167
|
+
// 页面在浏览器,在 iOS,Mac,Android 上面的企业微信都表现正常,但是在 windows 企业微信下,会偶发不能渲染通讯录控件内容
|
|
12168
|
+
// 解答:由于 企业微信的 windows 客户端浏览器内核不支持 customElements,每次更新了 open-data 元素后,需要用 bind 或者 bindAll 接口对目标元素进行一次更新,这样才能保证 open-data 元素实时渲染正确的数据。遇到上面的情况,请检查一下页面代码,看看有没有可能出现时序问题:先执行了 bind,然后才渲染出对应的 open-data 元素
|
|
12169
|
+
if (changedProperties.has('openid')) {
|
|
12170
|
+
if (this.wwopendataRef && this._isCanUseWxworkSuite && this._topWWOpenData) {
|
|
12171
|
+
this._topWWOpenData.bind(this.wwopendataRef);
|
|
12172
|
+
}
|
|
12173
|
+
}
|
|
12174
|
+
}
|
|
12175
|
+
// private test (e: Event) {
|
|
12158
12176
|
// // console.log(this.shadowRoot)
|
|
12159
12177
|
// // console.log(this.renderRoot)
|
|
12160
12178
|
// // console.log(this.shadowRoot?.querySelector('#aaaa'))
|
|
@@ -12213,7 +12231,7 @@ var WxworksuiteBaseOpendata = /*#__PURE__*/function (_LitElement) {
|
|
|
12213
12231
|
}(s$1);
|
|
12214
12232
|
_class$7 = WxworksuiteBaseOpendata;
|
|
12215
12233
|
_class$7.componentName = 'wxworksuite-base-opendata';
|
|
12216
|
-
_class$7.styles = i$4(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["
|
|
12234
|
+
_class$7.styles = i$4(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral([""])));
|
|
12217
12235
|
__decorate([n$1({
|
|
12218
12236
|
type: String
|
|
12219
12237
|
})], WxworksuiteBaseOpendata.prototype, "openid", void 0);
|
|
@@ -12224,6 +12242,7 @@ __decorate([n$1({
|
|
|
12224
12242
|
type: String
|
|
12225
12243
|
})], WxworksuiteBaseOpendata.prototype, "mode", void 0);
|
|
12226
12244
|
__decorate([r$1()], WxworksuiteBaseOpendata.prototype, "_isCanUseWxworkSuite", void 0);
|
|
12245
|
+
__decorate([r$1()], WxworksuiteBaseOpendata.prototype, "_topWWOpenData", void 0);
|
|
12227
12246
|
|
|
12228
12247
|
/**
|
|
12229
12248
|
* @license
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart100/spu-web-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npm run build:types && rollup -c -w",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
41
|
-
"@smart100/wxworksuite-plugin": "^0.0.
|
|
41
|
+
"@smart100/wxworksuite-plugin": "^0.0.10",
|
|
42
42
|
"axios": "^1.6.0",
|
|
43
43
|
"co": "^4.6.0",
|
|
44
44
|
"dayjs": "^1.11.10",
|
package/src/utils.ts
CHANGED
|
@@ -31,7 +31,7 @@ const setTitle = (pagetitle?: string) => {
|
|
|
31
31
|
|
|
32
32
|
// 父级spu容器 且 是web或者h5引擎
|
|
33
33
|
if (window.top !== window) {
|
|
34
|
-
const topWin = window.top
|
|
34
|
+
const topWin: any = window.top
|
|
35
35
|
topWin.document.title = pagetitle
|
|
36
36
|
|
|
37
37
|
// 如果是在h5引擎内 且 h5引擎也作为spu被放置在app内
|
|
@@ -42,6 +42,10 @@ const setTitle = (pagetitle?: string) => {
|
|
|
42
42
|
window?.Native?.setNavigationBarTitle && window.Native.setNavigationBarTitle(pagetitle)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
|
|
46
|
+
// const inWhichSPU = () => {
|
|
47
|
+
// }
|
|
48
|
+
|
|
45
49
|
export {
|
|
46
50
|
isIOS,
|
|
47
51
|
getUniqueid,
|