pansl před 1 rokem
rodič
revize
ad02b6a397
2 změnil soubory, kde provedl 67 přidání a 111 odebrání
  1. 41 43
      common/config.js
  2. 26 68
      pages/index/index.vue

+ 41 - 43
common/config.js

@@ -1,46 +1,44 @@
-let config = {}
-
-// #ifdef H5
-if (process.env.NODE_ENV !== 'production') {} else {}
-// #endif
-
-// #ifdef MP-WEIXIN
-import wxApp from "@/common/wecaht.min.app.js"
-console.log(wxApp.getWXAppId(), 'wxApp.getWXAppId()wxApp.getWXAppId()wxApp.getWXAppId()')
-if (__wxConfig.envVersion == 'develop') {
-	// 开发版本
-	config = {
-		apiUrl: "https://api.duanju.dududus.com",
-		staticUrl: 'https://xjc.demo.hongcd.com/img/', //静态图片地址https://xjc.demo.hongcd.com
-		zystaticUrl: "",
-		TabbarIndex: 2
-	}
-} else if (__wxConfig.envVersion == 'trial') {
-	//体验版
-	config = {
-		apiUrl: "https://api.dududus.com",
-		staticUrl: 'https://xjc.demo.hongcd.com/img/', //静态图片地址https://xjc.demo.hongcd.com
-		zystaticUrl: "",
-		TabbarIndex: 2
-	}
-} else if (__wxConfig.envVersion == 'release') {
-	//正式版
-	config = {
-		apiUrl: "https://api.dududus.com",
-		staticUrl: 'https://xjc.demo.hongcd.com/img/', //静态图片地址https://xjc.demo.hongcd.com
-		zystaticUrl: "",
-		TabbarIndex: 2
-	}
-} else {
-	config = {
-		apiUrl: "https://api.duanju.dududus.com",
-		staticUrl: 'https://xjc.demo.hongcd.com/img/', //静态图片地址https://xjc.demo.hongcd.com
-		zystaticUrl: "",
-		TabbarIndex: 2
+// 配置信息
+var config = {}
+const accountInfo = uni.getAccountInfoSync();
+const envVersion = accountInfo.miniProgram.envVersion;
+console.log(accountInfo, envVersion, 'envVersionenvVersionenvVersion')
+uni.getSystemInfo({
+	success: function(res) {
+		console.log(res, 'getSystemInfogetSystemInfogetSystemInfogetSystemInfo')
+		if (res.uniPlatform === 'mp-weixin') {
+			console.log(accountInfo, envVersion, '当前在微信开中运行当前在微信开中运行当前在微信开中运行当前在微信开中运行')
+			// 在微信小程序中运行的逻辑
+			if (envVersion === 'develop') {
+				// 开发版本
+				config = {
+					apiUrl: "https://api.duanju.dududus.com",
+					staticUrl: 'https://xjc.demo.hongcd.com/img/', //静态图片地址https://xjc.demo.hongcd.com
+					zystaticUrl: "",
+					TabbarIndex: 2
+				}
+			} else if (envVersion === 'trial') {
+				//体验版
+				config = {
+					apiUrl: "https://api.zhiyupa.com",
+					staticUrl: 'https://xjc.demo.hongcd.com/img/', //静态图片地址https://xjc.demo.hongcd.com
+					zystaticUrl: "",
+					TabbarIndex: 2
+				}
+			} else if (envVersion === 'release') {
+				//正式版
+				config = {
+					apiUrl: "https://api.zhiyupa.com",
+					staticUrl: 'https://xjc.demo.hongcd.com/img/', //静态图片地址https://xjc.demo.hongcd.com
+					zystaticUrl: "",
+					TabbarIndex: 2
+				}
+			}
+		} else if (res.uniPlatform === 'web') {
+			// 在H5环境中运行的逻辑
+			console.log('当前在H5环境中运行');
+		}
 	}
-}
-// #endif
+});
 
-
-// 配置信息
 export default config

+ 26 - 68
pages/index/index.vue

@@ -5,19 +5,7 @@
 		<sub-tabvs class="" :tabs="typetab" @change="changeIndex" :selectIndex="selecttype"
 			:scrollTop="scrollTop"></sub-tabvs>
 		<view class="home-header pd0_15 mt10" :style="'background: ' + mbgColor + ';'">
-			<view class="home-mendian flex alcenter space plr15 cl-w9" style="display: none;">
-				<navigator style="width: calc(100% - 80rpx);" url="/pages/client/tuan/ss">
-					<view class="flex alcenter" style="width: calc(100% - 80rpx);">
-						<text class="iconfont  iconsousuo ft14 mr10"></text>
-						<text class="text-over ft14" style="width: calc(100% - 60rpx);">请输入搜索内容</text>
-					</view>
-				</navigator>
-				<text @click="saoma()" class="iconfont iconicon_saoma ft24"></text>
-			</view>
-
-			<view class="">
-				<home-banner :banners="banners"></home-banner>
-			</view>
+			<home-banner :banners="banners"></home-banner>
 		</view>
 		<view class="integral-mall-main plr15" style="margin-top: 30upx;">
 			<view class="integal-mall-menu flex pt10 pb10">
@@ -44,46 +32,42 @@
 				</view>
 			</view>
 			<view class="mt24">
-				<view class="flex alcenter start">
+				<view class="flex alcenter start mb10">
 					<view class="flex alcenter">
 						<image style="width: 40rpx;height: 40rpx;" :src="statics.zhuico[0]"></image>
 						<text class="ft16 ftw600 cl-main ml15">{{ hotdata.subject_name }}</text>
 					</view>
-					<!-- <navigator url="/pages/client/tuan/ss?selectIndex=1"> -->
-					<!-- <view @click="huanyihuan()" class="ft14 cl-notice">换一换</view> -->
-					<!-- </navigator> -->
-				</view>
-
-				<view class="flex space"
-					style="display:flex; flex-wrap:wrap; padding: 30upx 30upx 0px 30upx;min-height: 100px;">
-					<block v-for="(value, key) in hotdata.data" :key="key">
-						<view class="box pb10 mb15" style="width:31%; border-radius:20rpx;" @click="detail(value)">
-							<!-- <view class="btn-mini" style="position: absolute; top: 20upx; right: 20upx; border-radius: 10upx;font-size: 18upx;width: 60upx; height: 36upx; z-index: 1;" :style="getBtnStyle">{{value.lxname}}</view> -->
-							<image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
-							<view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{ value.name }}</view>
-						</view>
-					</block>
 				</view>
