瀏覽代碼

Merge remote-tracking branch 'origin/master'

hmp 4 年之前
父節點
當前提交
133087cbf6
共有 7 個文件被更改,包括 69 次插入29 次删除
  1. 2 2
      assets/http/service.js
  2. 20 9
      components/alert/votePopup.vue
  3. 1 1
      pages.json
  4. 9 1
      pages/index/home.vue
  5. 7 1
      pages/index/index.vue
  6. 30 15
      pages/rank/rank.vue
  7. 二進制
      static/icon/selected.png

+ 2 - 2
assets/http/service.js

@@ -1,7 +1,7 @@
 import Request from 'luch-request'
 
-// let baseURL = 'http://192.168.1.91:2888'
-let baseURL = 'http://192.168.1.168:2888'
+let baseURL = 'http://192.168.1.91:2888'
+// let baseURL = 'http://192.168.1.168:2888'
 
 let tokenUrl = baseURL +
 	"/blade-auth/oauth/token?tenantId=000000&password=21232f297a57a5a743894a0e4a801fc3&username=admin"

+ 20 - 9
components/alert/votePopup.vue

@@ -3,7 +3,8 @@
 		<view class="padding-30">
 			<view class="padding-top-20 text-bold text-xl">投票助力</view>
 			<view class="padding-top-10 padding-bottom-10" style="color: #888888;font-size: 22rpx;" >
-				中国移动用户可使用移动积分兑换活力道具,兑换后可获得移动为你发起2人助力和10个普法积分(可用于积分商城兑换商品),快为喜爱的作品加油助力吧
+				中国移动用户可使用移动积分兑换活力道具,兑换后可获得移动为你发起{{gitfs[selected].activeVote}}
+				人助力和{{vuex_active_setting.voteAndPointRate*gitfs[selected].activeVote}}个普法积分(可用于积分商城兑换商品),快为喜爱的作品加油助力吧
 			</view>
 			<scroll-view style="white-space: nowrap;" :scroll-x="true">
 				<view v-for="(item,index) in gitfs" class="gift-item">
@@ -19,7 +20,7 @@
 				<view class="text-center padding-bottom-20" style="color: #0A9FEF;">您目前的移动积分</view>
 				<view class="button-bar">
 					<view class="button-r">
-						<u-count-to color="#E72226" start-val="0" :end-val="count" :duration="500"></u-count-to>
+						<u-count-to v-if="show" color="#E72226" start-val="0" :end-val="gitfs[selected].point" :duration="500"></u-count-to>
 						 <span class="info">移动积分</span>
 					 </view>
 					<view class="button-f">点击投票</view>
