weixin_52219567 3 săptămâni în urmă
părinte
comite
713150f153

+ 2 - 2
src/addon/shop/api/order.ts

@@ -33,7 +33,7 @@ export function getShopOrderNum() {
  * 获取订单详情
  */
 export function getShopOrderDetail(order_id: any) {
-    return request.get(`shop/order/${ order_id }`)
+    return request.get(`order/miniOrder/${ order_id }`)
 }
 
 /**
@@ -61,7 +61,7 @@ export function orderCreateCalculate(params: Record<string, any>) {
  * 订单创建
  */
 export function orderCreate(params: Record<string, any>) {
-    return request.post('shop/order_create/create', params)
+    return request.post('order/miniOrder/submit', params)
 }
 
 /**

+ 1 - 1
src/addon/shop/components/diy/shop-goods-detail-basic-info/index.vue

@@ -344,7 +344,7 @@
 	// 价格模块样式
 	const marketGoodCss = computed(() => {
 		let style = "";
-		let imgVal = diyComponent.value.priceRegion.marketingBgImg;
+		let imgVal = 'https://v6.site.niucloud.com/' + diyComponent.value.priceRegion.marketingBgImg;
 		style += `background: url(${img(imgVal)}) no-repeat;`;
 
 		if (diyComponent.value.goodsInfo.priceBgColor) {

+ 139 - 350
src/addon/shop/components/ns-goods-sku/ns-goods-sku.vue

@@ -1,13 +1,16 @@
 <template>
     <view @touchmove.prevent.stop>
         <u-overlay :show="goodsSkuPop" @click="closeFn" zIndex="490">
-            <u-popup class="popup-type" :show="goodsSkuPop" @close="closeFn" mode="bottom" :overlay="false" zIndex="500">
-                <view class="py-[32rpx] relative" v-if="goodsDetail.detail" @touchmove.prevent.stop>
-                    <view class="flex px-[32rpx]" :class="{'mb-[58rpx]':!(goodsDetail.is_newcomer && goodsDetail.newcomer_price != goodsDetail.price && (Object.keys(cartSkuList).length?parseInt(cartSkuList.num)+buyNum:buyNum)>1)}">
+            <u-popup class="popup-type" :show="goodsSkuPop" @close="closeFn" mode="bottom" :overlay="false"
+                zIndex="500">
+                <view class="py-[32rpx] relative" v-if="goodsDetail.id" @touchmove.prevent.stop>
+                    <view class="flex px-[32rpx]">
                         <view class="rounded-[var(--goods-rounded-big)] overflow-hidden w-[180rpx] h-[180rpx]">
-                            <u--image width="180rpx" height="180rpx" :src="img(goodsDetail.detail.sku_image)" @click="imgListPreview(goodsDetail.detail.sku_image)" model="aspectFill">
+                            <u--image width="180rpx" height="180rpx" :src="img(goodsDetail.productImage)"
+                                @click="imgListPreview(goodsDetail.productImage)" model="aspectFill">
                                 <template #error>
-                                    <image class="w-[180rpx] h-[180rpx]" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill" />
+                                    <image class="w-[180rpx] h-[180rpx]"
+                                        :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill" />
                                 </template>
                             </u--image>
                         </view>
@@ -15,456 +18,241 @@
                             <view class="w-[100%]">
                                 <view class="text-[var(--price-text-color)] flex items-baseline">
                                     <text class="text-[32rpx] font-bold price-font">¥</text>
-                                    <text class="text-[48rpx] price-font">{{ parseFloat(goodsPrice).toFixed(2).split('.')[0] }}</text>
-                                    <text class="text-[32rpx] mr-[6rpx] price-font">.{{ parseFloat(goodsPrice).toFixed(2).split('.')[1] }}</text>
-                                    <image class="h-[24rpx] ml-[6rpx] max-w-[60rpx]" v-if="priceType() == 'newcomer_price'" :src="img('addon/shop/newcomer.png')" mode="heightFix" />
-                                    <image class="h-[24rpx] ml-[6rpx] max-w-[44rpx]" v-if="priceType() == 'member_price'" :src="img('addon/shop/VIP.png')" mode="heightFix" />
-                                    <image class="h-[24rpx] ml-[6rpx] max-w-[80rpx]" v-if="priceType() == 'discount_price'" :src="img('addon/shop/discount.png')" mode="heightFix" />
+                                    <text class="text-[48rpx] price-font">{{
+                                        parseFloat(goodsPrice).toFixed(2).split(".")[0]
+                                        }}</text>
+                                    <text class="text-[32rpx] mr-[6rpx] price-font">.{{
+                                        parseFloat(goodsPrice).toFixed(2).split(".")[1]
+                                        }}</text>
                                 </view>
-                                <view class="text-[26rpx] leading-[32rpx] text-[var(--text-color-light6)] mt-[12rpx]">库存{{ goodsDetail.detail.stock }}{{ goodsDetail.goods.unit }}</view>
+                                <view class="text-[26rpx] leading-[32rpx] text-[var(--text-color-light6)] mt-[12rpx]">
+                                    库存{{ goodsDetail.allStock
+                                    }}{{ goodsDetail.goods.unit }}</view>
                             </view>
-                            <view class="text-[26rpx] leading-[30rpx] text-[var(--text-color-light6)] w-[100%] max-h-[60rpx] multi-hidden" v-if="goodsDetail.goodsSpec && goodsDetail.goodsSpec.length">已选规格:{{ goodsDetail.detail.sku_spec_format }}</view>
-                            <!-- 	<view v-if="goodsDetail.goodsSpec && goodsDetail.goodsSpec.length">
-                                          <text>已选规格:{{goodsDetail.detail.sku_spec_format}}</text>
-                                        </view> -->
-                        </view>
-                    </view>
-                    <view class="flex items-center px-[32rpx] pt-[8rpx] pb-[16rpx] h-[58rpx] box-border"
-                          v-if="goodsDetail.is_newcomer && goodsDetail.newcomer_price != goodsDetail.price && (Object.keys(cartSkuList).length?parseInt(cartSkuList.num)+buyNum:buyNum)>1">
-                        <image class="h-[24rpx] w-[56rpx]" :src="img('addon/shop/newcomer.png')" mode="aspectFit" />
-                        <view class="text-[24rpx] text-[#FFB000] leading-[34rpx] ml-[8rpx]">
-                            第1{{ goodsDetail.goods.unit }},¥{{ parseFloat(goodsDetail.newcomer_price).toFixed(2) }}/{{ goodsDetail.goods.unit }};第{{ (parseInt(cartSkuList.num || 0) + buyNum) > 2 ? '2~' + (parseInt(cartSkuList.num || 0) + buyNum) : '2' }}{{ goodsDetail.goods.unit }},¥{{ parseFloat(parseFloat(goodsDetail.show_price)).toFixed(2) }}/{{ goodsDetail.goods.unit }}
                         </view>
                     </view>
+
                     <scroll-view class="h-[500rpx] px-[32rpx] box-border mb-[60rpx]" scroll-y="true">
-                        <view :class="{'mt-[20rpx]': 0 != index }" v-for="(item,index) in goodsDetail.goodsSpec" :key="index">
-                            <view class="text-[28rpx] leading-[36rpx] mb-[24rpx]">{{ item.spec_name }}</view>
-                            <view class="flex flex-wrap">
-                                <view class="box-border bg-[var(--temp-bg)] text-[24rpx] px-[44rpx] text-center h-[56rpx] flex-center mr-[20rpx] mb-[20rpx] border-1 border-solid rounded-[50rpx] border-[var(--temp-bg)]"
-                                    :class="{'!border-[var(--primary-color)] text-[var(--primary-color)] !bg-[var(--primary-color-light)]': subItem.selected}"
-                                    v-for="(subItem,subIndex) in item.values" :key="subIndex"
-                                    @click="change(subItem, index)">{{ subItem.name }}</view>
-                            </view>
-                        </view>
                         <view class="flex justify-between items-center my-[20rpx]">
                             <view class="text-[28rpx]">购买数量</view>
-                            <text v-if="maxBuyShow > 0 && minBuyShow > 1" class="ml-[20rpx] mr-[auto] text-[24rpx] text-[var(--primary-color)]">({{ minBuyShow }}{{ goodsDetail.goods.unit }}起售,限购{{ maxBuyShow }}{{ goodsDetail.goods.unit }})</text>
-                            <text v-else-if="maxBuyShow > 0" class="ml-[20rpx] mr-[auto] text-[24rpx] text-[var(--primary-color)]">(限购{{ maxBuyShow }}{{ goodsDetail.goods.unit }})</text>
-                            <text v-else-if="minBuyShow > 1" class="ml-[20rpx] mr-[auto] text-[24rpx] text-[var(--primary-color)]">({{ minBuyShow }}{{ goodsDetail.goods.unit }}起售)</text>
-                            <u-number-box :min="minBuy" :max="maxBuy" integer :step="1" input-width="68rpx" v-model="buyNum" input-height="52rpx">
+                            <text class="ml-[20rpx] mr-[auto] text-[24rpx] text-[var(--primary-color)]">({{
+                                goodsDetail.minOrderQuantity
+                                }}{{ goodsDetail.goods.unit }}起售)</text>
+                            <u-number-box :min="goodsDetail.minOrderQuantity" :max="goodsDetail.allStock" integer
+                                :step="1" input-width="68rpx" v-model="buyNum" input-height="52rpx">
                                 <template #minus>
                                     <view class="relative w-[30rpx] h-[30rpx]" @click="reduceNumChange">
-                                        <text class="text-[30rpx] nc-iconfont nc-icon-jianV6xx font-500 absolute flex items-center justify-center -left-[8rpx] -bottom-[8rpx] -right-[8rpx] -top-[8rpx]"
-                                            :class="{ '!text-[var(--text-color-light9)]': buyNum <= minBuy }"></text>
+                                        <text
+                                            class="text-[30rpx] nc-iconfont nc-icon-jianV6xx font-500 absolute flex items-center justify-center -left-[8rpx] -bottom-[8rpx] -right-[8rpx] -top-[8rpx]"
+                                            :class="{
+                                                '!text-[var(--text-color-light9)]':
+                                                    buyNum <= goodsDetail.minOrderQuantity,
+                                            }"></text>
                                     </view>
                                 </template>
                                 <template #input>
-                                    <input class="text-[#303133] text-[28rpx] mx-[10rpx] w-[80rpx] h-[44rpx] bg-[var(--temp-bg)] leading-[44rpx] text-center rounded-[6rpx]"
-                                        type="number" @input="goodsSkuInputFn" @blur="goodsSkuBlurFn" v-model="buyNum" />
+                                    <input
+                                        class="text-[#303133] text-[28rpx] mx-[10rpx] w-[80rpx] h-[44rpx] bg-[var(--temp-bg)] leading-[44rpx] text-center rounded-[6rpx]"
+                                        type="number" @input="goodsSkuInputFn" @blur="goodsSkuBlurFn"
+                                        v-model="buyNum" />
                                 </template>
                                 <template #plus>
                                     <view class="relative w-[30rpx] h-[30rpx]" @click="addNumChange">
-                                        <text class="text-[30rpx] nc-iconfont nc-icon-jiahaoV6xx font-500 absolute flex items-center justify-center -left-[8rpx] -bottom-[8rpx] -right-[8rpx] -top-[8rpx]"
-                                            :class="{ '!text-[var(--text-color-light9)]': buyNum >= maxBuy || buyNum == 0 }"></text>
+                                        <text
+                                            class="text-[30rpx] nc-iconfont nc-icon-jiahaoV6xx font-500 absolute flex items-center justify-center -left-[8rpx] -bottom-[8rpx] -right-[8rpx] -top-[8rpx]"
+                                            :class="{
+                                                '!text-[var(--text-color-light9)]':
+                                                    buyNum >= goodsDetail.allStock || buyNum == 0,
+                                            }"></text>
                                     </view>
                                 </template>
                             </u-number-box>
                         </view>
-                        <view class="mt-[40rpx]">
-                            <diy-form ref="diyFormRef" :form_id="goodsDetail.goods.form_id" :storage_name="'diyFormStorageByGoodsDetail_' + goodsDetail.sku_id" />
-                        </view>
                     </scroll-view>
                     <view class="px-[20rpx]">
-
                         <!-- #ifndef MP -->
-                        <button v-if="goodsDetail.detail.stock > 0" hover-class="none" class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 rounded-[50rpx] primary-btn-bg" type="primary" @click="confirm">确定</button>
+                        <button v-if="goodsDetail.allStock > 0" hover-class="none"
+                            class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 rounded-[50rpx] primary-btn-bg"
+                            type="primary" @click="confirm">
+                            确定
+                        </button>
                         <!-- #endif -->
 
                         <!-- #ifdef MP -->
-                        <template v-if="goodsDetail.detail.stock > 0">
-                            <!--<button v-if="isBindMobile && userInfo && !userInfo.mobile" hover-class="none" class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 rounded-[50rpx] primary-btn-bg" type="primary" open-type="getPhoneNumber" @getphonenumber="memberStore.bindMobile">确定</button>-->
-                            <!--<button v-else hover-class="none" class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 rounded-[50rpx] primary-btn-bg" type="primary" @click="confirm">确定</button>-->
-                            <button hover-class="none" class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 rounded-[50rpx] primary-btn-bg" type="primary" @click="confirm">确定</button>
+                        <template v-if="goodsDetail.allStock > 0">
+                            <button hover-class="none"
+                                class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 rounded-[50rpx] primary-btn-bg"
+                                type="primary" @click="confirm">
+                                确定
+                            </button>
                         </template>
                         <!-- #endif -->
 
-                        <button hover-class="none" v-else class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 text-[#fff] bg-[#ccc] rounded-[50rpx]">已售罄</button>
+                        <button hover-class="none" v-else
+                            class="!h-[80rpx] leading-[80rpx] text-[26rpx] font-500 text-[#fff] bg-[#ccc] rounded-[50rpx]">
+                            已售罄
+                        </button>
                     </view>
                 </view>
             </u-popup>
         </u-overlay>
-        <!-- 强制绑定手机号 -->
-        <bind-mobile ref="bindMobileRef" />
     </view>
 </template>
 
 <script setup lang="ts">
-import { ref, computed, toRaw } from 'vue';
-import { img, redirect, getToken } from '@/utils/common'
-import useCartStore from '@/addon/shop/stores/cart'
-import { useLogin } from '@/hooks/useLogin'
-import useMemberStore from '@/stores/member'
-import bindMobile from '@/components/bind-mobile/bind-mobile.vue';
-import { cloneDeep } from 'lodash-es'
-import { t } from '@/locale'
-import diyForm from '@/addon/components/diy-form/index.vue'
-import useGoodsDetailStore from '@/addon/shop/stores/goodsDetail'
-
-const props = defineProps(['goodsDetail']);
+import { ref, computed } from "vue";
+import { img, getToken } from "@/utils/common";
+import { useLogin } from "@/hooks/useLogin";
+import { cloneDeep } from "lodash-es";
+import useGoodsDetailStore from "@/addon/shop/stores/goodsDetail";
+import { addCart } from "@/addon/shop/api/cart";
+
+const props = defineProps(["goodsDetail"]);
 const goodsSkuPop = ref(false);
 const callback: any = ref(null);
-const currSpec = ref({
-    skuId: "",
-    name: []
-})
 const openType = ref("");
-const buyNum = ref(1)
-
-const maxBuy = ref(0); // 限购
-const minBuy = ref(0); // 起售
-const maxBuyShow = ref(0); // 限购
-const minBuyShow = ref(0); // 起售
+const buyNum = ref<any>(1);
 
 // 商品价格
 const goodsPrice = computed(() => {
     let price = "0.00";
-    if (goodsDetail.value.detail.type == 'newcomer_discount' && goodsDetail.value.detail.newcomer_price) {
-        price = goodsDetail.value.detail.newcomer_price
-    }else{
-        price = goodsDetail.value.show_price
-    }
+    price = goodsDetail.value.memberPrice || "0.00";
     return price;
-})
-
-// 价格类型
-const priceType = () => {
-    let type = "";
-	if(goodsDetail.value.detail.type == 'newcomer_discount' && goodsDetail.value.detail.newcomer_price){
-		type='newcomer_price'
-	}else{
-		type = goodsDetail.value.show_type
-	}
-    return type;
-}
-
-// 会员信息
-const memberStore = useMemberStore()
-const userInfo = computed(() => memberStore.info)
-
-// 购物车数量
-const cartStore = useCartStore();
-cartStore.getList();
-const cartSkuList = computed(() => {
-    if (goodsDetail.value && cartStore.cartList['goods_' + goodsDetail.value.goods_id] && cartStore.cartList['goods_' + goodsDetail.value.goods_id]['sku_' + goodsDetail.value.sku_id]) {
-        return cartStore.cartList['goods_' + goodsDetail.value.goods_id]['sku_' + goodsDetail.value.sku_id];
-    } else {
-        return {}
-    }
-})
-const cartList = computed(() => cartStore.cartList)
+});
 const open = (type = "", fn = "") => {
     openType.value = type;
     goodsSkuPop.value = true;
     callback.value = fn;
-}
+};
 
 const goodsSkuInputFn = () => {
     setTimeout(() => {
-        buyNum.value = parseInt(buyNum.value)
-        if (!buyNum.value || buyNum.value <= minBuy.value) {
-            buyNum.value = minBuy.value || 1;
+        buyNum.value = parseInt(buyNum.value);
+        if (!buyNum.value || buyNum.value <= goodsDetail.value.minOrderQuantity) {
+            buyNum.value = goodsDetail.value.minOrderQuantity || 1;
         }
-        if (buyNum.value >= maxBuy.value) {
-            buyNum.value = maxBuy.value;
+        if (buyNum.value >= goodsDetail.value.allStock) {
+            buyNum.value = goodsDetail.value.allStock;
         }
         // 起售大于库存,初始值也应该是零
-        if (minBuy.value > goodsDetail.value.detail.stock) {
+        if (goodsDetail.value.minOrderQuantity > goodsDetail.value.allStock) {
             buyNum.value = 0;
         }
-    }, 0)
-}
+    }, 0);
+};
 
 const goodsSkuBlurFn = () => {
     setTimeout(() => {
-        buyNum.value = parseInt(buyNum.value)
-        if (!buyNum.value || buyNum.value <= minBuy.value) {
-            buyNum.value = minBuy.value || 1;
+        buyNum.value = parseInt(buyNum.value);
+        if (!buyNum.value || buyNum.value <= goodsDetail.value.minOrderQuantity) {
+            buyNum.value = goodsDetail.value.minOrderQuantity || 1;
         }
-        if (buyNum.value >= maxBuy.value) {
-            buyNum.value = maxBuy.value;
+        if (buyNum.value >= goodsDetail.value.allStock) {
+            buyNum.value = goodsDetail.value.allStock;
         }
 
         // 起售大于库存,初始值也应该是零
-        if (minBuy.value > goodsDetail.value.detail.stock) {
+        if (goodsDetail.value.minOrderQuantity > goodsDetail.value.allStock) {
             buyNum.value = 0;
             uni.showToast({
-                title: '商品库存小于起购数量',
-                icon: 'none'
+                title: "商品库存小于起购数量",
+                icon: "none",
             });
         }
-    }, 0)
-}
+    }, 0);
+};
 
 const closeFn = () => {
-    goodsSkuPop.value = false
-    useGoodsDetailStore().setGoodsDetail({isOpenSkuBuy: false});
-}
+    goodsSkuPop.value = false;
+    useGoodsDetailStore().setGoodsDetail({ isOpenSkuBuy: false });
+};
 
 const goodsDetail = computed(() => {
     let data = cloneDeep(props.goodsDetail);
-    // 重组数据结构
-    if (Object.keys(data).length) {
-
-        if (!Object.keys(currSpec.value.name).length) currSpec.value.name = data.sku_spec_format.split(",");
-
-        data.goodsSpec.forEach((item: any, index: any) => {
-            let specName = item.spec_values.split(",");
-            item.values = [];
-            specName.forEach((specItem: any, specIndex: any) => {
-                item.values[specIndex] = {};
-                item.values[specIndex].name = specItem;
-                item.values[specIndex].selected = false;
-                item.values[specIndex].disabled = false;
-
-                // 选中规格
-                currSpec.value.name.forEach((currSpecItem, currSpecIndex) => {
-                    if (currSpecIndex == index && currSpecItem == specItem) {
-                        item.values[specIndex].selected = true;
-                    }
-                })
-            })
-        })
-        getSkuId();
-
-        // 当前详情内容
-        if (data.skuList && Object.keys(data.skuList).length) {
-            data.skuList.forEach((idItem: any, idIndex: any) => {
-                if (idItem.sku_id == currSpec.value.skuId) {
-                    idItem.sku_image = idItem.sku_image ? idItem.sku_image : data.goods.goods_cover
-                    data.detail = idItem;
-                }
-            })
-        }
-
-        // 限购 - 是否开启限购
-        if (data.goods.is_limit) {
-            if (data.goods.max_buy) {
-                let max_buy = 0;
-                if (data.goods.limit_type == 1) { //单次限购
-                    max_buy = data.goods.max_buy;
-                } else { // 单人限购
-                    let buyVal = data.goods.max_buy - (data.goods.has_buy || 0);
-                    max_buy = buyVal > 0 ? buyVal : 0;
-                }
-                if (max_buy > data.detail.stock) {
-                    maxBuy.value = data.detail.stock
-                } else if (max_buy <= data.detail.stock) {
-                    maxBuy.value = max_buy;
-                }
-
-                // 限购开启且最大购买变为零时,初始值也应该是零
-                if (maxBuy.value == 0) {
-                    buyNum.value = 0;
-                }
-            }
-            // 仅用于展示
-            maxBuyShow.value = data.goods.max_buy; // 限购
-        } else {
-            maxBuy.value = data.detail.stock;
-        }
-
-        // 起售
-        minBuy.value = data.goods.min_buy > 0 ? data.goods.min_buy : 1;
-        // 起售大于库存,初始值也应该是零
-        if (minBuy.value > data.detail.stock) {
-            buyNum.value = 0;
-        } else {
-            buyNum.value = minBuy.value;
-        }
-        // 仅用于展示
-        minBuyShow.value = data.goods.min_buy;
-    }
     return data;
-})
-
-const change = (data: any, index: any) => {
-    currSpec.value.name[index] = data.name;
-    getSkuId(); // 刷新当前规格信息
-}
+});
 
-const emits = defineEmits(['change'])
-const getSkuId = () => {
-    props.goodsDetail.skuList.forEach((skuItem: any, skuIndex: any) => {
-        if (skuItem.sku_spec_format == currSpec.value.name.toString()) {
-            currSpec.value.skuId = skuItem.sku_id
-            emits('change', skuItem.sku_id)
-        }
-    })
-}
+const emits = defineEmits(["change"]);
 
 const addNumChange = () => {
-    if (minBuy.value && minBuy.value > goodsDetail.value.detail.stock) {
-        uni.showToast({ title: '商品库存小于起购数量', icon: 'none' })
+    if (
+        goodsDetail.value.minOrderQuantity &&
+        goodsDetail.value.minOrderQuantity > goodsDetail.value.allStock
+    ) {
+        uni.showToast({ title: "商品库存小于起购数量", icon: "none" });
         return;
     }
     if (goodsDetail.value.goods.is_limit) {
-        let tips = `该商品单次限购${ goodsDetail.value.goods.max_buy }件`;
-        if (goodsDetail.value.goods.limit_type != 1) { //单次限购
-            tips = `该商品每人限购${ goodsDetail.value.goods.max_buy }件`;
-            if (goodsDetail.value.goods.max_buy - maxBuy.value) {
-                tips += `,已购${ goodsDetail.value.goods.max_buy - maxBuy.value }件`;
+        let tips = `该商品单次限购${goodsDetail.value.goods.max_buy}件`;
+        if (goodsDetail.value.goods.limit_type != 1) {
+            //单次限购
+            tips = `该商品每人限购${goodsDetail.value.goods.max_buy}件`;
+            if (
+                goodsDetail.value.goods.max_buy -
+                goodsDetail.value.allStockgoodsDetail.value.allStock
+            ) {
+                tips += `,已购${goodsDetail.value.goods.max_buy -
+                    goodsDetail.value.allStockgoodsDetail.value.allStock
+                    }件`;
             }
         }
-        if (buyNum.value >= maxBuy.value) {
-            uni.showToast({ title: tips, icon: 'none' })
+        if (buyNum.value >= goodsDetail.value.allStockgoodsDetail.value.allStock) {
+            uni.showToast({ title: tips, icon: "none" });
         }
     }
-}
+};
 
 const reduceNumChange = () => {
-    if (minBuy.value > 1) {
-        let tips = `该商品起购${ minBuy.value }件`;
-        if (buyNum.value <= minBuy.value) {
-            uni.showToast({ title: tips, icon: 'none' })
+    if (goodsDetail.value.minOrderQuantity > 1) {
+        let tips = `该商品起购${goodsDetail.value.minOrderQuantity}件`;
+        if (buyNum.value <= goodsDetail.value.minOrderQuantity) {
+            uni.showToast({ title: tips, icon: "none" });
         }
     }
-}
-
-//强制绑定手机号
-const bindMobileRef: any = ref(null)
-const isBindMobile = ref(uni.getStorageSync('isBindMobile'))
-
-const diyFormRef: any = ref(null)
+};
 
 //提交
 const confirm = () => {
-    if (!diyFormRef.value.verify()) return;
-
     if (buyNum.value < 1) return;
 
-    // #ifdef H5
-    // 绑定手机号
-    if (!userInfo.value && uni.getStorageSync('isBindMobile')) {
-        uni.setStorage({
-            key: 'loginBack', data: {
-                url: '/addon/shop/pages/goods/detail',
-                param: {
-                    sku_id: goodsDetail.value.sku_id,
-                    type: goodsDetail.value.type
-                }
-            }
-        })
-        bindMobileRef.value.open()
-        return false
-    }
-    // #endif
-
     // 检测是否登录
-    if (!userInfo.value) {
+    if (!getToken()) {
         useLogin().setLoginBack({
-            url: '/addon/shop/pages/goods/detail',
+            url: "/addon/shop/pages/goods/detail",
             param: {
-                sku_id: goodsDetail.value.sku_id,
-                type: goodsDetail.value.type
-            }
-        })
-        return false
-    }
-
-    // 加入购物车
-    if (openType.value == 'join_cart') {
-        let num = 0;
-        let limitNum = 0;
-        let cartId = "";
-
-        if (cartList.value['goods_' + goodsDetail.value.goods_id] && cartList.value['goods_' + goodsDetail.value.goods_id]['sku_' + goodsDetail.value.sku_id]) {
-            num = toRaw(cartList.value['goods_' + goodsDetail.value.goods_id]['sku_' + goodsDetail.value.sku_id].num);
-            cartId = toRaw(cartList.value['goods_' + goodsDetail.value.goods_id]['sku_' + goodsDetail.value.sku_id].id)
-        }
-        if (cartList.value['goods_' + goodsDetail.value.goods_id] && cartList.value['goods_' + goodsDetail.value.goods_id]) {
-            limitNum = toRaw(cartList.value['goods_' + goodsDetail.value.goods_id].totalNum);
-        }
-
-        num += Number(buyNum.value);
-        limitNum += Number(buyNum.value);
-        /************** 限购-start **************/
-        if (goodsDetail.value.goods.is_limit) {
-            let tips = `该商品单次限购${ goodsDetail.value.goods.max_buy }件`;
-            if (goodsDetail.value.goods.limit_type != 1) { //单次限购
-                tips = `该商品每人限购${ goodsDetail.value.goods.max_buy }件`;
-                if (goodsDetail.value.goods.max_buy - maxBuy.value) {
-                    tips += `,已购${ goodsDetail.value.goods.max_buy - maxBuy.value }件`;
-                }
-            }
-            if (limitNum > maxBuy.value) {
-                uni.showToast({ title: tips, icon: 'none' })
-                return false;
-            }
-        }
-        /************** 限购-end **************/
-        cartStore.increase({
-            id: cartId || '',
-            goods_id: goodsDetail.value.goods_id,
-            sku_id: goodsDetail.value.sku_id,
-            stock: goodsDetail.value.stock,
-            sale_price: goodsDetail.value.sale_price,
-            num: num
-        }, 0, () => {
-            uni.showToast({
-                title: '加入购物车成功',
-                icon: 'none'
-            });
-        });
-
-    } else if (openType.value == 'buy_now') {
-        // 立即购买
-        const data = {
-            sku_id: goodsDetail.value.sku_id,
-            num: buyNum.value
-        };
-
-        let extend_data = {}
-
-        // 新人专区进入且满足新人条件,需要传新人价类型
-        if(goodsDetail.value.detail.type == 'newcomer_discount' && goodsDetail.value.detail.newcomer_price){
-            extend_data.relate_id = ''
-            extend_data.activity_type = 'newcomer_discount'
-        }else{
-            extend_data.relate_id = goodsDetail.value.show_type == 'discount_price'?goodsDetail.value.discount_info.discount_id:''
-            extend_data.activity_type = goodsDetail.value.show_type == 'discount_price'?'discount': goodsDetail.value.detail.type
-        }
-
-        uni.setStorage({
-            key: 'orderCreateData',
-            data: {
-                sku_data: [
-                    data
-                ],
-                extend_data
+                goodsId: goodsDetail.value.id,
             },
-            success: () => {
-                redirect({ url: '/addon/shop/pages/order/payment' })
-            }
         });
+        return false;
     }
 