+				<u-scroll-list :indicator="false">
+					<view v-for="(value, key) in hotdata.data" :key="key" class="box pb10 mb15"
+						style="width:30%; border-radius:20rpx;margin: 6px;min-height: 100px;flex: none;"
+						@click="detail(value)">
+						<u--image width="100%" height="280rpx" radius="8" mode="scaleToFill" :src="value.cover_image"
+							:fade="true" duration="450">
+							<view slot="error" style="font-size: 24rpx;">加载失败</view>
+						</u--image>
+						<view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{ value.name }}</view>
+					</view>
+				</u-scroll-list>
 			</view>
 			<view class="mt24">
-				<view class="flex alcenter start">
+				<view class="flex alcenter start mb10">
 					<view class="flex alcenter">
 						<image style="width: 40rpx;height: 40rpx;" :src="statics.zhuico[0]"></image>
 						<text class="ft16 ftw600 cl-main ml15">{{ givedata.subject_name }}</text>
 					</view>
-					<!-- <navigator url="/pages/client/tuan/ss?selectIndex=1"> -->
-					<!-- <view @click="huanyihuan()" class="ft14 cl-notice">换一换</view> -->
-					<!-- </navigator> -->
-				</view>
-				<view class="flex space"
-					style="display:flex; flex-wrap:wrap; padding: 30upx 30upx 0px 30upx;min-height: 100px;">
-					<block v-for="(value, key) in givedata.data" :key="key">
-						<view class="box pb10 mb15" style="width:31%; border-radius:20rpx;" @click="detail(value)">
-							<image class="integral-mall-goods" mode="aspectFill" :src="value.cover_image"></image>
-							<view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{ value.name }}</view>
-						</view>
-					</block>
 				</view>
+				<u-scroll-list :indicator="false">
+					<view v-for="(value, key) in givedata.data" :key="key" class="box pb10 mb15"
+						style="width:30%; border-radius:20rpx;margin: 6px;min-height: 100px;flex: none;"
+						@click="detail(value)">
+						<u--image width="100%" height="280rpx" radius="8" mode="scaleToFill" :src="value.cover_image"
+							:fade="true" duration="450">
+							<view slot="error" style="font-size: 24rpx;">加载失败</view>
+						</u--image>
+						<view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{ value.name }}</view>
+					</view>
+				</u-scroll-list>
 			</view>
 		</view>
 	</view>
@@ -144,7 +128,6 @@
 		},
 		onLoad(e) {
 			this.settitle();
-
 		},
 		onShow() {
 			this.getList();
@@ -165,9 +148,6 @@
 				console.log(this.type)
 				this.selecttype = index;
 			},
-			huanyihuan() {
-
-			},
 			getList() {
 				getMiniprogramHall().then(res => {
 					console.log(res, 'getMiniprogramHallgetMiniprogramHall')
@@ -176,28 +156,6 @@
 					this.givedata = res.data.recommend[1]
 				})
 			},
-			saoma() {
-				//#ifdef APP-PLUS  
-				uni.scanCode({
-					success: function(res) {
-						if (res.result.indexOf("uid") != -1) {
-							var obj = JSON.parse(res.result);
-							if (obj.uid) {
-								uni.navigateTo({
-									url: '/pages/login/reg?uid=' + obj.uid
-								})
-							}
-						} else {
-							uni.showToast({
-								title: res.result,
-								icon: "none"
-							});
-						}
-					}
-				});
-				//#endif
-
-			},
 			detail(value) {
 				uni.navigateTo({
 					url: '/pages/video/index?video_id=' + value.video_id
@@ -250,7 +208,7 @@
 	}
 
 	.integral-mall-goods {
-		width: 100%;
+		width: 210rpx;
 		height: 280rpx;
 		background: #F2F2F2;
 		border-radius: 16upx;