解决冲突

This commit is contained in:
2021-11-03 18:43:00 +08:00
52 changed files with 49016 additions and 541 deletions

View File

@@ -30,23 +30,10 @@
</view>
<view class="lists">
<!-- 优选商品 -->
<goods-list :list="searchArr" priceType="CNY" v-if="searchType == 0" @on-goods="onGoods" />
<!-- 商家 -->
<industry-list :list="searchArr" v-if="searchType == 1" @on-industry="onOpenWechat" />
<goods-list :list="searchArr" priceType="CNY" @on-goods="onGoods" />
</view>
<!-- 分页 -->
<uni-load-more :status="pageStatus" :iconSize="16" v-if="searchArr.length > 0" />
<!-- 企业分类弹出 -->
<view class="companyBack" :class="companyShow ? 'active' : ''"></view>
<view class="companyPopup" :class="companyShow ? 'active' : ''">
<view class="nowrap companyPopup-label" :class="{'show': item.industry_id == companyId}"
v-for="(item, index) in categoryArr" :key="index" @click="companyList(item.industry_id, index)">
{{item.title}}
</view>
</view>
</view>
</template>
@@ -62,8 +49,8 @@
return {
nameVal: '',
searchArr: [],
searchType: '0', // 分类 0位商品 1为企业
marketType: 'asc', // 排序
<<<<<<< HEAD
pvType:'asc',
categoryArr: [], // 分类数组--企业
companyId: '', // 分类数组--企业id
@@ -85,10 +72,20 @@
if (this.searchType == '0') wechaUrl = 'mall/randgoods' //商品关键字
if (this.searchType == '1') wechaUrl = 'companies/rand' //商品关键字
randgoodsUrl(wechaUrl, {
=======
// 分页
pageStatus: '',
goodsPage: 1
}
},
onLoad() {
randgoodsUrl('mall/randgoods', {
>>>>>>> 72a3d53a17d6eb8e9823c8383c6eb07b896d9c4a
type: 1
}).then(res => {
this.nameVal = res.name
})
<<<<<<< HEAD
// 企业分类数据
if (this.searchType == '1') {
@@ -97,6 +94,8 @@
})
}
=======
>>>>>>> 72a3d53a17d6eb8e9823c8383c6eb07b896d9c4a
},
methods: {
getShopSelf(){
@@ -126,41 +125,9 @@
}
})
},
// 打开微信小程序
onOpenWechat(e) {
plus.share.getServices(res => {
let sweixin = null;
for (let val of res) {
if (val.id === 'weixin') {
sweixin = val
}
}
/** 以此为例子 显示跳转引导页
* 'index_4'
* index 跳小程序企业首页
* 4 企业id
**/
if (sweixin != null) {
sweixin.launchMiniProgram({
id: e.original_id,
path: 'pages/login/guide?scene=index_' + e.company_id,
})
} else {
uni.showToast({
title: '当前环境不支持打开微信小程序',
icon: 'none'
})
}
})
},
// 列表数据
getList() {
// type=0为商品列表; type=1为企业列表
let wechaUrl = '' // 定义接口来源名称
if (this.searchType == '0') wechaUrl = 'mall/goods' // 商品列表
if (this.searchType == '1') wechaUrl = 'companies/lists' //企业列表
searchUrl(wechaUrl, {
searchUrl('mall/goods', {
page: this.goodsPage,
order_by: this.marketType,
industry_id: this.companyId,
@@ -168,7 +135,7 @@
is_self:this.goodsType[this.goodsTypeIndex].id,
pv:this.pvType
}).then(res => {
if (res.page.current === 1) {
if (this.goodsPage === 1) {
this.searchArr = []
}
this.searchArr = this.searchArr.concat(res.data)
@@ -206,20 +173,6 @@
this.$Router.push({
name: 'goodsClassify'
})
},
// 查看企业行业
companyOpne() {
this.companyShow = !this.companyShow
},
// 筛选企业列表
companyList(id, index) {
this.companyId = id
this.companyName = this.categoryArr[index].title
this.companyShow = false
// 获取全局列表
this.getList();
}
},
@@ -267,7 +220,7 @@
.search-btn {
line-height: 60rpx;
color: #e93340;
color: $mian-color;
}
}
@@ -280,7 +233,6 @@
box-sizing: border-box;
line-height: 80rpx;
text-align: center;
.tabs-item {
font-size: $title-size-m;
color: $text-gray;