zmr #263
@ -13,7 +13,7 @@
 | 
			
		||||
		<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 340rpx;">
 | 
			
		||||
			<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
 | 
			
		||||
				<!-- 最多显示3个 -->
 | 
			
		||||
				<view v-if="groupList[i]">
 | 
			
		||||
				<view v-if="groupList[i]" class="group-container">
 | 
			
		||||
					<sitem :info="info" v-for="(info, index) in groupList[i].slice(0, 3)" :key="index"></sitem>
 | 
			
		||||
				</view>
 | 
			
		||||
				<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList[i] || !groupList[i].length" style="margin: 0 auto;"></u-empty>
 | 
			
		||||
@ -61,7 +61,7 @@ export default {
 | 
			
		||||
				gc_id: id,
 | 
			
		||||
			}).then(res => {
 | 
			
		||||
				this.groupList[this.current] = res.data;
 | 
			
		||||
				// console.log(this.groupList);
 | 
			
		||||
				console.log(this.groupList);
 | 
			
		||||
				this.$forceUpdate();
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
@ -105,10 +105,12 @@ export default {
 | 
			
		||||
    .list {
 | 
			
		||||
		box-sizing: border-box;
 | 
			
		||||
		padding: 0 30rpx;
 | 
			
		||||
        display: flex;
 | 
			
		||||
		> view {
 | 
			
		||||
			&:not(:nth-child(3n)) {
 | 
			
		||||
				margin-right: 20rpx;
 | 
			
		||||
		.group-container {
 | 
			
		||||
			display: flex;
 | 
			
		||||
			> view {
 | 
			
		||||
				&:not(:nth-child(3n)) {
 | 
			
		||||
					margin-right: 20rpx;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -309,17 +309,7 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
		setTotalPrice() {
 | 
			
		||||
			const goods = this.orderInfo.store_goods_total;
 | 
			
		||||
			// console.log(this.freight);
 | 
			
		||||
			let freight = 0, price = 0;
 | 
			
		||||
			// 商品价格加上运费
 | 
			
		||||
			// [goods, freight].forEach(object => {
 | 
			
		||||
			// 	for (const key in object) {
 | 
			
		||||
			// 		if (object.hasOwnProperty(key)) {
 | 
			
		||||
			// 			const element = object[key];
 | 
			
		||||
			// 			price += Number(element);
 | 
			
		||||
			// 		}
 | 
			
		||||
			// 	}
 | 
			
		||||
			// })
 | 
			
		||||
			let [freight, price, minPrice] = [0, 0, 0];
 | 
			
		||||
			// 运费
 | 
			
		||||
			for (const key in this.freight) {
 | 
			
		||||
				if (this.freight.hasOwnProperty(key)) {
 | 
			
		||||
@ -327,28 +317,38 @@ export default {
 | 
			
		||||
					freight += Number(element);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			// 商品价格
 | 
			
		||||
			for (const key in goods) {
 | 
			
		||||
				if (goods.hasOwnProperty(key)) {
 | 
			
		||||
					const element = goods[key];
 | 
			
		||||
					price += Number(element);
 | 
			
		||||
			// 商品价格减去优惠券
 | 
			
		||||
			// 店铺
 | 
			
		||||
			for (const gid in goods) {
 | 
			
		||||
				if (goods.hasOwnProperty(gid)) {
 | 
			
		||||
					// 计算最小价格
 | 
			
		||||
					minPrice += 0.01;
 | 
			
		||||
					// 每个店铺所有商品的价格
 | 
			
		||||
					let sprice = Number(goods[gid]);
 | 
			
		||||
					if(JSON.stringify(this.storeCoupon) != '{}') {
 | 
			
		||||
						for (const cid in this.storeCoupon) {
 | 
			
		||||
							if (this.storeCoupon.hasOwnProperty(cid)) {
 | 
			
		||||
								const cprice = this.storeCoupon[cid];
 | 
			
		||||
								// 商品减去优惠券价格
 | 
			
		||||
								if(gid == cid) {
 | 
			
		||||
									sprice -= cprice.voucher_price;
 | 
			
		||||
									// 每个店铺最低付款 0.01
 | 
			
		||||
									if(sprice <= 0) sprice = 0.01;
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					// 所有商品总价
 | 
			
		||||
					price += sprice;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			// 减去优惠券
 | 
			
		||||
			// 平台
 | 
			
		||||
			if(JSON.stringify(this.choiceCoupon) != '{}') price -= Number(this.choiceCoupon.voucher_price);
 | 
			
		||||
			// 店铺
 | 
			
		||||
			if(JSON.stringify(this.storeCoupon) != '{}') {
 | 
			
		||||
				for (const key in this.storeCoupon) {
 | 
			
		||||
					if (this.storeCoupon.hasOwnProperty(key)) {
 | 
			
		||||
						const element = this.storeCoupon[key];
 | 
			
		||||
						price -= element.voucher_price;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			// 最低付款 0.01
 | 
			
		||||
			if(price <= 0) price = 0.01;
 | 
			
		||||
			// console.log(price);
 | 
			
		||||
			// 每个店铺最低付款 0.01
 | 
			
		||||
			if(price <= minPrice) price = minPrice;
 | 
			
		||||
			// console.log("minPrice" + minPrice);
 | 
			
		||||
			// console.log("freight:" + freight);
 | 
			
		||||
			// console.log("price:" + price);
 | 
			
		||||
			this.totalPrice = (price + freight).toFixed(2);
 | 
			
		||||
		},
 | 
			
		||||
		setDelivery(index) {
 | 
			
		||||
 | 
			
		||||
@ -2,18 +2,18 @@
 | 
			
		||||
	<view id="actives">
 | 
			
		||||
		<!-- 活动消息推送 -->
 | 
			
		||||
		<view class="activity" v-for="(item, index) in actives" :key="index">
 | 
			
		||||
			<view class="times">{{item.type}}</view>
 | 
			
		||||
			<view class="times">{{item.kd_time}}</view>
 | 
			
		||||
			<view class="content">
 | 
			
		||||
				<view class="store_name">
 | 
			
		||||
					<image src="../../pageE/static/mine/1.png"></image>
 | 
			
		||||
					<view>小时代</view>
 | 
			
		||||
					<image :src="item.store_avatar"></image>
 | 
			
		||||
					<view>{{item.store_name}}</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="xiantiao"></view>
 | 
			
		||||
				<view class="title">{{item.name}}</view>
 | 
			
		||||
				<view class="title">{{item.title}}</view>
 | 
			
		||||
				<view class="images_about">
 | 
			
		||||
					<image :src="item.url"></image>
 | 
			
		||||
					<image :src="item.picture"></image>
 | 
			
		||||
					<view>
 | 
			
		||||
						<text>{{item.about}}</text>
 | 
			
		||||
						<text>{{item.summary}}</text>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
@ -35,8 +35,9 @@
 | 
			
		||||
		methods: {
 | 
			
		||||
            getCartList() {
 | 
			
		||||
                this.$u.post("message/orderDeliveryList",{page: this.page}).then(res => {
 | 
			
		||||
					console.log(res.data.data)
 | 
			
		||||
                    if (res.errCode == 0) {
 | 
			
		||||
                        this.actives == res.data;
 | 
			
		||||
                        this.actives = res.data.data;
 | 
			
		||||
                    }
 | 
			
		||||
                })
 | 
			
		||||
            }
 | 
			
		||||
@ -46,7 +47,10 @@
 | 
			
		||||
	};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
<style lang="scss" >
 | 
			
		||||
page{
 | 
			
		||||
	background-color: #ECECEC;
 | 
			
		||||
}
 | 
			
		||||
	#actives{
 | 
			
		||||
			height: 100%;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -12,8 +12,8 @@
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="version-view">
 | 
			
		||||
				<text class="title">版本更新</text>
 | 
			
		||||
				<text class="tips" v-if="0">已是最新版本</text>
 | 
			
		||||
				<text class="tips" v-else @click="updateVersion">1.1.10</text>
 | 
			
		||||
				<text class="tips" v-if="1">已是最新版本</text>
 | 
			
		||||
				<text class="tips" v-else @click="updateVersion">发现新版本</text>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
 | 
			
		||||
@ -61,6 +61,7 @@ export default {
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		async getMemberCouponList({ load = 'reload' }) {
 | 
			
		||||
			if(load == 'reload') this.page = 0;
 | 
			
		||||
			const res = await this.$u.api.getMemberCouponList({
 | 
			
		||||
				status: this.current + 1, // 代金券状态 1:未用 2:已用 3:过期 4:收回
 | 
			
		||||
				page: this.page,
 | 
			
		||||
 | 
			
		||||
@ -39,7 +39,8 @@
 | 
			
		||||
					</scroll-view>
 | 
			
		||||
				</swiper-item>
 | 
			
		||||
				<swiper-item>
 | 
			
		||||
					<scroll-view style="width:100%;height:100%" scroll-y="true" @scrolltolower="swiperBottomLive(e)">
 | 
			
		||||
					<scroll-view style="width:100%;height:100%" scroll-y="true" @scrolltolower="swiperBottomLive(e)" :refresher-enabled="true" @refresherrefresh="dianji(1)" :refresher-triggered="refresher"  @refresherpulling="onPulling"
 | 
			
		||||
            @refresherrestore="onRestore" @refresherabort="onAbort">
 | 
			
		||||
						<view class="box">
 | 
			
		||||
							<u-swiper mode="dot" :list="zhiboImageSwiper" name="adv_code" @click="clickSImage($event, 2)"></u-swiper>
 | 
			
		||||
							<view class="list">
 | 
			
		||||
@ -261,6 +262,7 @@
 | 
			
		||||
                    loading: '努力加载中',
 | 
			
		||||
                    nomore: '实在没有了'
 | 
			
		||||
				},
 | 
			
		||||
				refresher:true
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		components: {
 | 
			
		||||
@ -356,6 +358,7 @@
 | 
			
		||||
				this.$u.api.tabLiveList({page:this.live_page}).then((res) => {
 | 
			
		||||
					 // uni.stopPullDownRefresh();
 | 
			
		||||
					this.status_live = "loading";
 | 
			
		||||
					this.refresher = false;
 | 
			
		||||
					console.log(res)
 | 
			
		||||
                    if (res.errCode == 0) {
 | 
			
		||||
                        uni.hideLoading();
 | 
			
		||||
@ -410,7 +413,8 @@
 | 
			
		||||
			},
 | 
			
		||||
            // 切换导航
 | 
			
		||||
			dianji(a) {
 | 
			
		||||
                // console.log(a);
 | 
			
		||||
				console.log(a);
 | 
			
		||||
 | 
			
		||||
                if (a.type == "change") {
 | 
			
		||||
                    this.num = a.detail.current;
 | 
			
		||||
                } else {
 | 
			
		||||
@ -418,7 +422,7 @@
 | 
			
		||||
                }
 | 
			
		||||
                // console.log(this.num);
 | 
			
		||||
                // 状态请求
 | 
			
		||||
                if (a.type == "change") { // 强制请求一次
 | 
			
		||||
                if (a.type == "change" || this.num == 1) { // 强制请求一次
 | 
			
		||||
                    if (this.num == 0) {
 | 
			
		||||
                        this.page = 1;
 | 
			
		||||
                        this.articleList = [];
 | 
			
		||||
@ -429,7 +433,7 @@
 | 
			
		||||
                        this.live_page = 1;
 | 
			
		||||
                        this.status_live = "nomore";
 | 
			
		||||
                        this.getZhiBoSwiper(); // 直播轮播
 | 
			
		||||
                        this.tabLiveList();
 | 
			
		||||
						this.tabLiveList();
 | 
			
		||||
                    } else if (this.num == 2) {
 | 
			
		||||
                        this.follow_page = 0;
 | 
			
		||||
                        this.fansList = [];
 | 
			
		||||
@ -558,6 +562,16 @@
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			onPulling(e) {
 | 
			
		||||
                console.log("onpulling", e);
 | 
			
		||||
            },
 | 
			
		||||
            onRestore() {
 | 
			
		||||
                this.refresher = 'restore'; // 需要重置
 | 
			
		||||
                console.log("onRestore");
 | 
			
		||||
            },
 | 
			
		||||
            onAbort() {
 | 
			
		||||
                console.log("onAbort");
 | 
			
		||||
            },
 | 
			
		||||
			jumpPage(uri) {
 | 
			
		||||
				// console.log(uri);
 | 
			
		||||
				common.jumpPage({ type: uri.type, id: uri.id });
 | 
			
		||||
 | 
			
		||||
@ -211,7 +211,7 @@ export default {
 | 
			
		||||
		this.getOrderNumber();
 | 
			
		||||
	},
 | 
			
		||||
	onNavigationBarButtonTap(e) {
 | 
			
		||||
		console.log(e);
 | 
			
		||||
		// console.log(e);
 | 
			
		||||
		if(e.index == 0) this.$u.route('/pageE/setting/Index');
 | 
			
		||||
	},
 | 
			
		||||
    methods: {
 | 
			
		||||
@ -239,7 +239,7 @@ export default {
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		toOtherPage(url) {
 | 
			
		||||
			console.log(url);
 | 
			
		||||
			// console.log(url);
 | 
			
		||||
			uni.navigateTo({
 | 
			
		||||
				url: '/pageE' + url
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user