cmy před 1 rokem
rodič
revize
1468c6cb3a

+ 0 - 106
pages/index/artDetail.vue

@@ -1,106 +0,0 @@
-<template>
-	<view class="center">
-		<view class="title clamp">{{ item.title }}</view>
-		<view class="tip flex">
-			<view class="tip-left">作者:{{ item.author }}</view>
-			<view class="tip-right">{{ item.add_time }}</view>
-		</view>
-		<view class="main" v-for="(ls, index) in item.content" :key="index">
-			<view v-if="ls.type == 'rich-text'" v-html="ls.value" class="main"></view>
-			<video v-if="ls.type == 'video' && ls.value" :src="ls.value" style="width:100%;height: 300px"
-				frameborder="0"></video>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		details
-	} from '@/api/user.js';
-	export default {
-		data() {
-			return {
-				id: '',
-				item: ''
-			};
-		},
-		onLoad(option) {
-			this.id = option.id;
-			this.loadData();
-		},
-		methods: {
-			loadData() {
-				details({}, this.id).then(({
-					data
-				}) => {
-					console.log(data);
-					data.content = data.content.replace(/<img/g, '<img class="rich-img"').replace(/<p>\s*<img/g,
-						'<p class="pHeight"><img');
-					data.content = this.getVideo(data.content);
-					this.item = data;
-				});
-			},
-			// 富文本视频解析
-			getVideo(data) {
-				let videoList = [];
-				let videoReg = /<video.*?(?:>|\/>)/gi; //匹配到字符串中的 video 标签
-				let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i; //匹配到字符串中的 video 标签 的路径
-				let arr = data.match(videoReg) || []; // arr 为包含所有video标签的数组
-				let articleList = data.split('</video>'); // 把字符串  从视频标签分成数组
-				arr.forEach((item, index) => {
-					var src = item.match(srcReg);
-					videoList.push(src[1]); //所要显示的字符串中 所有的video 标签 的路径
-				});
-				let needArticleList = [];
-				articleList.forEach((item, index) => {
-					if (item != '' && item != undefined) {
-						//  常见的标签渲染
-						needArticleList.push({
-							type: 'rich-text',
-							value: item + '</video>'
-						});
-					}
-					let articleListLength = articleList.length; // 插入到原有video 标签位置
-					if (index < articleListLength && videoList[index] != undefined) {
-						needArticleList.push({
-							type: 'video',
-							value: videoList[index]
-						});
-					}
-				});
-				return needArticleList;
-			}
-		}
-	};
-</script>
-
-<style lang="less">
-	.center {
-		width: 100%;
-		height: 100%;
-	}
-
-	.title {
-		padding: 30rpx 30rpx 0 24rpx;
-		font-size: 32rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #333333;
-	}
-
-	.tip {
-		padding: 38rpx 32rpx 28rpx 24rpx;
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #666666;
-		border-bottom: 1px solid #e9e9e9;
-	}
-
-	/deep/ .main {
-		.rich-img {
-			width: 100% !important;
-			height: auto;
-		}
-	}
-</style>

+ 0 - 0
pages/entertainment/entertainment.vue → pages/index/entertainment.vue


+ 34 - 5
pages/index/index.vue

@@ -13,7 +13,9 @@
 					<image class="langTip" src="../../static/shouye/shouye2.png" mode="scaleToFill"></image>
 				</view>
 				<view class="text1  margin-r-10">
-					繁體中文
+					<picker :range="langList" range-key='label' @change="selectLang">
+						<view>{{label}}</view>
+					</picker>
 				</view>
 				<view class="icon1">
 					<image class="langTipDom" src="../../static/shouye/shouye3.png" mode="scaleToFill"></image>
@@ -36,13 +38,13 @@
 		<!-- 底部 -->
 		<view class="tra flex margin-b-10">
 			<view class="tra-item">
-				名稱
+				{{$t('home.b8')}}
 			</view>
 			<view class="tra-item">
-				最新價格
+				{{$t('home.k1')}}
 			</view>
 			<view class="tra-item">
-				24h漲跌幅
+				{{$t('home.b0')}}
 			</view>
 		</view>
 		<!-- 每一项 -->
@@ -63,6 +65,7 @@
 	</view>
 </template>
 <script>
+	import { mapState, mapActions } from "vuex";
 	export default {
 		data() {
 			return {
@@ -105,10 +108,36 @@
 					}],
 					page: 1, //当前页数
 					limit: 10 //每次信息条数
-				}
+				},
 			}
 		},
