ソースを参照

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
 export const USER_LATITUDE = 'user_latitude'
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
 	.swiper-content {
586
 	.swiper-content {
587
-		height: 350rpx;
587
+		height: 320rpx;
588
 		width: 100%;
588
 		width: 100%;
589
 		box-sizing: border-box;
589
 		box-sizing: border-box;
590
 		position: relative;
590
 		position: relative;
@@ -598,7 +598,7 @@
598
 			padding-left: 20rpx;
598
 			padding-left: 20rpx;
599
 			padding-right: 20rpx;
599
 			padding-right: 20rpx;
600
 			border-radius: 24rpx;
600
 			border-radius: 24rpx;
601
-			height: 340rpx;
601
+			height: 310rpx;
602
 			width: 100%;
602
 			width: 100%;
603
 			box-sizing: border-box;
603
 			box-sizing: border-box;
604
 			position: relative;
604
 			position: relative;
@@ -621,7 +621,7 @@
621
 
621
 
622
 		.swiper-container {
622
 		.swiper-container {
623
 			border-radius: 24rpx;
623
 			border-radius: 24rpx;
624
-			height: 340rpx;
624
+			height: 310rpx;
625
 			width: 100%;
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
 	console.log("===getBindingState",res);
33
 	console.log("===getBindingState",res);
34
   }).catch(error => {
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
 function updateAccount(type, info: {unionId: string, nickName: string, avatarUrl: string}) {
47
 function updateAccount(type, info: {unionId: string, nickName: string, avatarUrl: string}) {
51
-  uni.showLoading({
52
-    title: '授权中',
53
-    icon: 'none'
54
-  })
48
+ 
55
   
49
   
56
   getUpdateAccount({
50
   getUpdateAccount({
57
     type,
51
     type,
@@ -84,6 +78,8 @@ function unbindAccount(){
84
 			title:'解绑成功',
78
 			title:'解绑成功',
85
 			icon:'none'
79
 			icon:'none'
86
 		})
80
 		})
81
+		userNick.value ='点击获取微信昵称'
82
+		userHead.value =''
87
 		loadBindingState()
83
 		loadBindingState()
88
 	}).catch(res=>{
84
 	}).catch(res=>{
89
 		uni.showToast({
85
 		uni.showToast({
@@ -160,8 +156,6 @@ function getUserProfile({detail}){
160
     },
156
     },
161
     filePath: detail.avatarUrl ,
157
     filePath: detail.avatarUrl ,
162
     success: res => {
158
     success: res => {
163
-		
164
-		console.log("===res");
165
       uni.hideLoading()
159
       uni.hideLoading()
166
       const { data } = res
160
       const { data } = res
167
       const assetData = JSON.parse(data)
161
       const assetData = JSON.parse(data)
@@ -178,7 +172,15 @@ function getUserProfile({detail}){
178
 function onBindClick(){
172
 function onBindClick(){
179
 	
173
 	
180
 	if(getBindState('1')){
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
 		return
184
 		return
183
 	}
185
 	}
184
 	if(!userHead.value){
186
 	if(!userHead.value){
@@ -189,14 +191,17 @@ function onBindClick(){
189
 		return
191
 		return
190
 	}
192
 	}
191
 	
193
 	
192
-	if(!userNick.value){
194
+	if(!userNick.value ||userNick.value  =='点击获取微信昵称' ){
193
 		uni.showToast({
195
 		uni.showToast({
194
 			title:'请点击获取微信昵称',
196
 			title:'请点击获取微信昵称',
195
 			icon:'none'
197
 			icon:'none'
196
 		})
198
 		})
197
 		return
199
 		return
198
 	}
200
 	}
199
-	
201
+	uni.showLoading({
202
+	  title: '授权中',
203
+	  mask:true,
204
+	})
200
 	uni.login({
205
 	uni.login({
201
 	  provider: 'weixin',
206
 	  provider: 'weixin',
202
 	  univerifyStyle: {
207
 	  univerifyStyle: {
@@ -216,6 +221,7 @@ function onBindClick(){
216
 	  },
221
 	  },
217
 	  fail: (error) => {
222
 	  fail: (error) => {
218
 	    console.log(error)
223
 	    console.log(error)
224
+		uni.hideLoading()
219
 	  }
225
 	  }
220
 	});
226
 	});
221
 }
227
 }
@@ -232,11 +238,11 @@ function onBindClick(){
232
           微信授权
238
           微信授权
233
         </div>
239
         </div>
234
       </div>
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
            :class="getBindState('1') ? 'text-red' : 'text-gray border-gray'"
242
            :class="getBindState('1') ? 'text-red' : 'text-gray border-gray'"
237
       >
243
       >
238
         {{ getBindState('1') ? '已授权' : '未授权' }}
244
         {{ getBindState('1') ? '已授权' : '未授权' }}
239
-      </button>
245
+      </view>
240
 	
246
 	
241
     </div>
247
     </div>
242
 	<view class="item-line"></view>
248
 	<view class="item-line"></view>