增加基本项目配置
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<div class="bargain-record" ref="container">
|
||||
<div class="item" v-for="(item, bargainrecordIndex) in bargain" :key="bargainrecordIndex">
|
||||
<div class="picTxt acea-row row-between-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="item.image" />
|
||||
</div>
|
||||
<div class="text acea-row row-column-around">
|
||||
<div class="line1">{{ item.title }}</div>
|
||||
<count-down
|
||||
:is-day="true"
|
||||
:tip-text="'倒计时 '"
|
||||
:day-text="' 天 '"
|
||||
:hour-text="' 时 '"
|
||||
:minute-text="' 分 '"
|
||||
:second-text="' 秒'"
|
||||
:datatime="item.datatime"
|
||||
></count-down>
|
||||
<div class="money font-color-red">
|
||||
已砍至
|
||||
<span class="symbol">¥</span>
|
||||
<span class="num">{{ item.residuePrice }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom acea-row row-between-wrapper">
|
||||
<div class="purple" v-if="item.status === 1">活动进行中</div>
|
||||
<div class="success" v-else-if="item.status === 3">砍价成功</div>
|
||||
<div class="end" v-else>活动已结束</div>
|
||||
<div class="acea-row row-middle row-right">
|
||||
<div
|
||||
class="bnt cancel"
|
||||
v-if="item.status === 1"
|
||||
@click="getBargainUserCancel(item.bargainId)"
|
||||
>取消活动</div>
|
||||
<div
|
||||
class="bnt bg-color-red"
|
||||
v-if="item.status === 1"
|
||||
@click="goDetail(item.bargainId)"
|
||||
>继续砍价</div>
|
||||
<div class="bnt bg-color-red" v-else @click="goList">重开一个</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Loading :loaded="status" :loading="loadingList"></Loading>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import CountDown from "@/components/CountDown";
|
||||
import { getBargainUserList, getBargainUserCancel } from "@/api/activity";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
name: "BargainRecord",
|
||||
components: {
|
||||
CountDown,
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
bargain: [],
|
||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成
|
||||
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
|
||||
page: 1, //页码
|
||||
limit: 20 //数量
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getBargainUserList();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loadingList && this.getBargainUserList();
|
||||
},
|
||||
methods: {
|
||||
goDetail: function(id) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/DargainDetails/main",
|
||||
query: { id, partake: 0 }
|
||||
});
|
||||
},
|
||||
goList: function() {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GoodsBargain/main"
|
||||
});
|
||||
},
|
||||
getBargainUserList: function() {
|
||||
var that = this;
|
||||
if (that.loadingList) return;
|
||||
if (that.status) return;
|
||||
getBargainUserList({ page: that.page, limit: that.limit })
|
||||
.then(res => {
|
||||
that.status = res.data.length < that.limit;
|
||||
that.bargain.push.apply(that.bargain, res.data);
|
||||
that.page++;
|
||||
that.loadingList = false;
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
getBargainUserCancel: function(bargainId) {
|
||||
var that = this;
|
||||
getBargainUserCancel({ bargainId: bargainId })
|
||||
.then(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
that.status = false;
|
||||
that.loadingList = false;
|
||||
that.page = 1;
|
||||
that.bargain = [];
|
||||
that.getBargainUserList();
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,509 @@
|
||||
<template>
|
||||
<div class="bargain">
|
||||
<!-- 在header上加 on 为请求支援 -->
|
||||
<div :class="[bargainPartake != userInfo.uid ? 'header on' : 'header']">
|
||||
<div class="people">{{ lookCount }}人查看 丨 {{ shareCount }}人分享 丨 {{ userCount }}人参与</div>
|
||||
<!-- 帮助砍价、帮砍成功:-->
|
||||
<div class="pictxt acea-row row-center-wrapper" v-if="bargainPartake != userInfo.uid">
|
||||
<div class="pictrue">
|
||||
<img :src="bargainUserInfo.avatar" />
|
||||
</div>
|
||||
<div class="text">
|
||||
{{ bargainUserInfo.nickname }}
|
||||
<span>邀请您帮忙砍价</span>
|
||||
</div>
|
||||
</div>
|
||||
<count-down
|
||||
:is-day="true"
|
||||
:tip-text="'倒计时 '"
|
||||
:day-text="' 天 '"
|
||||
:hour-text="' 时 '"
|
||||
:minute-text="' 分 '"
|
||||
:second-text="' 秒'"
|
||||
:datatime="datatime"
|
||||
></count-down>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="pictxt acea-row row-between-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="bargain.image" />
|
||||
</div>
|
||||
<div class="text acea-row row-column-around">
|
||||
<div class="line2" v-text="bargain.title"></div>
|
||||
<div class="money font-color-red">
|
||||
已砍至: ¥
|
||||
<span class="num" v-text="price"></span>
|
||||
</div>
|
||||
<div class="acea-row row-middle">
|
||||
<div class="successNum" v-text="'原价' + bargain.price"></div>
|
||||
<div class="successNum" v-text="'已有' + bargainSumCount + '人砍价成功'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cu-progress acea-row row-middle round margin-top">
|
||||
<div
|
||||
class="acea-row row-middle bg-red"
|
||||
:style="{ width: loading ? pricePercent + '%' : '' }"
|
||||
></div>
|
||||
</div>
|
||||
<div class="balance acea-row row-between-wrapper">
|
||||
<div v-text="'已砍' + alreadyPrice + '元'"></div>
|
||||
<div v-if="surplusPrice === 0">砍价成功</div>
|
||||
<div v-else v-text="'还剩' + surplusPrice + '元'"></div>
|
||||
</div>
|
||||
<!-- 帮助砍价、帮砍成功:-->
|
||||
<!--<div class='bargainSuccess'><span class='iconfont icon-xiaolian'></span>已成功帮助好友砍价</div>-->
|
||||
<div class="bargainBnts">
|
||||
<div
|
||||
class="bargainBnt"
|
||||
@click="goPoster"
|
||||
v-if="bargainPartake === userInfo.uid && surplusPrice > 0"
|
||||
>邀请好友帮砍价</div>
|
||||
<div
|
||||
class="bargainBnt"
|
||||
@click="getBargainHelp"
|
||||
v-else-if="bargainPartake != userInfo.uid"
|
||||
>帮好友砍一刀</div>
|
||||
<div class="bargainBnt" @click="getBargainStart" v-if="bargainPartake != userInfo.uid">开启砍价</div>
|
||||
<div
|
||||
class="bargainBnt"
|
||||
@click="goPay"
|
||||
v-if="surplusPrice === 0 && bargainPartake === userInfo.uid && userBargainStatus === 1"
|
||||
>立即支付</div>
|
||||
<div class="bargainBnt on" @click="goList">抢更多商品</div>
|
||||
</div>
|
||||
<div class="tip">
|
||||
已有
|
||||
<span class="font-color-red" v-text="helpCount"></span>
|
||||
位好友成功帮您砍价
|
||||
</div>
|
||||
<div class="lock"></div>
|
||||
</div>
|
||||
<div class="bargainGang">
|
||||
<div class="title font-color-red acea-row row-center-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/left.png'" />
|
||||
</div>
|
||||
<div class="titleCon">砍价帮</div>
|
||||
<div class="pictrue on">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/left.png'" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, bargainHelpListIndex) in bargainHelpList"
|
||||
:key="bargainHelpListIndex"
|
||||
>
|
||||
<div class="pictxt acea-row row-between-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="item.avatar" />
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="name line1" v-text="item.nickname"></div>
|
||||
<div class="line1" v-text="item.add_time"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="money font-color-red">
|
||||
<span class="iconfont icon-kanjia"></span>
|
||||
砍掉{{ item.price }}元
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="load font-color-red"
|
||||
v-if="!helpListStatus && !helpListLoading"
|
||||
@click="getBargainHelpList"
|
||||
>点击加载更多</div>
|
||||
<div class="lock"></div>
|
||||
</div>
|
||||
<div class="goodsDetails">
|
||||
<div class="title font-color-red acea-row row-center-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/left.png'" />
|
||||
</div>
|
||||
<div class="titleCon">商品详情</div>
|
||||
<div class="pictrue on">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/left.png'" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="conter" v-html="bargain.description"></div>
|
||||
<div class="lock"></div>
|
||||
</div>
|
||||
<div class="goodsDetails">
|
||||
<div class="title font-color-red acea-row row-center-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/left.png'" />
|
||||
</div>
|
||||
<div class="titleCon">活动规则</div>
|
||||
<div class="pictrue on">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/left.png'" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="conter" v-html="bargain.rule"></div>
|
||||
</div>
|
||||
<div class="bargainTip" :class="active === true ? 'on' : ''">
|
||||
<div class="pictrue">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/bargainBg.jpg'" />
|
||||
<div class="iconfont icon-guanbi" @click="close"></div>
|
||||
</div>
|
||||
<div class="cutOff" v-if="bargainPartake === userInfo.uid">
|
||||
您已砍掉
|
||||
<span class="font-color-red" v-text="bargainHelpPrice"></span>元,听说分享次数越多砍价成功的机会越大哦!
|
||||
</div>
|
||||
<div class="cutOff on" v-else>
|
||||
<div class="help font-color-red" v-text="'成功帮砍' + bargainHelpPrice + '元'"></div>,您也可以砍价低价拿哦,快去挑选心仪的商品吧~
|
||||
</div>
|
||||
<div class="tipBnt" @click="goPoster" v-if="bargainPartake === userInfo.uid">邀请好友帮砍价</div>
|
||||
<div class="tipBnt" @click="getBargainStart" v-else>我也要参与</div>
|
||||
</div>
|
||||
<div class="mask" @touchmove.prevent :hidden="active === false" @click="close"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import CountDown from "@/components/CountDown";
|
||||
import {
|
||||
getBargainDetail,
|
||||
getBargainShare,
|
||||
getBargainStart,
|
||||
getBargainHelp,
|
||||
getBargainHelpPrice,
|
||||
getBargainHelpList,
|
||||
getBargainHelpCount,
|
||||
getBargainStartUser
|
||||
} from "@/api/activity";
|
||||
import { postCartAdd } from "@/api/store";
|
||||
import { mapGetters } from "vuex";
|
||||
import {} from "@/libs/wechat";
|
||||
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
|
||||
|
||||
const NAME = "DargainDetails";
|
||||
|
||||
export default {
|
||||
name: "DargainDetails",
|
||||
components: {
|
||||
CountDown
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
price: 0,
|
||||
bargainId: 0, //砍价编号
|
||||
bargainPartake: 0, //参与砍价
|
||||
bargain: [], //砍价产品信息
|
||||
partake: null,
|
||||
bargainSumCount: 0, //砍价成功人数
|
||||
activeMsg: "",
|
||||
active: false,
|
||||
loading: false,
|
||||
datatime: 0,
|
||||
lookCount: 0, //查看人数
|
||||
shareCount: 0, //分享人数
|
||||
userCount: 0, //参与人数
|
||||
bargainHelpPrice: 0, //砍掉金额
|
||||
bargainHelpList: [],
|
||||
helpListStatus: false, //砍价列表是否获取完成 false 未完成 true 完成
|
||||
helpListLoading: false, //当前接口是否请求完成 false 完成 true 未完成
|
||||
page: 1, //页码
|
||||
limit: 2, //数量
|
||||
helpCount: 0, //砍价帮总人数
|
||||
surplusPrice: 0, //剩余金额
|
||||
alreadyPrice: 0, //已砍掉价格
|
||||
pricePercent: 0, //砍价进度条
|
||||
bargainUserInfo: [], //砍价 开启砍价用户信息
|
||||
userBargainStatus: 2 //砍价状态
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["userInfo", "isLogin"]),
|
||||
// watch: {
|
||||
// $yroute: function(n) {
|
||||
// var that = this;
|
||||
// if (n.name === NAME) {
|
||||
// that.mountedStart();
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
mounted: function() {
|
||||
var that = this;
|
||||
that.mountedStart();
|
||||
setTimeout(function() {
|
||||
that.loading = true;
|
||||
}, 500);
|
||||
},
|
||||
methods: {
|
||||
mountedStart: function() {
|
||||
var that = this;
|
||||
let url = handleQrCode();
|
||||
if (url) {
|
||||
that.bargainId = url.bargainId;
|
||||
that.partake = url.uid;
|
||||
} else {
|
||||
that.bargainId = that.$yroute.query.id;
|
||||
that.partake = parseInt(that.$yroute.query.partake);
|
||||
}
|
||||
if (
|
||||
this.partake === undefined ||
|
||||
this.partake <= 0 ||
|
||||
isNaN(this.partake)
|
||||
) {
|
||||
that.bargainPartake = that.userInfo.uid;
|
||||
// that.$yrouter.push({
|
||||
// path: "/pages/activity/DargainDetails/main",
|
||||
// query: { id: that.bargainId, partake: that.bargainPartake }
|
||||
// });
|
||||
} else {
|
||||
that.bargainPartake = parseInt(this.partake);
|
||||
}
|
||||
that.getBargainHelpCountStart();
|
||||
that.getBargainDetail();
|
||||
that.getBargainShare(0);
|
||||
if (that.bargainPartake === that.userInfo.uid) that.getBargainStart();
|
||||
else that.getBargainStartUser();
|
||||
},
|
||||
updateTitle() {
|
||||
// document.title = this.bargain.title || this.$yroute.meta.title;
|
||||
},
|
||||
goPay: function() {
|
||||
var data = {};
|
||||
var that = this;
|
||||
data.productId = that.bargain.productId;
|
||||
data.cartNum = that.bargain.num;
|
||||
data.uniqueId = "";
|
||||
data.bargainId = that.bargainId;
|
||||
data.new = 1;
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
that.$yrouter.push({
|
||||
path: "/pages/order/OrderSubmission/main",
|
||||
query: { id: res.data.cartId }
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.$dialog.error(err.msg || err.response.data.msg);
|
||||
});
|
||||
},
|
||||
goPoster: function() {
|
||||
var that = this;
|
||||
that.getBargainShare(that.bargainId);
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/Poster/main",
|
||||
query: { id: that.bargainId, type: 2 }
|
||||
});
|
||||
},
|
||||
goList: function() {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GoodsBargain/main"
|
||||
});
|
||||
},
|
||||
//砍价分享
|
||||
//bargainId 0 获取 查看人数 分享人数 参与人数
|
||||
//bargainId 砍价产品编号 添加分享次数 获取 查看人数 分享人数 参与人数
|
||||
getBargainShare: function(bargainId) {
|
||||
var that = this;
|
||||
getBargainShare({ bargainId: bargainId }).then(res => {
|
||||
that.lookCount = res.data.lookCount;
|
||||
that.shareCount = res.data.shareCount;
|
||||
that.userCount = res.data.userCount;
|
||||
});
|
||||
},
|
||||
// 获取产品详情
|
||||
getBargainDetail: function() {
|
||||
var that = this;
|
||||
getBargainDetail(that.bargainId)
|
||||
.then(res => {
|
||||
that.$set(that, "bargain", res.data.bargain);
|
||||
that.updateTitle();
|
||||
that.datatime = that.bargain.stopTime;
|
||||
that.getBargainHelpCount();
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
//开启砍价
|
||||
getBargainStart: function() {
|
||||
var that = this;
|
||||
getBargainStart({ bargainId: that.bargainId })
|
||||
.then(() => {
|
||||
that.bargainPartake = that.userInfo.uid;
|
||||
that.getBargainHelp();
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
//参与砍价
|
||||
getBargainHelp: function() {
|
||||
var that = this;
|
||||
if (
|
||||
that.surplusPrice === 0 &&
|
||||
that.bargainPartake !== that.userInfo.uid
|
||||
) {
|
||||
return wx.showToast({
|
||||
title: "好友已经砍价成功",
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
var data = {
|
||||
bargainId: that.bargainId,
|
||||
bargainUserUid: that.bargainPartake
|
||||
};
|
||||
getBargainHelp(data)
|
||||
.then(res => {
|
||||
that.activeMsg = res.data.status;
|
||||
if (
|
||||
res.data.status === "SUCCESSFUL" &&
|
||||
that.bargainPartake !== that.userInfo.uid
|
||||
) {
|
||||
return that.$dialog.toast({ mes: "您已经砍过了" });
|
||||
}
|
||||
that.helpListStatus = false;
|
||||
that.page = 1;
|
||||
that.bargainHelpList = [];
|
||||
that.getBargainHelpPrice();
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
//获取砍掉的金额
|
||||
getBargainHelpPrice: function() {
|
||||
var that = this;
|
||||
getBargainHelpPrice({
|
||||
bargainId: that.bargainId,
|
||||
bargainUserUid: that.bargainPartake
|
||||
})
|
||||
.then(res => {
|
||||
that.bargainHelpPrice = res.data.price;
|
||||
that.getBargainHelpCount();
|
||||
that.getBargainHelpList();
|
||||
switch (that.activeMsg) {
|
||||
case "SUCCESSFUL":
|
||||
break;
|
||||
case "SUCCESS":
|
||||
that.active = true;
|
||||
break;
|
||||
}
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
//砍价帮
|
||||
getBargainHelpList: function() {
|
||||
var that = this;
|
||||
if (that.helpListLoading === true) return;
|
||||
if (that.helpListStatus === true) return;
|
||||
that.helpListLoading = true;
|
||||
getBargainHelpList({
|
||||
bargainId: that.bargainId,
|
||||
bargainUserUid: that.bargainPartake,
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
})
|
||||
.then(res => {
|
||||
that.helpListStatus = res.data.length < that.limit;
|
||||
that.helpListLoading = false;
|
||||
that.page++;
|
||||
that.bargainHelpList.push.apply(that.bargainHelpList, res.data);
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
getBargainHelpCountStart: function() {
|
||||
var that = this;
|
||||
getBargainHelpCount({
|
||||
bargainId: that.bargainId,
|
||||
bargainUserUid: that.bargainPartake
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {
|
||||
// that.$yrouter.push({
|
||||
// path: "/pages/activity/DargainDetails/main",
|
||||
// query: { id: that.bargainId, partake: that.userInfo.uid }
|
||||
// });
|
||||
});
|
||||
},
|
||||
getBargainHelpCount: function() {
|
||||
var that = this;
|
||||
getBargainHelpCount({
|
||||
bargainId: that.bargainId,
|
||||
bargainUserUid: that.bargainPartake
|
||||
})
|
||||
.then(res => {
|
||||
that.userBargainStatus = res.data.status;
|
||||
that.helpCount = res.data.count;
|
||||
that.surplusPrice = res.data.price;
|
||||
that.alreadyPrice = res.data.alreadyPrice;
|
||||
that.pricePercent = res.data.pricePercent;
|
||||
that.price = (that.bargain.price - that.alreadyPrice).toFixed(2);
|
||||
})
|
||||
.catch(() => {
|
||||
that.bargainPartake = that.userInfo.uid;
|
||||
// that.$yrouter.push({
|
||||
// path: "/pages/activity/DargainDetails/main",
|
||||
// query: { id: that.bargainId, partake: that.userInfo.uid }
|
||||
// });
|
||||
});
|
||||
},
|
||||
getBargainStartUser: function() {
|
||||
var that = this;
|
||||
getBargainStartUser({
|
||||
bargainId: that.bargainId,
|
||||
bargainUserUid: that.bargainPartake
|
||||
})
|
||||
.then(res => {
|
||||
that.bargainUserInfo = res.data;
|
||||
that.getBargainHelpList();
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
close: function() {
|
||||
this.active = false;
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
path: `/pages/activity/DargainDetails/main/?id=${
|
||||
this.$yroute.query.id
|
||||
}&partake=${this.userInfo.uid}`
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.bargainBnts {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<div class="bargain-list">
|
||||
<!-- <div class="header">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/cut-bg.png'" alt="">
|
||||
</div>-->
|
||||
<div class="list" v-if="bargainLis.length > 0">
|
||||
<div
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, bargainLisIndex) in bargainLis"
|
||||
:key="bargainLisIndex"
|
||||
>
|
||||
<div class="pictrue">
|
||||
<img :src="item.image" />
|
||||
</div>
|
||||
<div class="text acea-row row-column-around">
|
||||
<div class="line1" v-text="item.title"></div>
|
||||
<div class="num">
|
||||
<span class="iconfont icon-pintuan"></span>
|
||||
{{ item.people }}人正在参与
|
||||
</div>
|
||||
<div class="money font-color-red">
|
||||
可砍至: ¥
|
||||
<span class="price">{{item.minPrice}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cutBnt bg-color-red" @click="goDetail(item.id)">
|
||||
<span class="iconfont icon-kanjia"></span>参与砍价
|
||||
</div>
|
||||
</div>
|
||||
<div class="load font-color-red" v-if="!status" @click="getBargainList">点击加载更多</div>
|
||||
</div>
|
||||
<div class="noCommodity" style="background-color: #fff;" v-if="bargainLis.length === 0">
|
||||
<div class="noPictrue">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/noGood.png'" class="image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getBargainList } from "@/api/activity";
|
||||
export default {
|
||||
name: "GoodsBargain",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
bargainLis: [], //砍价列表
|
||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成
|
||||
loading: false, //当前接口是否请求完成 false 完成 true 未完成
|
||||
page: 1, //页码
|
||||
limit: 20 //数量
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getBargainList();
|
||||
},
|
||||
methods: {
|
||||
getBargainList: function() {
|
||||
var that = this;
|
||||
if (that.loading) return;
|
||||
if (that.status) return;
|
||||
that.loading = true;
|
||||
getBargainList({ page: that.page, limit: that.limit }).then(res => {
|
||||
that.status = res.data.length < that.limit;
|
||||
that.bargainLis.push.apply(that.bargainLis, res.data);
|
||||
that.page++;
|
||||
that.loading = false;
|
||||
});
|
||||
},
|
||||
goDetail: function(id) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/DargainDetails/main",
|
||||
query: { id, partake: 0 }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style >
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div class="group-list" ref="container">
|
||||
<!-- <div class="header">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/group.png'" class="image" />
|
||||
</div>-->
|
||||
<div class="list" v-if="combinationList.length>0">
|
||||
<div
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, combinationListIndex) in combinationList"
|
||||
:key="combinationListIndex"
|
||||
@click="link(item.id)"
|
||||
>
|
||||
<div class="pictrue">
|
||||
<img :src="item.image" />
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="line1" v-text="item.title"></div>
|
||||
<div class="acea-row">
|
||||
<div class="team acea-row row-middle cart-color">
|
||||
<div class="iconfont icon-pintuan"></div>
|
||||
<div class="num" v-text="item.people + '人团'"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom acea-row row-between-wrapper">
|
||||
<div class="money">
|
||||
¥
|
||||
<span class="num" v-text="item.price"></span>
|
||||
<span class="y-money" v-text="'¥' + item.productPrice"></span>
|
||||
</div>
|
||||
<div class="groupBnt bg-color-red">
|
||||
去拼团
|
||||
<span class="iconfont icon-jiantou"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Loading :loaded="status" :loading="loadingList"></Loading>
|
||||
</div>
|
||||
<div class="noCommodity" style="background-color: #fff;" v-if="combinationList.length === 0">
|
||||
<div class="noPictrue">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/noGood.png'" class="image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getCombinationList } from "@/api/activity";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
name: "GoodsGroup",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
combinationList: [],
|
||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成
|
||||
loading: false, //当前接口是否请求完成 false 完成 true 未完成
|
||||
page: 1, //页码
|
||||
limit: 20, //数量
|
||||
loadingList: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
// document.querySelector('body').setAttribute('style', 'background-color:#73CBB6');
|
||||
this.getCombinationList();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loadingList && this.getCombinationList();
|
||||
},
|
||||
methods: {
|
||||
getCombinationList: function() {
|
||||
var that = this;
|
||||
if (that.loading) return;
|
||||
if (that.status) return;
|
||||
getCombinationList({ page: that.page, limit: that.limit }).then(res => {
|
||||
that.status = res.data.length < that.limit;
|
||||
that.combinationList.push.apply(that.combinationList, res.data);
|
||||
that.page++;
|
||||
that.loading = false;
|
||||
});
|
||||
},
|
||||
link: function(id) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GroupDetails/main",
|
||||
query: { id }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="flash-sale" ref="container">
|
||||
<div class="header" v-if="headerImg">
|
||||
<img :src="headerImg" />
|
||||
</div>
|
||||
<vant-tabs
|
||||
:active="active"
|
||||
@change="setTime"
|
||||
:sticky="sticky"
|
||||
animated
|
||||
line-height="2"
|
||||
:ellipsis="false"
|
||||
>
|
||||
<vant-tab
|
||||
:ellipsis="false"
|
||||
:title="[title[index]]"
|
||||
v-for="(item, index) in timeList"
|
||||
:key="index"
|
||||
>
|
||||
<div slot="title" class="timeItem">
|
||||
<div class="time">{{ item.time }}</div>
|
||||
<div class="state">{{ item.state }}</div>
|
||||
</div>
|
||||
<div class="countDown font-color-red acea-row row-center-wrapper">
|
||||
<div v-if="item.status === 0" class="activity">活动已结束</div>
|
||||
<count-down
|
||||
:is-day="false"
|
||||
:tip-text="'距结束仅剩 '"
|
||||
:day-text="''"
|
||||
:hour-text="' : '"
|
||||
:minute-text="' : '"
|
||||
:second-text="''"
|
||||
:datatime="datatime"
|
||||
v-if="item.status === 1"
|
||||
></count-down>
|
||||
<div v-if="item.status === 2" class="activity">活动即将开始</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(itemSeckill, indexSeckill) in seckillList"
|
||||
:key="indexSeckill"
|
||||
>
|
||||
<div class="pictrue">
|
||||
<img :src="itemSeckill.image" />
|
||||
</div>
|
||||
<div class="text acea-row row-column-around">
|
||||
<div class="line1" v-text="itemSeckill.title"></div>
|
||||
<div class="money">
|
||||
限时价
|
||||
<span class="num font-color-red" v-text="'¥' + itemSeckill.price"></span>
|
||||
</div>
|
||||
<div class="progress cart-color">
|
||||
<div class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></div>
|
||||
<div class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="grab bg-color-red"
|
||||
v-if="item.status === 1 && itemSeckill.stock > 0"
|
||||
@click="goDetail(itemSeckill.id)"
|
||||
>马上抢</div>
|
||||
<div class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</div>
|
||||
<div class="grab bg-color-red" v-if="item.status === 2">即将开始</div>
|
||||
<div class="grab bg-color-red" v-if="item.status === 0">已结束</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="noCommodity"
|
||||
style="background-color: #fff;"
|
||||
v-if="seckillList.length === 0 && page > 1"
|
||||
>
|
||||
<div class="noPictrue">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/noGood.png'" class="image" />
|
||||
</div>
|
||||
</div>
|
||||
</vant-tab>
|
||||
</vant-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getSeckillConfig, getSeckillList } from "@/api/activity";
|
||||
import CountDown from "@/components/CountDown";
|
||||
// import { Tab, Tabs } from "vant-weapp";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
name: "GoodsSeckill",
|
||||
components: {
|
||||
CountDown
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
headerImg: "",
|
||||
timeList: [],
|
||||
sticky: false,
|
||||
loading: false,
|
||||
datatime: 0,
|
||||
active: 0,
|
||||
seckillList: [],
|
||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成
|
||||
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
|
||||
page: 1, //页码
|
||||
limit: 5, //数量
|
||||
title: []
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.mountedStart();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loadingList && this.getSeckillList();
|
||||
},
|
||||
methods: {
|
||||
mountedStart: function() {
|
||||
var that = this;
|
||||
wx.showLoading();
|
||||
getSeckillConfig().then(res => {
|
||||
that.$set(that, "headerImg", res.data.lovely);
|
||||
that.$set(that, "timeList", res.data.seckillTime);
|
||||
that.$set(that, "active", res.data.seckillTimeIndex);
|
||||
|
||||
let title = [];
|
||||
title = res.data.seckillTime.map((item, index) => {
|
||||
return {
|
||||
name: "div",
|
||||
attrs: {
|
||||
class: "timeItem"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: "div",
|
||||
attrs: {
|
||||
class: "time"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
text: item.time
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "div",
|
||||
attrs: {
|
||||
class: "state"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
text: item.state
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
});
|
||||
that.$set(that, "title", title);
|
||||
that.datatime = that.timeList[that.active].stop;
|
||||
that.getSeckillList();
|
||||
that.$nextTick(function() {
|
||||
that.sticky = true;
|
||||
wx.hideLoading();
|
||||
});
|
||||
});
|
||||
},
|
||||
setTime: function(event) {
|
||||
var that = this;
|
||||
that.active = event.mp.detail.index;
|
||||
that.datatime = that.timeList[that.active].stop;
|
||||
that.getSeckillList();
|
||||
},
|
||||
getSeckillList: function() {
|
||||
var that = this;
|
||||
if (that.loadingList) return;
|
||||
if (that.status) return;
|
||||
var time = that.timeList[that.active].id;
|
||||
getSeckillList(time, { page: that.page, limit: that.limit }).then(res => {
|
||||
that.status = res.data.length < that.limit;
|
||||
that.seckillList.push.apply(that.seckillList, res.data);
|
||||
that.page++;
|
||||
wx.hideLoading();
|
||||
});
|
||||
},
|
||||
goDetail: function(id) {
|
||||
var that = this;
|
||||
var time = that.timeList[that.active].stop;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/SeckillDetails/main",
|
||||
query: { id, time }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.timeItem {
|
||||
font-size: 0.22rem;
|
||||
color: #282828;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 0.11rem 0;
|
||||
height: 0.96rem;
|
||||
background-color: #efc58f;
|
||||
}
|
||||
.timeItem .time {
|
||||
font-size: 0.32rem;
|
||||
font-weight: bold;
|
||||
height: 0.37rem;
|
||||
line-height: 0.37rem;
|
||||
}
|
||||
.timeItem .state {
|
||||
height: 0.37rem;
|
||||
line-height: 0.37rem;
|
||||
}
|
||||
.activity {
|
||||
color: #333;
|
||||
}
|
||||
.flash-sale .list .item .grab {
|
||||
background-color: #999;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<div :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']" v-show="domStatus">
|
||||
<product-con-swiper :imgUrls="imgUrls"></product-con-swiper>
|
||||
<div class="wrapper">
|
||||
<div class="share acea-row row-between row-bottom">
|
||||
<div class="money font-color-red">
|
||||
¥
|
||||
<span class="num" v-text="storeInfo.price"></span>
|
||||
<span class="y-money" v-text="'¥' + storeInfo.productPrice"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="introduce" v-text="storeInfo.title"></div>
|
||||
<div class="label acea-row row-between-wrapper">
|
||||
<div v-text="'类型:' + storeInfo.people + '人团'"></div>
|
||||
<div v-text="'库存:' + storeInfo.stock + storeInfo.unitName"></div>
|
||||
<div v-text="'已拼:' + storeInfo.sales + storeInfo.unitName"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="notice acea-row row-middle">
|
||||
<div class="num font-color-red">
|
||||
<span class="iconfont icon-laba"></span>
|
||||
已拼{{ storeInfo.sales
|
||||
}}{{ storeInfo.unitName }}
|
||||
<span class="line">|</span>
|
||||
</div>
|
||||
<div class="swiper-no-swiping swiper">
|
||||
<swiper class="swiper-wrapper" :options="swiperTip" :autoplay="true" :interval="3000">
|
||||
<block v-for="(item, itemNewIndex) in itemNew" :key="itemNewIndex">
|
||||
<swiper-item>
|
||||
<div class="line1">{{ item }}</div>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</div>
|
||||
</div>
|
||||
<div class="assemble">
|
||||
<div v-for="(item, groupListindex) in groupList" :key="groupListindex">
|
||||
<div class="item acea-row row-between-wrapper" v-if="groupListindex < groupListCount">
|
||||
<div class="pictxt acea-row row-between-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="item.avatar" class="image" />
|
||||
</div>
|
||||
<div class="text line1" v-text="item.nickname"></div>
|
||||
</div>
|
||||
<div class="right acea-row row-middle">
|
||||
<div>
|
||||
<div class="lack">
|
||||
还差
|
||||
<span class="font-color-red" v-text="item.count"></span>人成团
|
||||
</div>
|
||||
<count-down
|
||||
:is-day="false"
|
||||
:tip-text="'剩余 '"
|
||||
:day-text="''"
|
||||
:hour-text="':'"
|
||||
:minute-text="':'"
|
||||
:second-text="''"
|
||||
:datatime="item.stopTime"
|
||||
></count-down>
|
||||
</div>
|
||||
<div class="spellBnt" @click="groupRule(item.id)">
|
||||
去拼单
|
||||
<span class="iconfont icon-jiantou"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="more" v-if="groupList.length > groupListCount" @click="setGroupListCount">
|
||||
查看更多
|
||||
<span class="iconfont icon-xiangxia"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="playWay">
|
||||
<div class="title acea-row row-between-wrapper">
|
||||
<div>拼团玩法</div>
|
||||
</div>
|
||||
<div class="way acea-row row-middle">
|
||||
<div class="item">
|
||||
<span class="num">①</span>开团/参团
|
||||
</div>
|
||||
<div class="iconfont icon-arrow"></div>
|
||||
<div class="item">
|
||||
<span class="num">②</span>邀请好友
|
||||
</div>
|
||||
<div class="iconfont icon-arrow"></div>
|
||||
<div class="item">
|
||||
<div>
|
||||
<span class="num">③</span>满员发货
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="userEvaluation">
|
||||
<div class="title acea-row row-between-wrapper">
|
||||
<div v-text="'用户评价(' + replyCount + ')'"></div>
|
||||
<div class="praise" @click="goReply">
|
||||
<span class="font-color-red" v-text="replyChance + '%'"></span>好评率
|
||||
<span class="iconfont icon-jiantou"></span>
|
||||
</div>
|
||||
</div>
|
||||
<UserEvaluation :reply="reply"></UserEvaluation>
|
||||
</div>
|
||||
<div class="product-intro">
|
||||
<div class="title">产品介绍</div>
|
||||
<div class="conter" v-html="storeInfo.description"></div>
|
||||
</div>
|
||||
<div style="height:100rpx;"></div>
|
||||
<div class="footer-group acea-row row-between-wrapper">
|
||||
<div class="customerSer acea-row row-center-wrapper row-column">
|
||||
<div class="iconfont icon-kefu"></div>
|
||||
<div>客服</div>
|
||||
</div>
|
||||
<div class="bnt bg-color-violet" @click="openAlone">单独购买</div>
|
||||
<div class="bnt bg-color-red" @click="openTeam">立即开团</div>
|
||||
</div>
|
||||
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
|
||||
<StorePoster
|
||||
v-on:setPosterImageStatus="setPosterImageStatus"
|
||||
:posterImageStatus="posterImageStatus"
|
||||
:posterData="posterData"
|
||||
></StorePoster>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.noscroll {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.product-con .footer-group .bnt {
|
||||
width: 43%;
|
||||
}
|
||||
.product-con .footer-group .bnt.bg-color-violet {
|
||||
background-color: #fa8013;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
|
||||
import ProductConSwiper from "@/components/ProductConSwiper";
|
||||
import CountDown from "@/components/CountDown";
|
||||
import UserEvaluation from "@/components/UserEvaluation";
|
||||
import ProductWindow from "@/components/ProductWindow";
|
||||
import StorePoster from "@/components/StorePoster";
|
||||
import { getCombinationDetail } from "@/api/activity";
|
||||
import { postCartAdd } from "@/api/store";
|
||||
import { imageBase64 } from "@/api/public";
|
||||
const NAME = "GroupDetails";
|
||||
|
||||
export default {
|
||||
name: "GroupDetails",
|
||||
components: {
|
||||
ProductConSwiper,
|
||||
CountDown,
|
||||
UserEvaluation,
|
||||
// swiper,
|
||||
// swiperSlide,
|
||||
ProductWindow,
|
||||
StorePoster
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
domStatus: false,
|
||||
posterData: {
|
||||
image: "",
|
||||
title: "",
|
||||
price: "",
|
||||
code: ""
|
||||
},
|
||||
posterImageStatus: false,
|
||||
reply: [],
|
||||
replyCount: 0,
|
||||
replyChance: 0,
|
||||
imgUrls: [],
|
||||
storeInfo: {},
|
||||
itemNew: {},
|
||||
groupListCount: 2,
|
||||
groupList: {},
|
||||
swiperTip: {
|
||||
direction: "vertical",
|
||||
autoplay: {
|
||||
disableOnInteraction: false,
|
||||
delay: 2000
|
||||
},
|
||||
loop: true,
|
||||
speed: 1000,
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
attr: {
|
||||
cartAttr: false,
|
||||
productSelect: {
|
||||
image: "",
|
||||
store_name: "",
|
||||
price: "",
|
||||
stock: "",
|
||||
unique: "",
|
||||
cart_num: 1
|
||||
}
|
||||
},
|
||||
cartNum:1
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$yroute: function(n) {
|
||||
var that = this;
|
||||
if (n.name === NAME) {
|
||||
that.mountedStart();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.mountedStart();
|
||||
},
|
||||
methods: {
|
||||
openAlone: function() {
|
||||
this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
|
||||
},
|
||||
mountedStart: function() {
|
||||
var that = this;
|
||||
let id = that.$yroute.query.id;
|
||||
getCombinationDetail(id).then(res => {
|
||||
that.$set(that, "storeInfo", res.data.storeInfo);
|
||||
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
|
||||
that.$set(that, "itemNew", res.data.pinkOkList);
|
||||
that.$set(that, "groupList", res.data.pink);
|
||||
that.$set(that, "reply", [res.data.reply]);
|
||||
that.$set(that, "replyCount", res.data.replyCount);
|
||||
that.$set(that, "replyChance", res.data.replyChance);
|
||||
that.setProductSelect();
|
||||
that.posterData.image = that.storeInfo.image;
|
||||
if (that.storeInfo.title.length > 30) {
|
||||
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
|
||||
} else {
|
||||
that.posterData.title = that.storeInfo.title;
|
||||
}
|
||||
that.posterData.price = that.storeInfo.price;
|
||||
that.posterData.code = that.storeInfo.code_base;
|
||||
that.domStatus = true;
|
||||
//that.getImageBase64();
|
||||
});
|
||||
},
|
||||
getImageBase64: function() {
|
||||
let that = this;
|
||||
imageBase64(this.posterData.image, that.posterData.code).then(res => {
|
||||
that.posterData.image = res.data.image;
|
||||
that.posterData.code = res.data.code;
|
||||
});
|
||||
},
|
||||
setPosterImageStatus: function() {
|
||||
// var sTop = document.body || document.documentElement;
|
||||
// sTop.scrollTop = 0;
|
||||
this.posterImageStatus = !this.posterImageStatus;
|
||||
},
|
||||
groupRule: function(id) {
|
||||
var that = this;
|
||||
that.$yrouter.push({
|
||||
path: "/pages/activity/GroupRule/main",
|
||||
query: { id }
|
||||
});
|
||||
},
|
||||
goReply: function() {
|
||||
var that = this;
|
||||
that.$yrouter.push({
|
||||
path: "/pages/shop/EvaluateList/main",
|
||||
query: { id: that.storeInfo.product_id }
|
||||
});
|
||||
},
|
||||
setGroupListCount: function() {
|
||||
this.groupListCount = this.groupListCount + 2;
|
||||
},
|
||||
//将父级向子集多次传送的函数合二为一;
|
||||
changeFun: function(opt) {
|
||||
if (typeof opt !== "object") opt = {};
|
||||
let action = opt.action || "";
|
||||
let value = opt.value === undefined ? "" : opt.value;
|
||||
this[action] && this[action](value);
|
||||
},
|
||||
changeattr: function(res) {
|
||||
var that = this;
|
||||
that.attr.cartAttr = res;
|
||||
},
|
||||
ChangeCartNum: function(res) {
|
||||
var that = this;
|
||||
that.attr.productSelect.cart_num = 1;
|
||||
that.cartNum = 1;
|
||||
that.$dialog.message("每人每次限购1" + that.storeInfo.unitName);
|
||||
},
|
||||
setProductSelect: function() {
|
||||
var that = this;
|
||||
var attr = that.attr;
|
||||
attr.productSelect.image = that.storeInfo.image;
|
||||
attr.productSelect.store_name = that.storeInfo.title;
|
||||
attr.productSelect.price = that.storeInfo.price;
|
||||
attr.productSelect.stock = that.storeInfo.stock;
|
||||
attr.cartAttr = false;
|
||||
that.$set(that, "attr", attr);
|
||||
},
|
||||
openTeam: function() {
|
||||
var that = this;
|
||||
if (that.attr.cartAttr == false) {
|
||||
that.attr.cartAttr = !this.attr.cartAttr;
|
||||
} else {
|
||||
var data = {};
|
||||
data.productId = that.storeInfo.productId;
|
||||
data.cartNum = that.attr.productSelect.cart_num;
|
||||
data.uniqueId = that.attr.productSelect.unique;
|
||||
data.combinationId = that.storeInfo.id;
|
||||
data.new = 1;
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
that.$yrouter.push({
|
||||
path: "/pages/order/OrderSubmission/main",
|
||||
query: { id: res.data.cartId }
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.$dialog.error(err.msg||err.response.data.msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.product-con .wrapper {
|
||||
padding-bottom: 0.26rem;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<div class="group-con">
|
||||
<div class="header acea-row row-between-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="storeCombination.image" />
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="line1" v-text="storeCombination.title"></div>
|
||||
<div class="money">
|
||||
¥
|
||||
<span class="num" v-text="storeCombination.price"></span>
|
||||
<span class="team cart-color" v-text="storeCombination.people + '人拼'"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></div>
|
||||
<div v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="title acea-row row-center-wrapper">
|
||||
<div class="line"></div>
|
||||
<div class="name acea-row row-center-wrapper">
|
||||
剩余
|
||||
<count-down
|
||||
:is-day="false"
|
||||
:tip-text="''"
|
||||
:day-text="''"
|
||||
:hour-text="' : '"
|
||||
:minute-text="' : '"
|
||||
:second-text="''"
|
||||
:datatime="pinkT.stopTime"
|
||||
></count-down>结束
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<div class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</div>
|
||||
<div class="tips" v-else-if="pinkBool === -1">还差{{ count }}人,拼团失败</div>
|
||||
<div class="tips font-color-red" v-else-if="pinkBool === 0">拼团中,还差{{ count }}人拼团成功</div>
|
||||
<div
|
||||
class="list acea-row row-middle"
|
||||
:class="[
|
||||
pinkBool === 1 || pinkBool === -1 ? 'result' : '',
|
||||
iShidden ? 'on' : ''
|
||||
]"
|
||||
>
|
||||
<div class="pictrue">
|
||||
<img :src="pinkT.avatar" />
|
||||
</div>
|
||||
<div class="acea-row row-middle" v-if="pinkAll.length > 0">
|
||||
<div class="pictrue" v-for="(item, pinkAllIndex) in pinkAll" :key="pinkAllIndex">
|
||||
<img :src="item.avatar" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="pictrue" v-for="countIndex in count" :key="countIndex">
|
||||
<img class="img-none" :src="$VUE_APP_RESOURCES_URL+'/images/vacancy.png'" />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="(pinkBool === 1 || pinkBool === -1) && count > 9"
|
||||
class="lookAll acea-row row-center-wrapper"
|
||||
@click="lookAll"
|
||||
>
|
||||
{{ iShidden ? "收起" : "查看全部" }}
|
||||
<span
|
||||
class="iconfont"
|
||||
:class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"
|
||||
></span>
|
||||
</div>
|
||||
<div
|
||||
class="teamBnt bg-color-red"
|
||||
v-if="userBool === 1 && isOk == 0 && pinkBool === 0"
|
||||
@click="goPoster"
|
||||
>邀请好友参团</div>
|
||||
<div
|
||||
class="teamBnt bg-color-red"
|
||||
v-else-if="userBool === 0 && pinkBool === 0 && count > 0"
|
||||
@click="pay"
|
||||
>我要参团</div>
|
||||
<div
|
||||
class="teamBnt bg-color-red"
|
||||
v-if="pinkBool === 1 || pinkBool === -1"
|
||||
@click="goDetail(storeCombination.id)"
|
||||
>再次开团</div>
|
||||
<div class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
|
||||
<span class="iconfont icon-guanbi3"></span>取消开团
|
||||
</div>
|
||||
<div class="lookOrder" v-if="pinkBool === 1" @click="goOrder">
|
||||
查看订单信息
|
||||
<span class="iconfont icon-xiangyou"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import CountDown from "@/components/CountDown";
|
||||
import { getCombinationPink, getCombinationRemove } from "@/api/activity";
|
||||
import { postCartAdd } from "@/api/store";
|
||||
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
|
||||
|
||||
const NAME = "GroupRule";
|
||||
export default {
|
||||
name: NAME,
|
||||
components: {
|
||||
CountDown
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
currentPinkOrder: "", //当前拼团订单
|
||||
isOk: 0, //判断拼团是否完成
|
||||
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功
|
||||
userBool: 0, //判断当前用户是否在团内|0=未在,1=在
|
||||
pinkAll: [], //团员
|
||||
pinkT: [], //团长信息
|
||||
storeCombination: [], //拼团产品
|
||||
pinkId: 0,
|
||||
count: 0, //拼团剩余人数
|
||||
iShidden: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$yroute(n) {
|
||||
var that = this;
|
||||
if (n.name === NAME) {
|
||||
that.pinkId = that.$yroute.query.id;
|
||||
that.getCombinationPink();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
var that = this;
|
||||
let url = handleQrCode();
|
||||
if (url) {
|
||||
that.pinkId = url.pinkId;
|
||||
} else {
|
||||
that.pinkId = that.$yroute.query.id;
|
||||
}
|
||||
that.getCombinationPink();
|
||||
},
|
||||
methods: {
|
||||
pay: function() {
|
||||
var that = this;
|
||||
var data = {};
|
||||
data.productId = that.storeCombination.productId;
|
||||
data.cartNum = that.pinkT.totalNum;
|
||||
data.uniqueId = "";
|
||||
data.combinationId = that.storeCombination.id;
|
||||
data.new = 1;
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
that.$yrouter.push({
|
||||
path: "/pages/order/OrderSubmission/main",
|
||||
query: { id: res.data.cartId, pinkid: that.pinkId }
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.$dialog.error(err.msg||err.response.data.msg);
|
||||
});
|
||||
},
|
||||
goPoster: function() {
|
||||
var that = this;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/Poster/main",
|
||||
query: { id: that.pinkId, type: 1 }
|
||||
});
|
||||
},
|
||||
goOrder: function() {
|
||||
var that = this;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/OrderDetails/main",
|
||||
query: { id: that.currentPinkOrder }
|
||||
});
|
||||
},
|
||||
//拼团列表
|
||||
goList: function() {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GoodsGroup/main"
|
||||
});
|
||||
},
|
||||
//拼团详情
|
||||
goDetail: function(id) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GroupDetails/main",
|
||||
query: { id }
|
||||
});
|
||||
},
|
||||
//拼团信息
|
||||
getCombinationPink: function() {
|
||||
var that = this;
|
||||
getCombinationPink(that.pinkId).then(res => {
|
||||
that.$set(that, "storeCombination", res.data.storeCombination);
|
||||
that.$set(that, "pinkT", res.data.pinkT);
|
||||
that.$set(that, "pinkAll", res.data.pinkAll);
|
||||
that.$set(that, "count", res.data.count);
|
||||
that.$set(that, "userBool", res.data.userBool);
|
||||
that.$set(that, "pinkBool", res.data.pinkBool);
|
||||
that.$set(that, "isOk", res.data.isOk);
|
||||
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder);
|
||||
});
|
||||
},
|
||||
//拼团取消
|
||||
getCombinationRemove: function() {
|
||||
var that = this;
|
||||
getCombinationRemove({ id: that.pinkId, cid: that.storeCombination.id })
|
||||
.then(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
lookAll: function() {
|
||||
this.iShidden = !this.iShidden;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div class="poster-poster" v-if="status === false">
|
||||
<div class="tip">
|
||||
<span class="iconfont icon-shuoming"></span>提示:长按图片保存至手机相册
|
||||
</div>
|
||||
<div class="poster">
|
||||
<img :src="image" mode="widthFix" show-menu-by-longpress />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.poster-poster {
|
||||
height: unset !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import { getBargainPoster, getCombinationPoster } from "@/api/activity";
|
||||
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
status: true,
|
||||
id: 0,
|
||||
image: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
var that = this;
|
||||
var id = that.$yroute.query.id;
|
||||
var type = that.$yroute.query.type;
|
||||
that.id = id;
|
||||
if (type == 2) {
|
||||
that.getBargainPoster();
|
||||
} else {
|
||||
that.getCombinationPoster();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getBargainPoster: function() {
|
||||
var that = this;
|
||||
getBargainPoster({ bargainId: that.id, from: "wechat" })
|
||||
.then(res => {
|
||||
that.image = res.data.url;
|
||||
that.status = false;
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
// 拼团海报
|
||||
getCombinationPoster: function() {
|
||||
var that = this;
|
||||
getCombinationPoster({ id: that.id, from: "wechat" })
|
||||
.then(res => {
|
||||
that.image = res.data.url;
|
||||
that.status = false;
|
||||
})
|
||||
.catch(res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<div :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']" v-show="domStatus">
|
||||
<product-con-swiper :imgUrls="imgUrls"></product-con-swiper>
|
||||
<div class="nav acea-row row-between-wrapper">
|
||||
<div class="money">
|
||||
¥
|
||||
<span class="num" v-text="storeInfo.price"></span>
|
||||
<span class="y-money" v-text="'¥' + storeInfo.price"></span>
|
||||
</div>
|
||||
<div class="acea-row row-middle">
|
||||
<div class="times">
|
||||
<div>距秒杀结束仅剩</div>
|
||||
<count-down
|
||||
:is-day="false"
|
||||
:tip-text="''"
|
||||
:day-text="''"
|
||||
:hour-text="' : '"
|
||||
:minute-text="' : '"
|
||||
:second-text="''"
|
||||
:datatime="datatime"
|
||||
></count-down>
|
||||
</div>
|
||||
<div class="iconfont icon-jiantou"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapperRush">
|
||||
<div class="introduce acea-row row-between">
|
||||
<div class="infor" v-text="storeInfo.title"></div>
|
||||
<div class="iconfont icon-fenxiang" @click="setPosterImageStatus"></div>
|
||||
</div>
|
||||
<div class="label acea-row row-middle">
|
||||
<div class="stock" v-text="'库存:' + storeInfo.stock + '件'"></div>
|
||||
<div v-text="'销量:' + storeInfo.sales + '件'"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-intro">
|
||||
<div class="title">产品介绍</div>
|
||||
<div class="conter" v-html="storeInfo.description"></div>
|
||||
</div>
|
||||
<div style="height:100rpx;"></div>
|
||||
<div class="footerRush acea-row row-between-wrapper">
|
||||
<div
|
||||
class="customerSer acea-row row-center-wrapper row-column"
|
||||
@click="$yrouter.push({ path: '/pages/user/CustomerList/index' })"
|
||||
>
|
||||
<div class="iconfont icon-kefu"></div>
|
||||
<div>客服</div>
|
||||
</div>
|
||||
<div class="bnt bg-color-red" @click="tapBuy">立即购买</div>
|
||||
</div>
|
||||
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
|
||||
<StorePoster
|
||||
v-on:setPosterImageStatus="setPosterImageStatus"
|
||||
:posterImageStatus="posterImageStatus"
|
||||
:posterData="posterData"
|
||||
></StorePoster>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.noscroll {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import ProductConSwiper from "@/components/ProductConSwiper";
|
||||
import CountDown from "@/components/CountDown";
|
||||
import ProductWindow from "@/components/ProductWindow";
|
||||
import StorePoster from "@/components/StorePoster";
|
||||
import { getSeckillDetail } from "@/api/activity";
|
||||
import { postCartAdd } from "@/api/store";
|
||||
import { imageBase64 } from "@/api/public";
|
||||
const NAME = "SeckillDetails";
|
||||
|
||||
export default {
|
||||
name: "SeckillDetails",
|
||||
components: {
|
||||
ProductConSwiper,
|
||||
CountDown,
|
||||
ProductWindow,
|
||||
StorePoster
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
domStatus: false,
|
||||
posterData: {
|
||||
image: "",
|
||||
title: "",
|
||||
price: "",
|
||||
code: ""
|
||||
},
|
||||
posterImageStatus: false,
|
||||
action: "",
|
||||
imgUrls: [],
|
||||
storeInfo: [],
|
||||
replyCount: 0,
|
||||
reply: [],
|
||||
cartNum: 1,
|
||||
attr: {
|
||||
cartAttr: false,
|
||||
productSelect: {
|
||||
image: "",
|
||||
store_name: "",
|
||||
price: "",
|
||||
stock: "",
|
||||
unique: "",
|
||||
cart_num: 1
|
||||
}
|
||||
},
|
||||
datatime: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$yroute: function(n) {
|
||||
var that = this;
|
||||
if (n.name === NAME) {
|
||||
that.mountedStart();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.mountedStart();
|
||||
},
|
||||
methods: {
|
||||
mountedStart: function() {
|
||||
var that = this;
|
||||
let id = that.$yroute.query.id;
|
||||
that.datatime = parseInt(that.$yroute.query.time);
|
||||
getSeckillDetail(id).then(res => {
|
||||
that.$set(that, "storeInfo", res.data.storeInfo);
|
||||
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
|
||||
that.$set(that, "replyCount", res.data.replyCount);
|
||||
that.$set(that, "reply", res.data.reply);
|
||||
that.posterData.image = that.storeInfo.image_base;
|
||||
that.updateTitle();
|
||||
if (that.storeInfo.title.length > 30) {
|
||||
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
|
||||
} else {
|
||||
that.posterData.title = that.storeInfo.title;
|
||||
}
|
||||
that.posterData.price = that.storeInfo.price;
|
||||
that.posterData.code = that.storeInfo.code_base;
|
||||
that.setProductSelect();
|
||||
that.domStatus = true;
|
||||
});
|
||||
},
|
||||
updateTitle() {
|
||||
// document.title = this.storeInfo.title || this.$yroute.meta.title;
|
||||
},
|
||||
setPosterImageStatus: function() {
|
||||
// var sTop = document.body || document.documentElement;
|
||||
// sTop.scrollTop = 0;
|
||||
this.posterImageStatus = !this.posterImageStatus;
|
||||
},
|
||||
//将父级向子集多次传送的函数合二为一;
|
||||
changeFun: function(opt) {
|
||||
if (typeof opt !== "object") opt = {};
|
||||
let action = opt.action || "";
|
||||
let value = opt.value === undefined ? "" : opt.value;
|
||||
this[action] && this[action](value);
|
||||
},
|
||||
changeattr: function(res) {
|
||||
var that = this;
|
||||
that.attr.cartAttr = res;
|
||||
},
|
||||
ChangeCartNum: function(res) {
|
||||
var that = this;
|
||||
if (res) {
|
||||
if (that.attr.productSelect.cart_num < that.storeInfo.stock) {
|
||||
that.attr.productSelect.cart_num++;
|
||||
this.cartNum++;
|
||||
}
|
||||
} else {
|
||||
if (that.attr.productSelect.cart_num > 1) {
|
||||
that.attr.productSelect.cart_num--;
|
||||
this.cartNum--;
|
||||
}
|
||||
}
|
||||
},
|
||||
setProductSelect: function() {
|
||||
var that = this;
|
||||
var attr = that.attr;
|
||||
attr.productSelect.image = that.storeInfo.image;
|
||||
attr.productSelect.store_name = that.storeInfo.title;
|
||||
attr.productSelect.price = that.storeInfo.price;
|
||||
attr.productSelect.stock = that.storeInfo.stock;
|
||||
attr.cartAttr = false;
|
||||
that.$set(that, "attr", attr);
|
||||
},
|
||||
selecAttrTap: function() {
|
||||
this.cartAttr = true;
|
||||
},
|
||||
tapBuy: function() {
|
||||
var that = this;
|
||||
if (that.attr.cartAttr == false) {
|
||||
that.attr.cartAttr = !this.attr.attrcartAttr;
|
||||
} else {
|
||||
console.log(that.storeInfo)
|
||||
var data = {};
|
||||
data.productId = that.storeInfo.productId;
|
||||
data.cartNum = that.attr.productSelect.cart_num;
|
||||
data.uniqueId = that.attr.productSelect.unique;
|
||||
data.secKillId = that.storeInfo.id;
|
||||
data.new = 1;
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
that.$yrouter.push({
|
||||
path: "/pages/order/OrderSubmission/main",
|
||||
query: { id: res.data.cartId }
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
this.$dialog.error(err.msg || err.response.data.msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.product-con .nav {
|
||||
padding: 0 0.2rem;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
Reference in New Issue
Block a user