作者 卢胜

订单详情

<script>
var wx = require('jweixin-module')
import {authorization,getOpenid } from '@/api/send'
export default {
onLaunch: function(e) {
const openId = uni.getStorageSync('openId')
console.log(openId);
if(!openId && !e.query.code){
console.log(!openId , !e.query.code);
console.log(1)
// getApp().authorization()
}else if(e.query.code) {
// getApp().getOpenid(e.query.code)
console.log(2)
}
console.log(e.query.code);
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
methods: {
// 拿code
async authorization(){
try {
const res = await authorization(window.location.href)
console.log('authorization', res)
window.location.href = res.url
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('authorization', err)
}
},
// 获取openid
async getOpenid(code){
try {
const res = await getOpenid(code)
console.log('getOpenid', res)
uni.setStorageSync('openId',res.openid)
// 保存数据
} catch (err) {
setTimeout(()=>{
uni.showToast({ title:err,icon:'none' })
},300)
uni.redirectTo({
url:'/pages/index/index'
})
console.log('getOpenid', err)
}
},
},
}
</script>
<script>
var wx = require('jweixin-module')
import {authorization,getOpenid } from '@/api/send'
export default {
// http://localhost:8080/
onLaunch: function(e) {
const openId = uni.getStorageSync('openId')
console.log(openId);
if(!openId && !e.query.code){
getApp().authorization()
}else if(e.query.code) {
console.log(2);
getApp().getOpenid(e.query.code)
}
// else {
// uni.showModal({
// content: 'open:'+openId + 'code:'+e.query.code,
// showCancel: false
// });
// }
console.log(e.query.code);
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
methods: {
// 拿code
async authorization(){
try {
const res = await authorization(window.location.href)
console.log('authorization', res)
window.location.href = res.url
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('authorization', err)
}
},
// 获取openid
async getOpenid(code){
try {
const res = await getOpenid(code)
console.log('getOpenid', res)
uni.setStorageSync('openId',res.openid)
// 保存数据
} catch (err) {
setTimeout(()=>{
uni.showToast({ title:err,icon:'none' })
},300)
uni.redirectTo({
url:'/pages/index/index'
})
console.log('getOpenid', err)
}
},
},
}
</script>
<style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss";
uni-page-head {
display:none !important;
}
/*每个页面公共css */
.wh100 {
width: 100%;
height: 100%;
}
.flexC {
display: flex;
justify-content: center;
align-items: center;
}
.flexD {
display: flex;
justify-content: space-between;
align-items: center;
}
.flex {
display: flex;
}
.flexA {
display: flex;
align-items: center;
}
.fw700 {
font-weight: 700;
}
.flexwrap {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.flexcolum {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.serviceBtn {
opacity: 0;
position: absolute;
left: 0;
bottom: 0;
width: 120rpx;
height: 120rpx;
}
</style>
<style>
/*每个页面公共css */
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss";
uni-page-head {
display:none !important;
}
/*每个页面公共css */
.wh100 {
width: 100%;
height: 100%;
}
.flexC {
display: flex;
justify-content: center;
align-items: center;
}
.flexD {
display: flex;
justify-content: space-between;
align-items: center;
}
.flex {
display: flex;
}
.flexA {
display: flex;
align-items: center;
}
.fw700 {
font-weight: 700;
}
.flexwrap {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.flexcolum {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.serviceBtn {
opacity: 0;
position: absolute;
left: 0;
bottom: 0;
width: 120rpx;
height: 120rpx;
}
</style>
<style>
/*每个页面公共css */
</style>
\ No newline at end of file
... ...
... ... @@ -164,7 +164,7 @@
if(!this.lastInfo.buyer_wechat) return toa.toast('请输入微信号')
// console.log(this.lastInfo, "000000")
let obj = {
openid:uni.getStorageSync('token'),
openid:uni.getStorageSync('openId'),
product_id: this.product_id,
buyer_package: this.lastInfo.buyer_package,
buyer_wechat: this.lastInfo.buyer_wechat,
... ...
... ... @@ -21,8 +21,8 @@
<input type="text" v-model="form.withdraw_name" placeholder="请输入" value="" />
</view>
<view class="list">
<view class="input">支付宝绑定的手机号:</view>
<input type="number" v-model="form.withdraw_mobile" maxlength="11" placeholder="请输入" value="" />
<view class="input">支付宝绑定的账号:</view>
<input type="text" v-model="form.withdraw_mobile" maxlength="11" placeholder="请输入" value="" />
</view>
</view>
<view class="payInput" v-if="form.withdraw_type==3">
... ... @@ -203,6 +203,24 @@
uni.showToast({ title:err,icon:'none' })
console.log('takeMoney', err)
}
},
async takeBail(){
try {
const res = await takeBail(this.form)
setTimeout(()=>{
toa.success('提现提交成功,请等待审核')
},200)
for (let key in this.form) {
this.form[key]=''
}
this.form.withdraw_type = 1
this.getUserInfo()
console.log('takeMoney', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('takeMoney', err)
}
}
},
... ...
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>元届印象</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.f3bf79df.js></script><script src=/static/js/index.5c54ce65.js></script></body></html>
\ No newline at end of file
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.f3bf79df.js></script><script src=/static/js/index.9fa833af.js></script></body></html>
\ No newline at end of file
... ...
... ... @@ -18,9 +18,11 @@ export const request = (options) => {
} else {
if(res.data.code== 401){
uni.navigateTo({
url:'/login/login'
url:'/pages/login/login'
})
uni.clearStorageSync()
// uni.clearStorageSync()
uni.removeStorageSync('token')
uni.removeStorageSync('userInfo')
}
reject(res.data.msg)
}
... ...