-    closeFn();
-}
+    // 加入购物车
+    addCart({
+        productId: goodsDetail.value.id,
+        productNum: buyNum.value
+    }).then((res) => {
+        uni.showToast({
+            title: "加入购物车成功",
+            icon: "none",
+        });
+        closeFn();
+    }).catch((res) => {});
+};
 
 //预览图片
 const imgListPreview = (item: any) => {
-    if (item === '') return false
+    if (item === "") return false;
     const urlList = [];
-    urlList.push(img(item))  //push中的参数为 :src="item.img_url" 中的图片地址
+    urlList.push(img(item)); //push中的参数为 :src="item.img_url" 中的图片地址
     uni.previewImage({
         indicator: "number",
         loop: true,
-        urls: urlList
-    })
-}
+        urls: urlList,
+    });
+};
 defineExpose({
-    open
-})
+    open,
+});
 </script>
 
 <style lang="scss" scoped>
@@ -472,7 +260,8 @@ defineExpose({
     display: flex;
     align-items: center;
 }
-::v-deep .uni-scroll-view{
-    position:inherit;
+
+::v-deep .uni-scroll-view {
+    position: inherit;
 }
 </style>

+ 1 - 1
src/addon/shop/pages/goods/cart.vue

@@ -484,7 +484,7 @@ const settlement = () => {
     }
     const ids: any = []
     cartList.value.forEach((item: any) => {
-        if (item.checked) ids.push(item.id)
+        if (item.checked) ids.push(item.shoppingCartId)
     })
 
     uni.setStorage({

+ 18 - 31
src/addon/shop/pages/order/components/address-list/address-list.vue

@@ -3,21 +3,24 @@
         <view @touchmove.prevent.stop class="popup-common">
             <view class="title">选择地址</view>
             <scroll-view scroll-y="true" class="h-[50vh]">
-                <view v-for="(item,index) in addressList" :key="item.id"
-                      class="flex items-center mx-[var(--popup-sidebar-m)] border-1 border-[#eee] border-solid rounded-[var(--rounded-mid)] px-[var(--pad-sidebar-m)] py-[var(--pad-top-m)]"
-                      :class="{'mb-[var(--top-m)]': addressList.length-1 != index, 'text-[var(--primary-color)] !border-[var(--primary-color)]': item.id == currAddressId}"
-                      @click="selectAddress(index)">
+                <view v-for="(item, index) in addressList" :key="item.id"
+                    class="flex items-center mx-[var(--popup-sidebar-m)] border-1 border-[#eee] border-solid rounded-[var(--rounded-mid)] px-[var(--pad-sidebar-m)] py-[var(--pad-top-m)]"
+                    :class="{ 'mb-[var(--top-m)]': addressList.length - 1 != index, 'text-[var(--primary-color)] !border-[var(--primary-color)]': item.id == currAddressId }"
+                    @click="selectAddress(item)">
                     <text class="nc-iconfont nc-icon-dingweiV6xx-1 text-[36rpx]"></text>
                     <view class="flex flex-col mx-[20rpx] w-[480rpx]">
                         <view class="flex items-center truncate leading-[1.5]">
-                            <text class="mr-[8rpx] text-[30rpx] truncate max-w-[300rpx]">{{ item.name }}</text>
-                            <text class="text-[30rpx]">{{ item.mobile }}</text>
+                            <text class="mr-[8rpx] text-[30rpx] truncate max-w-[300rpx]">{{ item.consignee }}</text>
+                            <text class="text-[30rpx]">{{ item.phone }}</text>
                         </view>
-                        <view class="truncate text-[26rpx] leading-[1.5] mt-[12rpx]">{{ item.full_address }}</view>
+                        <view class="truncate text-[26rpx] leading-[1.5] mt-[12rpx]">{{ item.provincialCityCountry }}{{
+                            item.address }}</view>
                     </view>
-                    <text class="nc-iconfont nc-icon-xiugaiV6xx text-[32rpx] ml-auto" @click.stop="editAddressFn(item)"></text>
+                    <text class="nc-iconfont nc-icon-xiugaiV6xx text-[32rpx] ml-auto"
+                        @click.stop="editAddressFn(item)"></text>
                 </view>
-                <view v-if="addressList.length == 0" class="text-[var(--text-color-light6)] text-[28rpx] text-center">暂无收货地址,请先创建地址</view>
+                <view v-if="addressList.length == 0" class="text-[var(--text-color-light6)] text-[28rpx] text-center">
+                    暂无收货地址,请先创建地址</view>
             </scroll-view>
 
             <view class="btn-wrap">
@@ -45,31 +48,16 @@ const addressList: any = ref([])
 
 const open = (data: any) => {
     show.value = true;
-    propData.value = data;
     currAddressId.value = data.id;
 }
 
-getAddressList({}).then(() => {
-    addressList.value = data;
+getAddressList({}).then((res: any) => {
+    addressList.value = res.rows
     loading.value = false
 })
 
-const selectAddress = (index: number) => {
-    let data = addressList.value[index];
-    if (propData.value.delivery == 'local_delivery' && !data.lat && !data.lng) {
-        // 待支付订单-同城配送,选择的地址没有经纬度的情况,会直接跳转到地图界面进行选择
-        // 参数二,表示是否直接跳转到地图界面, 1跳转到地图界面,2表示不跳
-        // editAddress(data, 1);
-        uni.showToast({
-            title: '缺少经纬度,请在地图上重新选点',
-            icon: 'none'
-        });
-    } else {
-        let obj: any = {}
-        obj.address_id = addressList.value[index].id
-        obj.delivery = propData.value.delivery
-        emits('confirm', obj)
-    }
+const selectAddress = (item: any) => {
+    emits('confirm', item)
     show.value = false;
 }
 
@@ -78,7 +66,7 @@ const editAddressFn = (data: any) => {
         // 待支付订单-同城配送,选择的地址没有经纬度的情况,会直接跳转到地图界面进行选择
         // 参数二,表示是否直接跳转到地图界面, 1跳转到地图界面,2表示不跳
         editAddress(data, 1);
-    } else{
+    } else {
         editAddress(data, 2);
     }
 }
@@ -117,5 +105,4 @@ defineExpose({
 })
 </script>
 
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 1 - 1
src/addon/shop/pages/order/components/message-open/message-open.vue

@@ -1,7 +1,7 @@
 <template>
     <u-popup :show="show" @close="show = false" mode="bottom" :round="10">
         <view @touchmove.prevent.stop class="popup-common flex flex-col">
-            <view class="title">买家留言</view>
+            <view class="title">采购事由</view>
             <view class="px-[var(--popup-sidebar-m)] py-[var(--pad-top-m)]" style="height: 180px;">
                 <u--textarea 
                     class="message-input" 

+ 205 - 634
src/addon/shop/pages/order/payment.vue

@@ -1,239 +1,137 @@
 <template>
     <view :style="themeColor()" class="payment-wrap">
-        <view class="payment-body min-h-[100vh]" v-if="orderData">
+        <view class="payment-body min-h-[100vh]">
             <!-- #ifdef MP -->
             <top-tabbar :data="topTabbarData" :scrollBool="topTabarObj.getScrollBool()" :mustFill="true" />
             <!-- #endif -->
             <view class="pt-[30rpx] sidebar-margin payment-bottom">
                 <!-- 配送方式 -->
-                <view class="mb-[var(--top-m)] rounded-[var(--rounded-big)] bg-white" v-if="orderData.basic.has_goods_types.includes('real') && delivery_type_list.length"
-                      :style="{backgroundImage: `url(${img('addon/shop/payment/head_bg.png')})`, backgroundSize: '100%', backgroundRepeat: 'no-repeat', backgroundPosition: 'bottom'}">
-                    <view class="rounded-tl-[var(--rounded-big)] rounded-tr-[var(--rounded-big)] head-tab flex items-center w-full bg-[var(--shop-payment-header-tab-color)]" v-if="delivery_type_list.length > 1">
-                        <view v-for="(item, index) in delivery_type_list" :key="index" class="head-tab-item flex-1 relative" :class="{'active': index === activeIndex}">
-                            <view class="h-[74rpx] relative z-10 text-center leading-[74rpx] text-[28rpx]" @click="switchDeliveryType(item.key, index)">{{ item.name }}</view>
-                            <image v-if="index === activeIndex && delivery_type_list.length == 3" class="tab-image absolute bottom-[-2rpx] h-[94rpx] w-[240rpx]" :src="img(`addon/shop/payment/tab_${index}.png`)" mode="aspectFit"/>
-                            <image v-else-if="index === activeIndex && delivery_type_list.length == 2" class="tab-img absolute bottom-[-2rpx]  h-[95rpx] w-[354rpx]" :src="img(`addon/shop/payment/tabstyle_${index}.png`)" mode="aspectFit"/>
-                        </view>
-                    </view>
+                <view class="mb-[var(--top-m)] rounded-[var(--rounded-big)] bg-white"
+                    :style="{ backgroundImage: `url(${img('https://v6.site.niucloud.com/addon/shop/payment/head_bg.png')})`, backgroundSize: '100%', backgroundRepeat: 'no-repeat', backgroundPosition: 'bottom' }">
                     <view class="min-h-[140rpx] flex items-center px-[30rpx]">
                         <!-- 收货地址 -->
-                        <view class="w-full" v-if="['express', 'local_delivery'].includes(createData.delivery.delivery_type)" @click="toSelectAddress">
-                            <view v-if="!$u.test.isEmpty(orderData.delivery.take_address)" class="pt-[20rpx] pb-[30rpx] flex items-center">
-                                <image class="w-[60rpx] h-[60rpx] mr-[20rpx] flex-shrink-0" :src="img('addon/shop/payment/position_01.png')" mode="aspectFit"/>
+                        <view class="w-full" @click="toSelectAddress">
+                            <view v-if="addressList.length > 0" class="pt-[20rpx] pb-[30rpx] flex items-center">
+                                <image class="w-[60rpx] h-[60rpx] mr-[20rpx] flex-shrink-0"
+                                    :src="img('https://v6.site.niucloud.com/addon/shop/payment/position_01.png')"
+                                    mode="aspectFit" />
                                 <view class="flex flex-col overflow-hidden">
-                                    <text class="text-[26rpx] text-[var(--text-color-light9)] mt-[16rpx] truncate max-w-[536rpx]">{{ orderData.delivery.take_address.full_address.substring(0, orderData.delivery.take_address.full_address.lastIndexOf(orderData.delivery.take_address.address)) }}</text>
-                                    <text class="font-500 text-[30rpx] mt-[14rpx] text-[#333] truncate max-w-[536rpx]">{{ orderData.delivery.take_address.address }}</text>
-                                    <view class="flex items-center text-[26rpx] text-[var(--text-color-light6)] mt-[16rpx]">
-                                        <text class="mr-[16rpx]">{{ orderData.delivery.take_address.name }}</text>
-                                        <text>{{ mobileHide(orderData.delivery.take_address.mobile) }}</text>
+                                    <text
+                                        class="text-[26rpx] text-[var(--text-color-light9)] mt-[16rpx] truncate max-w-[536rpx]">{{
+                                            addressData.provincialCityCountry
+                                        }}</text>
+                                    <text
+                                        class="font-500 text-[30rpx] mt-[14rpx] text-[#333] truncate max-w-[536rpx]">{{
+                                            addressData.address }}</text>
+                                    <view
+                                        class="flex items-center text-[26rpx] text-[var(--text-color-light6)] mt-[16rpx]">
+                                        <text class="mr-[16rpx]">{{ addressData.consignee }}</text>
+                                        <text>{{ addressData.phone }}</text>
                                     </view>
                                 </view>
-                                <text class="ml-auto nc-iconfont nc-icon-youV6xx text-[26rpx] text-[var(--text-color-light9)]"></text>
+                                <text
+                                    class="ml-auto nc-iconfont nc-icon-youV6xx text-[26rpx] text-[var(--text-color-light9)]"></text>
                             </view>
                             <view v-else class="flex items-center">
-                                <image class="w-[26rpx] h-[30rpx] mr-[10rpx]" :src="img('addon/shop/payment/position_02.png')" mode="aspectFit"/>
+                                <image class="w-[26rpx] h-[30rpx] mr-[10rpx]"
+                                    :src="img('https://v6.site.niucloud.com/addon/shop/payment/position_02.png')"
+                                    mode="aspectFit" />
                                 <text class="text-[28rpx]">添加收货地址</text>
-                                <text class="nc-iconfont nc-icon-youV6xx text-[26rpx] text-[var(--text-color-light9)] ml-auto"></text>
-                            </view>
-                        </view>
-
-                        <!-- 自提点 -->
-                        <view class="flex items-center w-full" v-if="createData.delivery.delivery_type == 'store'" @click="openSelectStore()">
-                            <view v-if="!$u.test.isEmpty(orderData.delivery.take_store)" class="pt-[40rpx] pb-[30rpx] w-full flex items-center">
-                                <view class="flex flex-col">
-                                    <view class="text-[30rpx] font-500 text-[#303133] mb-[20rpx]">{{ orderData.delivery.take_store.store_name }}</view>
-                                    <view class="text-[24rpx] text-[var(--text-color-light6)] mb-[20rpx] leading-[1.4] flex">
-                                        <text class="flex-shrink-0">门店地址:</text>
-                                        <text class="max-w-[490rpx]">{{ orderData.delivery.take_store.full_address }}</text>
-                                    </view>
-                                    <view class="text-[24rpx] text-[var(--text-color-light6)] mb-[20rpx]">
-                                        <text>联系电话:</text>
-                                        <text>{{ orderData.delivery.take_store.store_mobile }}</text>
-                                    </view>
-                                    <view class="text-[24rpx] text-[var(--text-color-light6)]">
-                                        <text>营业时间:</text>
-                                        <text>{{ orderData.delivery.take_store.trade_time }}</text>
-                                    </view>
-                                </view>
-                                <text class="ml-auto nc-iconfont nc-icon-youV6xx text-[26rpx] text-[var(--text-color-light9)]"></text>
-                            </view>
-                            <view v-else class="flex items-center w-full">
-                                <image class="w-[26rpx] h-[30rpx] mr-[10rpx]" :src="img('addon/shop/payment/position_02.png')" mode="aspectFit"/>
-                                <text class="text-[28rpx]">请选择自提点</text>
-                                <text class="ml-auto nc-iconfont nc-icon-youV6xx text-[26rpx] text-[var(--text-color-light9)]"></text>
-                            </view>
-                        </view>
-                    </view>
-                    <view v-if="createData.delivery.delivery_type == 'store'">
-                        <!-- 姓名 -->
-                        <view class="px-[20rpx] py-[14rpx]">
-                            <view class="flex justify-between items-center">
-                                <view class="text-color text-[26rpx]" @click="handleTime">姓名</view>
-                                <input class="text-right" maxlength="20" placeholder-style="color:#B1B3B5;font-size:26rpx" placeholder="请输入" v-model="createData.delivery.taker_name" />
-                            </view>
-                        </view>
-                        <!-- 预留手机 -->
-                        <view class="px-[20rpx] py-[14rpx]">
-                            <view class="flex justify-between items-center">
-                                <view class="text-color text-[26rpx]">预留手机</view>
-                                <input class="text-right" maxlength="11" placeholder-style="color:#B1B3B5;font-size:26rpx" placeholder="请输入" v-model="createData.delivery.taker_mobile" />
-                            </view>
-                        </view>
-                        <!-- 提货时间 -->
-                        <view class="flex justify-between items-center px-[20rpx] pt-[14rpx] pb-[24rpx]">
-                            <view class="text-color text-[26rpx]">提货时间</view>
-                            <view class="flex" @click="handleTime">
-                                <view class="text-[26rpx] ml-2 text-right" :class="{'text-[#63676D]': !createData.delivery.buyer_ask_delivery_time }">{{ createData.delivery.buyer_ask_delivery_time ? showGetDate : '选择提货时间' }}</view>
-                                <text class="text-[26rpx] text-[var(--text-color-light6)] nc-iconfont nc-icon-youV6xx"></text>
+                                <text
+                                    class="nc-iconfont nc-icon-youV6xx text-[26rpx] text-[var(--text-color-light9)] ml-auto"></text>
                             </view>
                         </view>
                     </view>
-					<view v-if="createData.delivery.delivery_type == 'local_delivery' && localConfig.time_is_open" >
-						<view class="flex justify-between items-center  px-[20rpx] pt-[14rpx] pb-[24rpx]"
-                        @click="handleTime">
-						    <view class="text-color text-[26rpx]">{{createData.delivery.local_delivery_type =='subscribe' ?'预约配送':''}}</view>
-						    <view class="flex items-center">
-						        <view v-if="createData.delivery.local_delivery_type =='subscribe'" class="text-[26rpx] ml-2 text-right" :class="{'text-[#63676D]': !createData.delivery.buyer_ask_delivery_time }">{{ createData.delivery.buyer_ask_delivery_time ? showGetDate : '选择时间' }}</view>
-								 <view v-else class="text-[26rpx] ml-2 text-right" >{{isDelivery?'立即配送':'当前时间不支持配送'}}</view>
-						        <text class="text-[26rpx] text-[var(--text-color-light6)] nc-iconfont nc-icon-youV6xx"></text>
-						    </view>
-						</view>
-					</view>
-                </view>
-                <view v-if="orderData.basic.has_goods_types.includes('real') && !delivery_type_list.length" class="mb-[var(--top-m)] card-template h-[100rpx] flex items-center">
-                    <p class="text-[28rpx] text-[var(--primary-color)]">商家尚未配置配送方式</p>
                 </view>
 
                 <view class="mb-[var(--top-m)] card-template p-[0] pb-[var(--pad-top-m)]">
                     <view class="pt-[var(--pad-top-m)] pb-[14rpx]">
-                        <template v-for="(item, index) in orderData.goods" :key="index">
-                            <view class="px-[var(--pad-sidebar-m)]" v-if="item.is_impulse_buy != 1" :class="{'mb-[20rpx]': (index+1) != orderData.goods.length}">
+                        <template v-for="(item, index) in cartList" :key="index">
+                            <view class="px-[var(--pad-sidebar-m)]"
+                                :class="{ 'mb-[20rpx]': (Number(index) + 1) != cartList.length }">
                                 <view class="flex">
-                                    <u--image radius="var(--goods-rounded-big)" width="180rpx" height="180rpx" :src="img(item.sku_image)" model="aspectFill">
+                                    <u--image radius="var(--goods-rounded-big)" width="180rpx" height="180rpx"
+                                        :src="img(item.productImage)" model="aspectFill">
                                         <template #error>
-                                            <image class="w-[180rpx] h-[180rpx] rounded-[var(--goods-rounded-big)] overflow-hidden" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill"/>
+                                            <image
+                                                class="w-[180rpx] h-[180rpx] rounded-[var(--goods-rounded-big)] overflow-hidden"
+                                                :src="img('static/resource/images/diy/shop_default.jpg')"
+                                                mode="aspectFill" />
                                         </template>
                                     </u--image>
                                     <view class="flex flex-1 w-0 flex-col justify-between ml-[20rpx] py-[6rpx]">
                                         <view class="line-normal">
-                                            <view class="truncate text-[#303133] text-[28rpx] leading-[32rpx]">{{ item.goods.goods_name }}</view>
-                                            <view class="mt-[14rpx] flex" v-if="item.sku_name">
-                                                <text class="truncate text-[24rpx] text-[var(--text-color-light9)] leading-[28rpx]">{{ item.sku_name }}</text>
-                                            </view>
-                                        </view>
-                                        <view v-if="item.manjian_info && Object.keys(item.manjian_info).length" class="flex items-center mt-[10rpx] mb-[auto]" @click.stop="manjianOpenFn(item.manjian_info)">
-                                            <view class="bg-[var(--primary-color-light)] text-[var(--primary-color)] rounded-[6rpx] text-[20rpx] flex items-center justify-center w-[88rpx] h-[36rpx] mr-[6rpx]">满减送</view>
-                                            <text class="text-[22rpx] text-[#999]">{{ item.manjian_info.manjian_name }}</text>
-                                        </view>
-                                        <view class="mb-auto" :class="{'mt-[6rpx]': !item.sku_name}" v-if="item.not_support_delivery">
-                                            <u-alert type="error" description="该商品不支持当前所选配送方式" class="leading-[30rpx] !inline-block" fontSize="11"></u-alert>
+                                            <view class="truncate text-[#303133] text-[28rpx] leading-[32rpx]">{{
+                                                item.itemName }}</view>
+
                                         </view>
+
+
                                         <view class="flex justify-between items-baseline">
-                                            <view class="text-[var(--price-text-color)] flex items-baseline  price-font">
+                                            <view
+                                                class="text-[var(--price-text-color)] flex items-baseline  price-font">
                                                 <text class="text-[24rpx] font-500 mr-[4rpx]">¥</text>
-                                                <text class="text-[40rpx] font-500">{{ parseFloat(item.price).toFixed(2).split('.')[0] }}</text>
-                                                <text class="text-[24rpx] font-500">.{{ parseFloat(item.price).toFixed(2).split('.')[1] }}</text>
+                                                <text class="text-[40rpx] font-500">{{
+                                                    parseFloat(item.memberPrice).toFixed(2).split('.')[0] }}</text>
+                                                <text class="text-[24rpx] font-500">.{{
+                                                    parseFloat(item.memberPrice).toFixed(2).split('.')[1] }}</text>
                                             </view>
                                             <view class="font-400 text-[28rpx] text-[#303133]">
                                                 <text>x</text>
-                                                <text>{{ item.num }}</text>
+                                                <text>{{ item.productNum }}</text>
                                             </view>
                                         </view>
                                     </view>
                                 </view>
-                                <view class="flex items-center mt-[8rpx]" :class="{'pb-[40rpx]': (index + 1) != Object.keys(orderData.goods_data).length}" v-if="item.is_newcomer && item.newcomer_price != item.price && item.num>1">
-                                    <image class="h-[24rpx] w-[56rpx]" :src="img('addon/shop/newcomer.png')" mode="heightFix"/>
-                                    <view class="text-[24rpx] text-[#FFB000] leading-[34rpx] ml-[8rpx]">第1{{ item.goods.unit }},¥{{ parseFloat(item.newcomer_price).toFixed(2) }}/{{ item.goods.unit }};第{{ item.num > 2 ? '2~' + item.num : '2' }}{{ item.goods.unit }},¥{{ parseFloat(item.price).toFixed(2) }}/{{ item.goods.unit }}</view>
-                                </view>
-                                <view class="card-template !p-[0]" v-if="item.goods.form_id">
-                                    <diy-form ref="diyFormGoodsRef" :form_id="item.goods.form_id" :relate_id="item.sku_id" :storage_name="'diyFormStorageByGoodsDetail_' + item.sku_id" form_border="none"/>
-                                </view>
                             </view>
                         </template>
-                        <!-- 赠品 -->
-                        <view v-if="orderData.gift_goods && Object.keys(orderData.gift_goods).length" class="pt-[20rpx] mb-[10rpx] bg-[#f9f9f9] mt-[24rpx] mx-[var(--pad-sidebar-m)] rounded-[30rpx]">
-                            <view v-for="(item, key, index) in orderData.gift_goods" :key="index" class="flex px-[var(--pad-sidebar-m)] pb-[20rpx]">
-                                <u--image radius="var(--goods-rounded-big)" width="120rpx" height="120rpx" :src="img(item.sku_image)" model="aspectFill">
-                                    <template #error>
-                                        <image class="w-[120rpx] h-[120rpx] rounded-[var(--goods-rounded-big)] overflow-hidden" :src="img('static/resource/images/diy/shop_default.jpg')" mode="aspectFill"/>
-                                    </template>
-                                </u--image>
-                                <view class="ml-[16rpx] py-[8rpx] flex flex-1 flex-col justify-between">
-                                    <view class="flex items-center">
-                                        <view class="bg-[var(--primary-color-light)] whitespace-nowrap text-[var(--primary-color)] rounded-[6rpx] text-[22rpx] flex items-center justify-center w-[64rpx] h-[34rpx] mr-[6rpx]">赠品</view>
-                                        <view class="text-[26rpx] max-w-[400rpx] truncate leading-[40rpx] text-[#333]">{{ item.goods.goods_name }}</view>
-                                    </view>
-                                    <view class="flex items-center">
-                                        <view v-if="item.sku_name" class="text-[22rpx] text-[var(--text-color-light9)] truncate max-w-[400rpx] leading-[28rpx]">{{ item.sku_name }}</view>
-                                        <view class="ml-[auto] font-400 text-[26rpx] text-[#303133]">
-                                            <text>x</text>
-                                            <text>{{ item.num }}</text>
-                                        </view>
-                                    </view>
-                                </view>
-                            </view>
-                        </view>
+
                     </view>
                     <!-- 买家留言 -->
-                    <view class="bg-white flex items-center leading-[30rpx] px-[var(--pad-sidebar-m)] mt-[30rpx]" @click="toLeaveMessage">
-                        <view class="text-[28rpx] w-[150rpx] text-[#303133]">买家留言</view>
+                    <view class="bg-white flex items-center leading-[30rpx] px-[var(--pad-sidebar-m)] mt-[30rpx]"
+                        @click="toLeaveMessage">
+                        <view class="text-[28rpx] w-[150rpx] text-[#303133]">采购事由</view>
                         <view class="flex-1 text-[#303133] flex items-center justify-center">
                             <view class="flex-1 w-0 text-right truncate">
-                                <text class="text-[28rpx] text-[var(--text-color-light9)]">{{createData.member_remark?createData.member_remark:'请输入留言信息给卖家'}}</text>
+                                <text class="text-[28rpx]"
+                                    :style="{ 'color': form.purchaseReason ? '#303133' : '#999999' }">{{
+                                        form.purchaseReason ?
+                                            form.purchaseReason : '请输入采购事由' }}</text>
                             </view>
-                           <text class="ml-auto text-[28rpx] nc-iconfont nc-icon-youV6xx  text-[var(--text-color-light9)]"></text>
-                      </view>
+                            <text
+                                class="ml-auto text-[28rpx] nc-iconfont nc-icon-youV6xx  text-[var(--text-color-light9)]"></text>
+                        </view>
                     </view>
                     <!-- 发票 -->
-                    <view v-if="invoiceRef && invoiceRef.invoiceOpen" class="flex items-center text-[#303133] leading-[30rpx] mt-[30rpx] px-[var(--pad-sidebar-m)]" @click="invoiceRef.open()">
-                        <view class="text-[28rpx] w-[150rpx] text-[#303133]">发票信息</view>
+                    <view class="flex items-center text-[#303133] leading-[30rpx] mt-[30rpx] px-[var(--pad-sidebar-m)]">
+                        <view class="text-[28rpx] w-[150rpx] text-[#303133]">
+                            费用类型</view>
                         <view class="flex-1 w-0 text-right truncate">
-                            <text class="text-[28rpx] text-[#333]">{{ createData.invoice.header_name || '不需要发票' }}</text>
+                            <text class="text-[28rpx]">日常物资采购</text>
                         </view>
-                        <text class="nc-iconfont nc-icon-youV6xx text-[26rpx] text-[var(--text-color-light9)]"></text>
                     </view>
 
                 </view>
 
-                <view class="mb-[var(--top-m)] card-template" v-if="couponRef && couponList.length">
-                    <!-- 优惠券 -->
-                    <view class="flex items-center h-[40rpx] leading-[40rpx]"
-                          @click="couponRef.open(createData.discount.coupon_id)" v-if="couponList.length">
-                        <view class="text-[28rpx] w-[150rpx] text-[#303133] flex-shrink-0">优惠券</view>
-                        <view class="flex-1 flex justify-end truncate">
-                            <text v-if="orderData.discount && orderData.discount.coupon" class="text-[var(--primary-color)] text-[28rpx] truncate ">{{ orderData.discount.coupon.title }}</text>
-                            <text class="text-[28rpx] text-gray-subtitle" v-else>请选择优惠券</text>
+                <view class="mb-[var(--top-m)] card-template p-[0] pb-[var(--pad-top-m)]">
+                    <view
+                        class="flex items-center text-[#303133] leading-[30rpx] mt-[10rpx] px-[var(--pad-sidebar-m)] pt-[30rpx]">
+                        <view class="text-[28rpx] w-[150rpx] text-[#303133]">
+                            订单备注</view>
+                        <view class="flex-1 w-0 text-right truncate">
+                            <input class="layout-two-content no-flex" placeholder="请输入订单备注"
+                                placeholderClass="layout-two-input-placeholder" v-model="form.remark" />
                         </view>
-                        <text class="nc-iconfont nc-icon-youV6xx -mb-[2rpx] text-[26rpx] text-[var(--text-color-light9)]"></text>
-                    </view>
-                </view>
-
-                <view class="card-template py-[10rpx] mb-[var(--top-m)]" v-if="orderData.form_id">
-                    <diy-form ref="diyFormRef" :form_id="orderData.form_id" :storage_name="'diyFormStorageByOrderPayment'"/>
-                </view>
-
-                <!-- 顺手买 -->
-                 <template v-if="systemStore.siteAddons.includes('shop_impulse_buy') && (!createData.extend_data || createData.extend_data && !createData.extend_data.activity_type || createData.extend_data.activity_type == 'discount')">
-                    <ns-impulse-buy :key="activeIndex" ref="impulseBuyRef" :data="orderData.goods" :order-key="orderData.order_key" :delivery-type="createData.delivery.delivery_type" :calculate-loading="calculateLoading" @confirm="impulseBuyConfirm"/>
-                 </template>
-
-                <view class="card-template">
-                    <view class="title">价格明细</view>
-                    <view class="card-template-item">
-                        <view class="text-[26rpx] w-[150rpx] leading-[30rpx] text-[#303133]">商品金额</view>
-                        <view class="flex-1 w-0 text-right  price-font text-[#333] text-[32rpx]">¥{{ parseFloat(orderData.basic.goods_money).toFixed(2) }}</view>
-                    </view>
-                    <view class="card-template-item" v-if="parseFloat(orderData.basic.delivery_money)">
-                        <view class="text-[26rpx] w-[150rpx] leading-[30rpx] text-[#303133]">配送费用</view>
-                        <view class="flex-1 w-0 text-right price-font text-[#333] text-[32rpx]">¥{{ parseFloat(orderData.basic.delivery_money).toFixed(2) }}</view>
-                    </view>
-                    <view class="card-template-item" v-if="parseFloat(orderData.basic.coupon_money)">
-                        <view class="text-[26rpx] w-[170rpx] leading-[30rpx] text-[#303133]">优惠券优惠</view>
-                        <view class="flex-1 w-0 text-right text-[var(--price-text-color)] text-[32rpx] price-font leading-[1]">-¥{{ parseFloat(orderData.basic.coupon_money).toFixed(2) }}</view>
                     </view>
-                    <view class="card-template-item" v-if="parseFloat(orderData.basic.manjian_discount_money)">
-                        <view class="text-[26rpx] w-[170rpx] leading-[30rpx] text-[#303133]">满减优惠</view>
-                        <view class="flex-1 w-0 text-right text-[var(--price-text-color)] text-[32rpx] price-font leading-[1]">-¥{{ parseFloat(orderData.basic.manjian_discount_money).toFixed(2) }}</view>
+                    <view class="flex items-center text-[#303133] leading-[30rpx] mt-[30rpx] px-[var(--pad-sidebar-m)]"
+                        @click="calendarShow = true">
+                        <view class="text-[28rpx] w-[150rpx] text-[#303133]">
+                            配送日期</view>
+                        <view class="flex-1 w-0 text-right truncate">
+                            <text class="text-[28rpx]"
+                                :style="{ 'color': form.deliveryDate ? '#303133' : '#999999' }">{{
+                                    form.deliveryDate ? form.deliveryDate : '请选择配送日期' }}</text>
+                        </view>
                     </view>
                 </view>
             </view>
@@ -242,441 +140,173 @@
                     <view class="flex items-baseline">
                         <text class="text-[26rpx] text-[#333] leading-[32rpx]">合计:</text>
                         <view class="inline-block">
-                            <text class="text-[26rpx] font-500 text-[var(--price-text-color)] price-font leading-[30rpx]">¥</text>
-                            <text class="text-[44rpx]  font-500  text-[var(--price-text-color)] price-font leading-[46rpx]">{{ parseFloat(orderData.basic.order_money).toFixed(2).split('.')[0] }}</text>
-                            <text class="text-[26rpx]  font-500  text-[var(--price-text-color)] price-font leading-[46rpx]">.{{ parseFloat(orderData.basic.order_money).toFixed(2).split('.')[1] }}</text>
+                            <text
+                                class="text-[26rpx] font-500 text-[var(--price-text-color)] price-font leading-[30rpx]">¥</text>
+                            <text
+                                class="text-[44rpx]  font-500  text-[var(--price-text-color)] price-font leading-[46rpx]">{{
+                                    parseFloat(allMoney).toFixed(2).split('.')[0] }}</text>
+                            <text
+                                class="text-[26rpx]  font-500  text-[var(--price-text-color)] price-font leading-[46rpx]">.{{
+                                    parseFloat(allMoney).toFixed(2).split('.')[1] }}</text>
                         </view>
                     </view>
-                    <button class="w-[196rpx]  h-[70rpx] font-500 text-[26rpx] leading-[70rpx] !text-[#fff] m-0  rounded-full primary-btn-bg remove-border" hover-class="none" :disabled="calculateLoading" :class="{'opacity-80': calculateLoading}" @click="create">提交订单</button>
+                    <button
+                        class="w-[196rpx]  h-[70rpx] font-500 text-[26rpx] leading-[70rpx] !text-[#fff] m-0  rounded-full primary-btn-bg remove-border"
+                        hover-class="none" @click="create">提交订单</button>
                 </view>
             </u-tabbar>
-
-            <!-- 选择优惠券 -->
-            <select-coupon :order-key="createData.order_key" ref="couponRef" @confirm="confirmSelectCoupon"/>
         </view>
-
-        <!-- 选择自提点 -->
-        <select-store ref="storeRef" @confirm="confirmSelectStore" v-show="orderData && orderData.basic && orderData.basic.has_goods_types && orderData.basic.has_goods_types.includes('real')"/>
-        <!-- 发票 -->
-        <invoice ref="invoiceRef" @confirm="confirmInvoice"/>
         <!-- 地址 -->
-        <address-list ref="addressRef" @confirm="confirmAddress" back="/addon/shop/pages/order/payment" />
-        <!-- 满减 -->
-        <ns-goods-manjian ref="manjianShowRef" />
-        <pay ref="payRef" @close="payClose"/>
-
-        <ns-select-time ref="selectTime" :rules="service_time" v-if="Object.keys(service_time).length" :isQuantum="true" :isOpen="localConfig.time_is_open" @change="getTime" @getStamp="getStamp" @getDate="getDate"></ns-select-time>
-        <message-open ref="messageOpenRef" @submit="confirmMessage" :default-message="createData.member_remark" />
-
+        <com-Address-list ref="addressRef" @confirm="confirmAddress" back="/addon/shop/pages/order/payment" />
+        <message-open ref="messageOpenRef" @submit="confirmMessage" :default-message="form.purchaseReason" />
+        <up-calendar :minDate="minDate" :show="calendarShow" mode="single" color="var(--primary-color)"
+            @confirm="calendarConfirm" @close="calendarShow = false"></up-calendar>
+        <pay ref="payRef" @close="payClose" />
     </view>
 </template>
-
 <script setup lang="ts">
 import { ref, computed, watch, nextTick } from 'vue'
-import { orderCreateCalculate, orderCreate ,getLocal} from '@/addon/shop/api/order'
+import { onLoad, onShow } from '@dcloudio/uni-app'
+import { topTabar } from '@/utils/topTabbar'
 import { redirect, img, mobileHide } from '@/utils/common'
-import selectCoupon from './components/select-coupon/select-coupon'
-import selectStore from './components/select-store/select-store'
-import addressList from './components/address-list/address-list'
+import comAddressList from './components/address-list/address-list.vue'
+import { getAddressList } from '@/app/api/member'
+import { getCartGoodsList } from '@/addon/shop/api/cart'
 import messageOpen from './components/message-open/message-open.vue'
-
-import invoice from './components/invoice/invoice'
-import nsGoodsManjian from '@/addon/shop/components/ns-goods-manjian/ns-goods-manjian.vue';
-import { useSubscribeMessage } from '@/hooks/useSubscribeMessage'
-import useSystemStore from '@/stores/system'
-import nsImpulseBuy from '@/addon/shop/components/ns-impulse-buy/ns-impulse-buy';
-import nsSelectTime from '@/addon/shop/components/ns-select-time'
-import { onShow } from '@dcloudio/uni-app'
-import { cloneDeep } from 'lodash-es'
-import { topTabar } from '@/utils/topTabbar'
-import diyForm from '@/addon/components/diy-form/index.vue'
-import useMemberStore from '@/stores/member'
-
-const memberStore = useMemberStore()
-const info = computed(() => memberStore.info)
+import diyForm from '@/addon/components/diy-form/index.vue';
+import { orderCreateCalculate, orderCreate, getLocal } from '@/addon/shop/api/order'
 const topTabarObj = topTabar()
 let topTabbarData = topTabarObj.setTopTabbarParam({ title: '待付款订单' })
-const systemStore = useSystemStore()
-const impulseBuyRef = ref()
-const createData: any = ref({
-    order_key: '',
-    member_remark: '',
-    discount: {},
-    invoice: {},
-    delivery: {
-        delivery_type: '',
-        buyer_ask_delivery_time: '',
-        taker_name: '',
-        taker_mobile: '',
-        local_delivery_type:'now',
-    },
-    extend_data: {}, // 扩展数据,目前礼品卡用到
-    form_data: {} // 万能表单数据(商品+待付款订单)
-})
-const manjianShowRef: any = ref(null); //满减送
-const orderData: any = ref(null)
-const couponRef = ref()
-const storeRef = ref()
-const payRef = ref()
-const addressRef = ref()
-const invoiceRef = ref()
+const calendarShow: any = ref(false)
+const payRef: any = ref(null)
+const orderId: any = ref(null)
+const addressList: any = ref([])
+const addressData: any = ref({})
+const addressRef = ref<any>(null)
+const cartList = ref<any>([])
+const minDate = ref<any>('')
+const allMoney = ref<any>(0);
 const createLoading = ref(false)
-const activeIndex = ref(0)//配送方式激活
-const delivery_type_list = ref([])
-const calculateLoading = ref(false)
-uni.getStorageSync('orderCreateData') && Object.assign(createData.value, uni.getStorageSync('orderCreateData'))
-
-const diyFormRef: any = ref(null)
-const diyFormGoodsRef: any = ref(null)
-const storeClickNum = ref(0) // 记录门店自提点击次数
-const service_time = ref({}) //获取配置时间
-const selectTime = ref(null)
-const handleTime = () => {
-    if (selectTime.value) {
-        selectTime.value.show = true;
-    } else if(createData.value.delivery.delivery_type=='store'){
-        uni.showToast({ title: '请选择自提点', icon: 'none' })
-    }
-};
-const isDelivery = ref(false)
-// 时间(月日时间段)
-const getTime = (e) => {
-	if (createData.value.delivery.delivery_type == 'local_delivery') {
-		isDelivery.value = true
-		if(e.includes('立即配送') ){
-			createData.value.delivery.buyer_ask_delivery_time = '';
-			createData.value.delivery.local_delivery_type = 'now';
-		}else {
-			createData.value.delivery.buyer_ask_delivery_time = e;
-			createData.value.delivery.local_delivery_type = 'subscribe';
-		}
-	}else {
-		createData.value.delivery.buyer_ask_delivery_time = e;
-	}
-}
-// 时间(年-月-日)
-const getStamp = (e) => {
-    // createData.value.reserve_service_time_stamp = new Date(e).getTime() / 1000
-}
-const showGetDate = ref(null)
-const getDate = (e) => {
-	if (createData.value.delivery.delivery_type == 'local_delivery') {
-		if (e.includes('立即配送')) {
-			showGetDate.value = null
-		} else {
-			showGetDate.value = e
-		}
-	}else {
-		showGetDate.value = e
-	}
-}
-const localConfig = ref({})
-onShow(async () => {
-	const res = await getLocal();
-	localConfig.value = res.data;
-    // 解决在创建订单时,使用优惠券并在切换页面后,提示优惠券已失效的问题
-    if(!payRef.value?.payInfo){
-        calculate(); // 确保在 localConfig 赋值后执行
-    }
-})
 
-const openSelectStore = () => {
-    if (storeRef.value) {
-        if (!createData.value.delivery.take_store_id) {
-            storeRef.value.getData((data: any) => {
-                if (data.length) {
-                    createData.value.delivery.take_store_id = ((data[0] && data[0].store_id) ? data[0].store_id : 0)
-                }
-            });
-        }
-    }
-    storeRef.value.open()
-}
+const form = ref<any>({
+    shippingAddressId: '',
+    deliveryDate: '',
+    expenseType: '0',
+    purchaseReason: '',
+    remark: '',
+    shippingFee: 0,
+    // 下单方式  1为购物车下单  2为直接下单
+    placeOrderType: 1,
+    productShoppingCartId: []
+});
+
+onShow(() => {
+    getCartGoodsListFn()
+    getAddressListFn()
+    getMinDate();
+})
 
-// 选择地址之后跳转回来
-const selectAddress = uni.getStorageSync('selectAddressCallback')
-if (selectAddress) {
-    createData.value.order_key = ''
-    createData.value.delivery.delivery_type = selectAddress.delivery
-    createData.value.delivery.take_address_id = selectAddress.address_id
-    uni.removeStorage({ key: 'selectAddressCallback' })
+const getMinDate = () => {
+    const now = new Date();
+    // 1. 获取年份
+    const year = now.getFullYear();
+    // 2. 获取月份 (注意:需要 +1,且建议补零)
+    const month = String(now.getMonth() + 1).padStart(2, '0');
+    // 3. 获取日期 (建议补零)
+    const day = String(now.getDate()).padStart(2, '0');
+    // 4. 拼接结果
+    const todayStr = `${year}-${month}-${day}`;
+    minDate.value = todayStr;
 }
 
-// 切换配送方式
-const switchDeliveryType = async (type: string, index: number) => {
-    await nextTick() // 等待 DOM 更新
-    if (!storeRef.value) {
-        // console.warn("storeRef is still undefined!");
-        return;
-    }
-    // 切换配送方式时,清空顺买商品,预约自提时间
-    if (createData.value.delivery.delivery_type != type && createData.value) {
-        delete createData.value.impulse_buy_goods
-        createData.value.delivery.buyer_ask_delivery_time = ''
-        service_time.value = {}  //清空配置时间
-    }
-
-    // 第一次进入时,加载门店自提并选中
-    if (type == 'store' && storeClickNum.value == 0) {
-        storeClickNum.value++;
-        storeRef.value.getData((data: any) => {
-            if (data.length) {
-                createData.value.delivery.take_store_id = data[0]?.store_id ?? 0
-                calculate()
+const getCartGoodsListFn = () => {
+    allMoney.value = 0;
+    const cart_ids = uni.getStorageSync('orderCreateData').cart_ids
+    getCartGoodsList({}).then((res: any) => {
+        const data = res.rows
+        cartList.value = []
+        data.forEach((item: any) => {
+            if (cart_ids.includes(item.shoppingCartId)) {
+                form.value.productShoppingCartId.push(item.shoppingCartId)
+                cartList.value.push(item)
+                allMoney.value = allMoney.value + Number(item.memberPrice * item.productNum);
             }
-        });
-    }
-    if (createData.value.delivery.delivery_type != type) {
-        activeIndex.value = index
-        createData.value.order_key = ''
-        createData.value.delivery.delivery_type = type
-        createData.value.delivery.take_address_id = 0
-        calculate()
-    }
+        })
+    }).catch((err) => { })
 }
 
-// 满减
-const manjianOpenFn = (data: any) => {
-    let obj = {};
-    obj.condition_type = cloneDeep(data).condition_type;
-    obj.rule_json = [cloneDeep(data).rule];
-    obj.name = cloneDeep(data).manjian_name;
-    manjianShowRef.value.open(obj);
+const getAddressListFn = () => {
+    getAddressList({}).then((res: any) => {
+        addressList.value = res.rows
+        if (res.rows.length > 0) {
+            form.value.shippingAddressId = res.rows[0].id;
+            addressData.value = res.rows[0]
+            addressList.value.forEach((item: any) => {
+                if (item.defaultAddress == 0) {
+                    form.value.shippingAddressId = item.id;
+                    addressData.value = item
+                }
+            });
+        }
+    }).catch(() => {
+    })
 }
 
-const formatTimeWeek = (timeType: number, weekStr: string): string[] => {
-    if (timeType === 0) {
-        // 每天都可以预约
-        return ['1', '2', '3', '4', '5', '6', '0'];
-    }
-    // 自定义时间周
-    return weekStr ? weekStr.split(',').map(item => item.trim()) : [];
-};
-
-
 /**
- * 订单计算
+ * 选择地址
  */
-const calculate = (params: any = {}) => {
-    const calculateData = Object.assign({}, createData.value, params)
-    calculateLoading.value = true
-    orderCreateCalculate(calculateData).then(({ data }) => {
-        orderData.value = cloneDeep(data);
-        calculateLoading.value = false
-
-        orderData.value.goods = []; //购买商品
-        if (orderData.value.goods_data && Object.values(orderData.value.goods_data).length) {
-            Object.values(orderData.value.goods_data).forEach((item: any, index) => {
-                orderData.value.goods.push(item);
-            })
-        }
-        if (createData.value.delivery.delivery_type == 'store') {
-            createData.value.delivery.taker_name = info.value.nickname
-            createData.value.delivery.taker_mobile = info.value.mobile
-        } else if(orderData.value.delivery && orderData.value.delivery.take_address) {
-            createData.value.delivery.taker_name = orderData.value.delivery.take_address.name
-            createData.value.delivery.taker_mobile = orderData.value.delivery.take_address.mobile
-        }
-        if(orderData.value.delivery.delivery_type == 'local_delivery'){
-            service_time.value = {
-                time_interval: localConfig.value.time_interval,
-                time_week: formatTimeWeek(localConfig.value.time_type, localConfig.value.time_week),
-                trade_time_json: localConfig.value.delivery_time,
-                most_day: localConfig.value.most_day,
-                advance_day: localConfig.value.advance_day,
-				type:"subscribe"
-            }
-        }
-
-        createData.value.order_key = data.order_key
-        if (orderData.value.delivery.delivery_type_list) {
-            delivery_type_list.value = cloneDeep(Object.values(orderData.value.delivery.delivery_type_list))
-        }
-        if (orderData.value.discount && orderData.value.discount.manjian) {
-            orderData.value.manjian = orderData.value.discount.manjian
-        }
-        if (orderData.value.delivery.take_store) {
-            service_time.value = {
-                time_interval: orderData.value.delivery.take_store.time_interval,
-                time_week: orderData.value.delivery.take_store.time_week,
-                trade_time_json: orderData.value.delivery.take_store.trade_time_json
-            };
-        }
+const toSelectAddress = () => {
+    let data: any = {};
+    data.id = form.value.shippingAddressId;
+    addressRef.value.open(data);
+}
+const confirmAddress = (data: any) => {
+    addressData.value = data
+    form.value.shippingAddressId = data.id;
+}
 
-        if (selectAddress) activeIndex.value = delivery_type_list.value.findIndex(el => el.key === orderData.value.delivery.delivery_type)
-        !createData.value.delivery.delivery_type && data.delivery.delivery_type && (createData.value.delivery.delivery_type = data.delivery.delivery_type)
-
-        // 用于自提点是第一种配送方式时,第一次进来加载门店自提并选中, 是对于onshow的补充
-        nextTick(() => {
-            setTimeout(() => {
-                if (delivery_type_list.value && Object.keys(delivery_type_list.value).length && delivery_type_list.value[0].key == 'store' && storeRef.value) {
-                    storeRef.value.getData((data: any) => {
-                        if (data.length) {
-                            createData.value.delivery.take_store_id = ((data[0] && data[0].store_id) ? data[0].store_id : 0)
-                        }
-                    });
-                }
-            }, 500);
-        })
-    }).catch(() => {
-        calculateLoading.value = false
-    })
+// 留言
+const messageOpenRef = ref()
+const toLeaveMessage = () => {
+    messageOpenRef.value.open();
 }
 
+const confirmMessage = (message: string) => {
+    form.value.purchaseReason = message
+}
 
-// 改变配送方式
-watch(
-    () => delivery_type_list.value.length,
-    (newValue, oldValue) => {
-        if (delivery_type_list.value.length && uni.getStorageSync('distributionType')) {
-            delivery_type_list.value.forEach((item: any, index) => {
-                if (item.name == uni.getStorageSync('distributionType')) {
-                    activeIndex.value = index;
-                    switchDeliveryType(item.key, index)
-                }
-            })
-            uni.removeStorage({ key: 'distributionType' })
-        }
-    }
-)
-
-let orderId = 0
-
-// 顺手买回调
-const impulseBuyConfirm = (params: any = {}) => {
-    const calculateParams = { 'is_need_recalculate': 1 }
-
-    if (params && Object.keys(params).length) {
-        let data = cloneDeep(params)
-        createData.value.impulse_buy_goods = createData.value.impulse_buy_goods && createData.value.impulse_buy_goods.length ? createData.value.impulse_buy_goods : []
-        createData.value.impulse_buy_goods.forEach((item: any, index: any, array: any) => {
-            if (data.impulse_buy_goods_id == item.impulse_buy_goods_id) {
-                item.num = params.num
-                if (!item.num) {
-                    array.splice(index, 1)
-                }
-                data = ''
-            }
-        })
-        if (data) {
-            createData.value.impulse_buy_goods.push(data)
-        }
-    } else if (createData.value.impulse_buy_goods) {
-        delete createData.value.impulse_buy_goods
-    }
-    calculate(calculateParams)
+//日期
+const calendarConfirm = (data: any) => {
+    form.value.deliveryDate = data[0]
+    calendarShow.value = false
 }
 
+
 /**
  * 订单创建
  */
 const create = () => {
-    if (!verify() || createLoading.value) return
-    if (diyFormGoodsRef.value) {
-        let pass = true;
-        for (let i = 0; i < diyFormGoodsRef.value.length; i++) {
-            if (!diyFormGoodsRef.value[i].verify()) {
-                pass = false;
-                break;
-            }
-        }
-        if (!pass) return;
+    if (!form.value.shippingAddressId) {
+        uni.showToast({ title: '请选择收货人', icon: 'none' })
+        return
     }
-
-    if (diyFormRef.value && !diyFormRef.value.verify()) return;
-    createLoading.value = true
-
-    useSubscribeMessage().request('shop_order_pay,shop_order_delivery')
-
-    createData.value.form_data.order = {};
-    createData.value.form_data.goods = {};
-    if (diyFormRef.value) {
-        createData.value.form_data.form_id = orderData.value.form_id;
-        createData.value.form_data.order = diyFormRef.value.getData();
+    if (!form.value.purchaseReason) {
+        uni.showToast({ title: '请输入采购事由', icon: 'none' })
+        return
     }
-    if (diyFormGoodsRef.value) {
-        orderData.value.goods.forEach((item: any) => {
-            if (item.goods.form_id) {
-                for (let i = 0; i < diyFormGoodsRef.value.length; i++) {
-                    let formItem = diyFormGoodsRef.value[i].getData();
-                    if (formItem.relate_id == item.sku_id && item.goods.form_id == formItem.form_id) {
-                        createData.value.form_data.goods[item.sku_id] = formItem;
-                    }
-                }
-            }
-        })
+    if (!form.value.deliveryDate) {
+        uni.showToast({ title: '请选择配送日期', icon: 'none' })
+        return
     }
-
-    orderCreate(createData.value).then(({ data }) => {
-        orderId = data.order_id
-        if (diyFormRef.value) diyFormRef.value.clearStorage();
-        if (diyFormGoodsRef.value) {
-            for (let i = 0; i < diyFormGoodsRef.value.length; i++) {
-                diyFormGoodsRef.value[i].clearStorage()
-            }
-        }
-        createData.value.form_data = {}
-        if (orderData.value.basic.order_money == 0) {
-            redirect({ url: '/addon/shop/pages/order/detail', param: { order_id: orderId }, mode: 'redirectTo' })
-        } else {
-            payRef.value?.open(data.trade_type, data.order_id, `/addon/shop/pages/order/detail?order_id=${ data.order_id }`)
-        }
+    if (createLoading.value) return
+    createLoading.value = true
+    orderCreate(form.value).then((res: any) => {
+        orderId.value = res.data
+        payRef.value?.open(res.data, `/addon/shop/pages/order/detail?order_id=${res.data}`)
     }).catch((err) => {
-		if (err.code == 401) {
-			uni.showToast({ icon: 'none', title:'登录过期,请重新登录' })
-			redirect({
-			    url: '/addon/shop/pages/index',
-			    mode: 'reLaunch'
-			});
-		}
-        createData.value.form_data = {}
         createLoading.value = false
     })
-}
-
-/**
- * 下单校验
- */
-const verify = () => {
-    const data = createData.value
-    let verify = true
-
-    if (orderData.value.basic.has_goods_types.includes('real')) {
-        if (['express', 'local_delivery'].includes(data.delivery.delivery_type) && !orderData.value.delivery.take_address) {
-            uni.showToast({ title: '请选择收货地址', icon: 'none' })
-            return false
-        }
-
-        if (data.delivery.delivery_type == 'store' && !data.delivery.take_store_id) {
-            uni.showToast({ title: '请选择自提点', icon: 'none' })
-            return false
-        }
-    }
-
-    if (data.delivery.delivery_type == 'store') {
-        if (!data.delivery.taker_name) {
-            uni.showToast({ title: '请输入姓名', icon: 'none' })
-            return false
-        }
-        if (!data.delivery.taker_mobile) {
-            uni.showToast({ title: '请输入手机号', icon: 'none' })
-            return false
-        }
-        if (!/^1[3-9]\d{9}$/.test(data.delivery.taker_mobile)) {
-            uni.showToast({ title: '请输入正确的手机号', icon: 'none' })
-            return false
-        }
-        if (!data.delivery.buyer_ask_delivery_time) {
-            uni.showToast({ title: '请选择自提时间', icon: 'none' })
-            return false
-        }
-    }
-	if(data.delivery.delivery_type == 'local_delivery' && !isDelivery.value && localConfig.value.time_is_open){
-		uni.showToast({ title: '当前时间不支持配送', icon: 'none' })
-		return false
-	}
 
-    return verify
 }
 
 /**
@@ -685,69 +315,9 @@ const verify = () => {
 const payClose = () => {
     redirect({ url: '/addon/shop/pages/order/detail', param: { order_id: orderId }, mode: 'redirectTo' })
 }
-
-/**
- * 选择地址
- */
-const toSelectAddress = () => {
-    let data: any = {};
-    data.delivery = createData.value.delivery.delivery_type;
-    data.type = createData.value.delivery.delivery_type == 'local_delivery' ? 'location_address' : 'address';
-    data.id = orderData.value.delivery.take_address.id;
-    addressRef.value.open(data);
-}
-
-const couponList = computed(() => {
-    return couponRef.value?.couponList || []
-})
-
-/**
- * 选择优惠券
- */
-const confirmSelectCoupon = (coupon: any) => {
-    createData.value.discount.coupon_id = coupon ? coupon.id : 0
-    calculate()
-}
-
-/**
- * 选择自提点
- */
-const confirmSelectStore = (store: any) => {
-    createData.value.delivery.take_store_id = ((store && store.store_id) ? store.store_id : 0)
-    if (store) {
-        service_time.value = {
-            time_interval: store.time_interval,
-            time_week: store.time_week,
-            trade_time_json: store.trade_time_json
-        };
-    }else{
-        service_time.value = {}
-        createData.value.delivery.buyer_ask_delivery_time = ''
-        
-    }
-    calculate()
-}
-
-const confirmInvoice = (invoice: object) => {
-    createData.value.invoice = invoice
-}
-
-const confirmAddress = (data: any) => {
-    createData.value.order_key = ''
-    createData.value.delivery.delivery_type = data.delivery
-    createData.value.delivery.take_address_id = data.address_id
-    calculate();
-}
-const messageOpenRef = ref()
-const toLeaveMessage = () => {
-  messageOpenRef.value.open();
-}
-const confirmMessage = (message: string) => {
-    console.log(message)
-  createData.value.member_remark = message
-}
 </script>
 
+
 <style lang="scss" scoped>
 .head-tab {
     .head-tab-item {
@@ -834,6 +404,7 @@ const confirmMessage = (message: string) => {
     /*  #endif  */
     /*  #ifdef H5  */
     background: linear-gradient(180deg, transparent 0%, var(--page-bg-color) 25%);
+
     /*  #endif  */
     &::after {
         content: '';

+ 8 - 0
src/app/api/order.ts

@@ -0,0 +1,8 @@
+import request from '@/utils/request'
+
+/**
+ * 获取订单详情
+ */
+export function getShopOrderDetail(order_id: any) {
+    return request.get(`order/miniOrder/${ order_id }`)
+}

+ 1 - 1
src/app/api/pay.ts

@@ -4,7 +4,7 @@ import request from '@/utils/request'
  * 支付
  */
 export function pay(data : AnyObject) {
-    return request.post(`pay`, data, { showErrorMessage: true })
+    return request.post(`order/miniOrder/orderPay`, data, { showErrorMessage: true })
 }
 
 /**

+ 15 - 28
src/app/pages/pay/result.vue

@@ -3,24 +3,23 @@
         <view class="w-screen h-screen flex flex-col items-center" v-if="payInfo">
             <top-tabbar ref="topTabbarRef" :data="topTabbarParam" />
             <view class="flex-1 flex flex-col items-center w-full pt-[180rpx]">
-                <view class="flex items-baseline" :class="{'text-[#06c05d]': payInfo.status==2, 'text-red': payInfo.status!=2}">
-                    <text class="nc-iconfont -mb-[4rpx] !text-[32rpx]" :class="{'nc-icon-duihaoV6mm': payInfo.status==2, 'nc-icon-tanhaoV6mm': payInfo.status!=2}"></text>
-                    <text class="text-[36rpx] ml-[16rpx] font-500">{{ payInfo.status == 2 ? '支付成功' : '支付失败' }}</text>
+                <view class="flex items-baseline"
+                    :class="{ 'text-[#06c05d]': true, 'text-red': payInfo.status != 2 }">
+                    <text class="nc-iconfont -mb-[4rpx] !text-[32rpx]"
+                        :class="{ 'nc-icon-duihaoV6mm': true, 'nc-icon-tanhaoV6mm': payInfo.status != 2 }"></text>
+                    <text class="text-[36rpx] ml-[16rpx] font-500">{{ true ? '支付成功' : '支付失败' }}</text>
                 </view>
                 <view class="text-[56rpx] font-500 mt-[60rpx] price-font">
-                    <text class="text-[36rpx] mr-[6rpx]">{{ t('currency') }}</text>
-                    <text>{{ moneyFormat(payInfo.money) }}</text>
+                    <text class="text-[36rpx] mr-[6rpx]"></text>
+                    <text>{{ moneyFormat(payInfo.payableAmount) }}</text>
                 </view>
             </view>
             <view class="pb-[260rpx]">
-                <button class="w-[380rpx] !border-0 h-[80rpx] text-[28rpx] text-[#333] !bg-[#f2f2f2] flex-center font-500 rounded-[20rpx]" :plain="true" @click="complete">{{ payInfo.status == 2 ? t('complete') : t('close') }}</button>
+                <button
+                    class="w-[380rpx] !border-0 h-[80rpx] text-[28rpx] text-[#333] !bg-[#f2f2f2] flex-center font-500 rounded-[20rpx]"
+                    :plain="true" @click="complete">{{ true ? '完成' : '关闭' }}</button>
             </view>
         </view>
-        <u-modal :show="loading" :showCancelButton="true" :confirmText="t('pay.completePay')" :cancelText="t('pay.incompletePay')" @cancel="complete" confirmColor="var(--primary-color)">
-            <view class="py-[20rpx]">
-                <u-loading-icon :text="t('pay.getting')" textSize="16" mode="circle" :vertical="true"></u-loading-icon>
-            </view>
-        </u-modal>
     </view>
 </template>
 
@@ -32,6 +31,7 @@ import { t } from '@/locale'
 import { redirect, moneyFormat } from '@/utils/common'
 import { getFirstPage } from '@/utils/pages'
 import { topTabar } from '@/utils/topTabbar'
+import { getShopOrderDetail } from '@/app/api/order';
 
 const payInfo = ref<AnyObject | null>(null)
 const loading = ref(false)
@@ -45,7 +45,6 @@ let topTabbarParam = topTabarObj.setTopTabbarParam({ title: '', isBack: false })
 /********* 自定义头部 - end ***********/
 
 onLoad((data: any) => {
-    tradeType = data.trade_type
     tradeId = data.trade_id
     getPayInfo()
 })
@@ -54,22 +53,10 @@ onLoad((data: any) => {
  * 获取支付信息
  */
 const getPayInfo = () => {
-    getPayInfoApi(tradeType, tradeId, {}).then((res: any) => {
-        if (!uni.$u.test.isEmpty(res.data)) {
-            if (res.data.status == 1 && requestNum < 5) {
-                loading.value = true
-                requestNum++
-                setTimeout(() => {
-                    getPayInfo()
-                }, 1000)
-                return
-            }
-            payInfo.value = res.data
-            loading.value = false
-            // uni.setNavigationBarTitle({
-            //     title: payInfo.value.status == 2 ? t('pay.paySuccess') : t('pay.payFail')
-            // })
-        }
+    loading.value = true
+    getShopOrderDetail(tradeId).then((res: any) => {
+        payInfo.value = res.data
+        loading.value = false
     })
 }
 

+ 33 - 127
src/components/pay/pay.vue

@@ -1,31 +1,34 @@
 <template>
-    <u-popup :show="show" :round="10" @close="handleClose" :closeable="true" bgColor="#fff" zIndex="10081" :closeOnClickOverlay="false">
+    <u-popup :show="show" :round="10" @close="handleClose" :closeable="true" bgColor="#fff" zIndex="10081"
+        :closeOnClickOverlay="false">
         <view class="flex flex-col h-[65vh] popup-common" v-if="payInfo" @touchmove.prevent.stop>
             <view class="head">
-                <view class="title">{{ t('pay.payTitle') }}</view>
+                <view class="title">确认支付</view>
                 <view class="flex items-end justify-center w-full text-xl font-bold py-[20rpx] price-font">
-                    <view class="text-base mr-[4rpx]">{{ t('currency') }}</view>
-                    {{ moneyFormat(payInfo.money) }}
+                    <view class="text-base mr-[4rpx]"></view>
+                    {{ moneyFormat(payInfo.totalAmount) }}
                 </view>
             </view>
             <scroll-view scroll-y="true" class="flex-1 pt-[20rpx]">
                 <view class="flex text-[28rpx] px-[36rpx] py-[20rpx] mb-[10rpx]">
-                    <view class="text-[var(--text-color-light6)]">{{ t('pay.orderInfo') }}</view>
-                    <view class="text-right flex-1 pl-[30rpx] truncate">{{ payInfo.body }}</view>
+                    <view class="text-[var(--text-color-light6)]">订单编号</view>
+                    <view class="text-right flex-1 pl-[30rpx] truncate">{{ payInfo.orderNo }}</view>
                 </view>
                 <view class="mx-[var(--popup-sidebar-m)] px-[30rpx] bg-white rounded-[20rpx] bg-[var(--temp-bg)]">
-                    <template v-if="payInfo.pay_type_list.length">
-                        <view class="pay-item py-[30rpx] flex items-center border-0 border-b border-solid border-[#eee]" v-for="(item, index) in payInfo.pay_type_list" :key="index" @click="type = item.key">
+                    <template v-if="pay_type_list.length">
+                        <view class="pay-item py-[30rpx] flex items-center border-0 border-b border-solid border-[#eee]"
+                            v-for="(item, index) in pay_type_list" :key="index" @click="type = item.key">
                             <u-image :src="img(item.icon)" width="50rpx" height="50rpx"></u-image>
                             <view class="flex-1 px-[20rpx] text-[28rpx] font-500">{{ item.name }}</view>
                             <u-icon name="checkbox-mark" color="var(--primary-color)" v-if="item.key == type"></u-icon>
                         </view>
                     </template>
-                    <view class="py-[30rpx] text-center text-[24rpx] text-gray-subtitle" v-else>{{ t('pay.notHavePayType') }}</view>
+                    <view class="py-[30rpx] text-center text-[24rpx] text-gray-subtitle" v-else>没有可用的支付方式"</view>
                 </view>
             </scroll-view>
             <view class="btn-wrap">
-                <button class="primary-btn-bg btn" hover-class="none" :loading="loading" @click="confirmPay">{{ t('pay.confirmPay') }}</button>
+                <button class="primary-btn-bg btn" hover-class="none" :loading="loading"
+                    @click="confirmPay">确认支付</button>
             </view>
         </view>
     </u-popup>
@@ -35,13 +38,14 @@
 import { ref } from 'vue'
 import { t } from '@/locale'
 import { getPayInfo, pay } from '@/app/api/pay'
+import { getShopOrderDetail } from '@/app/api/order';
 import { img, redirect, isWeixinBrowser, moneyFormat } from '@/utils/common'
 import wechat from '@/utils/wechat'
 
 const prop = defineProps({
     ignorePay: {
         type: Array,
-        default () {
+        default() {
             return []
         }
     },
@@ -59,105 +63,28 @@ const show = ref(false)
 const loading = ref(false)
 
 const payInfo = ref<AnyObject | null>(null)
-const type = ref('')
+const type = ref(1)
+
+const pay_type_list = ref<any>([
+    {
+        icon: 'https://v6.site.niucloud.com/static/resource/icon/pay_icon/balancepay.png',
+        name: '信用支付',
+        key: 1
+    }
+])
 
 /**
  * 确认支付
  */
 const confirmPay = () => {
-    if (uni.$u.test.isEmpty(type.value)) {
-        uni.showToast({ title: t('pay.notHavePayType'), icon: 'none' })
-        return
-    }
-    if (type.value == 'friendspay') {
-        redirect({
-            url: '/app/pages/friendspay/share',
-            param: {
-                id: payInfo.value?.trade_id,
-                type: payInfo.value?.trade_type,
-            },
-            mode: 'redirectTo'
-        })
-        return false
-    }
     if (loading.value) return
     loading.value = true
 
     pay({
-        trade_type: payInfo.value?.trade_type,
-        trade_id: payInfo.value?.trade_id,
-        type: type.value,
-        openid: uni.getStorageSync('openid') || ''
+        orderId: payInfo.value?.id,
+        payType: 0
     }).then((res: any) => {
-        switch (type.value) {
-            case 'wechatpay':
-                // #ifndef H5
-                uni.requestPayment({
-                    provider: 'wxpay',
-                    ...res.data,
-                    success: (res: any) => {
-                        toPayResult()
-                    },
-                    fail: (res: any) => {
-                        loading.value = false
-                    }
-                })
-                // #endif
-                // #ifdef H5
-                if (isWeixinBrowser()) {
-                    res.data.timestamp = res.data.timeStamp
-                    delete res.data.timeStamp
-                    wechat.pay({
-                        ...res.data,
-                        success: () => {
-                            toPayResult()
-                        },
-                        cancel: () => {
-                            loading.value = false
-                        }
-                    })
-                } else {
-                    uni.setStorageSync('paymenting', {
-                        trade_type: payInfo.value?.trade_type,
-                        trade_id: payInfo.value?.trade_id
-                    })
-                    location.href = res.data.h5_url
-                }
-                // #endif
-                break;
-            case 'alipay':
-                // #ifdef H5
-                if (isWeixinBrowser()) {
-                    redirect({
-                        url: '/app/pages/pay/browser',
-                        param: {
-                            trade_type: payInfo.value?.trade_type,
-                            trade_id: payInfo.value?.trade_id,
-                            alipay: encodeURIComponent(res.data.url)
-                        },
-                        mode: 'redirectTo'
-                    })
-                } else {
-                    uni.setStorageSync('paymenting', {
-                        trade_type: payInfo.value?.trade_type,
-                        trade_id: payInfo.value?.trade_id
-                    })
-                    location.href = res.data.url
-                }
-                // #endif
-                break;
-            default:
-                if (res.data.url) {
-                    redirect({
-                        url: res.data.url,
-                        param: res.data.param || {},
-                        mode: 'redirectTo'
-                    })
-                    return
-                }
-                toPayResult()
-                break;
-        }
+        toPayResult()
     }).catch(() => {
         loading.value = false
     })
@@ -169,7 +96,7 @@ const confirmPay = () => {
 uni.$on('checkIsReturnAfterPayment', () => {
     const data = uni.getStorageSync('paymenting')
     if (uni.getStorageSync('paymenting')) {
-        
+
         redirect({
             url: '/app/pages/pay/result',
             param: {
@@ -184,7 +111,7 @@ uni.$on('checkIsReturnAfterPayment', () => {
     }
 })
 const repeat = ref(false)
-const open = (tradeType: string, tradeId: number, payReturn: string = '', scene: string = '') => {
+const open = (tradeId: number, payReturn: string = '', scene: string = '') => {
 
     if (repeat.value) return
     repeat.value = true
@@ -192,30 +119,9 @@ const open = (tradeType: string, tradeId: number, payReturn: string = '', scene:
     // 设置支付后跳转页面
     uni.setStorageSync('payReturn', encodeURIComponent(payReturn))
 
-    // 帮人付款时过滤帮付选项
-    const obj: any = {}
-    if (scene) {
-        obj.scene = scene
-    }
-    getPayInfo(tradeType, tradeId, obj).then((res: any) => {
-
+    getShopOrderDetail(tradeId).then((res: any) => {
         let { data } = res
-
-        if (uni.$u.test.isEmpty(data)) {
-            uni.showToast({ title: t('pay.notObtainedInfo'), icon: 'none' })
-            return
-        }
-        if (data.money == 0) {
-            toPayResult()
-            return
-        }
         payInfo.value = data
-        if(prop.ignorePay) {
-            data.pay_type_list = data.pay_type_list.filter((item: any) => {
-                return !prop.ignorePay.includes(item.key)
-            })
-        }
-        type.value = data.pay_type_list[0] ? data.pay_type_list[0].key : ''
         show.value = true
         repeat.value = false
 
@@ -229,17 +135,17 @@ const emits = defineEmits(['close', 'confirm'])
 const toPayResult = () => {
     emits('confirm')
     // console.log(prop.reformat)
-    if(prop.reformat){
+    if (prop.reformat) {
         redirect({
             url: prop.reformat,
             mode: 'redirectTo'
         })
         return
     }
-    
+
     redirect({
         url: '/app/pages/pay/result',
-        param: { trade_type: payInfo.value?.trade_type, trade_id: payInfo.value?.trade_id },
+        param: { trade_id: payInfo.value?.id },
         mode: 'redirectTo'
     })
 }

+ 22 - 0
src/uni_modules/piaoyi-cityPicker/changelog.md

@@ -0,0 +1,22 @@
+## 1.1.7(2024-10-29)
+修复底部露出部分组件bug
+## 1.1.6(2024-08-20)
+更新本地数据源为最新数据源
+## 1.1.5(2024-06-12)
+使用说明文档优化
+## 1.1.4(2024-06-12)
+增加问题反馈描述
+## 1.1.3(2024-02-29)
+更新使用文档
+## 1.1.2(2024-01-16)
+解决Vue3项目导入导出报错问题
+## 1.1.1(2023-12-06)
+defaultValue可以传入defaultValue:['河北省','唐山市','丰南区']数组类型以及defaultValue: '420103'地区编码字符串类型
+## 1.1.0(2023-12-05)
+即默认值传入地区编码,也支持传入中文省市区数组
+## 1.0.9(2023-12-04)
+优化
+## 1.0.8(2023-10-24)
+修复东菀市和中山市下各镇的行政编码错误问题
+## 1.0.4(2023-09-15)
+改为uni_modules规范

+ 0 - 9
src/utils/interceptor.ts

@@ -22,13 +22,6 @@ export const redirectInterceptor = (route: { path: string, query: object }) => {
 
     loadShare()
 
-    // 添加会员访问日志
-    if (getToken()) memberLog({
-        route: route.path,
-        params: JSON.stringify(route.query),
-        pre_route: getCurrentPages()[0]?.route
-    })
-
 }
 
 /**
@@ -58,8 +51,6 @@ export const launchInterceptor = () => {
 
     loadShare()
 
-    // 添加会员访问日志
-    if (getToken()) memberLog({ route: launch.path, params: JSON.stringify(launch.query || {}), pre_route: '' })
 }