123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>确认-订单-创业帮</title>
- <meta name="keywords" content="确认-订单-创业帮">
- <meta name="description" content="确认-订单-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="确认-订单-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- <style>
- .van-ellipsis{overflow:hidden;}
- .mall-bottom{padding:0 .3733rem;height:54px;}
- .mall-bottom button{border-radius:999px !important; height:80% !important;}
- </style>
- </head>
- <body class="bgc-back pt0" style="padding-top:0;">
- <div id="app" v-cloak>
- <van-nav-bar class="user_rank_explan_title user_title_normal f16 rightbtn" title="确认订单" left-arrow @click-left="goback" v-if="toptitleisshow" v-cloak>
- <template #left><img src="./static/images/icon-comback@2x.png" alt=""></template>
- </van-nav-bar>
- <div class="deal-check" v-cloak>
- <van-cell-group :border="false">
- <van-card class="suremall" :price="products.Price" :desc="products.Details" :title="products.ProductName" :num="products.num" :thumb="products.DetailPicPath" :lazy-load="true" centered>
- <template #footer>
- <div class="tr van-hairline--top pt8 mt8"><span class="f12 c666">共{{products.num}}件商品 实付金额:</span><span class="f14 c333 more b" v-if="products.Price">¥{{products.total | tofixed2}}</span></div>
- </template>
- </van-card>
- </van-cell-group>
- </div>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button class="kxs-btn" type="default" color="#FFD500" style="color:#333;" text="确认订单" @click="onClickButton"></van-goods-action-button>
- </van-goods-action>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- function OnStart(){
- app.getinfo();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- activeIcon:'./static/images/checked@3x.png',
- inactiveIcon:'./static/images/unchecked@3x.png',
- toptitleisshow:false,
- active: 0,
- radio: '1',
- dealNote: '',
- //- 收货地址Id
- selectedAddress: '',
- address: {
- },
- //- 仓库Id
- selectedWarehouseId: '',
- warehouse:{
- },
- products:{
- },
- ProductJson:[],
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- const mallinfo = JSON.parse(PublicLib.getCookieInfo('checkmallInfo'));
- this.checkmallinfo(mallinfo);
- this.setgroupinfo(mallinfo);
- //- this.getinfo();
- },
- methods: {
- getinfo(){
- //- 拿到仓库Id
- this.selectedWarehouseId = PublicLib.getCookieInfo('warehouseId');
- //- 如果有仓库Id,就发起请求
- if(this.selectedWarehouseId !== '') {
- this.getwarehousedetail();
- };
- //- 拿到收货地址Id
- this.selectedAddress = PublicLib.getCookieInfo('addressId');
- //- 如果有收货地址Id,就发起请求
- if(this.selectedAddress !== '') {
- this.getaddressdetail();
- };
- },
- //- 点击确认订单
- async onClickButton() {
- //- if(this.selectedWarehouseId === ''){
- //- return tips('请选择发货仓库!')
- //- };
- //- if(this.selectedAddress === '' && this.radio === '1'){
- //- return tips('请选择收货地址!')
- //- };
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('api/v1/orders/confirmorder2?t='+Math.random(6),JSON.stringify({UserId,Remark:this.dealNote,ProductJson:this.ProductJson}));
- //- const res = await postRequest('api/v1/orders/confirmorder?t='+Math.random(6),JSON.stringify({UserId,DeliveryType:this.radio,StoreId:this.selectedWarehouseId,Remark:this.dealNote,AddressId:this.selectedAddress,ProductJson:this.ProductJson}));
- if(res.status !== '1') return tips(res.info);
- console.log(res)
- PublicLib.putCookieInfo('mallorderId', res.data.Id);
- //- 清除仓库Id
- PublicLib.putCookieInfo('warehouseId', '');
- //- 清除收货地址Id
- PublicLib.putCookieInfo('addressId', '');
- PublicLib.Goto({Url:'mall-deal-detail'});
- },
- selectaddress(){
- PublicLib.Goto({Url:'mall-address-list'});
- },
- //- 返回商品详情页
- goback(){
- PublicLib.GoBack({Level:1});
- //- 清除仓库Id
- PublicLib.putCookieInfo('warehouseId', '');
- //- 清除收货地址Id
- PublicLib.putCookieInfo('addressId', '');
- },
- //- 获取商品信息
- async checkmallinfo(data){
- //- PublicLib.ShowLoading({Message:''});
- const res = await getRequest('api/v1/products/detail?t='+Math.random(6),JSON.stringify({Id:data.goodsId}));
- if(res.status !== '1') return tips('获取订单信息失败,请重试!');
- //- PublicLib.HideLoading();
- res.data.DetailPicPath = res.data.DetailPicPath.length === 0 ? './static/images/payment-type-1.png' : res.data.DetailPicPath[0].Photo;
- this.products = res.data;
- this.products.num = data.selectedNum;
- this.products.Price = data.selectedSkuComb.price.toFixed(2);
- this.products.total = data.selectedNum * this.products.Price;
- },
- //- 设置商品提交信息
- setgroupinfo(data){
- const parameter = {
- ProductId: data.goodsId,
- // 商品规格Id
- NormId: data.selectedSkuComb.id,
- BuyCount: data.selectedNum,
- };
- console.log(data);
- this.ProductJson.push(parameter);
- },
- //- 选择发货仓库
- gowarehouse(){
- PublicLib.putCookieInfo('wareBrandId', this.products.BrandId);
- PublicLib.Goto({Url:'mall-warehouse-list'});
- },
- //- 获取发货仓详情
- async getwarehousedetail(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/storehouse/sendstoredetail?t='+Math.random(6),JSON.stringify({UserId,Id:this.selectedWarehouseId}));
- if(res.status !== '1') return tips('获取发货仓库详情失败,请重试!');
- this.warehouse = res.data;
- },
- //- 获取收货地址详情
- async getaddressdetail(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/useraddress/detail?t='+Math.random(6),JSON.stringify({UserId,Id:this.selectedAddress}));
- if(res.status !== '1') return tips('获取收货地址详情失败,请重试!');
- this.address = res.data;
- }
- }
- });
- </script>
- </body>
- </html>
|