Browse Source

新注册的用户地址处理

yuxingxing 2 years ago
parent
commit
c18067a1ec

+ 1 - 1
components/couponListWindow/index.vue

@@ -43,7 +43,7 @@
 			</view>
 			<!-- 无优惠券 -->
 			<view class='pictrue' v-else>
-				<image :src="imgHost + '/statics/images/noCoupon.png'"></image>
+				<!-- <image :src="imgHost + '/statics/images/noCoupon.png'"></image> -->
 			</view>
 		</view>
 		<view class='mask' catchtouchmove="true" :hidden='coupon.coupon==false' @click='close'></view>

+ 3 - 0
libs/login.js

@@ -38,6 +38,7 @@ function prePage() {
 export const toLogin = Debounce(_toLogin, 800)
 
 function _toLogin(push, pathLogin) {
+	console.log("跳转登录界面:"+pathLogin);
 	// #ifdef H5
 	if (isWeixin()) {
 		if (!uni.getStorageSync('authIng')) {
@@ -119,6 +120,8 @@ export function checkLogin() {
 		uni.setStorageSync('authIng', false)
 		Cache.clear(LOGIN_STATUS);
 		Cache.clear(EXPIRES_TIME);
+		Cache.clear("GOOD_ID_LOGIN");
+		Cache.clear("INVITE_CODE_LOGIN");
 		Cache.clear(USER_INFO);
 		Cache.clear(STATE_R_KEY);
 		return false;

+ 22 - 7
pages/goods_details/index.vue

@@ -107,7 +107,7 @@
 							<view class="flex">
 								<view style="display: flex; align-items: center; width: 90%">
 									<view class="attr-txt"> 送至: </view>
-									<view class="atterTxt line1" style="width: 82%">{{
+									<view class="atterTxt line1" style="width: 82%" v-if="attrAddrValue.id">{{
 											attrAddrValue.province + attrAddrValue.city + attrAddrValue.district +
 											attrAddrValue.detail
 									}}</view>
@@ -515,9 +515,15 @@ export default {
 		isLogin: {
 			handler: function (newV, oldV) {
 				if (newV == true) {
-					console.log("受邀码:"+this.$Cache.get('INVITE_CODE_LOGIN'));
-					this.id = this.$Cache.get('GOOD_ID_LOGIN')
-					this.getGoodsDetails();
+					uni.navigateTo({
+						url: "/pages/goods_details/index?id=" 
+						+ this.$Cache.get('GOOD_ID_LOGIN') 
+						+ "&inviteCode=" + this.$Cache.get('INVITE_CODE_LOGIN')
+						+ "&zoneType=" + 8
+					})
+					// this.$forceUpdate()
+					// this.id = this.$Cache.get('GOOD_ID_LOGIN')
+					// this.getGoodsDetails();
 					// this.getCouponList();
 					// this.getCartCount();
 					// this.downloadFilePromotionCode();
@@ -538,9 +544,12 @@ export default {
 			immediate: true,
 		},
 	},
-	
+	mounted() {
+		this.$forceUpdate()
+	},
 	onLoad(options) {
 		uni.hideShareMenu();
+		console.log("是否登录:" + this.isLogin);
 		// 判断是否登录
 		if (!this.isLogin) {
 			console.log("未登录的推荐码:" + options.inviteCode);
@@ -561,6 +570,7 @@ export default {
 			}, 1500);
 		} else {
 			console.log("受邀的推荐码:" + options.inviteCode);
+			console.log("受邀的商品id:" + options.id);
 			//1580 进入时
 			if (options.zoneType == 8) {
 				if (options.inviteCode) {
@@ -961,7 +971,7 @@ export default {
 					that.skuArr = storeInfo.goodsSpecList
 					that.$set(that, "storeInfo", storeInfo);
 					that.$set(that.attr, "productAttr", storeInfo.goodsSpecList);
-					that.downloadFilestoreImage();
+					// that.downloadFilestoreImage();
 					that.getUserAddressByUserId()
 					setTimeout(function () {
 						that.infoScroll();
@@ -1042,7 +1052,11 @@ export default {
 				type: 1
 			}).then(res => {
 				this.attrAddrValue = res.data
-				this.getAvailableCheck()
+				if(this.attrAddrValue.id){
+					this.getAvailableCheck()
+				}else{
+					this.DefaultSelect();
+				}
 			})
 		},
 		/**
@@ -1356,6 +1370,7 @@ export default {
 		 */
 		listenerActionSheet() {
 			this.currentPage = false
+			console.log(this.isLogin);
 			if (this.isLogin === false) {
 				toLogin();
 			} else {

+ 1 - 1
pages/users/user_coupon/index.vue

@@ -38,7 +38,7 @@
 		</view>
 		<view class='noCommodity' v-if="!couponsList.length && page === 2">
 			<view class='pictrue'>
-				<image :src="imgHost + '/statics/images/noCoupon.png'"></image>
+				<!-- <image :src="imgHost + '/statics/images/noCoupon.png'"></image> -->
 			</view>
 		</view>
 		<!-- #ifdef MP -->

+ 1 - 1
pages/users/user_get_coupon/index.vue

@@ -40,7 +40,7 @@
 		</view>
 		<view class='noCommodity' v-else-if="!couponsList.length && page === 2">
 			<view class='pictrue'>
-				<image :src="imgHost + '/statics/images/noCoupon.png'"></image>
+				<!-- <image :src="imgHost + '/statics/images/noCoupon.png'"></image> -->
 			</view>
 		</view>
 		<!-- #ifdef MP -->

+ 14 - 6
pages/users/wechat_login/index.vue

@@ -281,12 +281,20 @@ export default {
 				that.userInfo = res.data;
 				that.$store.commit('SETUID', res.data.userId);
 				that.$store.commit('UPDATE_USERINFO', res.data);
-				that.$util.Tips({
-					title: that.$t(`登录成功`),
-					icon: 'success'
-				}, {
-					tab: 3
-				});
+				let GOOD_ID_LOGIN = this.$Cache.get('GOOD_ID_LOGIN')
+				if (GOOD_ID_LOGIN) {
+					that.$util.Tips({
+						title: that.$t(`登录成功`),
+						icon: 'success'
+					});
+				} else {
+					that.$util.Tips({
+						title: that.$t(`登录成功`),
+						icon: 'success'
+					}, {
+						tab: 3
+					});
+				}
 			});
 		},
 		setUserInfo(e) {

+ 2 - 0
utils/util.js

@@ -27,6 +27,7 @@ export default {
 	 * tab=5 关闭当前页面,跳转到应用内的某个页面
 	 */
 	Tips: function(opt, to_url) {
+		console.log(opt,to_url)
 		if (typeof opt == 'string') {
 			to_url = opt;
 			opt = {};
@@ -45,6 +46,7 @@ export default {
 			if (typeof to_url == 'object') {
 				let tab = to_url.tab || 1,
 					url = to_url.url || '';
+					console.log(url);
 				switch (tab) {
 					case 1:
 						//一定时间后跳转至 table