| @@ -1,11 +1,11 @@ | |||||
| var extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; | var extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; | ||||
| var appId = extConfig.appId; | var appId = extConfig.appId; | ||||
| var config = { | var config = { | ||||
| // url: "https://ciformall.youlane.cn/C/api", | |||||
| url: "https://ciformall.youlane.cn/C/api", | |||||
| // url:"https://c.malls.iformall.com/C/api", | // url:"https://c.malls.iformall.com/C/api", | ||||
| url:'https://ctest.malls.iformall.com/C/api', | |||||
| // url:'https://ctest.malls.iformall.com/C/api', | |||||
| // url:'http://10.100.33.68:7000/C/api', | // url:'http://10.100.33.68:7000/C/api', | ||||
| // url: 'http://10.100.30.172:7000/C/api', | |||||
| // url: 'http://202.165.179.86:4000/C/api', | |||||
| api: { | api: { | ||||
| /** | /** | ||||
| * 接口用途:login | * 接口用途:login | ||||
| @@ -195,11 +195,15 @@ var config = { | |||||
| /** | /** | ||||
| * C端扫B端储值卡交易流水列表接口 | * C端扫B端储值卡交易流水列表接口 | ||||
| */ | */ | ||||
| cardpayList:"/cardPay/list" | |||||
| cardpayList:"/cardPay/list", | |||||
| /** | |||||
| * 根据code查询接口 | |||||
| */ | |||||
| findByCode:"/merchant/findByCode" | |||||
| }, | }, | ||||
| weapp: { | weapp: { | ||||
| AppId: "wx649b3be73c1afe47" | |||||
| AppId: "wxea71200db93d756b" | |||||
| }, | }, | ||||
| ErrorCode: { | ErrorCode: { | ||||
| @@ -54,18 +54,34 @@ Page({ | |||||
| let that = this; | let that = this; | ||||
| wx.scanCode({ | wx.scanCode({ | ||||
| success: (res) => { | success: (res) => { | ||||
| console.log(JSON.parse(res.result).merchant_id) | |||||
| if (JSON.parse(res.result).merchant_id && e.currentTarget.dataset.cardid && e.currentTarget.dataset.remainingamount) { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/scanPay/scanPay?merChant=${res.result}&cardid=${e.currentTarget.dataset.cardid}&remainingAmount=${e.currentTarget.dataset.remainingamount}`, | |||||
| console.log(res.result) | |||||
| Http.get({ | |||||
| url: config.api.findByCode, | |||||
| data: { | |||||
| merchantCode: res.result, | |||||
| } | |||||
| }) | |||||
| .then(res => { | |||||
| console.log(res); | |||||
| if (res.code == 200) { | |||||
| let merChantDetail = JSON.stringify(res.data); | |||||
| if (merChantDetail && e.currentTarget.dataset.cardid && e.currentTarget.dataset.remainingamount) { | |||||
| wx.navigateTo({ | |||||
| url: `/pages/scanPay/scanPay?merChant=${merChantDetail}&cardid=${e.currentTarget.dataset.cardid}&remainingAmount=${e.currentTarget.dataset.remainingamount}`, | |||||
| }) | |||||
| } else { | |||||
| wx.showToast({ | |||||
| title: "未识别到商户二维码", | |||||
| icon: "none", | |||||
| mask: false | |||||
| }) | |||||
| } | |||||
| } | |||||
| }) | }) | ||||
| } else { | |||||
| wx.showToast({ | |||||
| title: "未识别到商户二维码", | |||||
| icon: "none", | |||||
| mask: false | |||||
| .catch(err => { | |||||
| console.log(err) | |||||
| }) | }) | ||||
| } | |||||
| }, | }, | ||||
| fail: (res) => { | fail: (res) => { | ||||
| console.log(res); | console.log(res); | ||||
| @@ -12,7 +12,9 @@ Page({ | |||||
| focus: true, | focus: true, | ||||
| inputValue: '', | inputValue: '', | ||||
| cardList: [], | cardList: [], | ||||
| arrays:[], | |||||
| showModel: false, | showModel: false, | ||||
| ids:"" | |||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -23,7 +25,9 @@ Page({ | |||||
| that.setData({ | that.setData({ | ||||
| merChant: JSON.parse(options.merChant), | merChant: JSON.parse(options.merChant), | ||||
| cardid: options.cardid, | cardid: options.cardid, | ||||
| remainingAmount: options.remainingAmount | |||||
| cardids:options.cardid, | |||||
| remainingAmount: options.remainingAmount, | |||||
| remainingAmounts: options.remainingAmount, | |||||
| }) | }) | ||||
| }, | }, | ||||
| bindKeyInput(e) { | bindKeyInput(e) { | ||||
| @@ -43,7 +47,13 @@ Page({ | |||||
| that.gotoPay() | that.gotoPay() | ||||
| }, | }, | ||||
| fail: (err) => { | fail: (err) => { | ||||
| wx.hideLoading(); | |||||
| that.setData({ | |||||
| showModel:false, | |||||
| cardid: that.data.cardids, | |||||
| ids:"", | |||||
| remainingAmount: that.data.remainingAmounts | |||||
| }) | |||||
| } | } | ||||
| }) | }) | ||||
| } | } | ||||
| @@ -83,11 +93,12 @@ Page({ | |||||
| }, | }, | ||||
| gotoPay: function () { | gotoPay: function () { | ||||
| let that = this; | let that = this; | ||||
| console.log(that.data.cardid) | |||||
| Http.post({ | Http.post({ | ||||
| url: config.api.cardPayOrder, | url: config.api.cardPayOrder, | ||||
| data: { | data: { | ||||
| cardId: that.data.cardid, | cardId: that.data.cardid, | ||||
| merchantCode: that.data.merChant.merchant_id, | |||||
| merchantId: that.data.merChant.id, | |||||
| totalFee: that.data.inputValue | totalFee: that.data.inputValue | ||||
| } | } | ||||
| }) | }) | ||||
| @@ -109,11 +120,16 @@ Page({ | |||||
| content: err.message, | content: err.message, | ||||
| showCancel: false | showCancel: false | ||||
| }) | }) | ||||
| that.setData({ | |||||
| cardid: that.data.cardids, | |||||
| ids:"", | |||||
| remainingAmount: that.data.remainingAmounts | |||||
| }) | |||||
| }) | }) | ||||
| }, | }, | ||||
| // 指纹识别 | |||||
| startAuth(e) { | |||||
| check:function(e){ | |||||
| let that = this; | let that = this; | ||||
| console.log(e.currentTarget.dataset.id) | |||||
| if (e) { | if (e) { | ||||
| if (e.currentTarget.dataset.flags == 'check') { | if (e.currentTarget.dataset.flags == 'check') { | ||||
| that.setData({ | that.setData({ | ||||
| @@ -123,6 +139,9 @@ Page({ | |||||
| }) | }) | ||||
| } | } | ||||
| } | } | ||||
| }, | |||||
| startAuth(e) { | |||||
| let that = this; | |||||
| if (that.data.inputValue == "" || that.data.inputValue == 0) { | if (that.data.inputValue == "" || that.data.inputValue == 0) { | ||||
| wx.showModal({ | wx.showModal({ | ||||
| title: '抱歉', | title: '抱歉', | ||||
| @@ -133,11 +152,16 @@ Page({ | |||||
| that.setData({ | that.setData({ | ||||
| showModel: true | showModel: true | ||||
| }) | }) | ||||
| that.getList('notenogth'); | |||||
| that.getList(); | |||||
| console.log("1111") | |||||
| } else if (that.data.inputValue != "" && Number(that.data.remainingAmount) >= Number(that.data.inputValue)) { | } else if (that.data.inputValue != "" && Number(that.data.remainingAmount) >= Number(that.data.inputValue)) { | ||||
| wx.showLoading({ | wx.showLoading({ | ||||
| title: '付款中', | |||||
| title: '加载中', | |||||
| }) | }) | ||||
| console.log("222") | |||||
| setTimeout(function(){ | |||||
| wx.hideLoading(); | |||||
| },1500) | |||||
| that.gotoPayMoney(); | that.gotoPayMoney(); | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -164,16 +188,22 @@ Page({ | |||||
| .then(res => { | .then(res => { | ||||
| console.log(res) | console.log(res) | ||||
| if (res.code == 200) { | if (res.code == 200) { | ||||
| let arrays = []; | |||||
| res.data.list.map(file => { | res.data.list.map(file => { | ||||
| file.merchantVoList.map(files => { | |||||
| if (files.id == that.data.merChant.merchant_id) { | |||||
| file.flag = true | |||||
| } | |||||
| }) | |||||
| if (file.remainingAmount / 100 >= that.data.inputValue){ | |||||
| file.merchantVoList.map(files => { | |||||
| if (files.id == that.data.merChant.id) { | |||||
| file.flag = true; | |||||
| arrays.push(file); | |||||
| } | |||||
| }) | |||||
| } | |||||
| }) | }) | ||||
| console.log(arrays) | |||||
| that.setData({ | that.setData({ | ||||
| showPage: true, | showPage: true, | ||||
| cardList: res.data.list | |||||
| cardList: res.data.list, | |||||
| arrays: arrays | |||||
| }) | }) | ||||
| } | } | ||||
| }) | }) | ||||
| @@ -187,7 +217,11 @@ Page({ | |||||
| }, | }, | ||||
| showModel: function () { | showModel: function () { | ||||
| this.setData({ | this.setData({ | ||||
| showModel: false | |||||
| showModel: false, | |||||
| cardid: this.data.cardids, | |||||
| ids:"", | |||||
| remainingAmount: this.data.remainingAmounts | |||||
| }) | }) | ||||
| console.log(this.data.cardid) | |||||
| }, | }, | ||||
| }) | }) | ||||
| @@ -1,7 +1,7 @@ | |||||
| <view class='content'> | <view class='content'> | ||||
| <view class='head clearfix'> | <view class='head clearfix'> | ||||
| <text class='fl'>付款给{{merChant.merchant_name}}</text> | |||||
| <image class='fr' src='{{merChant.merchant_img_url}}' mode='widthFix'></image> | |||||
| <text class='fl'>付款给{{merChant.merchantName}}</text> | |||||
| <image class='fr' src='{{merChant.merchantImgUrl}}' mode='widthFix'></image> | |||||
| </view> | </view> | ||||
| <text class='txt1'>金额</text> | <text class='txt1'>金额</text> | ||||
| <view class='money'> | <view class='money'> | ||||
| @@ -17,7 +17,7 @@ | |||||
| </view> | </view> | ||||
| <view class='card-content'> | <view class='card-content'> | ||||
| <scroll-view scroll-y style="height: 500rpx;" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}"> | <scroll-view scroll-y style="height: 500rpx;" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}"> | ||||
| <view class='card-items {{item.remainingAmount/100>=inputValue&&item.flag?"":"opcacity"}}' wx:for="{{cardList}}" wx:key="{{index}}" data-remainingAmount='{{item.remainingAmount/100}}' data-id="{{item.id}}" data-flags="check" bindtap='startAuth'> | |||||
| <view wx:if="{{item.flag}}" class='card-items {{item.flag?"":"opcacity"}}' wx:for="{{cardList}}" wx:key="{{index}}" data-remainingAmount='{{item.remainingAmount/100}}' data-id="{{item.id}}" data-flags="check" bindtap='check'> | |||||
| <view class='card-items-left'> | <view class='card-items-left'> | ||||
| <view class='card-items-left-img'> | <view class='card-items-left-img'> | ||||
| <image src='{{item.coverImg}}'></image> | <image src='{{item.coverImg}}'></image> | ||||
| @@ -27,15 +27,26 @@ | |||||
| <view class='card-items-right'> | <view class='card-items-right'> | ||||
| <view class='card-items-right-text'>余额:{{item.remainingAmount/100}}元</view> | <view class='card-items-right-text'>余额:{{item.remainingAmount/100}}元</view> | ||||
| <view class='card-items-right-radio' class='icons'> | <view class='card-items-right-radio' class='icons'> | ||||
| <image wx:if="{{item.id != ids}}" src='./../../assets/images/no.png' mode='widthFix'></image> | |||||
| <image wx:if="{{item.id == ids&&item.remainingAmount/100>=inputValue&&item.flag}}" src='./../../assets/images/yes.png' mode='widthFix'></image> | |||||
| <image wx:if="{{item.id == ids&&item.flag}}" src='./../../assets/images/yes.png' mode='widthFix'></image> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view wx:if='{{item.remainingAmount/100<inputValue||!item.flag}}' class='card-items {{item.flag?"":"opcacity"}}' wx:for="{{cardList}}" wx:key="{{index}}"> | |||||
| <view class='card-items-left'> | |||||
| <view class='card-items-left-img'> | |||||
| <image src='{{item.coverImg}}'></image> | |||||
| </view> | |||||
| <view class='card-items-left-text'>{{item.id}}</view> | |||||
| </view> | |||||
| <view class='card-items-right'> | |||||
| <view class='card-items-right-text'>余额:{{item.remainingAmount/100}}元</view> | |||||
| </view> | |||||
| </view> | |||||
| </scroll-view> | </scroll-view> | ||||
| </view> | </view> | ||||
| <view class='card-bottom'> | <view class='card-bottom'> | ||||
| <button type='primary' bindtap='gotonewcard' class='checkcard-box'>购买新卡</button> | |||||
| <button type='primary' bindtap='gotoPayMoney' class='checkcard-box' wx:if="{{arrays.length>0}}">确认付款</button> | |||||
| <button type='primary' bindtap='gotonewcard' class='checkcard-box' wx:if="{{arrays.length==0}}">购买新卡</button> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -80,10 +80,10 @@ | |||||
| } | } | ||||
| .card-top{ | .card-top{ | ||||
| position: relative; | position: relative; | ||||
| height: 75rpx; | |||||
| height: 85rpx; | |||||
| width: 100%; | width: 100%; | ||||
| background: #E67663; | background: #E67663; | ||||
| line-height: 75rpx; | |||||
| line-height: 85rpx; | |||||
| text-align: center; | text-align: center; | ||||
| font-size:30rpx; | font-size:30rpx; | ||||
| font-weight:500; | font-weight:500; | ||||
| @@ -13,7 +13,7 @@ | |||||
| }, | }, | ||||
| "compileType": "miniprogram", | "compileType": "miniprogram", | ||||
| "libVersion": "2.0.9", | "libVersion": "2.0.9", | ||||
| "appid": "wx649b3be73c1afe47", | |||||
| "appid": "wxea71200db93d756b", | |||||
| "projectname": "C", | "projectname": "C", | ||||
| "isGameTourist": false, | "isGameTourist": false, | ||||
| "condition": { | "condition": { | ||||