guhongwei 2 năm trước cách đây
mục cha
commit
4d0be5da3e

+ 13 - 8
components/mobile-frame/index.vue

@@ -31,31 +31,36 @@
 						name: '首页',
 						route: 'pages/home/index',
 						normal: require('@/static/shouye.png'),
-						active: require('@/static/shouye_1.png')
+						active: require('@/static/shouye_1.png'),
+						type: '0'
 					},
 					{
 						name: '微店',
 						route: 'pages/store/index',
 						normal: require('@/static/store.png'),
-						active: require('@/static/store_1.png')
+						active: require('@/static/store_1.png'),
+						type: '0'
 					},
 					{
-						name: '周边',
-						route: 'pages/week/index',
-						normal: require('@/static/week.png'),
-						active: require('@/static/week_1.png')
+						name: '分类',
+						route: 'pagesHome/market/type',
+						normal: require('@/static/type.png'),
+						active: require('@/static/type_1.png'),
+						type: '1'
 					},
 					{
 						name: '购物车',
 						route: 'pages/market/index',
 						normal: require('@/static/market.png'),
-						active: require('@/static/market_1.png')
+						active: require('@/static/market_1.png'),
+						type: '0'
 					},
 					{
 						name: '我的',
 						route: 'pages/my/index',
 						normal: require('@/static/my.png'),
-						active: require('@/static/my_1.png')
+						active: require('@/static/my_1.png'),
+						type: '0'
 					},
 				]
 			};

+ 1 - 1
config.js

@@ -1,6 +1,6 @@
 export default {
 	serverUrl: 'https://broadcast.waityou24.cn',
-	logoUrl: 'https://broadcast.waityou24.cn/files/court/elimg/20220913094838.jpg',
+	logoUrl: 'https://broadcast.waityou24.cn/files/point/indexModule/20221010124133.png',
 	china: [ //全国地址
 		{
 			name: '北京市',

+ 13 - 4
pages/home/index.vue

@@ -107,7 +107,6 @@
 				}
 				// 推荐好货
 				res = await that.$api(`/viewGoods/iatg`, 'GET', {});
-				console.log(res);
 				if (res.errcode == '0') that.$set(that, `recomList`, res.data);
 				// 首页产品列表
 				res = await that.$api(`/viewGoods/indexGoodsList`, `GET`, {
@@ -155,9 +154,15 @@
 				that.topItem = 'top'
 			},
 			toPath(e) {
-				if (e && e.route) uni.redirectTo({
-					url: `/${e.route}`
-				})
+				if (e && e.route && e.type == '0') {
+					uni.redirectTo({
+						url: `/${e.route}`
+					})
+				} else {
+					uni.navigateTo({
+						url: `/${e.route}`
+					})
+				}
 			},
 		}
 	}
@@ -175,6 +180,10 @@
 			margin: 0 0 2vw 0;
 		}
 
