7 changed files with 198 additions and 44 deletions
-
4common/api.js
-
10common/styles/iconfont.css
-
6pages.json
-
48pages/goodsDetail/index.vue
-
2pages/login/index.vue
-
98pages/order/confirm_atonce.vue
-
74pages/order/confirm_order.vue
@ -0,0 +1,98 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
order_id: 0 |
||||
|
} |
||||
|
}, |
||||
|
onLoad(e) { |
||||
|
this.order_id = e.order_id |
||||
|
console.log(this.order_id) |
||||
|
if(this.order_id) { |
||||
|
this.getUserProfile() |
||||
|
}else { |
||||
|
this.order_id = '1111111'; |
||||
|
this.getUserProfile(); |
||||
|
console.log('oder_id',this.order_id) |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取用户信息 |
||||
|
getUserProfile(){ |
||||
|
uni.getUserProfile({ |
||||
|
desc: '您的信息将用于小程序显示', |
||||
|
lang: 'zh_CN', |
||||
|
complete: result => { |
||||
|
console.log(result) |
||||
|
if(result.errMsg == 'getUserProfile:ok'){ |
||||
|
let encryptedData = result.encryptedData; |
||||
|
let iv = result.iv; |
||||
|
let signature = result.signature; |
||||
|
// let userInfo = uni.getStorageSync('userinfo') || {}; |
||||
|
|
||||
|
this.$http(this.API.API_GETUSERINFO, { |
||||
|
encryptedData, |
||||
|
iv, |
||||
|
// token: userInfo.token // 已在公共参数传 |
||||
|
}).then(res => { |
||||
|
console.log("更新用户信息", res); |
||||
|
this.$msg('更新成功', {icon: 'success'}); |
||||
|
uni.setStorageSync('userinfo', res.data); |
||||
|
this.payOnce() |
||||
|
setTimeout(() => { |
||||
|
this.$toBack(); |
||||
|
}, 1000); |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
payOnce() { |
||||
|
this.$http(this.API.API_LF_PAY,{id: this.order_id}).then(res => { |
||||
|
uni.requestPayment({ |
||||
|
orderInfo: res.data.order_num, |
||||
|
timeStamp: res.data.timeStamp, |
||||
|
nonceStr: res.data.nonceStr, |
||||
|
package: res.data.package, |
||||
|
signType: res.data.signType, |
||||
|
paySign: res.data.paySign, |
||||
|
success: (res) => { |
||||
|
this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) |
||||
|
}, |
||||
|
fail: (err) => { |
||||
|
this.$url('/pages/payState/paystate?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'}) |
||||
|
}, |
||||
|
}) |
||||
|
}).catch(err => {}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.btn{ |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
width: 212rpx; |
||||
|
height: 82rpx; |
||||
|
background-color: #1998FE; |
||||
|
color: #FFFFFF; |
||||
|
line-height: 80rpx; |
||||
|
font-size: 32rpx; |
||||
|
border-radius: 41rpx; |
||||
|
} |
||||
|
.bref-box { |
||||
|
text-overflow: -o-ellipsis-lastline; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
display: -webkit-box; |
||||
|
-webkit-line-clamp: 2; |
||||
|
-webkit-box-orient: vertical; |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue