Browse Source

no message

xiaoxin 9 months atrás
parent
commit
31be027a3a

+ 8 - 8
common/config.js

@@ -1,12 +1,12 @@
-// const ROOTPATH = "https://mxys.chuanghai-tech.com/sqx_fast";
-// const ROOTPATH1 = "https://mxys.chuanghai-tech.com/sqx_fast";
-// const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss/websocket/"
-// const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss/ordersChat/"
+const ROOTPATH = "https://mxys.chuanghai-tech.com/sqx_fast";
+const ROOTPATH1 = "https://mxys.chuanghai-tech.com/sqx_fast";
+const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss/websocket/"
+const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss/ordersChat/"
 
-const ROOTPATH = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
-const ROOTPATH1 = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
-const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss-test/websocket/"
-const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss-test/ordersChat/"
+// const ROOTPATH = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
+// const ROOTPATH1 = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
+// const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss-test/websocket/"
+// const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss-test/ordersChat/"
 
 // const ROOTPATH = "http://192.168.161.190:8171/sqx_fast";
 // const ROOTPATH1 = "http://192.168.161.190:8171/sqx_fast";

+ 141 - 32
my/index/shop/index2.vue

@@ -154,9 +154,51 @@
 								{{ item.classifyName }}
 							</view>
 						</scroll-view>
-						<scroll-view class="VerticalMain" scroll-y scroll-with-animation :scroll-into-view="'main-' + mainCur" @scroll="VerticalMain">
-							<view class="bg-white padding-sm margin-bottom-sm" v-for="(item, index) in dataList" v-if="item.goodsList.length" :key="index" :id="'main-' + index">
-								<view class="flex justify-between padding-bottom-sm" @click="goDet(ite.goodsId)" v-for="(ite, ind) in item.goodsList" :key="ind">
+						<scroll-view
+							class="VerticalMain"
+							scroll-y
+							scroll-with-animation
+							:scroll-into-view="'main-' + mainCur"
+							@scroll="VerticalMainFun"
+							@scrolltolower="scrolltolowerRight"
+						>
+							<view v-if="!showShopTypeId">
+								<view
+									class="bg-white padding-sm margin-bottom-sm"
+									v-for="(item, index) in dataList"
+									v-if="item.goodsList.length"
+									:key="index"
+									:id="'main-' + index"
+								>
+									<view class="flex justify-between padding-bottom-sm" @click="goDet(ite.goodsId)" v-for="(ite, ind) in item.goodsList" :key="ind">
+										<image :src="ite.goodsCover" mode="aspectFill" style="width: 184rpx; height: 184rpx; border-radius: 10rpx"></image>
+										<view class="flex-sub margin-left-sm padding-tb-xs flex flex-direction justify-between">
+											<view class="text-black text-lg text-bold" style="font-size: 30upx">
+												{{ ite.goodsName }}
+											</view>
+											<view class="text-gray">已售 {{ ite.sales ? ite.sales : 0 }}</view>
+											<view class="text-gray text-sm u-line-2" style="overflow: hidden; line-clamp: 2; -webkit-line-clamp: 2; width: 100%">
+												{{ ite.goodsDescribe ? ite.goodsDescribe : '' }}
+											</view>
+											<view class="flex justify-between" style="position: relative">
+												<view class="text-sm" style="color: #ff0303">
+													¥
+													<text class="text-lg">{{ ite.goodsMoney }}</text>
+												</view>
+												<view
+													style="width: 80rpx; height: 80rpx; line-height: 80rpx; position: absolute; right: 0; top: -10rpx; text-align: center"
+													@click.stop="selSku(ite)"
+												>
+													<image src="../../../static/images/index/add.png" style="width: 40rpx; height: 40rpx"></image>
+												</view>
+											</view>
+										</view>
+									</view>
+									<view style="height: 30px"></view>
+								</view>
+							</view>
+							<view v-else>
+								<view class="flex justify-between padding-bottom-sm" @click="goDet(ite.goodsId)" v-for="(ite, ind) in supermarketGoodsList" :key="ite.goodsId">
 									<image :src="ite.goodsCover" mode="aspectFill" style="width: 184rpx; height: 184rpx; border-radius: 10rpx"></image>
 									<view class="flex-sub margin-left-sm padding-tb-xs flex flex-direction justify-between">
 										<view class="text-black text-lg text-bold" style="font-size: 30upx">
