浏览代码

fix: 调整部分功能模块

wenxingxing 19 小时之前
父节点
当前提交
f842d488f6

+ 3 - 1
api/index.js

@@ -41,7 +41,9 @@ let request = new Request().http
  export function getChineseMedicineById(data) {
  	 return request('/app/index/getChineseMedicineById',data,'GET');
  }
- 
+ export function getCartCount() {
+ 	 return request('/store/app/index/getCartCount',null,'GET');
+} 
  
  export function bdCallBackReq(data) {
  	 return request('/app/common/bdCallBack',data,'GET');

+ 1 - 1
api/user.js

@@ -209,7 +209,7 @@ export function isSmsVerification(data) {
 }
 
 export function getProductFoots(data) {
-	return request('/app/user/getProductFoots', data, 'GET');
+	return request('/store/app/user/getProductFoots', data, 'GET');
 }
 export function delProductFoots(data) {
 	return request('/app/user/delProductFoots', data, 'POST', 'application/json;charset=UTF-8');

+ 3 - 2
pages/course/components/answerFloatBox.vue

@@ -82,12 +82,12 @@ export default {
 		@include u-flex(column, center, center);
 		margin-top: -15rpx;
 		z-index: 10;
-		width: 210rpx;
+		width: 220rpx;
 		min-height: 120rpx;
 		background: linear-gradient(180deg, #FFF9DC 0%, #FFDC97 100%);
 		border-radius: 20rpx;
 		border: 2rpx solid linear-gradient(180deg, rgba(255, 228, 105, 1), rgba(255, 178, 30, 1));
-		padding: 10rpx 10rpx 20rpx;
+		padding: 10rpx 20rpx 20rpx;
 		box-sizing: border-box;
 		text-align: center;
 		overflow: hidden;
@@ -112,6 +112,7 @@ export default {
 	font-weight: 600;
 	font-size: 32rpx;
 	color: #FF2E3F;
+	box-sizing: border-box;
 }
 
 .answerBtnClass {

+ 1 - 1
pages/shopping/prescribe.vue

@@ -216,7 +216,7 @@
 		},
 		//发送给朋友
 		onShareAppMessage(res) {
-			if(this.utils.isLogin()){
+			if(this.$isLogin()){
 				var user=JSON.parse(uni.getStorageSync('userInfo'))
 				return {
 					title: "填写处方信息",

+ 12 - 16
pages/shopping/productDetails.vue

@@ -297,7 +297,7 @@ import {CustomToast} from '@/components/custom-toast.vue';
 		},
 		//发送给朋友
 		onShareAppMessage(res) {
-			if (this.utils.isLogin()) {
+			if (this.$isLogin()) {
 				var user = JSON.parse(uni.getStorageSync('userInfo'))
 				return {
 					title: this.product.productName,
@@ -308,7 +308,7 @@ import {CustomToast} from '@/components/custom-toast.vue';
 		},
 		//分享到朋友圈
 		onShareTimeline(res) {
-			if (this.utils.isLogin()) {
+			if (this.$isLogin()) {
 				var user = JSON.parse(uni.getStorageSync('userInfo'))
 				return {
 					title: this.product.productName,
@@ -517,22 +517,18 @@ import {CustomToast} from '@/components/custom-toast.vue';
 			},
 			// 跳转页面
 			navgetTo(url) {
-				this.utils.isLogin().then(res => {
-					if (res) {
-						uni.navigateTo({
-							url: url
-						})
-					}
-				})
+				if (this.$isLogin()) {
+					uni.navigateTo({
+						url: url
+					})
+				}
 			},
 			toCart(url) {
-				this.utils.isLogin().then(res => {
-					if (res) {
-						uni.switchTab({
-							url: url
-						})
-					}
-				})
+				if (this.$isLogin()) {
+					uni.switchTab({
+						url: url
+					})
+				}
 			},
 
 			// 加入购物车

+ 11 - 10
pages_mall/homeIndex.vue

@@ -62,7 +62,7 @@
 				</view>
 			</view>
 
-			<Server />
+			<!-- <Server /> -->
 		</scroll-view>
 	</view>
 </template>
@@ -160,13 +160,13 @@ export default {
 		this.getMenuButtonInfo(); // 初始化获取胶囊信息
 		if (option.userCode != null) {
 			uni.setStorageSync('userCode', option.userCode)
-			if (this.utils.checkLoginState()) this.getUserInfo()
+			if (this.$isLogin()) this.getUserInfo()
 		}
 		if (option.hasOwnProperty('q') && option.q) {
 			const url = decodeURIComponent(option.q)
 			const obj = this.utils.urlToObj(url)
 			uni.setStorageSync('userCode', obj.userCode)
-			if (this.utils.checkLoginState()) this.getUserInfo()
+			if (this.$isLogin()) this.getUserInfo()
 		}
 	},
 	onUnload() {
@@ -225,7 +225,7 @@ export default {
 			} else {
 				this.isuser = true
 			}
-			if (this.utils.checkLoginState()) this.getCartCount()
+			if (this.$isLogin()) this.getCartCount()
 			this.getStoreConfig()
 		},
 		// 获取胶囊按钮布局参数
@@ -350,11 +350,12 @@ export default {
 			})
 		},
 		getCartCount() {
-			this.utils.isLogin().then(res => {
-				if (res) getCartCount().then(cartRes => {
+			if (this.$isLogin()){
+				getCartCount().then(cartRes => {
 					if (cartRes.code == 200) this.cartCount = cartRes.data
+					this.$emit('updateMallIndexCartCount', cartRes.data || 0)
 				})
-			})
+			}
 		},
 		getStoreConfig() {
 			getStoreConfig().then(res => {
@@ -410,9 +411,9 @@ export default {
 			}
 		},
 		goAuthUrl(url) {
-			this.utils.isLogin().then(res => {
-				if (res) uni.switchTab({ url })
-			})
+			if (this.$isLogin()) {
+				uni.switchTab({ url })
+			}
 		},
 		navTo(url) {
 			uni.navigateTo({ url })

+ 7 - 3
pages_mall/index.vue

@@ -2,7 +2,7 @@
 	<view class="mall-index">
 		<!-- 内容区域 -->
 		<view class="content-area">
-			<index-page v-if="currentTab === 0" ref="indexPage"></index-page>
+			<index-page v-if="currentTab === 0" ref="indexPage" @updateMallIndexCartCount="getMallIndexCartCount"></index-page>
 			<!-- <category-page v-if="currentTab === 1" ref="categoryPage"></category-page> -->
 			<cart-page v-if="currentTab === 1" ref="cartPage"></cart-page>
 			<my-page v-if="currentTab === 2" ref="myPage"></my-page>
@@ -24,7 +24,7 @@
 				<view class="icon-wrap">
 					<u-icon :name="currentTab === 1 ? 'shopping-cart-fill' : 'shopping-cart'" size="28"
 						:color="currentTab === 1 ? '#FF233C' : '#999'"></u-icon>
-					<view class="badge">1</view>
+					<view class="badge">{{ cartMallCount }}</view>
 				</view>
 				<text>购物车</text>
 			</view>
@@ -52,7 +52,8 @@
 		data() {
 			return {
 				currentTab: 0,
-				isFirstLoad: true // 标记是否第一次进入页面
+				isFirstLoad: true, // 标记是否第一次进入页面
+				cartMallCount: 0
 			}
 		},
 		onLoad() {
@@ -85,6 +86,9 @@
 		methods: {
 			switchTab(index) {
 				this.currentTab = index;
+			},
+			getMallIndexCartCount(count) {
+				this.cartMallCount = count
 			}
 		}
 	}

+ 9 - 13
pages_points/integralGoodsDetails.vue

@@ -169,19 +169,15 @@
 				})
 			},
 			submit() {
-				this.utils.isLogin().then(
-					res => {
-						if (res) {
-							uni.navigateTo({
-								url: "./integralOrderPay?goodsId=" + this.goodsId
-							})
-						} else {
-							uni.navigateTo({
-								url: '/pages/auth/login'
-							})
-						}
-					}
-				);
+				if (this.$isLogin()) {
+					uni.navigateTo({
+						url: "./integralOrderPay?goodsId=" + this.goodsId
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/auth/login'
+					})
+				}
 			},
 			swiperChange(event) {
 				this.activeImg = event.detail.current + 1

+ 1 - 2
utils/login.js

@@ -848,8 +848,7 @@ export function goPage() {
       	 });
    } else {
 	    uni.reLaunch({
-	    	// url: '/pages_im/pages/conversation/conversationList/index',
-	    	url: '/pages/index/index',
+	    	url: '/pages_im/pages/conversation/conversationList/index',
 	    	//url: '../course/video/living-app',
 	    	animationType: 'none',
 	    	animationDuration: 2000