Преглед изворни кода

feat:提交代码,优化修改

longzhicheng пре 1 година
родитељ
комит
3d6d3b4045
3 измењених фајлова са 25 додато и 19 уклоњено
  1. 1 1
      src/constants/index.ts
  2. 3 3
      src/pages/home/index.vue
  3. 21 15
      src/pages/third_party_binding/index.vue

+ 1 - 1
src/constants/index.ts

@@ -1,7 +1,7 @@
1 1
 
2 2
 
3 3
 // 应用版本号
4
-export const APP_VERSION = '1.0.6'
4
+export const APP_VERSION = '2.0.0'
5 5
 // 用户纬度
6 6
 export const USER_LATITUDE = 'user_latitude'
7 7
 // 用户经度

+ 3 - 3
src/pages/home/index.vue

@@ -584,7 +584,7 @@
584 584
 
585 585
 
586 586
 	.swiper-content {
587
-		height: 350rpx;
587
+		height: 320rpx;
588 588
 		width: 100%;
589 589
 		box-sizing: border-box;
590 590
 		position: relative;
@@ -598,7 +598,7 @@
598 598
 			padding-left: 20rpx;
599 599
 			padding-right: 20rpx;
600 600
 			border-radius: 24rpx;
601
-			height: 340rpx;
601
+			height: 310rpx;
602 602
 			width: 100%;
603 603
 			box-sizing: border-box;
604 604
 			position: relative;
@@ -621,7 +621,7 @@
621 621
 
622 622
 		.swiper-container {
623 623
 			border-radius: 24rpx;
624
-			height: 340rpx;
624
+			height: 310rpx;
625 625
 			width: 100%;
626 626
 		}
627 627
 

+ 21 - 15
src/pages/third_party_binding/index.vue

@@ -32,10 +32,7 @@ function loadBindingState() {
32 32
 	}
33 33
 	console.log("===getBindingState",res);
34 34
   }).catch(error => {
35
-    // uni.showToast({
36
-    //   title: error,
37
-    //   icon: 'none'
38
-    // })
35
+    
39 36
   })
40 37
 }
41 38
 
@@ -48,10 +45,7 @@ function getBindState(type:any) {
48 45
 }
49 46
 
50 47
 function updateAccount(type, info: {unionId: string, nickName: string, avatarUrl: string}) {
51
-  uni.showLoading({
52
-    title: '授权中',
53
-    icon: 'none'
54
-  })
48
+ 
55 49
   
56 50
   getUpdateAccount({
57 51
     type,
@@ -84,6 +78,8 @@ function unbindAccount(){
84 78
 			title:'解绑成功',
85 79
 			icon:'none'
86 80
 		})
81
+		userNick.value ='点击获取微信昵称'
82
+		userHead.value =''
87 83
 		loadBindingState()
88 84
 	}).catch(res=>{
89 85
 		uni.showToast({
@@ -160,8 +156,6 @@ function getUserProfile({detail}){
160 156
     },
161 157
     filePath: detail.avatarUrl ,
162 158
     success: res => {
163
-		
164
-		console.log("===res");
165 159
       uni.hideLoading()
166 160
       const { data } = res
167 161
       const assetData = JSON.parse(data)
@@ -178,7 +172,15 @@ function getUserProfile({detail}){
178 172
 function onBindClick(){
179 173
 	
180 174
 	if(getBindState('1')){
181
-		unbindAccount()
175
+		uni.showModal({
176
+			title:'温馨提示',
177
+			content:'确定解除当前用户绑定?',
178
+			complete: (res) => {
179
+				if(res.confirm){
180
+					unbindAccount()
181
+				}
182
+			}
183
+		})
182 184
 		return
183 185
 	}
184 186
 	if(!userHead.value){
@@ -189,14 +191,17 @@ function onBindClick(){
189 191
 		return
190 192
 	}
191 193
 	
192
-	if(!userNick.value){
194
+	if(!userNick.value ||userNick.value  =='点击获取微信昵称' ){
193 195
 		uni.showToast({
194 196
 			title:'请点击获取微信昵称',
195 197
 			icon:'none'
196 198
 		})
197 199
 		return
198 200
 	}
199
-	
201
+	uni.showLoading({
202
+	  title: '授权中',
203
+	  mask:true,
204
+	})
200 205
 	uni.login({
201 206
 	  provider: 'weixin',
202 207
 	  univerifyStyle: {
@@ -216,6 +221,7 @@ function onBindClick(){
216 221
 	  },
217 222
 	  fail: (error) => {
218 223
 	    console.log(error)
224
+		uni.hideLoading()
219 225
 	  }
220 226
 	});
221 227
 }
@@ -232,11 +238,11 @@ function onBindClick(){
232 238
           微信授权
233 239
         </div>
234 240
       </div>
235
-      <button class="border border-solid rounded-full  text-xs px-2 h-6"
241
+      <view class="border border-solid rounded-full  text-xs px-2 h-4"
236 242
            :class="getBindState('1') ? 'text-red' : 'text-gray border-gray'"
237 243
       >
238 244
         {{ getBindState('1') ? '已授权' : '未授权' }}
239
-      </button>
245
+      </view>
240 246
 	
241 247
     </div>
242 248
 	<view class="item-line"></view>