guhongwei 2 éve
szülő
commit
ed508227cf
3 módosított fájl, 82 hozzáadás és 38 törlés
  1. 45 15
      pagesHome/group/share.vue
  2. 25 23
      pagesHome/order/detail.vue
  3. 12 0
      pagesRest/activity/info.vue

+ 45 - 15
pagesHome/group/share.vue

@@ -71,17 +71,34 @@
 	export default {
 		data() {
 			return {
+				// 系统设置
+				config: {},
 				user: {},
 				id: '',
 				info: {},
 				num: 1,
 			};
 		},
-		onLoad: function(e) {
+		onLoad: async function(e) {
 			const that = this;
 			that.$set(that, `id`, e.id || '');
-			that.watchLogin();
-			that.search();
+			await that.watchLogin();
+			await that.searchConfig();
+			await that.search();
+			await that.configShare();
+		},
+		onShow: function() {},
+		onUnload: function() {
+			// 页面卸载,重新部署分享内容
+			const that = this;
+			if (that.config) {
+				// 赋值默认值
+				that.$config.share = {
+					title: that.config.title,
+					path: '/pages/index/index',
+					imageUrl: that.config.config.share[0].url
+				}
+			}
 		},
 		methods: {
 			watchLogin() {
@@ -93,6 +110,18 @@
 						if (user) that.$set(that, `user`, user)
 					}
 				})
+				uni
+			},
+			// 查询系统设置
+			searchConfig() {
+				const that = this;
+				uni.getStorage({
+					key: 'config',
+					success: function(res) {
+						let data = res.data;
+						that.$set(that, `config`, data);
+					}
+				})
 			},
 			async search() {
 				const that = this;
@@ -103,17 +132,6 @@
 							res.data.persons = res.data.persons.filter(i => i.status == '0')
 						}
 						that.$set(that, `info`, res.data);
-						uni.getStorage({
-							key: 'config',
-							success: function(config) {
-								// 赋值默认值
-								that.$config.share = {
-									title: res.data.goods.name,
-									path: '/pagesHome/group/share?id=${that.id}',
-									imageUrl: config?.config?.share[0]?.url
-								}
-							}
-						});
 					} else {
 						uni.showToast({
 							title: res.errmsg,
@@ -175,7 +193,19 @@
 			toCount(e) {
 				const that = this;
 				that.num = e;
-			}
+			},
+			// 配置分享内容
+			configShare() {
+				const that = this;
+				let id = that.id;
+				let info = that.info;
+				let config = that.config;
+				that.$config.share = {
+					title: info.goods.name,
+					path: `/pagesHome/group/share?id=${that.id}`,
+					imageUrl: config?.config?.share[0]?.url
+				}
+			},
 		}
 	}
 </script>

+ 25 - 23
pagesHome/order/detail.vue

@@ -5,8 +5,7 @@
 				<scroll-view scroll-y="true" class="scroll-view">
 					<view class="list-scroll-view">
 						<view class="one_1">
-							<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff"
-								indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
+							<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
 								<swiper-item class="list" v-for="(item,index) in info.goods.file" :key="index">
 									<image class="image" :src="item.url" mode="aspectFit">
 									</image>
@@ -14,15 +13,12 @@
 							</swiper>
 							<!-- 是否关注商品 -->
 							<view class="goodsColect">
-								<text @tap="toGoodscolect"
-									:class="['iconfont',goodsColect?'icon-yduishoucangshixin-copy':'icon-yduishoucangkongxin']"></text>
+								<text @tap="toGoodscolect" :class="['iconfont',goodsColect?'icon-yduishoucangshixin-copy':'icon-yduishoucangkongxin']"></text>
 							</view>
 						</view>
 						<view class="one_2">
-							<text
-								class="money"><text>¥</text>{{info.specs&&info.specs.length>0?info.specs[0].sell_money:0}}</text>
-							<text
-								class="money"><text>¥</text>{{info.specs&&info.specs.length>0?info.specs[0].flow_money:0}}</text>
+							<text class="money"><text>¥</text>{{info.specs&&info.specs.length>0?info.specs[0].sell_money:0}}</text>
+							<text class="money"><text>¥</text>{{info.specs&&info.specs.length>0?info.specs[0].flow_money:0}}</text>
 						</view>
 						<view class="one_3">
 							<view class="name">
@@ -55,9 +51,7 @@
 						<view class="one_6">
 							<view class="one_6_1">
 								<view class="shop_1">
