|
@@ -212,12 +212,13 @@ Page({
|
|
|
let gunType = app.gunType;
|
|
|
if (gunType === '1') { //油品订单
|
|
|
console.log("**************计算优惠单开始****************");
|
|
|
+ console.log(app)
|
|
|
/**************计算优惠单开始****************/
|
|
|
getCustomerGradeInfo({
|
|
|
- "stationId": app.stationId,
|
|
|
+ "openId": app.globalData.openId,
|
|
|
+ "stationId": app.globalData.stationId,
|
|
|
"userType": "2",
|
|
|
"oilName": app.oilGunName,
|
|
|
- "openId": app.mpOpenId,
|
|
|
"mobilePhone": mobileValue
|
|
|
}).then(res => { // handle success
|
|
|
if (res.retCode == 0) { //获取优惠信息成功
|
|
@@ -312,7 +313,7 @@ Page({
|
|
|
"receivableAmt": app.orderAmount, //应收金额
|
|
|
"discountAmt": youHuiAmount, //优惠金额
|
|
|
"amt": totalMoney, //实收金额
|
|
|
- "token": app.mpOpenId,
|
|
|
+ "openId": app.globalData.openId,
|
|
|
"userType": 2,
|
|
|
"orderType": "1"
|
|
|
}).then(res => { // handle success
|
|
@@ -347,7 +348,7 @@ Page({
|
|
|
"receivableAmt": app.orderAmount, //应收金额
|
|
|
"discountAmt": youHuiAmount, //优惠金额
|
|
|
"amt": totalMoney, //实收金额
|
|
|
- "token": app.mpOpenId,
|
|
|
+ "openId": app.openId,
|
|
|
"userType": 2,
|
|
|
"orderType": "2"
|
|
|
}).then(res => { // handle success
|
|
@@ -384,15 +385,16 @@ Page({
|
|
|
//金额输入框获取实时输入的值
|
|
|
bindKeyInput: function (e) {
|
|
|
var app = getApp()
|
|
|
- const reg = /^[1-9]{1,}(\.)?([0-9]{0,2})?/ // 最小数额1
|
|
|
- // /^[0-9]{1,}(\.)?([0-9]{0,2})?/ // 不设置最小数额
|
|
|
+ // const reg = /^[1-9]{1,}(\.)?([0-9]{0,2})?/ // 最小数额1
|
|
|
+ const reg = /^[0-9]{1,}(\.)?([0-9]{0,2})?/ // 不设置最小数额
|
|
|
+
|
|
|
const res = e.detail.value.match(reg, "");
|
|
|
- if(res !== null){
|
|
|
+ if (res !== null) {
|
|
|
app.orderAmount = res[0]
|
|
|
this.setData({
|
|
|
account: res[0]
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
app.orderAmount = ""
|
|
|
this.setData({
|
|
|
account: ""
|
|
@@ -521,8 +523,10 @@ Page({
|
|
|
stationId: app.stationId
|
|
|
}).then(res => { // handle success
|
|
|
// console.log("sessionKey:" + res.session_key);
|
|
|
+ console.log("aaaaaaaaaaaa")
|
|
|
+ console.log(app)
|
|
|
decryptEncryptedData({
|
|
|
- sessionKey: res.session_key,
|
|
|
+ sessionKey: res.sessionKey,
|
|
|
encryptedData: encryptedData,
|
|
|
iv: iv
|
|
|
}).then(res => { // handle success
|
|
@@ -530,14 +534,14 @@ Page({
|
|
|
//保存appUserInfo信息
|
|
|
saveAppUserInfo({
|
|
|
"userType": "2",
|
|
|
- "minaOpenid": app.mpOpenId,
|
|
|
+ "openId": app.globalData.openId,
|
|
|
"blogNickName": app.globalData.userInfo.nickName,
|
|
|
"sexFlag": app.globalData.userInfo.gender === 1 ? 'M' : 'F',
|
|
|
"blogProfilePhoto": app.globalData.userInfo.avatarUrl,
|
|
|
"mobilePhone": mobilePhone,
|
|
|
- "stationId": app.stationId, //油站Id
|
|
|
- "stationName": app.stationName, //油站名称
|
|
|
- "unionId":app.unionId
|
|
|
+ "stationId": app.stationId, //油站Id
|
|
|
+ "stationName": app.stationName, //油站名称
|
|
|
+ "unionId": app.globalData.unionId
|
|
|
|
|
|
}).then(res => { // handle success
|
|
|
// console.log(res.data);
|