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

更新代码-商城/首页弹窗介绍

Signed-off-by: 李妹妹 <1639016684@qq.com>
李妹妹 пре 13 часа
родитељ
комит
6c8fac12e8

+ 9 - 0
api/home.js

@@ -49,3 +49,12 @@ export function listPublicCourse(data) {
 export function getHisStoreConfig(data) {
 	return request('/app/index/getHisStoreConfig', data || {}, 'GET');
 }
+//介绍页
+export function getStoreActivityGuide(data) {
+	return request('/publicApp/app/activity/getStoreActivityGuide', data || {}, 'GET');
+}
+
+/** 标记用户已查看引导页弹窗 */
+export function viewStoreActivityGuide(data) {
+	return request('/publicApp/app/activity/viewStoreActivityGuide', data || {}, 'POST');
+}

+ 3 - 3
common/request.js

@@ -11,8 +11,8 @@ export default class Request {
 		let path = 'https://userapp.klbycp.com/store'; //百域承品
 		let path2 = 'https://userapp.klbycp.com'; //百域承品
 
-		// let path = 'http://p3a4a6bc.natappfree.cc/store'; //本地
-		// let path2 = 'http://p3a4a6bc.natappfree.cc'; //本地
+		// let path = 'http://h7ea5a46.natappfree.cc/store'; //本地
+		// let path2 = 'http://h7ea5a46.natappfree.cc'; //本地
 
 		// let path = 'http://jc5cb469.natappfree.cc/store'; //本地
 		// let path2 = 'http://jc5cb469.natappfree.cc'; //本地
@@ -27,7 +27,7 @@ export default class Request {
 			path = path2
 		}
 		if (router.indexOf("/live/liveData/like") != -1) {
-			path = 'https://im.fhhx.runtzh.com';
+			path = 'https://userapp.klbycp.com';
 		}
 
 		if (router.indexOf("/app/order/getMyMergedOrderList") != -1 || router.indexOf("/app/order/deleteOrder") != -1) {

+ 5 - 4
pages/home/components/RecommendSection.vue

@@ -208,10 +208,11 @@ export default {
 			})
 		},
 	onLive(){
-		uni.showToast({
-			title: '暂无课程',
-			icon: 'none'
-		})
+		// uni.showToast({
+		// 	title: '暂无课程',
+		// 	icon: 'none'
+		// })
+		 uni.navigateTo({ url: '/pages_course/livingList' })
 	},
 		onLiveSwiperChange(e) {
 			this.liveCurrent = e.detail.current

+ 171 - 3
pages/home/index.vue

@@ -21,7 +21,7 @@
 		</view>
 
 		<!-- 主题横幅 Banner -->
-		<scroll-view scroll-y class="scroll-content" :show-scrollbar="false" :lower-threshold="120" @scrolltolower="onScrollToLower">
+		<scroll-view scroll-y class="scroll-content" :scroll-top="scrollTop" :show-scrollbar="false" :lower-threshold="120" @scroll="onContentScroll" @scrolltolower="onScrollToLower">
 			<view class="banner" @click="onBannerClick">
 				<!-- <image class="banner-bg" src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/banner.png" mode="aspectFill"></image> -->
 				<view class="inner">
@@ -167,11 +167,44 @@
 
 			<view class="bottom-placeholder"></view>
 		</scroll-view>
+
+		<!-- 引导页轮播弹窗 -->
+		<view class="guide-popup" v-if="guideShow">
+			<view class="guide-mask"></view>
+			<view class="guide-wrap">
+				<view class="guide-card">
+					<swiper
+						class="guide-swiper"
+						:current="guideCurrent"
+						@change="onGuideSwiperChange"
+						:indicator-dots="false"
+						:autoplay="false"
+						:circular="false"
+					>
+						<swiper-item v-for="(item, index) in guideList" :key="'guide-' + index">
+							<image class="guide-img" :src="item.value" mode="aspectFit" />
+						</swiper-item>
+					</swiper>
+					<view class="guide-dots" v-if="guideList.length > 1">
+						<view
+							v-for="(item, index) in guideList"
+							:key="'guide-dot-' + index"
+							class="guide-dot"
+							:class="{ active: guideCurrent === index }"
+						></view>
+					</view>
+				</view>
+				<view class="guide-btn" @tap="onGuideAction">{{ isGuideLast ? '立即体验' : '下一页' }}</view>
+				<view class="guide-close" @tap="closeGuide">
+					<u-icon name="close-circle" color="#fff" size="36"></u-icon>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
 <script>
-import { listPublicCourseCategory, listPublicCourse ,getHisStoreConfig } from '@/api/home.js'
+import { listPublicCourseCategory, listPublicCourse, getHisStoreConfig, getStoreActivityGuide } from '@/api/home.js'
 
 export default {
 	data() {
@@ -193,16 +226,28 @@ export default {
 			courseSectionLoading: true,
 			videoThumbSrc: '',
 			menuButtonInfo: {}, // 胶囊按钮布局信息
-			yxy:{}
+			yxy:{},
+			scrollTop: 0,
+			guideShow: false,
+			guideList: [],
+			guideCurrent: 0,
+			guideViewed: true,
+			guideScrollTop: 0
 		}
 	},
 	computed: {
+		isGuideLast() {
+			return this.guideList.length > 0 && this.guideCurrent >= this.guideList.length - 1
+		},
 		hasVideoContent() {
 			return !!(this.videos && this.videos.courseId)
 		}
 	},
 	onLoad() {
 		this.getMenuButtonInfo(); // 初始化获取胶囊信息
+		if (uni.getStorageSync('AppToken')) {
+			this.getStoreActivityGuide()
+		}
 	},
 	onShow() {
 		this.loadConfig();
@@ -425,6 +470,44 @@ export default {
 				return;
 			}
 			//uni.navigateTo({ url: '/pages_index/courseDetail'})
+		},
+		onContentScroll(e) {
+			this.guideScrollTop = e.detail.scrollTop
+		},
+		getStoreActivityGuide() {
+			if (!this.utils.checkLoginState()) return
+			getStoreActivityGuide().then(res => {
+				if (res.code != 200) return
+				this.guideList = res.guideData || []
+				if (!res.viewed && this.guideList.length > 0) {
+					this.guideCurrent = 0
+					this.guideScrollTop = this.top || 0
+					this.guideShow = true
+				}
+			})
+		},
+		onGuideSwiperChange(e) {
+			this.guideCurrent = e.detail.current
+		},
+		onGuideAction() {
+			if (this.isGuideLast) {
+				this.closeGuide()
+			} else {
+				this.guideCurrent++
+			}
+		},
+		closeGuide() {
+			if (!this.guideShow) return
+			const top = this.guideScrollTop
+			this.guideShow = false
+			this.guideViewed = true
+			// viewStoreActivityGuide().catch(() => {})
+			// if (top > 0) {
+			// 	this.scrollTop = 0
+			// 	this.$nextTick(() => {
+			// 		this.scrollTop = top
+			// 	})
+			// }
 		}
 	}
 }
@@ -1021,4 +1104,89 @@ export default {
 		@include sk-shimmer;
 	}
 }
