pay.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pages/money/pay"],{
  2. /***/ 178:
  3. /*!***********************************************************!*\
  4. !*** D:/2022/9/sx/main.js?{"page":"pages%2Fmoney%2Fpay"} ***!
  5. \***********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(wx, createPage) {
  10. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11. __webpack_require__(/*! uni-pages */ 26);
  12. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  13. var _pay = _interopRequireDefault(__webpack_require__(/*! ./pages/money/pay.vue */ 179));
  14. // @ts-ignore
  15. wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
  16. createPage(_pay.default);
  17. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["createPage"]))
  18. /***/ }),
  19. /***/ 179:
  20. /*!****************************************!*\
  21. !*** D:/2022/9/sx/pages/money/pay.vue ***!
  22. \****************************************/
  23. /*! no static exports found */
  24. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25. "use strict";
  26. __webpack_require__.r(__webpack_exports__);
  27. /* harmony import */ var _pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pay.vue?vue&type=template&id=5f7de3a0& */ 180);
  28. /* harmony import */ var _pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pay.vue?vue&type=script&lang=js& */ 182);
  29. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  30. /* harmony import */ var _pay_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pay.vue?vue&type=style&index=0&lang=scss& */ 185);
  31. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 35);
  32. var renderjs
  33. /* normalize component */
  34. var component = Object(_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  35. _pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  36. _pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__["render"],
  37. _pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  38. false,
  39. null,
  40. null,
  41. null,
  42. false,
  43. _pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__["components"],
  44. renderjs
  45. )
  46. component.options.__file = "pages/money/pay.vue"
  47. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  48. /***/ }),
  49. /***/ 180:
  50. /*!***********************************************************************!*\
  51. !*** D:/2022/9/sx/pages/money/pay.vue?vue&type=template&id=5f7de3a0& ***!
  52. \***********************************************************************/
  53. /*! exports provided: render, staticRenderFns, recyclableRender, components */
  54. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55. "use strict";
  56. __webpack_require__.r(__webpack_exports__);
  57. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./pay.vue?vue&type=template&id=5f7de3a0& */ 181);
  58. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  59. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
  61. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_template_id_5f7de3a0___WEBPACK_IMPORTED_MODULE_0__["components"]; });
  62. /***/ }),
  63. /***/ 181:
  64. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  65. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/2022/9/sx/pages/money/pay.vue?vue&type=template&id=5f7de3a0& ***!
  66. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  67. /*! exports provided: render, staticRenderFns, recyclableRender, components */
  68. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69. "use strict";
  70. __webpack_require__.r(__webpack_exports__);
  71. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  72. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  73. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
  74. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
  75. var components
  76. var render = function () {
  77. var _vm = this
  78. var _h = _vm.$createElement
  79. var _c = _vm._self._c || _h
  80. if (!_vm._isMounted) {
  81. _vm.e0 = function ($event) {
  82. !_vm.payLoding ? _vm.confirm() : ""
  83. }
  84. }
  85. }
  86. var recyclableRender = false
  87. var staticRenderFns = []
  88. render._withStripped = true
  89. /***/ }),
  90. /***/ 182:
  91. /*!*****************************************************************!*\
  92. !*** D:/2022/9/sx/pages/money/pay.vue?vue&type=script&lang=js& ***!
  93. \*****************************************************************/
  94. /*! no static exports found */
  95. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96. "use strict";
  97. __webpack_require__.r(__webpack_exports__);
  98. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./pay.vue?vue&type=script&lang=js& */ 183);
  99. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  100. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  101. /* harmony default export */ __webpack_exports__["default"] = (_E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  102. /***/ }),
  103. /***/ 183:
  104. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/2022/9/sx/pages/money/pay.vue?vue&type=script&lang=js& ***!
  106. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  107. /*! no static exports found */
  108. /***/ (function(module, exports, __webpack_require__) {
  109. "use strict";
  110. /* WEBPACK VAR INJECTION */(function(uni, wx) {
  111. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  112. Object.defineProperty(exports, "__esModule", {
  113. value: true
  114. });
  115. exports.default = void 0;
  116. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 42));
  117. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 44));
  118. var _wallet = __webpack_require__(/*! @/api/wallet.js */ 184);
  119. var _order = __webpack_require__(/*! @/api/order.js */ 142);
  120. var _vuex = __webpack_require__(/*! vuex */ 28);
  121. //
  122. //
  123. //
  124. //
  125. //
  126. //
  127. //
  128. //
  129. //
  130. //
  131. //
  132. //
  133. //
  134. //
  135. //
  136. //
  137. //
  138. //
  139. //
  140. //
  141. //
  142. //
  143. //
  144. //
  145. //
  146. //
  147. //
  148. //
  149. //
  150. //
  151. //
  152. //
  153. //
  154. //
  155. //
  156. var _default = {
  157. data: function data() {
  158. return {
  159. payType: 1,
  160. //支付类型
  161. payName: 'weixin',
  162. orderInfo: {},
  163. money: 0.0,
  164. //订单金额
  165. now_money: 0.0,
  166. //余额
  167. orderKey: '',
  168. orderId: '',
  169. //保存订单id
  170. payLoding: false,
  171. //判断是否支付中
  172. type: '',
  173. //判断是否从订单中进入
  174. pinkid: '' //保存拼团商品id
  175. };
  176. },
  177. computed: {},
  178. onLoad: function onLoad(options) {
  179. var _this = this;
  180. if (options.type == 1) {
  181. this.type = 1;
  182. this.orderId = options.ordid;
  183. this.money = options.money;
  184. } else {
  185. this.orderKey = options.key;
  186. var prepage = this.$api.prePage();
  187. (0, _order.computedOrderkey)({
  188. orderkey: this.orderKey,
  189. couponId: prepage.couponChecked.id,
  190. //优惠券编号
  191. addressId: prepage.addressData.id,
  192. //地址编号
  193. useIntegral: prepage.checkedPoints ? 1 : 0
  194. }).then(function (_ref) {
  195. var data = _ref.data;
  196. // 获取支付金额
  197. _this.money = data.result.pay_price;
  198. });
  199. }
  200. // 保存pinkid
  201. if (options.pinkid) {
  202. this.pinkid = options.pinkid;
  203. }
  204. // 载入余额
  205. (0, _wallet.balance)({}).then(function (_ref2) {
  206. var data = _ref2.data;
  207. // 获取余额
  208. _this.now_money = data.now_money;
  209. });
  210. },
  211. methods: {
  212. //选择支付方式
  213. changePayType: function changePayType(type) {
  214. this.payType = type;
  215. if (this.payType == 1) {
  216. this.payName = 'weixin';
  217. }
  218. if (this.payType == 2) {
  219. this.payName = 'ali';
  220. }
  221. if (this.payType == 3) {
  222. this.payName = 'yue';
  223. }
  224. },
  225. // 支付金额
  226. orderMoneyPay: function orderMoneyPay() {
  227. var obj = this;
  228. (0, _order.orderPay)({
  229. uni: obj.orderId,
  230. from: 'routine',
  231. //来源
  232. paytype: obj.payName //支付类型 weixin-微信 yue-余额
  233. }).then(function (e) {
  234. // 判断是否为余额支付
  235. if (obj.payName == 'yue' && e.data.status == 'SUCCESS') {
  236. if (e.status == 200) {
  237. obj.paySuccessTo();
  238. } else {
  239. obj.$api.msg(msg);
  240. }
  241. }
  242. if (obj.payName == 'weixin' || obj.payName == 'routine') {
  243. var da = e.data.result.jsConfig;
  244. var data = {
  245. timeStamp: da.timestamp,
  246. nonceStr: da.nonceStr,
  247. package: da.package,
  248. signType: da.signType,
  249. paySign: da.paySign,
  250. success: function success(res) {
  251. obj.paySuccessTo();
  252. },
  253. fail: function fail() {
  254. uni.navigateTo({
  255. url: '/pages/order/order?state=0'
  256. });
  257. }
  258. };
  259. if (obj.payName == 'routine') {
  260. wx.requestPayment(data);
  261. }
  262. }
  263. uni.hideLoading();
  264. obj.payLoding = false;
  265. }).catch(function (e) {
  266. // 支付完成
  267. uni.hideLoading();
  268. obj.payLoding = false;
  269. console.log(e);
  270. });
  271. },
  272. // 支付成功跳转
  273. paySuccessTo: function paySuccessTo() {
  274. uni.hideLoading();
  275. uni.redirectTo({
  276. url: '/pages/money/paySuccess?orderid=' + this.orderId
  277. });
  278. },
  279. //确认支付
  280. confirm: function () {
  281. var _confirm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  282. var obj;
  283. return _regenerator.default.wrap(function _callee$(_context) {
  284. while (1) {
  285. switch (_context.prev = _context.next) {
  286. case 0:
  287. obj = this;
  288. uni.showLoading({
  289. title: '支付中',
  290. mask: true
  291. });
  292. // 判断是否余额不足
  293. if (!(obj.payName == 'yue' && +obj.now_money < obj.money)) {
  294. _context.next = 5;
  295. break;
  296. }
  297. uni.showModal({
  298. title: '提示',
  299. content: '账户余额不足!',
  300. showCancel: false,
  301. success: function success(res) {},
  302. fail: function fail() {},
  303. complete: function complete() {}
  304. });
  305. return _context.abrupt("return");
  306. case 5:
  307. // 支付中
  308. obj.payLoding = true;
  309. // 判断是否为未支付订单中跳转进入
  310. if (obj.type != 1) {
  311. // 初次生成订单
  312. obj.firstCreateOrder();
  313. } else {
  314. // 已经生成订单未支付
  315. obj.orderMoneyPay();
  316. }
  317. case 7:
  318. case "end":
  319. return _context.stop();
  320. }
  321. }
  322. }, _callee, this);
  323. }));
  324. function confirm() {
  325. return _confirm.apply(this, arguments);
  326. }
  327. return confirm;
  328. }(),
  329. // 初次订单创建
  330. firstCreateOrder: function firstCreateOrder() {
  331. var obj = this;
  332. // 获取下单页面数据
  333. var prepage = obj.$api.prePage();
  334. var data = {
  335. real_name: prepage.addressData.real_name,
  336. //联系人名称
  337. phone: prepage.addressData.phone,
  338. //联系人号码
  339. couponId: prepage.couponChecked.id,
  340. //优惠券编号
  341. addressId: prepage.addressData.id,
  342. //支付地址id
  343. useIntegral: prepage.checkedPoints ? 1 : 0,
  344. //是否积分抵扣1为是0为否
  345. payType: obj.payName,
  346. //支付类型 weixin-微信 yue-余额
  347. mark: prepage.desc,
  348. //备注
  349. from: 'routine',
  350. //来源
  351. shipping_type: 1 //提货方式 1 快递 2自提
  352. };
  353. // 判断是否拼团商品
  354. if (obj.pinkid) {
  355. data.pinkId = obj.pinkid;
  356. }
  357. // 生成订单
  358. (0, _order.createOrderkey)(data, obj.orderKey).then(function (_ref3) {
  359. var data = _ref3.data,
  360. status = _ref3.status,
  361. msg = _ref3.msg;
  362. // 判断是否支付失败
  363. if (data.status == 'ORDER_EXIST') {
  364. uni.showModal({
  365. title: '提示',
  366. content: msg,
  367. showCancel: false
  368. });
  369. uni.hideLoading();
  370. obj.payLoding = false;
  371. return;
  372. }
  373. // 保存订单号
  374. obj.orderId = data.result.orderId;
  375. // 判断是否为余额支付
  376. if (obj.payName == 'yue') {
  377. if (status == 200 && data.status == 'SUCCESS') {
  378. obj.paySuccessTo();
  379. } else {
  380. obj.$api.msg(msg);
  381. }
  382. } else {
  383. // 立即支付
  384. obj.orderMoneyPay();
  385. }
  386. }).catch(function (e) {
  387. uni.hideLoading();
  388. obj.payLoding = false;
  389. console.log(e);
  390. });
  391. }
  392. }
  393. };
  394. exports.default = _default;
  395. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  396. /***/ }),
  397. /***/ 185:
  398. /*!**************************************************************************!*\
  399. !*** D:/2022/9/sx/pages/money/pay.vue?vue&type=style&index=0&lang=scss& ***!
  400. \**************************************************************************/
  401. /*! no static exports found */
  402. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  403. "use strict";
  404. __webpack_require__.r(__webpack_exports__);
  405. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./pay.vue?vue&type=style&index=0&lang=scss& */ 186);
  406. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
  407. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  408. /* harmony default export */ __webpack_exports__["default"] = (_E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_pay_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
  409. /***/ }),
  410. /***/ 186:
  411. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  412. !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/2022/9/sx/pages/money/pay.vue?vue&type=style&index=0&lang=scss& ***!
  413. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  414. /*! no static exports found */
  415. /***/ (function(module, exports, __webpack_require__) {
  416. // extracted by mini-css-extract-plugin
  417. if(false) { var cssReload; }
  418. /***/ })
  419. },[[178,"common/runtime","common/vendor"]]]);
  420. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/money/pay.js.map