Commit cba93ad0 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !12
2 parents 353ebb37 fb6b64bb
...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 1 let index = 3
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
...@@ -32,7 +32,8 @@ Page({ ...@@ -32,7 +32,8 @@ Page({
workWechatQrcode: '', workWechatQrcode: '',
qrcodeType: '', qrcodeType: '',
userCollaborationName: '', userCollaborationName: '',
userCollaborationCheck: false userCollaborationCheck: false,
isYqType: true
}, },
/** /**
...@@ -120,12 +121,15 @@ Page({ ...@@ -120,12 +121,15 @@ Page({
const [key, val] = item.split('=') const [key, val] = item.split('=')
op[key] = val op[key] = val
}) })
// 区分是流量方还是园区店
let isYqType = Boolean(op?.merchantId)
this.setData({ this.setData({
...op ...op,
isYqType
}) })
// 获取质保卡配置 // 获取质保卡配置
this.getwxQrcode() isYqType && this.getwxQrcode()
//util.showLoading('加载中...') //util.showLoading('加载中...')
console.log(op) console.log(op)
...@@ -233,18 +237,23 @@ Page({ ...@@ -233,18 +237,23 @@ Page({
// 支付 // 支付
handlePay() { handlePay() {
let _this = this let _this = this
const { payMoney, merchantId, openId, unPayMoneyList, userCollaborationName, userCollaborationCheck } = this.data const { payMoney, merchantId, isYqType, shopMerchantId, openId, unPayMoneyList, userCollaborationName, userCollaborationCheck } = this.data
if (userCollaborationName && !userCollaborationCheck) { if (userCollaborationName && !userCollaborationCheck) {
return util.showToast(`请先阅读并勾选《${userCollaborationName}》`) return util.showToast(`请先阅读并勾选《${userCollaborationName}》`)
} }
if (payMoney === '' || unPayMoneyList.includes(payMoney)) return if (payMoney === '' || unPayMoneyList.includes(payMoney)) return
// this.wxPayment(payMoney) // this.wxPayment(payMoney)
// console.log(Number(payMoney), '付款') // console.log(Number(payMoney), '付款')
let params = { let params = {
merchantId,
openId, openId,
receivedMoney: payMoney * 100 receivedMoney: payMoney * 100
} }
if (isYqType) {
params.merchantId = merchantId
} else {
params.shopMerchantId = shopMerchantId
}
util.showLoading('加载中...') util.showLoading('加载中...')
// 调用支付接口生成对应的微信支付参数 // 调用支付接口生成对应的微信支付参数
// console.log(params) // console.log(params)
......
...@@ -6,10 +6,14 @@ ...@@ -6,10 +6,14 @@
<view class="pay-header payCompanyInfo"> <view class="pay-header payCompanyInfo">
<!-- <view class=""> --> <!-- <view class=""> -->
<image class="shopIcon" src="../../../images/shopIcon.png" /> <image class="shopIcon" src="../../../images/shopIcon.png" />
<view class="company"> <view class="company" wx:if="{{isYqType}}">
<view class="company-name">深圳市嘀加智慧云服务有限公司</view> <view class="company-name">深圳市嘀加智慧云服务有限公司</view>
<view class="company-yqd">{{merchantName}}</view> <view class="company-yqd">{{merchantName}}</view>
</view> </view>
<view class="company center" wx:else>
<!-- <view class="company-name" >深圳市嘀加智慧云服务有限公司</view> -->
<view class="company-name">{{shopMerchantName}}</view>
</view>
<!-- 付款给企业 --> <!-- 付款给企业 -->
<!-- <view class="company-name">(深圳****公司)</view> --> <!-- <view class="company-name">(深圳****公司)</view> -->
<!-- </view> --> <!-- </view> -->
...@@ -75,13 +79,13 @@ ...@@ -75,13 +79,13 @@
支付成功 支付成功
</view> </view>
<view class="line" /> <view class="line" />
<view class="orderInfo"> <view wx:if="{{isYqType}}" class="orderInfo">
<view class="label">收款主体</view> <view class="label">收款主体</view>
<view class="info">深圳市嘀加智慧云服务有限公司</view> <view class="info">深圳市嘀加智慧云服务有限公司</view>
</view> </view>
<view class="orderInfo"> <view class="orderInfo">
<view class="label">商户名称</view> <view class="label">商户名称</view>
<view class="info">{{merchantName}}</view> <view class="info">{{merchantName || shopMerchantName}}</view>
</view> </view>
<view class="orderInfo"> <view class="orderInfo">
<view class="label">支付订单号</view> <view class="label">支付订单号</view>
......
...@@ -25,12 +25,15 @@ ...@@ -25,12 +25,15 @@
margin-top: 15rpx; margin-top: 15rpx;
font-size: 24rpx; font-size: 24rpx;
} }
.userCollaborationContainer .radio { .userCollaborationContainer .radio {
margin-top: -4rpx; margin-top: -4rpx;
} }
.userCollaborationContainer .label { .userCollaborationContainer .label {
min-width: 180rpx; min-width: 180rpx;
} }
.linkText { .linkText {
color: #3582EE; color: #3582EE;
} }
...@@ -48,6 +51,14 @@ ...@@ -48,6 +51,14 @@
margin-left: 20rpx; margin-left: 20rpx;
} }
.pay-header .center {
/* display: flex; */
justify-content: center;
/* height: 88rpx;
flex-direction: column;
margin-left: 20rpx; */
}
.company-name { .company-name {
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
......
...@@ -4,126 +4,165 @@ var app = getApp() ...@@ -4,126 +4,165 @@ var app = getApp()
import api from '../../restapi' import api from '../../restapi'
import util from '../../../utils/util.js' import util from '../../../utils/util.js'
Page( Page(
filter.identityFilter({ // {
/** filter.identityFilter({
* 页面的初始数据 /**
*/ * 页面的初始数据
data: { */
authToast: false, // 是否显示授权提示框 data: {
authType: true, // 授权类型(true:授权用户信息;false:授权手机号) authToast: false, // 是否显示授权提示框
sceneId: '', authType: true, // 授权类型(true:授权用户信息;false:授权手机号)
ajaxing: false sceneId: '',
}, ajaxing: false,
paySuccess: false
// paySuccess: true
},
onLogin() {
util.showLoading('加载中...')
this.getScenInfo()
console.log(app.globalData)
// if (app.globalData.userInfo || app.globalData.userInfo.phone) {
// }
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// options. scene= 'sceneId=10683'
onLogin() { // let options = {
util.showLoading('加载中...') // scene: 'sceneId=6783'
console.log(app.globalData) // }
if (app.globalData.userInfo || app.globalData.userInfo.phone) { wx.hideHomeButton({
this.getScenInfo() success: function () {
console.log('隐藏成功!')
} }
}, })
console.log(options)
let id = decodeURIComponent(options.scene).split('=')[1]
console.log(id, 'id')
this.setData({
sceneId: id
})
util.showLoading('加载中...')
this.getScenInfo()
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面初次渲染完成
*/ */
onLoad: function (options) { onReady: function () {},
// let options = {
// scene: 'sceneId=6783'
// }
console.log(options)
let id = decodeURIComponent(options.scene).split('=')[1]
this.setData({
sceneId: id
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面显示
*/ */
onReady: function () {}, onShow: function () {},
/** onUnload: function () {
* 生命周期函数--监听页面显示 this.setData({
*/ ajaxing: false
onShow: function () {}, })
},
onUnload: function () { // 获取订单信息
getInfo: function (row) {
let _this = this
let oParams = {}
oParams.orderCode = row.orderCode
oParams.workWxSessionId = row.workWxSessionId
api.GETORDERINFO(oParams, res => {
util.hideLoading()
console.log(JSON.parse(res.data))
let o = res.data ? JSON.parse(res.data) : {}
this.setData({ this.setData({
ajaxing: false o
})
},
// 获取订单信息
getInfo: function (row) {
let _this = this
let oParams = {}
oParams.orderCode = row.orderCode
oParams.workWxSessionId = row.workWxSessionId
api.GETORDERINFO(oParams, res => {
util.hideLoading()
console.log(JSON.parse(res.data))
let o = res.data ? JSON.parse(res.data) : {}
_this.wxPayment(o)
}) })
}, _this.wxPayment(o)
})
},
// 调用微信支付 // 调用微信支付
wxPayment: function (row) { wxPayment: function (row) {
let _this = this let _this = this
if (this.data.ajaxing) { if (this.data.ajaxing) {
return false return false
} }
_this.setData({ _this.setData({
ajaxing: true ajaxing: true
}) })
wx.requestPayment({ wx.requestPayment({
nonceStr: row.nonceStr, nonceStr: row.nonceStr,
package: row.package, package: row.package,
paySign: row.paySign, paySign: row.paySign,
timeStamp: row.timeStamp, timeStamp: row.timeStamp,
signType: 'MD5', signType: 'MD5',
success: function (res) { success: function (res) {
console.log(res) console.log(res)
wx.redirectTo({ _this.setData({
url: '/packagePersonal/pages/boutiqueList/boutiqueList' paySuccess: true,
}) dataTime: new Date().format('yyyy/MM/dd hh:mm')
}, })
fail: function (error) { wx.setNavigationBarTitle({
wx.switchTab({ title: '支付成功',
url: '/pages/tab/index/index'
}) })
} // wx.redirectTo({
}) // url: '/packagePersonal/pages/boutiqueList/boutiqueList'
}, // })
},
fail: function (error) {
// wx.switchTab({
// url: '/pages/tab/index/index'
// })
wx.showToast({
title: '支付失败',
icon: 'error'
})
// wx.showToast({
// title: '支付请求失败',
// icon: 'error'
// })
}
})
},
// 获取订单信息 // 获取订单信息
getScenInfo() { getScenInfo() {
let id = this.data.sceneId let id = this.data.sceneId
if (id) { console.log(this.data)
//let id = decodeURIComponent(options.scene).split('=')[1] // console.log();
//let id = options.sceneId; console.log(id)
api.qrCodeScene( // debugger
{ if (id) {
id //let id = decodeURIComponent(options.scene).split('=')[1]
}, //let id = options.sceneId;
res => { api.qrCodeScene(
let { returnCode, data } = res {
let op = {} id
console.log('dddddddddddddddddd') },
if (returnCode == '0') { res => {
if (data) { let { returnCode, data } = res
data.split('&').map(item => { let op = {}
const [key, val] = item.split('=') console.log('dddddddddddddddddd')
op[key] = val if (returnCode == '0') {
}) if (data) {
//util.showLoading('加载中...') data.split('&').map(item => {
console.log(op) const [key, val] = item.split('=')
this.getInfo(op) op[key] = val
} })
this.setData({
...op
})
//util.showLoading('加载中...')
console.log(op)
this.getInfo(op)
} }
} }
) }
} )
} }
}) }
})
// }
) )
<!--支付--> <!--支付-->
<view class="page"> <view class="page">
<view class="success-Container" wx:if="{{paySuccess}}">
<!-- <view class="amountOfMoney">¥ {{payMoney}}</view> -->
<view class="success-tips">
<image class="successIcon" src="../../../images/successIcon.png" />
支付成功
</view>
<view class="line" />
<view class="orderInfo">
<view class="label">收款主体</view>
<view class="info">深圳市嘀加智慧云服务有限公司</view>
</view>
<!-- <view class="orderInfo">
<view class="label">商户名称</view>
<view class="info">{{merchantName || shopMerchantName}}</view>
</view> -->
<view class="orderInfo">
<view class="label">支付订单号</view>
<view class="info">{{orderCode}}</view>
</view>
<view class="orderInfo">
<view class="label">支付时间</view>
<view class="info">{{dataTime}}</view>
</view>
</view>
</view> </view>
<auth-setting auth='{{authToast}}' type='{{authType}}' index /> <auth-setting auth='{{authToast}}' type='{{authType}}' index />
\ No newline at end of file \ No newline at end of file
/* packagesPayment/pages/payment/index.wxss */
\ No newline at end of file \ No newline at end of file
/* packagesPayment/pages/payment/index.wxss */
.success-Container {
padding: 100rpx 76rpx 0;
text-align: center;
background-color: #fff;
height: 100vh;
}
.amountOfMoney {
font-size: 80rpx;
font-weight: 600;
}
.success-tips {
display: flex;
align-items: center;
justify-content: center;
font-size: 48rpx;
margin-bottom: 30rpx;
}
.successIcon {
width: 64rpx;
height: 64rpx;
margin-right: 30rpx;
}
.orderInfo {
display: flex;
justify-content: space-between;
}
.success-Container {
box-sizing: border-box;
display: flex;
flex-direction: column;
/* justify-content: center; */
align-items: center;
}
.success-Container .line {
height: 1px;
width: 100%;
margin: 28rpx 0;
background: #E5E5E5;
}
.success-Container .orderInfo {
width: 100%;
margin-bottom: 28rpx;
}
.success-Container .label {
font-size: 30rpx;
color: #999;
}
.success-Container .info {
font-size: 30rpx;
color: #333;
flex: 1;
text-align: right;
max-width: 80%;
overflow: hidden;
text-overflow: ellipsis;
/* display: -webkit-box; */
white-space: nowrap;
}
.footerCon {
margin-top: auto;
margin-bottom: 200rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.wxTips {
font-size: 26rpx;
color: #999999;
/* line-height: 36rpx; */
}
.wxqrCon {
width: 306rpx;
height: 305rpx;
margin: 12rpx 0 84rpx;
Object-fit: contain;
}
.logoIcon {
/* text-align: center; */
width: 200rpx;
height: 50rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -243,7 +243,8 @@ ...@@ -243,7 +243,8 @@
{ {
"name": "支付", "name": "支付",
"pathName": "packagesPayment/pages/payment/index", "pathName": "packagesPayment/pages/payment/index",
"query": "sceneId=6684", "query": "sceneId='sceneId=10683'",
"launchMode": "default",
"scene": null "scene": null
}, },
{ {
......
...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 1 let index =3
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!