|  |  |  | 
|---|
|  |  |  | /***/ (function(module, exports, __webpack_require__) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | "use strict"; | 
|---|
|  |  |  | /* WEBPACK VAR INJECTION */(function(uni) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4); | 
|---|
|  |  |  | Object.defineProperty(exports, "__esModule", { | 
|---|
|  |  |  | value: true | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | exports.default = void 0; | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11)); | 
|---|
|  |  |  | var _vuex = __webpack_require__(/*! vuex */ 33); | 
|---|
|  |  |  | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | 
|---|
|  |  |  | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | 
|---|
|  |  |  | var _default = { | 
|---|
|  |  |  | computed: _objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight', 'userInfo', 'token', 'openid'])), | 
|---|
|  |  |  | data: function data() { | 
|---|
|  |  |  | return {}; | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | name: null, | 
|---|
|  |  |  | coverImage: null, | 
|---|
|  |  |  | nickName: null, | 
|---|
|  |  |  | fullCoverImage: null | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShow: function onShow(options) { | 
|---|
|  |  |  | console.log(this.userInfo); | 
|---|
|  |  |  | this.coverImage = this.userInfo.coverImage; | 
|---|
|  |  |  | this.nickName = this.userInfo.nickName; | 
|---|
|  |  |  | this.fullCoverImage = this.userInfo.fullCoverImage; | 
|---|
|  |  |  | this.name = this.userInfo.name; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | onChooseAvatar: function onChooseAvatar(e) { | 
|---|
|  |  |  | var detail = e.detail; | 
|---|
|  |  |  | var that = this; | 
|---|
|  |  |  | uni.compressImage({ | 
|---|
|  |  |  | src: detail.avatarUrl, | 
|---|
|  |  |  | quality: 80, | 
|---|
|  |  |  | success: function success(res) { | 
|---|
|  |  |  | that.uploadFile(res.tempFilePath); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | uploadFile: function uploadFile(fileUrl) { | 
|---|
|  |  |  | var that = this; | 
|---|
|  |  |  | console.log(fileUrl, 'fileUrl'); | 
|---|
|  |  |  | uni.uploadFile({ | 
|---|
|  |  |  | url: this.$baseUrl + 'web/public/upload', | 
|---|
|  |  |  | filePath: fileUrl, | 
|---|
|  |  |  | name: 'file', | 
|---|
|  |  |  | formData: { | 
|---|
|  |  |  | 'folder': 'member' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | success: function success(data) { | 
|---|
|  |  |  | var res = JSON.parse(data.data); | 
|---|
|  |  |  | that.coverImage = res.data.imgaddr; | 
|---|
|  |  |  | that.fullCoverImage = res.data.url; | 
|---|
|  |  |  | that.updateMemberInfo(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | fail: function fail(e) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '上传失败', | 
|---|
|  |  |  | duration: 2000, | 
|---|
|  |  |  | icon: "none" | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | updateMemberInfo: function updateMemberInfo() { | 
|---|
|  |  |  | var _this = this; | 
|---|
|  |  |  | if ((!this.name || this.name.trim() == '') && (!this.nickName || this.nickName.trim() == '') && (!this.coverImage || this.coverImage.trim() == '')) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '对不起,请按要求填写信息!', | 
|---|
|  |  |  | icon: "none", | 
|---|
|  |  |  | duration: 2000 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var that = this; | 
|---|
|  |  |  | this.$u.api.editMemberInfo({ | 
|---|
|  |  |  | name: that.name, | 
|---|
|  |  |  | nickName: that.nickName, | 
|---|
|  |  |  | coverImage: that.coverImage | 
|---|
|  |  |  | }).then(function (res) { | 
|---|
|  |  |  | that.userInfo.name = _this.name; | 
|---|
|  |  |  | that.userInfo.nickName = _this.nickName; | 
|---|
|  |  |  | that.userInfo.coverImage = _this.coverImage; | 
|---|
|  |  |  | that.userInfo.fullCoverImage = _this.fullCoverImage; | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '更新成功', | 
|---|
|  |  |  | icon: "none", | 
|---|
|  |  |  | duration: 2000 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | exports.default = _default; | 
|---|
|  |  |  | /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"])) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /***/ }), | 
|---|
|  |  |  |  | 
|---|