-									<image class="image"
-										:src="info.shop.logo&&info.shop.logo.length>0?info.shop.logo[0].url:''"
-										mode="aspectFit"></image>
+									<image class="image" :src="info.shop.logo&&info.shop.logo.length>0?info.shop.logo[0].url:''" mode="aspectFit"></image>
 								</view>
 								<view class="shop_2">
 									<view class="name">{{info.shop.name}}</view>
@@ -92,8 +86,7 @@
 				</scroll-view>
 			</view>
 			<view class="two">
-				<uni-goods-nav :options="options" :button-group="buttonGroup" @click="toNavleft"
-					@buttonClick="toNavright" />
+				<uni-goods-nav :options="options" :button-group="buttonGroup" @click="toNavleft" @buttonClick="toNavright" />
 			</view>
 		</view>
 		<!-- 跳转菜单 -->
@@ -101,8 +94,7 @@
 			<text @tap="toMenubar" class="iconfont icon-gengduo"></text>
 		</view>
 		<view class="bar_2" v-if="is_menu">
-			<view class="list" v-for="(item,index) in barList" :key="index" v-if="item.is_use=='0'"
-				@click="toPath(item)">
+			<view class="list" v-for="(item,index) in barList" :key="index" v-if="item.is_use=='0'" @click="toPath(item)">
 				<image class="image" :src="item.normal&&item.normal.length>0?item.normal[0].url:''"></image>
 				<text class="name"> {{item.name}}</text>
 			</view>
@@ -120,9 +112,7 @@
 								<view class="one">
 									<view class="one_1">
 										<view class="l">
-											<image class="image"
-												:src="specsInfo.file.length>0?specsInfo.file[0].url:info.goods.file[0].url"
-												mode="aspectFill" @tap="imageView(specsInfo.file)"></image>
+											<image class="image" :src="specsInfo.file.length>0?specsInfo.file[0].url:info.goods.file[0].url" mode="aspectFill" @tap="imageView(specsInfo.file)"></image>
 										</view>
 										<view class="r">
 											<view class="money">
@@ -140,9 +130,7 @@
 											规格
 										</view>
 										<view class="one_2_2">
-											<view
-												:class="['list',`${item.num==0?'zero_list':''}`,`${is_specs==index?'one_list':''}`]"
-												v-for="(item,index) in info.specs" :key="index" @tap="toSpecs(item)">
+											<view :class="['list',`${item.num==0?'zero_list':''}`,`${is_specs==index?'one_list':''}`]" v-for="(item,index) in info.specs" :key="index" @tap="toSpecs(item)">
 												<text>{{item.name}}</text>
 											</view>
 										</view>
@@ -152,8 +140,7 @@
 											<text>数量</text>
 										</view>
 										<view class="one_3_1">
-											<uni-number-box v-model="buy_num" @change="toCount" :min="1"
-												:max="specsInfo.num">
+											<uni-number-box v-model="buy_num" @change="toCount" :min="1" :max="specsInfo.num">
 											</uni-number-box>
 										</view>
 										<view class="one_3_1">
@@ -179,6 +166,8 @@
 	export default {
 		data() {
 			return {
+				// 系统设置
+				config: {},
 				// 商品id
 				id: '',
 				// 分享人id
@@ -247,6 +236,18 @@
 			await that.watchLogin();
 			that.configShare();
 		},
+		onUnload: function() {
+			// 页面卸载,重新部署分享内容
+			const that = this;
+			if (that.config) {
+				// 赋值默认值
+				that.$config.share = {
+					title: that.config.title,
+					path: '/pages/index/index',
+					imageUrl: that.config.config.share[0].url
+				}
+			}
+		},
 		methods: {
 			// 查询系统设置
 			searchConfig() {
@@ -255,6 +256,7 @@
 					key: 'config',
 					success: function(res) {
 						let data = res.data;
+						that.$set(that, `config`, data);
 						if (data.bottom_menu && data.bottom_menu.list.length > 0) {
 							let list = data.bottom_menu.list.sort((a, b) => {
 								return a.sort - b.sort

+ 12 - 0
pagesRest/activity/info.vue

@@ -61,6 +61,18 @@
 			await that.searchAct();
 			await that.configShare();
 		},
+		onUnload: function() {
+			// 页面卸载,重新部署分享内容
+			const that = this;
+			if (that.config) {
+				// 赋值默认值
+				that.$config.share = {
+					title: that.config.title,
+					path: '/pages/index/index',
+					imageUrl: that.config.config.share[0].url
+				}
+			}
+		},
 		methods: {
 			// 查询基本设置
 			searchConfig() {