@@ -34,17 +35,17 @@
 		name:"votePopup",
 		data() {
 			return {
-				show: true,
+				show: false,
 				selected: 0,
 				count: 1000,
-				gitfs: [1,1,1,1,1,1,1,1,1],
+				gitfs: [],
 			};
 		},
 		
 		methods: {
 			async showVote(){
-				// const res = await this.$api.activity.getGiftList({current: 1,size: 99});
-				// this.gitfs = res.data.data.records;
+				const res = await this.$api.activity.getGiftList({current: 1,size: 99});
+				this.gitfs = res.data.data.records;
 				this.show = true;
 			},
 			hideVote(){
@@ -74,11 +75,21 @@
 			height: 100rpx;
 			border: 1rpx dashed #DDDDDD;
 			padding: 10rpx;
-			transition: all;
+			transition: border 0.5s;
+			border: 0 solid transparent;
 		}
 		.selected{
-			border: 2rpx solid red;
-			background: red;
+			border: 2rpx solid #E72226;
+		}
+		.selected::before{
+			content: "";
+			position: absolute;
+			margin-top: 147rpx;
+			margin-left: 97rpx;
+			border-radius: 5rpx 0 0 0 ;
+			height: 30rpx;
+			width: 30rpx;
+			background: url(../../static/icon/selected.png) no-repeat center/22rpx red;
 		}
 		
 		.gift-name{

+ 1 - 1
pages.json

@@ -116,7 +116,7 @@
 		"list": [
 
 			{
-				"pagePath": "pages/index/index",
+				"pagePath": "pages/index/home",
 				"text": "首页",
 				"selectedIconPath": "static/tarbar/shouye.png",
 				"iconPath": "static/tarbar/shouye0.png"

+ 9 - 1
pages/index/home.vue

@@ -65,6 +65,15 @@
 			console.log(2);
 			await this.initWorksList();
 		},
+		computed:{
+			swiperList(){
+				const { indexImageList }= this.$store.state['vuex_page_interface_show'];
+				console.log(indexImageList);
+				let swiperList = [];
+				indexImageList.forEach(item => {swiperList.push(item.url);})
+				return swiperList;
+			}
+		},
 		methods :{
 			async initWorksList(){
 				const { defaultActiveId:activeId }= this.$store.state['vuex_active_setting'];
@@ -81,7 +90,6 @@
 		data() {
 			return {
 				worksList: [],
-				swiperList: ['https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/70c8b355db774f85ab9f8d4f6289df69-banner.jpg'],
 				gridList: [{
 						icon: '/static/grid/jieshao.png',
 						name: "活动介绍",

+ 7 - 1
pages/index/index.vue

@@ -4,7 +4,13 @@
 		async onLoad(props) {
 			const { path } = props;
 			await this.initParams();
-			this.$jump( path || '/pages/index/home');
+			if(this.$isEmpty(path)){
+				uni.switchTab({
+					url: '/pages/index/home'
+				})
+			}else{
+				this.$jump( path );
+			}
 		},
 
 		methods :{

+ 30 - 15
pages/rank/rank.vue

@@ -10,32 +10,34 @@
 			</view>
 			<view class="flex justify-center align-center padding-bottom">
 				<view class="search">
-					<u-search search-icon="/static/rank/search.png" :show-action="false" bg-color="#fff"
+					<u-search  @search="searchWorks" search-icon="/static/rank/search.png" :show-action="false" bg-color="#fff"
 						style="width: 100%;" placeholder-color="#CCCCCC"></u-search>
 				</view>
 			</view>
-			<block v-for="(item, index) in 20" :key="index">
+			<block v-for="(item, index) in rankList" :key="item.id">
 				<block v-if="index == 0 || index == 1 || index == 2">
 					<view class=" flex align-center"
 						style="height: 230rpx;position: relative;margin: 10rpx 20rpx 20rpx 20rpx;"
 						:class="index == 0 ? 'first' : index == 1 ? 'second' : index == 2 ? 'third' : '' ">
-						<u-image width="220" height="220" border-radius="10" src="/static/test/test.png"></u-image>
+						<u-image width="220" height="220" border-radius="10" :src="item.imgUrl"></u-image>
 						<view class="flex justify-between container" style="width: 100%;">
 							<view class="left" style="width: 95%;">
-								<view class="name text-cut">小学生法律小知识</view>
+								<view class="name text-cut">{{item.title}}</view>
 								<view class="padding-tb-sm text-sm center"
 									style="color: #888888;justify-content: flex-start">
-									<u-avatar src="/static/test/avatar.png" size="56"></u-avatar>
-									<text class="margin-left-10">一只可乐喵</text>
+									<u-avatar :src="item.userImg" size="56"></u-avatar>
+									<text class="margin-left-10">{{item.username}}</text>
 								</view>
 
 								<view class="flex justify-between">
 									<view class="hot-value center" style="justify-content: flex-start;">
 										<image src="../../static/rank/hot.png" style="width: 36rpx;height: 36rpx;"
 											mode=""></image>
-										<text>3085</text>
+										<text>{{item.voteCount}}</text>
 									</view>
-									<button class="cu-btn round  bg-base sm text-white"
+									<button
+										@click.stop="$jump('/pages/activity/activityDetail?id='+item.id)"
+										class="cu-btn round  bg-base sm text-white"
 										style="padding: 20rpx 38rpx;margin-bottom: 30rpx;">
 										<text>去投票</text>
 									</button>
@@ -59,23 +61,25 @@
 					</view>
 					<view class=" flex align-center "
 						style="background-color: #FFFFFF;border-radius: 20rpx;height: 200rpx;width: 95%;">
-						<u-image width="190" height="190" border-radius="10" src="/static/test/test.png"></u-image>
+						<u-image width="190" height="190" border-radius="10" :src="item.imgUrl"></u-image>
 						<view class="flex justify-between container" style="width: 100%;">
 							<view class="left" style="width: 95%;">
 								<view class="name text-cut"
-									style="font-size: 28rpx;font-weight: 600;padding-top: 20rpx;">小学生法律小知识</view>
+									style="font-size: 28rpx;font-weight: 600;padding-top: 20rpx;">{{item.title}}</view>
 								<view class="padding-top-20 text-sm center"
 									style="color: #888888;justify-content: flex-start">
-									<u-avatar src="/static/test/avatar.png" size="56"></u-avatar>
-									<text class="margin-left-10">一只可乐喵</text>
+									<u-avatar :src="item.userImg" size="56"></u-avatar>
+									<text class="margin-left-10">{{item.username}}</text>
 								</view>
 								<view class="flex justify-between">
 									<view class="hot-value center" style="justify-content: flex-start;">
 										<image src="../../static/rank/hot.png" style="width: 36rpx;height: 36rpx;"
 											mode=""></image>
-										<text>3085</text>
+										<text>{{item.voteCount}}</text>
 									</view>
-									<button class="cu-btn round bg-base sm text-white"
+									<button 
+									@click.stop="$jump('/pages/activity/activityDetail?id='+item.id)"
+									 class="cu-btn round bg-base sm text-white"
 										style="padding: 20rpx 38rpx;margin-bottom: 30rpx;">
 										<text>去投票</text>
 									</button>
@@ -133,9 +137,20 @@
 				this.loading = false
 				this.$refs.loading.hide()
 			}, 500)
+			this.getList(0);
 		},
 		methods: {
-
+			getList(page){
+				const { defaultActiveId:activeId ,rankTotal }= this.$store.state['vuex_active_setting'];
+				this.$api.activity.getWorksList({ activeId , start: page,end: page+rankTotal }).then(res => {
+						this.rankList.push(...res.data.data);
+					});
+			},
+			searchWorks(value){
+				this.$api.activity.searchWork(value).then(res => {
+					this.rankList = res.data.data;
+				})
+			}
 		}
 	}
 </script>

二進制
static/icon/selected.png