lianghanqiang 4 лет назад
Родитель
Сommit
0ffaae95f0

+ 3 - 9
App.vue

@@ -1,20 +1,14 @@
 <script>
+	import {initPlatformParams} from 'store/initParams.js'
 	export default {
 		onLaunch: function() {
 			//更新版本
 			this.updateApp()
 		},
-		async onShow() {
-			await this.initPlatformParams();
+		onShow() {			
+			initPlatformParams(this);
 		},
 		methods:{
-			async initPlatformParams(){
-				const {ACTIVE_SETTING,PAGE_INTERFACE_SHOW} = (await this.$api.platform.getPlatformParams({
-					keys: 'ACTIVE_SETTING,PAGE_INTERFACE_SHOW'
-				})).data.data;
-				this.$u.vuex('vuex_active_setting', JSON.parse(ACTIVE_SETTING));
-				this.$u.vuex('vuex_page_interface_show', JSON.parse(PAGE_INTERFACE_SHOW));
-			},
 			updateApp(){
 				const updateManager = uni.getUpdateManager();
 				updateManager.onCheckForUpdate(function (res) {

+ 1 - 0
assets/http/api.js

@@ -13,6 +13,7 @@ const activity = {
 	getWorksList: p => http.get('/app/active/product/sortList', {params:p}),
 	searchWork: p => http.get('/app/active/product/search', {params:{keyword: p}}),
 	getWorksDetail: id => http.get('/sing_active/activeproductrecord/detail', {params:{id}}),
+	getGiftList: p => http.get('/sing_goods/helpgoods/list', {params:p}),
 }
 
 //微信api

+ 95 - 30
components/alert/votePopup.vue

@@ -2,9 +2,28 @@
 	<u-popup v-model="show" mode="bottom" width="100%" height="750" border-radius="15" :closeable="true">
 		<view class="padding-30">
 			<view class="padding-top-20 text-bold text-xl">投票助力</view>
-			<view class="padding-20" style="color: #888888;font-size: 22rpx;" >{{}}</view>
-			<view>
-				
+			<view class="padding-top-10 padding-bottom-10" style="color: #888888;font-size: 22rpx;" >
+				中国移动用户可使用移动积分兑换活力道具,兑换后可获得移动为你发起2人助力和10个普法积分(可用于积分商城兑换商品),快为喜爱的作品加油助力吧
+			</view>
+			<scroll-view style="white-space: nowrap;" :scroll-x="true">
+				<view v-for="(item,index) in gitfs" class="gift-item">
+					<view @click.stop="selected = index;count = index" class="padding-20" :class="{'icon-box': true,'selected': index ==  selected}" >
+						<image mode="aspectFit" class="gift-img" :src="item.imgUrl"></image>
+						<view class="gift-name">{{item.name}}</view>
+					</view>
+					<view style="color: #999999;font-size: 20rpx;text-align: center;padding-top: 10rpx;">剩余免费次数</view>
+				</view>
+			</scroll-view>
+			
+			<view class="handle-bar">
+				<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>
+						 <span class="info">移动积分</span>
+					 </view>
+					<view class="button-f">点击投票</view>
+				</view>
 			</view>
 		</view>
 	</u-popup>
@@ -16,11 +35,16 @@
 		data() {
 			return {
 				show: true,
+				selected: 0,
+				count: 1000,
+				gitfs: [1,1,1,1,1,1,1,1,1],
 			};
 		},
 		
 		methods: {
-			showVote(){
+			async showVote(){
+				// const res = await this.$api.activity.getGiftList({current: 1,size: 99});
+				// this.gitfs = res.data.data.records;
 				this.show = true;
 			},
 			hideVote(){
@@ -31,36 +55,77 @@
 </script>
 
 <style lang="scss" scoped>
-	.sms-alert-container{
-		padding: 50rpx;
-		.title{
-			width: 100%;
-			text-align: center;
-			 padding:  0rpx 10rpx 50rpx 10rpx ;
-			font-weight: 500;
-			color: #353535;
-			letter-spacing: 2rpx;
-			font-size: 30rpx;
-		}
-		.info-msg{
-			padding: 5rpx 5rpx 20rpx 5rpx;
-			color: #353535;
-		}
-		.input-box{
-			display: flex;
-			align-items: center;
-			justify-content: left;
+	.gift-item{
+		width: 150rpx;
+		height: 250rpx;
+		margin: 12rpx;
+		// box-shadow: 0rpx 2rpx 2rpx 2rpx #DDDDDD;
+		// background: #007AFF;
+		display: inline-block;
+		.icon-box{
+			width: 150rpx;
+			height: 200rpx;
 			border: 1rpx solid #DDDDDD;
+			box-shadow: 3rpx 3rpx 4rpx rgba(26,26,26,0.2);
 			border-radius: 10rpx;
-			margin: 0 0 50rpx 0;
-			padding:  5rpx 5rpx 5rpx 30rpx;
 		}
-		.input-content{
-			width: 66%;
+		.gift-img{
+			width: 100rpx;
+			height: 100rpx;
+			border: 1rpx dashed #DDDDDD;
+			padding: 10rpx;
+			transition: all;
 		}
-		.code-button{
-			width: 34%;
-			border-left: 1rpx solid #DDDDDD;text-align: center;
+		.selected{
+			border: 2rpx solid red;
+			background: red;
+		}
+		
+		.gift-name{
+			font-size:22rpx ;
+			color: #353535;
+			padding-top: 10rpx;
+		}
+		
+	}
+	.handle-bar{
+		position: absolute;
+		width: 100%;
+		bottom: 0;
+		left: 0;
+		padding-bottom: 80rpx;
+		.button-bar{
+			width: 80%;
+			height: 80rpx;
+			border: 2rpx solid #E72226;
+			margin: auto;
+			border-radius: 100rpx;
+			display: flex;
+			.button-f{
+				flex-basis: 50%;
+				color: white;
+				display: flex;
+				font-size: 30rpx;
+				justify-content: center;
+				align-items: center;
+				background: #E72226;
+				border-radius: 0 100rpx 100rpx 0;
+			}
+			.button-r{
+				color: #E82E3E;
+				font-weight: 800;
+				flex-basis: 50%;
+				display: flex;
+				font-size: 40rpx;
+				justify-content: center;
+				align-items: center;
+				.info{
+					color: #AAAAAA;
+					font-weight: 500;
+					margin-left: 15rpx;
+					font-size: 22rpx;
+				}
+			}
 		}
 	}
 </style>

+ 13 - 5
main.js

@@ -18,6 +18,7 @@ Vue.use(toast)
 import loading from '@/components/loading/loading.vue'
 Vue.use(loading)
 
+
 //封装api
 import {
 	api
@@ -93,13 +94,20 @@ Vue.prototype.$isNotEmpty = function(value) {
 
 // #ifndef VUE3
 import Vue from 'vue'
+import { initPlatformParams } from 'store/initParams.js' 
 Vue.config.productionTip = false
 App.mpType = 'app'
-const app = new Vue({
-	store,
-	...App
-})
-app.$mount()
+
+const initApp = async function (){
+	const app = new Vue({
+		store,
+		...App
+	})
+	initPlatformParams(app);
+	app.$mount();
+}
+initApp();
+
 // #endif
 
 // #ifdef VUE3

+ 5 - 3
pages/activity/activityDetail.vue

@@ -28,10 +28,10 @@
 		</view>
 		
 		<view class="footer-bar">
-			<u-button shape="circle" :custom-style="customStyle">给ta投票</u-button>
+			<u-button @click="showVote()" shape="circle" :custom-style="customStyle">给ta投票</u-button>
 		</view>
 	
-		<vote-popup></vote-popup>
+		<vote-popup ref="votePopup"></vote-popup>
 	</view>
 </template>
 
@@ -64,7 +64,9 @@
 			}
 		},
 		methods: {
-			
+			showVote(){
+				this.$refs.votePopup.showVote();
+			}
 		}
 	}
 </script>

+ 3 - 2
pages/index/index.vue

@@ -21,7 +21,7 @@
 		</view>
 		<view class="padding-30">
 			<view class="text-bold" style="font-size: 34rpx;">
-				法护未来 童心同行
+				{{vuex_page_interface_show.indexTitle}}
 			</view>
 			<view  @click="$jump('/pages/activity/activityDetail?id='+item.id)" class="card shadow" v-for="(item,index) in worksList" :key="item.id">
 				<view v-if="index==0" class="center bg-img rank-tag" style="background-image: url(../../static/icon/ph1.png)">
@@ -40,7 +40,7 @@
 				<view class="right">
 					<view class="flex-direction flex">
 						<text class="title">{{item.title}}</text>
-						<text class="desc text-cut-2">{{item.content}}</text>
+						 <rich-text class="desc text-cut-2" :nodes="decodeURIComponent(item.content)"></rich-text>
 					</view>
 					<view class="bottom">
 						<view class="flex margin-top-10">
@@ -62,6 +62,7 @@
 	export default {
 		name: '',
 		async mounted() {
+			console.log(2);
 			await this.initWorksList();
 		},
 		methods :{

BIN
static/icon/ic_zhuanfa.png


BIN
static/poster/bg_shouyetc.png


+ 35 - 36
store/index.js

@@ -30,43 +30,42 @@ const saveLifeData = function(key, value){
 	}
 }
 
-
-
 const store = new Vuex.Store({
-	// 下面这些值仅为示例,使用过程中请删除
-	state: {
-		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
-		// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
-		vuex_audit: lifeData.vuex_audit ? lifeData.vuex_audit : 0,
-		vuex_userId: lifeData.vuex_userId ? lifeData.vuex_userId : null,
-		vuex_phone: lifeData.vuex_phone ? lifeData.vuex_phone : null,
-		vuex_skin: lifeData.vuex_skin ? lifeData.vuex_skin : config.themeRed.skin,
-		vuex_theme: lifeData.vuex_theme ? lifeData.vuex_theme : config.themeRed.theme,
-		vuex_page_interface_show: lifeData.vuex_page_interface_show ? lifeData.vuex_page_interface_show :  {},
-		vuex_active_setting: lifeData.vuex_active_setting ? lifeData.vuex_active_setting :  {},
-	},
-
-	mutations: {
-		$uStore(state, payload) {
-			// 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
-			let nameArr = payload.name.split('.');
-			let saveKey = '';
-			let len = nameArr.length;
-			if(nameArr.length >= 2) {
-				let obj = state[nameArr[0]];
-				for(let i = 1; i < len - 1; i ++) {
-					obj = obj[nameArr[i]];
+		// 下面这些值仅为示例,使用过程中请删除
+		state: {
+			// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
+			// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
+			vuex_audit: lifeData.vuex_audit ? lifeData.vuex_audit : 0,
+			vuex_userId: lifeData.vuex_userId ? lifeData.vuex_userId : null,
+			vuex_phone: lifeData.vuex_phone ? lifeData.vuex_phone : null,
+			vuex_skin: lifeData.vuex_skin ? lifeData.vuex_skin : config.themeRed.skin,
+			vuex_theme: lifeData.vuex_theme ? lifeData.vuex_theme : config.themeRed.theme,
+			vuex_page_interface_show: lifeData.vuex_page_interface_show ? lifeData.vuex_page_interface_show :  {},
+			vuex_active_setting: lifeData.vuex_active_setting ? lifeData.vuex_active_setting :  {},
+		},
+	
+		mutations: {
+			$uStore(state, payload) {
+				// 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
+				let nameArr = payload.name.split('.');
+				let saveKey = '';
+				let len = nameArr.length;
+				if(nameArr.length >= 2) {
+					let obj = state[nameArr[0]];
+					for(let i = 1; i < len - 1; i ++) {
+						obj = obj[nameArr[i]];
+					}
+					obj[nameArr[len - 1]] = payload.value;
+					saveKey = nameArr[0];
+				} else {
+					// 单层级变量,在state就是一个普通变量的情况
+					state[payload.name] = payload.value;
+					saveKey = payload.name;
 				}
-				obj[nameArr[len - 1]] = payload.value;
-				saveKey = nameArr[0];
-			} else {
-				// 单层级变量,在state就是一个普通变量的情况
-				state[payload.name] = payload.value;
-				saveKey = payload.name;
+				// 保存变量到本地,见顶部函数定义
+				saveLifeData(saveKey, state[saveKey])
 			}
-			// 保存变量到本地,见顶部函数定义
-			saveLifeData(saveKey, state[saveKey])
 		}
-	}
-})
-export default store
+	})
+	
+export default store