修复部分bug
This commit is contained in:
@@ -152,7 +152,7 @@
|
||||
<view class="title">
|
||||
限时抢购<text>海量商家优惠券</text>
|
||||
</view>
|
||||
<navigator class="more" open-type="navigate" url="/pages/coupons/couponList">查看更多</navigator>
|
||||
<view class="more" @click="onCoupons('more')">查看更多</view>
|
||||
</view>
|
||||
<view class="coupons" v-if="coupons.length > 0">
|
||||
<view class="coupons-item" v-for="(item, index) in coupons" :key="index">
|
||||
@@ -173,7 +173,7 @@
|
||||
<view class="logo">
|
||||
<image class="logo-img" :src="item.cover" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="btn">立即领取</view>
|
||||
<button class="btn" :disabled="!item.can.get" @click="onCoupons('get', item.coupon_id, index)">{{item.can.get ? '立即领取' : '已领取'}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 优选商品 -->
|
||||
@@ -186,9 +186,10 @@
|
||||
|
||||
<script>
|
||||
import { companies, companiesList } from '@/apis/interfaces/company'
|
||||
import { mall, list } from '@/apis/interfaces/goods'
|
||||
import { mall, list, managesCoupons } from '@/apis/interfaces/goods'
|
||||
import goodsList from '@/components/goods-list/goods-list'
|
||||
import industryList from '@/components/industry-list/industry-list'
|
||||
import userAuth from '@/public/userAuth'
|
||||
export default{
|
||||
comments:{
|
||||
goodsList,
|
||||
@@ -251,6 +252,34 @@
|
||||
break
|
||||
}
|
||||
},
|
||||
// 领取,更多优惠券
|
||||
onCoupons(type, id, index){
|
||||
let token = this.$store.getters.getToken
|
||||
if(token == ''){
|
||||
let userLogin = new userAuth()
|
||||
userLogin.Login()
|
||||
return
|
||||
}
|
||||
if(type === 'more'){
|
||||
this.$Router.push({name: 'CouponsList'})
|
||||
return
|
||||
}
|
||||
if(type === 'get'){
|
||||
managesCoupons(id).then(res=>{
|
||||
this.$set(this.coupons, index, res)
|
||||
uni.showToast({
|
||||
title: '领取成功',
|
||||
type: 'primary',
|
||||
duration: 3000
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon : 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 企业广场
|
||||
getCompanies(){
|
||||
companies().then(res=>{
|
||||
@@ -323,7 +352,6 @@
|
||||
},
|
||||
// 打开微信小程序
|
||||
onOpenWechat(e){
|
||||
console.log(e)
|
||||
plus.share.getServices(res => {
|
||||
let sweixin = null;
|
||||
for(let val of res){
|
||||
@@ -568,7 +596,14 @@
|
||||
text-align: center;
|
||||
line-height: 64rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
font-weight: 600;
|
||||
&[disabled]{
|
||||
background: rgba($color: #faf2dd, $alpha: .8);
|
||||
color: rgba($color: #fd5f3c, $alpha: .5);
|
||||
}
|
||||
&::after{
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user