+
+.guide-popup {
+	position: fixed;
+	top: 0;
+	right: 0;
+	left: 0;
+	bottom: 0;
+	z-index: 1001;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+.guide-mask {
+	position: absolute;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	background: rgba(0,0,0,0.55);
+}
+.guide-wrap {
+	position: relative;
+	z-index: 1;
+	width: 670rpx;
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+}
+.guide-card {
+	width: 670rpx;
+	border-radius: 40rpx;
+	overflow: hidden;
+	position: relative;
+}
+.guide-swiper {
+	width: 670rpx;
+	height: 880rpx;
+}
+.guide-img {
+	width: 100%;
+	height: 100%;
+	display: block;
+}
+.guide-dots {
+	position: absolute;
+	left: 0;
+	right: 0;
+	bottom: 24rpx;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	gap: 12rpx;
+}
+.guide-dot {
+	width: 12rpx;
+	height: 12rpx;
+	border-radius: 6rpx;
+	background: rgba(255, 255, 255, 0.45);
+	transition: all 0.2s;
+}
+.guide-dot.active {
+	width: 28rpx;
+	background: #fff;
+}
+.guide-btn {
+	margin-top: 30rpx;
+	width: 590rpx;
+	height: 104rpx;
+	background: linear-gradient(135deg, #FF5267 0%, #FF233C 100%);
+	border-radius: 52rpx;
+	font-family: PingFangSC, PingFang SC;
+	font-weight: 600;
+	font-size: 40rpx;
+	color: #FFFFFF;
+	line-height: 104rpx;
+	text-align: center;
+}
+.guide-close {
+	width: 60rpx;
+	height: 60rpx;
+	margin-top: 30rpx;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
 </style>

+ 167 - 2
pages/home/newindex.vue

@@ -72,6 +72,39 @@
 				<image :src="activity.logoUrl" @tap="showActivity()" />
 			</view>
 		</view>
+
+		<!-- 引导页轮播弹窗 -->
+		<view class="guide-popup" v-if="guideShow">
+			<view class="guide-mask"></view>
+			<view class="guide-wrap">
+				<view class="guide-card">
+					<swiper
+						class="guide-swiper"
+						:current="guideCurrent"
+						@change="onGuideSwiperChange"
+						:indicator-dots="false"
+						:autoplay="false"
+						:circular="false"
+					>
+						<swiper-item v-for="(item, index) in guideList" :key="'guide-' + index">
+							<image class="guide-img" :src="item.value" mode="aspectFit" />
+						</swiper-item>
+					</swiper>
+					<view class="guide-dots" v-if="guideList.length > 1">
+						<view
+							v-for="(item, index) in guideList"
+							:key="'guide-dot-' + index"
+							class="guide-dot"
+							:class="{ active: guideCurrent === index }"
+						></view>
+					</view>
+				</view>
+				<view class="guide-btn" @tap="onGuideAction">{{ isGuideLast ? '立即体验' : '下一页' }}</view>
+				<view class="guide-close" @tap="closeGuide">
+					<u-icon name="close-circle" color="#fff" size="36"></u-icon>
+				</view>
+			</view>
+		</view>
 		<z-modal :show="tuiModalControl" placeholderText="请输入邀请码" :btnGroup="btnGroup" :contentType="2"
 			titleText="填写邀请码" @cancle="cancleTui" @sure="submitTui"></z-modal>
 		<Server />
@@ -82,7 +115,7 @@
 import zModal from '@/components/z-modal/z-modal.vue'
 import { getMenu, getIndexData, getCartCount } from '@/api/index'
 import { getStoreConfig } from '@/api/common'
-import { getHomeInit, getHomeRecommend, getHomeGoods, listPublicCourse, getHisStoreConfig } from '@/api/home.js'
+import { getHomeInit, getHomeRecommend, getHomeGoods, listPublicCourse, getHisStoreConfig, getStoreActivityGuide, viewStoreActivityGuide } from '@/api/home.js'
 import HotProduct from './components/HotProduct.vue'
 //import TuiProduct from '@/components/tuiProduct.vue'
 import SearchBar from './components/SearchBar.vue'
@@ -143,10 +176,18 @@ export default {
 			imageUrl:[
 				'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/page01.png',
 				'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/page02.png'
-			]
+			],
+			guideShow: false,
+			guideList: [],
+			guideCurrent: 0,
+			guideViewed: true,
+			guideScrollTop: 0
 		}
 	},
 	computed: {
+		isGuideLast() {
+			return this.guideList.length > 0 && this.guideCurrent >= this.guideList.length - 1
+		},
 		bgColor() {
 			const t = this.top / 30
 			if(t>0){
@@ -205,6 +246,7 @@ export default {
 		this.getMenu()
 		if (uni.getStorageSync('AppToken')) {
 			this.getUserInfo()
+			this.getStoreActivityGuide()
 		} else {
 			this.isuser = true
 		}
@@ -451,6 +493,37 @@ export default {
 				else uni.showToast({ icon: 'none', title: '请求失败' })
 			})
 		},
+		getStoreActivityGuide() {
+			if (!this.utils.checkLoginState()) return
+			getStoreActivityGuide().then(res => {
+				if (res.code != 200) return
+				this.guideList = res.guideData || []
+				if (!res.viewed && this.guideList.length > 0) {
+					this.guideCurrent = 0
+					this.guideScrollTop = this.top || 0
+					this.guideShow = true
+				}
+			})
+		},
+		onGuideSwiperChange(e) {
+			this.guideCurrent = e.detail.current
+		},
+		onGuideAction() {
+			if (this.isGuideLast) {
+				this.closeGuide()
+			} else {
+				this.guideCurrent++
+			}
+		},
+		closeGuide() {
+			if (!this.guideShow) return
+			this.guideShow = false
+			this.guideViewed = true
+			// viewStoreActivityGuide().catch(() => {})
+			// if (this.guideScrollTop > 0) {
+			// 	uni.pageScrollTo({ scrollTop: this.guideScrollTop, duration: 0 })
+			// }
+		},
 		getCartCount() {
 			this.utils.isLogin().then(res => {
 				if (res) getCartCount().then(cartRes => {
@@ -671,4 +744,96 @@ export default {
 .popup-box .info-form image {
 	width: 100%;
 }
+.guide-popup {
+	position: fixed;
+	top: 0;
+	right: 0;
+	left: 0;
+	bottom: 0;
+	z-index: 1001;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+.guide-mask {
+	position: absolute;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	background: rgba(0,0,0,0.55);
+}
+.guide-wrap {
+	position: relative;
+	z-index: 1;
+	width: 670rpx;
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+}
+.guide-card {
+	width: 670rpx;
+	border-radius: 40rpx;
+	overflow: hidden;
+	position: relative;
+	//background: #fff;
+}
+.guide-swiper {
+	width: 670rpx;
+	height: 880rpx;
+}
+.guide-img {
+	width: 100%;
+	height: 100%;
+	display: block;
+}
+.guide-dots {
+	position: absolute;
+	left: 0;
+	right: 0;
+	bottom: 24rpx;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	gap: 12rpx;
+}
+.guide-dot {
+	width: 12rpx;
+	height: 12rpx;
+	border-radius: 6rpx;
+	background: rgba(255, 255, 255, 0.45);
+	transition: all 0.2s;
+}
+.guide-dot.active {
+	width: 28rpx;
+	background: #fff;
+}
+.guide-btn {
+	margin-top: 30rpx;
+	width: 590rpx;
+	height: 104rpx;
+	background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
+	border-radius: 52rpx;
+    font-family: PingFangSC, PingFang SC;
+    font-weight: 600;
+    font-size: 40rpx;
+    color: #FFFFFF;
+    line-height: 104rpx;
+	text-align: center;
+}
+.guide-close {
+	width: 60rpx;
+	height: 60rpx;
+	margin-top: 30rpx;
+	// border: 2rpx solid rgba(255, 255, 255, 0.85);
+	// border-radius: 50%;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+.guide-close-x {
+	color: #fff;
+	font-size: 40rpx;
+	line-height: 1;
+}
 </style>

+ 30 - 1
pages/shopping/paymentOrder.vue

@@ -145,7 +145,8 @@
 
 		</view>
 		<view class="btn-box">
-			<view class="btn" @click="payOrder()">去支付</view>
+			<view v-if="order.orderType!==5" class="btn" @click="payOrder()">去支付</view>
+			<view v-else class="btn" @click="toPayConfirmReward()">去支付</view>
 			<!-- <view class="other-btn" >
 				亲友代付
 				<button  class="share" data-name="shareBtn" open-type="share">分享</button>
@@ -168,6 +169,9 @@
 		orderBindUser,
 		clearPayType
 	} from '@/api/storeOrder'
+	import {
+		payConfirmReward
+	} from '@/api/order'
 	export default {
 		data() {
 			return {
@@ -200,6 +204,31 @@
 			this.clearPayTypeFun()
 		},
 		methods: {
+			toPayConfirmReward() {
+				let data = {
+					orderId: this.orderId,
+					appId: wx.getAccountInfoSync().miniProgram.appId
+				}
+				payConfirmReward(data).then(
+					res => {
+						if (res.code == 200) {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg,
+							});
+							uni.redirectTo({
+								url: "success?order=" + JSON.stringify(this.order)
+							})
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
 			getSafeUserInfo() {
 			let userInfoStr = uni.getStorageSync('userInfo');
 			if(Object.prototype.toString.call(userInfoStr) == '[object String]'){

+ 2 - 2
pages_company/managerOrder/productDetails.vue

@@ -323,7 +323,7 @@ import CustomToast from '@/components/custom-toast.vue';
 				var user = JSON.parse(uni.getStorageSync('userInfo'))
 				return {
 					title: this.product.productName,
-					path: '/pages/shopping/productDetails?productId=' + this.product.productId + "&userId=" + user.userId +"&companyId="+this.companyId+"&companyUserId="+this.companyUserId,
+					path: '/pages_company/managerOrder/productDetails?productId=' + this.product.productId + "&userId=" + user.userId +"&companyId="+this.companyId+"&companyUserId="+this.companyUserId,
 					imageUrl: 'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/app/vip/share.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 				}
 			}
@@ -435,7 +435,7 @@ import CustomToast from '@/components/custom-toast.vue';
 							if (type == "buy") {
 								uni.navigateTo({
 									url: '/pages/shopping/confirmOrder?type=' + this.type + "&cartIds=" + res
-										.id + "&orderType=" + this.orderType + "&storeId=" + this.storeId +"&courseId="+this.courseId
+										.id + "&orderType=" + this.orderType + "&storeId=" + this.storeId +"&courseId="+this.courseId+"&companyId="+this.companyId+"&companyUserId="+this.companyUserId
 								})
 							} else {
 								this.getCartCount()

+ 13 - 10
pages_course/living.vue

@@ -313,11 +313,12 @@
 			<view class="goods-card" v-if="isShowGoods&&!isFullscreen"
 				@click.stop="goShop(goodsCard.productId, goodsCard.goodsId)">
 				<view class="goods-card-header">
-					<view class="goods-status">
+					<view></view>
+					<!-- <view class="goods-status">
 						<image class="status-icon mr8"
 							src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/signal.png" />
 						主播讲解中
-					</view>
+					</view> -->
 					<image @click.stop="isShowGoods = false" class="close-icon" src="/static/images/close_w.png" />
 				</view>
 				<image class="goods-image" :src="goodsCard.imgUrl" />
@@ -7157,7 +7158,7 @@
 				background-color: #fff;
 				border-radius: 20rpx;
 				overflow: hidden;
-				width: 224rpx;
+				width: 300rpx;
 				padding: 4rpx;
 
 				.goods-card-header {
@@ -7187,15 +7188,15 @@
 					}
 
 					.close-icon {
-						width: 24rpx;
-						height: 24rpx;
+						width: 30rpx;
+						height: 30rpx;
 					}
 				}
 
 				.goods-image {
 					width: 100%;
-					height: 224rpx;
-					border-radius: 16rpx 16rpx 0 0;
+					height: 300rpx;
+					border-radius: 20rpx 20rpx 0 0;
 					overflow: hidden;
 				}
 
@@ -7203,10 +7204,12 @@
 					padding: 4rpx;
 
 					.goods-title {
-						font-weight: 500;
-						font-size: 24rpx;
+						font-family: PingFangSC, PingFang SC;
+						font-weight: 600;
+						font-size: 32rpx;
+						color: rgba(0,0,0,0.85);
+						line-height: 44rpx;
 						margin: 10rpx 0 12rpx;
-						color: #111111;
 					}
 
 					.goods-action {

+ 5 - 5
pages_user/user/storeOrder.vue

@@ -46,7 +46,7 @@
 					</view>
 					<!-- 产品列表 -->
 					<!-- 商城 -->
-					<view class="drug-list" v-if="item.orderType!==2">
+					<view class="drug-list">
 						<view @click="showDetail(item)" v-if="item.isPackage!=1"
 							v-for="(subItem,subIndex) in item.items" :key="subIndex" class="drug-item">
 							<view class="img-box">
@@ -111,7 +111,7 @@
 						</view>
 					</view>
 					<!-- 直播 -->
-					<view class="drug-list" v-if="item.orderType==2">
+					<view class="drug-list" v-if="item.orderType==99">
 						<view @click="showDetail(item)" v-if="item.isPackage!=1" class="drug-item">
 							<view class="img-box">
 								<image :src="JSON.parse(item.itemJson).image" mode="aspectFill"></image>
@@ -119,7 +119,7 @@
 							<view class="drug-info">
 								<view>
 									<view class="name-box ellipsis2">
-										<view v-if="item.isPrescribe==1" class="tag">处方药</view>
+										<!-- <view v-if="item.isPrescribe==1" class="tag">处方药</view> -->
 										{{JSON.parse(item.itemJson).productName}}
 									</view>
 									<view class="spec ellipsis2">{{JSON.parse(item.itemJson).sku}}</view>
@@ -127,7 +127,7 @@
 								<view class="num-box">
 									<view class="price">
 										<text class="unit">¥</text>
-										<text class="num">{{JSON.parse(item.itemJson).price.toFixed(2)}}</text>
+										<text class="num">{{JSON.parse(item.itemJson).price}}</text>
 									</view>
 									<view class="amount">x{{item.totalNum}}</view>
 								</view>
@@ -160,7 +160,7 @@
 								<text class="label">订单金额:</text>
 								<view class="price-box">
 									<view class="unit">¥</view>
-									<view class="num">{{item.payPrice.toFixed(2)}}</view>
+									<view class="num">{{item.payPrice}}</view>
 								</view>
 							</view>
 							<view class="btn-box">

BIN
static/images/like.png