Commit ea73a5b2 authored by 珠峰架构's avatar 珠峰架构

修改支付

parent e4e2df2e
...@@ -47,6 +47,16 @@ ...@@ -47,6 +47,16 @@
} }
} }
,{
"path" : "pages/h5/pay",
"name":"pay",
"style" :
{
"navigationBarTitleText": "支付",
"enablePullDownRefresh": false
}
}
], ],
"subPackages":[], "subPackages":[],
"tabBar": { "tabBar": {
...@@ -84,8 +94,8 @@ ...@@ -84,8 +94,8 @@
"current": 0, //当前激活的模式(list 的索引项) "current": 0, //当前激活的模式(list 的索引项)
"list": [ "list": [
{ {
"name": "index", //模式名称 "name": "pay", //模式名称
"path": "/pages/index/index" //启动页面,必选 "path": "/pages/h5/pay" //启动页面,必选
} }
] ]
}, },
......
<template> <template>
<view> <view>
<web-view @message="handleMsg" :src='webUrl'></web-view> <web-view @message="handleMsg" :src='webUrl' ></web-view>
</view> </view>
</template> </template>
...@@ -12,11 +12,18 @@ ...@@ -12,11 +12,18 @@
} }
} , } ,
onReady(){ onReady(){
this.webUrl = "https://wx.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=134581110000230&companyId=00000310&time="+new Date().getTime() // this.webUrl = "http://172.18.0.147:8000/#/?time="+new Date().getTime()
console.log(this.webUrl)
this.webUrl = "https://wxcs.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=171795610000098&time="+new Date().getTime()
// this.webUrl = "https://wx.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=134581110000230&companyId=00000310&time="+new Date().getTime()
}, },
methods:{ methods:{
handleMsg(e){ handleMsg(e){
console.log(e) console.log(e)
console.log('接收到消息:' + JSON.stringify(e.detail.data));
uni.navigateToMiniProgram({
orderId: data.orderId ,
});
} }
}, },
onLoad(){ onLoad(){
......
<template>
<view>
<button @click="pay">测试小程序支付</button>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
pay() {
let params = {
"prepay_id": "wx151613092294758229d4369b2a414d0000",
"appId": "wx60c6530c49c52ff7",
"timeStamp": "1678867989",
"nonceStr": "1gaLpfAGDaG70y7SlQMd4GDfd0SzhP8j",
"package": "prepay_id=wx151613092294758229d4369b2a414d0000",
"signType": "RSA",
"paySign": "DEZRfCE2eCZ5Oi+jzEx2qtnSZiDzqy0GE7GRHOfjf1zmwZXpE+OgW6+7ExpmHInNWmiBRoxuDX6TpjM1O/B1241yNi47buf2IsuLE49nlPqw/o0lv1o9zBav/7elM0o3d7jLTljhR6GguEpcBmwNkaFJGYmvO2kS3Llzwl+RHJUPTcfs3YgWFtdJTRhul9aBuIs0ZUAG3qSWIawipBfFBGUYBLusn6+ebYh+SRzOEPZSV8N5lEbLd8CqYq7CxNuJVG5IYZlva3cWRmK8f3R6F/t2gTQveFlI8jEl1OK5ZqEjvYi1ct64DHYtbUl/kzl4pMJAZweQnNbZk8bYQwPGsA=="
}
console.log(params)
wx.requestPayment({
appId:params.appId,
timeStamp: params.timeStamp,
nonceStr: params.nonceStr,
package: params.nonceStr,
signType: params.signType,
paySign: params.paySign,
success(res) {
console.log("小程序成功。。。。")
console.log(res)
},
fail(res) {
console.log("shibai 。。。。")
console.log(res)
}
})
}
},
}
</script>
<style>
</style>
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
</view> </view>
</view> </view>
<image src="../../static/img/run/ranking_btn.png" class="ranking_btn" mode="widthFix"></image> <image src="../../static/img/run/ranking_btn.png" class="ranking_btn" mode="widthFix"></image>
<!-- open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" -->
<!-- <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">1111</button> -->
</view> </view>
</view> </view>
<u-tabbar :value="tabBarVal" @change="changeTabBar" :fixed="true" :placeholder="true" activeColor="#00c791" :safeAreaInsetBottom="true"> <u-tabbar :value="tabBarVal" @change="changeTabBar" :fixed="true" :placeholder="true" activeColor="#00c791" :safeAreaInsetBottom="true">
...@@ -44,7 +46,11 @@ ...@@ -44,7 +46,11 @@
data() { data() {
return { return {
todayNum: 0, todayNum: 0,
tabBarVal: '步数' tabBarVal: '步数',
registerPopup:true,
form:{name:'xxx'},
tips: '获取',
seconds: 10
} }
}, },
computed: { computed: {
...@@ -60,10 +66,10 @@ ...@@ -60,10 +66,10 @@
success: function(res) { success: function(res) {
wRunEncryptedData.encryptedData = res.encryptedData wRunEncryptedData.encryptedData = res.encryptedData
wRunEncryptedData.iv = res.iv wRunEncryptedData.iv = res.iv
console.log(wRunEncryptedData)
http('user.wxRun', wRunEncryptedData).then(res => { http('user.wxRun', wRunEncryptedData).then(res => {
if (!res.code && res.data) { if (!res.code && res.data) {
that.todayNum = res.data.todayNum; // that.todayNum = res.data.todayNum;
that.todayNum = 0;
console.log(that.todayNum) console.log(that.todayNum)
} else { } else {
that.todayNum = 0; that.todayNum = 0;
...@@ -75,13 +81,19 @@ ...@@ -75,13 +81,19 @@
}, },
changeTabBar(name){ changeTabBar(name){
this.tabBarVal = name; this.tabBarVal = name;
console.log(name) console.log(name)
if(name == '商城') { if(name == '商城') {
uni.navigateTo({ uni.navigateTo({
url: '/pages/h5/index', url: '/pages/h5/index',
}) })
} }
} },
getPhoneNumber (e) {
if(!e.detail.code){
this.$u.toast(e.detail.code);
}
},
}, },
onHide(){ onHide(){
}, },
...@@ -114,7 +126,7 @@ ...@@ -114,7 +126,7 @@
console.log(this.registerInfo) console.log(this.registerInfo)
http('user.register', this.registerInfo).then(res => { http('user.register', this.registerInfo).then(res => {
if (!res.code) { if (!res.code) {
// this.getWeRunData()
} else { } else {
// that.$u.toast(res.msg); // that.$u.toast(res.msg);
} }
...@@ -188,16 +200,13 @@ ...@@ -188,16 +200,13 @@
} }
} }
// .footer { .registre-popup{
// position: fixed; margin:60rpx 0;
// bottom: 0; padding:0 40rpx;
// background: red; .btn{
// display: flex;
// width: 100%; }
// li{ }
// flex: 1;
// }
// }
} }
.u-page__item__slot-icon { .u-page__item__slot-icon {
......
...@@ -24,6 +24,11 @@ export default { ...@@ -24,6 +24,11 @@ export default {
auth: true, auth: true,
method: "post" method: "post"
}, },
getPh:{
url: 'mall/miniProgram/wxRun',
auth: true,
method: "post"
}
}, },
......
...@@ -18,7 +18,7 @@ export default function http( ...@@ -18,7 +18,7 @@ export default function http(
throw (`暂未登录,已阻止此次API请求: '${api.url}'`); throw (`暂未登录,已阻止此次API请求: '${api.url}'`);
} }
token && shoproRequest.setConfig(config => { token && shoproRequest.setConfig(config => {
config.header.mpAuthor = token config.header.mpoAuthor = token
}) })
if (toastBefore !== '') { if (toastBefore !== '') {
uni.showLoading({ uni.showLoading({
......
...@@ -37,6 +37,8 @@ const actions = { ...@@ -37,6 +37,8 @@ const actions = {
} else { } else {
uni.login({ uni.login({
success: function(info) { success: function(info) {
console.log("获取手机号======")
console.log(info)
let code = info.code; let code = info.code;
http('user.getHomePage', { http('user.getHomePage', {
code: code, code: code,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment