提交 11cf932a authored 作者: 刘旭's avatar 刘旭

修改bug

上级 766cb48c
......@@ -198,6 +198,7 @@ let addCarts = (selectShop: any) => {
};
// 立即购买
let buyNow = (selectShop: any) => {
console.log(selectShop, selectShop.sku_name_arr ,' selectShop.sku_name_arr');
let productId: any = getProductId(selectShop.sku_name_arr)
let shop = custom(selectShop)
let specifications: any = []
......@@ -221,7 +222,7 @@ let buyNow = (selectShop: any) => {
fastaddCart(data).then((res: any) => {
if(res.data.code === 200) {
uni.navigateTo({
url: `../order/checkout?type=` + 'goods',
url: `../order/checkout?type=` + 'goods' + '&buyNowId=' + res.data.data,
success() {
if(!uni.getStorageSync('addressId')) {
uni.setStorage({
......@@ -230,7 +231,6 @@ let buyNow = (selectShop: any) => {
})
}
let storage: any = {
buyNowId: res.data.data,
cartId: 0,
couponId: 0,
}
......@@ -300,6 +300,14 @@ const handleClose = () => {
skuPopupRef.value.handClose()
}
// 重置页面数据
let reload = () => {
let pages = getCurrentPages(); //获取所有页面的数组对象
let currPage: any = pages[pages.length - 1]; //当前页面
uni.reLaunch({
url: '/' + currPage.route + '?id=' + detailId.value,
});
};
defineExpose({
skuKey,
......
......@@ -9,9 +9,15 @@
@confirm="search"
/>
</view>
<!-- 轮播图 -->
<!-- 轮播图 effect3d-->
<view class="wrap">
<u-swiper :list="indexData?.banner" name="url" height="400" img-mode="aspectFit"></u-swiper>
<u-swiper
:list="indexData?.banner"
name="url"
height="400"
img-mode="aspectFit"
bg-color="#ffffff"
></u-swiper>
</view>
<!-- 宫格布局 -->
<u-grid :col="6" class="grid" @tap="clickGrid">
......@@ -22,7 +28,7 @@
item.iconUrl.split('http').length > 1
? item.iconUrl
: baseUrl + item.iconUrl
"
"
:size="46"
></u-icon>
<view class="grid-text">{{ item.name }}</view>
......
......@@ -87,16 +87,37 @@ import { checkoutCart, orderSubmit } from '@/api/index';
import config from '@/utils/config';
let baseUrl = config.baseUrl;
const buyNowId = ref(uni.getStorageSync('buyNowId') || 0);
const buyNowId = ref();
const buyNowData = ref();
const remarks = ref(); // 订单备注
const type = ref('' as any); // 何种方式下单
onLoad((options: any) => {
type.value = options.type;
if (options.buyNowId) buyNowId.value = options.buyNowId;
switch (type.value) {
case 'cart':
buyNowId.value = 0;
initCheckoutCart(buyNowId.value, 0);
break;
case 'productLineCart':
buyNowId.value = 0;
initCheckoutCart(buyNowId.value, 2);
break;
case 'goods':
initCheckoutCart(buyNowId.value, 0);
break;
case 'productline':
initCheckoutCart(buyNowId.value, 2);
break;
}
console.log(type.value, '.type');
});
onShow(() => {
});
// 设置地址
const tapAddresss = () => {
uni.navigateTo({
......@@ -130,12 +151,6 @@ const onsubmit = () => {
url: `/pages/order/downPdf?orderId=${res.data.data.orderId}&type=${type.value}`,
});
}
// orderDetail({
// orderId: res.data.data.orderId,
// }).then((res1: any) => {
// console.log(res1, '订单详情信息');
// });
}
});
};
......@@ -169,8 +184,8 @@ const initCheckoutCart = (cartId: number, types: number) => {
});
};
onShow(() => {
switch (type.value) {
const init = (type: string) => {
switch (type) {
case 'cart':
buyNowId.value = 0;
initCheckoutCart(buyNowId.value, 0);
......@@ -180,7 +195,6 @@ onShow(() => {
initCheckoutCart(buyNowId.value, 2);
break;
case 'goods':
buyNowId.value = uni.getStorageSync('buyNowId');
initCheckoutCart(buyNowId.value, 0);
break;
case 'productline':
......@@ -188,8 +202,7 @@ onShow(() => {
initCheckoutCart(buyNowId.value, 2);
break;
}
});
};
</script>
<style lang="scss" scoped>
......
......@@ -59,7 +59,12 @@
<u-input v-model="formData.pay" placeholder="请输入付款方式" />
</u-form-item>
<u-form-item label="保修:" prop="guarantee">
<u-input type="number" v-model="formData.guarantee" placeholder="请输入保修" />
<u-input
v-model="formData.guarantee"
:disabled="true"
placeholder="请输入保修"
@tap="guaranteeShow = true"
/>
</u-form-item>
<u-form-item label="备注:" prop="remarks">
<u-input type="textarea" v-model="formData.remarks" placeholder="请输入备注" />
......@@ -70,6 +75,7 @@
<u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm"></u-picker>
<u-picker mode="region" v-model="pickerShow1" @confirm="regionConfirm1"></u-picker>
<u-picker mode="time" v-model="pickerDateShow" @confirm="dateConfirm"></u-picker>
<u-select v-model="guaranteeShow" :list="guaranteeList" @confirm="guaranteeConfirm"></u-select>
<order-form ref="orderRef" @onSubmit="onSubmit" />
<u-modal
v-model="showModel"
......@@ -93,6 +99,7 @@ let baseUrl = config.baseUrl;
let pickerShow = ref(false)
let pickerShow1 = ref(false)
let pickerDateShow = ref(false)
let guaranteeShow = ref(false)
let showModel = ref(false)
let content = ref('是否下载execl?')
let formData = ref({
......@@ -157,6 +164,12 @@ let rules = ref({
guarantee: [{ required: true, message: '请输入保修', trigger: 'blur' }],
});
let guaranteeList = ref([
{value: '1年', label: '1年'},
{value: '2年', label: '2年'},
{value: '其他', label: '其他'}
])
let uFormRef = ref();
let quotationData = ref();
let unitPrice = ref()
......@@ -251,6 +264,11 @@ let dateConfirm = (e: any) => {
formData.value.deliveryDate = e.year + '-' + e.month + '-' + e.day
}
// 选择保修回调
let guaranteeConfirm = (e: any) => {
formData.value.guarantee = e[0].value
}
// 初始化数据
let initQuotation = (orderId: number) => {
quotationInit({ orderId }).then((res: any) => {
......
......@@ -318,7 +318,6 @@ let buyNow = () => {
});
}
let storage: any = {
buyNowId: res.data.data,
cartId: 0,
couponId: 0,
};
......@@ -330,7 +329,7 @@ let buyNow = () => {
});
});
uni.navigateTo({
url: `../order/checkout?type=` + 'productline',
url: '../order/checkout?type=' + 'productline' + '&buyNowId=' + res.data.data,
});
}
});
......@@ -426,7 +425,6 @@ let reload = () => {
url: '/' + currPage.route,
});
};
</script>
<style lang="scss" scoped>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论