1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:///D:/老农商城/mall-laonong/pagesA/recharge/recharge.vue?4134","webpack:///D:/老农商城/mall-laonong/pagesA/recharge/recharge.vue?78ed","webpack:///D:/老农商城/mall-laonong/pagesA/recharge/recharge.vue?d5d5","webpack:///D:/老农商城/mall-laonong/pagesA/recharge/recharge.vue?3b54","uni-app:///pagesA/recharge/recharge.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;kDAAA;;;AAGA;AACA,sG,8FAHA;AACAA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC,CAGAC,UAAU,CAACC,iBAAD,CAAV,C;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AAAqH;AACrH;AAC4D;AACL;;;AAGvD;AACoL;AACpL,gBAAgB,2LAAU;AAC1B,EAAE,8EAAM;AACR,EAAE,mFAAM;AACR,EAAE,4FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,uFAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACtBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,oMAEN;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AClEA;AAAA;AAAA;AAAA;AAA0rB,CAAgB,wrBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuD9sB;AACA,MADA,kBACA;AACA;AACA,oBADA,EACA;AACA,oBAFA,EAEA;AACA,qBAHA,EAGA;AACA,sBAJA,EAIA;AACA,iBALA,EAKA;AACA,gBANA;AAOA,sBAPA;;AASA,GAXA;AAYA,QAZA,oBAYA;AACA;AACA;AACA;AACA;AACA,GAjBA;AAkBA;AACA;AACA,eAFA,yBAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAPA;AAQA,KAXA;;AAaA;AACA,iBAdA,2BAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBADA;AAEA,6BAFA;AAGA,+BAHA;AAIA,+BAJA;AAKA,iCALA;;AAOA;AACA,WATA;AAUA;AACA;AACA;AACA,OAjBA;AAkBA,KAjCA;;AAmCA;AACA,oBApCA,8BAoCA;AACA;AACA,oBADA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAPA;AAQA,KAhDA;;AAkDA;AACA,gBAnDA,wBAmDA,KAnDA,EAmDA;AACA;AACA;AACA;AACA;AACA,KAxDA;;AA0DA;AACA,YA3DA,sBA2DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAJA,MAIA;AACA;AACA;AACA,SARA;AASA;AACA,KAvEA;;AAyEA;AACA,eA1EA,uBA0EA,IA1EA,EA0EA;AACA;AACA;AACA,mCADA;AAEA,iCAFA;AAGA,+BAHA;AAIA,iCAJA;AAKA,4BALA;AAMA;AACA;AACA;AACA,SATA;AAUA;AACA;AACA,SAZA;;AAcA,KA1FA;;AA4FA;AACA,iBA7FA,yBA6FA,MA7FA,EA6FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAFA,EAEA,IAFA;AAGA,SARA,MAQA;AACA;AACA;AACA;AACA,WAFA,EAEA,IAFA;AAGA;AACA,OAfA;AAgBA,KA9GA,EAlBA,E","file":"pagesA/recharge/recharge.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pagesA/recharge/recharge.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./recharge.vue?vue&type=template&id=2511df8b&\"\nvar renderjs\nimport script from \"./recharge.vue?vue&type=script&lang=js&\"\nexport * from \"./recharge.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pagesA/recharge/recharge.vue\"\nexport default component.exports","export * from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./recharge.vue?vue&type=template&id=2511df8b&\"","var components\ntry {\n components = {\n statusNav: function() {\n return import(\n /* webpackChunkName: \"components/status-nav/status-nav\" */ \"@/components/status-nav/status-nav.vue\"\n )\n }\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var l0 = _vm.isLoading\n ? _vm.__map(_vm.amountList, function(item, index) {\n var $orig = _vm.__get_orig(item)\n\n var m0 = parseInt(item.money)\n var m1 = parseInt(item.price)\n return {\n $orig: $orig,\n m0: m0,\n m1: m1\n }\n })\n : null\n var l1 = _vm.isLoading\n ? _vm.__map(_vm.detailedList, function(item, index) {\n var $orig = _vm.__get_orig(item)\n\n var m2 = parseFloat(item.money)\n return {\n $orig: $orig,\n m2: m2\n }\n })\n : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n l0: l0,\n l1: l1\n }\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./recharge.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./recharge.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"pad-x170\" v-if=\"isLoading\">\r\n\t\t<status-nav :ifReturn=\"true\" navBarTitle=\"我的余额\" :marginBottom=\"0\"></status-nav>\r\n\t\t<!-- 余额概况 -->\r\n\t\t<view class=\"recharge border-box\">\r\n\t\t\t<view class=\"recharge-msg radius30 border-box\">\r\n\t\t\t\t<view class=\"txt flex\">\r\n\t\t\t\t\t<text class=\"font30\">我的余额</text>\r\n\t\t\t\t\t<text class=\"font24\">余额可用于购物使用</text>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"price font60\"><text class=\"font48\">¥</text>{{balance}}</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 充值金额 -->\r\n\t\t<view class=\"recharge-amount border-box pad-all20 mar-s20\">\r\n\t\t\t<view class=\"recharge-title font30 flex\">\r\n\t\t\t\t<view class=\"line background-orange\"></view>\r\n\t\t\t\t<text>充值金额</text>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"amount-list flex\">\r\n\t\t\t\t<view class=\"amount-item border-box radius20 mar-s25\" @tap=\"changeAmount(index)\" :class=\"index==amountIndex?'checked':''\" v-for=\"(item,index) in amountList\" :key=\"index\">\r\n\t\t\t\t\t<view class=\"font48 mar-s15\">{{parseInt(item.money)}}元</view>\r\n\t\t\t\t\t<text class=\"font24\">售价{{parseInt(item.price)}}元</text>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 明细 -->\r\n\t\t<view class=\"recharge-detailed border-box pad-all20 mar-s20\">\r\n\t\t\t<view class=\"recharge-title font30 flex\">\r\n\t\t\t\t<view class=\"line background-orange\"></view>\r\n\t\t\t\t<text>消费明细</text>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"detailed-list\">\r\n\t\t\t\t<view class=\"detailed-item font30 border-box pad-sx20 flex\" v-for=\"(item,index) in detailedList\" :key=\"index\">\r\n\t\t\t\t\t<view class=\"txt\">\r\n\t\t\t\t\t\t<view class=\"name mar-x10\">{{item.title}}</view>\r\n\t\t\t\t\t\t<view class=\"time font24 color-99\">{{item.create_time}}</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"price\" :class=\"parseFloat(item.money)<0?'color-red':''\">{{item.money}}</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 尾部 -->\r\n\t\t<view class=\"pull-footer-bg background-white pad-all20 radius30 border-box\">\r\n\t\t\t<view class=\"pull-footer background-grey radius30 pad-all20 border-box flex\">\r\n\t\t\t\t<view class=\"price color-ff\" style=\"margin-left: 24rpx;\">\r\n\t\t\t\t\t<view class=\"font60 flex\">¥{{amountPrice}}</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"btn font36 color-48 background-orange radius30 flex\" @tap=\"submitEv\">确认充值</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tamountList:[],//充值模板\r\n\t\t\t\tamountIndex:0, //充值选中\r\n\t\t\t\tamountPrice:'', //充值金额\r\n\t\t\t\tdetailedList:[],//明细列表\r\n\t\t\t\tbalance:'', //用户余额\r\n\t\t\t\tflag:true,\r\n\t\t\t\tisLoading:false,\r\n\t\t\t}\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\t// 获取用户信息\r\n\t\t\tthis.getUserInfo();\r\n\t\t\t// 获取充值模板\r\n\t\t\tthis.getAmountMode();\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 获取个人信息\r\n\t\t\tgetUserInfo(){\r\n\t\t\t\tthis.$requst.post('/api/user/info').then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'用户信息');\r\n\t\t\t\t\t\tthis.balance = res.data.balance;\r\n\t\t\t\t\t\t// 获取余额消费记录\r\n\t\t\t\t\t\tthis.getPeiceDetailed();\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 获取充值模板\r\n\t\t\tgetAmountMode(){\r\n\t\t\t\tthis.$requst.post('/api/user/recharge-template-list').then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'充值模板');\r\n\t\t\t\t\t\tlet amountArr = [];\r\n\t\t\t\t\t\tres.data.forEach(item=>{\r\n\t\t\t\t\t\t\tlet amountObj = {\r\n\t\t\t\t\t\t\t\tid:item.id,\r\n\t\t\t\t\t\t\t\tname:item.name,\r\n\t\t\t\t\t\t\t\tmoney:item.money,\r\n\t\t\t\t\t\t\t\tprice:item.price,\r\n\t\t\t\t\t\t\t\tstatus:item.status\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tamountArr.push(amountObj);\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.amountList = amountArr;\r\n\t\t\t\t\t\tthis.amountPrice = this.$toolAll.tools.addXiaoShu(this.amountList[0].price);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 获取余额消费记录\r\n\t\t\tgetPeiceDetailed(){\r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle:'加载中'\r\n\t\t\t\t})\r\n\t\t\t\tthis.$requst.post('/api/user/balance-log-list',{template_id:this.amountList[this.amountIndex].id}).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'余额记录');\r\n\t\t\t\t\t\tthis.detailedList = res.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tuni.hideLoading();\r\n\t\t\t\t\tthis.isLoading = true;\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择充值金额\r\n\t\t\tchangeAmount(index){\r\n\t\t\t\tif(index!==this.amountIndex){\r\n\t\t\t\t\tthis.amountIndex = index;\r\n\t\t\t\t\tthis.amountPrice = this.$toolAll.tools.addXiaoShu(this.amountList[index].price);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 发起充值\r\n\t\t\tsubmitEv(){\r\n\t\t\t\tif(this.flag){\r\n\t\t\t\t\tthis.$requst.post('/api/recharge/create',{template_id:this.amountList[this.amountIndex].id}).then(res=>{\r\n\t\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\t\tconsole.log(res,'发起充值');\r\n\t\t\t\t\t\t\t// 调用微信支付\r\n\t\t\t\t\t\t\tthis.callPayMent(res.data);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 调用微信支付\r\n\t\t\tcallPayMent(data){\r\n\t\t\t\t//调起支付\r\n\t\t\t\twx.requestPayment({ \r\n\t\t\t\t\t'timeStamp': data.timeStamp,\r\n\t\t\t\t\t'nonceStr': data.nonceStr,\r\n\t\t\t\t\t'package': data.package,\r\n\t\t\t\t\t\"signType\": data.signType,\r\n\t\t\t\t\t'paySign': data.sign,\r\n\t\t\t\t\t'success': (res)=> { // 接口调用成功的回调函数\r\n\t\t\t\t\t\tconsole.log('支付成功:',res);\r\n\t\t\t\t\t\tthis.amountConfirm(data.coding);\r\n\t\t\t\t\t},\r\n\t\t\t\t\t'fail': function (res) { // 接口调用失败的回调函数\r\n\t\t\t\t\t\tconsole.log('支付失败:' + JSON.stringify(res));\r\n\t\t\t\t\t}\r\n\t\t\t\t })\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 确认充值\r\n\t\t\tamountConfirm(coding){\r\n\t\t\t\tthis.$requst.post('/api/recharge/paid',{order_coding:coding}).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'充值成功');\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('充值成功');\r\n\t\t\t\t\t\t// 重新获取用户信息\r\n\t\t\t\t\t\tthis.getUserInfo();\r\n\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\tthis.flag = true;\r\n\t\t\t\t\t\t},1200)\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\tthis.flag = true;\r\n\t\t\t\t\t\t},1200)\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t\r\n</style>\r\n"],"sourceRoot":""} |