Enzo 4 years ago
parent
commit
9cc05f9f0c
  1. 8
      pages/business/center/center.vue
  2. 4
      pages/business/payment/wait.vue
  3. 79
      pages/shop/goodsdetail.vue
  4. 2
      pages/user/member/code.vue

8
pages/business/center/center.vue

@ -128,7 +128,13 @@
} }
}).then(res => { }).then(res => {
console.log("getStoreCenter", res); console.log("getStoreCenter", res);
this.detail = res.data.data;
if(res.data.code == 200){
this.detail = res.data.data;
}else{
this.$msg('您的状态异常,请重新登录').then(() => {
this.$url('/pages/business/login/login', {type: 'redirect'});
})
}
}) })
}, },
// //

4
pages/business/payment/wait.vue

@ -63,12 +63,12 @@
token: token token: token
} }
}).then(res => { }).then(res => {
if(this.$isRight(res.data.data)){
if(this.$isRight(res.data.data) && res.data.data.status == 2){
let url = '/pages/business/payment/paystate'; let url = '/pages/business/payment/paystate';
url += '?payState=1'; url += '?payState=1';
url += '&amount='+ this.amount; url += '&amount='+ this.amount;
this.$url(url, {type: 'redirect'}); this.$url(url, {type: 'redirect'});
}else if(this.overtime){
}else if(this.overtime || (res.data.data && res.data.data.status == 3)){
let url = '/pages/business/payment/paystate'; let url = '/pages/business/payment/paystate';
url += '?payState=0'; url += '?payState=0';
this.$url(url, {type: 'redirect'}); this.$url(url, {type: 'redirect'});

79
pages/shop/goodsdetail.vue

@ -10,9 +10,11 @@
<view class="seckill-box" v-if="type == 'seckill'"> <view class="seckill-box" v-if="type == 'seckill'">
<view>距离结束还剩余</view> <view>距离结束还剩余</view>
<view> <view>
<countdown-timer :time="time" :autoStart="true">
<template v-slot="{hour, minute, second}">
<countdown-timer :time="time" :autoStart="true" @finish="dateFinish">
<template v-slot="{day, hour, minute, second}">
<view class="lf-flex"> <view class="lf-flex">
<view>{{ day }}</view>
<view></view>
<view>{{ hour >= 10 ? hour : "0" + hour }}</view> <view>{{ hour >= 10 ? hour : "0" + hour }}</view>
<view></view> <view></view>
<view>{{ minute >= 10 ? minute : "0" + minute }}</view> <view>{{ minute >= 10 ? minute : "0" + minute }}</view>
@ -252,10 +254,9 @@
skeletonLoading: false, skeletonLoading: false,
pictures: [], pictures: [],
show_popup: false, // show_popup: false, //
spec_current: null, //
click_type: null, // [1][2] click_type: null, // [1][2]
type: 'mail', // mailpointseckill type: 'mail', // mailpointseckill
time: new Date('2021/09/8 14:15:00').getTime() - new Date('2021/09/8 13:10:00').getTime(),
time: 0,
goods_stock: { goods_stock: {
specs: {}, specs: {},
stores: {} stores: {}
@ -264,7 +265,8 @@
brand_detail: {}, brand_detail: {},
token: '', token: '',
coupons: [], // coupons: [], //
goods_num: 1
goods_num: 1,
is_date_finish: false
} }
}, },
computed: { computed: {
@ -272,15 +274,21 @@
let goods_detail = this.goods_detail; let goods_detail = this.goods_detail;
let stores = this.goods_stock.stores; let stores = this.goods_stock.stores;
let specs = this.goods_stock.specs; let specs = this.goods_stock.specs;
let specId = 1;
if(!this.$isRight(specs[specId])){
if(!this.$isRight(specs[1])){
return `${goods_detail.min_price} - ¥${goods_detail.max_price}`; return `${goods_detail.min_price} - ¥${goods_detail.max_price}`;
} }
let spec_current = specs[specId].spec_current;
if(specs[specId].spec_current != null){
let id = specs[specId].list[spec_current].id;
return "¥"+ stores[specId +'-'+ id].price;
let spec_current_1 = specs[1].spec_current;
let spec_current_2 = specs[2].spec_current;
if(specs[1].spec_current != null && specs[2].spec_current != null){
let id_1 = specs[1].list[spec_current_1].id;
let id_2 = specs[2].list[spec_current_2].id;
if(id_1 < id_2){
let id_3 = id_2;
id_2 = id_1;
id_1 = id_3;
}
return "¥"+ stores[id_2 +'-'+ id_1].price;
}else{ }else{
return `${goods_detail.min_price} - ¥${goods_detail.max_price}`; return `${goods_detail.min_price} - ¥${goods_detail.max_price}`;
} }
@ -381,24 +389,49 @@
}, },
// TODO // TODO
confirm(){ confirm(){
if(this.is_date_finish){
return this.$msg('活动已结束');
}
let goods_detail = this.goods_detail; let goods_detail = this.goods_detail;
let specs = this.goods_stock.specs; let specs = this.goods_stock.specs;
let stores = this.goods_stock.stores; let stores = this.goods_stock.stores;
let s_id_1 = 1;
let s_id_2 = 2;
for(let i in specs){
if(specs[i].label_key == 'size'){
s_id_1 = 1;
}
if(specs[i].label_key == 'color'){
s_id_2 = 2;
}
}
let spec_current_1 = specs[s_id_1].spec_current;
let spec_current_2 = specs[s_id_2].spec_current;
let id_1 = specs[s_id_1].list[spec_current_1].id;
let id_2 = specs[s_id_2].list[spec_current_2].id;
if(id_1 > id_2){
let id_3 = id_2;
id_2 = id_1;
id_1 = id_3;
}
let par = { let par = {
attributes: { attributes: {
color: specs[2].list[specs[2].spec_current].value,
color: specs[s_id_2].list[specs[s_id_2].spec_current].value,
com_id: goods_detail.id, com_id: goods_detail.id,
img: goods_detail.img, img: goods_detail.img,
size: specs[1].list[specs[1].spec_current].value,
sku: goods_detail.goods_no +'-'+ specs[1].list[specs[1].spec_current].value
size: specs[s_id_1].list[specs[s_id_1].spec_current].value,
sku: goods_detail.goods_no +'-'+ specs[s_id_1].list[specs[s_id_1].spec_current].value
}, },
id: stores[1 +'-'+ specs[1].list[specs[1].spec_current].id].id,
product_id: stores[1 +'-'+ specs[1].list[specs[1].spec_current].id].id,
id: stores[id_1 +'-'+ id_2].id,
product_id: stores[id_1 +'-'+ id_2].id,
price: stores[id_1 +'-'+ id_2].price,
store_count: stores[id_1 +'-'+ id_2].store,
market_price: goods_detail.market_price, market_price: goods_detail.market_price,
name: goods_detail.name, name: goods_detail.name,
price: stores[1 +'-'+ specs[1].list[specs[1].spec_current].id].price,
qty: this.goods_num,
store_count: stores[1 +'-'+ specs[1].list[specs[1].spec_current].id].store
qty: this.goods_num
} }
uni.showLoading({ uni.showLoading({
@ -506,6 +539,8 @@
if(this.$isRight(meta.seckill)){ if(this.$isRight(meta.seckill)){
type = 'seckill'; type = 'seckill';
this.seckill = meta.seckill; this.seckill = meta.seckill;
let currentDate = this.$shared.recordTime();
this.time = new Date(meta.seckill.ends_at).getTime() - new Date(currentDate).getTime()
} }
if(type != 'point'){ if(type != 'point'){
this.getBrandDetail(goods_detail.brand_id); this.getBrandDetail(goods_detail.brand_id);
@ -570,6 +605,10 @@
}) })
}, 200); }, 200);
}, },
//
dateFinish(){
this.is_date_finish = true;
},
// //
formatRichText(richText){ formatRichText(richText){
if(richText != null){ if(richText != null){

2
pages/user/member/code.vue

@ -219,7 +219,7 @@
this.show_code = true; this.show_code = true;
this.show_code_count++; this.show_code_count++;
} }
if(detail.clerk_id){
if(detail.status == 1){
// , // ,
let amount = detail.amount; let amount = detail.amount;
let brand_id = detail.brand_id; let brand_id = detail.brand_id;

Loading…
Cancel
Save