Browse Source

添加店铺详情分享页面

xiaoxin 9 months ago
parent
commit
0049383f93
3 changed files with 2249 additions and 38 deletions
  1. 2221 0
      my/index/shop/index2.vue
  2. 7 0
      pages.json
  3. 21 38
      pages/index/shop/index.vue

File diff suppressed because it is too large
+ 2221 - 0
my/index/shop/index2.vue


+ 7 - 0
pages.json

@@ -170,6 +170,13 @@
 					}
 				},
 				{
+					"path": "index/shop/index2",
+					"style": {
+						"navigationBarTitleText": "店铺详情",
+						"navigationStyle": "custom"
+					}
+				},
+				{
 					"path": "address/add",
 					"style": {
 						"navigationBarTitleText": "添加地址"

+ 21 - 38
pages/index/shop/index.vue

@@ -680,15 +680,15 @@ export default {
 			XCXIsSelect: '否',
 			couponList: [], //优惠券列表
 			coupons: false,
-			huoListss: [], //活动
+			// huoListss: [], //活动
 
 			shop_zhizhao: []
 		}
 	},
 	onLoad(option) {
-		if (option.huoListss) {
-			this.huoListss = JSON.parse(decodeURIComponent(option.huoListss))
-		}
+		// if (option.huoListss) {
+		// 	this.huoListss = JSON.parse(decodeURIComponent(option.huoListss))
+		// }
 		this.XCXIsSelect = this.$queue.getData('XCXIsSelect')
 		if (this.XCXIsSelect == '否') {
 			// this.getGuize()
@@ -700,38 +700,24 @@ export default {
 				title: '店铺详情'
 			})
 		}
-		let that = this
-		that.shopId = option.shopId
+
+		this.shopId = option.shopId
 
 		uni.showLoading({
 			title: '加载中',
 			mask: true // 是否显示透明蒙层,防止触摸穿透
 		})
 
-		// #ifndef H5
-		uni.getLocation({
-			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
-			success: function (res) {
-				that.lat = res.latitude
-				that.lng = res.longitude
-			}
-		})
-		that.getData()
-		// #endif
-		// #ifdef H5
 		uni.getLocation({
 			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
-			success: function (res) {
+			success: (res) => {
 				console.log(res, '经纬度')
-				that.lat = res.latitude
-				that.lng = res.longitude
-				that.getData()
+				this.lat = res.latitude
+				this.lng = res.longitude
+				this.getData()
 			}
 		})
-
-		that.getData()
-		// #endif
-		that.orderId = uni.getStorageSync('orderId') ? uni.getStorageSync('orderId') : ''
+		this.orderId = uni.getStorageSync('orderId') ? uni.getStorageSync('orderId') : ''
 	},
 	onHide() {
 		uni.removeStorageSync('types')
@@ -757,7 +743,7 @@ export default {
 		//发送给朋友
 		return {
 			title: this.shopDet.shopName,
-			path: '/pages/index/shop/index?shopId=' + this.shopDet.shopId,
+			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId,
 			imageUrl: this.shopDet.shopCover
 		}
 	},
@@ -765,7 +751,7 @@ export default {
 		//分享到朋友圈
 		return {
 			title: this.shopDet.shopName,
-			path: '/pages/index/shop/index?shopId=' + this.shopDet.shopId,
+			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId,
 			imageUrl: this.shopDet.shopCover
 		}
 	},
@@ -809,16 +795,15 @@ export default {
 		},
 		//领取优惠券
 		lingqv(couponId, needIntegral) {
-			let that = this
 			let data = {
 				couponId: couponId
 			}
-			that.$Request.postT('/app/coupon/buyCoupon', data).then((res) => {
+			this.$Request.postT('/app/coupon/buyCoupon', data).then((res) => {
 				if (res.code == 0) {
 					uni.showToast({
 						title: '领取成功'
 					})
-					that.coupons = false
+					this.coupons = false
 				} else {
 					uni.showToast({
 						title: res.msg,
@@ -975,9 +960,8 @@ export default {
 					this.getEchoOrder()
 
 					if (!this.skuList.length) {
-						let that = this
-						setTimeout(function () {
-							that.orderSel(2)
+						setTimeout(() => {
+							this.orderSel(2)
 						}, 500)
 					} else {
 						if (this.goodsDet.attr.length) {
@@ -1365,7 +1349,6 @@ export default {
 			this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
 		},
 		VerticalMain(e) {
-			let that = this
 			let tabHeight = 0
 			if (this.load) {
 				for (let i = 0; i < this.dataList.length; i++) {
@@ -1401,13 +1384,13 @@ export default {
 		// 点击调起地图查看位置
 		goMap() {
 			//查看位置需要传经纬度才能执行
-			let that = this
+
 			uni.authorize({
 				scope: 'scope.userLocation',
-				success(res) {
+				success: (res) => {
 					uni.openLocation({
-						latitude: that.shopDet.shopLat,
-						longitude: that.shopDet.shopLng,
+						latitude: this.shopDet.shopLat,
+						longitude: this.shopDet.shopLng,
 						success: function () {}
 					})
 				},