+		computed: {
+		  ...mapState({
+		    langList: "langList",
+		    lang: "lang",
+		  }),
+		  label() {
+			  const label = this.langList.find((item) =>{ 
+				  console.log(this.lang,item.value);
+				return  item.value == this.lang
+				}).label;
+		    return label
+		  }
+		},
 		methods: {
+			  ...mapActions({
+			    setLang: "setLang",
+			  }),
+			  getCurrent(){
+			      let pages = getCurrentPages();
+			      let curPage = pages[pages.length - 1];
+			      return curPage
+			  },
+			  selectLang(value) {
+			    this.setLang(this.langList[value.detail.value].value);
+			    let path = '/'+this.getCurrent().route
+			  },
+			
 			loadData(source) {
 				//这里是将订单挂载到tab列表下
 				let navItem = this.navList;

+ 0 - 0
pages/information/information.vue → pages/index/information.vue


+ 0 - 0
pages/pledge/pledge.vue → pages/index/pledge.vue


+ 0 - 177
pages/index/sign.vue

@@ -1,177 +0,0 @@
-<template>
-	<view>
-		<view class="title-box">
-			<view class=" title-conetnt  position-relative">
-				<view class="title-img"><image src="/static/img/img08.png" mode="aspectFit"></image></view>
-				<view class="title-content-box">
-					<view class="title-text">已连续签到</view>
-					<view class="title-day-text">
-						<text class="title-day">{{actionDay}}</text>
-						<text>天</text>
-					</view>
-					<view class="title-button" :class="{'signAction':signTrue}" @click="signTrue?'':integral()">{{signTrue?'已签到':'立即签到'}}</view>
-				</view>
-			</view>
-			<view class="title-tip"><text>共获得{{sum_integral}}积分,总签到{{allSign}}天</text></view>
-		</view>
-		<calendar class="sign-date-box" :checks="signList" checksClass="" :checkTextShow="true" checksIcon="/static/img/img07.png"></calendar>
-	</view>
-</template>
-
-<script>
-import calendar from '../../components/ss-calendar/ss-calendar.vue';
-import { signList, integral,signUser } from '@/api/functionalUnit.js';
-export default {
-	components: {
-		calendar
-	},
-	data() {
-		return {
-			money: '', //保存当前月份
-			year: '', //保存当前年份
-			day: '', //保存当前日期
-			signList: [] ,//签到日子列表
-			actionDay:0,//连续签到天数
-			allSign:0,//累计签到
-			sum_integral:0,//累计获得积分
-			signTrue:false,
-		};
-	},
-	onLoad() {
-		this.signUser();
-		this.getData();
-		this.loadList();
-	},
-	methods: {
-		// 获取当前时间
-		getData(current) {
-			const date = current ? new Date(current) : new Date();
-			this.year = date.getFullYear();//保存当前年份
-			this.month = date.getMonth() + 1;//保存当前月份
-			this.day = date.getDate();//保存当前日期
-		},
-		//获取签到用户信息
-		signUser(){
-			signUser({all:1}).then(({data}) => {
-				this.actionDay = data.sign_num;//连续签到天数
-				this.allSign = data.sum_sgin_day;//累计签到天数
-				this.sum_integral = data.sum_integral;//累计总积分
-			})
-		},
-		// 签到
-		integral() {
-			integral({})
-				.then(e => {
-					// 改为已签到
-					this.signTrue = true;
-					this.actionDay++;
-					// 保存签到成功
-					this.signList.push(this.day);
-					uni.showToast({
-						title: '签到成功',
-						duration: 2000,
-						position: 'top'
-					});
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		},
-		// 获取签到列表
-		loadList() {
-			let obj = this;
-			let present = this.day; //保存当前天数用于后续计算
-			let actionDay = 0; //用于计算活跃天数
-			let arr = []; //保存返回数组;
-			signList({
-				page: 1,
-				limit: 31
-			}).then(e => {
-				arr = e.data.map((e, ind) => {
-					let time = e.add_time.split('-');
-					let day = parseInt(time[2].replace(/^0/i, ''));
-					let year = time[0];
-					let month = +time[1];
-					if (obj.year == year && obj.month == month) {
-						return day;
-					}
-				});
-				this.signList = arr;
-				// 判断今天是否已经签到
-				if(arr[0]==this.day){
-					this.signTrue = true;
-				}
-			});
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-page {
-	background: $page-color-base;
-}
-.sign-date-box {
-	margin: 25rpx;
-	border-radius: 15rpx;
-	margin-top: -70rpx;
-}
-.title-box {
-	background-color: $base-color;
-	padding-top: 120rpx;
-	color: #ffffff;
-	height: 590rpx;
-	.title-conetnt {
-		height: 350rpx;
-		width: 350rpx;
-		margin: 0 auto;
-		text-align: center;
-		.title-img {
-			position: absolute;
-			top: 0;
-			left: 0;
-			height: 100%;
-			width: 100%;
-			image {
-				height: 100%;
-				width: 100%;
-			}
-		}
-		.title-content-box {
-			position: absolute;
-			width: 100%;
-			.title-day-text {
-				padding: 20rpx;
-				font-size: $font-base - 2rpx;
-				.title-day {
-					font-size: 60rpx;
-				}
-			}
-			.title-text {
-				font-size: 26rpx;
-				padding-top: 100rpx;
-			}
-			.title-button {
-				background-color: #fe7e51;
-				border-radius: 99rpx;
-				width: 200rpx;
-				height: 64rpx;
-				margin: 0 auto;
-				line-height: 64rpx;
-				text-align: center;
-				font-size: $font-base;
-				&.signAction{
-					background-color: $font-color-light;
-				}
-			}
-		}
-	}
-}
-.title-tip {
-	color: #ffffff;
-	font-size: $font-base - 2rpx;
-	padding-top: 20rpx;
-	text-align: center;
-	margin-top: -40rpx;
-}
-</style>

+ 0 - 0
pages/user/user.vue → pages/index/user.vue