master
parent
002e2daf18
commit
188f750313
|
@ -1,16 +1,16 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="posAll bac5" v-if="ifMask">
|
||||
<view class="animated width100 " :class="ifAnimated?'bounceInUp':'bounceOutDown'" style="position: absolute;bottom: 0;">
|
||||
<view class="posAll bac5" v-if="ifMask" @tap="executeEv(0)">
|
||||
<view @tap.stop="ifMask=true,ifAnimated=true" class="animated width100 " :class="ifAnimated?'bounceInUp':'bounceOutDown'" style="position: absolute;bottom: 0;">
|
||||
<view class="bacf pad-zy20 pad-x20" style="border-radius: 30rpx 30rpx 0 0;">
|
||||
<view class="disjbac pad-sx20">
|
||||
<view class="fon28 bold colb">优惠券</view>
|
||||
<view @tap="executeEv(0)" class="icon icon-del-white fon24" style="color: #b2b2b2;"></view>
|
||||
<view @tap.stop="executeEv(0)" class="icon icon-del-white fon24 pad-zy20" style="color: #b2b2b2;"></view>
|
||||
</view>
|
||||
<view class="fon20" style="color: #616161;">已选中推荐优惠,使用优惠券{{couponCount}}张,共抵扣<span class="col-e42417">¥{{$toolAll.tools.addXiaoShu(couponPrice)}}</span></view>
|
||||
<view class="fon20" style="color: #616161;">使用优惠券{{couponCount}}张,共抵扣<span class="col-e42417">¥{{$toolAll.tools.addXiaoShu(couponPrice)}}</span></view>
|
||||
</view>
|
||||
<view class="pad20 overflow-s" style="background-color: #f2f2f2;max-height: 720rpx;">
|
||||
<view @tap="chooseCoupon(item.id,index)" class="radius12 bacf boxshow2 pad-sx20 fon24" :class="index<(dataList.length-1)?'mar-x20':''" v-for="(item,index) in dataList" :key="index">
|
||||
<view @tap.stop="chooseCoupon(item.id,index)" class="radius12 bacf boxshow2 pad-sx20 fon24" :class="index<(dataList.length-1)?'mar-x20':''" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="disac">
|
||||
<view class="flexs bold col-e42417 dis pad-z20" style="min-width: 180rpx;color:#e42417;">
|
||||
<view class="">¥</view>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<view class="col9 fon24 disjcac pad-sx50" v-if="!dataList.length">暂无可用优惠券</view>
|
||||
</view>
|
||||
<view class="bacf pad-sx20 disjcac boxshowt">
|
||||
<view @tap="executeEv(1)" class="disjcac fon24" style="width: 380rpx;height: 70rpx;border-radius: 35rpx;background-color: #f37617;color: #FFFFFF;">
|
||||
<view @tap.stop="executeEv(1)" class="disjcac fon24" style="width: 380rpx;height: 70rpx;border-radius: 35rpx;background-color: #f37617;color: #FFFFFF;">
|
||||
确定
|
||||
</view>
|
||||
</view>
|
||||
|
@ -83,7 +83,6 @@
|
|||
},
|
||||
// 查询是否选中
|
||||
checkChoose(){
|
||||
console.log(this.couponId,666666);
|
||||
let exitIndex = this.dataList.findIndex(item=>item.id==this.couponId);
|
||||
if(exitIndex!=-1){
|
||||
this.dataList[exitIndex].ifcheck = true;
|
||||
|
@ -121,7 +120,8 @@
|
|||
let params = {
|
||||
status:'normal',
|
||||
page:1,
|
||||
size:100
|
||||
size:100,
|
||||
condition:uni.getStorageSync('courseInfo').original_total*1
|
||||
}
|
||||
this.$requst.get('/api/user/coupon-list',params).then(res=>{
|
||||
if(res.code==0){
|
||||
|
|
|
@ -11,3 +11,7 @@ export function uploadFile(data) {
|
|||
export function reportRecord(data) {
|
||||
return request.post("/api/user/video-view", data);
|
||||
}
|
||||
// 查询购物车数量
|
||||
export function checkCartNum() {
|
||||
return request.get("/api/order/shopping-cart-count");
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
import swiperTab from '@/components/swiper-tab/swiper-tab.vue';
|
||||
import list from '@/components/list.vue';
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
import { mapState } from 'vuex';
|
||||
import { checkCartNum } from '@/jsFile/public-api.js';
|
||||
export default {
|
||||
components:{
|
||||
'foot-tab' :footTab,
|
||||
|
@ -46,9 +48,15 @@
|
|||
loading:false
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
...mapState({
|
||||
cartNum: state => state.moduleA.cartNum
|
||||
})
|
||||
},
|
||||
onLoad() {
|
||||
// 调用获取分类列表
|
||||
this.getHomeCate();
|
||||
this.cartNumEv();
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.$refs.refproduct.list.length){
|
||||
|
@ -62,6 +70,14 @@
|
|||
uni.removeStorageSync('skuList');
|
||||
},
|
||||
methods: {
|
||||
// 查询购物车数量
|
||||
cartNumEv(){
|
||||
checkCartNum().then(res=>{
|
||||
if(res.code==0){
|
||||
this.$store.commit('setCartNum',res.data.count);
|
||||
}
|
||||
})
|
||||
},
|
||||
// tab点击事件
|
||||
clickTab(index){
|
||||
this.current = index;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<view class="fon24 col26">头像</view>
|
||||
<view class="disac">
|
||||
<image class="radius_100" :src="userInfo.headimgurl" mode="aspectFill" style="width: 92rpx;height: 92rpx;"></image>
|
||||
<view class="icon icon-next fon24 mar-z10" style="color: #7f7f7f;"></view>
|
||||
<!-- <view class="icon icon-next fon24 mar-z10" style="color: #7f7f7f;"></view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="pad-sx30 fon24 pad-zy10 disjbac bbot">
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</view>
|
||||
<view class="disjbac pad-sx20 pad-zy10">
|
||||
<view class="fon22 col26">推广获取积分</view>
|
||||
<view class="fon26 bold col-e42417" v-if="scoreInfo">{{scoreInfo.score}}</view>
|
||||
<view class="fon26 bold col-e42417" v-if="scoreInfo">{{scoreInfo}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-s30 pad-zy20 bacf boxshow2">
|
||||
|
@ -85,7 +85,7 @@
|
|||
}
|
||||
this.$requst.get('/api/user/sales',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.scoreInfo = res.data.account;
|
||||
this.scoreInfo = res.data.promotion_score;
|
||||
this.total = res.data.list.total;
|
||||
if(this.page==1){this.dataList=[];}
|
||||
this.dataList = [...this.dataList,...res.data.list.list];
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</view>
|
||||
<view class="pad-zy30">
|
||||
<view class="disjbac" style="background: linear-gradient(to bottom, #fefcfc 0%, #f8efed 100%);border-radius: 24rpx 24rpx 0 0;">
|
||||
<view class="disjcac fc fon24 pad-sx30 width100" :class="item.is_today==1?'activeDay':''" v-for="(item,index) in signList" :key="index">
|
||||
<view class="disjcac fc fon24 pad-sx30 width100" :class="item.is_sign==1?'activeDay':''" v-for="(item,index) in signList" :key="index">
|
||||
<view class="">+{{item.score}}</view>
|
||||
<view class="mar-s10">{{item.key}}</view>
|
||||
</view>
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
</view>
|
||||
<view @tap="chooseCoupon" class="disjbac mar-s30">
|
||||
<view class="">优惠券抵扣</view>
|
||||
<view class="disjbac col-e42417">-¥{{couponInfo.coupon_price}} <i class="icon icon-next fon20" style="color: #7f7f7f;"></i></view>
|
||||
<view class="disjbac col-e42417" v-if="couponInfo.coupon_id">-¥{{couponInfo.coupon_price}} <i class="icon icon-next fon20" style="color: #7f7f7f;"></i></view>
|
||||
<view class="disjbac col26" v-else>可用优惠券{{couponNum}}张<i class="icon icon-next fon20" style="color: #7f7f7f;"></i></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon24 dis fe mar-s20">合计:<span class="col-e42417">{{realityPrice}}</span></view>
|
||||
|
@ -53,11 +54,13 @@
|
|||
coupon_id:'',//优惠券ID
|
||||
coupon_price:0//优惠券抵扣金额
|
||||
},
|
||||
flag:true
|
||||
flag:true,
|
||||
couponNum:0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.courseInfo = uni.getStorageSync('courseInfo');
|
||||
this.getCoupon();
|
||||
// uni.getStorageSync('skuList');
|
||||
},
|
||||
computed:{
|
||||
|
@ -75,6 +78,20 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取待使用优惠券列表
|
||||
getCoupon(){
|
||||
let params = {
|
||||
status:'normal',
|
||||
page:1,
|
||||
size:100,
|
||||
condition:this.courseInfo.original_total*1
|
||||
}
|
||||
this.$requst.get('/api/user/coupon-list',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.couponNum = res.data.list.length;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 调起优惠券弹框
|
||||
chooseCoupon(){
|
||||
this.$refs.refCoupon.couponId = this.couponInfo.coupon_id;
|
||||
|
|
|
@ -158,6 +158,7 @@
|
|||
this.datalist = [];
|
||||
this.$requst.get('/api/order/shopping-cart',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$store.commit('setCartNum',res.data.list.length);
|
||||
if(res.data.list.length){
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
|
@ -329,6 +330,7 @@
|
|||
this.delCart(this.datalist[index].id);
|
||||
setTimeout(()=>{
|
||||
this.datalist.splice(index,1);
|
||||
this.$store.commit('setCartNum',this.datalist.length);
|
||||
this.judgeSelectAllEv();
|
||||
},500)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<view>
|
||||
<status-container titlet="确认订单" returnc="#FFFFFF">
|
||||
<view slot="content" style="margin-top: -20rpx;" v-if="loading">
|
||||
<view @tap="$toolAll.tools.goPage(`/pagesA/my-address/my-address?ifChoose=1`)" class="bacf disjbac fon24 pad-sx20 pad-zy30 boxshowb">
|
||||
<view v-if="orderInfo.list[0].spu_type!='coupon'" @tap="$toolAll.tools.goPage(`/pagesA/my-address/my-address?ifChoose=1`)" class="bacf disjbac fon24 pad-sx20 pad-zy30 boxshowb">
|
||||
<view class="fon20 line-h40" v-if="addressInfo">
|
||||
<view class="" style="color: #676767;">{{addressInfo.province_str}}{{addressInfo.city_str}}{{addressInfo.county_str}}</view>
|
||||
<view class="fon26">{{addressInfo.address}}</view>
|
||||
|
|
|
@ -62,6 +62,8 @@
|
|||
import list from '@/components/list.vue';
|
||||
import swiperPu from '@/components/swipers/swiper-pu.vue';
|
||||
import buyPopu from '@/components/buy-popu.vue';
|
||||
import { mapState } from 'vuex';
|
||||
import { checkCartNum } from '@/jsFile/public-api.js';
|
||||
export default {
|
||||
components:{'foot-tab' :footTab,list,swiperPu,buyPopu},
|
||||
data() {
|
||||
|
@ -79,6 +81,11 @@
|
|||
ifDetail:false
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
...mapState({
|
||||
cartNum: state => state.moduleA.cartNum
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
// 开启banner图自动轮播
|
||||
this.$store.commit('setAutoplay',true);
|
||||
|
@ -109,6 +116,7 @@
|
|||
this.shopId = op.id;
|
||||
// 调用产品详情
|
||||
this.getDetail();
|
||||
this.cartNumEv();
|
||||
},
|
||||
methods: {
|
||||
// 获取产品详情
|
||||
|
@ -224,10 +232,19 @@
|
|||
this.$requst.post('/api/order/shopping-cart-add',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
|
||||
this.cartNumEv();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 查询购物车数量
|
||||
cartNumEv(){
|
||||
checkCartNum().then(res=>{
|
||||
if(res.code==0){
|
||||
this.$store.commit('setCartNum',res.data.count);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除对象中某个字段
|
||||
objField(field){
|
||||
let newObj = JSON.parse(JSON.stringify(this.shopList[0].sku_list[0]));
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
<input @tap="uploadVideo" class="width100 radius4 mar-s20 pad-zy20 tcenter" type="text" placeholder="浏览..." disabled
|
||||
style="border: 2rpx solid #ececec;background-color: #f5f5f5;height: 70rpx;box-sizing: border-box;">
|
||||
<view class="pad-s20" v-if="videoInfo.full_src">
|
||||
<video :src="videoInfo.full_src" :controls="true" object-fit="contain" :show-center-play-btn="true" style="height: 180rpx;" class="width100"></video>
|
||||
<video :src="videoInfo.full_src" :controls="true" object-fit="contain" :show-center-play-btn="true" style="height: 388rpx;" class="width100"></video>
|
||||
</view>
|
||||
<input @tap="submitEv" class="width100 radius4 mar-s60 tcenter" type="text" placeholder="立即上传" placeholder-style="color:#FFFFFF;" disabled
|
||||
<input @tap="submitEv" class="width100 radius4 mar-s60 tcenter" type="text" placeholder="立即保存" placeholder-style="color:#FFFFFF;" disabled
|
||||
style="border: 2rpx solid #e42417;background-color: #e42417;height: 70rpx;box-sizing: border-box;">
|
||||
</view>
|
||||
</view>
|
||||
|
@ -68,7 +68,7 @@
|
|||
this.flag = false;
|
||||
let params = {
|
||||
title:this.title,
|
||||
video:this.videoInfo.full_src
|
||||
video:this.videoInfo.src
|
||||
}
|
||||
uni.showToast({
|
||||
title:'正在上传练习视频',
|
||||
|
@ -79,7 +79,7 @@
|
|||
if(res.code==0){
|
||||
this.title = '';
|
||||
this.videoInfo.full_src = '';
|
||||
this.$toolAll.tools.showToast('上传练习视频成功');
|
||||
this.$toolAll.tools.showToast('保存成功');
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack({delta:1})
|
||||
},1000)
|
||||
|
|
|
@ -3,7 +3,8 @@ export default {
|
|||
token:'token已生成',
|
||||
userInfo:{},
|
||||
ifAutoplay:false ,// 组件轮播是否自动播放
|
||||
fristIn:false
|
||||
fristIn:false,//是否第一次进入
|
||||
cartNum:0//购物车数量
|
||||
},
|
||||
// Vuex中store数据改变的唯一方法就是mutations 不适合异步方法
|
||||
mutations: {
|
||||
|
@ -14,5 +15,9 @@ export default {
|
|||
setFristIn(state,str) {
|
||||
state.fristIn = str;
|
||||
},
|
||||
// 设置购物车数量
|
||||
setCartNum(state,str) {
|
||||
state.cartNum = str;
|
||||
},
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue