mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 06:20:50 +00:00
Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev
This commit is contained in:
commit
68bdfd76c1
@ -97,8 +97,8 @@ export default {
|
||||
this.modals = false;
|
||||
setTimeout(() => {
|
||||
this.$emit('submitFail');
|
||||
this.loading = false;
|
||||
}, 1000);
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.loading = false;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<span>
|
||||
<Button icon="ios-arrow-back" size="small" type="text" @click="$router.go(-1)">返回</Button>
|
||||
</span>
|
||||
<Divider type="vertical"/>
|
||||
<Divider type="vertical" />
|
||||
<span class="ivu-page-header-title">{{ $route.params.id ? '编辑秒杀商品' : '添加秒杀商品' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -267,7 +267,7 @@
|
||||
<Col span="24">
|
||||
<FormItem label="规格选择:">
|
||||
<Table :data="specsData" :columns="columns" border @on-selection-change="changeCheckbox">
|
||||
<template slot-scope="{ row, index }" slot="price">
|
||||
<!-- <template slot-scope="{ row, index }" slot="price">
|
||||
<InputNumber
|
||||
v-model="row.price"
|
||||
:min="0.01"
|
||||
@ -280,7 +280,7 @@
|
||||
"
|
||||
:active-change="false"
|
||||
></InputNumber>
|
||||
</template>
|
||||
</template> -->
|
||||
<template slot-scope="{ row, index }" slot="pic">
|
||||
<div
|
||||
class="acea-row row-middle row-center-wrapper"
|
||||
@ -630,18 +630,18 @@ export default {
|
||||
title: title,
|
||||
key: key,
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
minWidth: 120,
|
||||
render: (h, params) => {
|
||||
return h('div', [
|
||||
h('InputNumber', {
|
||||
props: {
|
||||
min: 1,
|
||||
min: 0,
|
||||
precision: 0,
|
||||
value: params.row.quota,
|
||||
value: key === 'price' ? params.row.price : params.row.quota,
|
||||
},
|
||||
on: {
|
||||
'on-change': (e) => {
|
||||
params.row.quota = e;
|
||||
key === 'price' ? (params.row.price = e) : (params.row.quota = e);
|
||||
that.specsData[params.index] = params.row;
|
||||
if (!!that.formValidate.attrs && that.formValidate.attrs.length) {
|
||||
that.formValidate.attrs.forEach((v, index) => {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<span>
|
||||
<Button icon="ios-arrow-back" size="small" type="text" @click="$router.go(-1)">返回</Button>
|
||||
</span>
|
||||
<Divider type="vertical"/>
|
||||
<Divider type="vertical" />
|
||||
<span class="ivu-page-header-title">{{ $route.meta.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -26,8 +26,7 @@
|
||||
<Row type="flex" :gutter="24">
|
||||
<Col span="6" v-if="type == 1">
|
||||
<FormItem label="订单状态:" label-for="status">
|
||||
<Select v-model="pagination.status" placeholder="请选择订单状态">
|
||||
<Option value="">全部</Option>
|
||||
<Select v-model="pagination.status" clearable placeholder="请选择订单状态" @on-change="changeStatus">
|
||||
<Option value="0">未支付</Option>
|
||||
<Option value="1">待发货</Option>
|
||||
<Option value="2">待收货</Option>
|
||||
@ -199,6 +198,10 @@ export default {
|
||||
this.getList(this.id);
|
||||
},
|
||||
methods: {
|
||||
changeStatus() {
|
||||
this.pagination.page = 1;
|
||||
this.getList(this.id);
|
||||
},
|
||||
// 统计
|
||||
getStatistics(id) {
|
||||
getseckillStatistics(id).then((res) => {
|
||||
@ -246,7 +249,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
<style lang="less" scoped>
|
||||
.cl {
|
||||
margin-right: 20px;
|
||||
}
|
||||
@ -261,7 +264,7 @@ export default {
|
||||
.ech-box {
|
||||
margin-top: 10px;
|
||||
}
|
||||
/deep/ .ivu-tabs-nav-scroll{
|
||||
/deep/ .ivu-tabs-nav-scroll {
|
||||
background-color: #fff;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
</view>
|
||||
<view class='text acea-row row-column-around'>
|
||||
<view class='name line1'>{{item.title}}</view>
|
||||
<view class='money'>{{$t(`¥`)}}
|
||||
<view class='money font-color'>{{$t(`¥`)}}
|
||||
<text class='num font-color'>{{item.price}}</text>
|
||||
<text class="y_money">{{$t(`¥`)}}{{item.ot_price}}</text>
|
||||
</view>
|
||||
@ -180,8 +180,8 @@
|
||||
}
|
||||
|
||||
.noCommodity {
|
||||
background-color: #fff;
|
||||
padding-bottom: 30rpx;
|
||||
padding: 200rpx 0;
|
||||
.emptyBox{
|
||||
text-align: center;
|
||||
padding-top: 20rpx;
|
||||
@ -317,7 +317,6 @@
|
||||
|
||||
.flash-sale .list .item .text .money {
|
||||
font-size: 30rpx;
|
||||
color: #E93323;
|
||||
}
|
||||
|
||||
.flash-sale .list .item .text .money .num {
|
||||
|
||||
@ -1,94 +1,102 @@
|
||||
<template>
|
||||
<view class="lottery_container">
|
||||
<view class="grid_wrap">
|
||||
<view class="lottery_wrap">
|
||||
<ul class="lottery_grid">
|
||||
<li v-for="(item, index) in prizeData" :class="{ active: current_index == index && index != 8 }"
|
||||
:key="index" @click="luck_draw" :data-index="index">
|
||||
<view :class="{in_line:index != 8 }" class="lottery-msg">
|
||||
<image v-if="index != 8" class="grid_img" mode='aspectFit' :src="item.image" alt="" />
|
||||
<text v-if="index !=8" class="name">
|
||||
{{ index == 8 ? $t(`抽奖`) : item.name }}
|
||||
</text>
|
||||
<image v-else class="lottery-click" src="../../static/lottery-click.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
</li>
|
||||
</ul>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LotteryDraw from './js/grids_lottery.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current_index: -1,
|
||||
lotteryBtn: true
|
||||
};
|
||||
},
|
||||
props: {
|
||||
prizeData: {
|
||||
type: Array,
|
||||
default: function() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
luck_draw(event) {
|
||||
if (this.lotteryBtn) {
|
||||
this.lotteryBtn = false
|
||||
} else {
|
||||
return
|
||||
}
|
||||
let index = event.currentTarget.dataset.index;
|
||||
let that = this;
|
||||
if (index == 8) {
|
||||
// 点击抽奖之后知道获奖位置,修改父组件中lottery_draw_param的值
|
||||
this.$emit('get_winingIndex', function(res) {
|
||||
let lottery_draw_param = res;
|
||||
let win = new LotteryDraw({
|
||||
domData: that.prizeData,
|
||||
...lottery_draw_param
|
||||
},
|
||||
function(index, count) {
|
||||
that.current_index = index;
|
||||
if (lottery_draw_param.winingIndex == index && lottery_draw_param.totalCount ==
|
||||
count) {
|
||||
that.lotteryBtn = true
|
||||
that.$emit('luck_draw_finish', that.prizeData[index])
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './css/grids_lottery.css';
|
||||
|
||||
.lottery-msg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 4rpx;
|
||||
|
||||
.name {}
|
||||
}
|
||||
|
||||
.lottery-click {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
<template>
|
||||
<view class="lottery_container">
|
||||
<view class="grid_wrap">
|
||||
<view class="lottery_wrap">
|
||||
<ul class="lottery_grid">
|
||||
<li v-for="(item, index) in prizeData" :class="{ active: current_index == index && index != 8 }"
|
||||
:key="index" @click="luck_draw" :data-index="index">
|
||||
<view :class="{in_line:index != 8 }" class="lottery-msg">
|
||||
<image v-if="index != 8" class="grid_img" mode='aspectFit' :src="item.image" alt="" />
|
||||
<text v-if="index !=8" class="name">
|
||||
{{ index == 8 ? $t(`抽奖`) : item.name }}
|
||||
</text>
|
||||
<image v-else class="lottery-click" src="../../static/lottery-click.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
</li>
|
||||
</ul>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LotteryDraw from './js/grids_lottery.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current_index: -1,
|
||||
lotteryBtn: true
|
||||
};
|
||||
},
|
||||
props: {
|
||||
prizeData: {
|
||||
type: Array,
|
||||
default: function() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
lotteryNum: {
|
||||
type: Number | String,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
luck_draw(event) {
|
||||
if (Number(this.lotteryNum) <= 0) {
|
||||
return this.$util.Tips({
|
||||
title: this.$t(`剩余抽奖次数为0`)
|
||||
});
|
||||
} else if (this.lotteryBtn) {
|
||||
this.lotteryBtn = false
|
||||
} else {
|
||||
return
|
||||
}
|
||||
let index = event.currentTarget.dataset.index;
|
||||
let that = this;
|
||||
if (index == 8) {
|
||||
// 点击抽奖之后知道获奖位置,修改父组件中lottery_draw_param的值
|
||||
this.$emit('get_winingIndex', function(res) {
|
||||
let lottery_draw_param = res;
|
||||
let win = new LotteryDraw({
|
||||
domData: that.prizeData,
|
||||
...lottery_draw_param
|
||||
},
|
||||
function(index, count) {
|
||||
that.current_index = index;
|
||||
if (lottery_draw_param.winingIndex == index && lottery_draw_param.totalCount ==
|
||||
count) {
|
||||
that.lotteryBtn = true
|
||||
that.$emit('luck_draw_finish', that.prizeData[index])
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './css/grids_lottery.css';
|
||||
|
||||
.lottery-msg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 4rpx;
|
||||
|
||||
.name {}
|
||||
}
|
||||
|
||||
.lottery-click {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<view class="grids" v-show="lotteryShow">
|
||||
<image class="grids-bag" src="../static/pay-lottery-bag.png" mode=""></image>
|
||||
<view class="grids-box">
|
||||
<gridsLottery class="" :prizeData="prize" @get_winingIndex='getWiningIndex'
|
||||
<gridsLottery class="" :lotteryNum="lottery_num" :prizeData="prize" @get_winingIndex='getWiningIndex'
|
||||
@luck_draw_finish='luck_draw_finish'>
|
||||
</gridsLottery>
|
||||
</view>
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<noticeBar :showMsg="userList.data"></noticeBar>
|
||||
</view>
|
||||
<view class="grids-box">
|
||||
<gridsLottery class="" :prizeData="prize" @get_winingIndex='getWiningIndex'
|
||||
<gridsLottery class="" :prizeData="prize" :lotteryNum="lottery_num" @get_winingIndex='getWiningIndex'
|
||||
@luck_draw_finish='luck_draw_finish'>
|
||||
</gridsLottery>
|
||||
</view>
|
||||
|
||||
@ -1,244 +1,246 @@
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class="record" v-if="lotteryList.length">
|
||||
<view class="record-list" v-for="item in lotteryList" :key="item.id">
|
||||
<image class="goods-img" :src="item.prize.image" mode=""></image>
|
||||
<view class="right-data">
|
||||
<view class="title line1">
|
||||
{{item.prize.name}}
|
||||
</view>
|
||||
<view class="goods-msg">
|
||||
{{$t(`奖品类型`)}}:
|
||||
<text class="num">
|
||||
{{item.prize.type | typeName}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="goods-msg exchange" v-if="item.type == 6 && !item.receive_time"
|
||||
@click="fromAddress(item)">
|
||||
{{$t(`立即兑换`)}}
|
||||
</view>
|
||||
<view class="goods-msg" v-else>
|
||||
{{$t(`兑换时间`)}}:
|
||||
{{item.receive_time || '--'}}
|
||||
</view>
|
||||
|
||||
<view class="goods-msg" v-if="item.deliver_info.deliver_name">
|
||||
{{$t(`快递公司`)}}:
|
||||
{{item.deliver_info.deliver_name || '--'}}
|
||||
</view>
|
||||
<view class="goods-msg" v-if="item.deliver_info.deliver_number">
|
||||
{{$t(`快递单号`)}}:
|
||||
{{item.deliver_info.deliver_number || '--'}}
|
||||
<!-- #ifndef H5 -->
|
||||
<view v-if="item.deliver_info.deliver_number" class='copy'
|
||||
@tap='copyOrderId(item.deliver_info.deliver_number)'>{{$t(`复制`)}}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view v-if="item.deliver_info.deliver_number" class='copy copy-data'
|
||||
:data-clipboard-text="item.deliver_info.deliver_number">{{$t(`复制`)}}</view>
|
||||
<!-- #endif -->
|
||||
<!-- <view v-if="item.deliver_info.deliver_number" class='copy' @tap='copyOrderId(item.deliver_info.deliver_number)'>复制</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if='lotteryList.length > 0'>
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="lotteryList.length === 0 && !loading">
|
||||
<emptyPage :title="$t(`暂无中奖记录`)"></emptyPage>
|
||||
</block>
|
||||
<userAddress :aleartStatus="addressModel" @getAddress="getAddress" @close="()=>{addressModel = false}">
|
||||
</userAddress>
|
||||
<view v-if="addressModel" class="mask" @close="()=>{addressModel = false}"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
|
||||
import {
|
||||
getLotteryList,
|
||||
receiveLottery
|
||||
} from '@/api/lottery.js'
|
||||
import userAddress from '../components/userAddress.vue'
|
||||
import emptyPage from '@/components/emptyPage.vue'
|
||||
import colors from '@/mixins/color.js';
|
||||
export default {
|
||||
components: {
|
||||
emptyPage,
|
||||
userAddress
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
addressModel: false,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
},
|
||||
lotteryList: [],
|
||||
loadTitle: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getLotteryList()
|
||||
},
|
||||
filters: {
|
||||
typeName(type) {
|
||||
console.log(type)
|
||||
if (type == 2) {
|
||||
return '积分'
|
||||
} else if (type == 3) {
|
||||
return '余额'
|
||||
} else if (type == 4) {
|
||||
return '红包'
|
||||
} else if (type == 5) {
|
||||
return '优惠券'
|
||||
} else if (type == 6) {
|
||||
return '商品'
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady: function() {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
this.$nextTick(function() {
|
||||
const clipboard = new ClipboardJS(".copy-data");
|
||||
clipboard.on("success", () => {
|
||||
this.$util.Tips({
|
||||
title: this.$t(`复制成功`)
|
||||
});
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
getAddress(data) {
|
||||
let addData = data
|
||||
addData.id = this.addid
|
||||
addData.address = data.address.province + data.address.city + data.address.district + data.detail
|
||||
receiveLottery(addData).then(res => {
|
||||
this.$util.Tips({
|
||||
title: this.$t(`领取成功`)
|
||||
});
|
||||
this.addressModel = false
|
||||
}).catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
fromAddress(item) {
|
||||
this.addid = item.id
|
||||
this.addressModel = true
|
||||
},
|
||||
// #ifndef H5
|
||||
copyOrderId: function(data) {
|
||||
let that = this;
|
||||
uni.setClipboardData({
|
||||
data: data
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
getLotteryList() {
|
||||
let that = this;
|
||||
if (this.loadend) return;
|
||||
if (this.loading) return;
|
||||
this.loading = true;
|
||||
this.loadTitle = '';
|
||||
getLotteryList(this.where).then(res => {
|
||||
let list = res.data;
|
||||
let lotteryList = this.$util.SplitArray(list, this.lotteryList);
|
||||
let loadend = list.length < this.where.limit;
|
||||
this.loadend = loadend;
|
||||
this.loading = false;
|
||||
this.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
|
||||
this.$set(this, 'lotteryList', lotteryList);
|
||||
this.$set(this.where, 'page', this.where.page + 1);
|
||||
}).catch(err => {
|
||||
that.loading = false;
|
||||
that.loadTitle = that.$t(`加载更多`);
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.lotteryList.length > 0) {
|
||||
this.getLotteryList();
|
||||
} else {
|
||||
this.getLotteryList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.record {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.record-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
height: 100%;
|
||||
|
||||
.goods-img {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.right-data {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-height: 170rpx;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
|
||||
}
|
||||
|
||||
.goods-msg {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
|
||||
.num {
|
||||
color: var(--view-theme);
|
||||
}
|
||||
|
||||
.copy {
|
||||
display: -webkit-inline-box;
|
||||
display: -webkit-inline-flex;
|
||||
width: 60rpx;
|
||||
margin-left: 10rpx;
|
||||
padding: 0rpx 4rpx;
|
||||
border: 2rpx solid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.exchange {
|
||||
color: #fff;
|
||||
background-color: var(--view-theme);
|
||||
border-radius: 30rpx;
|
||||
text-align: center;
|
||||
padding: 4rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="colorStyle">
|
||||
<view class="record" v-if="lotteryList.length">
|
||||
<view class="record-list" v-for="item in lotteryList" :key="item.id">
|
||||
<image class="goods-img" :src="item.prize.image" mode=""></image>
|
||||
<view class="right-data">
|
||||
<view class="title line1">
|
||||
{{item.prize.name}}
|
||||
</view>
|
||||
<view class="goods-msg">
|
||||
{{$t(`奖品类型`)}}:
|
||||
<text class="num">
|
||||
{{item.prize.type | typeName}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="goods-msg exchange" v-if="item.type == 6 && !item.receive_time"
|
||||
@click="fromAddress(item)">
|
||||
{{$t(`立即兑换`)}}
|
||||
</view>
|
||||
<view class="goods-msg" v-else>
|
||||
{{$t(`兑换时间`)}}:
|
||||
{{item.receive_time || '--'}}
|
||||
</view>
|
||||
|
||||
<view class="goods-msg" v-if="item.deliver_info.deliver_name">
|
||||
{{$t(`快递公司`)}}:
|
||||
{{item.deliver_info.deliver_name || '--'}}
|
||||
</view>
|
||||
<view class="goods-msg" v-if="item.deliver_info.deliver_number">
|
||||
{{$t(`快递单号`)}}:
|
||||
{{item.deliver_info.deliver_number || '--'}}
|
||||
<!-- #ifndef H5 -->
|
||||
<view v-if="item.deliver_info.deliver_number" class='copy'
|
||||
@tap='copyOrderId(item.deliver_info.deliver_number)'>{{$t(`复制`)}}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view v-if="item.deliver_info.deliver_number" class='copy copy-data'
|
||||
:data-clipboard-text="item.deliver_info.deliver_number">{{$t(`复制`)}}</view>
|
||||
<!-- #endif -->
|
||||
<!-- <view v-if="item.deliver_info.deliver_number" class='copy' @tap='copyOrderId(item.deliver_info.deliver_number)'>复制</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if='lotteryList.length > 0'>
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="lotteryList.length === 0 && !loading">
|
||||
<emptyPage :title="$t(`暂无中奖记录`)"></emptyPage>
|
||||
</block>
|
||||
<userAddress :aleartStatus="addressModel" @getAddress="getAddress" @close="()=>{addressModel = false}">
|
||||
</userAddress>
|
||||
<view v-if="addressModel" class="mask" @close="()=>{addressModel = false}"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
|
||||
import {
|
||||
getLotteryList,
|
||||
receiveLottery
|
||||
} from '@/api/lottery.js'
|
||||
import userAddress from '../components/userAddress.vue'
|
||||
import emptyPage from '@/components/emptyPage.vue'
|
||||
import colors from '@/mixins/color.js';
|
||||
export default {
|
||||
components: {
|
||||
emptyPage,
|
||||
userAddress
|
||||
},
|
||||
mixins: [colors],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
addressModel: false,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
},
|
||||
lotteryList: [],
|
||||
loadTitle: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getLotteryList()
|
||||
},
|
||||
filters: {
|
||||
typeName(type) {
|
||||
console.log(type)
|
||||
if (type == 2) {
|
||||
return '积分'
|
||||
} else if (type == 3) {
|
||||
return '余额'
|
||||
} else if (type == 4) {
|
||||
return '红包'
|
||||
} else if (type == 5) {
|
||||
return '优惠券'
|
||||
} else if (type == 6) {
|
||||
return '商品'
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady: function() {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
this.$nextTick(function() {
|
||||
const clipboard = new ClipboardJS(".copy-data");
|
||||
clipboard.on("success", () => {
|
||||
this.$util.Tips({
|
||||
title: this.$t(`复制成功`)
|
||||
});
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
getAddress(data) {
|
||||
let addData = data
|
||||
addData.id = this.addid
|
||||
addData.address = data.address.province + data.address.city + data.address.district + data.detail
|
||||
receiveLottery(addData).then(res => {
|
||||
this.$util.Tips({
|
||||
title: this.$t(`领取成功`)
|
||||
});
|
||||
this.addressModel = false
|
||||
this.where.page = 1
|
||||
this.getLotteryList()
|
||||
}).catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
fromAddress(item) {
|
||||
this.addid = item.id
|
||||
this.addressModel = true
|
||||
},
|
||||
// #ifndef H5
|
||||
copyOrderId: function(data) {
|
||||
let that = this;
|
||||
uni.setClipboardData({
|
||||
data: data
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
getLotteryList() {
|
||||
let that = this;
|
||||
if (this.loadend) return;
|
||||
if (this.loading) return;
|
||||
this.loading = true;
|
||||
this.loadTitle = '';
|
||||
getLotteryList(this.where).then(res => {
|
||||
let list = res.data;
|
||||
let lotteryList = this.$util.SplitArray(list, this.lotteryList);
|
||||
let loadend = list.length < this.where.limit;
|
||||
this.loadend = loadend;
|
||||
this.loading = false;
|
||||
this.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
|
||||
this.$set(this, 'lotteryList', lotteryList);
|
||||
this.$set(this.where, 'page', this.where.page + 1);
|
||||
}).catch(err => {
|
||||
that.loading = false;
|
||||
that.loadTitle = that.$t(`加载更多`);
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.lotteryList.length > 0) {
|
||||
this.getLotteryList();
|
||||
} else {
|
||||
this.getLotteryList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.record {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.record-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
height: 100%;
|
||||
|
||||
.goods-img {
|
||||
width: 170rpx;
|
||||
height: 170rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.right-data {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-height: 170rpx;
|
||||
|
||||
.title {
|
||||
font-size: 28rpx;
|
||||
|
||||
}
|
||||
|
||||
.goods-msg {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
|
||||
.num {
|
||||
color: var(--view-theme);
|
||||
}
|
||||
|
||||
.copy {
|
||||
display: -webkit-inline-box;
|
||||
display: -webkit-inline-flex;
|
||||
width: 60rpx;
|
||||
margin-left: 10rpx;
|
||||
padding: 0rpx 4rpx;
|
||||
border: 2rpx solid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.exchange {
|
||||
color: #fff;
|
||||
background-color: var(--view-theme);
|
||||
border-radius: 30rpx;
|
||||
text-align: center;
|
||||
padding: 4rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<view class="grids" v-show="lotteryShow">
|
||||
<image class="grids-bag" src="../static/pay-lottery-bag.png" mode=""></image>
|
||||
<view class="grids-box">
|
||||
<gridsLottery class="" :prizeData="prize" @get_winingIndex='getWiningIndex'
|
||||
<gridsLottery class="" :lotteryNum="lottery_num" :prizeData="prize" @get_winingIndex='getWiningIndex'
|
||||
@luck_draw_finish='luck_draw_finish'>
|
||||
</gridsLottery>
|
||||
</view>
|
||||
|
||||
@ -521,10 +521,16 @@
|
||||
if (
|
||||
that.attr.productAttr.length &&
|
||||
productSelect === undefined
|
||||
)
|
||||
) {
|
||||
return that.$util.Tips({
|
||||
title: that.$t(`该产品没有更多库存了`)
|
||||
});
|
||||
}
|
||||
if (that.attr.productSelect.cart_num <= 0) {
|
||||
return that.$util.Tips({
|
||||
title: that.$t(`最少添加 1 件商品`)
|
||||
});
|
||||
}
|
||||
}
|
||||
let q = {
|
||||
product_id: id,
|
||||
|
||||
@ -232,10 +232,13 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/.uni-scroll-view-content{
|
||||
<style lang="scss" scoped>
|
||||
/deep/.uni-scroll-view-content,
|
||||
.scroll-view_x {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.hotList {
|
||||
background-color: #fff;
|
||||
margin: $uni-index-margin-row $uni-index-margin-col;
|
||||
@ -293,14 +296,15 @@
|
||||
// }
|
||||
|
||||
.hotList .list {
|
||||
width: 690rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #fff;
|
||||
margin: 0rpx auto 0 auto;
|
||||
padding: 20rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hotList .list .item {
|
||||
@ -308,6 +312,8 @@
|
||||
background: var(--view-op-ten);
|
||||
border-radius: 12rpx;
|
||||
margin-right: 20rpx;
|
||||
display: inline-block;
|
||||
|
||||
.rectangle {
|
||||
margin: 0 auto;
|
||||
border-radius: 30rpx;
|
||||
|
||||
@ -145,7 +145,7 @@
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
if (this.is_show) this.userSpreadNewList();
|
||||
// if (this.is_show) this.userSpreadNewList();
|
||||
},
|
||||
onHide: function() {
|
||||
this.is_show = true;
|
||||
@ -370,7 +370,7 @@
|
||||
.no-data {
|
||||
background-color: #fff;
|
||||
padding-bottom: 30rpx;
|
||||
padding: 100rpx 0;
|
||||
padding: 180rpx 0 300rpx;
|
||||
|
||||
.emptyBox {
|
||||
text-align: center;
|
||||
|
||||
@ -199,16 +199,17 @@
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.coupon-list .item .text{
|
||||
padding: 14rpx 10rpx;
|
||||
}
|
||||
.coupon-list .item .text .condition {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition .name {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
line-height: 28rpx;
|
||||
line-height: 34rpx;
|
||||
/* display: flex;
|
||||
align-items: center; */
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
:class="activePic == picList.length ? 'pic-box-color-active' : ''"
|
||||
@click="picCharge(picList.length)">
|
||||
<input type="number" :placeholder="$t(`其他`)" v-model="money"
|
||||
class="pic-box-money pic-number-pic"
|
||||
class="pic-box-money pic-number-pic"
|
||||
:placeholder-class="activePic == picList.length ? 'active' :''"
|
||||
:class="activePic == picList.length ? 'pic-box-color-active' : ''" />
|
||||
</view>
|
||||
@ -523,15 +523,19 @@
|
||||
}
|
||||
},
|
||||
})
|
||||
} else {
|
||||
if(this.numberPic == '') this.numberPic = this.money;
|
||||
} else {
|
||||
if (this.numberPic == '') this.numberPic = this.money;
|
||||
this.pay()
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.tip .pic-box-color .active {
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
width: 100%;
|
||||
@ -677,9 +681,11 @@
|
||||
margin-right: 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.active{
|
||||
color: #fff !important;
|
||||
|
||||
.active {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.pic-box-color-active {
|
||||
background-color: var(--view-theme) !important;
|
||||
color: #fff !important;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user