hwq 3 лет назад
Родитель
Сommit
653d10b063

+ 16 - 0
api/market.js

@@ -42,3 +42,19 @@ export function spExchange(data,id) {
 		data
 	});
 }
+
+export function activityDetail(data,id) {
+	return request({
+		url: '/api/activity/'+id,
+		method: 'get',
+		data
+	});
+}
+
+export function joinActivity(data,id) {
+	return request({
+		url: '/api/activity/'+id,
+		method: 'post',
+		data
+	});
+}

+ 54 - 0
api/product.js

@@ -87,3 +87,57 @@ export function redeem(data,id) {
 		data
 	});
 }
+
+// 获取商品列表
+export function getProducts(data) {
+	// 	{
+	// 参数名称	是否必须	示例	备注
+	// sid			否			二级分类编号
+	// cid			否			一级分类编号(!)
+	// keyword		否			搜索
+	// priceOrder	否			价格排序
+	// salesOrder	否			销量排序
+	// news			否			是否新品
+	// page			否			分页参数起始值
+	// limit		否			分页数步长值
+	// }
+	return request({
+		url: '/api/products',
+		method: 'get',
+		data
+	});
+}
+// 获取商品详情
+export function goodsDetail(data, id) {
+	return request({
+		url: '/api/product/detail/' + id,
+		method: 'get',
+		data
+	});
+}
+// 加入购物车
+export function cartAdd(data) {
+	return request({
+		url: '/api/cart/add',
+		method: 'post',
+		data
+	});
+}
+
+// 收藏商品
+export function collectAdd(data) {
+	return request({
+		url: '/api/collect/add',
+		method: 'post',
+		data
+	});
+}
+
+// 取消收藏商品
+export function collectDel(data) {
+	return request({
+		url: '/api/collect/del',
+		method: 'post',
+		data
+	});
+}

+ 124 - 0
components/uni-fav/uni-fav.vue

