| | |
| | | "key": 'index' |
| | | }, |
| | | { |
| | | "pagePath": "/pages/tabbar/category/category", |
| | | // "pagePath": "/pages/tabbar/category/category", |
| | | "pagePath": "/pages/commodity-square/commoditySquare", |
| | | |
| | | "iconPath": "/static/tabbar/category.png", |
| | | "selectedIconPath": "/static/tabbar/category-s.png", |
| | | "text": "商城", |
| | |
| | | */ |
| | | // 开发环境 |
| | | const dev = { |
| | | im: "http://127.0.0.1:8885", |
| | | common: "http://127.0.0.1:8890", |
| | | buyer: "http://127.0.0.1:8888", |
| | | store: "http://127.0.0.1:8889", |
| | | im: "http://192.168.0.15:8885", |
| | | common: "http://192.168.0.15:8890", |
| | | buyer: "http://192.168.0.15:8888", |
| | | store: "http://192.168.0.15:8889", |
| | | // common: "http://192.168.0.113:8890", |
| | | // buyer: "http://192.168.0.113:8888", |
| | | // im: "http://192.168.0.113:8885", |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/tabbar/category/category", |
| | | // "path": "pages/tabbar/category/category", |
| | | "path": "pages/commodity-square/commoditySquare", |
| | | |
| | | "style": { |
| | | "navigationBarTitleText": "分类", |
| | | "navigationStyle": "custom", // 隐藏系统导航栏 |
| | | "navigationBarTitleText": "商品广场", |
| | | // "navigationStyle": "custom", // 隐藏系统导航栏 |
| | | "navigationBarTextStyle": "black", |
| | | "disableScroll": true, |
| | | // "disableScroll": true, |
| | | "bounce": "none", |
| | | "scrollIndicator": "none", |
| | | "componentPlaceholder": { |
| | |
| | | "navigationBarTitleText": "大健康" |
| | | } |
| | | }] |
| | | }, |
| | | { |
| | | "root": "pages/commodity-square", |
| | | "pages": [{ |
| | | "path" : "commoditySquare", |
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "商品广场" |
| | | } |
| | | }] |
| | | } |
| | | // , |
| | | // { |
| | | // "root": "pages/commodity-square", |
| | | // "pages": [{ |
| | | // "path" : "commoditySquare", |
| | | // "style" : |
| | | // { |
| | | // "navigationBarTitleText" : "商品广场" |
| | | // } |
| | | // }] |
| | | // } |
| | | ], |
| | | "globalStyle": { |
| | | "navigationBarTextStyle": "black", |
| | |
| | | "text": "首页" |
| | | }, |
| | | { |
| | | "pagePath": "pages/tabbar/category/category", |
| | | // "pagePath": "pages/tabbar/category/category", |
| | | "pagePath": "pages/commodity-square/commoditySquare", |
| | | "iconPath": "static/tabbar/category.png", |
| | | "selectedIconPath": "static/tabbar/category-s.png", |
| | | "text": "商城" |
| | |
| | | <input type="text" v-show="false" v-model="flushDom"/> |
| | | <view class="commoditySquare"> |
| | | <view class="left" style="width: 310rpx;"> |
| | | <view class="commoditySquareItem" v-for="(item,index) in goodsList1" @click="goToGoodsInfo('goodsList1',item.id)"> |
| | | <view class="commoditySquareItem" v-for="(item,index) in goodsList1" |
| | | @click="goToGoodsInfo('goodsList1',item.id)"> |
| | | <video :src="item.goodsVideo" v-if="item.goodsVideo " v-show="item.show" :initial-time="0" |
| | | :controls="false" object-fit="contain" :show-play-btn="false" :show-center-play-btn="false" |
| | | @loadedmetadata="getvideoInfo($event,'goodsList1',index)" :ref="'video'+item.id" |
| | |
| | | </view> |
| | | </view> |
| | | <view class="right" style="width: 310rpx;"> |
| | | <view class="commoditySquareItem" v-for="(item,index) in goodsList2" @click="goToGoodsInfo('goodsList2',item.id)"> |
| | | <view class="commoditySquareItem" v-for="(item,index) in goodsList2" |
| | | @click="goToGoodsInfo('goodsList2',item.id)"> |
| | | <video :src="item.goodsVideo" v-if="item.goodsVideo " v-show="item.show" :initial-time="0" |
| | | :controls="false" object-fit="contain" :show-play-btn="false" :show-center-play-btn="false" |
| | | @loadedmetadata="getvideoInfo($event,'goodsList2',index)" :ref="'video'+item.id" |
| | |
| | | </view> |
| | | </uni-drawer> |
| | | </view> |
| | | <view style="display: flex;align-items: center;justify-content: center;margin-top: 20rpx;" v-if="canLoadMore">没有更多数据了.................</view> |
| | | <view style="display: flex;align-items: center;justify-content: center;margin-top: 20rpx;" v-if="canLoadMore"> |
| | | 没有更多数据了.................</view> |
| | | <custom-tabbar bgColor="#ffffff" selected="shop"></custom-tabbar> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | onShow() { |
| | | this.showDrawer('showLeft') |
| | | }, |
| | | onLoad() { |
| | | this.loadCategoryList(); |
| | | async onLoad() { |
| | | await this.loadCategoryList(); |
| | | this.getGoodsParam.pageNumber = 1 |
| | | this.getGoodsParam.categoryId = "" |
| | | this.getGoodsParam.keyword = "" |
| | | const goodsList = await getGoodsList(this.getGoodsParam); |
| | | const sts = await getSTSToken(); |
| | | const stsUrl = sts.data.data.endpoint |
| | | // 处理数据 |
| | | goodsList.data.result.records.forEach(item => { |
| | | if (item.thumbnail !== '' && item.thumbnail !== null && item.thumbnail.indexOf('http') === |
| | | -1) { |
| | | item.thumbnail = stsUrl + '/' + item.thumbnail |
| | | } |
| | | if (item.goodsVideo !== '' && item.goodsVideo !== null && item.goodsVideo.indexOf( |
| | | 'http') === -1) { |
| | | item.goodsVideo = stsUrl + '/' + item.goodsVideo |
| | | } |
| | | }) |
| | | //平分给两个数组 |
| | | const middle = Math.ceil(goodsList.data.result.records.length / 2); |
| | | this.goodsList1 = goodsList.data.result.records.slice(0, middle); |
| | | this.goodsList2 = goodsList.data.result.records.slice(middle); |
| | | this.maxPages = goodsList.data.result.pages |
| | | console.log(this.maxPages) |
| | | }, |
| | | async onReachBottom(){ |
| | | if(this.getGoodsParam.pageNumber<this.maxPages){ |
| | |
| | | } |
| | | |
| | | .commoditySquareItem { |
| | | border: 1rpx solid darkgray; |
| | | // border: 1rpx solid #b6dbba; |
| | | border-radius: 12rpx; |
| | | box-sizing: border-box; |
| | | padding: 0 32rpx; |