|
@@ -154,9 +154,51 @@
|
|
|
{{ item.classifyName }}
|
|
{{ item.classifyName }}
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-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>
|
|
<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="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">
|
|
<view class="text-black text-lg text-bold" style="font-size: 30upx">
|
|
@@ -180,7 +222,6 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view style="height: 30px"></view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
<empty v-if="!dataList.length"></empty>
|
|
<empty v-if="!dataList.length"></empty>
|
|
@@ -634,7 +675,8 @@ export default {
|
|
|
lng: '',
|
|
lng: '',
|
|
|
shopName: '',
|
|
shopName: '',
|
|
|
page: 1,
|
|
page: 1,
|
|
|
- limit: 10,
|
|
|
|
|
|
|
+ limit: 20,
|
|
|
|
|
+ total: 0,
|
|
|
evaluatePage: 1,
|
|
evaluatePage: 1,
|
|
|
evaluateLimit: 10,
|
|
evaluateLimit: 10,
|
|
|
show: true,
|
|
show: true,
|
|
@@ -682,7 +724,10 @@ export default {
|
|
|
coupons: false,
|
|
coupons: false,
|
|
|
// huoListss: [], //活动
|
|
// huoListss: [], //活动
|
|
|
|
|
|
|
|
- shop_zhizhao: []
|
|
|
|
|
|
|
+ shop_zhizhao: [],
|
|
|
|
|
+ shopTypeId: '',
|
|
|
|
|
+ showShopTypeId: false,
|
|
|
|
|
+ supermarketGoodsList: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
@@ -703,19 +748,29 @@ export default {
|
|
|
let list = scene.split(',')
|
|
let list = scene.split(',')
|
|
|
let shopId
|
|
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) {
|
|
if (shopId) {
|
|
|
this.shopId = shopId
|
|
this.shopId = shopId
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
this.getData()
|
|
this.getData()
|
|
|
} else {
|
|
} else {
|
|
|
// if (option.huoListss) {
|
|
// if (option.huoListss) {
|
|
|
// this.huoListss = JSON.parse(decodeURIComponent(option.huoListss))
|
|
// this.huoListss = JSON.parse(decodeURIComponent(option.huoListss))
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
+ this.shopTypeId = option.shopTypeId.split(',')
|
|
|
|
|
+ this.showShopTypeId = this.shopTypeId.includes('10')
|
|
|
|
|
+
|
|
|
this.shopId = option.shopId
|
|
this.shopId = option.shopId
|
|
|
|
|
|
|
|
uni.showLoading({
|
|
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) {
|
|
clickImg(img) {
|
|
|
uni.previewImage({
|
|
uni.previewImage({
|
|
@@ -861,6 +929,10 @@ export default {
|
|
|
this.current = e
|
|
this.current = e
|
|
|
|
|
|
|
|
if (this.current == 1) {
|
|
if (this.current == 1) {
|
|
|
|
|
+ this.tabCur = 0
|
|
|
|
|
+ this.page = 1
|
|
|
|
|
+ this.total = 0
|
|
|
|
|
+ this.supermarketGoodsList = []
|
|
|
this.getData()
|
|
this.getData()
|
|
|
} else if (this.current == 2) {
|
|
} else if (this.current == 2) {
|
|
|
this.evaluatePage = 1
|
|
this.evaluatePage = 1
|
|
@@ -896,12 +968,19 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 获取店铺信息
|
|
// 获取店铺信息
|
|
|
getData() {
|
|
getData() {
|
|
|
|
|
+ let urlreq = ''
|
|
|
|
|
+ if (this.showShopTypeId) {
|
|
|
|
|
+ urlreq = '/app/goods/selectGoodsClassifyList'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ urlreq = '/app/goods/selectGoodsList'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let data = {
|
|
let data = {
|
|
|
shopId: this.shopId,
|
|
shopId: this.shopId,
|
|
|
lng: this.lng,
|
|
lng: this.lng,
|
|
|
lat: this.lat
|
|
lat: this.lat
|
|
|
}
|
|
}
|
|
|
- this.$Request.get('/app/goods/selectGoodsList', data).then((res) => {
|
|
|
|
|
|
|
+ this.$Request.get(urlreq, data).then((res) => {
|
|
|
console.log(res, '999')
|
|
console.log(res, '999')
|
|
|
if (res.code == 0 && res.data) {
|
|
if (res.code == 0 && res.data) {
|
|
|
this.dataList = res.data.list
|
|
this.dataList = res.data.list
|
|
@@ -931,10 +1010,30 @@ export default {
|
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
|
title: this.shopDet.shopName
|
|
title: this.shopDet.shopName
|
|
|
})
|
|
})
|
|
|
|
|
+ if ((urlreq = '/app/goods/selectGoodsClassifyList')) {
|
|
|
|
|
+ this.getSupermarketGoodsList(this.dataList[0].classifyId)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
uni.hideLoading()
|
|
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() {
|
|
getEchoOrder() {
|
|
|
let data = {
|
|
let data = {
|
|
|
shopId: this.shopId,
|
|
shopId: this.shopId,
|
|
@@ -1364,31 +1463,41 @@ export default {
|
|
|
this.tabCur = e.currentTarget.dataset.id
|
|
this.tabCur = e.currentTarget.dataset.id
|
|
|
this.mainCur = e.currentTarget.dataset.id
|
|
this.mainCur = e.currentTarget.dataset.id
|
|
|
this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
|
|
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
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|