lhl há 2 anos atrás
pai
commit
735d63f705

+ 20 - 1
api/index.js

@@ -134,4 +134,23 @@ export function createSignFLow(data) {
 		method: 'post',
 		data
 	});
-}
+}
+//我的活动
+export function record(data) {
+	return request({
+		url: '/api/article/record',
+		method: 'get',
+		data
+	});
+}
+
+//活动报名
+export function joinAction(data) {
+	return request({
+		url: '/api/article/apply',
+		method: 'post',
+		data
+	});
+}
+
+

+ 12 - 0
pages.json

@@ -199,6 +199,18 @@
 						"navigationBarTitleText": "图片裁切"
 					}
 				},
+				{
+					"path": "myAction",
+					"style": {
+						"navigationBarTitleText": "我的活动"
+					}
+				},
+				{
+					"path": "actionList",
+					"style": {
+						"navigationBarTitleText": "活动列表"
+					}
+				},
 				{
 					"path": "myteam",
 					"style": {

+ 34 - 6
pages/shop/action.vue

@@ -1,6 +1,7 @@
 <template>
     <view class="content">
 		<image :src="actionImg" mode="widthFix" class="action-img"></image>
+		
 		<view class="action-wrap">
 			<image src="../../static/image/action-top.png" mode="" class="action-top"></image>
 			<view class="">
@@ -12,15 +13,24 @@
 				上传照片
 			</view>
 		</view>
+		<view class="notice-item">
+			<view class="" v-html="content">
+				
+			</view>
+		</view>
+		
     </view>
 </template>
 <script>
 	import { upload } from '@/api/order.js'
+	import { details,joinAction } from '@/api/index.js'
 export default {
     data() {
         return {
+			content: '',
 			upimg: '',
-			loading:false
+			loading:false,
+			id: ''
         };
     },
 	computed: {
@@ -29,7 +39,10 @@ export default {
 		}
 	},
     onLoad(opt) {
-
+		if(opt.id ) {
+			this.id = opt.id
+			this.details(opt.id) 
+		}
     },
     onShow() {
 
@@ -38,6 +51,15 @@ export default {
 
     },
     methods: {
+		details(id) {
+			details({},id).then(res => {
+				console.log(res);
+				this.content = res.data.content
+				if(this.content != null){
+					this.content = this.content.replace(/<img/g,"<img style='max-width:100%;height:auto;'");
+				}//小程序商品详情图超出屏幕问题
+			}) 
+		},
 		upActionImg() {
 			upload().then(res => {
 				this.upimg = res[0].url
@@ -48,11 +70,12 @@ export default {
 				return
 			}
 			if(this.upimg == '') {
-				this.$api.msg('请上传合影照片')
+				return this.$api.msg('请上传合影照片')
 			}
 			this.loading = true
 			joinAction({
-				img: this.upimg
+				aid: this.id,
+				up_file: this.upimg
 			}).then(res => {
 				this.loading = false
 				uni.showToast({
@@ -80,7 +103,7 @@ export default {
 }
 .action-wrap {
 	width: 690rpx;
-	margin:50rpx auto 0;
+	margin:50rpx auto 20rpx;
 	// height: 560rpx;
 	background-color: #dcf4ef;
 	border-radius: 20rpx;
@@ -119,5 +142,10 @@ export default {
 		margin: auto;
 	}
 }
-
+.notice-item {
+	width: 100%;
+	height: 100%;
+	padding: 35rpx 35rpx;
+	padding-bottom: 30rpx;
+}
 </style>

+ 11 - 5
pages/shop/rent.vue

@@ -331,6 +331,7 @@
 				payType: 'yue',
 				sm: '', //使用说明
 				loading: false, //是否支付中
+				renew: 0,//是否续费
 			}
 		},
 		computed: {
@@ -344,7 +345,10 @@
 				return  this.isdk && this.dkQrcodeUrl
 			},
 		},
-		onLoad() {
+		onLoad(opt) {
+			if(opt.renew) {
+				this.renew = opt.renew
+			}
 			this.getRents()
 			this.getSm()
 		},
@@ -669,11 +673,12 @@
 				this.selectTc = item
 			},
 			getRents() {
+				let that = this
 				getRents({
-					store_id: this.selctStore.id
+					store_id: that.is_tj ? that.userinfo.store_id : that.selctStore.id
 				}).then(res => {
-					this.tcList = res.data.rent
-					this.selectTc = this.tcList[0]
+					that.tcList = res.data.rent
+					that.selectTc = that.tcList[0]
 				})
 			},
 			paySuccessTo() {
@@ -709,7 +714,8 @@
 					// #ifdef APP-PLUS
 					from: 'app', //来源
 					// #endif
-					pay_type: that.isdk ? 'pxz' : that.payType //支付方式
+					pay_type: that.isdk ? 'pxz' : that.payType, //支付方式
+					renew: that.renew
 				}).then(({
 					data,
 					status,

+ 30 - 0
pages/user/user.vue

@@ -79,6 +79,36 @@
 								<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
 							</view>
 						</view>
+						<view class="flex listItem" @click="navTo('/pages/user_home/actionList')">
+							<view class="flex titleBox">
+								<image class="listIconImg" src="../../static/icon/actiont.png" mode="widthFix"></image>
+								<text class="title">活动</text>
+							</view>
+							<view class="right flex">
+								<text></text>
+								<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
+							</view>
+						</view>
+						<view class="flex listItem" @click="navTo('/pages/user_home/myAction')">
+							<view class="flex titleBox">
+								<image class="listIconImg" src="../../static/icon/myaction.png" mode="widthFix"></image>
+								<text class="title">我的活动</text>
+							</view>
+							<view class="right flex">
+								<text></text>
+								<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
+							</view>
+						</view>
+						<!-- <view class="flex listItem" @click="navTo('/pages/user_home/myAction')">
+							<view class="flex titleBox">
+								<image class="listIconImg" src="../../static/icon/htong.png" mode="widthFix"></image>
+								<text class="title">下载合同</text>
+							</view>
+							<view class="right flex">
+								<text></text>
+								<image class="img" src="../../static/icon/next1.png" mode="widthFix"></image>
+							</view>
+						</view> -->
 						<view class="flex listItem" @click="smsh" v-if="userInfo && userInfo.adminid == 1">
 							<view class="flex titleBox">
 								<image class="listIconImg" src="../../static/icon/userhx.png" mode="widthFix"></image>

+ 102 - 0
pages/user_home/actionList.vue

@@ -0,0 +1,102 @@
+<template>
+	<view class="content">
+		<empty v-if="loaded && list.length == 0"></empty>
+		<view class="action" v-for="item in list" @click="goAction(item)">
+			<image :src="item.image_input[0]" mode="" class="action-img"></image>
+			<view class="action-tit">
+				{{item.title}}
+			</view>
+		</view>
+		<uni-load-more :status="loadingType"></uni-load-more>
+	</view>
+</template>
+<script>
+	import {
+		articleList,
+		record,
+	} from '@/api/index.js'
+	export default {
+		data() {
+			return {
+				page: 1,
+				limit: 10,
+				list: [],
+				loadingType: 'more',
+				loaded: false,
+				type: 0,
+			};
+		},
+		onLoad(opt) {
+			if(opt.type) {
+				this.type = opt.type
+			}
+		},
+		onShow() {
+			this.getActionList()
+		},
+		onReachBottom() {
+
+		},
+		methods: {
+			goAction(item) {
+				if(this.type == 0) {
+					uni.navigateTo({
+						url: '/pages/shop/action?id=' + item.id
+					})
+				}
+				
+			},
+			getActionList() {
+				if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
+					return
+				}
+				this.loadingType = 'more'
+				articleList({
+					page: this.page,
+					limit: this.limit
+				},2).then(res => {
+					this.list = this.list.concat(res.data)
+					this.page++
+					if (res.data.lengt == this.limit) {
+						this.loadingType = 'more'
+					} else {
+						this.loadingType = 'noMore'
+					}
+					this.loaded = true
+				})
+			}
+		}
+	};
+</script>
+<style lang="scss" scoped>
+	page {
+		background-color: #f2f2f2;
+		height: auto;
+		min-height: 100%;
+	}
+
+	.action {
+		width: 700rpx;
+		margin: 25rpx auto;
+		border-radius: 35rpx;
+		overflow: hidden;
+		background-color: #fff;
+
+		.action-img {
+			width: 700rpx;
+			height: 300rpx;
+			background-color: #333;
+		}
+
+		.action-tit {
+			min-height: 100rpx;
+			font-size: 34rpx;
+			font-weight: 500;
+			color: #0E0E0E;
+			display: flex;
+			align-items: center;
+			padding: 15rpx;
+			padding-left: 30rpx;
+		}
+	}
+</style>

+ 102 - 0
pages/user_home/myAction.vue

@@ -0,0 +1,102 @@
+<template>
+	<view class="content">
+		<empty v-if="loaded && list.length == 0"></empty>
+		<view class="action" v-for="item in list" @click="goAction(item)">
+			<image :src="item.image_input[0]" mode="" class="action-img"></image>
+			<view class="action-tit">
+				{{item.title}}
+			</view>
+		</view>
+		<uni-load-more :status="loadingType"></uni-load-more>
+	</view>
+</template>
+<script>
+	import {
+		articleList,
+		record,
+	} from '@/api/index.js'
+	export default {
+		data() {
+			return {
+				page: 1,
+				limit: 10,
+				list: [],
+				loadingType: 'more',
+				loaded: false,
+				type: 0,
+			};
+		},
+		onLoad(opt) {
+			if(opt.type) {
+				this.type = opt.type
+			}
+		},
+		onShow() {
+			this.getActionList()
+		},
+		onReachBottom() {
+
+		},
+		methods: {
+			goAction(item) {
+				if(this.type == 0) {
+					uni.navigateTo({
+						url: '/pages/shop/action?id=' + item.id
+					})
+				}
+				
+			},
+			getActionList() {
+				if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
+					return
+				}
+				this.loadingType = 'more'
+				record({
+					page: this.page,
+					limit: this.limit
+				}).then(res => {
+					this.list = this.list.concat(res.data.data)
+					this.page++
+					if (res.data.data.lengt == this.limit) {
+						this.loadingType = 'more'
+					} else {
+						this.loadingType = 'noMore'
+					}
+					this.loaded = true
+				})
+			}
+		}
+	};
+</script>
+<style lang="scss" scoped>
+	page {
+		background-color: #f2f2f2;
+		height: auto;
+		min-height: 100%;
+	}
+
+	.action {
+		width: 700rpx;
+		margin: 25rpx auto;
+		border-radius: 35rpx;
+		overflow: hidden;
+		background-color: #fff;
+
+		.action-img {
+			width: 700rpx;
+			height: 300rpx;
+			background-color: #333;
+		}
+
+		.action-tit {
+			min-height: 100rpx;
+			font-size: 34rpx;
+			font-weight: 500;
+			color: #0E0E0E;
+			display: flex;
+			align-items: center;
+			padding: 15rpx;
+			padding-left: 30rpx;
+		}
+	}
+</style>

+ 19 - 7
pages/user_home/myRent.vue

@@ -1,10 +1,12 @@
 <template>
 	<view class="content">
-		<view class="top-tit" v-if="dqtime">
+		<view class="top-tit flex" v-if="dqtime">
 			<view class="tit">
 				电池到期时间: {{dqtime}}
 			</view>
-			
+			<view class="xf" @click="xf">
+				立即续费
+			</view>
 		</view>
 		<view v-for="(item, index) in list" :key="index" class="order-item">
 			<view class="i-top b-b">
@@ -31,8 +33,8 @@
 			<view class="action-box b-t">
 				<button v-if="item.status == 1" class="action-btn btn-base"
 					@click.stop="navTo('/pages/order/hxqm?id=' + item.verify_code + '&type=2' + '&dcode=' + userInfo.battery_number)">出示券码</button>
-<!-- 				<button v-if="item.status == 2" class="action-btn btn-base"
-					@click.stop="navTo('/pages/order/hxqm?id=' + item.verify_code + '&type=2')">续费</button> -->
+				<!-- <button v-if="item.status == 2" class="action-btn btn-base"
+					@click.stop="xf(item)">续费</button> -->
 			</view>
 		</view>
 
@@ -71,10 +73,16 @@
 		computed: {
 			...mapState('user',['userInfo']),
 			dqtime() {
-				return this.userInfo.battery_end_time?getTime(): ''
+				return this.userInfo.battery_end_time?getTime(this.userInfo.battery_end_time): ''
 			}
 		},
 		methods: {
+			xf() {
+				// console.log(item);
+				uni.navigateTo({
+					url: '/pages/shop/rent?renow=1'
+				})
+			},
 			navTo(url) {
 				uni.navigateTo({
 					url,
@@ -329,13 +337,17 @@
 	}
 	.top-tit {
 		width: 750rpx;
-		background-color: #fff;
+		background-color:rgba(108, 217, 192, 0.4);
 		padding: 10rpx;
 		.tit {
 			font-size: 28rpx;
-			background-color:rgba(108, 217, 192, 0.4);
+			
 			border-radius: 5rpx;
 			padding: 10rpx;
 		}
+		.xf {
+			font-size: 32rpx;
+			padding-right: 30rpx;
+		}
 	}
 </style>

BIN
static/icon/actiont.png


BIN
static/icon/htong.png


BIN
static/icon/myaction.png