1 line
11 KiB
Plaintext
1 line
11 KiB
Plaintext
{"version":3,"sources":["uni-app:///main.js","webpack:///D:/老农商城/mall-laonong/pagesA/coupon/coupon.vue?ca18","webpack:///D:/老农商城/mall-laonong/pagesA/coupon/coupon.vue?8366","webpack:///D:/老农商城/mall-laonong/pagesA/coupon/coupon.vue?fff7","webpack:///D:/老农商城/mall-laonong/pagesA/coupon/coupon.vue?3130","uni-app:///pagesA/coupon/coupon.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;kDAAA;;;AAGA;AACA,gG,8FAHA;AACAA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC,CAGAC,UAAU,CAACC,eAAD,CAAV,C;;;;;;;;;;;;;ACLA;AAAA;AAAA;AAAA;AAAA;AAAmH;AACnH;AAC0D;AACL;;;AAGrD;AACoL;AACpL,gBAAgB,2LAAU;AAC1B,EAAE,4EAAM;AACR,EAAE,iFAAM;AACR,EAAE,0FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,qFAAU;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;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC1DA;AAAA;AAAA;AAAA;AAAwrB,CAAgB,srBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0B5sB;AACA,MADA,kBACA;AACA;AACA;AACA,qCADA;AAEA,sCAFA;AAGA,sCAHA,CADA;AAKA;AACA,iBANA,EAMA;AACA,oBAPA,EAOA;AACA,aARA;AASA,cATA;AAUA,mBAVA;AAWA,sBAXA;;AAaA,GAfA;AAgBA,QAhBA,kBAgBA,EAhBA,EAgBA;AACA;AACA;AACA;AACA,GApBA;AAqBA,QArBA,oBAqBA;AACA;AACA,GAvBA;AAwBA,eAxBA,2BAwBA;AACA;AACA;AACA;AACA;AACA;AACA,GA9BA;AA+BA;AACA;AACA,eAFA,yBAEA;AACA;AACA,oBADA;;AAGA;AACA,uBADA;AAEA,uBAFA;AAGA,+CAHA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAVA;AAWA,KAtBA;AAuBA;AACA,SAxBA,mBAwBA;AACA;AACA;AACA,iCADA;;AAGA,KA7BA;AA8BA;AACA,aA/BA,qBA+BA,EA/BA,EA+BA,KA/BA,EA+BA;AACA;AACA;AACA;AACA;AACA,SAHA,MAGA;AACA;AACA;AACA,OAPA;AAQA,KAxCA;AAyCA;AACA,aA1CA,qBA0CA,KA1CA,EA0CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KApDA,EA/BA,E","file":"pagesA/coupon/coupon.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pagesA/coupon/coupon.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./coupon.vue?vue&type=template&id=5c3582aa&\"\nvar renderjs\nimport script from \"./coupon.vue?vue&type=script&lang=js&\"\nexport * from \"./coupon.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/coupon/coupon.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!./coupon.vue?vue&type=template&id=5c3582aa&\"","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.couponList, function(item, index) {\n var $orig = _vm.__get_orig(item)\n\n var g0 = item.amount.split(\".\")\n var g1 = item.amount.split(\".\")\n var m0 = parseInt(item.condition)\n var m1 = parseInt(item.amount)\n return {\n $orig: $orig,\n g0: g0,\n g1: g1,\n m0: m0,\n m1: m1\n }\n })\n : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n l0: l0\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!./coupon.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!./coupon.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view 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=\"record-nav border-box flex\" style=\"background-color: #f5f5f5;padding: 40rpx 20rpx;margin: 0;\">\r\n\t\t\t<view class=\"item color-8c radius20 border-box\" :class=\"index==navIndex?'cur':''\" v-for=\"(item,index) in navList\" :key=\"index\" @tap=\"changeNav(index)\">{{item.title}}</view>\r\n\t\t</view>\r\n\t\t<!-- 优惠券列表 -->\r\n\t\t<view class=\"coupon-list pad-zy20 border-box\">\r\n\t\t\t<view class=\"coupon-item radius30 mar-s40 flex\" :class=\"navIndex==2?'grey':''\" v-for=\"(item,index) in couponList\" :key=\"index\">\r\n\t\t\t\t<view class=\"price color-ff border-box\"><text class=\"font30\">¥</text>{{item.amount.split(\".\")[0]}}<text class=\"font30\">{{'.'+item.amount.split(\".\")[1]}}</text></view>\r\n\t\t\t\t<view class=\"txt\">\r\n\t\t\t\t\t<view class=\"font36\">{{item.name}}</view>\r\n\t\t\t\t\t<view class=\"font24 color-8c mar-s10\">满{{parseInt(item.condition)}}减{{parseInt(item.amount)}}</view>\r\n\t\t\t\t\t<view class=\"font24 color-8c mar-s10\">{{item.begin_at}}至{{item.end_at}}</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"btn mar-zy20 color-ff font24\" v-if=\"navIndex==0\" @tap=\"useEv\">使用</view>\r\n\t\t\t\t<view class=\"btn mar-zy20 color-ff font24\" v-if=\"navIndex==1\" @tap=\"receiveEv(item.id,index)\">领取</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<!-- 到底啦 -->\r\n\t\t<view class=\"no-more font24\" v-if=\"noMore\" style=\"margin-top: 20rpx;\"><text>—— 到底啦 ——</text></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\tnavList:[\r\n\t\t\t\t\t{title:'已领取',tag:'normal'},\r\n\t\t\t\t\t{title:'可领取',tag:'waiting'},\r\n\t\t\t\t\t{title:'已过期',tag:'invalid'}\r\n\t\t\t\t], //导航数据\r\n\t\t\t\tnavIndex:0, //导航位置\r\n\t\t\t\tcouponList:[], //优惠券列表\r\n\t\t\t\tpage:1,\r\n\t\t\t\tsize:10,\r\n\t\t\t\tnoMore:false,\r\n\t\t\t\tisLoading:false,\r\n\t\t\t}\r\n\t\t},\r\n\t\tonLoad(op) {\r\n\t\t\tif(op.index){\r\n\t\t\t\tthis.navIndex = op.index;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\tthis.getCouponEv();\r\n\t\t},\r\n\t\tonReachBottom() {\r\n\t\t\tif(!this.noMore){\r\n\t\t\t\tthis.page++;\r\n\t\t\t\t// 查询优惠券\r\n\t\t\t\tthis.getCouponEv();\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 查询优惠券\r\n\t\t\tgetCouponEv(){\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\tlet params = {\r\n\t\t\t\t\tpage:this.page,\r\n\t\t\t\t\tsize:this.size,\r\n\t\t\t\t\tstatus:this.navList[this.navIndex].tag\r\n\t\t\t\t}\r\n\t\t\t\tthis.$requst.post('/api/user/get-coupon-list',params).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\tif(res.data.length == 0){\r\n\t\t\t\t\t\t\tthis.noMore = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.couponList = this.couponList.concat(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\tuseEv(){\r\n\t\t\t\t// 去首页\r\n\t\t\t\tuni.reLaunch({\r\n\t\t\t\t\turl:`/pages/index/index`\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 领取优惠券\r\n\t\t\treceiveEv(id,index){\r\n\t\t\t\tthis.$requst.get('/api/user/get-coupon',{coupon_id:id}).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('领取成功');\r\n\t\t\t\t\t\tthis.couponList.splice(index,1)\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}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 导航切换\r\n\t\t\tchangeNav(index){\r\n\t\t\t\tif(index!==this.navIndex){\r\n\t\t\t\t\tthis.navIndex = index;\r\n\t\t\t\t\t// 清除数据\r\n\t\t\t\t\tthis.noMore = false;\r\n\t\t\t\t\tthis.couponList = [];\r\n\t\t\t\t\tthis.page = 1;\r\n\t\t\t\t\t// 查询优惠券\r\n\t\t\t\t\tthis.getCouponEv();\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":""} |