Răsfoiți Sursa

修改:优化恋爱日记配置信息

小莫唐尼 3 ani în urmă
părinte
comite
1305b4a555
6 a modificat fișierele cu 68 adăugiri și 47 ștergeri
  1. 1 0
      .gitignore
  2. 1 4
      config/love.config.js
  3. 26 15
      config/love.config.template.js
  4. 1 1
      pagesA/love/journey.vue
  5. 31 7
      pagesA/love/list.vue
  6. 8 20
      pagesA/love/love.vue

+ 1 - 0
.gitignore

@@ -2,4 +2,5 @@ node_modules/
 unpackage/ 
 config/halo.config.js
 config/ad.config.js
+config/love.config.js
 package-lock.json

Fișier diff suprimat deoarece este prea mare
+ 1 - 4
config/love.config.js


Fișier diff suprimat deoarece este prea mare
+ 26 - 15
config/love.config.template.js


+ 1 - 1
pagesA/love/journey.vue

@@ -23,7 +23,7 @@ export default {
 	methods: {
 		fnInit() {
 			clearTimeout(this.timer);
-			const _html = LoveConfig.story;
+			const _html = LoveConfig.journey;
 			let _index = 0;
 			const _typing = () => {
 				this.timer = setTimeout(() => {

+ 31 - 7
pagesA/love/list.vue

@@ -99,14 +99,38 @@ export default {
 		}
 	},
 	created() {
-		this.fnFormatList();
+		this.fnGetList();
 	},
 	methods: {
-		fnFormatList() {
-			this.list = LoveConfig.loveList.map(item => {
-				item['open'] = false;
-				return item;
-			});
+		fnGetList() {
+			if (LoveConfig.loveList.useApi && LoveConfig.loveList.api) {
+				uni.request({
+					url: LoveConfig.loveList.api,
+					header: {
+						ContentType: 'application/json'
+					},
+					method: 'GET',
+					dataType: 'json',
+					success: res => {
+						if (res.statusCode == 200 && res.data.status == 200) {
+							this.list = res.data.data.map(item => {
+								item['open'] = false;
+								return item;
+							});
+						} else {
+							uni.$tm.toast('数据请求失败,请检查接口!');
+						}
+					},
+					fail: err => {
+						uni.$tm.toast('数据请求失败,请检查接口!');
+					}
+				});
+			} else {
+				this.list = LoveConfig.loveList.data.map(item => {
+					item['open'] = false;
+					return item;
+				});
+			}
 		},
 		fnOnItemOpen(item) {
 			item.open = !item.open;
@@ -141,7 +165,7 @@ export default {
 		rgba(109, 186, 130, 0.1)
 	);
 	// background: rgba(247, 246, 242, 1);
-	color: #55423b;
+	// color: #55423b;
 }
 .love-card {
 	width: 100%;

+ 8 - 20
pagesA/love/love.vue

@@ -40,27 +40,15 @@
 		</view>
 		<!-- 功能导航 -->
 		<view class="list-wrap">
-			<view class="list-item" @click="fnToPage('journey')">
-				<view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
-				<view class="right">
-					<view class="name">关于我们</view>
-					<view class="desc">我们一起度过的那些经历</view>
+			<block v-for="(nav, index) in loveConfig.nav" :key="index">
+				<view v-if="nav.use" class="list-item" @click="fnToPage(nav.key)">
+					<view class="left"><image class="icon" :src="nav.iconImageUrl" mode="aspectFit"></image></view>
+					<view class="right">
+						<view class="name">{{ nav.title }}</view>
+						<view class="desc">{{ nav.desc }}</view>
+					</view>
 				</view>
-			</view>
-			<view class="list-item" @click="fnToPage('album')">
-				<view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
-				<view class="right">
-					<view class="name">恋爱相册</view>
-					<view class="desc">定格了我们的那些小美好</view>
-				</view>
-			</view>
-			<view class="list-item" @click="fnToPage('list')">
-				<view class="left"><image class="icon" src="https://b.925i.cn/uni_halo_love/diandian.png" mode="aspectFit"></image></view>
-				<view class="right">
-					<view class="name">恋爱清单</view>
-					<view class="desc">你我之间的约定我们都在努力实现</view>
-				</view>
-			</view>
+			</block>
 		</view>
 	</view>
 </template>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff