完善余额功能
This commit is contained in:
@ -101,13 +101,19 @@ var components
|
||||
try {
|
||||
components = {
|
||||
uInput: function () {
|
||||
return Promise.all(/*! import() | components/uview-ui/components/u-input/u-input */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/uview-ui/components/u-input/u-input")]).then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-input/u-input.vue */ 446))
|
||||
return Promise.all(/*! import() | components/uview-ui/components/u-input/u-input */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/uview-ui/components/u-input/u-input")]).then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-input/u-input.vue */ 463))
|
||||
},
|
||||
priceFormat: function () {
|
||||
return __webpack_require__.e(/*! import() | components/price-format/price-format */ "components/price-format/price-format").then(__webpack_require__.bind(null, /*! @/components/price-format/price-format.vue */ 374))
|
||||
return __webpack_require__.e(/*! import() | components/price-format/price-format */ "components/price-format/price-format").then(__webpack_require__.bind(null, /*! @/components/price-format/price-format.vue */ 391))
|
||||
},
|
||||
uButton: function () {
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-button/u-button */ "components/uview-ui/components/u-button/u-button").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-button/u-button.vue */ 334))
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-button/u-button */ "components/uview-ui/components/u-button/u-button").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-button/u-button.vue */ 351))
|
||||
},
|
||||
uPopup: function () {
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-popup/u-popup */ "components/uview-ui/components/u-popup/u-popup").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-popup/u-popup.vue */ 522))
|
||||
},
|
||||
loadingView: function () {
|
||||
return __webpack_require__.e(/*! import() | components/loading-view/loading-view */ "components/loading-view/loading-view").then(__webpack_require__.bind(null, /*! @/components/loading-view/loading-view.vue */ 557))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
@ -179,6 +185,23 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _user = __webpack_require__(/*! @/api/user */ 30);
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -259,26 +282,82 @@ var _default = {
|
||||
bgImageHeight: 244,
|
||||
// 背景图高度,单位px,根据实际情况调整
|
||||
selectIndex: 0,
|
||||
backText: '',
|
||||
topSpace: 0
|
||||
topSpace: 0,
|
||||
rechargeTemplate: [],
|
||||
userInfo: {
|
||||
user_money: 0 // Provide a default value to avoid undefined
|
||||
},
|
||||
|
||||
showLoading: false,
|
||||
showPopup: false,
|
||||
rechargeInfo: {},
|
||||
number: '' // 输入金额
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad() {
|
||||
var _this = this;
|
||||
uni.$on('payment', function (params) {
|
||||
if (params.result) {
|
||||
_this.onShowPopup();
|
||||
_this.getUserInfoFun();
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
var systemInfo = uni.getSystemInfoSync();
|
||||
this.statusBarHeight = systemInfo.statusBarHeight;
|
||||
this.topSpace = 80 + 44;
|
||||
this.rechargeTemplateFun();
|
||||
this.getUserInfoFun();
|
||||
},
|
||||
onUnload: function onUnload() {
|
||||
uni.$off('payment');
|
||||
},
|
||||
methods: {
|
||||
// 跳转个人信息
|
||||
toProfile: function toProfile() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/profile'
|
||||
onShowPopup: function onShowPopup() {
|
||||
this.showPopup = !this.showPopup;
|
||||
},
|
||||
// 获取充值模板列表
|
||||
rechargeTemplateFun: function rechargeTemplateFun() {
|
||||
var _this2 = this;
|
||||
(0, _user.rechargeTemplate)().then(function (res) {
|
||||
if (res.code == 1) {
|
||||
_this2.rechargeTemplate = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 跳转我的钱包
|
||||
toWallet: function toWallet() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/wallet'
|
||||
// 获取用户信息
|
||||
getUserInfoFun: function getUserInfoFun() {
|
||||
var _this3 = this;
|
||||
(0, _user.getUser)().then(function (res) {
|
||||
if (res.code == 1) {
|
||||
_this3.userInfo = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
rechargeNow: function rechargeNow() {
|
||||
var number = this.number;
|
||||
console.log("number>>>", number);
|
||||
this.rechargeFun({
|
||||
money: Number(number)
|
||||
});
|
||||
},
|
||||
// 充值
|
||||
rechargeFun: function rechargeFun(obj) {
|
||||
var _this4 = this;
|
||||
this.showLoading = true;
|
||||
(0, _user.recharge)(obj).then(function (_ref) {
|
||||
var code = _ref.code,
|
||||
data = _ref.data,
|
||||
msg = _ref.msg;
|
||||
if (code != 1) throw new Error(msg);
|
||||
_this4.rechargeInfo = data;
|
||||
uni.navigateTo({
|
||||
url: "/pages/recharge/recharge?from=".concat('recharge', "&order_id=", data.id)
|
||||
});
|
||||
}).catch(function (err) {
|
||||
console.log(err);
|
||||
}).finally(function () {
|
||||
_this4.showLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user