Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev
This commit is contained in:
commit
6546a74f03
|
|
@ -1132,18 +1132,17 @@ exports.loginWechatMp = loginWechatMp;
|
|||
* @param context
|
||||
*/
|
||||
function syncUserInfoWechatMp(_a, context) {
|
||||
var _b, _c, _d;
|
||||
var nickname = _a.nickname, avatarUrl = _a.avatarUrl, encryptedData = _a.encryptedData, iv = _a.iv, signature = _a.signature;
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
var userId, application, _b, _c, sessionKey, user, _d, originNickname, extraFile$entity, updateData, extraFileOperations, _e, _f, _g, _h, _j;
|
||||
var _k, _l, _m;
|
||||
return tslib_1.__generator(this, function (_o) {
|
||||
switch (_o.label) {
|
||||
case 0: return [4 /*yield*/, context.getToken()];
|
||||
case 1:
|
||||
userId = (_o.sent()).userId;
|
||||
return [4 /*yield*/, context.getApplication()];
|
||||
case 2:
|
||||
application = _o.sent();
|
||||
var userId, application, config, _e, _f, sessionKey, user, _g, originNickname, extraFile$entity, updateData, extraFileOperations, _h, _j, _k, _l, _m, _o, _p;
|
||||
var _q, _r, _s, _t;
|
||||
return tslib_1.__generator(this, function (_u) {
|
||||
switch (_u.label) {
|
||||
case 0:
|
||||
userId = context.getToken().userId;
|
||||
application = context.getApplication();
|
||||
config = ((_b = application === null || application === void 0 ? void 0 : application.system) === null || _b === void 0 ? void 0 : _b.config) || ((_d = (_c = application === null || application === void 0 ? void 0 : application.system) === null || _c === void 0 ? void 0 : _c.platform) === null || _d === void 0 ? void 0 : _d.config);
|
||||
return [4 /*yield*/, context.select('wechatUser', {
|
||||
data: {
|
||||
id: 1,
|
||||
|
|
@ -1163,6 +1162,8 @@ function syncUserInfoWechatMp(_a, context) {
|
|||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: 'avatar',
|
||||
|
|
@ -1177,65 +1178,74 @@ function syncUserInfoWechatMp(_a, context) {
|
|||
}, {
|
||||
dontCollect: true,
|
||||
})];
|
||||
case 3:
|
||||
_b = tslib_1.__read.apply(void 0, [_o.sent(), 1]), _c = _b[0], sessionKey = _c.sessionKey, user = _c.user;
|
||||
_d = user, originNickname = _d.nickname, extraFile$entity = _d.extraFile$entity;
|
||||
case 1:
|
||||
_e = tslib_1.__read.apply(void 0, [_u.sent(), 1]), _f = _e[0], sessionKey = _f.sessionKey, user = _f.user;
|
||||
_g = user, originNickname = _g.nickname, extraFile$entity = _g.extraFile$entity;
|
||||
updateData = {};
|
||||
if (nickname !== originNickname) {
|
||||
Object.assign(updateData, {
|
||||
nickname: nickname,
|
||||
});
|
||||
}
|
||||
if (!((extraFile$entity === null || extraFile$entity === void 0 ? void 0 : extraFile$entity.length) === 0 || (0, extraFile_1.composeFileUrl)(extraFile$entity[0]) !== avatarUrl)) return [3 /*break*/, 6];
|
||||
_k = {};
|
||||
if (!((extraFile$entity === null || extraFile$entity === void 0 ? void 0 : extraFile$entity.length) === 0 ||
|
||||
(0, extraFile_1.composeFileUrl)(extraFile$entity[0], config) !== avatarUrl)) return [3 /*break*/, 7];
|
||||
_q = {};
|
||||
return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()];
|
||||
case 2:
|
||||
_q.id = _u.sent(),
|
||||
_q.action = 'create';
|
||||
_j = (_h = Object).assign;
|
||||
_r = {};
|
||||
return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()];
|
||||
case 3:
|
||||
_r.id = _u.sent(),
|
||||
_r.tag1 = 'avatar',
|
||||
_r.entity = 'user',
|
||||
_r.entityId = userId;
|
||||
return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()];
|
||||
case 4:
|
||||
_k.id = _o.sent(),
|
||||
_k.action = 'create';
|
||||
_f = (_e = Object).assign;
|
||||
_l = {};
|
||||
extraFileOperations = [
|
||||
(_q.data = _j.apply(_h, [(_r.objectId = _u.sent(),
|
||||
_r), (0, extraFile_1.decomposeFileUrl)(avatarUrl)]),
|
||||
_q)
|
||||
];
|
||||
if (!(extraFile$entity.length > 0)) return [3 /*break*/, 6];
|
||||
_l = (_k = extraFileOperations).push;
|
||||
_s = {};
|
||||
return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()];
|
||||
case 5:
|
||||
extraFileOperations = [
|
||||
(_k.data = _f.apply(_e, [(_l.id = _o.sent(),
|
||||
_l.tag1 = 'avatar',
|
||||
_l.entity = 'user',
|
||||
_l.entityId = userId,
|
||||
_l), (0, extraFile_1.decomposeFileUrl)(avatarUrl)]),
|
||||
_k)
|
||||
];
|
||||
if (extraFile$entity.length > 0) {
|
||||
extraFileOperations.push({
|
||||
action: 'remove',
|
||||
data: {},
|
||||
filter: {
|
||||
_l.apply(_k, [(_s.id = _u.sent(),
|
||||
_s.action = 'remove',
|
||||
_s.data = {},
|
||||
_s.filter = {
|
||||
id: extraFile$entity[0].id,
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
_s)]);
|
||||
_u.label = 6;
|
||||
case 6:
|
||||
Object.assign(updateData, {
|
||||
extraFile$entity: extraFileOperations,
|
||||
});
|
||||
_o.label = 6;
|
||||
case 6:
|
||||
if (!(Object.keys(updateData).length > 0)) return [3 /*break*/, 9];
|
||||
_h = (_g = context).operate;
|
||||
_j = ['user'];
|
||||
_m = {};
|
||||
_u.label = 7;
|
||||
case 7:
|
||||
if (!(Object.keys(updateData).length > 0)) return [3 /*break*/, 10];
|
||||
_o = (_m = context).operate;
|
||||
_p = ['user'];
|
||||
_t = {};
|
||||
return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()];
|
||||
case 7: return [4 /*yield*/, _h.apply(_g, _j.concat([(_m.id = _o.sent(),
|
||||
_m.action = 'update',
|
||||
_m.data = updateData,
|
||||
_m.filter = {
|
||||
case 8: return [4 /*yield*/, _o.apply(_m, _p.concat([(_t.id = _u.sent(),
|
||||
_t.action = 'update',
|
||||
_t.data = updateData,
|
||||
_t.filter = {
|
||||
id: userId,
|
||||
},
|
||||
_m), {
|
||||
_t), {
|
||||
dontCollect: true,
|
||||
}]))];
|
||||
case 8:
|
||||
_o.sent();
|
||||
_o.label = 9;
|
||||
case 9: return [2 /*return*/];
|
||||
case 9:
|
||||
_u.sent();
|
||||
_u.label = 10;
|
||||
case 10: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import './index.less';
|
||||
declare const Empty: () => JSX.Element;
|
||||
export default Empty;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import './index.less';
|
||||
declare const Empty: () => JSX.Element;
|
||||
export default Empty;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
right: 0;
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
z-index: 999;
|
||||
|
||||
width: 750rpx;
|
||||
height: 106rpx;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import './index.less';
|
||||
interface QrCodeProps {
|
||||
id?: string;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
export default function Web(props: {
|
||||
config: WebConfig;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WechatMpConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
export default function WechatMp(props: {
|
||||
config: WechatMpConfig;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
export default function WechatPublic(props: {
|
||||
isService?: boolean;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Style as StyleType } from '../../../types/Style';
|
||||
declare type StyleProps = {
|
||||
value?: StyleType | null;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Account(props: {
|
||||
account: Required<Config>['Account'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Cos(props: {
|
||||
cos: Required<Config>['Cos'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Cos(props: {
|
||||
live: Required<Config>['Live'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
export default function Cos(props: {
|
||||
map: Required<Config>['Map'];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../types/Config';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
declare const _default: import("react").ComponentType<any>;
|
||||
export default _default;
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var uuid_1 = require("oak-domain/lib/utils/uuid");
|
||||
var assert_1 = tslib_1.__importDefault(require("assert"));
|
||||
exports.default = OakComponent({
|
||||
entity: 'extraFile',
|
||||
isList: true,
|
||||
projection: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
tag2: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
extension: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
},
|
||||
formData: function (_a) {
|
||||
var extraFiles = _a.data, features = _a.features;
|
||||
var avatar = extraFiles === null || extraFiles === void 0 ? void 0 : extraFiles.filter(function (ele) { return !ele.$$deleteAt$$ && ele.tag1 === 'avatar'; })[0];
|
||||
var avatarUrl = features.extraFile.getUrl(avatar);
|
||||
return {
|
||||
avatar: avatar,
|
||||
avatarUrl: avatarUrl,
|
||||
};
|
||||
},
|
||||
data: {
|
||||
origin: 'qiniu',
|
||||
type: 'image',
|
||||
tag1: 'avatar',
|
||||
},
|
||||
wechatMp: {
|
||||
externalClasses: ['oak-class'],
|
||||
},
|
||||
properties: {
|
||||
// 图片是否可预览
|
||||
preview: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
entity: String,
|
||||
entityId: String,
|
||||
},
|
||||
methods: {
|
||||
onPickByMp: function () {
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
var _a, errMsg, tempFiles, err_1;
|
||||
var _this = this;
|
||||
return tslib_1.__generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
_b.trys.push([0, 5, , 6]);
|
||||
return [4 /*yield*/, wx.chooseMedia({
|
||||
count: 1,
|
||||
mediaType: ['image'],
|
||||
sourceType: ['album', 'camera'],
|
||||
})];
|
||||
case 1:
|
||||
_a = _b.sent(), errMsg = _a.errMsg, tempFiles = _a.tempFiles;
|
||||
if (!(errMsg !== 'chooseMedia:ok')) return [3 /*break*/, 2];
|
||||
this.setMessage({
|
||||
type: 'warning',
|
||||
content: errMsg,
|
||||
});
|
||||
return [3 /*break*/, 4];
|
||||
case 2: return [4 /*yield*/, Promise.all(tempFiles.map(function (tempExtraFile) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
||||
var tempFilePath, thumbTempFilePath, fileType, size, filePath, fileFullName;
|
||||
return tslib_1.__generator(this, function (_a) {
|
||||
tempFilePath = tempExtraFile.tempFilePath, thumbTempFilePath = tempExtraFile.thumbTempFilePath, fileType = tempExtraFile.fileType, size = tempExtraFile.size;
|
||||
filePath = tempFilePath || thumbTempFilePath;
|
||||
fileFullName = filePath.match(/[^/]+(?!.*\/)/g)[0];
|
||||
this.pushExtraFile({
|
||||
name: fileFullName,
|
||||
fileType: fileType,
|
||||
size: size,
|
||||
extra1: filePath,
|
||||
});
|
||||
return [2 /*return*/];
|
||||
});
|
||||
}); }))];
|
||||
case 3:
|
||||
_b.sent();
|
||||
_b.label = 4;
|
||||
case 4: return [3 /*break*/, 6];
|
||||
case 5:
|
||||
err_1 = _b.sent();
|
||||
console.error(err_1);
|
||||
if (err_1.errMsg !== 'chooseMedia:fail cancel') {
|
||||
this.setMessage({
|
||||
type: 'error',
|
||||
content: err_1.errMsg,
|
||||
});
|
||||
}
|
||||
return [3 /*break*/, 6];
|
||||
case 6: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
onPickByWeb: function (uploadFiles) {
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
var _this = this;
|
||||
return tslib_1.__generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, Promise.all(uploadFiles.map(function (uploadFile) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
||||
var name, fileType, size, originFileObj;
|
||||
return tslib_1.__generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
name = uploadFile.name, fileType = uploadFile.type, size = uploadFile.size, originFileObj = uploadFile.originFileObj;
|
||||
return [4 /*yield*/, this.pushExtraFile({
|
||||
name: name,
|
||||
fileType: fileType,
|
||||
size: size,
|
||||
extra1: originFileObj,
|
||||
})];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); }))];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
pushExtraFile: function (options) {
|
||||
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
||||
var _a, origin, type, tag1, avatar, _b, entityId, entity, name, extra1, fileType, size, extension, filename, updateData, bucket, error_1;
|
||||
return tslib_1.__generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
_a = this.state, origin = _a.origin, type = _a.type, tag1 = _a.tag1, avatar = _a.avatar;
|
||||
_b = this.props, entityId = _b.entityId, entity = _b.entity;
|
||||
name = options.name, extra1 = options.extra1, fileType = options.fileType, size = options.size;
|
||||
extension = name.substring(name.lastIndexOf('.') + 1);
|
||||
filename = name.substring(0, name.lastIndexOf('.'));
|
||||
(0, assert_1.default)(entity, '必须传入entity');
|
||||
updateData = {
|
||||
extra1: extra1,
|
||||
origin: origin,
|
||||
type: type,
|
||||
tag1: tag1,
|
||||
objectId: (0, uuid_1.generateNewId)(),
|
||||
entity: entity,
|
||||
filename: filename,
|
||||
size: size,
|
||||
extension: extension,
|
||||
fileType: fileType,
|
||||
id: (0, uuid_1.generateNewId)(),
|
||||
entityId: entityId,
|
||||
};
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
_c.trys.push([1, 3, , 4]);
|
||||
return [4 /*yield*/, this.features.extraFile.upload(updateData)];
|
||||
case 2:
|
||||
bucket = (_c.sent()).bucket;
|
||||
Object.assign(updateData, {
|
||||
bucket: bucket,
|
||||
extra1: null,
|
||||
});
|
||||
return [3 /*break*/, 4];
|
||||
case 3:
|
||||
error_1 = _c.sent();
|
||||
//todo 保存extraFile失败 需要remove七牛图片
|
||||
throw error_1;
|
||||
case 4:
|
||||
this.addItem(updateData);
|
||||
if (avatar) {
|
||||
this.removeItem(avatar.id);
|
||||
}
|
||||
if (!entityId) return [3 /*break*/, 6];
|
||||
return [4 /*yield*/, this.execute()];
|
||||
case 5:
|
||||
_c.sent();
|
||||
_c.label = 6;
|
||||
case 6: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"l-avatar": "../../../miniprogram_npm/lin-ui/avatar/index"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
@import "../../../config/styles/mp/index.less";
|
||||
@import "../../../config/styles/mp/mixins.less";
|
||||
|
||||
.file-list__container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.file-list__item {
|
||||
position: relative;
|
||||
width: 220rpx;
|
||||
padding-bottom: 220rpx;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
// size 不同时,对应的图片间距设置
|
||||
// size 仅支持 1-10
|
||||
each(range(2, 10), {
|
||||
@valuePlusOne : @value+1;
|
||||
|
||||
.file-list__item--@{value}:nth-of-type(n+@{valuePlusOne}) {
|
||||
margin-top : 20rpx;
|
||||
}
|
||||
|
||||
.file-list__item--@{value}:not(:nth-of-type(@{value}n+1)) {
|
||||
margin-left : 20rpx;
|
||||
}
|
||||
}) // 当 size 为 null,每行会显示 3 张图片
|
||||
|
||||
.file-list__item--null:nth-of-type(n+4) {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.file-list__item--null:not(:nth-of-type(3n+1)) {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.file-list__image {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1rpx solid #eee;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.file-list__item--selected {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 10;
|
||||
background-color: #000;
|
||||
filter: Alpha(Opacity=50);
|
||||
opacity: 0.5;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.file-list__remove {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 10rpx;
|
||||
height: 40rpx;
|
||||
width: 40rpx;
|
||||
border-radius: 50%;
|
||||
background: rgb(0 0 0 / 40%);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.file-list__item--add {
|
||||
border: 1rpx solid #eee;
|
||||
border-radius: 4rpx;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.file-list__image--add {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.file-list__item-slot-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.file-list__item-slot-wrapper:empty+.file-list__image--add {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<view class="avatar-box aok-class" bind:tap="onPickByMp">
|
||||
<block wx:if="{{avatarUrl}}">
|
||||
<l-avatar src="{{avatarUrl}}" size="120" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
<l-avatar icon="user" size="120" icon-size="60" />
|
||||
</block>
|
||||
</view>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import { UploadFile } from 'antd';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
declare type Theme = 'file' | 'image' | 'file-flow' | 'image-flow' | 'custom';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'extraFile', true, {
|
||||
accept?: string;
|
||||
maxNumber?: number;
|
||||
multiple?: boolean;
|
||||
draggable?: boolean;
|
||||
theme?: Theme;
|
||||
tips?: string;
|
||||
beforeUpload?: (file: File) => Promise<boolean>;
|
||||
disabled?: boolean;
|
||||
style?: Record<string, string>;
|
||||
className?: string;
|
||||
directory?: boolean;
|
||||
onPreview?: (file: UploadFile<any>) => void;
|
||||
onDownload?: (file: UploadFile<any>) => void;
|
||||
showUploadList?: boolean;
|
||||
children?: JSX.Element;
|
||||
files?: EntityDict['extraFile']['OpSchema'][];
|
||||
disableInsert?: boolean;
|
||||
}, {
|
||||
onPickByWeb: (files: UploadFile[], callback?: (file: any, status: string) => void) => void;
|
||||
onDeleteByWeb: (file: UploadFile) => void;
|
||||
}>): JSX.Element;
|
||||
export {};
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||
var react_1 = require("react");
|
||||
var antd_1 = require("antd");
|
||||
var icons_1 = require("@ant-design/icons");
|
||||
var utils_1 = require("antd/es/upload/utils");
|
||||
var classnames_1 = tslib_1.__importDefault(require("classnames"));
|
||||
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
var useFeatures_1 = tslib_1.__importDefault(require("../../../hooks/useFeatures"));
|
||||
function getListType(theme) {
|
||||
var themeMap = {
|
||||
file: 'text',
|
||||
image: 'picture-card',
|
||||
'file-flow': 'text',
|
||||
'image-flow': 'picture',
|
||||
custom: 'text',
|
||||
};
|
||||
return themeMap[theme];
|
||||
}
|
||||
function render(props) {
|
||||
var _this = this;
|
||||
var _a = props.data, _b = _a.accept, accept = _b === void 0 ? 'image/*' : _b, _c = _a.maxNumber, maxNumber = _c === void 0 ? 20 : _c, _d = _a.multiple, multiple = _d === void 0 ? maxNumber !== 1 : _d, _e = _a.draggable, draggable = _e === void 0 ? false : _e, _f = _a.theme, theme = _f === void 0 ? 'image' : _f, tips = _a.tips, beforeUpload = _a.beforeUpload, disabled = _a.disabled, style = _a.style, className = _a.className, _g = _a.directory, directory = _g === void 0 ? false : _g, onPreview = _a.onPreview, onDownload = _a.onDownload, children = _a.children, _h = _a.showUploadList, showUploadList = _h === void 0 ? true : _h, files = _a.files, disableInsert = _a.disableInsert;
|
||||
var _j = props.methods, onPickByWeb = _j.onPickByWeb, onDeleteByWeb = _j.onDeleteByWeb;
|
||||
var features = (0, useFeatures_1.default)();
|
||||
var _k = tslib_1.__read((0, react_1.useState)([]), 2), newFiles = _k[0], setNewFiles = _k[1];
|
||||
var _l = tslib_1.__read((0, react_1.useState)([]), 2), newUploadFiles = _l[0], setNewUploadFiles = _l[1];
|
||||
var listType = getListType(theme);
|
||||
(0, react_1.useEffect)(function () {
|
||||
if (files && files.length > 0) {
|
||||
setNewFiles(files);
|
||||
}
|
||||
else {
|
||||
setNewFiles([]);
|
||||
}
|
||||
}, [files]);
|
||||
var extraFileToUploadFile = function (extraFile) {
|
||||
return {
|
||||
id: extraFile.id,
|
||||
url: features.extraFile.getUrl(extraFile),
|
||||
thumbUrl: features.extraFile.getUrl(extraFile),
|
||||
name: extraFile.filename + (extraFile.extension || ''),
|
||||
fileName: extraFile.filename + (extraFile.extension || ''),
|
||||
size: extraFile.size,
|
||||
type: extraFile.fileType,
|
||||
uid: extraFile.id, //upload 组件需要uid来维护fileList
|
||||
// status: 'done',
|
||||
};
|
||||
};
|
||||
var setNewUploadFilesByStatus = function (file, status) {
|
||||
var filename = file.filename, size = file.size, id = file.id;
|
||||
var file2 = newUploadFiles.find(function (ele) { var _a; return ((_a = ele.name) === null || _a === void 0 ? void 0 : _a.includes(filename)) && ele.size === size; });
|
||||
if (file2) {
|
||||
Object.assign(file2, {
|
||||
status: status,
|
||||
id: id,
|
||||
});
|
||||
}
|
||||
setNewUploadFiles(newUploadFiles);
|
||||
};
|
||||
var customDelete = function (index) {
|
||||
var arr = tslib_1.__spreadArray([], tslib_1.__read(newUploadFiles), false);
|
||||
arr.splice(index, 1);
|
||||
setNewUploadFiles(arr);
|
||||
};
|
||||
var getUploadButton = function () {
|
||||
if (children) {
|
||||
return children;
|
||||
}
|
||||
if (listType === 'picture-card') {
|
||||
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(icons_1.PlusOutlined, {}), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: { marginTop: 8 } }, { children: "\u8BF7\u9009\u62E9\u56FE\u7247" }))] }));
|
||||
}
|
||||
return (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "default" }, { children: "\u9009\u62E9\u6587\u4EF6" }));
|
||||
};
|
||||
return ((0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ direction: "vertical", className: web_module_less_1.default['oak-upload'], style: { width: '100%' } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Upload, tslib_1.__assign({ className: (0, classnames_1.default)(web_module_less_1.default['oak-upload__upload'], className), style: style, disabled: disabled, directory: directory, showUploadList: showUploadList, beforeUpload: function (file) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
||||
var result;
|
||||
return tslib_1.__generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
if (!(typeof beforeUpload === 'function')) return [3 /*break*/, 2];
|
||||
return [4 /*yield*/, beforeUpload(file)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
if (result) {
|
||||
return [2 /*return*/, false];
|
||||
}
|
||||
_a.label = 2;
|
||||
case 2: return [2 /*return*/, false];
|
||||
}
|
||||
});
|
||||
}); }, multiple: multiple, maxCount: maxNumber, accept: accept, listType: listType, fileList: theme === 'custom'
|
||||
? []
|
||||
: newFiles === null || newFiles === void 0 ? void 0 : newFiles.map(function (ele) {
|
||||
return extraFileToUploadFile(ele);
|
||||
}), onChange: function (_a) {
|
||||
var file = _a.file, fileList = _a.fileList, event = _a.event;
|
||||
// id不存在就是file对象
|
||||
if (!file.id) {
|
||||
if (theme !== 'custom') {
|
||||
onPickByWeb([(0, utils_1.file2Obj)(file)]);
|
||||
}
|
||||
else {
|
||||
setNewUploadFiles([(0, utils_1.file2Obj)(file)]);
|
||||
}
|
||||
}
|
||||
}, onRemove: function (file) {
|
||||
onDeleteByWeb(file);
|
||||
}, onPreview: onPreview, onDownload: onDownload }, { children: disableInsert ? null : getUploadButton() })), tips && ((0, jsx_runtime_1.jsx)("small", tslib_1.__assign({ className: web_module_less_1.default['oak-upload__tips'] }, { children: tips }))), theme === 'custom' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Table, { dataSource: newUploadFiles || [], rowKey: "id", columns: [
|
||||
{
|
||||
align: 'center',
|
||||
dataIndex: 'tableIndex',
|
||||
title: '序号',
|
||||
render: function (value, record, index) { return index + 1; },
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
dataIndex: 'name',
|
||||
title: '文件名',
|
||||
},
|
||||
{
|
||||
dataIndex: 'size',
|
||||
title: '文件大小',
|
||||
render: function (value, record, index) {
|
||||
return features.extraFile.formatBytes(value);
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'status',
|
||||
title: '状态',
|
||||
render: function (value, record, index) {
|
||||
var cpn;
|
||||
switch (value) {
|
||||
case 'success':
|
||||
cpn = ((0, jsx_runtime_1.jsx)(antd_1.Tag, tslib_1.__assign({ color: "success" }, { children: "success" })));
|
||||
break;
|
||||
case 'uploading':
|
||||
cpn = ((0, jsx_runtime_1.jsx)(antd_1.Tag, tslib_1.__assign({ color: "processing" }, { children: "uploading" })));
|
||||
break;
|
||||
default:
|
||||
cpn = ((0, jsx_runtime_1.jsx)(antd_1.Tag, tslib_1.__assign({ color: "warning" }, { children: "waiting" })));
|
||||
break;
|
||||
}
|
||||
return cpn;
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'op',
|
||||
width: 300,
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
render: function (value, record, index) {
|
||||
// 只处理state的文件 这时候可以直接删除
|
||||
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !record.id && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
|
||||
customDelete(index);
|
||||
} }, { children: "\u5220\u9664" }))) }));
|
||||
},
|
||||
fixed: 'right',
|
||||
},
|
||||
] }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: { display: 'flex', justifyContent: 'flex-end' } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ danger: true, type: "default", onClick: function () { return setNewUploadFiles([]); } }, { children: "\u6E05\u7A7A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
|
||||
onPickByWeb(newUploadFiles, function (file, status) {
|
||||
setNewUploadFilesByStatus(file, status);
|
||||
});
|
||||
} }, { children: "\u4E0A\u4F20" }))] }) }))] }))] })));
|
||||
}
|
||||
exports.default = render;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
.oak-upload {
|
||||
&__tips {
|
||||
display: block;
|
||||
color: var(--oak-text-color-placeholder);
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
"component": true,
|
||||
"usingComponents": {
|
||||
"l-icon": "../../../miniprogram_npm/lin-ui/icon/index",
|
||||
"OakDisplay": "../display/index"
|
||||
"oak-display": "../display/index"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<view class="file-list__container aok-class">
|
||||
<view class="file-list__container oak-class">
|
||||
<block wx:for="{{files}}" wx:key="index">
|
||||
<block wx:if="{{item}}">
|
||||
<view class="file-list__item file-list__item--{{size}} oak-item-class" style="{{itemSizePercentage?'width:'+itemSizePercentage+'padding-bottom:'+itemSizePercentage:'xxx'}}">
|
||||
<OakDisplay data-index="{{index}}" bind:tap="onItemTapped" mode="{{mode}}" oakId="{{item.id}}" oakAutoUnmount="{{true}}" oakPath="{{oakFullpath}}.{{item.id}}" />
|
||||
<oak-display data-index="{{index}}" bind:tap="onItemTapped" mode="{{mode}}" oakId="{{item.id}}" oakAutoUnmount="{{true}}" oakPath="{{oakFullpath}}.{{item.id}}" />
|
||||
<view wx:if="{{!disableDelete}}" mut-bind:tap="onDeleteByMp" class="file-list__remove" data-value="{{item}}">
|
||||
<l-icon name="close" color="#ffffff" size="18" />
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { UploadFile } from 'antd';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ exports.default = OakComponent({
|
|||
actions: Array,
|
||||
actionDescriptions: Object,
|
||||
iconSize: String,
|
||||
rowNum: {
|
||||
type: Number,
|
||||
value: 4,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClickMp: function (e) {
|
||||
|
|
@ -17,7 +21,9 @@ exports.default = OakComponent({
|
|||
observers: {
|
||||
actions: function (actions) {
|
||||
var actionDescriptions = this.props.actionDescriptions;
|
||||
var actionss = actions.map(function (action) { return Object.assign({}, actionDescriptions[action], { action: action }); });
|
||||
var actionss = actions.map(function (action) {
|
||||
return Object.assign({}, actionDescriptions[action], { action: action });
|
||||
});
|
||||
this.setState({ actionss: actionss });
|
||||
},
|
||||
},
|
||||
|
|
@ -25,9 +31,11 @@ exports.default = OakComponent({
|
|||
ready: function () {
|
||||
var _a = this.props, actions = _a.actions, actionDescriptions = _a.actionDescriptions;
|
||||
if (actions) {
|
||||
var actionss = actions.map(function (action) { return Object.assign({}, actionDescriptions[action], { action: action }); });
|
||||
var actionss = actions.map(function (action) {
|
||||
return Object.assign({}, actionDescriptions[action], { action: action });
|
||||
});
|
||||
this.setState({ actionss: actionss });
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<view class="block block--bottom">
|
||||
<view class="btn-box">
|
||||
<l-grid row-num="{{4}}">
|
||||
<l-grid row-num="{{rowNum}}">
|
||||
<block wx:for="{{actionss}}" wx:key="index">
|
||||
<l-grid-item bind:linitemtap="onClickMp" data-index="{{index}}" key="{{index}}" slot="{{index}}">
|
||||
<oak-icon class="image" name="{{item.icon.name}}" type="{{item.icon.type || 'fas'}}" size="{{iconSize || 66}}" slot="image" />
|
||||
<oak-icon class="image" name="{{item.icon.name}}" type="{{item.icon.type}}" size="{{iconSize || 40}}" slot="image" />
|
||||
<text class='label'>{{item.label}}</text>
|
||||
</l-grid-item>
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from "oak-frontend-base";
|
||||
import { EntityDict } from "../../../general-app-domain";
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -4,17 +4,18 @@
|
|||
// bottom: constant(safe-area-inset-bottom) !important;
|
||||
// /* 兼容 iOS < 11.2 */
|
||||
// bottom: env(safe-area-inset-bottom) !important;
|
||||
// right: 45%;
|
||||
|
||||
position: 'fixed';
|
||||
bottom: 40rpx;
|
||||
right: calc(100% / 2 - 8px);
|
||||
z-index: 1;
|
||||
z-index: 1100;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.arc-popup {
|
||||
z-index: 1101 !important;
|
||||
}
|
||||
|
||||
.block {
|
||||
width: 176rpx;
|
||||
height: 176rpx;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<view bind:tap="handlePopup" class="btn-popup">
|
||||
<oak-icon name="packup" ></oak-icon>
|
||||
</view>
|
||||
<l-arc-popup show="{{visible}}">
|
||||
<l-arc-popup show="{{visible}}" l-class="arc-popup">
|
||||
<view class="block block--bottom">
|
||||
<view class="btn-box">
|
||||
<l-button type="default" l-class="btn-item" l-label-class="btn-item-label" size="mini" shape="semicircle" bind:lintap="printRunningTree">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'address', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../general-app-domain';
|
||||
import './web.less';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'message', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'message', false, {}, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { MessageProps } from 'oak-frontend-base/lib/types/Message';
|
||||
export default function render(props: {
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { AvatarSize } from 'antd/es/avatar/SizeContext';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'userEntityGrant', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'address', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'address', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'application', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'application', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from './../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'article', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'article', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'article', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import '@wangeditor/editor/dist/css/style.css';
|
||||
import { EntityDict } from './../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'domain', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'system', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'domain', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'token', true, {}, {}>): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'token', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'message', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'message', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'message', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'message', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'message', true, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function render(this: any): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"navigationBarTitleText": "手机号",
|
||||
"navigationBarTitleText": "绑定手机号",
|
||||
"usingComponents": {
|
||||
"l-button": "../../../miniprogram_npm/lin-ui/button/index",
|
||||
"l-card": "../../../miniprogram_npm/lin-ui/card/index",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'mobile', true, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function Render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function Render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'area', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { Config } from '../../../../types/Config';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { Config } from '../../../types/Config';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'platform', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'platform', false, {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ exports.default = OakComponent({
|
|||
},
|
||||
goMyInfo: function () {
|
||||
this.navigateTo({
|
||||
url: '/user',
|
||||
url: '/user/info',
|
||||
oakId: this.state.userId,
|
||||
}, undefined, true);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"navigationBarTitleText": "设置",
|
||||
"oakDisablePulldownRefresh": true
|
||||
"oakDisablePulldownRefresh": true,
|
||||
"usingComponents": {
|
||||
"l-list": "../../miniprogram_npm/lin-ui/list/index"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
@import "../../../config/styles/mp/index.less";
|
||||
@import "../../../config/styles/mp/mixins.less";
|
||||
@import "../../config/styles/mp/index.less";
|
||||
@import "../../config/styles/mp/mixins.less";
|
||||
|
||||
.page-body {
|
||||
height: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
background-color: @oak-bg-color-page;
|
||||
}
|
||||
|
||||
.cell {
|
||||
background-color: #fff;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<!-- index.wxml -->
|
||||
<view class="page-body">
|
||||
<view class="cell">
|
||||
<l-list title="我的信息" icon="phone" bind:lintap="goMyInfo" >
|
||||
<l-list title="我的信息" icon="user" bind:lintap="goMyInfo" >
|
||||
</l-list>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
/// <reference types="react" />
|
||||
export default function Render(): JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WechatPublicConfig } from '../../../general-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'subscription', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'subscription', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
import { Config } from '../../../../types/Config';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { Config } from '../../../types/Config';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'system', true, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'system', false, {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ exports.default = OakComponent({
|
|||
id: 1,
|
||||
nickname: 1,
|
||||
name: 1,
|
||||
birth: 1,
|
||||
gender: 1,
|
||||
idState: 1,
|
||||
userState: 1,
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
|
|
@ -25,6 +29,7 @@ exports.default = OakComponent({
|
|||
extra1: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
extension: 1,
|
||||
},
|
||||
filter: {
|
||||
|
|
@ -75,7 +80,7 @@ exports.default = OakComponent({
|
|||
var _d = tslib_1.__read(data || [], 1), token = _d[0];
|
||||
var user = token === null || token === void 0 ? void 0 : token.user;
|
||||
var player = token === null || token === void 0 ? void 0 : token.player;
|
||||
var avatarFile = user && user.extraFile$entity && user.extraFile$entity[0];
|
||||
var avatarFile = (user === null || user === void 0 ? void 0 : user.extraFile$entity) && (user === null || user === void 0 ? void 0 : user.extraFile$entity[0]);
|
||||
var avatar = features.extraFile.getUrl(avatarFile);
|
||||
var nickname = user && user.nickname;
|
||||
var mobileData = user && user.mobile$user && user.mobile$user[0];
|
||||
|
|
@ -170,7 +175,7 @@ exports.default = OakComponent({
|
|||
this.navigateTo({
|
||||
url: '/login',
|
||||
eventLoggedIn: eventLoggedIn,
|
||||
});
|
||||
}, undefined, true);
|
||||
return [3 /*break*/, 5];
|
||||
}
|
||||
_b.label = 5;
|
||||
|
|
@ -195,6 +200,14 @@ exports.default = OakComponent({
|
|||
});
|
||||
},
|
||||
goSetting: function () {
|
||||
this.navigateTo({
|
||||
url: '/setting',
|
||||
});
|
||||
},
|
||||
goMyInfo: function () {
|
||||
if (!this.state.isLoggedIn) {
|
||||
return;
|
||||
}
|
||||
this.navigateTo({
|
||||
url: '/user/info',
|
||||
oakId: this.state.userId,
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@
|
|||
<view class="page-body">
|
||||
<view class="userInfo">
|
||||
<block wx:if="{{avatar}}">
|
||||
<l-avatar src="{{avatar}}" text="{{nickname || '未设置'}}" placement="bottom"/>
|
||||
<l-avatar src="{{avatar}}" text="{{nickname || '未设置'}}" placement="bottom" bind:lintap="goMyInfo"/>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<l-avatar icon="user" size="140" icon-size="80" text="{{nickname || '未设置'}}" placement="bottom"/>
|
||||
<l-avatar icon="user" size="140" icon-size="80" text="{{nickname || '未设置'}}" placement="bottom" bind:lintap="goMyInfo"/>
|
||||
</block>
|
||||
<block wx:if="{{isLoggedIn && !isPlayingAnother}}">
|
||||
<block wx:if="{{isLoggedIn && !isPlayingAnother && !oakLoading}}">
|
||||
<l-button shape="semicircle" type="default" size="mini" disabled="{{refreshing}}" plain="true" bind:lintap="onRefresh">{{t('syncWeChat')}}</l-button>
|
||||
</block>
|
||||
<block wx:elif="{{!isLoggedIn}}">
|
||||
<l-button shape="semicircle" type="default" size="mini" disabled="{{refreshing}}" bind:lintap="doLogin">{{t('login')}}</l-button>
|
||||
<l-button shape="semicircle" type="default" size="mini" disabled="{{refreshing || oakLoading}}" bind:lintap="doLogin">{{t('login')}}</l-button>
|
||||
</block>
|
||||
</view>
|
||||
<view class="cell">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'token', true, {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ exports.default = OakComponent({
|
|||
nickname: 1,
|
||||
birth: 1,
|
||||
gender: 1,
|
||||
idState: 1,
|
||||
userState: 1,
|
||||
mobile$user: {
|
||||
$entity: 'mobile',
|
||||
data: {
|
||||
|
|
@ -34,6 +36,11 @@ exports.default = OakComponent({
|
|||
entity: 1,
|
||||
entityId: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: 'avatar',
|
||||
},
|
||||
indexFrom: 0,
|
||||
count: 1,
|
||||
},
|
||||
},
|
||||
isList: false,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
"l-input": "../../../miniprogram_npm/lin-ui/input/index",
|
||||
"l-radio-group": "../../../miniprogram_npm/lin-ui/radio-group/index",
|
||||
"l-radio": "../../../miniprogram_npm/lin-ui/radio/index",
|
||||
"l-form-item": "@oak-general-business/miniprogram_npm/lin-ui/form-item/index"
|
||||
"l-form-item": "../../../miniprogram_npm/lin-ui/form-item/index",
|
||||
"oak-extraFile-avatar": "../../../components/extraFile/avatar/index"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,25 +12,16 @@
|
|||
.safe-area-inset-bottom();
|
||||
}
|
||||
|
||||
|
||||
.avatar {
|
||||
font-size: 128rpx;
|
||||
color: @oak-text-color-secondary;
|
||||
height: 140rpx;
|
||||
width: 140rpx;
|
||||
border-radius: 14rpx;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.nickname {
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.col {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0rpx 10rpx;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
background-color: #fff;
|
||||
|
||||
.left {
|
||||
|
|
@ -72,20 +63,6 @@
|
|||
}
|
||||
|
||||
|
||||
.userInfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.btn-view {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.pupop-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
|||
|
|
@ -1,26 +1,23 @@
|
|||
<view class="page-body">
|
||||
<view class="userInfo">
|
||||
<block wx:if="{{avatar}}">
|
||||
<l-avatar src="{{avatar}}" />
|
||||
</block>
|
||||
<block wx:else>
|
||||
<l-avatar icon="user" size="140" icon-size="86" />
|
||||
</block>
|
||||
</view>
|
||||
<view class="col">
|
||||
<l-list title="昵称" data-attr="nickname" bind:lintap="setVisibleMp" >
|
||||
<view class="col">
|
||||
<l-list title="头像">
|
||||
<view slot="right-section" class="avatar">
|
||||
<oak-extraFile-avatar oakAutoUnmount="{{true}}" oakPath="{{ oakFullpath ? oakFullpath + '.extraFile$entity' : undefined }}" entity="user" entityId="{{id}}"/>
|
||||
</view>
|
||||
</l-list>
|
||||
<l-list title="昵称" data-attr="nickname" bind:lintap="setVisibleMp">
|
||||
<view slot="right-section" class="value">{{nickname || '未设置'}}</view>
|
||||
</l-list>
|
||||
<l-list title="姓名" data-attr="name" bind:lintap="setVisibleMp" >
|
||||
<l-list title="姓名" data-attr="name" bind:lintap="setVisibleMp">
|
||||
<view slot="right-section" class="value">{{name || '未设置'}}</view>
|
||||
</l-list>
|
||||
<l-list title="性别" data-attr="gender" bind:lintap="setVisibleMp" >
|
||||
<l-list title="性别" data-attr="gender" bind:lintap="setVisibleMp">
|
||||
<view slot="right-section" class="value">{{genderStr || '未设置'}}</view>
|
||||
</l-list>
|
||||
<l-list title="生日" data-attr="birth" bind:lintap="setVisibleMp" >
|
||||
<l-list title="生日" data-attr="birth" bind:lintap="setVisibleMp">
|
||||
<view slot="right-section" class="value">{{birthText || '未设置'}}</view>
|
||||
</l-list>
|
||||
<l-list title="手机号" bind:lintap="setMobile">
|
||||
<l-list title="手机号" bind:lintap="setMobile">
|
||||
<view slot="right-section" class="value">{{mobile || '未绑定'}}</view>
|
||||
</l-list>
|
||||
<!-- <l-list tag-position="right" is-link="{{false}}" title="用户状态">
|
||||
|
|
@ -30,8 +27,8 @@
|
|||
</l-tag>
|
||||
</view>
|
||||
</l-list> -->
|
||||
<l-list tag-position="right" is-link="{{false}}" title="认证状态">
|
||||
<view slot="right-section" class="value">
|
||||
<l-list tag-position="right" is-link="{{false}}" title="认证状态">
|
||||
<view slot="right-section" class="value">
|
||||
<l-tag l-class="{{idStateColor[idState]}}" size="mini" shape="circle">
|
||||
{{idState || '未设置'}}
|
||||
</l-tag>
|
||||
|
|
@ -40,47 +37,42 @@
|
|||
</view>
|
||||
<view style="flex:1" />
|
||||
|
||||
<l-popup show="{{visible}}" content-align="bottom" locked="{{true}}">
|
||||
<view class='pupop-content'>
|
||||
<view class="pupop-header">
|
||||
<view class="close" bind:tap="onPupopCloseMp">
|
||||
<l-icon name="close" size="24"> </l-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class='pupop-form'>
|
||||
<block wx:if="{{ attr === 'nickname' }}">
|
||||
<l-input label="昵称" value="{{nickname}}" placeholder="请输入昵称" bind:lininput="setCustomDataMp" />
|
||||
</block>
|
||||
<block wx:elif="{{ attr === 'name' }}">
|
||||
<l-input label="姓名" value="{{name}}" placeholder="请输入姓名" bind:lininput="setCustomDataMp" />
|
||||
</block>
|
||||
<block wx:elif="{{ attr === 'gender' }}">
|
||||
<l-form-item label="性别">
|
||||
<l-radio-group current="{{gender}}" placement="row" length="2" bind:linchange="genderChangeMp">
|
||||
<l-radio
|
||||
l-class="l-radio"
|
||||
wx:for="{{genderOptions}}"
|
||||
wx:key="id"
|
||||
key="{{item.value}}"
|
||||
placement="left">
|
||||
{{item.label}}
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
</l-form-item>
|
||||
|
||||
</block>
|
||||
<l-popup show="{{visible}}" content-align="bottom" locked="{{false}}">
|
||||
<view class='pupop-content'>
|
||||
<view class="pupop-header">
|
||||
<view class="close" bind:tap="onPupopCloseMp">
|
||||
<l-icon name="close" size="24"></l-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class='pupop-form'>
|
||||
<block wx:if="{{ attr === 'nickname' }}">
|
||||
<l-input label="昵称" value="{{nickname}}" placeholder="请输入昵称" bind:lininput="setCustomDataMp" />
|
||||
</block>
|
||||
<block wx:elif="{{ attr === 'name' }}">
|
||||
<l-input label="姓名" value="{{name}}" placeholder="请输入姓名" bind:lininput="setCustomDataMp" />
|
||||
</block>
|
||||
<block wx:elif="{{ attr === 'gender' }}">
|
||||
<l-form-item label="性别" label-width="100rpx">
|
||||
<l-radio-group current="{{gender}}" placement="row" length="2" bind:linchange="genderChangeMp">
|
||||
<l-radio l-class="l-radio" wx:for="{{genderOptions}}" wx:key="id" key="{{item.value}}" placement="left">
|
||||
{{item.label}}
|
||||
</l-radio>
|
||||
</l-radio-group>
|
||||
</l-form-item>
|
||||
|
||||
</block>
|
||||
|
||||
</block>
|
||||
<block wx:elif="{{ attr === 'birth' }}">
|
||||
<picker mode="date" end="{{birthEnd}}" value="{{birthText}}" bind:change="birthChangeMp">
|
||||
<l-input label="出生日期" value="{{birthText2 || birthText || '选择日期'}}" disabled="{{true}}" l-label-class="label">
|
||||
<l-icon slot="right" name="right" size="20" />
|
||||
</l-input>
|
||||
</picker>
|
||||
|
||||
</block>
|
||||
|
||||
</block>
|
||||
<block wx:elif="{{ attr === 'birth' }}">
|
||||
<picker mode="date" end="{{birthEnd}}" value="{{birthText}}" bind:change="birthChangeMp">
|
||||
<l-input label="出生日期" value="{{birthText2 || birthText || '选择日期'}}" disabled="{{true}}" l-label-class="label">
|
||||
<l-icon slot="right" name="right" size="20" />
|
||||
</l-input>
|
||||
</picker>
|
||||
|
||||
</block>
|
||||
|
||||
|
||||
</view>
|
||||
<l-button size="long" bind:lintap="onConfirmMp">
|
||||
提交
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
declare type DataProps = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../general-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/// <reference types="react" />
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../../general-app-domain';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ exports.default = OakComponent({
|
|||
extra1: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
extension: 1,
|
||||
},
|
||||
filter: {
|
||||
|
|
@ -37,6 +38,16 @@ exports.default = OakComponent({
|
|||
},
|
||||
},
|
||||
},
|
||||
sorters: [
|
||||
{
|
||||
sorter: {
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
},
|
||||
],
|
||||
isList: true,
|
||||
formData: function (_a) {
|
||||
var users = _a.data, features = _a.features;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,26 @@ exports.default = OakComponent({
|
|||
avatar: 1,
|
||||
idCardType: 1,
|
||||
idNumber: 1,
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
extension: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: 'avatar',
|
||||
},
|
||||
indexFrom: 0,
|
||||
count: 1,
|
||||
},
|
||||
},
|
||||
isList: false,
|
||||
formData: function (_a) {
|
||||
|
|
@ -39,11 +59,13 @@ exports.default = OakComponent({
|
|||
var _b = user || {}, birth = _b.birth, gender = _b.gender, idCardType = _b.idCardType;
|
||||
var birthDate = birth && new Date(birth);
|
||||
var birthText = birthDate && birthDate.toLocaleDateString();
|
||||
var birthDayValue = birthDate && "".concat(birthDate.getFullYear(), "-").concat(birthDate.getMonth() + 1, "-").concat(birthDate.getDate());
|
||||
var birthDayValue = birthDate &&
|
||||
"".concat(birthDate.getFullYear(), "-").concat(birthDate.getMonth() + 1, "-").concat(birthDate.getDate());
|
||||
var genderOption = gender && GenderOptions.find(function (ele) { return ele.value === gender; });
|
||||
var genderText = genderOption && genderOption.label;
|
||||
var genderOptionIndex = genderOption && GenderOptions.indexOf(genderOption);
|
||||
var idCardTypeOption = idCardType && IDCardTypeOptions.find(function (ele) { return ele.value === idCardType; });
|
||||
var idCardTypeOption = idCardType &&
|
||||
IDCardTypeOptions.find(function (ele) { return ele.value === idCardType; });
|
||||
var idCardTypeText = idCardTypeOption && idCardTypeOption.label;
|
||||
var idCardTypeOptionIndex = idCardTypeOption && IDCardTypeOptions.indexOf(idCardTypeOption);
|
||||
var idCardTypeIndex = idCardType && IDCardTypeOptions.find(function (ele) { return ele.value === gender; });
|
||||
|
|
@ -72,7 +94,7 @@ exports.default = OakComponent({
|
|||
var today = new Date();
|
||||
var birthEnd = "".concat(today.getFullYear(), "-").concat(today.getMonth() + 1, "-").concat(today.getDate());
|
||||
this.setState({ birthEnd: birthEnd });
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
setValueMp: function (input) {
|
||||
|
|
@ -103,12 +125,21 @@ exports.default = OakComponent({
|
|||
onIdCardTypeChange: function (e) {
|
||||
var index = e.detail.value;
|
||||
var value = IDCardTypeOptions[index].value;
|
||||
this.update({ idCardType: value });
|
||||
this.update({
|
||||
idCardType: value,
|
||||
});
|
||||
},
|
||||
onGenderChange: function (e) {
|
||||
var index = e.detail.value;
|
||||
var value = GenderOptions[index].value;
|
||||
this.update({ gender: value });
|
||||
this.update({
|
||||
gender: value,
|
||||
});
|
||||
},
|
||||
setMobile: function () {
|
||||
this.navigateTo({
|
||||
url: '/mobile/me',
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
"navigationBarTitleText": "修改用户信息",
|
||||
"navigationBarTitleText": "编辑用户信息",
|
||||
"usingComponents": {
|
||||
"l-button": "../../../../miniprogram_npm/lin-ui/button/index",
|
||||
"l-list": "../../../../miniprogram_npm/lin-ui/list/index",
|
||||
"l-input": "../../../../miniprogram_npm/lin-ui/input/index",
|
||||
"l-icon": "../../../../miniprogram_npm/lin-ui/icon/index",
|
||||
"mobile-manage-list": "../../../../components/mobile/manageList/index"
|
||||
"mobile-manage-list": "../../../../components/mobile/manageList/index",
|
||||
"oak-extraFile-avatar": "../../../../components/extraFile/avatar/index"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,15 @@
|
|||
.safe-area-inset-bottom();
|
||||
}
|
||||
|
||||
.list-box {
|
||||
padding-left: 25rpx;
|
||||
padding-right: 25rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
@ -23,15 +32,27 @@
|
|||
}
|
||||
|
||||
.list-item {
|
||||
position: relative;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
min-height: 88rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
padding-right: 25rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.label {
|
||||
width: 180rpx;
|
||||
width: 100px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 88rpx;
|
||||
padding-left: 25rpx;
|
||||
padding-right: 15rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.mobile-box {
|
||||
flex: 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,18 @@
|
|||
<!-- index.wxml -->
|
||||
<view class="page-body">
|
||||
<view class="col">
|
||||
<view class="list-box">
|
||||
<l-list title="头像">
|
||||
<view slot="right-section" class="avatar">
|
||||
<oak-extraFile-avatar oakAutoUnmount="{{true}}" oakPath="{{ oakFullpath ? oakFullpath + '.extraFile$entity' : undefined }}" entity="user"/>
|
||||
</view>
|
||||
</l-list>
|
||||
</view>
|
||||
|
||||
<l-input placeholder="请输入昵称" label="昵称" value="{{nickname}}" confirm-type="next" bind:lininput="setValueMp" l-label-class="label" data-attr="nickname" />
|
||||
<l-input placeholder="请输入姓名" label="姓名" value="{{name}}" confirm-type="next" bind:lininput="setValueMp" l-label-class="label" data-attr="name" />
|
||||
<l-input placeholder="请输入姓名" label="姓名" value="{{name}}" confirm-type="next" bind:lininput="setValueMp" l-label-class="label" data-attr="name" />
|
||||
<picker range="{{GenderOptions}}" range-key="label" value="{{genderOptionIndex}}" bind:change="onGenderChange">
|
||||
<l-input label="性别" value="{{genderText || '选择性别'}}" disabled="{{true}}" l-label-class="label" >
|
||||
<l-input label="性别" value="{{genderText || '选择性别'}}" disabled="{{true}}" l-label-class="label">
|
||||
<l-icon slot="right" name="right" size="20" />
|
||||
</l-input>
|
||||
</picker>
|
||||
|
|
@ -15,7 +23,7 @@
|
|||
</picker>
|
||||
<block wx:if="{{isRoot}}">
|
||||
<picker range="{{IDCardTypeOptions}}" range-key="label" value="{{idCardTypeOptionIndex}}" bind:change="onIdCardTypeChange">
|
||||
<l-input label="证件类别" value="{{idCardTypeText || '选择证件类别'}}" disabled="{{true}}" l-label-class="label" >
|
||||
<l-input label="证件类别" value="{{idCardTypeText || '选择证件类别'}}" disabled="{{true}}" l-label-class="label">
|
||||
<l-icon slot="right" name="right" size="20" />
|
||||
</l-input>
|
||||
</picker>
|
||||
|
|
@ -27,9 +35,17 @@
|
|||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view style="flex: 1" />
|
||||
<l-button type="default" disabled="{{oakExecuting || !oakDirty}}" loading="{{oakExecuting}}" size="long" bind:lintap="confirmMp">
|
||||
<block wx:else>
|
||||
<view class="list-box">
|
||||
<l-list title="手机号" bind:lintap="setMobile">
|
||||
<view slot="right-section" class="value">{{mobile || '未绑定'}}</view>
|
||||
</l-list>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
<view style="flex: 1" />
|
||||
<l-button type="default" disabled="{{oakExecuting || !oakDirty}}" loading="{{oakExecuting}}" size="long" bind:lintap="confirmMp">
|
||||
{{t('common:action.confirm')}}
|
||||
</l-button>
|
||||
</l-button>
|
||||
</view>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue