Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-471abf95.9740cec5.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
5.2 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-471abf95"],{"4f21":function(o,t,e){"use strict";e("97fb")},"97fb":function(o,t,e){},d0ce7:function(o,t,e){"use strict";e.r(t);var l=function(){var o=this,t=o._self._c;return t("div",[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[o._v("购买优惠券")]),t("div",[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:o._closeBuyGold}},[t("i",{staticClass:"el-icon-close"}),o._v(" 返回 ")])],1)]),t("div",{staticClass:"card-body"},[t("el-form",{attrs:{"label-position":"right","label-width":"120px"}},[t("el-form-item",{attrs:{label:"优惠券"}},[t("el-input",{attrs:{disabled:"",placeholder:"优惠券"},model:{value:o.buyGoldInfo.couponName,callback:function(t){o.$set(o.buyGoldInfo,"couponName",t)},expression:"buyGoldInfo.couponName"}})],1),t("el-form-item",{attrs:{label:"库存"}},[t("el-input",{attrs:{disabled:"",placeholder:"库存"},model:{value:o.buyGoldInfo.couponStock,callback:function(t){o.$set(o.buyGoldInfo,"couponStock",t)},expression:"buyGoldInfo.couponStock"}})],1),t("el-form-item",{attrs:{label:"优惠券价格"}},[t("el-input",{attrs:{disabled:"",placeholder:"优惠券价格"},model:{value:o.buyGoldInfo.buyPrice,callback:function(t){o.$set(o.buyGoldInfo,"buyPrice",t)},expression:"buyGoldInfo.buyPrice"}})],1),t("el-form-item",{attrs:{label:"优惠券数量"}},[t("el-input",{attrs:{type:"number",placeholder:"必填,请填写购买优惠券数量"},on:{change:o._changeGoldCount},model:{value:o.buyGoldInfo.goldCount,callback:function(t){o.$set(o.buyGoldInfo,"goldCount",t)},expression:"buyGoldInfo.goldCount"}})],1),t("el-form-item",{attrs:{label:"支付金额"}},[t("el-input",{attrs:{disabled:"",placeholder:"支付金额"},model:{value:o.buyGoldInfo.goldMoney,callback:function(t){o.$set(o.buyGoldInfo,"goldMoney",t)},expression:"buyGoldInfo.goldMoney"}})],1)],1)],1)])],1),t("el-col",{staticStyle:{"margin-top":"20px"},attrs:{span:24}},[t("el-button",{staticClass:"float-right",attrs:{type:"primary"},on:{click:o._toBuyGold}},[t("i",{staticClass:"el-icon-check"}),o._v(" 购买 ")])],1)],1),t("el-dialog",{attrs:{title:"扫码支付",visible:o.dialogVisible,width:"70%","before-close":o.handleClose},on:{"update:visible":function(t){o.dialogVisible=t}}},[t("div",{staticClass:"dialog-body"},[t("el-row",[t("el-col",{attrs:{span:24}},[t("h3",{staticClass:"m-t-none m-b"},[o._v("扫码支付")]),t("el-card",{staticClass:"box-card"},[t("el-form",{attrs:{"label-position":"right","label-width":"120px"}},[t("el-form-item",{attrs:{label:"支付二维码"}},[t("el-col",{attrs:{span:8}},[t("div",{staticStyle:{position:"relative"}},[o.buyGoldInfo.showRefresh?t("img",{staticStyle:{position:"absolute",top:"0",left:"15px"},attrs:{src:"/img/qrcode-refresh.png",width:"200",height:"200",alt:""},on:{click:o._changeAppType}}):o._e(),t("div",{staticStyle:{width:"200px",height:"200px"},attrs:{id:"qrcode"}})])]),t("el-col",{attrs:{span:16}},[t("span",[o._v("请用微信扫码支付")])])],1)],1)],1)],1)],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){o.dialogVisible=!1}}},[o._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:o._finishScanQrCode}},[o._v("支付完成")])],1)])],1)},s=[],a=e("d044"),n=e.n(a),i=e("b775");function c(o){return new Promise((t,e)=>{Object(i["a"])({url:"/couponPool.listCouponPool",method:"get",params:o}).then(o=>{const e=o.data;t(e)}).catch(o=>{e(o)})})}function d(o){return new Promise((t,e)=>{Object(i["a"])({url:"/paymentGold/toQrPayGold",method:"post",data:o}).then(o=>{const e=o.data;t(e)}).catch(o=>{e(o)})})}var r=e("7323"),u={name:"BuyGold",data(){return{dialogVisible:!1,buyGoldInfo:{poolId:"",actualPrice:"0",buyPrice:"0",couponName:"0",couponStock:"0",couponType:"",goldCount:"0",goldMoney:"0",payQrCode:"",shopId:Object(r["f"])(),showRefresh:!1}}},created(){this._initData()},methods:{_initData(){this.buyGoldInfo.poolId=this.$route.query.poolId,this._listProducts()},_listProducts(){const o={page:1,poolId:this.buyGoldInfo.poolId,row:1};c(o).then(o=>{const t=o.data[0];Object.assign(this.buyGoldInfo,t),this._changeGoldCount()}).catch(o=>{console.error("请求失败:",o)})},_closeBuyGold(){this.dialogVisible=!1,this.$router.push("/pages/goods/couponShopPoolManage")},_changeGoldCount(){const o=this.buyGoldInfo.buyPrice*this.buyGoldInfo.goldCount;this.buyGoldInfo.goldMoney=o.toFixed(2)},_toBuyGold(){this.buyGoldInfo.payQrCode="",d(this.buyGoldInfo).then(o=>{0===o.code&&(this.buyGoldInfo.payQrCode=o.codeUrl,this._viewQr(this.buyGoldInfo.payQrCode),this.dialogVisible=!0,this.$message.success(o.msg))}).catch(o=>{console.error("请求失败:",o),this.$message.error(o)})},_viewQr(o){document.getElementById("qrcode").innerHTML="",new n.a(document.getElementById("qrcode"),{text:o,width:200,height:200,colorDark:"#000000",colorLight:"#ffffff",correctLevel:n.a.CorrectLevel.H})},_finishScanQrCode(){this._closeBuyGold()},_changeAppType(){console.log("_changeAppType")},handleClose(o){o()}}},p=u,b=(e("4f21"),e("2877")),h=Object(b["a"])(p,l,s,!1,null,"b629e8d6",null);t["default"]=h.exports}}]);
//# sourceMappingURL=chunk-471abf95.9740cec5.js.map