正在显示
26 个修改的文件
包含
1049 行增加
和
241 行删除
@@ -742,7 +742,7 @@ | @@ -742,7 +742,7 @@ | ||
742 | height: 4rpx; | 742 | height: 4rpx; |
743 | background: #C29445; | 743 | background: #C29445; |
744 | position: absolute; | 744 | position: absolute; |
745 | - bottom: -30rpx; | 745 | + bottom: -22rpx; |
746 | left: 50%; | 746 | left: 50%; |
747 | transform: translateX(-50%); | 747 | transform: translateX(-50%); |
748 | 748 | ||
@@ -1134,4 +1134,24 @@ | @@ -1134,4 +1134,24 @@ | ||
1134 | text-align: center; | 1134 | text-align: center; |
1135 | margin-top: 30rpx; | 1135 | margin-top: 30rpx; |
1136 | } | 1136 | } |
1137 | + .add{ | ||
1138 | + width:750rpx; | ||
1139 | + height:116rpx; | ||
1140 | + background: #fff; | ||
1141 | + position: fixed; | ||
1142 | + bottom:0; | ||
1143 | + left:0; | ||
1144 | + display:flex; | ||
1145 | + justify-content: center; | ||
1146 | + align-items: center; | ||
1147 | + } | ||
1148 | + .addcount{ | ||
1149 | + width:686rpx; | ||
1150 | + height:88rpx; | ||
1151 | + background:#C29445; | ||
1152 | + color:#fff; | ||
1153 | + font-size: 32rpx; | ||
1154 | + text-align: center; | ||
1155 | + line-height: 88rpx; | ||
1156 | + } | ||
1137 | </style> | 1157 | </style> |
1 | { | 1 | { |
2 | "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages | 2 | "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
3 | - | ||
4 | - | ||
5 | { | 3 | { |
6 | "path": "pages/homepage/homepage", | 4 | "path": "pages/homepage/homepage", |
7 | "style": { | 5 | "style": { |
@@ -22,6 +20,7 @@ | @@ -22,6 +20,7 @@ | ||
22 | "navigationBarTextStyle": "black" | 20 | "navigationBarTextStyle": "black" |
23 | } | 21 | } |
24 | }, | 22 | }, |
23 | + | ||
25 | { | 24 | { |
26 | "path": "pages/nearshop/allprovince", | 25 | "path": "pages/nearshop/allprovince", |
27 | "style": { | 26 | "style": { |
@@ -55,9 +54,6 @@ | @@ -55,9 +54,6 @@ | ||
55 | } | 54 | } |
56 | }, | 55 | }, |
57 | 56 | ||
58 | - | ||
59 | - | ||
60 | - | ||
61 | { | 57 | { |
62 | "path": "pages/nearshop/cartlist", | 58 | "path": "pages/nearshop/cartlist", |
63 | "style": { | 59 | "style": { |
@@ -3,56 +3,64 @@ | @@ -3,56 +3,64 @@ | ||
3 | 3 | ||
4 | <uni-swipe-action> | 4 | <uni-swipe-action> |
5 | <uni-swipe-action-item v-for="(item,index) in swipeList" :options="item.options" :key="item.id" @change="swipeChange" | 5 | <uni-swipe-action-item v-for="(item,index) in swipeList" :options="item.options" :key="item.id" @change="swipeChange" |
6 | - @click="swipeClick($event,index)"> | ||
7 | - <!-- <text class="cont">{{item.content}}</text> --> | ||
8 | - <view class="searchshop commnonpadding"> | 6 | + > |
9 | 7 | ||
8 | + <!-- <text class="cont">{{item.content}}</text> --> | ||
9 | + <!-- @click="swipeClick($event,index)" --> | ||
10 | + <view class="searchshop commnonpadding" @click.stop="shopdetail" :data-id="item.store_id"> | ||
10 | <view class="searchgooditem flex boxsizing"> | 11 | <view class="searchgooditem flex boxsizing"> |
11 | <view class="shopleftimg"> | 12 | <view class="shopleftimg"> |
12 | - <image src="../../static/shop.png" mode=""></image> | 13 | + <image :src="item.store.image" mode=""></image> |
13 | </view> | 14 | </view> |
14 | <view class="shopright"> | 15 | <view class="shopright"> |
15 | - <view class="shopname">湖北省南阳市南阳面粉厂</view> | 16 | + <view class="shopname">{{item.store.name}}</view> |
16 | <view class="shopmiddle flexone"> | 17 | <view class="shopmiddle flexone"> |
17 | <view class="shopmiddleleft"> | 18 | <view class="shopmiddleleft"> |
18 | - 8.2 | 19 | + {{item.store.score}} |
19 | </view> | 20 | </view> |
20 | <view class="shopmiddleright"> | 21 | <view class="shopmiddleright"> |
21 | <view class="star flex"> | 22 | <view class="star flex"> |
22 | <view class="starimg"> | 23 | <view class="starimg"> |
23 | - <image src="../../static/shixing.png" mode=""></image> | 24 | + <image src="../../static/shixing.png" mode="" v-if="item.store.star>=2"></image> |
25 | + <image src="../../static/kongxing.png" mode="" v-else></image> | ||
24 | </view> | 26 | </view> |
25 | <view class="starimg"> | 27 | <view class="starimg"> |
26 | - <image src="../../static/shixing.png" mode=""></image> | 28 | + <image src="../../static/shixing.png" mode="" v-if="item.store.star>=4"></image> |
29 | + <image src="../../static/kongxing.png" mode="" v-else></image> | ||
27 | </view> | 30 | </view> |
28 | <view class="starimg"> | 31 | <view class="starimg"> |
29 | - <image src="../../static/shixing.png" mode=""></image> | 32 | + <image src="../../static/shixing.png" mode="" v-if="item.store.star>=6"></image> |
33 | + <image src="../../static/kongxing.png" mode="" v-else></image> | ||
30 | </view> | 34 | </view> |
31 | <view class="starimg"> | 35 | <view class="starimg"> |
32 | - <image src="../../static/shixing.png" mode=""></image> | 36 | + <image src="../../static/shixing.png" mode="" v-if="item.store.star>=8"></image> |
37 | + <image src="../../static/kongxing.png" mode="" v-else></image> | ||
33 | </view> | 38 | </view> |
34 | <view class="starimg"> | 39 | <view class="starimg"> |
35 | - <image src="../../static/kongxing.png" mode=""></image> | 40 | + <image src="../../static/shixing.png" mode="" v-if="item.store.star>=10"></image> |
41 | + <image src="../../static/kongxing.png" mode="" v-else></image> | ||
36 | </view> | 42 | </view> |
37 | </view> | 43 | </view> |
38 | - <view class="haoping">好评率96%</view> | 44 | + <view class="haoping">好评率{{item.store.probability}}%</view> |
39 | </view> | 45 | </view> |
40 | </view> | 46 | </view> |
41 | <view class="shopdizhi flexone"> | 47 | <view class="shopdizhi flexone"> |
42 | <view class="shopdiimg"> | 48 | <view class="shopdiimg"> |
43 | <image src="../../static/shopaddress.png" mode=""></image> | 49 | <image src="../../static/shopaddress.png" mode=""></image> |
44 | </view> | 50 | </view> |
45 | - <view class='shopli'>距离256km</view> | 51 | + <view class='shopli'>距离{{item.store.distance}}km</view> |
46 | </view> | 52 | </view> |
47 | </view> | 53 | </view> |
48 | </view> | 54 | </view> |
49 | </view> | 55 | </view> |
56 | + | ||
50 | </uni-swipe-action-item> | 57 | </uni-swipe-action-item> |
51 | </uni-swipe-action> | 58 | </uni-swipe-action> |
52 | </view> | 59 | </view> |
53 | </template> | 60 | </template> |
54 | 61 | ||
55 | <script> | 62 | <script> |
63 | + import app from "../../App.vue"; | ||
56 | import uniSection from '@/components/uni-section/uni-section.vue' | 64 | import uniSection from '@/components/uni-section/uni-section.vue' |
57 | import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue' | 65 | import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue' |
58 | import uniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue' | 66 | import uniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue' |
@@ -82,8 +90,50 @@ | @@ -82,8 +90,50 @@ | ||
82 | this.$nextTick(() => { | 90 | this.$nextTick(() => { |
83 | this.isOpened = true | 91 | this.isOpened = true |
84 | }) | 92 | }) |
93 | + // 获取店铺收藏列表 | ||
94 | + this.getcollectshop() | ||
85 | }, | 95 | }, |
86 | methods: { | 96 | methods: { |
97 | + // 获取收藏店铺 | ||
98 | + getcollectshop() { | ||
99 | + let that = this; | ||
100 | + var url = 'store/collect_list'; | ||
101 | + var params = { | ||
102 | + | ||
103 | + } | ||
104 | + console.log(params) | ||
105 | + app.post(url, params).then((res) => { | ||
106 | + let shoplist = res.data.data; | ||
107 | + shoplist.forEach(function(value, index, array) { | ||
108 | + value.options = [{ | ||
109 | + text: '取消收藏', | ||
110 | + style: { | ||
111 | + backgroundColor: '#DAD7DB' | ||
112 | + } | ||
113 | + }] | ||
114 | + }) | ||
115 | + that.swipeList = shoplist; | ||
116 | + this.$forceUpdate() | ||
117 | + console.log(that.swipeList) | ||
118 | + console.log(res) | ||
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | ||
123 | + | ||
124 | + }).catch((err) => { | ||
125 | + console.log(err) | ||
126 | + }) | ||
127 | + }, | ||
128 | + // 店铺详情 | ||
129 | + shopdetail(e) { | ||
130 | + console.log(33493490) | ||
131 | + let id = e.currentTarget.dataset.id; | ||
132 | + console.log(id) | ||
133 | + uni.navigateTo({ | ||
134 | + url: '/pages/nearshop/shopdetail?shopid=' + id | ||
135 | + }) | ||
136 | + }, | ||
87 | bindClick(e) { | 137 | bindClick(e) { |
88 | uni.showToast({ | 138 | uni.showToast({ |
89 | title: `点击了${e.content.text}按钮`, | 139 | title: `点击了${e.content.text}按钮`, |
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | <view class="homename">面访用品</view> | 36 | <view class="homename">面访用品</view> |
37 | 37 | ||
38 | </view> | 38 | </view> |
39 | - <view class="homeboxitem flexfour"> | 39 | + <view class="homeboxitem flexfour" @click="collectshop"> |
40 | <view class="homeitemimg"> | 40 | <view class="homeitemimg"> |
41 | <image src="../../static/shopcollect.png" mode=""></image> | 41 | <image src="../../static/shopcollect.png" mode=""></image> |
42 | </view> | 42 | </view> |
@@ -215,7 +215,6 @@ | @@ -215,7 +215,6 @@ | ||
215 | } | 215 | } |
216 | }, | 216 | }, |
217 | methods: { | 217 | methods: { |
218 | - | ||
219 | getlocation() { | 218 | getlocation() { |
220 | let that=this; | 219 | let that=this; |
221 | uni.getLocation({ | 220 | uni.getLocation({ |
@@ -224,7 +223,7 @@ | @@ -224,7 +223,7 @@ | ||
224 | console.log('当前位置的经度:' + res.longitude); | 223 | console.log('当前位置的经度:' + res.longitude); |
225 | console.log('当前位置的纬度:' + res.latitude); | 224 | console.log('当前位置的纬度:' + res.latitude); |
226 | uni.setStorageSync("longitude",res.longitude); | 225 | uni.setStorageSync("longitude",res.longitude); |
227 | - uni.setStorageSync("latitude",res.longitude) | 226 | + uni.setStorageSync("latitude",res.latitude) |
228 | var point = new plus.maps.Point(res.longitude, res.latitude); | 227 | var point = new plus.maps.Point(res.longitude, res.latitude); |
229 | plus.maps.Map.reverseGeocode( | 228 | plus.maps.Map.reverseGeocode( |
230 | point, {}, | 229 | point, {}, |
@@ -246,7 +245,8 @@ | @@ -246,7 +245,8 @@ | ||
246 | that.provincename=uni.getStorageSync("provincename") | 245 | that.provincename=uni.getStorageSync("provincename") |
247 | } | 246 | } |
248 | 247 | ||
249 | - console.log(that.provincename) | 248 | + console.log(that.provincename); |
249 | + that.changeinfo() | ||
250 | // that.getprovinceid() | 250 | // that.getprovinceid() |
251 | 251 | ||
252 | // _this.addressList = address.match(reg).toString().split(","); | 252 | // _this.addressList = address.match(reg).toString().split(","); |
@@ -261,6 +261,24 @@ | @@ -261,6 +261,24 @@ | ||
261 | } | 261 | } |
262 | }); | 262 | }); |
263 | }, | 263 | }, |
264 | + // 修改个人信息 | ||
265 | + changeinfo(){ | ||
266 | + let that = this; | ||
267 | + var url = 'member/update_user'; | ||
268 | + var params = { | ||
269 | + avatar:'', | ||
270 | + nickname:'', | ||
271 | + longitude:uni.getStorageSync("longitude"), | ||
272 | + latitude:uni.getStorageSync("latitude") | ||
273 | + } | ||
274 | + console.log(params) | ||
275 | + app.post(url, params).then((res) => { | ||
276 | + console.log(res); | ||
277 | + this.carttotal=res.data.data.total | ||
278 | + }).catch((err) => { | ||
279 | + | ||
280 | + }) | ||
281 | + }, | ||
264 | // 获取购物车气泡 | 282 | // 获取购物车气泡 |
265 | getcartnum(){ | 283 | getcartnum(){ |
266 | let that = this; | 284 | let that = this; |
@@ -271,14 +289,18 @@ | @@ -271,14 +289,18 @@ | ||
271 | app.post(url, params).then((res) => { | 289 | app.post(url, params).then((res) => { |
272 | console.log(res); | 290 | console.log(res); |
273 | this.carttotal=res.data.data.total | 291 | this.carttotal=res.data.data.total |
274 | - | ||
275 | - | ||
276 | - | ||
277 | }).catch((err) => { | 292 | }).catch((err) => { |
278 | 293 | ||
279 | }) | 294 | }) |
280 | }, | 295 | }, |
281 | 296 | ||
297 | + // 店铺收藏 | ||
298 | + collectshop(){ | ||
299 | + uni.navigateTo({ | ||
300 | + url:"/pages/homepage/collectshop" | ||
301 | + }) | ||
302 | + }, | ||
303 | + | ||
282 | // 抽奖专区 | 304 | // 抽奖专区 |
283 | choujiang() { | 305 | choujiang() { |
284 | uni.navigateTo({ | 306 | uni.navigateTo({ |
@@ -8,21 +8,25 @@ | @@ -8,21 +8,25 @@ | ||
8 | </view> | 8 | </view> |
9 | <view class="miaoshatime flexthree"> | 9 | <view class="miaoshatime flexthree"> |
10 | <view class='miaoname'>距离开始</view> | 10 | <view class='miaoname'>距离开始</view> |
11 | - <view class='miaotime miaohour boxsizing'>8</view> | 11 | + <!-- days:'', |
12 | + hours:'', | ||
13 | + minutes:'', | ||
14 | + seconds:'', --> | ||
15 | + <view class='miaotime miaohour boxsizing'>{{days}}</view> | ||
12 | <view class="miaoname">天</view> | 16 | <view class="miaoname">天</view> |
13 | <view class="miaofen flexone miaohour"> | 17 | <view class="miaofen flexone miaohour"> |
14 | - <view class='miaotime miaok'>2</view> | ||
15 | - <view class='miaotime'>3</view> | 18 | + <view class='miaotime miaok'>{{hours}}</view> |
19 | + <!-- <view class='miaotime'>3</view> --> | ||
16 | </view> | 20 | </view> |
17 | <view class="miaoname">:</view> | 21 | <view class="miaoname">:</view> |
18 | <view class="miaofen flexone miaohour"> | 22 | <view class="miaofen flexone miaohour"> |
19 | - <view class='miaotime boxsizing miaok'>4</view> | ||
20 | - <view class='miaotime boxsizing'>5</view> | 23 | + <view class='miaotime boxsizing miaok'>{{minutes}}</view> |
24 | + <!-- <view class='miaotime boxsizing'>5</view> --> | ||
21 | </view> | 25 | </view> |
22 | <view class="miaoname">:</view> | 26 | <view class="miaoname">:</view> |
23 | <view class="miaofen flexone miaohour"> | 27 | <view class="miaofen flexone miaohour"> |
24 | - <view class='miaotime boxsizing miaok'>1</view> | ||
25 | - <view class='miaotime boxsizing'>2</view> | 28 | + <view class='miaotime boxsizing miaok'>{{seconds}}</view> |
29 | + <!-- <view class='miaotime boxsizing'>2</view> --> | ||
26 | </view> | 30 | </view> |
27 | </view> | 31 | </view> |
28 | 32 | ||
@@ -51,7 +55,6 @@ | @@ -51,7 +55,6 @@ | ||
51 | </view> | 55 | </view> |
52 | </view> | 56 | </view> |
53 | </view> | 57 | </view> |
54 | - | ||
55 | <!-- <view class="searchgooditem flexone boxsizing"> | 58 | <!-- <view class="searchgooditem flexone boxsizing"> |
56 | <view class="gooditemleft"> | 59 | <view class="gooditemleft"> |
57 | <image src="../../static/goopic.png" mode=""></image> | 60 | <image src="../../static/goopic.png" mode=""></image> |
@@ -123,13 +126,80 @@ | @@ -123,13 +126,80 @@ | ||
123 | return { | 126 | return { |
124 | showbanben: false, | 127 | showbanben: false, |
125 | page:1, | 128 | page:1, |
126 | - orderlist:[] | 129 | + orderlist:[], |
130 | + days:'', | ||
131 | + hours:'', | ||
132 | + minutes:'', | ||
133 | + seconds:'', | ||
127 | } | 134 | } |
128 | }, | 135 | }, |
129 | onLoad() { | 136 | onLoad() { |
130 | - this.getmiaosha() | 137 | + this.getmiaosha(); |
138 | + this.getTime() | ||
131 | }, | 139 | }, |
132 | methods: { | 140 | methods: { |
141 | + // 获取倒计时 | ||
142 | + getTime(){ | ||
143 | + let that = this; | ||
144 | + var url = 'flour_goods/seckill_setting'; | ||
145 | + | ||
146 | + var params = { | ||
147 | + | ||
148 | + } | ||
149 | + console.log(params) | ||
150 | + app.post(url,params, "post").then((res) => { | ||
151 | + console.log(res); | ||
152 | + let remaintime=res.data.data.endtime-res.data.data.starttime | ||
153 | + let number = remaintime; | ||
154 | + // 时间戳处理 | ||
155 | + var totalSecond = number; | ||
156 | + console.log(totalSecond); | ||
157 | + var interval = setInterval(function () { | ||
158 | + // 秒数 | ||
159 | + var second = totalSecond; | ||
160 | + | ||
161 | + // 天数位 | ||
162 | + var day = Math.floor(second/3600/24); | ||
163 | + var dayStr = day.toString(); | ||
164 | + if (dayStr.length == 1) dayStr = '0' + dayStr; | ||
165 | + // 小时位 | ||
166 | + var hr = Math.floor((second - day * 3600 * 24) / 3600); | ||
167 | + var hrStr = hr.toString(); | ||
168 | + if (hrStr.length == 1) hrStr = '0' + hrStr; | ||
169 | + // 分钟位 | ||
170 | + var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60); | ||
171 | + var minStr = min.toString(); | ||
172 | + if (minStr.length == 1) minStr = '0' + minStr; | ||
173 | + // 秒位 | ||
174 | + var sec = second - day * 3600 * 24 - hr * 3600 - min * 60; | ||
175 | + var secStr = sec.toString(); | ||
176 | + if (secStr.length == 1) secStr = '0' + secStr; | ||
177 | + | ||
178 | + that.days=dayStr; | ||
179 | + that.hours=hrStr; | ||
180 | + that.minutes=minStr; | ||
181 | + that.seconds=secStr; | ||
182 | + | ||
183 | + | ||
184 | + totalSecond--; | ||
185 | + if (totalSecond <= 0) { | ||
186 | + clearInterval(interval); | ||
187 | + uni.showToast({ | ||
188 | + title: '活动已结束', | ||
189 | + icon:'none' | ||
190 | + }); | ||
191 | + // 倒计时结束 | ||
192 | + //that.countDown(); | ||
193 | + that.days='00'; | ||
194 | + that.hours='00'; | ||
195 | + that.minutes='00'; | ||
196 | + that.seconds='00'; | ||
197 | + } | ||
198 | + }.bind(this), 1000); | ||
199 | + | ||
200 | + | ||
201 | + }).catch((err) => {}) | ||
202 | + }, | ||
133 | getmiaosha() { | 203 | getmiaosha() { |
134 | let that = this; | 204 | let that = this; |
135 | var url = 'flour_goods/get_flour_goods'; | 205 | var url = 'flour_goods/get_flour_goods'; |
@@ -23,7 +23,6 @@ | @@ -23,7 +23,6 @@ | ||
23 | </view> | 23 | </view> |
24 | <view class="cardyan" @click="getcode" v-if="disable==false">{{time}}</view> | 24 | <view class="cardyan" @click="getcode" v-if="disable==false">{{time}}</view> |
25 | <view class="cardyan" v-else>{{time}}</view> | 25 | <view class="cardyan" v-else>{{time}}</view> |
26 | - | ||
27 | <!-- <view class="cardyan" @click="getcode">{{time}}</view> --> | 26 | <!-- <view class="cardyan" @click="getcode">{{time}}</view> --> |
28 | </view> | 27 | </view> |
29 | <button class="loginbtn" @click="login">登录</button> | 28 | <button class="loginbtn" @click="login">登录</button> |
@@ -104,7 +103,6 @@ | @@ -104,7 +103,6 @@ | ||
104 | }, | 103 | }, |
105 | // 获取验证码 | 104 | // 获取验证码 |
106 | getcode() { | 105 | getcode() { |
107 | - | ||
108 | let that = this; | 106 | let that = this; |
109 | that.disable = true; | 107 | that.disable = true; |
110 | if (that.phone == '') { | 108 | if (that.phone == '') { |
@@ -267,7 +265,6 @@ | @@ -267,7 +265,6 @@ | ||
267 | url: '/pages/login/xieyi?type=' + type | 265 | url: '/pages/login/xieyi?type=' + type |
268 | }) | 266 | }) |
269 | } | 267 | } |
270 | - | ||
271 | }, | 268 | }, |
272 | forgetmima() { | 269 | forgetmima() { |
273 | uni.navigateTo({ | 270 | uni.navigateTo({ |
@@ -276,6 +273,7 @@ | @@ -276,6 +273,7 @@ | ||
276 | }, | 273 | }, |
277 | // 微信登录 | 274 | // 微信登录 |
278 | wxlogin() { | 275 | wxlogin() { |
276 | + let that = this; | ||
279 | uni.login({ | 277 | uni.login({ |
280 | provider: 'weixin', | 278 | provider: 'weixin', |
281 | success: function(loginRes) { | 279 | success: function(loginRes) { |
@@ -286,6 +284,36 @@ | @@ -286,6 +284,36 @@ | ||
286 | success: function(infoRes) { | 284 | success: function(infoRes) { |
287 | console.log(infoRes) | 285 | console.log(infoRes) |
288 | console.log('用户昵称为:' + infoRes.userInfo.nickName); | 286 | console.log('用户昵称为:' + infoRes.userInfo.nickName); |
287 | + | ||
288 | + var url = 'user/wechat_login'; | ||
289 | + var params = { | ||
290 | + nickname:infoRes.userInfo.nickName, | ||
291 | + avatar:infoRes.userInfo.avatarUrl, | ||
292 | + openid:infoRes.userInfo.openId, | ||
293 | + gender:infoRes.userInfo.gender, | ||
294 | + city:infoRes.userInfo.city, | ||
295 | + province:infoRes.userInfo.province, | ||
296 | + country:infoRes.userInfo.country, | ||
297 | + more:JSON.stringify(infoRes.userInfo) | ||
298 | + } | ||
299 | + console.log('参数', params) | ||
300 | + app.post(url, params, "post").then((res) => { | ||
301 | + console.log(res); | ||
302 | + uni.showToast({ | ||
303 | + title:'登录成功', | ||
304 | + iocn:'none' | ||
305 | + }) | ||
306 | + setTimeout(function(){ | ||
307 | + uni.navigateTo({ | ||
308 | + url:"/pages/homepage/homepage" | ||
309 | + }) | ||
310 | + },1500) | ||
311 | + | ||
312 | + }).catch((err) => { | ||
313 | + console.log(err) | ||
314 | + | ||
315 | + }) | ||
316 | + | ||
289 | } | 317 | } |
290 | }); | 318 | }); |
291 | } | 319 | } |
@@ -19,9 +19,13 @@ | @@ -19,9 +19,13 @@ | ||
19 | </view> | 19 | </view> |
20 | </view> | 20 | </view> |
21 | <view class="tapnav flexone"> | 21 | <view class="tapnav flexone"> |
22 | + | ||
22 | <!-- :class="order==2?'nearactive':''" --> | 23 | <!-- :class="order==2?'nearactive':''" --> |
23 | <!-- :class="order==3?'nearactive':''" --> | 24 | <!-- :class="order==3?'nearactive':''" --> |
24 | - <view class="tapnavitem" :class="order==2?'nearactive':''" @click="rangge" :data-id="2">距离最近</view> | 25 | + |
26 | + <view class="tapnavitem" :class="order==2?'nearactive':''" @click="rangge" :data-id="2"> | ||
27 | + 距离最近 | ||
28 | + </view> | ||
25 | <view class="tapnavitem pingfen" @click="rangge" :class="order==3?'nearactive':''" :data-id="3">评分最高</view> | 29 | <view class="tapnavitem pingfen" @click="rangge" :class="order==3?'nearactive':''" :data-id="3">评分最高</view> |
26 | </view> | 30 | </view> |
27 | 31 |
1 | <template> | 1 | <template> |
2 | <view class="page"> | 2 | <view class="page"> |
3 | <view class="box"> | 3 | <view class="box"> |
4 | - <view class="item"> | ||
5 | - <view class="info"> | 4 | + <view :class="item.type==3?'item':'itemk'" v-for="(item,index) in accountlist" :key="index"> |
5 | + <view v-if="item.type==1" @click="seltype(item)"> | ||
6 | + <view class="info flextwo"> | ||
6 | <view class="name"> | 7 | <view class="name"> |
7 | - <image src="../../static/logo.png" mode="widthFix" class="icon" /> 农业银行 | 8 | + <image src="../../static/ticard.png" class="icon iconk"/> 提现到我的钱包 |
8 | </view> | 9 | </view> |
9 | - <view class="num"> | ||
10 | - <view class="numItem"> | ||
11 | - <view class="dian"/> | ||
12 | - <view class="dian"/> | ||
13 | - <view class="dian"/> | ||
14 | - <view class="dian"/> | ||
15 | - </view> | ||
16 | - <view class="numItem"> | ||
17 | - <view class="dian"/> | ||
18 | - <view class="dian"/> | ||
19 | - <view class="dian"/> | ||
20 | - <view class="dian"/> | ||
21 | - </view> | ||
22 | - <view class="numItem"> | ||
23 | - <vieitemw class="dian"/> | ||
24 | - <view class="dian"/> | ||
25 | - <view class="dian"/> | ||
26 | - <view class="dian"/> | ||
27 | - </view> | ||
28 | - <view class="numItem">2665</view> | ||
29 | - </view> | ||
30 | - </view> | ||
31 | - <view class="btnBox"> | ||
32 | - <view class="edit">编辑</view> | 10 | + |
33 | <image src="../../static/right.png" mode="widthFix" class="right"></image> | 11 | <image src="../../static/right.png" mode="widthFix" class="right"></image> |
34 | </view> | 12 | </view> |
35 | </view> | 13 | </view> |
36 | - <view class="item"> | ||
37 | - <view class="info"> | 14 | + <view class='bankitem' v-if="item.type==3"> |
15 | + <view class="info" @click="seltype(item)"> | ||
38 | <view class="name"> | 16 | <view class="name"> |
39 | - <image src="../../static/build.png" mode="widthFix" class="icon" /> 建设银行 | 17 | + <image :src="item.image" mode="widthFix" class="icon"/> {{item.bank_name}} |
40 | </view> | 18 | </view> |
41 | <view class="num"> | 19 | <view class="num"> |
42 | <view class="numItem"> | 20 | <view class="numItem"> |
@@ -57,28 +35,90 @@ | @@ -57,28 +35,90 @@ | ||
57 | <view class="dian"/> | 35 | <view class="dian"/> |
58 | <view class="dian"/> | 36 | <view class="dian"/> |
59 | </view> | 37 | </view> |
60 | - <view class="numItem">2665</view> | 38 | + <view class="numItem">{{item.card_number}}</view> |
61 | </view> | 39 | </view> |
62 | </view> | 40 | </view> |
63 | - <view class="btnBox"> | 41 | + <view class="btnBox" @click="editcard(item)"> |
64 | <view class="edit">编辑</view> | 42 | <view class="edit">编辑</view> |
65 | <image src="../../static/right.png" mode="widthFix" class="right"></image> | 43 | <image src="../../static/right.png" mode="widthFix" class="right"></image> |
66 | </view> | 44 | </view> |
67 | </view> | 45 | </view> |
46 | + | ||
47 | + </view> | ||
48 | + | ||
68 | </view> | 49 | </view> |
50 | + <view class="add" @click='addcart'> | ||
51 | + <view class="addcount">添加银行卡</view> | ||
52 | + </view> | ||
53 | + | ||
69 | </view> | 54 | </view> |
70 | </template> | 55 | </template> |
71 | 56 | ||
72 | <script> | 57 | <script> |
58 | + import app from "../../App.vue"; | ||
73 | export default { | 59 | export default { |
74 | data() { | 60 | data() { |
75 | return { | 61 | return { |
76 | - | 62 | + page:1, |
63 | + pageNum:10, | ||
64 | + accountlist:[] | ||
77 | } | 65 | } |
78 | }, | 66 | }, |
67 | + onLoad(){ | ||
68 | + | ||
69 | + }, | ||
79 | methods: { | 70 | methods: { |
71 | + //获取账户信息 | ||
72 | + getaccount(){ | ||
73 | + let that = this; | ||
74 | + var url = 'bank/get_list'; | ||
75 | + var params = { | ||
76 | + page:that.page, | ||
77 | + pageNum:10 | ||
78 | + } | ||
79 | + console.log('7766554', params) | ||
80 | + app.post(url, params).then((res) => { | ||
81 | + console.log(res); | ||
82 | + that.accountlist=that.accountlist.concat(res.data.data); | ||
83 | + that.accountlist.forEach(function(value,index,array){ | ||
84 | + value.card_number=value.card_number.substr(-4) | ||
85 | + }) | ||
86 | + that.accountlist=that.accountlist; | ||
87 | + | ||
88 | + }).catch((err) => { | ||
89 | + console.log(err) | ||
80 | 90 | ||
91 | + }) | ||
92 | + }, | ||
93 | + // 选择银行卡信息 | ||
94 | + seltype(item){ | ||
95 | + console.log(item) | ||
96 | + uni.$emit('accountinfo',item); | ||
97 | + uni.navigateTo({ | ||
98 | + url:'/pages/usercenter/cashOut' | ||
99 | + }) | ||
100 | + }, | ||
101 | + // 添加银行卡 | ||
102 | + addcart(){ | ||
103 | + uni.navigateTo({ | ||
104 | + url:'/pages/usercenter/addCard' | ||
105 | + }) | ||
106 | + }, | ||
107 | + // 编辑银行卡 | ||
108 | + editcard(item){ | ||
109 | + let newitem=JSON.stringify(item); | ||
110 | + uni.navigateTo({ | ||
111 | + url:'/pages/usercenter/addCard?item='+newitem+'&type='+1 | ||
112 | + }) | ||
113 | + } | ||
114 | + | ||
115 | + }, | ||
116 | + onShow(){ | ||
117 | + this.page=1; | ||
118 | + this.accountlist=[] | ||
119 | + this.getaccount() | ||
81 | } | 120 | } |
121 | + | ||
82 | } | 122 | } |
83 | </script> | 123 | </script> |
84 | 124 | ||
@@ -86,11 +126,14 @@ | @@ -86,11 +126,14 @@ | ||
86 | page{ | 126 | page{ |
87 | background: #F7F7F7; | 127 | background: #F7F7F7; |
88 | } | 128 | } |
129 | + .infok{ | ||
130 | + | ||
131 | + } | ||
89 | .box{ | 132 | .box{ |
90 | margin-top: 38rpx; | 133 | margin-top: 38rpx; |
91 | padding: 32rpx; | 134 | padding: 32rpx; |
92 | box-sizing: border-box; | 135 | box-sizing: border-box; |
93 | - overflow: hidden; | 136 | + padding-bottom: 140rpx;; |
94 | } | 137 | } |
95 | .item{ | 138 | .item{ |
96 | width: 100%; | 139 | width: 100%; |
@@ -100,6 +143,14 @@ | @@ -100,6 +143,14 @@ | ||
100 | box-sizing: border-box; | 143 | box-sizing: border-box; |
101 | margin-top: 16rpx; | 144 | margin-top: 16rpx; |
102 | } | 145 | } |
146 | + .itemk{ | ||
147 | + width: 100%; | ||
148 | + height: 124rpx; | ||
149 | + background: #fff; | ||
150 | + padding: 24rpx; | ||
151 | + box-sizing: border-box; | ||
152 | + margin-top: 16rpx; | ||
153 | + } | ||
103 | .info { | 154 | .info { |
104 | display: flex; | 155 | display: flex; |
105 | flex-wrap: wrap; | 156 | flex-wrap: wrap; |
@@ -114,14 +165,20 @@ | @@ -114,14 +165,20 @@ | ||
114 | font-family:PingFangHK-Regular,PingFangHK; | 165 | font-family:PingFangHK-Regular,PingFangHK; |
115 | font-weight:400; | 166 | font-weight:400; |
116 | color:rgba(8,18,31,1); | 167 | color:rgba(8,18,31,1); |
117 | - line-height:44rpx; | 168 | + /* line-height:44rpx; */ |
118 | display: flex; | 169 | display: flex; |
119 | align-items: center; | 170 | align-items: center; |
120 | } | 171 | } |
121 | .icon{ | 172 | .icon{ |
122 | width: 36rpx; | 173 | width: 36rpx; |
174 | + | ||
123 | margin-right: 8rpx; | 175 | margin-right: 8rpx; |
124 | } | 176 | } |
177 | + .iconk{ | ||
178 | + width: 36rpx; | ||
179 | + height:36rpx; | ||
180 | + | ||
181 | + } | ||
125 | .num{ | 182 | .num{ |
126 | display: flex; | 183 | display: flex; |
127 | align-items: center; | 184 | align-items: center; |
1 | <template> | 1 | <template> |
2 | <view class="page"> | 2 | <view class="page"> |
3 | + <view class="tixianbox"> | ||
4 | + <view class='tixiantype'>提现方式</view> | ||
5 | + <view class="tixianlist flexone"> | ||
6 | + <view class="tixianlistitem flexone" :class="sel==1?'selactivek':''" @click="selitem" :data-id="1"> | ||
7 | + <view class="tixianimg"> | ||
8 | + <image src="../../static/icon_wechat.png"></image> | ||
9 | + </view> | ||
10 | + <view class="tixianname">微信</view> | ||
11 | + </view> | ||
12 | + <view class="tixianlistitem flexone" :class="sel==2?'selactivek':''" @click="selitem" :data-id="2"> | ||
13 | + <view class="tixianimg"> | ||
14 | + <image src="../../static/icon_zhifu.png"></image> | ||
15 | + </view> | ||
16 | + <view class="tixianname">支付宝</view> | ||
17 | + </view> | ||
18 | + <view class="tixianlistitem flexone" :class="sel==3?'selactivek':''" @click="selitem" :data-id="3"> | ||
19 | + <view class="tixianimg"> | ||
20 | + <image src="../../static/ticard.png"></image> | ||
21 | + </view> | ||
22 | + <view class="tixianname">银行卡</view> | ||
23 | + </view> | ||
24 | + | ||
25 | + </view> | ||
26 | + | ||
27 | + </view> | ||
28 | + <!-- 微信 --> | ||
29 | + <view class="cardboxk" v-if="sel==1"> | ||
30 | + <view class="title">请输入绑定信息</view> | ||
31 | + <view class="box"> | ||
32 | + <view class="item"> | ||
33 | + <text class="name">姓名</text> | ||
34 | + <input type="text" value="" placeholder="请输入姓名" class="fill" @input="enternamew" /> | ||
35 | + </view> | ||
36 | + <view class="item"> | ||
37 | + <text class="name">账号</text> | ||
38 | + <input type="text" value="" placeholder="请输入微信账号" class="fill" @input="enteraccount" /> | ||
39 | + </view> | ||
40 | + | ||
41 | + </view> | ||
42 | + | ||
43 | + </view> | ||
44 | + <!--支付宝 --> | ||
45 | + <view class="cardboxk" v-if="sel==2"> | ||
46 | + <view class="title">请输入绑定信息</view> | ||
47 | + <view class="box"> | ||
48 | + <view class="item"> | ||
49 | + <text class="name">姓名</text> | ||
50 | + <input type="text" value="" placeholder="请输入姓名" class="fill" @input="enternamew" /> | ||
51 | + </view> | ||
52 | + <view class="item"> | ||
53 | + <text class="name">账号</text> | ||
54 | + <input type="text" value="" placeholder="请输入支付宝账号" class="fill" @input="enteraccount" /> | ||
55 | + </view> | ||
56 | + | ||
57 | + </view> | ||
58 | + | ||
59 | + </view> | ||
60 | + <!-- 银行卡 --> | ||
61 | + <view class="cardboxk" v-if="sel==3"> | ||
3 | <view class="title">请绑定持卡人本人的银行卡</view> | 62 | <view class="title">请绑定持卡人本人的银行卡</view> |
4 | <view class="box"> | 63 | <view class="box"> |
5 | <view class="item"> | 64 | <view class="item"> |
6 | <text class="name">持卡人</text> | 65 | <text class="name">持卡人</text> |
7 | - <input type="text" value="" placeholder="mingzi" class="fill"/> | 66 | + <input type="text" value="" placeholder="请输入持卡人" class="fill" @input="enterpeople" /> |
8 | </view> | 67 | </view> |
9 | <view class="item"> | 68 | <view class="item"> |
10 | <text class="name">卡号</text> | 69 | <text class="name">卡号</text> |
11 | - <input type="text" value="" placeholder="mingzi" class="fill"/> | 70 | + <input type="text" value="" placeholder="请输入卡号" class="fill" @input="entercard" /> |
12 | </view> | 71 | </view> |
72 | + <picker @change="bindbankPickerChange" :value="index" :range="bankarray" range-key="name"> | ||
73 | + <!-- <view class="uni-input">{{array[index]}}</view> --> | ||
13 | <view class="item"> | 74 | <view class="item"> |
14 | <text class="name">开户行</text> | 75 | <text class="name">开户行</text> |
15 | - <input type="text" value="" placeholder="mingzi" class="fill"/> | 76 | + <view class="fill">{{bankname}}</view> |
77 | + <!-- <input type="text" value="" placeholder="请输入开户行" class="fill" @input="enterbank" /> --> | ||
16 | </view> | 78 | </view> |
79 | + </picker> | ||
80 | + | ||
17 | <view class="item"> | 81 | <view class="item"> |
18 | <text class="name">手机号</text> | 82 | <text class="name">手机号</text> |
19 | - <input type="text" value="" placeholder="mingzi" class="fill"/> | 83 | + <input type="number" value="" placeholder="请输入手机号" class="fill" @input="enterphone" /> |
20 | </view> | 84 | </view> |
21 | </view> | 85 | </view> |
86 | + | ||
87 | + </view> | ||
88 | + | ||
89 | + | ||
90 | + <view class="add" @click='surecard'> | ||
91 | + <view class="addcount">确认</view> | ||
92 | + </view> | ||
22 | </view> | 93 | </view> |
23 | </template> | 94 | </template> |
24 | 95 | ||
25 | <script> | 96 | <script> |
97 | + import app from "../../App.vue"; | ||
26 | export default { | 98 | export default { |
27 | data() { | 99 | data() { |
28 | return { | 100 | return { |
29 | - | 101 | + people: '', |
102 | + card: '', | ||
103 | + bank: '', | ||
104 | + phone: '', | ||
105 | + item: '', | ||
106 | + type: '', | ||
107 | + sel: 1, | ||
108 | + name2: '', | ||
109 | + account: '', | ||
110 | + index:0, | ||
111 | + bankid:'', | ||
112 | + bankname:'请选择开户行', | ||
113 | + bankarray:[] | ||
30 | } | 114 | } |
31 | }, | 115 | }, |
116 | + onLoad(options) { | ||
117 | + if (options.item) { | ||
118 | + this.item = JSON.parse(options.item); | ||
119 | + this.type = options.type; | ||
120 | + } | ||
121 | + | ||
122 | + this.getbanklist() | ||
123 | + | ||
124 | + | ||
125 | + | ||
126 | + }, | ||
32 | methods: { | 127 | methods: { |
33 | 128 | ||
129 | + enterpeople(e) { | ||
130 | + this.people = e.detail.value | ||
131 | + }, | ||
132 | + entercard(e) { | ||
133 | + this.card = e.detail.value | ||
134 | + }, | ||
135 | + enterbank(e) { | ||
136 | + this.bank = e.detail.value | ||
137 | + }, | ||
138 | + enterphone(e) { | ||
139 | + console.log(e.detail.value) | ||
140 | + this.phone = e.detail.value; | ||
141 | + console.log(this.phone) | ||
142 | + }, | ||
143 | + selitem(e) { | ||
144 | + this.sel = e.currentTarget.dataset.id; | ||
145 | + }, | ||
146 | + // 输入姓名 | ||
147 | + enternamew(e) { | ||
148 | + this.name2 = e.detail.value | ||
149 | + }, | ||
150 | + // 输入账号 | ||
151 | + enteraccount(e) { | ||
152 | + this.account = e.detail.value | ||
153 | + }, | ||
154 | + // 选择开户行 | ||
155 | + bindbankPickerChange(e){ | ||
156 | + this.bankname=this.bankarray[e.target.value].name; | ||
157 | + this.bankid=this.bankarray[e.target.value].id | ||
158 | + }, | ||
159 | + | ||
160 | + // 获取开户行 | ||
161 | + getbanklist(){ | ||
162 | + let that=this; | ||
163 | + var url = 'bank/open_account'; | ||
164 | + var params = { | ||
165 | + } | ||
166 | + console.log('7766554', params) | ||
167 | + app.post(url, params).then((res) => { | ||
168 | + console.log(res); | ||
169 | + that.bankarray=res.data.data; | ||
170 | + | ||
171 | + }).catch((err) => { | ||
172 | + | ||
173 | + }) | ||
174 | + }, | ||
175 | + | ||
176 | + surecard() { | ||
177 | + let that = this; | ||
178 | + if(that.sel==3){ | ||
179 | + if (that.people == '') { | ||
180 | + uni.showToast({ | ||
181 | + title: "请输入持卡人", | ||
182 | + icon: "none" | ||
183 | + }) | ||
184 | + return false | ||
185 | + } | ||
186 | + if (that.card == '') { | ||
187 | + uni.showToast({ | ||
188 | + title: "请输入卡号", | ||
189 | + icon: "none" | ||
190 | + }) | ||
191 | + return false | ||
192 | + } | ||
193 | + | ||
194 | + if (!(/^1[3456789]\d{9}$/.test(that.phone))) { | ||
195 | + wx.showToast({ | ||
196 | + title: '请输入正确手机号', | ||
197 | + icon: 'none' | ||
198 | + }) | ||
199 | + return false; | ||
200 | + } | ||
201 | + }else{ | ||
202 | + if(that.name2==''){ | ||
203 | + uni.showToast({ | ||
204 | + title:'请输入姓名', | ||
205 | + icon:'none' | ||
206 | + }) | ||
207 | + return false | ||
208 | + } | ||
209 | + if(that.sel==1){ | ||
210 | + if(that.account==''){ | ||
211 | + uni.showToast({ | ||
212 | + title:'请输入微信账号', | ||
213 | + icon:'none' | ||
214 | + }) | ||
215 | + return false | ||
216 | + } | ||
217 | + }else{ | ||
218 | + if(that.account==''){ | ||
219 | + uni.showToast({ | ||
220 | + title:'请输入支付宝账号', | ||
221 | + icon:'none' | ||
222 | + }) | ||
223 | + return false | ||
224 | + } | ||
225 | + } | ||
226 | + | ||
227 | + } | ||
228 | + var url = 'bank/add_user_address'; | ||
229 | + var params = { | ||
230 | + type: that.sel, | ||
231 | + name: that.people, | ||
232 | + card_number: that.card, | ||
233 | + open_account_id: that.bankid, | ||
234 | + mobile: that.phone, | ||
235 | + name2: that.name2, | ||
236 | + account: that.account | ||
237 | + | ||
238 | + } | ||
239 | + console.log('7766554', params) | ||
240 | + app.post(url, params).then((res) => { | ||
241 | + console.log(res); | ||
242 | + | ||
243 | + if(that.sel==1){ | ||
244 | + uni.showToast({ | ||
245 | + title: '添加银行卡成功', | ||
246 | + icon: 'none' | ||
247 | + }) | ||
248 | + }else if(that.sel==2){ | ||
249 | + uni.showToast({ | ||
250 | + title: '添加微信账户成功', | ||
251 | + icon: 'none' | ||
252 | + }) | ||
253 | + }else if(that.sel==3){ | ||
254 | + uni.showToast({ | ||
255 | + title: '添加支付宝账户成功', | ||
256 | + icon: 'none' | ||
257 | + }) | ||
258 | + } | ||
259 | + | ||
260 | + setTimeout(function() { | ||
261 | + uni.navigateBack({ | ||
262 | + checked: true | ||
263 | + }) | ||
264 | + }, 1500) | ||
265 | + | ||
266 | + }).catch((err) => { | ||
267 | + | ||
268 | + }) | ||
269 | + } | ||
270 | + | ||
34 | } | 271 | } |
35 | } | 272 | } |
36 | </script> | 273 | </script> |
37 | 274 | ||
38 | <style> | 275 | <style> |
39 | - .title{ | ||
40 | - font-size:28rpx; | ||
41 | - font-family:PingFangHK-Regular,PingFangHK; | ||
42 | - font-weight:400; | ||
43 | - color:rgba(61,69,76,1); | 276 | + .tixianlist { |
277 | + margin-top: 22rpx; | ||
278 | + } | ||
279 | + | ||
280 | + .tixianlistitem { | ||
281 | + width: 184rpx; | ||
282 | + height: 72rpx; | ||
283 | + display: flex; | ||
284 | + align-items: center; | ||
285 | + justify-content: center; | ||
286 | + margin-right: 16rpx; | ||
287 | + border: 1rpx solid transparent; | ||
288 | + } | ||
289 | + | ||
290 | + .selactivek { | ||
291 | + border: 1rpx solid #C29445; | ||
292 | + border-radius: 8rpx; | ||
293 | + } | ||
294 | + | ||
295 | + .tixianname { | ||
296 | + color: #3D454C; | ||
297 | + font-size: 28rpx; | ||
298 | + margin-left: 8rpx; | ||
299 | + } | ||
300 | + | ||
301 | + .tixianbox { | ||
302 | + padding: 0 40rpx; | ||
303 | + box-sizing: border-box; | ||
304 | + } | ||
305 | + | ||
306 | + .tixiantype { | ||
307 | + color: #3D454C; | ||
308 | + font-size: 28rpx; | ||
309 | + } | ||
310 | + | ||
311 | + .tixianimg { | ||
312 | + width: 48rpx; | ||
313 | + height: 48rpx; | ||
314 | + font-size: 0; | ||
315 | + } | ||
316 | + | ||
317 | + image { | ||
318 | + width: 100%; | ||
319 | + height: 100%; | ||
320 | + } | ||
321 | + | ||
322 | + .title { | ||
323 | + font-size: 28rpx; | ||
324 | + font-family: PingFangHK-Regular, PingFangHK; | ||
325 | + font-weight: 400; | ||
326 | + color: rgba(61, 6 9, 76, 1); | ||
44 | line-height: 104rpx; | 327 | line-height: 104rpx; |
45 | padding: 0 40rpx; | 328 | padding: 0 40rpx; |
46 | box-sizing: border-box; | 329 | box-sizing: border-box; |
47 | } | 330 | } |
48 | - .box{ | 331 | + |
332 | + .box { | ||
49 | background: #fff; | 333 | background: #fff; |
50 | padding: 0 40rpx; | 334 | padding: 0 40rpx; |
51 | box-sizing: border-box; | 335 | box-sizing: border-box; |
52 | } | 336 | } |
53 | - .item{ | 337 | + |
338 | + .item { | ||
54 | height: 108rpx; | 339 | height: 108rpx; |
55 | display: flex; | 340 | display: flex; |
56 | align-items: center; | 341 | align-items: center; |
57 | border-bottom: 1px solid #EEEEEE; | 342 | border-bottom: 1px solid #EEEEEE; |
58 | } | 343 | } |
59 | - .name{ | 344 | + |
345 | + .name { | ||
60 | width: 84rpx; | 346 | width: 84rpx; |
61 | - font-size:28rpx; | ||
62 | - font-family:PingFangHK-Medium,PingFangHK; | ||
63 | - font-weight:600; | ||
64 | - color:rgba(8,18,31,1); | 347 | + font-size: 28rpx; |
348 | + font-family: PingFangHK-Medium, PingFangHK; | ||
349 | + font-weight: 600; | ||
350 | + color: rgba(8, 18, 31, 1); | ||
65 | margin-right: 16rpx; | 351 | margin-right: 16rpx; |
66 | } | 352 | } |
67 | - .fill{ | ||
68 | - width:232rpx; | ||
69 | - font-size:28rpx; | ||
70 | - font-family:PingFangHK-Regular,PingFangHK; | ||
71 | - font-weight:400; | ||
72 | - color:rgba(91,94,100,1); | 353 | + |
354 | + .fill { | ||
355 | + width: 232rpx; | ||
356 | + font-size: 28rpx; | ||
357 | + font-family: PingFangHK-Regular, PingFangHK; | ||
358 | + font-weight: 400; | ||
359 | + color: rgba(91, 94, 100, 1); | ||
73 | } | 360 | } |
74 | </style> | 361 | </style> |
1 | <template> | 1 | <template> |
2 | <view class="page"> | 2 | <view class="page"> |
3 | - <view class="box" style="margin-top: 0;"> | ||
4 | - <view class="cardBox"> | ||
5 | - <image src="../../static/logo.png" mode="widthFix" class="logo"/> | 3 | + <view class="box" style="margin-top: 0;" @click="selectaccount"> |
4 | + <view class='nodata' v-if="accountinfo==''">请选择提现账户</view> | ||
5 | + <view v-else> | ||
6 | + <view class="cardBox" v-if="accountinfo.type!=3"> | ||
7 | + <image src="../../static/ticard.png" mode="widthFix" class="logo" /> | ||
8 | + <view class="cardInfo"> | ||
9 | + <view class="cardTips">提现到钱包</view> | ||
10 | + | ||
11 | + </view> | ||
12 | + </view> | ||
13 | + <view class="cardBox" v-else> | ||
14 | + <image src="../../static/logo.png" mode="widthFix" class="logo" /> | ||
6 | <view class="cardInfo"> | 15 | <view class="cardInfo"> |
7 | <view class="cardTips">提现账户</view> | 16 | <view class="cardTips">提现账户</view> |
8 | <view class="cardName">农业银行(6549)</view> | 17 | <view class="cardName">农业银行(6549)</view> |
9 | </view> | 18 | </view> |
10 | </view> | 19 | </view> |
11 | </view> | 20 | </view> |
21 | + | ||
22 | + </view> | ||
12 | <view class="box"> | 23 | <view class="box"> |
13 | <view class="title">转账金额</view> | 24 | <view class="title">转账金额</view> |
14 | <view class="fillArea"> | 25 | <view class="fillArea"> |
15 | <text>¥</text> | 26 | <text>¥</text> |
16 | - <input type="text" class="fillmoney"> | 27 | + <input type="number" class="fillmoney" @input="emtermoney"> |
17 | </view> | 28 | </view> |
18 | <view class="tipsmoney">当前账户余额9938.57元</view> | 29 | <view class="tipsmoney">当前账户余额9938.57元</view> |
19 | </view> | 30 | </view> |
20 | <view class="box"> | 31 | <view class="box"> |
21 | <view class="title">转账说明:</view> | 32 | <view class="title">转账说明:</view> |
22 | - <textarea name="" id="" cols="30" rows="10" class="wordArea"></textarea> | 33 | + <textarea name="" id="" cols="30" rows="10" class="wordArea" placeholder="转账说明"></textarea> |
23 | </view> | 34 | </view> |
24 | <view class="submit">申请提现</view> | 35 | <view class="submit">申请提现</view> |
25 | </view> | 36 | </view> |
26 | </template> | 37 | </template> |
27 | 38 | ||
28 | <script> | 39 | <script> |
40 | + import app from "../../App.vue"; | ||
29 | export default { | 41 | export default { |
30 | data() { | 42 | data() { |
31 | return { | 43 | return { |
32 | - | 44 | + money: '', |
45 | + accountinfo: '' | ||
33 | } | 46 | } |
34 | }, | 47 | }, |
35 | methods: { | 48 | methods: { |
49 | + // 选择提现账户 | ||
50 | + selectaccount() { | ||
51 | + uni.navigateTo({ | ||
52 | + url: '/pages/usercenter/account' | ||
53 | + }) | ||
54 | + }, | ||
55 | + emtermoney(e) { | ||
56 | + var money; | ||
57 | + if (/^(\d?)+(\.\d{0,2})?$/.test(e.detail.value)) { //正则验证,提现金额小数点后不能大于两位数字 | ||
58 | + money = e.detail.value; | ||
59 | + } else { | ||
60 | + money = e.detail.value.substring(0, e.detail.value.length - 1); | ||
61 | + } | ||
62 | + this.money = money | ||
63 | + }, | ||
64 | + }, | ||
65 | + onShow() { | ||
66 | + let that=this; | ||
67 | + uni.$once('accountinfo',function(data){ | ||
68 | + that.accountinfo=data; | ||
69 | + console.log(6666); | ||
70 | + console.log(that.accountinfo) | ||
36 | 71 | ||
72 | + }) | ||
37 | } | 73 | } |
38 | } | 74 | } |
39 | </script> | 75 | </script> |
40 | 76 | ||
41 | <style> | 77 | <style> |
42 | - .page{ | 78 | + .page { |
43 | background: #FEFEFE; | 79 | background: #FEFEFE; |
44 | padding: 32rpx 32rpx 0; | 80 | padding: 32rpx 32rpx 0; |
45 | box-sizing: border-box; | 81 | box-sizing: border-box; |
46 | } | 82 | } |
47 | - .title{ | ||
48 | - font-size:32rpx; | ||
49 | - font-family:PingFangHK-Regular,PingFangHK; | ||
50 | - font-weight:600; | ||
51 | - color:rgba(8,18,31,1); | 83 | + |
84 | + .title { | ||
85 | + font-size: 32rpx; | ||
86 | + font-family: PingFangHK-Regular, PingFangHK; | ||
87 | + font-weight: 600; | ||
88 | + color: rgba(8, 18, 31, 1); | ||
52 | } | 89 | } |
53 | - .box{ | 90 | + |
91 | + .box { | ||
54 | margin-top: 60rpx; | 92 | margin-top: 60rpx; |
55 | } | 93 | } |
56 | - .userbox{ | ||
57 | - width:686rpx; | ||
58 | - height:120rpx; | ||
59 | - background:rgba(255,255,255,1); | ||
60 | - box-shadow:0px 8rpx 24rpx 0px rgba(0,0,0,0.06); | ||
61 | - border-radius:8rpx; | 94 | + |
95 | + .userbox { | ||
96 | + width: 686rpx; | ||
97 | + height: 120rpx; | ||
98 | + background: rgba(255, 255, 255, 1); | ||
99 | + box-shadow: 0px 8rpx 24rpx 0px rgba(0, 0, 0, 0.06); | ||
100 | + border-radius: 8rpx; | ||
62 | display: flex; | 101 | display: flex; |
63 | align-items: center; | 102 | align-items: center; |
64 | - font-size:32rpx; | ||
65 | - font-family:PingFangHK-Regular,PingFangHK; | ||
66 | - font-weight:400; | ||
67 | - color:rgba(8,18,31,1); | 103 | + font-size: 32rpx; |
104 | + font-family: PingFangHK-Regular, PingFangHK; | ||
105 | + font-weight: 400; | ||
106 | + color: rgba(8, 18, 31, 1); | ||
68 | margin-top: 32rpx; | 107 | margin-top: 32rpx; |
69 | padding: 0 24rpx; | 108 | padding: 0 24rpx; |
70 | box-sizing: border-box; | 109 | box-sizing: border-box; |
71 | } | 110 | } |
72 | - .avator{ | 111 | + |
112 | + .avator { | ||
73 | width: 72rpx; | 113 | width: 72rpx; |
74 | margin-right: 16rpx; | 114 | margin-right: 16rpx; |
75 | } | 115 | } |
76 | - .fillArea{ | 116 | + |
117 | + .fillArea { | ||
77 | height: 132rpx; | 118 | height: 132rpx; |
78 | display: flex; | 119 | display: flex; |
79 | align-items: center; | 120 | align-items: center; |
80 | border-bottom: 1px solid #EAEAEA; | 121 | border-bottom: 1px solid #EAEAEA; |
81 | } | 122 | } |
82 | - .fillArea text{ | ||
83 | - font-size:72rpx; | ||
84 | - font-family:PingFangHK-Regular,PingFangHK; | ||
85 | - font-weight:400; | ||
86 | - color:rgba(8,18,31,1); | 123 | + |
124 | + .fillArea text { | ||
125 | + font-size: 72rpx; | ||
126 | + font-family: PingFangHK-Regular, PingFangHK; | ||
127 | + font-weight: 400; | ||
128 | + color: rgba(8, 18, 31, 1); | ||
87 | margin-right: 16rpx; | 129 | margin-right: 16rpx; |
88 | } | 130 | } |
89 | - .fillmoney{ | 131 | + |
132 | + .fillmoney { | ||
90 | width: 400rpx; | 133 | width: 400rpx; |
91 | display: flex; | 134 | display: flex; |
92 | align-items: center; | 135 | align-items: center; |
93 | - font-size:32rpx; | ||
94 | - font-family:PingFangHK-Regular,PingFangHK; | ||
95 | - font-weight:400; | ||
96 | - color:rgba(8,18,31,1); | ||
97 | - } | ||
98 | - .tipsmoney{ | ||
99 | - font-size:24rpx; | ||
100 | - font-family:PingFangHK-Regular,PingFangHK; | ||
101 | - font-weight:400; | ||
102 | - color:rgba(189,196,206,1); | 136 | + font-size: 32rpx; |
137 | + font-family: PingFangHK-Regular, PingFangHK; | ||
138 | + font-weight: 400; | ||
139 | + color: rgba(8, 18, 31, 1); | ||
140 | + } | ||
141 | + | ||
142 | + .tipsmoney { | ||
143 | + font-size: 24rpx; | ||
144 | + font-family: PingFangHK-Regular, PingFangHK; | ||
145 | + font-weight: 400; | ||
146 | + color: rgba(189, 196, 206, 1); | ||
103 | margin-top: 14rpx; | 147 | margin-top: 14rpx; |
104 | } | 148 | } |
105 | - .wordArea{ | 149 | + |
150 | + .wordArea { | ||
106 | width: 100%; | 151 | width: 100%; |
107 | margin-top: 16rpx; | 152 | margin-top: 16rpx; |
108 | height: 160rpx; | 153 | height: 160rpx; |
109 | - font-size:28rpx; | ||
110 | - font-family:PingFangHK-Regular,PingFangHK; | ||
111 | - font-weight:400; | ||
112 | - color:rgba(61,69,76,1); | 154 | + font-size: 28rpx; |
155 | + font-family: PingFangHK-Regular, PingFangHK; | ||
156 | + font-weight: 400; | ||
157 | + color: rgba(61, 69, 76, 1); | ||
113 | } | 158 | } |
114 | - .submit{ | 159 | + |
160 | + .submit { | ||
115 | width: 686rpx; | 161 | width: 686rpx; |
116 | height: 84rpx; | 162 | height: 84rpx; |
117 | background: rgba(194, 148, 69, 1); | 163 | background: rgba(194, 148, 69, 1); |
@@ -125,31 +171,36 @@ | @@ -125,31 +171,36 @@ | ||
125 | align-items: center; | 171 | align-items: center; |
126 | margin: 100rpx auto; | 172 | margin: 100rpx auto; |
127 | } | 173 | } |
128 | - .cardBox{ | 174 | + |
175 | + .cardBox { | ||
129 | display: flex; | 176 | display: flex; |
130 | align-items: center; | 177 | align-items: center; |
131 | border-bottom: 1px solid #EAEAEA; | 178 | border-bottom: 1px solid #EAEAEA; |
132 | padding-bottom: 32rpx; | 179 | padding-bottom: 32rpx; |
133 | } | 180 | } |
134 | - .logo{ | 181 | + |
182 | + .logo { | ||
135 | width: 72rpx; | 183 | width: 72rpx; |
136 | margin-right: 16rpx; | 184 | margin-right: 16rpx; |
137 | } | 185 | } |
138 | - .cardInfo{ | 186 | + |
187 | + .cardInfo { | ||
139 | width: 596rpx; | 188 | width: 596rpx; |
140 | 189 | ||
141 | } | 190 | } |
142 | - .cardTips{ | ||
143 | - font-size:32rpx; | ||
144 | - font-family:PingFangHK-Regular,PingFangHK; | ||
145 | - font-weight:400; | ||
146 | - color:rgba(8,18,31,1); | 191 | + |
192 | + .cardTips { | ||
193 | + font-size: 32rpx; | ||
194 | + font-family: PingFangHK-Regular, PingFangHK; | ||
195 | + font-weight: 400; | ||
196 | + color: rgba(8, 18, 31, 1); | ||
147 | } | 197 | } |
148 | - .cardName{ | ||
149 | - font-size:28rpx; | ||
150 | - font-family:PingFangHK-Regular,PingFangHK; | ||
151 | - font-weight:400; | ||
152 | - color:rgba(8,18,31,1); | 198 | + |
199 | + .cardName { | ||
200 | + font-size: 28rpx; | ||
201 | + font-family: PingFangHK-Regular, PingFangHK; | ||
202 | + font-weight: 400; | ||
203 | + color: rgba(8, 18, 31, 1); | ||
153 | margin-top: 16rpx; | 204 | margin-top: 16rpx; |
154 | } | 205 | } |
155 | </style> | 206 | </style> |
@@ -4,14 +4,13 @@ | @@ -4,14 +4,13 @@ | ||
4 | <view class="title">充值金额</view> | 4 | <view class="title">充值金额</view> |
5 | <view class="money"> | 5 | <view class="money"> |
6 | ¥ | 6 | ¥ |
7 | - <input type="text" class="fill" /> | 7 | + <input class="fill" @input="emtermoney" type="digit" /> |
8 | </view> | 8 | </view> |
9 | 9 | ||
10 | <view class="huiyuanbot"> | 10 | <view class="huiyuanbot"> |
11 | <view class="behuiyuanbtn" @click="sureti">确认</view> | 11 | <view class="behuiyuanbtn" @click="sureti">确认</view> |
12 | </view> | 12 | </view> |
13 | </view> | 13 | </view> |
14 | - | ||
15 | <view class="cover" v-if="showwrap"> | 14 | <view class="cover" v-if="showwrap"> |
16 | <view class="coverBox"> | 15 | <view class="coverBox"> |
17 | <view class="top"> | 16 | <view class="top"> |
@@ -25,46 +24,143 @@ | @@ -25,46 +24,143 @@ | ||
25 | <view class="moneyTitle">订单总额</view> | 24 | <view class="moneyTitle">订单总额</view> |
26 | </view> --> | 25 | </view> --> |
27 | <view class="payBox"> | 26 | <view class="payBox"> |
28 | - <view class="payItem"> | 27 | + <view class="payItem" @click="zhifubao" :data-id="2"> |
29 | <view class="left"> | 28 | <view class="left"> |
30 | <image src="../../static/paya.png" mode="widthFix" /> | 29 | <image src="../../static/paya.png" mode="widthFix" /> |
31 | 支付宝 | 30 | 支付宝 |
32 | </view> | 31 | </view> |
33 | <view class="right"> | 32 | <view class="right"> |
34 | - <image src="../../static/nocheck.png" mode="widthFix" class="check" /> | 33 | + <image src="../../static/check.png" mode="widthFix" class="check" v-if="pay_type==2" /> |
34 | + <image src="../../static/nocheck.png" mode="widthFix" class="check" v-else /> | ||
35 | </view> | 35 | </view> |
36 | </view> | 36 | </view> |
37 | - <view class="payItem"> | 37 | + <view class="payItem" @click="weixin" :data-id="1"> |
38 | <view class="left"> | 38 | <view class="left"> |
39 | <image src="../../static/payb.png" mode="widthFix" /> | 39 | <image src="../../static/payb.png" mode="widthFix" /> |
40 | 微信 | 40 | 微信 |
41 | </view> | 41 | </view> |
42 | <view class="right"> | 42 | <view class="right"> |
43 | - <image src="../../static/check.png" mode="widthFix" class="check" /> | 43 | + <image src="../../static/check.png" mode="widthFix" class="check" v-if="pay_type==1" /> |
44 | + <image src="../../static/nocheck.png" mode="widthFix" class="check" v-else /> | ||
44 | </view> | 45 | </view> |
45 | </view> | 46 | </view> |
46 | </view> | 47 | </view> |
47 | - <view class="submit">确认支付(¥2560.00)</view> | 48 | + |
49 | + <view class="submit" @click="pay">确认支付(¥{{money}})</view> | ||
50 | + </view> | ||
51 | + | ||
48 | </view> | 52 | </view> |
49 | </view> | 53 | </view> |
50 | </view> | 54 | </view> |
51 | </template> | 55 | </template> |
52 | 56 | ||
53 | <script> | 57 | <script> |
58 | + import app from "../../App.vue"; | ||
54 | export default { | 59 | export default { |
55 | data() { | 60 | data() { |
56 | return { | 61 | return { |
57 | showwrap: false, | 62 | showwrap: false, |
63 | + money: '', | ||
64 | + pay_type: '' | ||
58 | }; | 65 | }; |
59 | }, | 66 | }, |
60 | methods: { | 67 | methods: { |
61 | - sureti(){ | ||
62 | - this.showwrap=true | 68 | + sureti() { |
69 | + if (this.money == '') { | ||
70 | + uni.showToast({ | ||
71 | + title: '请输入充值金额', | ||
72 | + icon: "none" | ||
73 | + }) | ||
74 | + | ||
75 | + return false | ||
76 | + } | ||
77 | + this.showwrap = true | ||
78 | + }, | ||
79 | + weixin(e) { | ||
80 | + this.pay_type = e.currentTarget.dataset.id; | ||
63 | }, | 81 | }, |
82 | + zhifubao(e) { | ||
83 | + this.pay_type = e.currentTarget.dataset.id; | ||
84 | + }, | ||
85 | + | ||
86 | + // 正则判断输入两位小数 | ||
87 | + | ||
88 | + emtermoney(e) { | ||
89 | + var money; | ||
90 | + if (/^(\d?)+(\.\d{0,2})?$/.test(e.detail.value)) { //正则验证,提现金额小数点后不能大于两位数字 | ||
91 | + money = e.detail.value; | ||
92 | + } else { | ||
93 | + money = e.detail.value.substring(0, e.detail.value.length - 1); | ||
94 | + } | ||
95 | + | ||
96 | + this.money = money | ||
97 | + }, | ||
98 | + | ||
64 | // 隐藏弹出 | 99 | // 隐藏弹出 |
65 | - hidewrap(){ | ||
66 | - this.showwrap=false | 100 | + hidewrap() { |
101 | + this.showwrap = false | ||
102 | + }, | ||
103 | + // 支付 | ||
104 | + pay() { | ||
105 | + let that = this; | ||
106 | + if (this.pay_type == "") { | ||
107 | + uni.showToast({ | ||
108 | + title: "请选择支付方式", | ||
109 | + icon: "none" | ||
110 | + }) | ||
111 | + return false | ||
112 | + } | ||
113 | + | ||
114 | + var url = 'money/create_order'; | ||
115 | + var params = { | ||
116 | + pay_type: that.pay_type, | ||
117 | + total: that.money | ||
67 | } | 118 | } |
119 | + console.log('7766554', params) | ||
120 | + app.post(url, params).then((res) => { | ||
121 | + console.log(res); | ||
122 | + that.paymoney(res.data.data.order_money_id) | ||
123 | + | ||
124 | + }).catch((err) => { | ||
125 | + | ||
126 | + }) | ||
127 | + | ||
128 | + }, | ||
129 | + // 支付接口 | ||
130 | + paymoney(id) { | ||
131 | + let that = this; | ||
132 | + | ||
133 | + // if(that.pay_type == 2) { | ||
134 | + | ||
135 | + // } | ||
136 | + | ||
137 | + var url = 'money/pay'; | ||
138 | + var params = { | ||
139 | + order_money_id: id | ||
140 | + } | ||
141 | + | ||
142 | + console.log(params) | ||
143 | + app.post(url, params, "post").then((res) => { | ||
144 | + console.log(res); | ||
145 | + if (that.pay_type == 2) { | ||
146 | + // 支付宝支付 | ||
147 | + uni.requestPayment({ | ||
148 | + provider: 'alipay', | ||
149 | + orderInfo: res.data.data.result, | ||
150 | + success(r) { | ||
151 | + console.log(r) | ||
152 | + } | ||
153 | + }) | ||
154 | + } | ||
155 | + | ||
156 | + | ||
157 | + }).catch((err) => { | ||
158 | + console.log(err) | ||
159 | + | ||
160 | + }) | ||
161 | + }, | ||
162 | + | ||
163 | + | ||
68 | } | 164 | } |
69 | }; | 165 | }; |
70 | </script> | 166 | </script> |
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | <image src="../../static/icond.png" mode="widthFix" class="icon"></image>我的邀请码 | 10 | <image src="../../static/icond.png" mode="widthFix" class="icon"></image>我的邀请码 |
11 | </view> | 11 | </view> |
12 | <view class="right salecode"> | 12 | <view class="right salecode"> |
13 | - 15621564879 | 13 | + {{share_number}} |
14 | <image src="../../static/icona.png" mode="widthFix" class="rcion"></image> | 14 | <image src="../../static/icona.png" mode="widthFix" class="rcion"></image> |
15 | </view> | 15 | </view> |
16 | </view> | 16 | </view> |
@@ -40,7 +40,9 @@ | @@ -40,7 +40,9 @@ | ||
40 | data() { | 40 | data() { |
41 | return { | 41 | return { |
42 | nickname:'', | 42 | nickname:'', |
43 | - avatar:'' | 43 | + avatar:'', |
44 | + share_number:'' | ||
45 | + | ||
44 | } | 46 | } |
45 | }, | 47 | }, |
46 | onLoad() { | 48 | onLoad() { |
@@ -69,6 +71,7 @@ | @@ -69,6 +71,7 @@ | ||
69 | console.log(res); | 71 | console.log(res); |
70 | that.nickname = res.data.data.nickname; | 72 | that.nickname = res.data.data.nickname; |
71 | that.avatar = res.data.data.avatar; | 73 | that.avatar = res.data.data.avatar; |
74 | + that.share_number=res.data.data.share_number | ||
72 | 75 | ||
73 | 76 | ||
74 | }).catch((err) => { | 77 | }).catch((err) => { |
@@ -3,61 +3,170 @@ | @@ -3,61 +3,170 @@ | ||
3 | <view class="box" style="margin-top: 0;"> | 3 | <view class="box" style="margin-top: 0;"> |
4 | <view class="title">到账用户手机</view> | 4 | <view class="title">到账用户手机</view> |
5 | <view class="searchbox"> | 5 | <view class="searchbox"> |
6 | - <input type="text" placeholder="请输入到账用户手机号" class="fillTel" /> | ||
7 | - <view class="searchbtn"> | ||
8 | - <image src="../../static/tel.png" mode="widthFix" class="icon"/>查找 | 6 | + <input type="number" placeholder="请输入到账用户手机号" class="fillTel" @input="enterphone" /> |
7 | + <view class="searchbtn" @click='search'> | ||
8 | + <image src="../../static/tel.png" mode="widthFix" class="icon" />查找 | ||
9 | </view> | 9 | </view> |
10 | </view> | 10 | </view> |
11 | </view> | 11 | </view> |
12 | - <view class="box"> | 12 | + <view class="box" v-if="userinfo!=''"> |
13 | <view class="title">到账用户信息</view> | 13 | <view class="title">到账用户信息</view> |
14 | <view class="userbox"> | 14 | <view class="userbox"> |
15 | - <image src="../../static/userpic.png" mode="widthFix" class="avator" /> | ||
16 | - <text>用户昵称昵称</text> | 15 | + <image :src="userinfo.avatar" mode="widthFix" class="avator" /> |
16 | + <text>{{userinfo.nickname}}</text> | ||
17 | </view> | 17 | </view> |
18 | </view> | 18 | </view> |
19 | <view class="box"> | 19 | <view class="box"> |
20 | <view class="title">转账金额</view> | 20 | <view class="title">转账金额</view> |
21 | <view class="fillArea"> | 21 | <view class="fillArea"> |
22 | <text>¥</text> | 22 | <text>¥</text> |
23 | - <input type="text" class="fillmoney"> | 23 | + <input class="fillmoney" @input="emtermoney" type="digit"> |
24 | </view> | 24 | </view> |
25 | - <view class="tipsmoney">当前账户余额9938.57元</view> | 25 | + <view class="tipsmoney">当前账户余额{{userinfok.money}}元</view> |
26 | </view> | 26 | </view> |
27 | <view class="box"> | 27 | <view class="box"> |
28 | <view class="title">转账说明:</view> | 28 | <view class="title">转账说明:</view> |
29 | - <textarea name="" id="" cols="30" rows="10" class="wordArea"></textarea> | 29 | + <textarea name="" id="" cols="30" rows="10" class="wordArea" placeholder="转账说明"></textarea> |
30 | </view> | 30 | </view> |
31 | - <view class="submit">转账</view> | 31 | + <view class="submit" @click="zhuanzhang">转账</view> |
32 | </view> | 32 | </view> |
33 | </template> | 33 | </template> |
34 | 34 | ||
35 | <script> | 35 | <script> |
36 | + import app from "../../App.vue"; | ||
36 | export default { | 37 | export default { |
37 | data() { | 38 | data() { |
38 | return { | 39 | return { |
40 | + phone: '', | ||
41 | + userinfo:'', | ||
42 | + money:'', | ||
43 | + userinfok:'' | ||
39 | 44 | ||
40 | } | 45 | } |
41 | }, | 46 | }, |
47 | + onLoad(){ | ||
48 | + this.getuserinfo() | ||
49 | + }, | ||
42 | methods: { | 50 | methods: { |
51 | + enterphone(e) { | ||
52 | + this.phone = e.detail.value | ||
53 | + }, | ||
54 | + // 获取用户信息 | ||
55 | + getuserinfo() { | ||
56 | + let that = this; | ||
57 | + var url = 'member/index'; | ||
58 | + var params = { | ||
59 | + | ||
60 | + } | ||
61 | + console.log('7766554', params) | ||
62 | + app.post(url, params).then((res) => { | ||
63 | + console.log(res); | ||
64 | + that.userinfok = res.data.data; | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + }).catch((err) => { | ||
69 | + | ||
70 | + }) | ||
71 | + }, | ||
72 | + emtermoney(e) { | ||
73 | + var money; | ||
74 | + if (/^(\d?)+(\.\d{0,2})?$/.test(e.detail.value)) { //正则验证,提现金额小数点后不能大于两位数字 | ||
75 | + money = e.detail.value; | ||
76 | + } else { | ||
77 | + money = e.detail.value.substring(0, e.detail.value.length - 1); | ||
78 | + } | ||
79 | + this.money = money | ||
80 | + }, | ||
81 | + search() { | ||
82 | + let that=this; | ||
83 | + if (!(/^1[3456789]\d{9}$/.test(that.phone))) { | ||
84 | + wx.showToast({ | ||
85 | + title: '请输入正确手机号', | ||
86 | + icon: 'none' | ||
87 | + }) | ||
88 | + return false; | ||
89 | + } | ||
90 | + var url = 'member/get_user'; | ||
91 | + var params = { | ||
92 | + mobile:that.phone | ||
93 | + } | ||
94 | + console.log('7766554', params) | ||
95 | + app.post(url, params).then((res) => { | ||
96 | + console.log(res); | ||
97 | + that.userinfo=res.data.data; | ||
98 | + }).catch((err) => { | ||
99 | + console.log(err) | ||
100 | + uni.showToast({ | ||
101 | + title:err.msg, | ||
102 | + icon:'none' | ||
103 | + }) | ||
104 | + | ||
105 | + }) | ||
106 | + }, | ||
107 | + zhuanzhang(){ | ||
108 | + let that = this; | ||
109 | + if(that.phone==''){ | ||
110 | + uni.showToast({ | ||
111 | + title:'请输入手机号查找用户信息', | ||
112 | + icon:'none' | ||
113 | + }) | ||
114 | + return false | ||
115 | + } | ||
116 | + | ||
117 | + if(that.money==''){ | ||
118 | + uni.showToast({ | ||
119 | + title:'请输入转账金额', | ||
120 | + icon:'none' | ||
121 | + }) | ||
122 | + return false | ||
123 | + } | ||
124 | + var url = 'member/transfer'; | ||
125 | + var params = { | ||
126 | + user_id:that.userinfo.id, | ||
127 | + money:that.money | ||
128 | + } | ||
129 | + console.log('7766554', params) | ||
130 | + app.post(url, params).then((res) => { | ||
131 | + console.log(res); | ||
132 | + uni.showToast({ | ||
133 | + title:'转账成功', | ||
134 | + icon:"none" | ||
135 | + }) | ||
136 | + setTimeout(function(){ | ||
137 | + uni.navigateBack({ | ||
138 | + checked:true | ||
139 | + }) | ||
140 | + },1500) | ||
141 | + | ||
142 | + }).catch((err) => { | ||
143 | + console.log(err) | ||
144 | + uni.showToast({ | ||
145 | + title:"转账失败", | ||
146 | + icon:"none" | ||
147 | + }) | ||
148 | + }) | ||
149 | + }, | ||
43 | 150 | ||
44 | } | 151 | } |
45 | } | 152 | } |
46 | </script> | 153 | </script> |
47 | 154 | ||
48 | <style> | 155 | <style> |
49 | - page{ | 156 | + page { |
50 | background: #FEFEFE; | 157 | background: #FEFEFE; |
51 | padding: 32rpx 32rpx 0; | 158 | padding: 32rpx 32rpx 0; |
52 | box-sizing: border-box; | 159 | box-sizing: border-box; |
53 | } | 160 | } |
54 | - .title{ | ||
55 | - font-size:32rpx; | ||
56 | - font-family:PingFangHK-Regular,PingFangHK; | ||
57 | - font-weight:600; | ||
58 | - color:rgba(8,18,31,1); | 161 | + |
162 | + .title { | ||
163 | + font-size: 32rpx; | ||
164 | + font-family: PingFangHK-Regular, PingFangHK; | ||
165 | + font-weight: 600; | ||
166 | + color: rgba(8, 18, 31, 1); | ||
59 | } | 167 | } |
60 | - .searchbox{ | 168 | + |
169 | + .searchbox { | ||
61 | height: 104rpx; | 170 | height: 104rpx; |
62 | display: flex; | 171 | display: flex; |
63 | align-items: center; | 172 | align-items: center; |
@@ -65,93 +174,105 @@ | @@ -65,93 +174,105 @@ | ||
65 | border-bottom: 1px solid #EAEAEA; | 174 | border-bottom: 1px solid #EAEAEA; |
66 | box-sizing: border-box; | 175 | box-sizing: border-box; |
67 | } | 176 | } |
68 | - .fillTel{ | 177 | + |
178 | + .fillTel { | ||
69 | width: 360rpx; | 179 | width: 360rpx; |
70 | - font-size:36rpx; | ||
71 | - font-family:PingFangHK-Regular,PingFangHK; | ||
72 | - font-weight:400; | ||
73 | - color:rgba(189,196,206,1); | 180 | + font-size: 36rpx; |
181 | + font-family: PingFangHK-Regular, PingFangHK; | ||
182 | + font-weight: 400; | ||
183 | + color: rgba(189, 196, 206, 1); | ||
74 | margin-right: ; | 184 | margin-right: ; |
75 | } | 185 | } |
76 | - .searchbtn{ | 186 | + |
187 | + .searchbtn { | ||
77 | display: flex; | 188 | display: flex; |
78 | align-items: center; | 189 | align-items: center; |
79 | justify-content: center; | 190 | justify-content: center; |
80 | - width:160rpx; | ||
81 | - height:64rpx; | ||
82 | - border-radius:8rpx; | ||
83 | - border:1px solid rgba(255,148,23,1); | ||
84 | - font-size:24rpx; | ||
85 | - font-family:PingFangSC-Regular,PingFang SC; | ||
86 | - font-weight:400; | ||
87 | - color:rgba(255,148,23,1); | ||
88 | - } | ||
89 | - .searchbtn .icon{ | 191 | + width: 160rpx; |
192 | + height: 64rpx; | ||
193 | + border-radius: 8rpx; | ||
194 | + border: 1px solid rgba(255, 148, 23, 1); | ||
195 | + font-size: 24rpx; | ||
196 | + font-family: PingFangSC-Regular, PingFang SC; | ||
197 | + font-weight: 400; | ||
198 | + color: rgba(255, 148, 23, 1); | ||
199 | + } | ||
200 | + | ||
201 | + .searchbtn .icon { | ||
90 | width: 32rpx; | 202 | width: 32rpx; |
91 | margin-right: 16rpx; | 203 | margin-right: 16rpx; |
92 | } | 204 | } |
93 | - .box{ | 205 | + |
206 | + .box { | ||
94 | margin-top: 60rpx; | 207 | margin-top: 60rpx; |
95 | } | 208 | } |
96 | - .userbox{ | ||
97 | - width:686rpx; | ||
98 | - height:120rpx; | ||
99 | - background:rgba(255,255,255,1); | ||
100 | - box-shadow:0px 8rpx 24rpx 0px rgba(0,0,0,0.06); | ||
101 | - border-radius:8rpx; | 209 | + |
210 | + .userbox { | ||
211 | + width: 686rpx; | ||
212 | + height: 120rpx; | ||
213 | + background: rgba(255, 255, 255, 1); | ||
214 | + box-shadow: 0px 8rpx 24rpx 0px rgba(0, 0, 0, 0.06); | ||
215 | + border-radius: 8rpx; | ||
102 | display: flex; | 216 | display: flex; |
103 | align-items: center; | 217 | align-items: center; |
104 | - font-size:32rpx; | ||
105 | - font-family:PingFangHK-Regular,PingFangHK; | ||
106 | - font-weight:400; | ||
107 | - color:rgba(8,18,31,1); | 218 | + font-size: 32rpx; |
219 | + font-family: PingFangHK-Regular, PingFangHK; | ||
220 | + font-weight: 400; | ||
221 | + color: rgba(8, 18, 31, 1); | ||
108 | margin-top: 32rpx; | 222 | margin-top: 32rpx; |
109 | padding: 0 24rpx; | 223 | padding: 0 24rpx; |
110 | box-sizing: border-box; | 224 | box-sizing: border-box; |
111 | } | 225 | } |
112 | - .avator{ | 226 | + |
227 | + .avator { | ||
113 | width: 72rpx; | 228 | width: 72rpx; |
114 | margin-right: 16rpx; | 229 | margin-right: 16rpx; |
115 | } | 230 | } |
116 | - .fillArea{ | 231 | + |
232 | + .fillArea { | ||
117 | height: 132rpx; | 233 | height: 132rpx; |
118 | display: flex; | 234 | display: flex; |
119 | align-items: center; | 235 | align-items: center; |
120 | border-bottom: 1px solid #EAEAEA; | 236 | border-bottom: 1px solid #EAEAEA; |
121 | } | 237 | } |
122 | - .fillArea text{ | ||
123 | - font-size:72rpx; | ||
124 | - font-family:PingFangHK-Regular,PingFangHK; | ||
125 | - font-weight:400; | ||
126 | - color:rgba(8,18,31,1); | 238 | + |
239 | + .fillArea text { | ||
240 | + font-size: 72rpx; | ||
241 | + font-family: PingFangHK-Regular, PingFangHK; | ||
242 | + font-weight: 400; | ||
243 | + color: rgba(8, 18, 31, 1); | ||
127 | margin-right: 16rpx; | 244 | margin-right: 16rpx; |
128 | } | 245 | } |
129 | - .fillmoney{ | 246 | + |
247 | + .fillmoney { | ||
130 | width: 400rpx; | 248 | width: 400rpx; |
131 | display: flex; | 249 | display: flex; |
132 | align-items: center; | 250 | align-items: center; |
133 | - font-size:32rpx; | ||
134 | - font-family:PingFangHK-Regular,PingFangHK; | ||
135 | - font-weight:400; | ||
136 | - color:rgba(8,18,31,1); | ||
137 | - } | ||
138 | - .tipsmoney{ | ||
139 | - font-size:24rpx; | ||
140 | - font-family:PingFangHK-Regular,PingFangHK; | ||
141 | - font-weight:400; | ||
142 | - color:rgba(189,196,206,1); | 251 | + font-size: 32rpx; |
252 | + font-family: PingFangHK-Regular, PingFangHK; | ||
253 | + font-weight: 400; | ||
254 | + color: rgba(8, 18, 31, 1); | ||
255 | + } | ||
256 | + | ||
257 | + .tipsmoney { | ||
258 | + font-size: 24rpx; | ||
259 | + font-family: PingFangHK-Regular, PingFangHK; | ||
260 | + font-weight: 400; | ||
261 | + color: rgba(189, 196, 206, 1); | ||
143 | margin-top: 14rpx; | 262 | margin-top: 14rpx; |
144 | } | 263 | } |
145 | - .wordArea{ | 264 | + |
265 | + .wordArea { | ||
146 | width: 100%; | 266 | width: 100%; |
147 | margin-top: 16rpx; | 267 | margin-top: 16rpx; |
148 | height: 160rpx; | 268 | height: 160rpx; |
149 | - font-size:28rpx; | ||
150 | - font-family:PingFangHK-Regular,PingFangHK; | ||
151 | - font-weight:400; | ||
152 | - color:rgba(61,69,76,1); | 269 | + font-size: 28rpx; |
270 | + font-family: PingFangHK-Regular, PingFangHK; | ||
271 | + font-weight: 400; | ||
272 | + color: rgba(61, 69, 76, 1); | ||
153 | } | 273 | } |
154 | - .submit{ | 274 | + |
275 | + .submit { | ||
155 | width: 686rpx; | 276 | width: 686rpx; |
156 | height: 84rpx; | 277 | height: 84rpx; |
157 | background: rgba(194, 148, 69, 1); | 278 | background: rgba(194, 148, 69, 1); |
@@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
47 | } | 47 | } |
48 | }, | 48 | }, |
49 | onLoad() { | 49 | onLoad() { |
50 | - this.getuserinfo() | 50 | + |
51 | }, | 51 | }, |
52 | methods: { | 52 | methods: { |
53 | // 获取用户信息 | 53 | // 获取用户信息 |
@@ -89,12 +89,16 @@ | @@ -89,12 +89,16 @@ | ||
89 | url:'/pages/usercenter/transferAccounts' | 89 | url:'/pages/usercenter/transferAccounts' |
90 | }) | 90 | }) |
91 | }, | 91 | }, |
92 | + | ||
92 | // 提现 | 93 | // 提现 |
93 | tixian(){ | 94 | tixian(){ |
94 | uni.navigateTo({ | 95 | uni.navigateTo({ |
95 | url:'/pages/usercenter/cashOut' | 96 | url:'/pages/usercenter/cashOut' |
96 | }) | 97 | }) |
97 | } | 98 | } |
99 | + }, | ||
100 | + onShow(){ | ||
101 | + this.getuserinfo() | ||
98 | } | 102 | } |
99 | } | 103 | } |
100 | </script> | 104 | </script> |
static/icon_wechat.png
0 → 100644
1.9 KB
static/icon_zhifu.png
0 → 100644
1.4 KB
static/ticard.png
0 → 100644
768 字节
此 diff 太大无法显示。
此 diff 太大无法显示。
768 字节
1.9 KB
1.9 KB
1.4 KB
1.4 KB
768 字节
-
请 注册 或 登录 后发表评论