调整全局颜色,新增转让市场

This commit is contained in:
唐明明
2021-11-03 16:56:06 +08:00
parent 6cb32203bf
commit 2a6cd3a959
51 changed files with 3961 additions and 3593 deletions

View File

@@ -7,37 +7,20 @@
</view>
<view class="tabs">
<view class="tabs-item" @click="onTabs">
{{searchType == 0 ? '价格' : '信用值'}}
<image class="icon" mode="widthFix"
:src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" />
价格
<image class="icon" mode="widthFix" :src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" />
</view>
<view class="tabs-item" v-if="searchType == 0" @click="pageUrl">全部分类 <image class="tabs-item-arrow"
<view class="tabs-item" @click="pageUrl">全部分类 <image class="tabs-item-arrow"
src="@/static/icons/search_row.png" mode=""></image>
</view>
<view class="tabs-item" v-if="searchType == 1" @click="companyOpne">{{companyName}}
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode=""></image>
</view>
</view>
</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>
@@ -52,36 +35,18 @@
return {
nameVal: '',
searchArr: [],
searchType: '0', // 分类 0位商品 1为企业
marketType: 'asc', // 排序
categoryArr: [], // 分类数组--企业
companyId: '', // 分类数组--企业id
companyName: '选择行业',
companyShow: false,
// 分页
pageStatus: '',
page: 1
goodsPage: 1
}
},
onLoad() {
this.searchType = this.$Route.query.type
// 商品分类默认关键字 type=0为商品列表; type=1为企业列表
let wechaUrl = '' // 定义接口来源名称
if (this.searchType == '0') wechaUrl = 'mall/randgoods' //商品关键字
if (this.searchType == '1') wechaUrl = 'companies/rand' //商品关键字
randgoodsUrl(wechaUrl, {
randgoodsUrl('mall/randgoods', {
type: 1
}).then(res => {
this.nameVal = res.name
})
// 企业分类数据
if (this.searchType == '1') {
companyCategory().then(res => {
this.categoryArr = res
})
}
},
methods: {
// 商品详情
@@ -93,47 +58,15 @@
}
})
},
// 打开微信小程序
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,
name: this.nameVal
}).then(res => {
if (res.page.current === 1) {
if (this.goodsPage === 1) {
this.searchArr = []
}
this.searchArr = this.searchArr.concat(res.data)
@@ -164,20 +97,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();
}
},
@@ -225,7 +144,7 @@
.search-btn {
line-height: 60rpx;
color: #e93340;
color: $mian-color;
}
}
@@ -238,7 +157,6 @@
box-sizing: border-box;
line-height: 80rpx;
text-align: center;
.tabs-item {
font-size: $title-size-m;
color: $text-gray;