You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
9.5 KiB
1 lines
9.5 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-question-buyTwo"],{"178b":function(e,n,t){"use strict";t("6a54");var i=t("f5bd").default;Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t("2634")),o=i(t("2fdc")),r={data:function(){return{tabIndex:0,range:["微信支付","余额支付"],info:{type:1,children:[]},userInfo:{},isClick:!0}},onReady:function(){this.info=uni.getStorageSync("teamInfo"),this.userInfo=uni.getStorageSync("userInfo"),console.log(this.info)},methods:{toSubmit:function(){var e=this;return(0,o.default)((0,a.default)().mark((function n(){var t,i,o,r,c;return(0,a.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(-1!=e.tabIndex){n.next=3;break}return uni.showToast({icon:"none",title:"请选择支付方式"}),n.abrupt("return");case 3:if(1==e.tabIndex&&(1==e.info.type?e.info.price:2==e.info.type?e.info.children[e.info.idx].price:e.info.children[e.info.idx1].price),0!=e.isClick){n.next=6;break}return n.abrupt("return");case 6:return e.isClick=!1,t=1==e.info.type?e.info.id:2==e.info.type?e.info.children[e.info.idx].id:e.info.children[e.info.idx1].id,n.next=10,e.$api.createOrder({category_id:t});case 10:i=n.sent,o=i.code,r=i.data,c=i.msg,console.log(t,e.info,o),200==o?(e.isClick=!0,e.toPay1(r.order_sn)):(e.isClick=!0,uni.showToast({icon:"none",title:c}));case 16:case"end":return n.stop()}}),n)})))()},toPay:function(e){var n=this;return(0,o.default)((0,a.default)().mark((function t(){var i,o,r,c;return(0,a.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n.$api.payOrder({is_balance:1==n.tabIndex?1:"",order_sn:e});case 2:i=t.sent,o=i.code,r=i.data,c=i.msg,200==o?1==r.is_pay?(uni.removeStorageSync("teamInfo"),wx.redirectTo({url:"/pages/question/buyThree"})):uni.requestPayment({provider:"wxpay",timeStamp:r.pay_data.timeStamp,nonceStr:r.pay_data.nonceStr,package:r.pay_data.package,signType:r.pay_data.signType,paySign:r.pay_data.paySign,success:function(e){uni.removeStorageSync("teamInfo"),uni.redirectTo({url:"/pages/question/buyThree"})},fail:function(e){uni.showToast({icon:"none",title:"支付失败"}),uni.removeStorageSync("teamInfo"),setTimeout((function(){uni.redirectTo({url:"/pages/question/list"})}),2e3)}}):uni.showToast({icon:"none",title:c});case 7:case"end":return t.stop()}}),t)})))()},toPay1:function(e){var n=this;return(0,o.default)((0,a.default)().mark((function t(){var i,o,r,c,s;return(0,a.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n.$api.payOrder({is_balance:1==n.tabIndex?1:"",order_sn:e,is_public:1});case 2:i=t.sent,o=i.code,r=i.data,c=i.msg,200==o?1==r.is_pay?(uni.removeStorageSync("teamInfo"),wx.redirectTo({url:"/pages/question/buyThree"})):(s=function(){console.log(r.pay_data),WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:r.pay_data.appId,timeStamp:r.pay_data.timeStamp,nonceStr:r.pay_data.nonceStr,package:r.pay_data.package,signType:r.pay_data.signType,paySign:r.pay_data.paySign},(function(e){console.log(e),"get_brand_wcpay_request:ok"==e.err_msg&&(uni.showToast({icon:"none",title:"支付成功"}),setTimeout((function(){uni.removeStorageSync("teamInfo"),uni.redirectTo({url:"/pages/question/buyThree"})}),2e3)),"get_brand_wcpay_request:cancel"==e.err_msg&&(uni.showToast({icon:"none",title:"支付失败"}),uni.removeStorageSync("teamInfo"),setTimeout((function(){uni.redirectTo({url:"/pages/question/list"})}),2e3)),"get_brand_wcpay_request:fail"==e.err_msg&&(uni.showToast({icon:"none",title:"支付失败"}),uni.removeStorageSync("teamInfo"),setTimeout((function(){uni.redirectTo({url:"/pages/question/list"})}),2e3)),"调用支付JSAPI缺少参数:total_fee"==e.err_msg&&(uni.showToast({icon:"none",title:e.err_msg}),uni.removeStorageSync("teamInfo"),setTimeout((function(){uni.redirectTo({url:"/pages/question/list"})}),2e3))}))},console.log(22333),"undefined"==typeof WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()):uni.showToast({icon:"none",title:c});case 7:case"end":return t.stop()}}),t)})))()},bindPickerChange:function(e){this.tabIndex=e},openPage:function(){uni.navigateTo({url:"/pages/question/buyThree"})}}};n.default=r},"26c7":function(e,n,t){"use strict";t.r(n);var i=t("178b"),a=t.n(i);for(var o in i)["default"].indexOf(o)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(o);n["default"]=a.a},5153:function(e,n,t){var i=t("c86c");n=i(!1),n.push([e.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.buyTwo[data-v-0393235c]{width:100%;padding:0 %?25?% %?25?%;overflow:hidden;box-sizing:border-box}.buyTwo-action[data-v-0393235c]{padding:%?30?%;overflow:hidden;display:flex;align-items:center}.buyTwo-action .li[data-v-0393235c]{flex:1;text-align:center;position:relative;font-size:%?26?%;font-weight:400;color:#333}.buyTwo-action .li uni-image[data-v-0393235c]{width:%?110?%;height:%?110?%;display:block;margin:0 auto;margin-bottom:%?20?%}.buyTwo-action .li uni-button[data-v-0393235c]{width:100%;height:100%;position:absolute;left:0;top:0;z-index:2;opacity:0}.buyTwo-con[data-v-0393235c]{margin-top:%?20?%;background:#fff;border-radius:%?20?%;box-sizing:border-box;padding:%?50?% %?30?%;text-align:center}.buyTwo-con .a[data-v-0393235c]{font-size:%?30?%;font-weight:700;color:#222;line-height:2}.buyTwo-con .b[data-v-0393235c]{font-size:%?26?%;color:#666;line-height:2}.buyTwo-con .c[data-v-0393235c]{margin:%?30?% 0 %?10?%;font-size:%?60?%;font-weight:700;color:#f01b1b}.buyTwo-pay[data-v-0393235c]{margin-top:%?20?%;background:#fff;border-radius:%?20?%;box-sizing:border-box;padding:%?50?% %?30?%}.buyTwo-pay .l[data-v-0393235c]{font-size:%?30?%;color:#222}.buyTwo-pay .r[data-v-0393235c]{margin-top:%?30?%}.buyTwo-pay .r .item[data-v-0393235c]{padding:%?20?%;display:flex;align-items:center;font-size:%?30?%;color:#222}.buyTwo-pay .r .item uni-image[data-v-0393235c]{width:%?40?%;height:%?40?%;margin-right:%?20?%}.buyTwo-pay .r .item uni-text[data-v-0393235c]{color:#999;margin-left:%?10?%;font-size:%?26?%}.buyTwo-pay .r .item-on[data-v-0393235c]{color:#38bcff}.buyTwo-btn .btn[data-v-0393235c]{width:%?320?%;line-height:%?98?%;margin:%?70?% auto;font-size:%?30?%;color:#fff;text-align:center;background:linear-gradient(-90deg,#3399ea,#38bcff);border-radius:%?49?%}',""]),e.exports=n},5321:function(e,n,t){var i=t("5153");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var a=t("967d").default;a("695119c1",i,!0,{sourceMap:!1,shadowMode:!1})},6061:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return a})),t.d(n,"a",(function(){}));var i=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-uni-view",{staticClass:"buyTwo"},[t("v-uni-view",{staticClass:"buyTwo-con"},[t("v-uni-view",{staticClass:"a"},[e._v(e._s(e.info.name))]),1!=e.info.type?t("v-uni-view",{staticClass:"b"},[e._v(e._s(2==e.info.type?e.info.children[e.info.idx].name:e.info.children[e.info.idx1].name))]):e._e(),t("v-uni-view",{staticClass:"c"},[e._v("¥"+e._s(1==e.info.type?e.info.price:2==e.info.type?e.info.children[e.info.idx].price:e.info.children[e.info.idx1].price))])],1),t("v-uni-view",{staticClass:"buyTwo-pay"},[t("v-uni-view",{staticClass:"l"},[e._v("支付方式")]),t("v-uni-view",{staticClass:"r"},[t("v-uni-view",{staticClass:"item",class:0==e.tabIndex?"item-on":"",on:{click:function(n){arguments[0]=n=e.$handleEvent(n),e.bindPickerChange(0)}}},[0==e.tabIndex?t("v-uni-image",{attrs:{src:e.staticUrl("/static/icon-select-on.png")}}):t("v-uni-image",{attrs:{src:e.staticUrl("/static/icon-select.png")}}),e._v("微信支付")],1),t("v-uni-view",{staticClass:"item",class:1==e.tabIndex?"item-on":"",on:{click:function(n){arguments[0]=n=e.$handleEvent(n),e.bindPickerChange(1)}}},[1==e.tabIndex?t("v-uni-image",{attrs:{src:e.staticUrl("/static/icon-select-on.png")}}):t("v-uni-image",{attrs:{src:e.staticUrl("/static/icon-select.png")}}),e._v("余额支付"),t("v-uni-text",[e._v("("+e._s("剩余:"+e.userInfo.balance+"元")+")")])],1)],1)],1),t("v-uni-view",{staticClass:"buyTwo-btn"},[t("v-uni-view",{staticClass:"btn",on:{click:function(n){arguments[0]=n=e.$handleEvent(n),e.toSubmit()}}},[e._v("立即支付")])],1)],1)},a=[]},"717c":function(e,n,t){"use strict";t.r(n);var i=t("6061"),a=t("26c7");for(var o in a)["default"].indexOf(o)<0&&function(e){t.d(n,e,(function(){return a[e]}))}(o);t("cea0");var r=t("828b"),c=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"0393235c",null,!1,i["a"],void 0);n["default"]=c.exports},cea0:function(e,n,t){"use strict";var i=t("5321"),a=t.n(i);a.a}}]); |