guhongwei 2 年之前
父節點
當前提交
88c1e05ac4
共有 4 個文件被更改,包括 281 次插入5 次删除
  1. 7 4
      common/css/font-icon.css
  2. 7 0
      pages.json
  3. 1 1
      pages/index/index.vue
  4. 266 0
      pagesHome/group/share.vue

+ 7 - 4
common/css/font-icon.css

@@ -2,9 +2,9 @@
   font-family: "iconfont"; /* Project id 3674157 */
   /* Color fonts */
   src: 
-       url('https://at.alicdn.com/t/c/font_3674157_4t5e6t08l0l.woff2?t=1665454390021') format('woff2'),
-       url('https://at.alicdn.com/t/c/font_3674157_4t5e6t08l0l.woff?t=1665454390021') format('woff'),
-       url('https://at.alicdn.com/t/c/font_3674157_4t5e6t08l0l.ttf?t=1665454390021') format('truetype');
+       url('https://at.alicdn.com/t/c/font_3674157_dspilyh0g0m.woff2?t=1665484081438') format('woff2'),
+       url('https://at.alicdn.com/t/c/font_3674157_dspilyh0g0m.woff?t=1665484081438') format('woff'),
+       url('https://at.alicdn.com/t/c/font_3674157_dspilyh0g0m.ttf?t=1665484081438') format('truetype');
 }
 
 .iconfont {
@@ -15,6 +15,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-cantuan:before {
+  content: "\ec43";
+}
+
 .icon-liebiaoxingshi:before {
   content: "\e742";
 }
@@ -154,4 +158,3 @@
 .icon-daipinglun:before {
   content: "\e602";
 }
-

+ 7 - 0
pages.json

@@ -257,7 +257,14 @@
 					"style": {
 						"navigationBarTitleText": "团购"
 					}
+				},
+				{
+					"path": "group/share",
+					"style": {
+						"navigationBarTitleText": "团购分享"
+					}
 				}
+
 			]
 		}
 	],

+ 1 - 1
pages/index/index.vue

@@ -33,7 +33,7 @@
 							data: res,
 							success: function() {
 								uni.redirectTo({
-									url: `/pagesHome/group/index`
+									url: `/pages/home/index`
 								})
 							}
 						});

+ 266 - 0
pagesHome/group/share.vue

@@ -0,0 +1,266 @@
+<template>
+	<mobile-frame>
+		<view class="main">
+			<view class="one">
+				<view class="one_1">
+					<view class="img">
+						<image class="image" :src="info.goods.file&&info.goods.file.length>0?info.goods.file[0].url:''" mode=""></image>
+					</view>
+					<view class="info">
+						<view class="name">
+							{{info.goods.name}}
+						</view>
+						<view class="other">
+							<view class="other_1">
+								<text>价格:</text>
+								<text>¥{{info.goods.sell_money}}元</text>
+							</view>
+							<view class="other_1">
+								<text></text>
+								<text>{{info.goods.brief}}</text>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="two">
+				<view class="list" v-for="(item,index) in info.persons" :key="index">
+					<view class="img">
+						<image class="image" src="../../static/logo.png" mode=""></image>
+					</view>
+					<view class="name">
+						{{item.name}}
+					</view>
+				</view>
+				<view class="list list_1" v-if="info.group_persons>info.persons.length">
+					<text class="iconfont icon-cantuan"></text>
+					<button type="default" size="mini" @tap.stop="toOpen">参团</button>
+				</view>
+			</view>
+		</view>
+	</mobile-frame>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				id: '',
+				user: {},
+				info: {
+					group_persons: 6,
+					goods: {
+						file: [ //
+							{
+								url: this.$config.logoUrl
+							}
+						],
+						name: '测试商品',
+						sell_money: 10,
+						brief: '信息简介'
+					},
+					persons: [ //
+						{
+							file: [ //
+								{
+									url: this.$config.logoUrl
+								}
+							],
+							name: '顾红伟'
+						},
+						{
+							file: [ //
+								{
+									url: this.$config.logoUrl
+								}
+							],
+							name: '顾红伟'
+						},
+						{
+							file: [ //
+								{
+									url: this.$config.logoUrl
+								}
+							],
+							name: '顾红伟'
+						},
+						{
+							file: [ //
+								{
+									url: this.$config.logoUrl
+								}
+							],
+							name: '顾红伟'
+						},
+						{
+							file: [ //
+								{
+									url: this.$config.logoUrl
+								}
+							],
+							name: '顾红伟'
+						},
+					]
+				},
+				// 分享
+				share: {
+					title: '天恩活泉',
+					path: `/pages/index/index`,
+					imageUrl: this.$config.shareUrl,
+				}
+			};
+		},
+		onLoad: function(e) {
+			const that = this;
+			that.$set(that, `id`, e.id || '63437e3ba163596194c3e830');
+		},
+		onShow: function() {
+			const that = this;
+			that.watchLogin();
+			that.search();
+		},
+		methods: {
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: function(res) {
+						let user = that.$jwt(res.data);
+						if (user) that.$set(that, `user`, user)
+					}
+				})
+			},
+			async search() {
+				const that = this;
+				if (that.id) {
+					let res = await that.$api(`/group/${that.id}`, `GET`);
+					if (res.errcode == '0') {
+						// that.$set(that, `info`, res.data);
+					} else {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none'
+						})
+					}
+				}
+			},
+			// 参团
+			toOpen() {
+				const that = this;
+				console.log(that.info);
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
+		.one {
+			padding: 2vw;
+
+			.one_1 {
+				display: flex;
+
+				.img {
+					width: 30vw;
+
+					.image {
+						width: 100%;
+						height: 15vh;
+						border-radius: 5px;
+
+					}
+				}
+
+				.info {
+					width: 66vw;
+					padding: 0 0 0 2vw;
+
+					.name {
+						font-size: 16px;
+						font-weight: bold;
+						margin: 0 0 1vw 0;
+					}
+
+					.other {
+						.other_1 {
+							font-size: 14px;
+							margin: 0 0 1vw 0;
+
+							text:nth-child(2) {
+								color: #858585;
+							}
+						}
+
+						.other_1:nth-child(1) {
+							text:last-child {
+								color: #ff0000;
+							}
+						}
+
+						.other_1:nth-child(2) {
+							text:last-child {
+								overflow: hidden;
+								text-overflow: ellipsis;
+								-webkit-line-clamp: 2;
+								word-break: break-all;
+								display: -webkit-box;
+								-webkit-box-orient: vertical;
+							}
+						}
+					}
+				}
+			}
+		}
+
+		.two {
+			padding: 2vw;
+			display: flex;
+			flex-wrap: wrap;
+
+			.list {
+				width: 18vw;
+				text-align: center;
+				padding: 2vw;
+				border-radius: 10px;
+				margin: 0 2.5vw 2vw 0;
+				box-shadow: 0 0 3px #858585;
+
+				.img {
+					.image {
+						width: 18vw;
+						height: 11vh;
+						border-radius: 90px;
+					}
+				}
+
+				.name {
+					font-size: 14px;
+					font-weight: bold;
+				}
+			}
+
+			.list:nth-child(4n) {
+				margin: 0 0 2vw 0;
+			}
+
+			.list_1 {
+				text {
+					font-size: 45px;
+					margin: 1vw 0 2vw 0;
+					display: inline-block;
+				}
+
+				button {
+					background-color: #ff0000;
+					color: #fff;
+				}
+			}
+		}
+	}
+</style>