123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- <!DOCTYPE html>
- <html class="">
- <!--STATUS OK-->
- <head>
- <meta name="referrer" content="always" />
- <meta charset='utf-8' />
- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="x-dns-prefetch-control" content="on">
- <meta name="description" content="">
- <meta name="format-detection" content="telephone=no" />
- <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
- <link rel="stylesheet" type="text/css" href="css/iconfont.css">
- <link rel="stylesheet" type="text/css" href="css/main.css" />
- <script src="js/vue.js"></script>
- <script src="js/vant-ui.js"></script>
- <script src="js/main.js"></script>
- <title></title>
- </head>
- <style>
- .couponleft {
- width: 2.4rem;
- color: #fff;
- height: 2rem;
- background: url(./img/images/youhuijuanLeft.png) no-repeat;
- background-size: 100% 100%;
- font-size: 0.7rem;
- padding-top: 0.4rem;
- padding-right: 0.2rem;
- }
- .mescroll {
- position: relative;
- height: 90%;
- top: 1rem
- }
- </style>
- <body>
- <div id="app" v-cloak>
- <div class="pageView chukujilu flex col" style="overflow-y:scroll">
- <!-- <div class="header flex a-center j-center">
- <i class="iconfont icon-back" onclick="history.go(-1)"></i>
- 入库统计
- </div>-->
- <!-- <div class="leiji flex a-center j-center">
- 入库码:<h4>202004041613617225</h4>
- </div>-->
- <div class="boxs" style="padding-left: 0; padding-right: 0; padding-bottom: 1.4rem;">
- <div class="rukuTongji">
- <!--<div class="rukuTongjiTitle flex a-center j-center">
- 规格统计
- </div>
- <div class="rukuTongjiHead flex j-center">
- <div class="item flex a-center j-center">
- 规格
- </div>
- <div class="item flex a-center j-center">
- 数量
- </div>
- </div>
- <div class="rukuTongjiBody">
- <div class="item flex a-center j-center">
- <div class="fx1">
- 165/60r14 75h
- <br/>
- bh15bgbl
- </div>
- <div class="fx1">
- SL12
- </div>
- </div>
- <div class="item flex a-center j-center">
- <div class="fx1">
- 165/60r14 75h
- <br/>
- bh15bgbl
- </div>
- <div class="fx1">
- SL12
- </div>
- </div>
- </div>-->
- <div class="rukuTongjiTitle flex a-center j-center" style="margin-top: 0rem;">
- 明细统计
- </div>
- <div class="rukuTongjiHead flex j-center">
- <div class="item flex a-center j-center">
- 胎号
- </div>
- <div class="item flex a-center j-center">
- 物料
- </div>
- <div class="item flex a-center j-center">
- 奖励
- </div>
- <div class="item flex a-center j-center">
- 优惠券
- </div>
- </div>
- <div class="rukuTongjiBody">
- <div class="item flex a-center j-center" v-for="(s,index) in store">
- <div class="fx1">
- {{ s.tireNumber }}
- </div>
- <div class="fx1">
- {{ s.maktx }}
- </div>
- <div class="fx1">
- {{ s.reward }}元
- </div>
- <div class="fx1" style="color: #4CB4FF;" v-on:click="showPopups(s)">
- {{s.couponName}}
- </div>
- </div>
- </div>
- </div>
- <div class="rukuTongjiFoot flex a-center j-center" v-if="canClick" v-on:click="doneChoose">
- 扫码确认
- </div>
- <div class="rukuTongjiFoot flex a-center j-center" style="background-color : #ccc;color:#fff"
- v-if="!canClick">
- 扫码确认
- </div>
- </div>
- <van-popup v-model="showPopup" round position="bottom" closeable close-icon="close"
- v-bind:style="{ height: '80%' }">
- <div style="height:90%;" class="mescroll-touch-y mescroll">
- <div class="flex" v-for="(item,index) in couponList" :key="index">
- <div class="flex" style="margin: 0.1rem 0;" v-on:click="selected(item)">
- <div class="couponleft">
- <div class="flex a-end j-center">
- <div>¥</div>
- <div>{{item.bonus}}</div>
- </div>
- </div>
- <div class="flex col"
- style="justify-content: space-between;border-top:1px solid #dadada;border-right:1px solid #dadada;border-bottom:1px solid #dadada;height:2rem;width: 5.1rem;">
- <div class="flex"
- style="justify-content: space-between;margin: auto 0;padding-left: 0.1rem;">
- <div>
- <div style="font-size: 0.5rem;">{{item.bonus}}元优惠券</div>
- <div style="font-size: 0.25rem;color: #888;">失效时间:{{item.expireTime}}</div>
- </div>
- <div style="margin: auto 0;padding-right: 0.1rem;">
- <!-- <van-checkbox v-model="item.checked"></van-checkbox> -->
- <van-icon size="28px" name="checked" v-if="item.checked" color="#1989fa" />
- </div>
- </div>
- <div class="flex"
- style="border-top:1px dashed #dadada;height: .4rem;align-items: center;padding-left: 0.1rem;">
- <div style="font-size: 0.18rem;">适用范围:{{item.couponDescribe}}</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </van-popup>
- </div>
- </div>
- </body>
- <link rel="stylesheet" href="./mescroll/mescroll.min.css">
- <script type="text/javascript" src="../script/aui-scroll.js"></script>
- <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
- <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript" src="../script/httpRequest.js"></script>
- <script type="text/javascript" src="../script/vue_plugins.js"></script>
- <script type="text/javascript">
- apiready = function () {
- var store = api.pageParam.store;
- var type = api.pageParam.type;
- new Vue({
- el: '#app',
- data: {
- store: JSON.parse(store),
- address: '', // 经纬度 + 地址
- lonlat: '',
- userid: '',
- type: type,
- canClick: true,
- showPopup: false,
- couponList: [],
- couponNum: "",
- addd: [],
- checkNum: 0
- },
- created: function () {
- this.store.map(function (item) {
- item.couponName = "选择优惠券";
- item.couponId = ""
- })
- },
- methods: {
- init: function () {
- var _this = this;
- this.userid = $api.getStorage('userid');
- this.map = api.require('bMap');
- if (api.systemType == 'ios') {
- this.map.initMapSDK(function (ret) {
- if (ret.status) { }
- });
- }
- this.ifHasPrme('location', function (ret1) {
- if (ret1 == true) {
- // 获取当前位置和当前经纬度
- _this.map.getLocation(function (ret2, err) {
- if (ret2.status) {
- _this.lonlat = ret2;
- _this.map.getNameFromCoords({
- lon: ret2.lon,
- lat: ret2.lat
- }, function (ret3, err) {
- if (ret3.status) {
- _this.address = ret3;
- } else {
- }
- });
- } else { }
- });
- }
- })
- this.residueCoupon()
- },
- //查看可以优惠券数量
- residueCoupon: function () {
- var data = {
- "storeId": this.userid,
- "type": 'body',
- "url": 'json'
- }
- var url = "residueCoupon",
- _this = this;
- this.$post(url, data, function (ret) {
- if (ret.code == 0) {
- _this.couponNum = ret.data
- }
- })
- },
- /**
- * 扫码入库
- */
- showPopups: function (item) {
- if (this.checkNum >= this.couponNum) {
- api.toast({
- msg: "最多使用" + this.couponNum + "张优惠券"
- });
- return
- }
- var data = {
- "storeId": this.userid,
- "brand": item.brand,
- "specs": item.specs,
- "pattern": item.pattern,
- "matnr": item.matnr,
- "maktx": item.maktx,
- "type": 'body',
- "url": 'json'
- }
- var url = "storeCouponMessage",
- _this = this;
- this.selectedData = item
- this.$post(url, data, function (ret) {
- if (ret.code == 0) {
- _this.couponList = ret.data
- if (_this.couponList.length == 0) {
- api.toast({
- msg: '暂无优惠券',
- });
- } else {
- _this.showPopup = true
- }
- }
- })
- },
- selected: function (a) {
- this.selectedData
- var _this = this;
- if (a.checked == false && this.selectedData.couponId == "") {
- var data = {
- "id": a.id,
- "useType": 3,
- "type": 'body',
- "url": 'json'
- }
- this.store
- .filter(function (e) {
- return e.tirenumber == _this.selectedData.tirenumber
- })
- .forEach(function (e) {
- e.couponName = "¥" + a.bonus;
- e.couponId = a.id;
- })
- } else if (a.checked == true && this.selectedData.couponId == a.id) {
- var data = {
- "id": a.id,
- "useType": 1,
- "type": 'body',
- "url": 'json'
- }
- this.store
- .filter(function (e) {
- return e.tirenumber == _this.selectedData.tirenumber
- })
- .forEach(function (e) {
- e.couponName = "选择优惠券";
- e.couponId = "";
- })
- } else if (a.checked == true && this.selectedData.couponId != a.id) {
- api.toast({
- msg: '此优惠券已被选中,请选择其它优惠券',
- });
- return
- } else {
- api.toast({
- msg: '最多选一张',
- });
- return
- }
- var url = "Couponupdate",
- _this = this;
- this.$post(url, data, function (ret) {
- if (ret.code == 0) {
- }
- })
- this.checkNum = 0
- this.store.map(function (cart, index) {
- if (cart.couponName != "选择优惠券") {
- _this.checkNum += 1
- }
- })
- this.showPopup = false
- },
- doneChoose: function () {
- if (!this.address.lat || !this.address.lon) {
- api.toast({
- msg: '正在获取定位,请稍候',
- });
- this.init();
- return;
- }
- var data = {
- "scanAddress": this.address.district,
- "latitude": this.address.lat == '' ? '' : this.address.lat.toString().substring(0, 11),
- "longitude": this.address.lon == '' ? '' : this.address.lon.toString().substring(0, 11),
- "storeId": this.userid,
- "province": this.address.province,
- "city": this.address.city,
- "district": this.address.district,
- "rewardType": "2",
- "materialList": this.store,
- "result": this.store.length,
- "type": 'body',
- "url": 'json'
- }
- var url = "sacaCodeIn",
- _this = this;
- this.canClick = false;
- this.$post(url, data, function (ret) {
- _this.canClick = true;
- if (ret.code == 0) {
- if (!ret.message) {
- _this.sendEvent('refushku');
- api.alert({
- title: '入库提示',
- msg: ret.msg,
- }, function (ret, err) {
- if (ret) {
- _this.goWin('intoNode_win', 'intoNode_win.html', '');
- }
- });
- } else {
- api.toast({
- msg: ret.message
- });
- }
- }
- })
- }
- },
- mounted: function () {
- this.init();
- },
- })
- }
- </script>
- </html>
|