@@ -180,7 +222,6 @@
 										</view>
 									</view>
 								</view>
-								<view style="height: 30px"></view>
 							</view>
 						</scroll-view>
 						<empty v-if="!dataList.length"></empty>
@@ -634,7 +675,8 @@ export default {
 			lng: '',
 			shopName: '',
 			page: 1,
-			limit: 10,
+			limit: 20,
+			total: 0,
 			evaluatePage: 1,
 			evaluateLimit: 10,
 			show: true,
@@ -682,7 +724,10 @@ export default {
 			coupons: false,
 			// huoListss: [], //活动
 
-			shop_zhizhao: []
+			shop_zhizhao: [],
+			shopTypeId: '',
+			showShopTypeId: false,
+			supermarketGoodsList: []
 		}
 	},
 	onLoad(option) {
@@ -703,19 +748,29 @@ export default {
 			let list = scene.split(',')
 			let shopId
 
-			if (list.length > 0) {
-				shopId = list[0] //获取shopid
+			if (list.length) {
+				//获取shopid
+				shopId = list[0]
+			}
+
+			if (list.length > 1) {
+				this.shopTypeId = list[1].split(',')
+				this.showShopTypeId = this.shopTypeId.includes('10')
 			}
 
 			if (shopId) {
 				this.shopId = shopId
 			}
+
 			this.getData()
 		} else {
 			// if (option.huoListss) {
 			// 	this.huoListss = JSON.parse(decodeURIComponent(option.huoListss))
 			// }
 
+			this.shopTypeId = option.shopTypeId.split(',')
+			this.showShopTypeId = this.shopTypeId.includes('10')
+
 			this.shopId = option.shopId
 
 			uni.showLoading({
@@ -784,6 +839,19 @@ export default {
 				})
 			}
 		},
+		scrolltolowerRight() {
+			if (this.showShopTypeId) {
+				if (this.total > this.supermarketGoodsList.length) {
+					this.page++
+					this.getSupermarketGoodsList(this.dataList[this.tabCur].classifyId)
+				} else {
+					uni.showToast({
+						title: '没有更多数据了',
+						icon: 'none'
+					})
+				}
+			}
+		},
 		//营业执照点击放大
 		clickImg(img) {
 			uni.previewImage({
@@ -861,6 +929,10 @@ export default {
 			this.current = e
 
 			if (this.current == 1) {
+				this.tabCur = 0
+				this.page = 1
+				this.total = 0
+				this.supermarketGoodsList = []
 				this.getData()
 			} else if (this.current == 2) {
 				this.evaluatePage = 1
@@ -896,12 +968,19 @@ export default {
 		},
 		// 获取店铺信息
 		getData() {
+			let urlreq = ''
+			if (this.showShopTypeId) {
+				urlreq = '/app/goods/selectGoodsClassifyList'
+			} else {
+				urlreq = '/app/goods/selectGoodsList'
+			}
+
 			let data = {
 				shopId: this.shopId,
 				lng: this.lng,
 				lat: this.lat
 			}
-			this.$Request.get('/app/goods/selectGoodsList', data).then((res) => {
+			this.$Request.get(urlreq, data).then((res) => {
 				console.log(res, '999')
 				if (res.code == 0 && res.data) {
 					this.dataList = res.data.list
@@ -931,10 +1010,30 @@ export default {
 					uni.setNavigationBarTitle({
 						title: this.shopDet.shopName
 					})
+					if ((urlreq = '/app/goods/selectGoodsClassifyList')) {
+						this.getSupermarketGoodsList(this.dataList[0].classifyId)
+					}
 				}
 				uni.hideLoading()
 			})
 		},
+		getSupermarketGoodsList(classifyId) {
+			let dataRight = {
+				shopId: this.shopId,
+				classifyId,
+				page: this.page,
+				limit: this.limit
+			}
+			// console.log(dataRight)
+
+			this.$Request.get('/app/goods/selectSupermarketGoodsList', dataRight).then((res) => {
+				// console.log(res, '9996329')
+				if (res.code == 0) {
+					this.supermarketGoodsList = [...this.supermarketGoodsList, ...res.data.records]
+					this.total = res.data.total
+				}
+			})
+		},
 		getEchoOrder() {
 			let data = {
 				shopId: this.shopId,
@@ -1364,31 +1463,41 @@ export default {
 			this.tabCur = e.currentTarget.dataset.id
 			this.mainCur = e.currentTarget.dataset.id
 			this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
+
+			if (this.showShopTypeId) {
+				this.page = 1
+				this.total = []
+				this.supermarketGoodsList = []
+				// console.log(this.tabCur)
+				this.getSupermarketGoodsList(this.dataList[this.tabCur].classifyId)
+			}
 		},
-		VerticalMain(e) {
-			let tabHeight = 0
-			if (this.load) {
-				for (let i = 0; i < this.dataList.length; i++) {
-					let view = uni.createSelectorQuery().select('#main-' + this.dataList[i].id)
-					view.fields(
-						{
-							size: true
-						},
-						(data) => {
-							this.dataList[i].top = tabHeight
-							tabHeight = tabHeight + data.height
-							this.dataList[i].bottom = tabHeight
-						}
-					).exec()
+		VerticalMainFun(e) {
+			if (!this.showShopTypeId) {
+				let tabHeight = 0
+				if (this.load) {
+					for (let i = 0; i < this.dataList.length; i++) {
+						let view = uni.createSelectorQuery().select('#main-' + this.dataList[i].id)
+						view.fields(
+							{
+								size: true
+							},
+							(data) => {
+								this.dataList[i].top = tabHeight
+								tabHeight = tabHeight + data.height
+								this.dataList[i].bottom = tabHeight
+							}
+						).exec()
+					}
+					this.load = false
 				}
-				this.load = false
-			}
-			let scrollTop = e.detail.scrollTop
-			for (let i = 0; i < this.dataList.length; i++) {
-				if (scrollTop > this.dataList[i].top && scrollTop < this.dataList[i].bottom) {
-					this.verticalNavTop = (this.dataList[i].id - 1) * 50
-					this.tabCur = this.dataList[i].id
-					return false
+				let scrollTop = e.detail.scrollTop
+				for (let i = 0; i < this.dataList.length; i++) {
+					if (scrollTop > this.dataList[i].top && scrollTop < this.dataList[i].bottom) {
+						this.verticalNavTop = (this.dataList[i].id - 1) * 50
+						this.tabCur = this.dataList[i].id
+						return false
+					}
 				}
 			}
 		},

+ 7 - 5
pages/index/shop/confirmOrder.vue

@@ -838,7 +838,9 @@ export default {
 				this.getDistance()
 			}
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + this.address.insideDeliveryFee).toFixed(2)
+				this.totalPrice1 = parseFloat(
+					parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
+				).toFixed(2)
 			} else {
 				this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 			}
@@ -1104,7 +1106,7 @@ export default {
 					this.totalPrice = res.data.money
 					if (this.orderType == 2) {
 						this.totalPrice1 = parseFloat(
-							parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + this.address.insideDeliveryFee
+							parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
 						).toFixed(2)
 					} else {
 						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
@@ -1160,7 +1162,7 @@ export default {
 					this.totalPrice = res.data.money
 					if (this.orderType == 2) {
 						this.totalPrice1 = parseFloat(
-							parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + this.address.insideDeliveryFee
+							parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
 						).toFixed(2)
 					} else {
 						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
@@ -1602,7 +1604,7 @@ export default {
 			this.$Request.get(`/app/inside-address/${insideAddressId}`).then((res) => {
 				// console.log(res, 987456)
 				if (res.code == 0) {
-					this.address.insideDeliveryFee = res.data.deliveryFee
+					this.address.insideDeliveryFee = res.data.deliveryFee || 0
 				}
 			})
 		},
@@ -1969,4 +1971,4 @@ export default {
 		top: -20rpx; */
 	z-index: 9;
 }
-</style>
+</style>

+ 10 - 7
pages/index/shop/index.vue

@@ -162,7 +162,7 @@
 							@scroll="VerticalMainFun"
 							@scrolltolower="scrolltolowerRight"
 						>
-							<view v-if="shopTypeId != 10">
+							<view v-if="!showShopTypeId">
 								<view
 									class="bg-white padding-sm margin-bottom-sm"
 									v-for="(item, index) in dataList"
@@ -727,12 +727,15 @@ export default {
 
 			shop_zhizhao: [],
 			shopTypeId: '',
+			showShopTypeId: false,
 			supermarketGoodsList: []
 		}
 	},
 	onLoad(option) {
 		// console.log(option)
-		this.shopTypeId = option.shopTypeId
+		this.shopTypeId = option.shopTypeId.split(',')
+		this.showShopTypeId = this.shopTypeId.includes('10')
+
 		// if (option.huoListss) {
 		// 	this.huoListss = JSON.parse(decodeURIComponent(option.huoListss))
 		// }
@@ -815,7 +818,7 @@ export default {
 			}
 		},
 		scrolltolowerRight() {
-			if (this.shopTypeId == 10) {
+			if (this.showShopTypeId) {
 				if (this.total > this.supermarketGoodsList.length) {
 					this.page++
 					this.getSupermarketGoodsList(this.dataList[this.tabCur].classifyId)
@@ -943,7 +946,7 @@ export default {
 		// 获取店铺信息
 		getData() {
 			let urlreq = ''
-			if (this.shopTypeId == 10) {
+			if (this.showShopTypeId) {
 				urlreq = '/app/goods/selectGoodsClassifyList'
 			} else {
 				urlreq = '/app/goods/selectGoodsList'
@@ -1445,7 +1448,7 @@ export default {
 			this.mainCur = e.currentTarget.dataset.id
 			this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
 
-			if (this.shopTypeId == 10) {
+			if (this.showShopTypeId) {
 				this.page = 1
 				this.total = []
 				this.supermarketGoodsList = []
@@ -1454,7 +1457,7 @@ export default {
 			}
 		},
 		VerticalMainFun(e) {
-			if (this.shopTypeId != 10) {
+			if (!this.showShopTypeId) {
 				let tabHeight = 0
 				if (this.load) {
 					for (let i = 0; i < this.dataList.length; i++) {
@@ -2309,4 +2312,4 @@ page {
 	width: 180rpx; /* 三张图片平分宽度 */
 	height: 135rpx;
 }
-</style>
+</style>

+ 3 - 3
pages/index/shop/payOrder.vue

@@ -1028,7 +1028,7 @@ export default {
 					console.log(this.dabaoMoney, '打包')
 					console.log(this.paotuiMoney, '跑腿')
 					if (this.orderType == 2) {
-						this.totalPrice1 = this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee
+						this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 					} else {
 						this.totalPrice1 = this.totalPrice + this.dabaoMoney
 					}
@@ -1457,7 +1457,7 @@ export default {
 			this.$Request.get(`/app/inside-address/${insideAddressId}`).then((res) => {
 				// console.log(res, 987456)
 				if (res.code == 0) {
-					this.address.insideDeliveryFee = res.data.deliveryFee
+					this.address.insideDeliveryFee = res.data.deliveryFee || 0
 				}
 			})
 		},
@@ -1808,4 +1808,4 @@ export default {
 		top: -20rpx; */
 	z-index: 9;
 }
-</style>
+</style>