+		.zero:last-child {
+			margin: 0
+		}
+
 		.one {
 			background-color: var(--fFB1Color);
 			border-radius: 20px;

+ 26 - 2
pages/index/index.vue

@@ -1,7 +1,9 @@
 <template>
 	<mobile-frame>
 		<view class="main">
-			系统首页
+			<view class="one">
+				<image class="logo" :src="logoUrl" mode=""></image>
+			</view>
 		</view>
 	</mobile-frame>
 </template>
@@ -10,7 +12,9 @@
 	export default {
 		components: {},
 		data() {
-			return {};
+			return {
+				logoUrl: ''
+			};
 		},
 		onLoad: function() {},
 		onShow: function() {
@@ -19,6 +23,8 @@
 		},
 		methods: {
 			search() {
+				const that = this;
+				that.$set(that, `logoUrl`, that.$config.logoUrl);
 				// 查询当前所在平台
 				uni.getSystemInfo({
 					success: async function(res) {
@@ -39,4 +45,22 @@
 </script>
 
 <style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			text-align: center;
+			margin: 40vw 0 0 0;
+
+			.logo {
+				width: 50vw;
+				height: 50vw;
+				border-radius: 90px;
+				box-shadow: 0 0 5px #f1f1f1;
+			}
+		}
+	}
 </style>

+ 9 - 3
pages/market/index.vue

@@ -107,9 +107,15 @@
 		},
 		methods: {
 			toPath(e) {
-				if (e && e.route) uni.redirectTo({
-					url: `/${e.route}`
-				})
+				if (e && e.route && e.type == '0') {
+					uni.redirectTo({
+						url: `/${e.route}`
+					})
+				} else {
+					uni.navigateTo({
+						url: `/${e.route}`
+					})
+				}
 			},
 			// 公共跳转
 			toCommon(route, e) {

+ 17 - 5
pages/my/index.vue

@@ -28,7 +28,7 @@
 			<view class="two">
 				<view class="two_1">
 					<view class="title">我的订单</view>
-				<!-- 	<view class="title">
+					<!-- 	<view class="title">
 						<text @click="toOrder({route:'pagesMy/order/index',type:'order',status:'-0'})">全部订单</text>
 						<text class="iconfont icon-jiantouyou"></text>
 					</view> -->
@@ -45,7 +45,7 @@
 					<view class="title">{{item.title}}</view>
 					<view class="title">
 						<text v-if="user.id&&item.title=='我的积分'">{{user.integral||0}}分</text>
-						<text v-if="item.title=='客服电话'">{{serviceContaceInfo.phone||''}}</text>
+						<text v-if="item.title=='客服电话'" @tap="makePhone(serviceContaceInfo.phone)">{{serviceContaceInfo.phone||''}}</text>
 						<text class="iconfont icon-jiantouyou"></text>
 					</view>
 				</view>
@@ -167,9 +167,15 @@
 			},
 			// 底部菜单跳转
 			toPath(e) {
-				if (e && e.route) uni.redirectTo({
-					url: `/${e.route}`
-				})
+				if (e && e.route && e.type == '0') {
+					uni.redirectTo({
+						url: `/${e.route}`
+					})
+				} else {
+					uni.navigateTo({
+						url: `/${e.route}`
+					})
+				}
 			},
 			// 公共跳转
 			toCommon(e) {
@@ -212,6 +218,12 @@
 				});
 
 			},
+			// 拨打电话
+			makePhone(e) {
+				uni.makePhoneCall({
+					phoneNumber: e
+				});
+			}
 		}
 	}
 </script>

+ 84 - 50
pages/store/index.vue

@@ -4,11 +4,10 @@
 			<view class="one">
 				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
 					<view class="list-scroll-view">
-						微店
-				<!-- 		<view class="list" v-for="(item,index) in list" :key="index">
+						<view class="list" v-for="(item,index) in list" :key="index" @tap="toShop(item)">
 							<view class="list_1">
 								<view class="l">
-									<image class="image" :src="item.url" mode=""></image>
+									<image class="image" :src="item.logo&&item.logo.length>0?item.logo[0].url:''" mode=""></image>
 								</view>
 								<view class="c">
 									<view class="name">
@@ -25,14 +24,14 @@
 								</view>
 							</view>
 							<view class="list_2">
-								<view class="market" v-for="(tag,indexs) in item.market" :key="indexs">
-									<image class="image" :src="tag.url" mode=""></image>
+								<view class="market" v-for="(tag,indexs) in item.market" :key="indexs" @tap="toBuy(tag)">
+									<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''" mode=""></image>
 									<view class="money">
-										¥{{tag.money}}
+										¥{{tag.sell_money}}
 									</view>
 								</view>
 							</view>
-						</view> -->
+						</view>
 					</view>
 				</scroll-view>
 			</view>
@@ -47,61 +46,96 @@
 				frameStyle: {
 					useBar: true
 				},
-				list: [ //
-					{
-						url: require('@/static/test.png'),
-						name: '官方自营店',
-						market_num: 12,
-						follow_num: 12,
-						is_follow: true,
-						market: [ //
-							{
-								url: require('@/static/test.png'),
-								money: 10
-							},
-							{
-								url: require('@/static/test.png'),
-								money: 10
-							},
-							{
-								url: require('@/static/test.png'),
-								money: 10
-							}
-
-						]
-					},
-					{
-						url: require('@/static/test.png'),
-						name: '官方自营店',
-						market_num: 12,
-						follow_num: 12,
-						is_follow: false,
-						market: [ //
-							{
-								url: require('@/static/test.png'),
-								money: 10
-							}
-
-						]
-					}
-				]
+				list: [],
+				total: 0,
+				page: 0,
+				skip: 0,
+				limit: 5,
 			};
 		},
