作者 卢胜

订单详情

1 -<script>  
2 - var wx = require('jweixin-module')  
3 - import {authorization,getOpenid } from '@/api/send'  
4 - export default {  
5 - onLaunch: function(e) {  
6 - const openId = uni.getStorageSync('openId')  
7 - console.log(openId);  
8 - if(!openId && !e.query.code){  
9 - console.log(!openId , !e.query.code);  
10 - console.log(1)  
11 - // getApp().authorization()  
12 - }else if(e.query.code) {  
13 - // getApp().getOpenid(e.query.code)  
14 - console.log(2)  
15 - }  
16 - console.log(e.query.code);  
17 - console.log('App Launch')  
18 - },  
19 - onShow: function() {  
20 - console.log('App Show')  
21 - },  
22 - onHide: function() {  
23 - console.log('App Hide')  
24 - },  
25 - methods: {  
26 - // 拿code  
27 - async authorization(){  
28 - try {  
29 - const res = await authorization(window.location.href)  
30 - console.log('authorization', res)  
31 - window.location.href = res.url  
32 - // 保存数据  
33 - } catch (err) {  
34 - uni.showToast({ title:err,icon:'none' })  
35 - console.log('authorization', err)  
36 - }  
37 - },  
38 - // 获取openid  
39 - async getOpenid(code){  
40 - try {  
41 - const res = await getOpenid(code)  
42 - console.log('getOpenid', res)  
43 - uni.setStorageSync('openId',res.openid)  
44 - // 保存数据  
45 - } catch (err) {  
46 - setTimeout(()=>{  
47 - uni.showToast({ title:err,icon:'none' })  
48 - },300)  
49 - uni.redirectTo({  
50 - url:'/pages/index/index'  
51 - })  
52 - console.log('getOpenid', err)  
53 - }  
54 - },  
55 - },  
56 - }  
57 -</script>  
58 - 1 +<script>
  2 + var wx = require('jweixin-module')
  3 + import {authorization,getOpenid } from '@/api/send'
  4 + export default {
  5 + // http://localhost:8080/
  6 + onLaunch: function(e) {
  7 + const openId = uni.getStorageSync('openId')
  8 + console.log(openId);
  9 + if(!openId && !e.query.code){
  10 + getApp().authorization()
  11 + }else if(e.query.code) {
  12 + console.log(2);
  13 + getApp().getOpenid(e.query.code)
  14 + }
  15 + // else {
  16 + // uni.showModal({
  17 + // content: 'open:'+openId + 'code:'+e.query.code,
  18 + // showCancel: false
  19 + // });
  20 + // }
  21 + console.log(e.query.code);
  22 + console.log('App Launch')
  23 + },
  24 + onShow: function() {
  25 + console.log('App Show')
  26 + },
  27 + onHide: function() {
  28 + console.log('App Hide')
  29 + },
  30 + methods: {
  31 + // 拿code
  32 + async authorization(){
  33 + try {
  34 + const res = await authorization(window.location.href)
  35 + console.log('authorization', res)
  36 + window.location.href = res.url
  37 + // 保存数据
  38 + } catch (err) {
  39 + uni.showToast({ title:err,icon:'none' })
  40 + console.log('authorization', err)
  41 + }
  42 + },
  43 + // 获取openid
  44 + async getOpenid(code){
  45 + try {
  46 + const res = await getOpenid(code)
  47 + console.log('getOpenid', res)
  48 + uni.setStorageSync('openId',res.openid)
  49 + // 保存数据
  50 + } catch (err) {
  51 + setTimeout(()=>{
  52 + uni.showToast({ title:err,icon:'none' })
  53 + },300)
  54 + uni.redirectTo({
  55 + url:'/pages/index/index'
  56 + })
  57 + console.log('getOpenid', err)
  58 + }
  59 + },
  60 + },
  61 + }
  62 +</script>
  63 +
