新增打开微信小程序增加开通会员测试环境

This commit is contained in:
唐明明
2021-09-08 10:02:56 +08:00
parent 4f33cdbceb
commit c0ef48f7cf
11 changed files with 319 additions and 205 deletions

View File

@@ -18,7 +18,7 @@
mode="aspectFill"
/>
<view class="item-title nowrap">{{item.name || '-'}}</view>
<view class="item-btn">进店</view>
<view class="item-btn" @click="onOpenWechat(item)">进店</view>
</view>
</block>
</scroll-view>
@@ -49,16 +49,16 @@
</view>
<view class="trading nowrap">累计交易{{item.orders || 0}}</view>
</view>
<view class="btn">进店</view>
<view class="btn" @click="onOpenWechat(item)">进店</view>
</view>
</swiper-item>
</swiper>
<!-- 行业分类 -->
<scroll-view class="industry-tabs" scroll-x>
<view class="industry-item" :class="{'show':index === industryIndex}" v-for="(item, index) in industryBus" :key="index">{{item.title}}</view>
<view class="industry-item" :class="{'show':index === industryIndex}" v-for="(item, index) in industryBus" :key="index" @click="onBusIndustry(index)">{{item.title}}</view>
</scroll-view>
<!-- 商家 -->
<industry-list :list="busList" />
<industry-list :list="busList" @on-industry="onOpenWechat"/>
</block>
<!-- 易货商城 -->
<block v-if="tabIndex === 1">
@@ -193,7 +193,7 @@
console.log(res)
this.recommendBus = res.positions
this.hotBus = res.hot
this.industryBus = [{title: '全部',}, ...res.industries]
this.industryBus = [{title: '全部', industry_id: ''}, ...res.industries]
this.getCompaniesList()
}).catch(err => {
uni.showToast({
@@ -202,9 +202,16 @@
})
})
},
// 企业广场行业
onBusIndustry(index){
this.industryIndex = index
this.getCompaniesList()
},
// 企业列表
getCompaniesList(){
companiesList().then(res => {
companiesList({
industry_id: this.industryBus[this.industryIndex].industry_id
}).then(res => {
this.busList = res.data
this.busPages = res.pages
})
@@ -216,6 +223,11 @@
this.banners = res.banners
this.coupons = res.coupons
this.position = res.positions
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
this.getGoods()
},
@@ -233,6 +245,22 @@
// 易货分类
onClassify(){
this.$Router.push({name: 'goodsList'})
},
// 打开微信小程序
onOpenWechat(e){
plus.share.getServices(res => {
let sweixin = null;
for(let val of res){
console.log(val)
if(val.id === weixin){
sweixin = val
return
}
}
sweixin ? sweixin.launchMiniProgram({
id: e.original_id
}):plus.nativeUI.alert('当前环境不支持微信操作!');
})
}
}
}