@@ -0,0 +1,124 @@
+<template>
+	<view :class="[circle === true || circle === 'true' ? 'uni-fav--circle' : '']" :style="[{ backgroundColor: checked ? bgColorChecked : bgColor }]"
+	 @click="onClick" class="uni-fav">
+		<!-- #ifdef MP-ALIPAY -->
+		<view class="uni-fav-star" v-if="!checked && (star === true || star === 'true')">
+			<uni-icons :color="fgColor" :style="{color: checked ? fgColorChecked : fgColor}" size="14" type="star-filled" />
+		</view>
+		<!-- #endif -->
+		<!-- #ifndef MP-ALIPAY -->
+		<uni-icons :color="fgColor" :style="{color: checked ? fgColorChecked : fgColor}" class="uni-fav-star" size="14" type="star-filled"
+		 v-if="!checked && (star === true || star === 'true')" />
+		<!-- #endif -->
+		<text :style="{color: checked ? fgColorChecked : fgColor}" class="uni-fav-text">{{ checked ? contentText.contentFav : contentText.contentDefault }}</text>
+	</view>
+</template>
+
+<script>
+	import uniIcons from "../uni-icons/uni-icons.vue";
+	export default {
+		name: "UniFav",
+		components: {
+			uniIcons
+		},
+		props: {
+			star: {
+				type: [Boolean, String],
+				default: true
+			},
+			bgColor: {
+				type: String,
+				default: "#eeeeee"
+			},
+			fgColor: {
+				type: String,
+				default: "#666666"
+			},
+			bgColorChecked: {
+				type: String,
+				default: "#007aff"
+			},
+			fgColorChecked: {
+				type: String,
+				default: "#FFFFFF"
+			},
+			circle: {
+				type: [Boolean, String],
+				default: false
+			},
+			checked: {
+				type: Boolean,
+				default: false
+			},
+			contentText: {
+				type: Object,
+				default () {
+					return {
+						contentDefault: "收藏",
+						contentFav: "已收藏"
+					};
+				}
+			}
+		},
+		watch: {
+			checked() {
+				if (uni.report) {
+					if (this.checked) {
+						uni.report("收藏", "收藏");
+					} else {
+						uni.report("取消收藏", "取消收藏");
+					}
+				}
+			}
+		},
+		methods: {
+			onClick() {
+				this.$emit("click");
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	$fav-height: 25px;
+
+	.uni-fav {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		width: 60px;
+		height: $fav-height;
+		line-height: $fav-height;
+		text-align: center;
+		border-radius: 3px;
+	}
+
+	.uni-fav--circle {
+		border-radius: 30px;
+	}
+
+	.uni-fav-star {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		height: $fav-height;
+		line-height: 24px;
+		margin-right: 3px;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.uni-fav-text {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		height: $fav-height;
+		line-height: $fav-height;
+		align-items: center;
+		justify-content: center;
+		font-size: $uni-font-size-base;
+	}
+</style>

+ 396 - 0
components/uni-notice-bar/uni-notice-bar.vue

@@ -0,0 +1,396 @@
+<template>
+	<view v-if="show" class="uni-noticebar" :style="{ backgroundColor: backgroundColor }" @click="onClick">
+		<!-- #ifdef MP-ALIPAY -->
+		<view v-if="showClose === true || showClose === 'true'" class="uni-noticebar-close" @click="close">
+			<uni-icons type="closefill" :color="color" size="12" />
+		</view>
+		<view v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon">
+			<uni-icons type="sound" :color="color" size="14" />
+		</view>
+		<!-- #endif -->
+		<!-- #ifndef MP-ALIPAY -->
+		<uni-icons v-if="showClose === true || showClose === 'true'" class="uni-noticebar-close" type="closefill" :color="color"
+		 size="12" @click="close" />
+		<uni-icons v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon" type="sound" :color="color"
+		 size="14" />
+		<!-- #endif -->
+		<view ref="textBox" class="uni-noticebar__content-wrapper" :class="{'uni-noticebar__content-wrapper--scrollable':scrollable, 'uni-noticebar__content-wrapper--single':!scrollable && (single || moreText)}">
+			<view :id="elIdBox" class="uni-noticebar__content" :class="{'uni-noticebar__content--scrollable':scrollable, 'uni-noticebar__content--single':!scrollable && (single || moreText)}">
+				<text :id="elId" ref="animationEle" class="uni-noticebar__content-text" :class="{'uni-noticebar__content-text--scrollable':scrollable,'uni-noticebar__content-text--single':!scrollable && (single || moreText)}"
+				 :style="{color:color, width:wrapWidth+'px', 'animationDuration': animationDuration, '-webkit-animationDuration': animationDuration ,animationPlayState: webviewHide?'paused':animationPlayState,'-webkit-animationPlayState':webviewHide?'paused':animationPlayState, animationDelay: animationDelay, '-webkit-animationDelay':animationDelay}">{{text}}</text>
+			</view>
+		</view>
+		<view v-if="showGetMore === true || showGetMore === 'true'" class="uni-noticebar__more" @click="clickMore">
+			<text v-if="moreText" :style="{ color: moreColor }" class="uni-noticebar__more-text">{{ moreText }}</text>
+			<uni-icons type="arrowright" :color="moreColor" size="14" />
+		</view>
+	</view>
+</template>
+
+<script>
+	import uniIcons from '../uni-icons/uni-icons.vue'
+	// #ifdef APP-NVUE
+	const dom = weex.requireModule('dom');
+	const animation = weex.requireModule('animation');
+	// #endif
+
+	/**
+	 * NoticeBar 自定义导航栏
+	 * @description 通告栏组件
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=30
+	 * @property {Number} speed 文字滚动的速度,默认100px/秒
+	 * @property {String} text 显示文字
+	 * @property {String} backgroundColor 背景颜色
+	 * @property {String} color 文字颜色
+	 * @property {String} moreColor 查看更多文字的颜色
+	 * @property {String} moreText 设置“查看更多”的文本
+	 * @property {Boolean} single = [true|false] 是否单行
+	 * @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行
+	 * @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标
+	 * @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮
+	 * @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行
+	 * @event {Function} click 点击 NoticeBar 触发事件
+	 * @event {Function} close 关闭 NoticeBar 触发事件
+	 * @event {Function} getmore 点击”查看更多“时触发事件
+	 */
+
+	export default {
+		name: 'UniNoticeBar',
+		components: {
+			uniIcons
+		},
+		props: {
+			text: {
+				type: String,
+				default: ''
+			},
+			moreText: {
+				type: String,
+				default: ''
+			},
+			backgroundColor: {
+				type: String,
+				default: '#fffbe8'
+			},
+			speed: {
+				// 默认1s滚动100px
+				type: Number,
+				default: 100
+			},
+			color: {
+				type: String,
+				default: '#de8c17'
+			},
+			moreColor: {
+				type: String,
+				default: '#999999'
+			},
+			single: {
+				// 是否单行
+				type: [Boolean, String],
+				default: false
+			},
+			scrollable: {
+				// 是否滚动,添加后控制单行效果取消
+				type: [Boolean, String],
+				default: false
+			},
+			showIcon: {
+				// 是否显示左侧icon
+				type: [Boolean, String],
+				default: false
+			},
+			showGetMore: {
+				// 是否显示右侧查看更多
+				type: [Boolean, String],
+				default: false
+			},
+			showClose: {
+				// 是否显示左侧关闭按钮
+				type: [Boolean, String],
+				default: false
+			}
+		},
+		data() {
+			const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
+			const elIdBox = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
+			return {
+				textWidth: 0,
+				boxWidth: 0,
+				wrapWidth: '',
+				webviewHide: false,
+				// #ifdef APP-NVUE
+				stopAnimation: false,
+				// #endif
+				elId: elId,
+				elIdBox: elIdBox,
+				show: true,
+				animationDuration: 'none',
+				animationPlayState: 'paused',
+				animationDelay: '0s'
+			}
+		},
+		mounted() {
+			// #ifdef APP-PLUS
+			var pages = getCurrentPages();
+			var page = pages[pages.length - 1];
+			var currentWebview = page.$getAppWebview();
+			currentWebview.addEventListener('hide',()=>{
+				this.webviewHide = true
+			})
+			currentWebview.addEventListener('show',()=>{
+				this.webviewHide = false
+			})
+			// #endif
+			this.$nextTick(() => {
+				this.initSize()
+			})
+		},
+		// #ifdef APP-NVUE
+		beforeDestroy() {
+			this.stopAnimation = true
+		},
+		// #endif
+		methods: {
+			initSize() {
+				if (this.scrollable) {
+					// #ifndef APP-NVUE
+					let query = [],
+						boxWidth = 0,
+						textWidth = 0;
+					let textQuery = new Promise((resolve, reject) => {
+						uni.createSelectorQuery()
+							// #ifndef MP-ALIPAY
+							.in(this)
+							// #endif
+							.select(`#${this.elId}`)
+							.boundingClientRect()
+							.exec(ret => {
+								this.textWidth = ret[0].width
+								resolve()
+							})
+					})
+					let boxQuery = new Promise((resolve, reject) => {
+						uni.createSelectorQuery()
+							// #ifndef MP-ALIPAY
+							.in(this)
+							// #endif
+							.select(`#${this.elIdBox}`)
+							.boundingClientRect()
+							.exec(ret => {
+								this.boxWidth = ret[0].width
+								resolve()
+							})
+					})
+					query.push(textQuery)
+					query.push(boxQuery)
+					Promise.all(query).then(() => {
+						this.animationDuration = `${this.textWidth / this.speed}s`
+						this.animationDelay = `-${this.boxWidth / this.speed}s`
+						setTimeout(() => {
+							this.animationPlayState = 'running'
+						}, 1000)
+					})
+					// #endif
+					// #ifdef APP-NVUE
+					dom.getComponentRect(this.$refs['animationEle'], (res) => {
+						let winWidth = uni.getSystemInfoSync().windowWidth
+						this.textWidth = res.size.width
+						animation.transition(this.$refs['animationEle'], {
+							styles: {
+								transform: `translateX(-${winWidth}px)`
+							},
+							duration: 0,
+							timingFunction: 'linear',
+							delay: 0
+						}, () => {
+							if (!this.stopAnimation) {
+								animation.transition(this.$refs['animationEle'], {
+									styles: {
+										transform: `translateX(-${this.textWidth}px)`
+									},
+									timingFunction: 'linear',
+									duration: (this.textWidth - winWidth) / this.speed * 1000,
+									delay: 1000
+								}, () => {
+									if (!this.stopAnimation) {
+										this.loopAnimation()
+									}
+								});
+							}
+						});
+					})
+					// #endif
+				}
+				// #ifdef APP-NVUE
+				if (!this.scrollable && (this.single || this.moreText)) {
+					dom.getComponentRect(this.$refs['textBox'], (res) => {
+						this.wrapWidth = res.size.width
+					})
+				}
+				// #endif
+			},
+			loopAnimation() {
+				// #ifdef APP-NVUE
+				animation.transition(this.$refs['animationEle'], {
+					styles: {
+						transform: `translateX(0px)`
+					},
+					duration: 0
+				}, () => {
+					if (!this.stopAnimation) {
+						animation.transition(this.$refs['animationEle'], {
+							styles: {
+								transform: `translateX(-${this.textWidth}px)`
+							},
+							duration: this.textWidth / this.speed * 1000,
+							timingFunction: 'linear',
+							delay: 0
+						}, () => {
+							if (!this.stopAnimation) {
+								this.loopAnimation()
+							}
+						});
+					}
+				});
+				// #endif
+			},
+			clickMore() {
+				this.$emit('getmore')
+			},
+			close() {
+				this.show = false;
+				this.$emit('close')
+			},
+			onClick() {
+				this.$emit('click')
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import '@/uni.scss';
+
+	.uni-noticebar {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		width: 100%;
+		box-sizing: border-box;
+		/* #endif */
+		flex-direction: row;
+		align-items: center;
+		padding: 6px 12px;
+		margin-bottom: 10px;
+	}
+
+	.uni-noticebar-close {
+		margin-right: 5px;
+	}
+
+	.uni-noticebar-icon {
+		margin-right: 5px;
+	}
+
+	.uni-noticebar__content-wrapper {
+		flex: 1;
+		flex-direction: column;
+		overflow: hidden;
+	}
+
+	.uni-noticebar__content-wrapper--single {
+		/* #ifndef APP-NVUE */
+		line-height: 18px;
+		/* #endif */
+	}
+
+	.uni-noticebar__content-wrapper--single,
+	.uni-noticebar__content-wrapper--scrollable {
+		flex-direction: row;
+	}
+
+	/* #ifndef APP-NVUE */
+	.uni-noticebar__content-wrapper--scrollable {
+		position: relative;
+		height: 18px;
+	}
+	/* #endif */
+
+	.uni-noticebar__content--scrollable {
+		/* #ifdef APP-NVUE */
+		flex: 0;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		flex: 1;
+		display: block;
+		overflow: hidden;
+		/* #endif */
+	}
+
+	.uni-noticebar__content--single {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		flex: none;
+		width: 100%;
+		justify-content: center;
+		/* #endif */
+	}
+
+	.uni-noticebar__content-text {
+		font-size: 14px;
+		line-height: 18px;
+		/* #ifndef APP-NVUE */
+		word-break: break-all;
+		/* #endif */
+	}
+
+	.uni-noticebar__content-text--single {
+		/* #ifdef APP-NVUE */
+		lines: 1;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		display: block;
+		width: 100%;
+		white-space: nowrap;
+		/* #endif */
+		overflow: hidden;
+		text-overflow: ellipsis;
+	}
+
+	.uni-noticebar__content-text--scrollable {
+		/* #ifdef APP-NVUE */
+		lines: 1;
+		padding-left: 750rpx;
+		/* #endif */
+		/* #ifndef APP-NVUE */
+		position: absolute;
+		display: block;
+		height: 18px;
+		line-height: 18px;
+		white-space: nowrap;
+		padding-left: 100%;
+		animation: notice 10s 0s linear infinite both;
+		animation-play-state: paused;
+		/* #endif */
+	}
+
+	.uni-noticebar__more {
+		/* #ifndef APP-NVUE */
+		display: inline-flex;
+		/* #endif */
+		flex-direction: row;
+		flex-wrap: nowrap;
+		align-items: center;
+		padding-left: 5px;
+	}
+
+	.uni-noticebar__more-text {
+		font-size: 14px;
+	}
+
+	@keyframes notice {
+		100% {
+			transform: translate3d(-100%, 0, 0);
+		}
+	}
+</style>

+ 6 - 0
pages.json

@@ -501,6 +501,12 @@
 				"navigationBarTitleText": "创建订单"
 			}
 		},
+		{
+			"path": "pages/product/pingOrder",
+			"style": {
+				"navigationBarTitleText": "创建订单"
+			}
+		},
 		{
 			"path": "pages/index/article",
 			"style": {

+ 105 - 166
pages/assets/logroll.vue

@@ -7,80 +7,61 @@
 				<view class="main-title-font">互助说明</view>
 			</view>
 			<view class="main">
-				1234564654
-				<br />
-				12345489446534
-				<br />
-				2315648645156
-				<br />
-				156351648644
-				<br />
-				15448654848
-				<br />
-				15645614564186
-				<br />
-				156152348486
-				<br />
-				84546848646848
-				<br />
-				84546848646848
-				<br />
-				84546848646848
-				<br />
-				84546848646848
-				<br />
-				84546848646848
-				<br />
-				84546848646848
-			</view>
-		</view>
-		<view class="btn" @click="open()">加入互助</view>
-		<uni-popup ref="popup" type="center">
-			<view class="popup">
-				<view class="popup-dox">
-					<view class="popup-title">确认付款</view>
-					<view class="popup-little">请输入支付密码确认付款</view>
-				</view>
 				<view class="people-info">
 					<view class="info-font">收款人</view>
 					<view class="info-main">
 						<view class="info-left">
-							<view class="avtor"><image src="" mode=""></image></view>
-							<view class="left-font">
-								<view class="name">御风</view>
-								<view class="phone">13541202523</view>
+							<view class="avtor" v-if="info.next_checker"><image :src="info.next_checker.avatar" mode=""></image></view>
+							<view class="left-font" v-if="info.next_checker">
+								<view class="name clamp">{{ info.next_checker.nickname}}</view>
+								<view class="phone">{{ info.next_checker.phone }}</view>
 							</view>
 						</view>
-						<view class="info-right">
-							<view class="num">2000</view>
-							<view class="right-font">互助积分</view>
+						<view class="info-right" v-if="info.next_checker">
+							<view class="num">{{ info.my_last_join == null ? info.l1_money*1 : info.my_last_join == 1 ? info.l2_money*1 : info.l3_money*1 }}</view>
+							<view class="right-font">{{ info.my_last_join == null ? info.l1_money_type : info.my_last_join == 1 ? info.l2_money_type : info.l3_money_type}}</view>
 						</view>
 					</view>
 					<view class="pwd-box">
 						<view class="pwd-font">密码</view>
-						<view class="input"><input type="password" value="pwd" placeholder="请输入支付密码" placeholder-class="pwd-tip" /></view>
+						<view class="input"><input type="password" value="pwd" v-model="pwd" placeholder="请输入支付密码" placeholder-class="pwd-tip" /></view>
 					</view>
-					<view class="btn-box">确认</view>
 				</view>
 			</view>
-			<view class="close_icon" @click="close"><image src="../../static/img/Close.png"></image></view>
-		</uni-popup>
+		</view>
+		<view class="btn" @click="open()">加入互助</view>
 	</view>
 </template>
 
 <script>
+import { activityDetail,joinActivity } from '@/api/market.js'
 export default {
 	data() {
 		return {
-			pwd: ''
+			pwd: '',
+			info:{},
 		};
 	},
+	onLoad() {
+		this.loadData();
+	},
 	methods: {
 		open() {
-			this.$refs.popup.open();
+			if(this.pwd == ''){
+				this.$api.msg('密码不能为空');
+				return
+			}
+			joinActivity({trade_psw:this.pwd},1).then(e =>{
+				console.log(e)
+				this.$api.msg('参与互助成功');
+			}).catch(e =>{
+				console.log(e)
+			})
 		},
-		close() {
-			this.$refs.popup.close();
+		loadData(){
+			activityDetail({},1).then(e =>{
+				this.info =e.data
+			})
 		}
 	}
 };
@@ -171,142 +152,100 @@ export default {
 	font-weight: bold;
 	color: #030454;
 }
-.popup {
-	width: 540rpx;
-	background-color: #ffffff;
-	border-radius: 15rpx;
-	text-align: center;
-	padding-bottom: 50rpx;
-	.popup-dox {
-		padding-top: 84rpx;
+
+.people-info {
+	margin-top: 56rpx;
+	padding: 0 26rpx;
+	text-align: left;
+	.info-font {
+		font-size: 40rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #FFFFFF;
+	}
+	.info-main {
+		margin-top: 26rpx;
 		display: flex;
-		flex-direction: column;
+		justify-content: space-between;
 		align-items: center;
-		.popup-title {
-			font-size: 36rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-		}
-		.popup-little {
-			font-size: 24rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #808080;
-		}
-	}
-	.people-info {
-		margin-top: 56rpx;
-		padding: 0 26rpx;
-		text-align: left;
-		.info-font {
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #333333;
-		}
-		.info-main {
-			margin-top: 26rpx;
+		.info-left {
 			display: flex;
-			justify-content: space-between;
+			justify-content: flex-start;
 			align-items: center;
-			.info-left {
-				display: flex;
-				justify-content: flex-start;
-				align-items: center;
-				.avtor {
-					background: #007BFF;
-					width: 80rpx;
-					height: 80rpx;
+			.avtor {
+				width: 100rpx;
+				height: 100rpx;
+				border-radius: 50%;
+				image {
+					width: 100rpx;
+					height: 100rpx;
 					border-radius: 50%;
-					image {
-						width: 80rpx;
-						height: 80rpx;
-						border-radius: 50%;
-					}
-				}
-				.left-font {
-					margin-left: 10rpx;
-					.name {
-						font-size: 30rpx;
-						font-family: PingFang SC;
-						font-weight: 500;
-						color: #333333;
-					}
-					.phone {
-						font-size: 22rpx;
-						font-family: PingFang SC;
-						font-weight: 400;
-						color: #333333;
-						opacity: 0.8;
-					}
 				}
 			}
-			.info-right {
-				text-align: right;
-				line-height: 1;
-				.num {
-					font-size: 42rpx;
+			.left-font {
+				margin-left: 10rpx;
+				.name {
+					max-width: 300rpx;
+					font-size: 40rpx;
 					font-family: PingFang SC;
-					font-weight: bold;
-					color: #2E58FF;
+					font-weight: 500;
+					color: #FFFFFF;
 				}
-				.right-font {
-					font-size: 22rpx;
+				.phone {
+					font-size: 28rpx;
 					font-family: PingFang SC;
-					font-weight: 500;
-					color: #666666;
+					font-weight: 400;
+					color: #FFFFFF;
+					opacity: 0.8;
 				}
 			}
 		}
-	}
-	.pwd-box {
-		width: 490rpx;
-		background: #F4F4F4;
-		border-radius: 10rpx;
-		display: flex;
-		align-items: center;
-		justify-content: flex-start;
-		margin: 50rpx auto 0;
-		padding: 20rpx 20rpx;
-		.pwd-font {
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #333333;
-		}
-		.pwd-tip {
-			font-size: 28rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #999999;
-			opacity: 0.51;
-		}
-		.input {
-			margin-left: 20rpx;
+		.info-right {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			line-height: 1;
+			.num {
+				font-size: 54rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #FFFFFF;
+			}
+			.right-font {
+				margin-top: 10rpx;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #FFFFFF;
+			}
 		}
 	}
-	.btn-box {
-		margin:46rpx auto 0;
-		width: 460rpx;
-		height: 70rpx;
-		background: linear-gradient(0deg, #2E58FF, #32C6FF);
-		border-radius: 10rpx;
-		text-align: center;
-		line-height: 70rpx;
+}
+.pwd-box {
+	width: 490rpx;
+	background: #f4f4f4;
+	border-radius: 10rpx;
+	display: flex;
+	align-items: center;
+	justify-content: flex-start;
+	margin: 50rpx auto 0;
+	padding: 20rpx 20rpx;
+	.pwd-font {
+		font-size: 30rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #333333;
+	}
+	.pwd-tip {
 		font-size: 28rpx;
 		font-family: PingFang SC;
 		font-weight: 500;
-		color: #FFFFFF;
+		color: #999999;
+		opacity: 0.51;
 	}
-}
-.close_icon {
-	width: 60rpx;
-	height: 60rpx;
-	margin: 88rpx auto 0;
-	image {
-		width: 100%;
-		height: 100%;
+	.input {
+		margin-left: 20rpx;
+		color: #999999;
 	}
 }
 </style>

+ 28 - 33
pages/index/index.vue

@@ -22,23 +22,23 @@
 		</view>
 		<!-- 商品栏 -->
 		<view class="commodity">
-			<view class="commodity-item" v-for="(item, index) in commodityList">
+			<view class="commodity-item" v-for="(item, index) in commodityList" @click="navToDetailPages(item)">
 				<view class="commodity-prc">
-					<image src="" mode=""></image>
+					<image :src="item.image" mode=""></image>
 					<view class="fanli" v-if="item.type == 1">
 						<view class="fanli-bg"><image src="../../static/img/index-fanl.png" mode=""></image></view>
-						<view class="fanli-font flex">
+						<!-- <view class="fanli-font flex">
 							<view class="font-left">购物最高可返消费金额的</view>
 							<view class="font-right">10<text>%</text></view>
-						</view>
+						</view> -->
 					</view>
 				</view>
 				<view class="commodity-info">
-					<view class="commodity-name clamp">{{ item.name }}</view>
+					<view class="commodity-name clamp">{{ item.store_name }}</view>
 					<view class="commodity-systom clamp">{{ item.systom }}</view>
 					<view class="commodity-price">
 						¥{{ item.price }}
-						<text>¥{{ item.price }}</text>
+						<text>¥{{ item.ot_price }}</text>
 					</view>
 				</view>
 			</view>
@@ -46,7 +46,6 @@
 	</view>
 </template>
 <script>
-import { lala, lalaDetial, buylala } from '@/api/product.js';
 import { getTime } from '@/utils/rocessor.js';
 import { loadIndexs } from '@/api/user.js';
 import { saveUrl,interceptor } from '@/utils/loginUtils.js';
@@ -112,32 +111,7 @@ export default {
 			],
 			swiperLength: 0,
 			swiperCurrent: 0,
-			commodityList: [
-				{
-					name: '古驰马衔扣单肩包',
-					systom: '1955系列单肩包女包',
-					price: '2690.32',
-					type: 1
-				},
-				{
-					name: '古驰马衔扣单肩包',
-					systom: '1955系列单肩包女包',
-					price: '2690',
-					type: 0
-				},
-				{
-					name: '古驰马衔扣单肩包',
-					systom: '1955系列单肩包女包',
-					price: '2690',
-					type: 0
-				},
-				{
-					name: '古驰马衔扣单肩包',
-					systom: '1955系列单肩包女包',
-					price: '2690',
-					type: 1
-				}
-			]
+			commodityList: []
 		};
 	},
 	//页面加载即刻发生
@@ -151,6 +125,7 @@ export default {
 				console.log(data);
 				obj.carouselList = data.banner;
 				obj.swiperLength = data.banner.length;
+				obj.commodityList = data.likeInfo;
 			});
 		},
 		//轮播图切换修改背景色
@@ -158,6 +133,26 @@ export default {
 			const index = e.detail.current;
 			this.swiperCurrent = index;
 		},
+		navToDetailPages(e) {
+			if (!this.hasLogin) {
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						if (e.confirm) {
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+				return;
+			}
+			uni.navigateTo({
+				url: '/pages/product/product?id=' + e.id
+			});
+		},
 		nav(url){
 			if (!this.hasLogin) {
 				uni.showModal({

+ 14 - 55
pages/market/details.vue

@@ -1,14 +1,14 @@
 <template>
 	<view class="center">
-		<view class="top"><image src="" mode=""></image></view>
+		<view class="top"><image :src="list.logo" mode=""></image></view>
 		<view class="name-box">
 			<view class="price-box">
 				兑换价:
-				<text class="price">9800</text>
-				<text class="unit">拼团积分</text>
-				<text class="yuan">¥229</text>
+				<text class="price">{{price * 1}}</text>
+				<text class="unit">{{ list.cost_money_type}}</text>
+				<!-- <text class="yuan">¥229</text> -->
 			</view>
-			<view class="name clamp">拼购IPFS服务器 紫盘 4TB 移动监控服务器</view>
+			<view class="name clamp">{{list.name}}</view>
 		</view>
 		<view class="tip-box">
 			<view class="tip-titele">兑换须知</view>
@@ -18,7 +18,7 @@
 			<view class="detail-title">
 				商品详情
 			</view>
-			<view class="systom">
+			<view class="systom" v-html="list.detail">
 				
 			</view>
 		</view>
@@ -28,7 +28,7 @@
 	</view>
 </template>
 <script>
-import { miningDateils, buyMining } from '@/api/market.js';
+import { miningDateils } from '@/api/market.js';
 import uniNumberBox from '@/components/uni-number-box.vue';
 export default {
 	components: {
@@ -51,6 +51,7 @@ export default {
 	onLoad(option) {
 		this.id = option.id;
 		this.type = option.type;
+		this.loadData();
 	},
 
 	computed: {
@@ -70,56 +71,11 @@ export default {
 				console.log(obj.list);
 			});
 		},
-		//阅读并同意
-		Getcheckbox() {
-			let obj = this;
-			obj.checked = !obj.checked;
-		},
 		ToIndex() {
 			uni.navigateTo({
 				url: '/pages/finance/xieyi'
 			});
 		},
-		pay() {
-			let obj = this;
-			if (obj.password == '') {
-				obj.$api.msg('请输入交易密码!');
-				return;
-			}
-			if (obj.checked == false) {
-				obj.$api.msg('请阅读并同意协议!');
-				return;
-			}
-			buyMining(
-				{
-					num: obj.num * obj.step,
-					trade_psw: obj.password
-				},
-				obj.id
-			)
-				.then(data => {
-					obj.$api.msg(data.msg);
-					obj.password = '';
-					obj.num = 1;
-				})
-				.catch(e => {
-					obj.password = '';
-					obj.num = 1;
-					if (e.msg == '交易密码错误') {
-						return;
-					}
-					console.log(e);
-					var reg = new RegExp('购买矿机所需的');
-					if (e.msg.match(reg) == -1) {
-					} else {
-						setTimeout(function() {
-							uni.navigateTo({
-								url: '/pages/finance/recharge'
-							});
-						}, 1000);
-					}
-				});
-		},
 		numberChange(data) {
 			let obj = this;
 			obj.num = data.number;
@@ -136,8 +92,8 @@ export default {
 			this.current = index;
 		},
 		back() {
-			uni.navigateBack({
-				url: '/pages/calculation/buyCalculation'
+			uni.navigateTo({
+				url: '/pages/market/pay?&id=' + this.id + '&type=' + this.type
 			});
 		}
 	}
@@ -151,9 +107,12 @@ page,
 	height: 100%;
 }
 .top {
-	background: #45969B;
 	width: 750rpx;
 	height: 710rpx;
+	image {
+		width: 100%;
+		height: 100%;
+	}
 }
 .name-box {
 	padding: 30rpx 26rpx;

+ 37 - 12
pages/market/market.vue

@@ -20,17 +20,17 @@
 				<image src="../../static/icon/f-r.png" mode=""></image>
 			</view>
 			<view class="main-box">
-				<view class="main-item" v-for="(item, index) in 10" :key="index">
-					<view class="item-bg"><image src="" mode=""></image></view>
+				<view class="main-item" v-for="(item, index) in list" :key="index">
+					<view class="item-bg"><image :src="item.logo" mode=""></image></view>
 					<view class="item-info">
-						<view class="item-name">拼购IPFS服务器</view>
-						<view class="item-tip">合约周期:1080天+180天</view>
-						<view class="item-tip">有效空间:1T</view>
+						<view class="item-name">{{ item.name }}</view>
+						<view class="item-tip">合约周期:{{ item.first_step_time + item.second_step_time }}天 + {{ item.third_step_time }}天</view>
+						<view class="item-tip">有效空间:{{ item.step }}T</view>
 						<view class="price">
-							9800
-							<text>拼团积分</text>
+							{{ item.cost_money*1 }}
+							<text>{{ item.cost_money_type}}</text>
 						</view>
-						<view class="btn" @click="go()">立即兑换</view>
+						<view class="btn" @click="go(item)">立即兑换</view>
 					</view>
 				</view>
 			</view>
@@ -38,7 +38,7 @@
 	</view>
 </template>
 <script>
-import { mining, buyMining } from '@/api/market.js';
+import { mining } from '@/api/market.js';
 import { wallet } from '@/api/finance.js';
 export default {
 	data() {
@@ -51,11 +51,12 @@ export default {
 			num: ''
 		};
 	},
-	onLoad(option) {},
+	onLoad(option) {
+		this.loadData();
+	},
 	onShow() {},
 	//下拉刷新
 	onPullDownRefresh() {
-		this.moneyType();
 	},
 	methods: {
 		nav(url) {
@@ -74,6 +75,31 @@ export default {
 				
 			})
 		},
+		// 请求载入数据
+		async loadData() {
+			let obj = this;
+			uni.showLoading({
+				title: '加载中...'
+			});
+			mining({
+				page: 1,
+				limit: 1000
+			}).then(({ data }) => {
+				uni.hideLoading();
+				console.log(data.data, '9999999999999999999999999999999999');
+				obj.list = data.data.map(e => {
+					e.step = +e.step;
+					e._cost_money = +e._cost_money.replace(e.cost_money_type, '') + e.cost_money_type;
+					return e;
+				});
+				console.log(obj.list, 'obj.list++++++++++++');
+			});
+		},
+		go(ls) {
+			uni.navigateTo({
+				url: '/pages/market/details?id=' + ls.id + '&type=' + ls.type
+			});
+		}
 	}
 };
 </script>
@@ -204,7 +230,6 @@ page {
 			display: flex;
 			justify-content: flex-start;
 			.item-bg {
-				background: #82848A;
 				width: 260rpx;
 				height: 260rpx;
 				flex-shrink: 0;

+ 1 - 1
pages/money/pay.vue

@@ -35,7 +35,7 @@
 
 <script>
 import { balance } from '@/api/wallet.js';
-// import { createOrderkey,computedOrderkey,orderPay } from '@/api/order.js';
+import { createOrderkey,computedOrderkey,orderPay } from '@/api/order.js';
 import { mapState } from 'vuex';
 export default {
 	data() {

+ 10 - 13
pages/order/createOrder.vue

@@ -1,9 +1,6 @@
 <template>
 	<view>
-		
-
-		<!-- 地址 -->
-		<navigator v-if="tabCurrentIndex == 0" url="/pages/set/address?source=1" class="address-section">
+		<navigator v-if="tabCurrentIndex == 0" url="/pages/address/address?source=1" class="address-section">
 			<view class="order-content" v-if="addressData.real_name">
 				<text class="iconfont iconlocation"></text>
 				<view class="cen">
@@ -273,15 +270,15 @@ export default {
 			this.couponChecked = item;
 			this.payMoneyNub();
 		},
-		// 加载优惠券列表
-		couponsOrder(money) {
-			couponsOrder({}, money).then(e => {
-				if (e.data.length > 0) {
-					this.couponListshow = true;
-				}
-				this.couponList = e.data;
-			});
-		},
+		// // 加载优惠券列表
+		// couponsOrder(money) {
+		// 	couponsOrder({}, money).then(e => {
+		// 		if (e.data.length > 0) {
+		// 			this.couponListshow = true;
+		// 		}
+		// 		this.couponList = e.data;
+		// 	});
+		// },
 		//顶部tab点击
 		tabClick(index) {
 			this.tabCurrentIndex = index;

+ 22 - 25
pages/product/ping.vue

@@ -2,8 +2,8 @@
 	<view class="center">
 		<image class="logo-img" src="../../static/img/img01.png"></image>
 		<view class="goods-list">
-			<view v-for="(item, index) in 2" :key="index" class="guess-item" @click="navToDetailPage(item)">
-				<image src=""></image>
+			<view v-for="(item, index) in producList" :key="index" class="guess-item">
+				<image :src="item.background_image"></image>
 				<view class="guess-box">
 					<view class="title clamp2">
 						<view class="tuanF">
@@ -12,15 +12,13 @@
 								<view class="tuan-font">11人团1人中</view>
 							</view>
 						</view>
-						西部数据 紫盘 4TB 移动监控硬盘...
+						{{ item.name }}
 					</view>
 					<view class="price-box flex">
-						<view class="yuanprice">105</view>
-						<image src="../../static/img/down.png" mode=""></image>
-						<view class="jiang">直降40元</view>
+						<view class="jiang">门票费:{{item.ticket}} {{item.ticket_money_type}}</view>
 					</view>
-					<view class="price">¥65</view>
-					<view class="btn">马上拼</view>
+					<view class="price">{{ item.cost_money_type === item.cost_2_money_type? item.cost*1+item.cost_money_type : item.cost*1+item.cost_money_type + '/' +item.cost_2*1 + item.cost_2_money_type}}</view>
+					<view class="btn" @click="navToDetailPage(item)">马上拼</view>
 				</view>
 			</view>
 		</view>
@@ -28,17 +26,27 @@
 </template>
 
 <script>
+import { lala, lalaDetial } from '@/api/product.js';
 export default {
 	data() {
 		return {
 			producList: []
 		};
 	},
+	onLoad() {
+		this.loadData();
+	},
 	methods: {
-		navToDetailPage(item){
+		navToDetailPage(item) {
 			uni.navigateTo({
-				url:'/pages/product/pingDetails'
-			})
+				url: '/pages/product/pingDetails?id=' + item.id
+			});
+		},
+		loadData() {
+			lala({}).then(({data}) => {
+				console.log(data,'123456');
+				this.producList = data.list.data
+			});
 		}
 	}
 };
@@ -93,6 +101,7 @@ page {
 					margin-right: 4rpx;
 					position: relative;
 					top: -6rpx;
+					line-height: 1;
 					.tuan {
 						display: flex;
 						align-items: center;
@@ -117,20 +126,8 @@ page {
 			}
 
 			.price-box {
-				margin-top: 88rpx;
+				margin-top: 70rpx;
 				justify-content: flex-start;
-				.yuanprice {
-					font-size: 26rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					text-decoration: line-through;
-					color: #999999;
-					padding-right: 6rpx;
-				}
-				image {
-					width: 14rpx;
-					height: 16rpx;
-				}
 				.jiang {
 					padding-left: 2rpx;
 					font-size: 24rpx;
@@ -153,7 +150,7 @@ page {
 				font-size: 28rpx;
 				font-family: PingFang SC;
 				font-weight: 500;
-				color: #FFFFFF;
+				color: #ffffff;
 				line-height: 56rpx;
 				text-align: center;
 				position: absolute;

+ 60 - 93
pages/product/pingDetails.vue

@@ -1,33 +1,39 @@
 <template>
 	<view class="center">
-		<view class="top"><image src="" mode=""></image></view>
+		<view class="top"><image :src="list.data.background_image" mode=""></image></view>
 		<view class="name-box">
 			<view class="price-box">
-				
-				¥
-				<text class="price">9800</text>
-				<text class="yuan">¥229</text>
+				<text class="price">
+					{{
+						list.data.cost_money_type === list.data.cost_2_money_type
+							? list.data.cost * 1 + list.data.cost_money_type
+							: list.data.cost * 1 + list.data.cost_money_type + '/' + list.data.cost_2 * 1 + list.data.cost_2_money_type
+					}}
+				</text>
+				<!-- <text class="yuan">¥229</text> -->
 			</view>
-			<view class="name clamp">西部数据 紫盘 4TB 移动监控硬盘</view>
+			<view class="name clamp">{{ list.data.name }}</view>
 			<view class="info">
-				<view class="info-item">
-					快递:¥0.00
-				</view>
-				<view class="info-item">
-					销量:56件
-				</view>
-				<view class="info-item">
-					浙江省台州市
-				</view>
+				<view class="info-item">门票:{{ list.data.ticket * 1 }}{{ list.data.ticket_money_type }}</view>
+				<view class="info-item">销量:56件</view>
+				<view class="info-item">浙江省台州市</view>
 			</view>
 		</view>
 		<view class="tip-box">
 			<view class="tip-titele">拼团玩法</view>
-			<view class="tip-main">开团/参团-邀请好友-满员开团-拼中发货</view>
+			<view class="tip-main">开团/参团-满员开团-拼中发货</view>
 		</view>
 		<view class="tip-box">
 			<view class="tip-titele">拼团须知</view>
-			<view class="tip-main">开团玩法详细介绍开团玩法详细介绍开团 玩法详细介绍开团玩法详细介绍开团玩法 详细介绍开团玩法详细介绍</view>
+			<view class="tip-main">
+				本轮预约开始时间:{{ list.start }}
+				<br />
+				本轮预约结束时间:{{ list.end }}
+				<br />
+				本轮开奖时间:{{ list.next_pink.name }}
+				<br />
+				下轮预约开始时间:{{ list.next_pink.name }}
+			</view>
 		</view>
 		<view class="detail">
 			<view class="detail-title">商品详情</view>
@@ -37,7 +43,8 @@
 	</view>
 </template>
 <script>
-import { miningDateils, buyMining } from '@/api/market.js';
+import { lalaDetial } from '@/api/product.js';
+import { getTime } from '@/utils/rocessor.js';
 import uniNumberBox from '@/components/uni-number-box.vue';
 export default {
 	components: {
@@ -46,20 +53,12 @@ export default {
 	data() {
 		return {
 			id: '',
-			type: '',
-			num: 1,
-			step: 0,
-			password: '',
-
-			price: '',
-			list: {},
-			checked: false,
-			current: 0
+			list: {}
 		};
 	},
 	onLoad(option) {
 		this.id = option.id;
-		this.type = option.type;
+		this.loadData();
 	},
 
 	computed: {
@@ -71,83 +70,48 @@ export default {
 	methods: {
 		async loadData() {
 			let obj = this;
-			miningDateils({}, obj.id).then(({ data }) => {
+			lalaDetial({}, obj.id).then(({ data }) => {
 				obj.list = data;
-				// obj.money = obj.list.cost_money;
-				obj.price = obj.list.cost_money;
-				obj.step = obj.list.step;
+				obj.list.end = getTime(data.next_pink.value - data.close_join * 60);
+				//当前时间
+				for (let i = 0; i < data.open_times.length; i++) {
+					//拼团开始时间
+					if (data.open_times[i].value == data.next_pink.value) {
+						if (i != 0) {
+							let j = i - 1;
+							obj.list.start = getTime(data.open_times[j].value);
+						} else {
+							let date = data.open_times[0].name.split(' ');
+							let start = date[0] + ' ' + data.lala_pink_open + ':00';
+							start = new Date(start);
+							start = start.getTime();
+							obj.list.start = getTime(start);
+						}
+					}
+				}
 				console.log(obj.list);
 			});
 		},
-		//阅读并同意
-		Getcheckbox() {
-			let obj = this;
-			obj.checked = !obj.checked;
-		},
-		ToIndex() {
-			uni.navigateTo({
-				url: '/pages/finance/xieyi'
-			});
-		},
-		pay() {
-			let obj = this;
-			if (obj.password == '') {
-				obj.$api.msg('请输入交易密码!');
+		buy() {
+			//当前时间
+			let dateTime = new Date().valueOf();
+			let start = new Date(this.list.start).valueOf();
+			let end = new Date(this.list.end).valueOf();
+			console.log(dateTime, start, end);
+			if(dateTime < start){
+				this.$api.msg('当前场次还未开始');
 				return;
 			}
-			if (obj.checked == false) {
-				obj.$api.msg('请阅读并同意协议!');
+			if(dateTime > end){
+				this.$api.msg('当前场次已经结束,请等待下一场');
 				return;
 			}
-			buyMining(
-				{
-					num: obj.num * obj.step,
-					trade_psw: obj.password
-				},
-				obj.id
-			)
-				.then(data => {
-					obj.$api.msg(data.msg);
-					obj.password = '';
-					obj.num = 1;
-				})
-				.catch(e => {
-					obj.password = '';
-					obj.num = 1;
-					if (e.msg == '交易密码错误') {
-						return;
-					}
-					console.log(e);
-					var reg = new RegExp('购买矿机所需的');
-					if (e.msg.match(reg) == -1) {
-					} else {
-						setTimeout(function() {
-							uni.navigateTo({
-								url: '/pages/finance/recharge'
-							});
-						}, 1000);
-					}
-				});
-		},
-		numberChange(data) {
-			let obj = this;
-			obj.num = data.number;
-		},
-		buy() {
-			// let list = JSON.stringify(this.list)
 			uni.navigateTo({
-				url: '/pages/order/createOrder'
+				url: '/pages/product/pingOrder?id=' + this.id
 			});
-			// console.log(this.list,'--------------***********')
-			// console.log('buy click')
 		},
 		changeCurrent(index) {
 			this.current = index;
-		},
-		back() {
-			uni.navigateBack({
-				url: '/pages/calculation/buyCalculation'
-			});
 		}
 	}
 };
@@ -160,9 +124,12 @@ page,
 	height: 100%;
 }
 .top {
-	background: #45969b;
 	width: 750rpx;
 	height: 710rpx;
+	image {
+		width: 100%;
+		height: 100%;
+	}
 }
 .name-box {
 	padding: 30rpx 26rpx;

Разница между файлами не показана из-за своего большого размера
+ 113 - 0
pages/product/pingOrder.vue


Разница между файлами не показана из-за своего большого размера
+ 277 - 689
pages/product/product.vue


BIN
static/icon/del.png


Некоторые файлы не были показаны из-за большого количества измененных файлов