-		onShow: function() {},
+		onShow: function() {
+			const that = this;
+			that.search()
+		},
 		methods: {
+			async search() {
+				const that = this;
+				let info = {
+					skip: that.skip,
+					limit: that.limit
+				}
+				const res = await that.$api(`/viewShop/microIndex`, `GET`, {
+					...info,
+				})
+				if (res.errcode == '0') {
+					let list = [...that.list, ...res.data];
+					that.$set(that, `list`, list)
+					that.$set(that, `total`, res.total)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
+			},
 			// 分页
 			toPage() {
-
+				const that = this;
+				let list = that.list;
+				let limit = that.limit;
+				if (that.total > list.length) {
+					uni.showLoading({
+						title: '加载中',
+						mask: true
+					})
+					let page = that.page + 1;
+					that.$set(that, `page`, page)
+					let skip = page * limit;
+					that.$set(that, `skip`, skip)
+					that.search();
+					uni.hideLoading();
+				} else uni.showToast({
+					title: '没有更多数据了'
+				});
+			},
+			// 商铺
+			toShop(e) {
+				const that = this;
+				that.clearPage();
+				uni.navigateTo({
+					url: `/pagesHome/shop/index?id=${e._id}`
+				})
+			},
+			// 购买
+			toBuy(e) {
+				const that = this;
+				that.clearPage();
+				uni.navigateTo({
+					url: `/pagesHome/order/detail?id=${e._id}`
+				})
 			},
 			// 关注
 			toFolllow(e) {
 				console.log(e);
 			},
 			toPath(e) {
-				if (e && e.route) uni.redirectTo({
-					url: `/${e.route}`
-				})
+				if (e && e.route && e.type == '0') {
+					uni.redirectTo({
+						url: `/${e.route}`
+					})
+				} else {
+					uni.navigateTo({
+						url: `/${e.route}`
+					})
+				}
 			},
+			// 清空列表
+			clearPage() {
+				const that = this;
+				that.$set(that, `list`, [])
+				that.$set(that, `skip`, 0)
+				that.$set(that, `limit`, 5)
+				that.$set(that, `page`, 0)
+			}
 		}
 	}
 </script>

+ 9 - 3
pages/week/index.vue

@@ -16,9 +16,15 @@
 		onShow: function() {},
 		methods: {
 			toPath(e) {
-				if (e && e.route) uni.redirectTo({
-					url: `/${e.route}`
-				})
+				if (e && e.route && e.type == '0') {
+					uni.redirectTo({
+						url: `/${e.route}`
+					})
+				} else {
+					uni.navigateTo({
+						url: `/${e.route}`
+					})
+				}
 			}
 		}
 	}

+ 12 - 2
pagesHome/market/search.vue

@@ -2,7 +2,7 @@
 	<mobile-frame>
 		<view class="main">
 			<view class="one">
-				<input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索商品">
+				<input type="text" v-model="searchInfo.name" @blur="toInput" placeholder="搜索商品">
 			</view>
 			<view class="two">
 				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
@@ -108,7 +108,7 @@
 					...that.searchInfo
 				})
 				if (res.errcode == '0') {
-					let list = [...that.list, ...res.data];
+					let list = [...that.list, ...res.data]
 					that.$set(that, `list`, list)
 					that.$set(that, `total`, res.total)
 				} else {
@@ -142,6 +142,7 @@
 			toInput(e) {
 				const that = this;
 				if (e.detail.value) that.$set(that.searchInfo, `name`, e.detail.value);
+				that.clearPage();
 				that.search();
 			},
 			// 筛选
@@ -176,12 +177,21 @@
 				}
 				that.$set(that.searchInfo, `key`, key);
 				that.$set(that.searchInfo, `value`, value);
+				that.clearPage();
 				that.search();
 			},
 			toBuy(e) {
 				uni.navigateTo({
 					url: `/pagesHome/order/detail?id=${e.id||e._id}`
 				})
+			},
+			// 清空列表
+			clearPage() {
+				const that = this;
+				that.$set(that, `list`, [])
+				that.$set(that, `skip`, 0)
+				that.$set(that, `limit`, 5)
+				that.$set(that, `page`, 0)
 			}
 		}
 	}

+ 11 - 1
pagesHome/shop/index.vue

@@ -30,7 +30,7 @@
 				</view>
 				<view class="one_3" v-else-if="barActive=='1'">
 					<view class="first">
-						<input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索商品">
+						<input type="text" v-model="searchInfo.name" @blur="toInput" placeholder="搜索商品">
 					</view>
 					<view class="second">
 						<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
@@ -276,6 +276,7 @@
 			toInput(e) {
 				const that = this;
 				that.$set(that.searchInfo, `name`, e.detail.value);
+				that.clearPage();
 				that.searchAll();
 			},
 			// 筛选
@@ -310,6 +311,7 @@
 				}
 				that.$set(that.searchInfo, `key`, key);
 				that.$set(that.searchInfo, `value`, value);
+				that.clearPage();
 				that.searchAll();
 			},
 			// 收藏
@@ -336,6 +338,14 @@
 					title: item.name
 				});
 			},
+			// 清空列表
+			clearPage() {
+				const that = this;
+				that.$set(that, `list`, [])
+				that.$set(that, `skip`, 0)
+				that.$set(that, `limit`, 5)
+				that.$set(that, `page`, 0)
+			}
 		}
 	}
 </script>

BIN
static/type.png


BIN
static/type_1.png