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

修改支付

parent e4e2df2e
......@@ -47,6 +47,16 @@
}
}
,{
"path" : "pages/h5/pay",
"name":"pay",
"style" :
{
"navigationBarTitleText": "支付",
"enablePullDownRefresh": false
}
}
],
"subPackages":[],
"tabBar": {
......@@ -84,8 +94,8 @@
"current": 0, //当前激活的模式(list 的索引项)
"list": [
{
"name": "index", //模式名称
"path": "/pages/index/index" //启动页面,必选
"name": "pay", //模式名称
"path": "/pages/h5/pay" //启动页面,必选
}
]
},
......
<template>
<view>
<web-view @message="handleMsg" :src='webUrl'></web-view>
<web-view @message="handleMsg" :src='webUrl' ></web-view>
</view>
</template>
......@@ -12,11 +12,18 @@
}
} ,
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:{
handleMsg(e){
console.log(e)
console.log('接收到消息:' + JSON.stringify(e.detail.data));
uni.navigateToMiniProgram({
orderId: data.orderId ,
});
}
},
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 @@
</view>
</view>
<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>
<u-tabbar :value="tabBarVal" @change="changeTabBar" :fixed="true" :placeholder="true" activeColor="#00c791" :safeAreaInsetBottom="true">
......@@ -44,7 +46,11 @@
data() {
return {
todayNum: 0,
tabBarVal: '步数'
tabBarVal: '步数',
registerPopup:true,
form:{name:'xxx'},
tips: '获取',
seconds: 10
}
},
computed: {
......@@ -60,10 +66,10 @@
success: function(res) {
wRunEncryptedData.encryptedData = res.encryptedData
wRunEncryptedData.iv = res.iv
console.log(wRunEncryptedData)
http('user.wxRun', wRunEncryptedData).then(res => {
if (!res.code && res.data) {
that.todayNum = res.data.todayNum;
// that.todayNum = res.data.todayNum;
that.todayNum = 0;
console.log(that.todayNum)
} else {
that.todayNum = 0;
......@@ -75,13 +81,19 @@
},
changeTabBar(name){
this.tabBarVal = name;
console.log(name)
if(name == '商城') {
uni.navigateTo({
url: '/pages/h5/index',
})
}
}
console.log(name)
if(name == '商城') {
uni.navigateTo({
url: '/pages/h5/index',
})
}
},
getPhoneNumber (e) {
if(!e.detail.code){
this.$u.toast(e.detail.code);
}
},
},
onHide(){
},
......@@ -114,7 +126,7 @@
console.log(this.registerInfo)
http('user.register', this.registerInfo).then(res => {
if (!res.code) {
// this.getWeRunData()
} else {
// that.$u.toast(res.msg);
}
......@@ -188,16 +200,13 @@
}
}
// .footer {
// position: fixed;
// bottom: 0;
// background: red;
// display: flex;
// width: 100%;
// li{
// flex: 1;
// }
// }
.registre-popup{
margin:60rpx 0;
padding:0 40rpx;
.btn{
}
}
}
.u-page__item__slot-icon {
......
......@@ -24,6 +24,11 @@ export default {
auth: true,
method: "post"
},
getPh:{
url: 'mall/miniProgram/wxRun',
auth: true,
method: "post"
}
},
......
......@@ -18,7 +18,7 @@ export default function http(
throw (`暂未登录,已阻止此次API请求: '${api.url}'`);
}
token && shoproRequest.setConfig(config => {
config.header.mpAuthor = token
config.header.mpoAuthor = token
})
if (toastBefore !== '') {
uni.showLoading({
......
......@@ -37,6 +37,8 @@ const actions = {
} else {
uni.login({
success: function(info) {
console.log("获取手机号======")
console.log(info)
let code = info.code;
http('user.getHomePage', {
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