59 <style lang="scss"> 64 <style lang="scss">
60 - /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */  
61 - @import "uview-ui/index.scss";  
62 - uni-page-head {  
63 - display:none !important;  
64 - }  
65 - /*每个页面公共css */  
66 - .wh100 {  
67 - width: 100%;  
68 - height: 100%;  
69 - }  
70 -  
71 - .flexC {  
72 - display: flex;  
73 - justify-content: center;  
74 - align-items: center;  
75 - }  
76 - .flexD {  
77 - display: flex;  
78 - justify-content: space-between;  
79 - align-items: center;  
80 - }  
81 -  
82 - .flex {  
83 - display: flex;  
84 - }  
85 -  
86 - .flexA {  
87 - display: flex;  
88 - align-items: center;  
89 - }  
90 -  
91 - .fw700 {  
92 - font-weight: 700;  
93 - }  
94 -  
95 - .flexwrap {  
96 - display: flex;  
97 - flex-wrap: wrap;  
98 - align-items: center;  
99 - }  
100 -  
101 - .flexcolum {  
102 - display: flex;  
103 - flex-direction: column;  
104 - justify-content: center;  
105 - align-items: center;  
106 - }  
107 -  
108 - .serviceBtn {  
109 - opacity: 0;  
110 - position: absolute;  
111 - left: 0;  
112 - bottom: 0;  
113 - width: 120rpx;  
114 - height: 120rpx;  
115 - }  
116 -</style>  
117 -<style>  
118 -  
119 - /*每个页面公共css */ 65 + /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
  66 + @import "uview-ui/index.scss";
  67 + uni-page-head {
  68 + display:none !important;
  69 + }
  70 + /*每个页面公共css */
  71 + .wh100 {
  72 + width: 100%;
  73 + height: 100%;
  74 + }
  75 +
  76 + .flexC {
  77 + display: flex;
  78 + justify-content: center;
  79 + align-items: center;
  80 + }
  81 + .flexD {
  82 + display: flex;
  83 + justify-content: space-between;
  84 + align-items: center;
  85 + }
  86 +
  87 + .flex {
  88 + display: flex;
  89 + }
  90 +
  91 + .flexA {
  92 + display: flex;
  93 + align-items: center;
  94 + }
  95 +
  96 + .fw700 {
  97 + font-weight: 700;
  98 + }
  99 +
  100 + .flexwrap {
  101 + display: flex;
  102 + flex-wrap: wrap;
  103 + align-items: center;
  104 + }
  105 +
  106 + .flexcolum {
  107 + display: flex;
  108 + flex-direction: column;
  109 + justify-content: center;
  110 + align-items: center;
  111 + }
  112 +
  113 + .serviceBtn {
  114 + opacity: 0;
  115 + position: absolute;
  116 + left: 0;
  117 + bottom: 0;
  118 + width: 120rpx;
  119 + height: 120rpx;
  120 + }
120 </style> 121 </style>
  122 +<style>
  123 +
  124 + /*每个页面公共css */
  125 +</style>
@@ -164,7 +164,7 @@ @@ -164,7 +164,7 @@
164 if(!this.lastInfo.buyer_wechat) return toa.toast('请输入微信号') 164 if(!this.lastInfo.buyer_wechat) return toa.toast('请输入微信号')
165 // console.log(this.lastInfo, "000000") 165 // console.log(this.lastInfo, "000000")
166 let obj = { 166 let obj = {
167 - openid:uni.getStorageSync('token'), 167 + openid:uni.getStorageSync('openId'),
168 product_id: this.product_id, 168 product_id: this.product_id,
169 buyer_package: this.lastInfo.buyer_package, 169 buyer_package: this.lastInfo.buyer_package,
170 buyer_wechat: this.lastInfo.buyer_wechat, 170 buyer_wechat: this.lastInfo.buyer_wechat,
@@ -21,8 +21,8 @@ @@ -21,8 +21,8 @@
21 <input type="text" v-model="form.withdraw_name" placeholder="请输入" value="" /> 21 <input type="text" v-model="form.withdraw_name" placeholder="请输入" value="" />
22 </view> 22 </view>
23 <view class="list"> 23 <view class="list">
24 - <view class="input">支付宝绑定的手机号:</view>  
25 - <input type="number" v-model="form.withdraw_mobile" maxlength="11" placeholder="请输入" value="" /> 24 + <view class="input">支付宝绑定的账号:</view>
  25 + <input type="text" v-model="form.withdraw_mobile" maxlength="11" placeholder="请输入" value="" />
26 </view> 26 </view>
27 </view> 27 </view>
28 <view class="payInput" v-if="form.withdraw_type==3"> 28 <view class="payInput" v-if="form.withdraw_type==3">
@@ -203,6 +203,24 @@ @@ -203,6 +203,24 @@
203 uni.showToast({ title:err,icon:'none' }) 203 uni.showToast({ title:err,icon:'none' })
204 console.log('takeMoney', err) 204 console.log('takeMoney', err)
205 } 205 }
  206 + },
  207 + async takeBail(){
  208 + try {
  209 + const res = await takeBail(this.form)
  210 + setTimeout(()=>{
  211 + toa.success('提现提交成功,请等待审核')
  212 + },200)
  213 + for (let key in this.form) {
  214 + this.form[key]=''
  215 + }
  216 + this.form.withdraw_type = 1
  217 + this.getUserInfo()
  218 + console.log('takeMoney', res)
  219 + // 保存数据
  220 + } catch (err) {
  221 + uni.showToast({ title:err,icon:'none' })
  222 + console.log('takeMoney', err)
  223 + }
206 } 224 }
207 225
208 }, 226 },
1 <!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)')) 1 <!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)'))
2 - 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>  
  2 + 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>
@@ -18,9 +18,11 @@ export const request = (options) => { @@ -18,9 +18,11 @@ export const request = (options) => {
18 } else { 18 } else {
19 if(res.data.code== 401){ 19 if(res.data.code== 401){
20 uni.navigateTo({ 20 uni.navigateTo({
21 - url:'/login/login' 21 + url:'/pages/login/login'
22 }) 22 })
23 - uni.clearStorageSync() 23 + // uni.clearStorageSync()
  24 + uni.removeStorageSync('token')
  25 + uni.removeStorageSync('userInfo')
24 } 26 }
25 reject(res.data.msg) 27 reject(res.data.msg)
26 } 28 }