Commit d3741d9c by 张立顺

v4.17.0功能开发

1 parent d7cdb64d
......@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 1
let index = 3
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......
......@@ -12,7 +12,7 @@
</view>
<view class="company center" wx:else>
<!-- <view class="company-name" >深圳市嘀加智慧云服务有限公司</view> -->
<view class="company-name">{{merchantName}}</view>
<view class="company-name">{{shopMerchantName}}</view>
</view>
<!-- 付款给企业 -->
<!-- <view class="company-name">(深圳****公司)</view> -->
......@@ -85,7 +85,7 @@
</view>
<view class="orderInfo">
<view class="label">商户名称</view>
<view class="info">{{merchantName}}</view>
<view class="info">{{merchantName || shopMerchantName}}</view>
</view>
<view class="orderInfo">
<view class="label">支付订单号</view>
......
......@@ -4,126 +4,165 @@ var app = getApp()
import api from '../../restapi'
import util from '../../../utils/util.js'
Page(
filter.identityFilter({
/**
* 页面的初始数据
*/
data: {
authToast: false, // 是否显示授权提示框
authType: true, // 授权类型(true:授权用户信息;false:授权手机号)
sceneId: '',
ajaxing: false
},
// {
filter.identityFilter({
/**
* 页面的初始数据
*/
data: {
authToast: false, // 是否显示授权提示框
authType: true, // 授权类型(true:授权用户信息;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() {
util.showLoading('加载中...')
console.log(app.globalData)
if (app.globalData.userInfo || app.globalData.userInfo.phone) {
this.getScenInfo()
// let options = {
// scene: 'sceneId=6783'
// }
wx.hideHomeButton({
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) {
// let options = {
// scene: 'sceneId=6783'
// }
console.log(options)
let id = decodeURIComponent(options.scene).split('=')[1]
this.setData({
sceneId: id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
onUnload: function () {
this.setData({
ajaxing: false
})
},
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({
ajaxing: false
})
},
// 获取订单信息
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)
o
})
},
_this.wxPayment(o)
})
},
// 调用微信支付
wxPayment: function (row) {
let _this = this
if (this.data.ajaxing) {
return false
}
_this.setData({
ajaxing: true
})
wx.requestPayment({
nonceStr: row.nonceStr,
package: row.package,
paySign: row.paySign,
timeStamp: row.timeStamp,
signType: 'MD5',
success: function (res) {
console.log(res)
wx.redirectTo({
url: '/packagePersonal/pages/boutiqueList/boutiqueList'
})
},
fail: function (error) {
wx.switchTab({
url: '/pages/tab/index/index'
// 调用微信支付
wxPayment: function (row) {
let _this = this
if (this.data.ajaxing) {
return false
}
_this.setData({
ajaxing: true
})
wx.requestPayment({
nonceStr: row.nonceStr,
package: row.package,
paySign: row.paySign,
timeStamp: row.timeStamp,
signType: 'MD5',
success: function (res) {
console.log(res)
_this.setData({
paySuccess: true,
dataTime: new Date().format('yyyy/MM/dd hh:mm')
})
wx.setNavigationBarTitle({
title: '支付成功',
})
}
})
},
// 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() {
let id = this.data.sceneId
if (id) {
//let id = decodeURIComponent(options.scene).split('=')[1]
//let id = options.sceneId;
api.qrCodeScene(
{
id
},
res => {
let { returnCode, data } = res
let op = {}
console.log('dddddddddddddddddd')
if (returnCode == '0') {
if (data) {
data.split('&').map(item => {
const [key, val] = item.split('=')
op[key] = val
})
//util.showLoading('加载中...')
console.log(op)
this.getInfo(op)
}
// 获取订单信息
getScenInfo() {
let id = this.data.sceneId
console.log(this.data)
// console.log();
console.log(id)
// debugger
if (id) {
//let id = decodeURIComponent(options.scene).split('=')[1]
//let id = options.sceneId;
api.qrCodeScene(
{
id
},
res => {
let { returnCode, data } = res
let op = {}
console.log('dddddddddddddddddd')
if (returnCode == '0') {
if (data) {
data.split('&').map(item => {
const [key, val] = item.split('=')
op[key] = val
})
this.setData({
...op
})
//util.showLoading('加载中...')
console.log(op)
this.getInfo(op)
}
}
)
}
}
)
}
})
}
})
// }
)
<!--支付-->
<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>
<auth-setting auth='{{authToast}}' type='{{authType}}' index />
\ No newline at end of file
/* packagesPayment/pages/payment/index.wxss */
\ 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
......@@ -243,7 +243,8 @@
{
"name": "支付",
"pathName": "packagesPayment/pages/payment/index",
"query": "sceneId=6684",
"query": "sceneId='sceneId=10683'",
"launchMode": "default",
"scene": null
},
{
......
......@@ -14,7 +14,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 1
let index =3
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!