Commit d3741d9c by 张立顺

v4.17.0功能开发

1 parent d7cdb64d
...@@ -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:开发版(正常开发工具,测试时)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
<view class="company center" wx:else> <view class="company center" wx:else>
<!-- <view class="company-name" >深圳市嘀加智慧云服务有限公司</view> --> <!-- <view class="company-name" >深圳市嘀加智慧云服务有限公司</view> -->
<view class="company-name">{{merchantName}}</view> <view class="company-name">{{shopMerchantName}}</view>
</view> </view>
<!-- 付款给企业 --> <!-- 付款给企业 -->
<!-- <view class="company-name">(深圳****公司)</view> --> <!-- <view class="company-name">(深圳****公司)</view> -->
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</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>
......
...@@ -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!