feat:优惠券

This commit is contained in:
2026-06-15 14:20:38 +08:00
parent cac63ff675
commit 3523cc3a21
14 changed files with 688 additions and 1137 deletions
+2
View File
@@ -50,9 +50,11 @@ export default {
const res = await getAddress();
if (res && res.bizcode === 100) {
this.addressList = res.data;
console.log("我是秦星星addressList", this.addressList);
}
},
checkAddress(item) {
console.log("我是秦星星", item);
this.selectAddress = item;
this.$emit("valueFunc", item);
},
+52 -14
View File
@@ -1,16 +1,20 @@
<template>
<view class="ping-item" @click.stop="onClick">
<image
class="top-img"
:src="obj.url"
mode="widthFix"
lazy-load
/>
<image class="top-img" :src="obj.url" mode="widthFix" lazy-load />
<view class="shop-bottom-panel">
<text class="title text-30 text-zu text-overflow">
{{ obj.title }}
</text>
<view class="flex-r-lr price-line">
<!-- 有优惠券 -->
<view class="flex-r-lr price-line coupon-line" v-if="obj.buyDeductionValue">
<view class="text-28 text-zi text-bold">
<view class="text-36 text-bold">{{ obj.buyDeductionValue }}抵扣券</view>
<view class="text-24">+{{ obj.price }}元</view>
</view>
<text class="text-20 sold">兑换</text>
</view>
<!-- 无优惠券 -->
<view class="flex-r-lr price-line" v-else>
<text class="text-28 text-zi text-bold">¥{{ obj.price }}</text>
<text class="text-24 sold">已售{{ obj.sales }}件</text>
</view>
@@ -41,7 +45,8 @@ export default {
background: #fff;
border-radius: 12rpx;
overflow: hidden;
margin-bottom: 0; /* 瀑布流父层控制间距,这里清零 */
margin-bottom: 0;
/* 瀑布流父层控制间距,这里清零 */
}
.top-img {
@@ -75,15 +80,48 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
}
.text-30 { font-size: 30rpx; }
.text-28 { font-size: 28rpx; }
.text-24 { font-size: 24rpx; }
.text-zu { color: #333; }
.text-zi { color: #7A35F6; }
.text-bold { font-weight: bold; }
.text-30 {
font-size: 30rpx;
}
.text-28 {
font-size: 28rpx;
}
.text-24 {
font-size: 24rpx;
}
.text-zu {
color: #333;
}
.text-zi {
color: #7A35F6;
}
.text-bold {
font-weight: bold;
}
.flex-r-lr {
display: flex;
justify-content: space-between;
align-items: center;
}
.coupon-line {
.sold {
width: 98rpx;
height: 64rpx;
background: linear-gradient(270deg, #B164FB 0%, #7934F6 100%);
border-radius: 8rpx;
font-size: 30rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>
+2 -2
View File
@@ -21,9 +21,9 @@
</view>
</view>
</view>
<view class="prize_draw_right_warp" v-if="item.type === 4" v-show="item.status === 1" @click="jumpGetFun(item)">
<view class="prize_draw_right_warp" v-if="item.type === 'goods'" v-show="item.status === 1" @click="jumpGetFun(item)">
去领取</view>
<view class="prize_draw_right_warp yes_" v-if="item.type === 4" v-show="item.status === 2">已领取</view>
<view class="prize_draw_right_warp yes_" v-if="item.type === 'goods'" v-show="item.status === 2">已领取</view>
</view>
<view v-else class="not_order_warp">
<up-image src="https://static.tbmall.xin/static/not_order.png" width="80" height="80"
+3 -2
View File
@@ -88,8 +88,9 @@
<view class="content_item_yd_msg">(快递动态跟进请复制单号至[快递100官网] 查询)</view>
<view>共{{ item.buyNum }}件,合计¥{{ item.sumAmount }}</view>
</view> -->
<view class="collect_msg">运费:¥{{ item.postage }},商品总价:¥{{item.sumAmount}}</view>
<view class="collect_msg">共{{ item.buyNum }}件,合计¥{{ item.sumAmount + item.postage }}</view>
<view class="collect_msg" v-if="item.buyDeductionValue">共{{ item.buyNum }}件,合计抵扣券{{item.buyDeductionValue}} +¥{{item.sumAmount}}</view>
<view class="collect_msg" v-if="!item.buyDeductionValue">运费:¥{{ item.postage }},商品总价:¥{{item.sumAmount}}</view>
<view class="collect_msg" v-if="!item.buyDeductionValue">共{{ item.buyNum }}件,合计¥{{ item.sumAmount + item.postage }}</view>
<view class="collect_operate">
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.UNSHIPPED" @click="checkCancel(true)">取消订单</view> -->
<view class="operate_comm operate_but_2" v-if="
@@ -1,27 +1,13 @@
<template>
<view
class="mine_order_info_warp"
:style="{
<view class="mine_order_info_warp" :style="{
height: height,
}"
>
}">
<up-loading-page :loading="listLoading"></up-loading-page>
<view class="order_info_header">
<up-image
src="/static/common/left_b.png"
width="20"
height="19"
bgColor="#f1f6ff00"
@click="jumpLeft"
></up-image>
<up-image src="/static/common/left_b.png" width="20" height="19" bgColor="#f1f6ff00" @click="jumpLeft"></up-image>
<view class="header_status">
<view style="margin-top: 10rpx">
<up-image
src="/static/common/order_status_1.png"
width="20"
height="19"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/order_status_1.png" width="20" height="19" bgColor="#f1f6ff00"></up-image>
</view>
<text class="msg">{{ getValue(ORDER_STATUS, orderInfo.status) }}</text>
</view>
@@ -35,45 +21,25 @@
<text style="font-size: 36rpx; font-weight: bold">{{
orderInfo.sumAmount
}}</text>
<text style="font-size: 20rpx; font-weight: bold; margin-left: 20rpx"
>订单</text
>
<text
style="font-size: 28rpx; font-weight: bold; margin-left: 10rpx"
>{{ formatDate1(orderInfo.expireTime) }}</text
>
<text style="font-size: 20rpx; font-weight: bold"
>&nbsp;自动取消</text
>
<text style="font-size: 20rpx; font-weight: bold; margin-left: 20rpx">订单</text>
<text style="font-size: 28rpx; font-weight: bold; margin-left: 10rpx">{{ formatDate1(orderInfo.expireTime)
}}</text>
<text style="font-size: 20rpx; font-weight: bold">&nbsp;自动取消</text>
</view>
</view>
<view
class="content_cancel"
v-if="orderInfo.status === ORDER_TYPE.CANCELED"
>取消原因:超时未支付</view
>
<view class="content_cancel" v-if="orderInfo.status === ORDER_TYPE.CANCELED">取消原因:超时未支付</view>
<!-- 地址 -->
<view class="steps_warp">
<!-- 物流单号 -->
<view class="address_info">
<view class="address_data_warp">
<up-image
src="/static/common/waybill.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/waybill.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<view class="address_info_name">订单编号:</view>
<view class="address_info_mobile" style="margin-right: 20rpx">{{
orderInfo.orderNum
}}</view>
<up-image
src="/static/common/copy.png"
width="14"
height="14"
bgColor="#f1f6ff00"
@click="copyData(orderInfo.orderNum)"
></up-image>
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00"
@click="copyData(orderInfo.orderNum)"></up-image>
</view>
</view>
<view class="address_info_right">&nbsp;</view>
@@ -81,12 +47,7 @@
<view class="address_warp">
<view class="address_info">
<view class="address_data_warp">
<up-image
src="/static/common/address.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/address.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<view class="address_info_name">{{ orderInfo.name }}</view>
<view class="address_info_mobile">{{ orderInfo.phone }}</view>
</view>
@@ -102,42 +63,25 @@
<view class="order_comm order_product_warp">
<!-- 头部 -->
<view class="order_product_header">
<up-image
:src="orderInfo.shopLogo"
width="22"
height="22"
bgColor="#f1f6ff00"
shape="circle"
></up-image>
<up-image :src="orderInfo.shopLogo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
<view class="order_product_title">{{ orderInfo.shopName }}</view>
</view>
<!-- 产品详情 -->
<view class="order_item_content">
<view v-for="pItem in orderInfo.items" :key="pItem.id">
<view class="content_item">
<up-image
:src="pItem.mainGraph"
width="80"
height="80"
bgColor="#f1f6ff00"
></up-image>
<up-image :src="pItem.mainGraph" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="content_info">
<view class="content_info_title">{{ pItem.title }}</view>
<view class="content_info_tag">{{ pItem.goodsSpece }}</view>
<view>
<text
class="content_info_description"
v-for="dItem in pItem.description"
:key="dItem"
>
<text class="content_info_description" v-for="dItem in pItem.description" :key="dItem">
{{ dItem }}
</text>
</view>
</view>
<view class="content_right">
<view class="content_right_total"
>¥{{ pItem.goodsAmount }}</view
>
<view class="content_right_total">¥{{ pItem.goodsAmount }}</view>
<view class="content_right_quantity">x{{ pItem.buyNum }}</view>
</view>
</view>
@@ -147,13 +91,8 @@
<view class="item_value">
<view>{{ pItem.expressNo }} </view>
<view style="margin-left: 10rpx">
<up-image
src="/static/common/copy.png"
width="14"
height="14"
bgColor="#f1f6ff00"
@click="copyData(pItem.expressNo)"
></up-image>
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00"
@click="copyData(pItem.expressNo)"></up-image>
</view>
</view>
</view>
@@ -166,25 +105,27 @@
<view class="order_comm order_data_warp">
<view class="data_item">
<view class="item_title">商品总价</view>
<view class="item_value">¥{{ orderInfo.sumAmount }}</view>
<view class="item_value" v-if="!orderInfo.buyDeductionValue">¥{{ orderInfo.sumAmount }}</view>
<view class="item_value" v-else>抵扣券{{ orderInfo.buyDeductionValue }} +¥{{ orderInfo.sumAmount }}</view>
</view>
<view class="data_item">
<view class="item_title">快递运费</view>
<view class="item_value">¥{{ orderInfo.postage }}</view>
</view>
<view class="data_item" v-if="orderInfo.buyDeductionValue">
<view class="item_title">抵扣券</view>
<view class="item_value" style="color: #7934F6">{{ orderInfo.buyDeductionValue }}抵扣券</view>
</view>
<view class="data_item">
<view class="item_title"
>平台优惠<text class="copy_order_coupon" v-if="orderInfo.coupon"
>优惠券</text
></view
>
<view class="item_title">平台优惠<text class="copy_order_coupon" v-if="orderInfo.coupon">优惠券</text></view>
<view class="item_value">-¥0.00</view>
</view>
<view class="data_item">
<view class="item_title">应付款</view>
<view class="item_value pay_amount"
>¥{{ orderInfo.sumAmount + orderInfo.postage }}</view
>
<view class="item_value pay_amount">¥{{ orderInfo.sumAmount + orderInfo.postage }}</view>
</view>
<view class="order_data_but"></view>
@@ -208,77 +149,45 @@
<view class="code_content" v-if="orderInfo.antChainHash">
<view>
<view style="font-size: 28rpx; color: #333; font-weight: bold"
>您的订单已接入蚂蚁链溯源</view
>
<view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx"
>扫描二维码或复制下方链接查看溯源信息</view
>
<view class="code_content_item"><view class="code_content_item_text">
<view style="font-size: 28rpx; color: #333; font-weight: bold">您的订单已接入蚂蚁链溯源</view>
<view style="font-size: 20rpx; color: #999; margin-bottom: 18rpx">扫描二维码或复制下方链接查看溯源信息</view>
<view class="code_content_item">
<view class="code_content_item_text">
{{
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`
}}
</view>
<up-image
style="margin-left: 8rpx"
src="/static/rwa/copy.png"
width="12"
@click="
<up-image style="margin-left: 8rpx" src="/static/rwa/copy.png" width="12" @click="
copyData(
`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`
)
"
height="12"
bgColor="#f1f6ff00"
></up-image
></view>
" height="12" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view>
<up-qrcode
:val="`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`"
:size="63"
@click.stop="previewQrcode(`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`)"
></up-qrcode>
@click.stop="previewQrcode(`https://chaininsight.antdigital.com/search?unionId=2647&projectName=VBGAKNJB&content=${orderInfo.antChainHash}`)"></up-qrcode>
</view>
</view>
<!-- 支付方式 -->
<view
class="order_way_warp"
@click="wayShowFun(true)"
v-if="orderInfo.status === ORDER_TYPE.UNPAID"
>
<view class="order_way_warp" @click="wayShowFun(true)" v-if="orderInfo.status === ORDER_TYPE.UNPAID">
<view>支付方式</view>
<view class="order_way_right">
{{ getValue(wayOption, wayForm.payway) }}
<up-image
src="/static/common/right.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view>
<view
class="collect_operate order_but_warp"
v-if="
<view class="collect_operate order_but_warp" v-if="
[ORDER_TYPE.UNPAID, ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)
"
>
">
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">取消订单</view> -->
<view
class="operate_comm operate_but_2"
v-if="orderInfo.status === ORDER_TYPE.UNPAID"
@click="goPay"
>去付款</view
>
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.UNPAID" @click="goPay">去付款</view>
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请退款</view> -->
<view
class="operate_comm operate_but_2"
v-if="orderInfo.status === ORDER_TYPE.NOT_RECEIVE"
@click="confirmReceiptOk(orderInfo)"
>确认收货</view
>
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.NOT_RECEIVE"
@click="confirmReceiptOk(orderInfo)">确认收货</view>
<!-- <view class="operate_comm operate_but_3" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> -->
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请售后</view> -->
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
@@ -287,38 +196,22 @@
</view>
<!-- 选择支付方式 -->
<up-popup
v-model:show="wayShow"
:round="10"
:closeOnClickOverlay="false"
:closeable="true"
:safeAreaInsetBottom="false"
>
<up-popup v-model:show="wayShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
:safeAreaInsetBottom="false">
<view class="way_popup_warp">
<view class="way_popup_title">支付方式</view>
<up-radio-group v-model="wayForm.payway" placement="column">
<view
v-for="item in wayOption"
:key="item.id"
style="margin-bottom: 10rpx"
>
<view v-for="item in wayOption" :key="item.id" style="margin-bottom: 10rpx">
<view class="way_item">
<view class="way_item_">
<!-- <view style="margin-top: 2rpx;"><up-image :src="item.path" width="20" height="20" bgColor="#f1f6ff00"></up-image></view> -->
<view class="way_item_val"
>{{ item.name
}}<text v-if="item.balance"
>&nbsp;&nbsp;(¥{{ item.balance }})</text
>
<view class="way_item_val">{{ item.name
}}<text v-if="item.balance">&nbsp;&nbsp;(¥{{ item.balance }})</text>
</view>
</view>
<up-radio :name="item.type" activeColor="#FF7C41"> </up-radio>
</view>
<view
class="balance_comm_msg"
v-if="item.type === 'balance' && isShowBalance"
>当前现金余额不足,如需支付请前往充值</view
>
<view class="balance_comm_msg" v-if="item.type === 'balance' && isShowBalance">当前现金余额不足,如需支付请前往充值</view>
</view>
</up-radio-group>
<view class="popup_but" @click="wayShow = false"> 确认 </view>
@@ -583,11 +476,13 @@ export default {
justify-content: space-between;
align-items: center;
margin-bottom: 48rpx;
.code_content_item {
font-size: 20rpx;
color: #7934f6;
display: flex;
align-items: center;
.code_content_item_text {
width: 350rpx;
overflow: hidden;
@@ -598,6 +493,7 @@ export default {
}
}
}
.mine_order_info_warp {
height: 100vh;
// height: calc(100vh - 180rpx);
@@ -681,8 +577,7 @@ export default {
margin: 10rpx 20rpx;
}
.address_warp {
}
.address_warp {}
.address_info {
display: flex;
+169 -248
View File
@@ -1,33 +1,18 @@
<template>
<view class="order_submit_warp">
<Header
:leftTitle="$t('order.submit.title')"
leftPathType="switchTab"
leftPath="/pages/shopping_cart/shopping_cart"
/>
<Header :leftTitle="$t('order.submit.title')" leftPathType="switchTab"
leftPath="/pages/shopping_cart/shopping_cart" />
<!-- 收件人信息 -->
<view
class="order_submit_header_warp"
@click="checkAddressShow(true, 'data')"
v-if="orderInfo.address && Object.keys(orderInfo.address).length !== 0"
>
<view class="order_submit_header_warp" @click="checkAddressShow(true, 'data')"
v-if="orderInfo.address && Object.keys(orderInfo.address).length !== 0">
<view class="header_areaAddress_warp">
<view
class="tab-comm areaAddress_default"
v-if="orderInfo.address.isDefault"
>默认</view
>
<view class="tab-comm areaAddress_default" v-if="orderInfo.address.isDefault">默认</view>
<!-- <view class="tab-comm areaAddress_tab">家</view> -->
<text>{{ assembleAddress(orderInfo.address).names }}</text>
</view>
<view class="header_detailedAddress_warp">
<view style="width: 90%">{{ orderInfo.address.address }}</view>
<up-image
src="/static/common/right.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="header_name_warp">
<text style="margin-right: 20rpx">{{ orderInfo.address.name }}</text>
@@ -39,167 +24,92 @@
<view class="no_address_title">
<view>请填写地址</view>
<view style="margin-top: 10rpx">
<up-image
src="/static/common/right.png"
width="14"
height="14"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/right.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view class="no_address_msg">您还未添加收货地址,请完善地址!</view>
</view>
<!-- 店铺信息 -->
<view
class="order_store_warp order_product_warp"
v-for="(item, index) in orderInfo.shops"
:key="item.id"
>
<view class="order_store_warp order_product_warp" v-for="(item, index) in orderInfo.shops" :key="item.id">
<!-- 头部 -->
<view class="order_product_header">
<up-image
:src="item.logo"
width="22"
height="22"
bgColor="#f1f6ff00"
shape="circle"
></up-image>
<up-image :src="item.logo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
<view class="order_product_title">{{ item.name }}</view>
</view>
<view v-for="(addItem, addIndex) in item.addrTimes" :key="addIndex">
<!-- 单个地址 -->
<view
v-if="addItem.address"
class="shops_address_warp"
@click="checkAddressShow(true, 'addrTimes', addIndex, index)"
>
<view v-if="addItem.address" class="shops_address_warp"
@click="checkAddressShow(true, 'addrTimes', addIndex, index)">
<view class="shops_address_warp_title">
<text style="margin-right: 20rpx">{{ addItem.address.name }}</text>
<text>{{ addItem.address.address }}</text>
</view>
<view>
<up-image
src="/static/common/right.png"
width="16"
height="16"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/right.png" width="16" height="16" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<!-- 产品详情 -->
<view
v-if="ids"
class="order_item_content"
v-for="(pItem, pIndex) in addItem.goods"
:key="pItem.id"
>
<up-image
:src="pItem.img"
width="80"
height="80"
bgColor="#f1f6ff00"
@click="jumpProductInfo(pItem)"
></up-image>
<view v-if="ids" class="order_item_content" v-for="(pItem, pIndex) in addItem.goods" :key="pItem.id">
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"
@click="jumpProductInfo(pItem)"></up-image>
<view class="content_info_right">
<view
class="content_info_left_total"
@click="jumpProductInfo(pItem)"
>
<view class="content_info_left_total" @click="jumpProductInfo(pItem)">
<view class="content_info_title">{{ pItem.title }}</view>
<view class="content_info_tag">{{ pItem.specs }}</view>
</view>
<view class="content_info_right_total">
<view class="content_right_total">
<view
>¥<text style="font-size: 36rpx">{{
<view>¥<text style="font-size: 36rpx">{{
pItem.totalPrice
}}</text></view
>
}}</text></view>
<view>每件到手价¥{{ pItem.unitPrice }}</view>
</view>
<view class="shopping_info_quantity">
<view
class="quantity_but"
@click="quantityFun('minus', index, addIndex, pIndex)"
>-</view
>
<view class="quantity_but" @click="quantityFun('minus', index, addIndex, pIndex)">-</view>
<view class="quantity_value">{{ pItem.num }}</view>
<view
class="quantity_but"
@click="quantityFun('add', index, addIndex, pIndex)"
>+</view
>
<view class="quantity_but" @click="quantityFun('add', index, addIndex, pIndex)">+</view>
</view>
</view>
</view>
</view>
<view
v-else
class="order_item_content"
v-for="(pItem, pIndex) in addItem.goods"
:key="pItem.id"
>
<up-image
:src="pItem.img"
width="80"
height="80"
bgColor="#f1f6ff00"
@click="jumpProductInfo(pItem)"
></up-image>
<view v-else class="order_item_content" v-for="(pItem, pIndex) in addItem.goods" :key="'else-' + pItem.id">
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"
@click="jumpProductInfo(pItem)"></up-image>
<view class="content_info_right">
<view
class="content_info_left_total"
@click="jumpProductInfo(pItem)"
>
<view class="content_info_left_total" @click="jumpProductInfo(pItem)">
<view class="content_info_title">{{ pItem.title }}</view>
<view class="content_info_tag">{{ pItem.specs }}</view>
</view>
<view class="content_info_right_total">
<view class="content_right_total">
<view
>¥<text style="font-size: 36rpx">{{
<view>¥<text style="font-size: 36rpx">{{
pItem.totalPrice
}}</text></view
>
}}</text></view>
<view>每件到手价¥{{ pItem.unitPrice }}</view>
</view>
<view class="shopping_info_quantity">
<view
class="quantity_but"
@click="quantityFun('minus', index, addIndex, pIndex)"
>-</view
>
<view class="quantity_but" @click="quantityFun('minus', index, addIndex, pIndex)">-</view>
<view class="quantity_value">{{ pItem.num }}</view>
<view
class="quantity_but"
@click="quantityFun('add', index, addIndex, pIndex)"
>+</view
>
<view class="quantity_but" @click="quantityFun('add', index, addIndex, pIndex)">+</view>
</view>
</view>
</view>
</view>
<view class="content_info_right_remark">
<view class="title">留言</view>
<up-input
placeholder="建议留言前先与商家沟通确认"
border="surround"
v-model="addItem.remark"
:customStyle="{
<up-input placeholder="建议留言前先与商家沟通确认" border="surround" v-model="addItem.remark" :customStyle="{
'text-align': 'right !important',
border: '0rpx',
}"
style="text-align: right"
></up-input>
}" style="text-align: right"></up-input>
</view>
<!-- 运费 -->
<view class="order_freight_warp" v-if="orderInfo">
<view class="order_freight_item">
<view
>运费<text style="color: #c0c3c6; margin-left: 20rpx">{{
<view>运费<text style="color: #c0c3c6; margin-left: 20rpx">{{
getValue(PRODUCT_DELIVERY_TIME, addItem.deliveryTime)
}}</text></view
>
}}</text></view>
<view class="value_">
{{ orderInfo.postage ? "¥" + orderInfo.postage : "包邮" }}
</view>
@@ -220,42 +130,33 @@
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
</view> -->
<!-- 优惠券信息 -->
<view class="order_way_warp_two" v-if="isCoupon">
<view class="price-view">
<text class="text-32 text-zu">抵扣券余额</text>
<text class="text-32 text-zu text-bold">{{ couponData.balance || 0 }}</text>
</view>
<view class="price-view">
<text class="text-32 text-zu">实付抵扣券 </text>
<text class="text-32 text-zu text-bold">{{ buyCouponvalue }}</text>
</view>
</view>
<view class="order_way_warp_two">
<text class="text-32 text-zu">支付方式</text>
<up-radio-group v-model="orderInfo.paymentMethod" placement="column">
<view
v-for="(item, index) in wayOption"
:key="item.id"
class="way-option"
:style="{
<view v-for="(item, index) in wayOption" :key="item.id" class="way-option" :style="{
borderWidth: wayOption.length - 1 == index ? '0rpx' : '2rpx',
}"
>
}">
<view class="way-option-item">
<image
v-if="item.type == 'wechat'"
src="https://static.tbmall.xin/static/new/wx.png"
></image>
<image
v-if="item.type == 'alipay'"
src="https://static.tbmall.xin/static/new/zfb.png"
></image>
<image
v-if="item.type == 'balance'"
src="https://static.tbmall.xin/static/new/bank.png"
></image>
<image
v-if="item.type == 'redpacket'"
src="https://static.tbmall.xin/static/new/jf.png"
></image>
<text
v-if="item.type == 'wechat' || item.type == 'alipay'"
class="text-32 text-zu"
style="margin-left: 20rpx"
>{{ item.name }}</text
>
<text v-else style="margin-left: 20rpx" class="text-32 text-zu"
>{{ item.name }}
<image v-if="item.type == 'wechat'" src="https://static.tbmall.xin/static/new/wx.png"></image>
<image v-if="item.type == 'alipay'" src="https://static.tbmall.xin/static/new/zfb.png"></image>
<image v-if="item.type == 'balance'" src="https://static.tbmall.xin/static/new/bank.png"></image>
<image v-if="item.type == 'redpacket'" src="https://static.tbmall.xin/static/new/jf.png"></image>
<text v-if="item.type == 'wechat' || item.type == 'alipay'" class="text-32 text-zu"
style="margin-left: 20rpx">{{ item.name }}</text>
<text v-else style="margin-left: 20rpx" class="text-32 text-zu">{{ item.name }}
<text style="color: #999; margin: 0 10rpx">可用:</text>
{{ item.balance }}
</text>
@@ -267,15 +168,25 @@
<view class="order_way_warp_two">
<view class="price-view">
<text class="text-32 text-zu">商品总价</text>
<text class="text-32 text-zu text-bold"
>¥{{ orderInfo.amount - orderInfo.postage + (orderInfo.enterpriseAmount || 0) }}</text
>
<text class="text-32 text-zu text-bold" v-if="isCoupon">
{{ `${buyCouponvalue}抵扣券+${orderInfo.amount - (orderInfo.postage || 0) +
(orderInfo.enterpriseAmount
|| 0)}元` }}
</text>
<text class="text-32 text-zu text-bold" v-else>¥{{ orderInfo.amount - orderInfo.postage +
(orderInfo.enterpriseAmount
|| 0) }}</text>
</view>
<view class="price-view">
<text class="text-32 text-zu">运费</text>
<text class="text-32 text-zu text-bold">¥{{ orderInfo.postage }}</text>
</view>
<view class="price-view" v-if="user.isEnterpriseUser">
<view class="price-view" v-if="isCoupon">
<text class="text-32 text-zu">抵扣券</text>
<text class="text-32 text-zu text-bold">{{ buyCouponvalue }}抵扣券</text>
</view>
<view class="price-view" v-if="user?.isEnterpriseUser">
<text class="text-32 text-zu">企业用户优惠</text>
<text class="text-32 text-zu text-bold">¥{{ orderInfo.enterpriseAmount }}</text>
</view>
@@ -288,55 +199,34 @@
<!-- 去支付的固定按钮 -->
<view class="order_pay_but">
<view class="price_">
<text class="text-32" style="color: #999; font-weight: 400"
>共
<text class="text-32" style="color: #999; font-weight: 400">共
<text>{{ totleNum }}</text>
件
</text>
¥<text style="font-size: 60rpx">{{ orderInfo.amount }}</text></view
>
¥<text style="font-size: 60rpx">{{ orderInfo.amount }}</text>
</view>
<view class="_but" @click="goPay">支付</view>
</view>
<!-- 选择支付方式 -->
<up-popup
v-model:show="wayShow"
:round="10"
:closeOnClickOverlay="false"
:closeable="true"
:safeAreaInsetBottom="false"
>
<up-popup v-model:show="wayShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
:safeAreaInsetBottom="false">
<view class="way_popup_warp">
<view class="way_popup_title">支付方式</view>
<up-radio-group v-model="orderInfo.paymentMethod" placement="column">
<view
v-for="item in wayOption"
:key="item.id"
style="margin-bottom: 10rpx"
>
<view v-for="item in wayOption" :key="item.id" style="margin-bottom: 10rpx">
<view class="way_item">
<view class="way_item_">
<view class="way_item_val"
>{{ item.name
}}<text v-if="item.balance"
>&nbsp;&nbsp;({{ item.balance }})</text
>
<view class="way_item_val">{{ item.name
}}<text v-if="item.balance">&nbsp;&nbsp;({{ item.balance }})</text>
</view>
</view>
<view
v-if="item.type === 'balance' && isShowBalance"
class="go_balance_comm_warp"
@click="goRechargeFun(item)"
>去充值</view
>
<view v-if="item.type === 'balance' && isShowBalance" class="go_balance_comm_warp"
@click="goRechargeFun(item)">去充值</view>
<up-radio v-else :name="item.type" activeColor="#03AD27">
</up-radio>
</view>
<view
class="balance_comm_msg"
v-if="item.type === 'balance' && isShowBalance"
>当前现金余额不足,如需支付请前往充值</view
>
<view class="balance_comm_msg" v-if="item.type === 'balance' && isShowBalance">当前现金余额不足,如需支付请前往充值</view>
</view>
</up-radio-group>
<view class="popup_but" @click="wayShow = false"> 确认 </view>
@@ -344,68 +234,38 @@
</up-popup>
<!-- 选择地址 -->
<up-popup
v-model:show="addressShow"
:round="10"
:closeOnClickOverlay="false"
:closeable="true"
:safeAreaInsetBottom="false"
@close="checkAddressShow(false, null, 0, 0)"
>
<up-popup v-model:show="addressShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
:safeAreaInsetBottom="false" @close="checkAddressShow(false, null, 0, 0)">
<view class="address_popup_warp">
<view class="address_popup_title">收件地址</view>
<view class="address_popup_content">
<view class="address_popup_content_add" @click="addAdress">
+ 新增地址</view
>
+ 新增地址</view>
<Address @valueFunc="getAddressValueFunc" />
</view>
<view class="popup_but" @click="addressOk"> 确认 </view>
</view>
</up-popup>
<u-modal
:show="tipsShow"
title="提示"
showCancelButton
@cancel="onCancel"
@confirm="onConfirm"
:cancelText="type == 1 ? '取消' : '忘记密码'"
:confirmText="type == 1 ? '去设置' : '重试'"
confirmColor="#7934F6"
:content="content"
></u-modal>
<u-modal :show="tipsShow" title="提示" showCancelButton @cancel="onCancel" @confirm="onConfirm"
:cancelText="type == 1 ? '取消' : '忘记密码'" :confirmText="type == 1 ? '去设置' : '重试'" confirmColor="#7934F6"
:content="content"></u-modal>
<u-keyboard
ref="uKeyboard"
mode="number"
:show="show"
@change="onChange"
@backspace="onBackspace"
:dotDisabled="true"
:tooltip="false"
>
<u-keyboard ref="uKeyboard" mode="number" :show="show" @change="onChange" @backspace="onBackspace"
:dotDisabled="true" :tooltip="false">
<view style="background-color: #fff">
<view class="money">
<text style="color: #000; position: relative; top: 40rpx">
<text style="font-size: 48rpx">¥</text>{{ orderInfo.amount }}</text
>
<text style="font-size: 48rpx">¥</text>{{ orderInfo.amount }}</text>
<text class="text-40" style="margin-left: 20rpx"></text>
<view class="text-28 close" data-flag="false" @tap="showPop(false)">
<u-icon name="close" color="#333333" size="20"></u-icon>
</view>
</view>
<view class="mid-tips">
<u-code-input
v-model="password"
:dot="true"
borderColor="#EAEAEA"
:maxlength="6"
@finish="finish"
></u-code-input>
<u-code-input v-model="password" :dot="true" borderColor="#EAEAEA" :maxlength="6"
@finish="finish"></u-code-input>
</view>
<view class="tips text-28" style="color: #999; display: inline-block"
>请输入支付密码</view
>
<view class="tips text-28" style="color: #999; display: inline-block">请输入支付密码</view>
</view>
</u-keyboard>
@@ -465,7 +325,9 @@ export default {
}
return num;
},
},
components: {
Address,
Header,
@@ -493,7 +355,7 @@ export default {
selectAddress: {}, // 收件地址选择
wayOption: [],
isShowBalance: false,
ji: 0,
isPoints: 0, // 是否积分积分支付
sed: null,
curPay: null,
user: null,
@@ -501,6 +363,11 @@ export default {
content: "您未设置支付密码,请先去设置支付密码",
type: "1",
defaultAddress: "",
isCoupon: false, // 是否优惠卷
couponData: {}, // 优惠卷数据
allOrderInfo: {}, // 所有订单信息
buyCouponvalue: 0, // 实付抵扣券积分
buyCouponAmount: 0, // 实付抵扣券对应的钱
};
},
async onLoad(option) {
@@ -509,8 +376,12 @@ export default {
if (option.address) {
this.defaultAddress = option.address;
}
console.log('-------', option.isCoupon)
if (option.isCoupon) {
this.isCoupon = option.isCoupon;
}
if (option.sed) {
this.ji = 1;
this.isPoints = 1;
this.sed = JSON.parse(option.sed);
await this.addressList();
// console.log('addressListOne',this.addressListOne)
@@ -520,7 +391,6 @@ export default {
this.getOrderTwo();
}
if (option.ids) {
this.ids = option.ids;
this.getOrder();
@@ -545,6 +415,15 @@ export default {
methods: {
getValue,
assembleAddress,
// 实付抵扣券
onBuyCouponvalue(currentQuantity) {
this.buyCouponvalue = Number((this.allOrderInfo.buyDeductionValue * (currentQuantity || 1)).toFixed(2)) || 0;
},
// 实付抵扣券对应的钱
onBuyCouponAmount() {
this.buyCouponAmount = Number((this.sed.goodsNum * this.allOrderInfo.buyDeduction).toFixed(2)) || 0;
},
async addressList() {
const res = await getAddress();
if (res && res.bizcode === 100) {
@@ -618,18 +497,24 @@ export default {
},
async getWayOption() {
let parmas = {};
if (this.ji) {
if (this.isPoints) {
parmas["types"] = "4";
} else {
parmas["types"] = "1,2,3";
}
console.log('parmas-----', this.isCoupon)
if (this.isCoupon) {
parmas["types"] = "1,2,3";
parmas.isDeduction = true;
}
const result = await getSupportPay(parmas);
if (result && result.bizcode === 100) {
const data = result.data || [];
const amount = this.orderInfo.amount;
let flag = data.some((item) =>
["wechat", "alipay"].includes(item.type)
);
// const amount = this.orderInfo.amount;
// let flag = data.some((item) =>
// ["wechat", "alipay"].includes(item.type)
// );
// 没有支付宝和微信支付
// if (flag) {
// this.isShowBalance = false;
@@ -637,8 +522,9 @@ export default {
// const balanceFlag = data.some(item => item.type === "balance" && item.balance < amount);
// this.isShowBalance = balanceFlag;
// }
this.wayOption = data;
console.log("getWayOption", this.wayOption);
this.wayOption = data.filter(item => item.type !== "vcoin");
this.couponData = data.filter(item => item.type === "vcoin")[0] || {};
console.log("getWayOption", this.wayOption, this.couponData);
}
},
async getOrder() {
@@ -697,10 +583,13 @@ export default {
const params = {
id: this.sed.id,
};
if(this.isCoupon){
params.type = -1;
}
const resp = await getGoodsDetail(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
this.ji = data.type == 3 ? 1 : 0;
this.isPoints = data.type == 3 ? 1 : 0;
this.orderInfo = {
address: null,
amount: this.sed.goodsNum * this.sed.specsId.price,
@@ -752,7 +641,10 @@ export default {
if (!this.orderInfo.address && this.addressListOne && this.addressListOne.length) {
this.orderInfo.address = this.addressListOne[0];
}
this.allOrderInfo = data;
this.orderInfo.paymentMethod = null;
this.onBuyCouponvalue(this.sed.goodsNum || 1);
this.onBuyCouponAmount();
// if(this.addressListOne && this.addressListOne.length){
// this.orderInfo.address = this.addressListOne[0];
// }
@@ -828,6 +720,11 @@ export default {
].totalPrice = currentTotalPrice.toFixed(2);
this.orderInfo.amount = currentAmount.toFixed(2);
if (this.isCoupon || this.sed) {
this.onBuyCouponvalue(currentQuantity);
this.onBuyCouponAmount();
return;
}
const resp = await getSettleList({ cartIds: this.ids });
if (resp && resp.bizcode === 100) {
@@ -915,8 +812,18 @@ export default {
return (this.tipsShow = true);
}
console.log("orderInfo----", arr);
if (arr.length) {
if (arr[0].type == "balance" || arr[0].type == "redpacket") {
if (this.isCoupon) {
if (this.buyCouponvalue > this.couponData.balance) {
this.$refs.uToastRef.show({
type: "error",
message: "您当前优惠券金额不足",
});
return;
}
this.show = true;
} else if (arr[0].type == "balance" || arr[0].type == "redpacket") {
this.show = true;
} else {
this.passPay();
@@ -933,16 +840,20 @@ export default {
remark: JSON.stringify(this.getRemark()), //备注信息'[{"sid":"店铺ID","rmk":"备注内容"},{"sid":"店铺ID","rmk":"备注内容"}]'
};
let resp = null;
console.log("orderInfo----", this.sed);
if (this.sed) {
if (
this.orderInfo.paymentMethod == "balance" ||
this.orderInfo.paymentMethod == "redpacket"
this.orderInfo.paymentMethod == "redpacket" ||
this.isCoupon
) {
params["password"] = CryptoJS.MD5(this.payPwd).toString();
}
params["goodsId"] = this.sed.id;
params["specsId"] = this.sed.specsId.id;
params["goodsNum"] = this.orderInfo.shops[0].addrTimes[0].goods[0].num;
if (this.isCoupon) params.payway2 = 'vcoin';
resp = await settlementOrder(params);
} else {
params["cartIds"] = this.ids;
@@ -1086,6 +997,7 @@ export default {
background-color: #fff;
border-radius: 16rpx;
margin-top: 24rpx;
.price-view-two {
width: 100%;
height: 108rpx;
@@ -1094,11 +1006,13 @@ export default {
justify-content: flex-end;
align-items: center;
}
.price-line {
width: 100%;
min-height: 1rpx;
background-color: #ececec;
}
.price-view {
width: 100%;
height: 72rpx;
@@ -1106,6 +1020,7 @@ export default {
flex-direction: row;
justify-content: space-between;
}
.way-option {
height: 112rpx;
width: 100%;
@@ -1114,11 +1029,13 @@ export default {
align-items: center;
border-bottom: 1rpx solid #ececec;
justify-content: space-between;
.way-option-item {
height: 112rpx;
display: flex;
flex-direction: row;
align-items: center;
image {
width: 48rpx;
height: 48rpx;
@@ -1126,6 +1043,7 @@ export default {
}
}
}
.money {
text-align: center;
font-size: 68rpx;
@@ -1133,6 +1051,7 @@ export default {
position: relative;
background-color: #fff;
height: 180rpx;
.close {
position: absolute;
top: 20rpx;
@@ -1141,12 +1060,14 @@ export default {
font-size: 28rpx;
}
}
.mid-tips {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.tips {
color: $u-tips-color;
margin: 20rpx 0;
@@ -1154,6 +1075,7 @@ export default {
background-color: #fff;
width: 100%;
}
.order_submit_warp {
background-color: $app-bj;
height: calc(100vh - 200rpx);
@@ -1276,8 +1198,7 @@ export default {
width: calc(100% - 160rpx);
}
.content_info_left_total {
}
.content_info_left_total {}
.content_info_title {
width: 460rpx;
@@ -114,6 +114,7 @@ export default {
const city = province && province.length !== 0 ? await this.getRegion(province[0].id) : [];
const area = city && city.length !== 0 ? await this.getRegion(city[0].id) : [];
this.regionColumns = [nation, province, city, area];
console.log("我是秦星星regionColumns", this.regionColumns);
} else {
this.regionColumns = [[], [], [], []];
}
@@ -150,6 +151,7 @@ export default {
picker
} = e;
const selectData = this.regionColumns[columnIndex][index];
if (!selectData) return;
const resultData = await this.getRegion(selectData.id);
if (resultData && resultData.length !== 0) {
const index = columnIndex + 1;
@@ -174,6 +176,7 @@ export default {
}
})
this.form.regionStr = regionStr;
console.log("我是秦星星regionStr", regionStr,regionId);
if (regionId && regionId.length !== 0) {
this.form.countryId = regionId[0] ? regionId[0] : null;
this.form.provinceId = regionId[1] ? regionId[1] : null;
@@ -225,7 +228,9 @@ export default {
if (!params.areaId || params.areaId === 0) {
delete params.areaId;
}
console.log("params", params,selectAddress);
delete params.regionStr;
delete params.id;
const res = await editAddress(params);
if (res && res.bizcode === 100) {
const goodsParams = {
@@ -254,6 +259,7 @@ export default {
// 地址选中
getAddressValueFunc(item) {
this.selectAddress = item;
console.log("地址选中item", item);
},
// 地址选中OK
addressOk() {
+142 -234
View File
@@ -3,73 +3,52 @@
<!-- <image v-if="tmpImg" :src="tmpImg" style="width:620rpx;height:960rpx"></image> -->
<!-- 头部产品描述图 -->
<view class="product_info_header_warp">
<up-swiper
:list="swiperList"
class="product_info_header_swiper"
@click="onSwiper"
@change="(e) => (currentNum = e.current)"
>
<up-swiper :list="swiperList" class="product_info_header_swiper" @click="onSwiper"
@change="(e) => (currentNum = e.current)">
<template #indicator>
<view class="indicator-num">
<text class="indicator-num__text"
>{{ currentNum + 1 }}/{{ swiperList.length }}</text
>
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ swiperList.length }}</text>
</view>
</template>
</up-swiper>
<view class="img_comm left_warp">
<up-image
src="/static/common/left_b_st.png"
width="30"
height="30"
bgColor="#f1f6ff00"
v-if="!isShareUrl"
@click="jumpLeft"
></up-image>
<up-image src="/static/common/left_b_st.png" width="30" height="30" bgColor="#f1f6ff00" v-if="!isShareUrl"
@click="jumpLeft"></up-image>
</view>
<view class="img_comm right_warp">
<up-image
v-if="!isShareUrl"
src="/static/common/share_st.png"
width="30"
height="30"
bgColor="#f1f6ff00"
@click="jumpShare"
></up-image>
<up-image v-if="!isShareUrl" src="/static/common/share_st.png" width="30" height="30" bgColor="#f1f6ff00"
@click="jumpShare"></up-image>
</view>
</view>
<!-- 数据详情 -->
<view class="product_content_warp">
<!-- 标题,系列 -->
<view class="content_data">
<view
style="
<view style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<view class="content_data_price">
">
<view class="content_data_price buy_deduction" v-if="orderInfo.buyDeductionValue">
<view class="buy_deduction_value">
<text class="text-38 text-bold mr-10">{{ orderInfo.buyDeductionValue }}抵扣券</text>
<text class="text-24">+{{ orderInfo.minPrice }}元</text>
</view>
<view class="buy_deduction_label">
兑后抵扣券不退
</view>
</view>
<view class="content_data_price" v-else>
<text>¥</text>
<text
style="font-size: 60rpx"
v-if="orderInfo.minPrice && orderInfo.maxPrice"
>{{ orderInfo.minPrice }} - {{ orderInfo.maxPrice }}</text
>
<text style="font-size: 60rpx" v-if="orderInfo.minPrice && orderInfo.maxPrice">{{ orderInfo.minPrice }} - {{
orderInfo.maxPrice }}</text>
<text style="font-size: 60rpx" v-else>{{
orderInfo.minPrice
}}</text>
<text class="price_o">¥{{ orderInfo.adPrice }}</text>
</view>
<view
class="text-24"
style="color: #ff5a5a; width: 120rpx; height: 38rpx"
v-if="orderInfo.tag"
>
<image
src="/static/shopping/tg.png"
style="width: 120rpx; height: 38rpx"
></image>
<view class="text-24" style="color: #ff5a5a; width: 120rpx; height: 38rpx" v-if="orderInfo.tag">
<image src="/static/shopping/tg.png" style="width: 120rpx; height: 38rpx"></image>
</view>
</view>
<view class="content_data_title">
@@ -85,34 +64,21 @@
<!-- 具体规格 -->
<view class="content_concrete">
<view
class="concrete_item concrete_item_but"
@click="checkSpecification(true, 'n')"
>
<view class="concrete_item concrete_item_but" @click="checkSpecification(true, 'n')">
<view class="concrete_item_">
<view class="concrete_item_title">规格</view>
<view class="concrete_item_value">
{{ selectSpecificationTempl.combTypes || "暂未选择规格" }}
</view>
</view>
<up-image
src="/static/common/right.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="concrete_item">
<view class="concrete_item_">
<view class="concrete_item_title">收货地址</view>
<view class="concrete_item_value" @click="jumpAddAddress">
<view class="address_warp" v-if="!adressInfo">
<up-image
src="/static/common/address2.png"
width="10"
height="10"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/address2.png" width="10" height="10" bgColor="#f1f6ff00"></up-image>
<view style="margin-left: 10rpx">请填写地址</view>
</view>
<view class="address_warp" v-else>{{ adressInfo }}</view>
@@ -138,21 +104,11 @@
<view class="concrete_item_title">购物保障</view>
<view class="concrete_item_value concrete_item_bz">
<view class="concrete_item_bz concrete_item_bz_item">
<up-image
src="/static/product/product_b.png"
width="10"
height="12"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/product/product_b.png" width="10" height="12" bgColor="#f1f6ff00"></up-image>
<view class="concrete_item_bz_item_left">品质严保</view>
</view>
<view class="concrete_item_bz">
<up-image
src="/static/product/product_js.png"
width="10"
height="10"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/product/product_js.png" width="10" height="10" bgColor="#f1f6ff00"></up-image>
<view class="concrete_item_bz_item_left">极速退款</view>
</view>
</view>
@@ -163,9 +119,7 @@
<view class="tui-view">
<text class="text-32 text-zu">退货提示</text>
<text class="text-28 text-fu1"
>拆封后影响品质”或“影响二次销售的”不予退货。</text
>
<text class="text-28 text-fu1">拆封后影响品质”或“影响二次销售的”不予退货。</text>
<view class="tui-list">
<view class="tui-box" :key="index" v-for="(item, index) in tuiList">
<image :src="`/static/new/tui_${index}.png`"></image>
@@ -186,67 +140,35 @@
<view class="product_but_warp">
<view class="product_but_left">
<view class="left_item">
<up-image
src="/static/product/home.png"
width="20"
height="20"
bgColor="#f1f6ff00"
@click="jumpOther('home')"
></up-image>
<up-image src="/static/product/home.png" width="20" height="20" bgColor="#f1f6ff00"
@click="jumpOther('home')"></up-image>
<view>首页</view>
</view>
<view class="left_item">
<up-image
src="/static/product/kefu.png"
width="20"
height="20"
bgColor="#f1f6ff00"
@click="onZiXun"
></up-image>
<up-image src="/static/product/kefu.png" width="20" height="20" bgColor="#f1f6ff00"
@click="onZiXun"></up-image>
<view>咨询</view>
</view>
<view class="left_item" v-if="!ji">
<up-image
src="/static/product/cart.png"
width="24"
height="20"
bgColor="#f1f6ff00"
@click="jumpOther('cart')"
></up-image>
<view class="left_item" v-if="!isShowCart && !isCoupon">
<up-image src="/static/product/cart.png" width="24" height="20" bgColor="#f1f6ff00"
@click="jumpOther('cart')"></up-image>
<view>购物车</view>
</view>
</view>
<view class="product_but_right" v-if="!isShareUrl">
<view
v-if="!ji"
class="but_comm join_warp"
@click="checkSpecification(true, 'addCart')"
>加入购物车</view
>
<view
class="but_comm buy_warp"
:class="{ 'border-16': ji }"
@click="checkSpecification(true, 'buy')"
>立即购买</view
>
<view v-if="!isShowCart && !isCoupon" class="but_comm join_warp" @click="checkSpecification(true, 'addCart')">
加入购物车
</view>
<MyBtn
v-if="isShareUrl"
mh="88rpx"
text="打开APP"
wd="200rpx"
@ok="onOpenApp"
></MyBtn>
<view class="but_comm buy_warp" :class="{ 'border-16': isShowCart || isCoupon }"
@click="checkSpecification(true, 'buy')">
立即购买
</view>
</view>
<MyBtn v-if="isShareUrl" mh="88rpx" text="打开APP" wd="200rpx" @ok="onOpenApp"></MyBtn>
</view>
<!-- 选择规格的弹框 -->
<up-popup
:show="specificationShow"
:round="10"
:closeOnClickOverlay="false"
:closeable="true"
@close="specificationShow = false"
mode="bottom"
>
<up-popup :show="specificationShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
@close="specificationShow = false" mode="bottom">
<view class="specification_warp">
<!-- 选择地址 -->
<view class="specification_adress_warp">
@@ -263,43 +185,36 @@
</view>
<!-- 商品 -->
<view class="specification_product_warp">
<up-image
:src="orderInfo.mainGraph"
width="100"
height="100"
bgColor="#f1f6ff00"
></up-image>
<up-image :src="orderInfo.mainGraph" width="100" height="100" bgColor="#f1f6ff00"></up-image>
<view class="product_content">
<view class="price_warp">
<view class="price_content_warp">
<!-- 优惠券价格 -->
<view class="price_content_warp" v-if="isCoupon">
<text class="text-38 text-bold mr-10">{{ orderInfo.buyDeductionValue }}抵扣券</text>
<text class="text-24" v-if="
selectSpecificationTempl &&
Object.keys(selectSpecificationTempl).length !== 0">+{{ selectSpecificationTempl.price }}元</text>
<text v-else>+{{ orderInfo.minPrice }}元</text>
</view>
<view class="price_content_warp" v-else>
<view>¥</view>
<text
style="font-size: 50rpx"
v-if="
<text style="font-size: 50rpx" v-if="
selectSpecificationTempl &&
Object.keys(selectSpecificationTempl).length !== 0
"
>
">
{{ selectSpecificationTempl.price }}
</text>
<view style="font-size: 50rpx" v-else>
{{ orderInfo.minPrice }}
<text v-if="orderInfo.maxPrice"
>- {{ orderInfo.maxPrice }}</text
>
<text v-if="orderInfo.maxPrice">- {{ orderInfo.maxPrice }}</text>
</view>
<view
class="price_content_coupon_warp"
v-if="orderInfo.couponPrice && orderInfo.couponPrice !== 0"
>优惠卷{{ orderInfo.couponPrice }}</view
>
<view class="price_content_coupon_warp" v-if="orderInfo.couponPrice && orderInfo.couponPrice !== 0">
优惠券{{
orderInfo.couponPrice }}</view>
</view>
<view class="oOrice_content_warp">¥{{ orderInfo.adPrice }}</view>
<view
class="coupon_content_warp"
v-if="orderInfo.couponPrice && orderInfo.couponPrice !== 0"
>优惠卷已优惠¥{{ orderInfo.couponPrice }}</view
>
<view class="oOrice_content_warp" v-if="!isCoupon">¥{{ orderInfo.adPrice }}</view>
<view class="coupon_content_warp" v-if="orderInfo.couponPrice && orderInfo.couponPrice !== 0">优惠卷已优惠¥{{
orderInfo.couponPrice }}</view>
</view>
<view class="inventory_warp">
<view>库存</view>
@@ -310,25 +225,16 @@
<!-- 规格 -->
<view class="specification_list_warp">
<view
v-for="(item, index) in specificationList"
:key="item.id"
class="list_warp"
>
<view v-for="(item, index) in specificationList" :key="item.id" class="list_warp">
<view class="list_title_warp">{{ item.type }}</view>
<view class="specification_item_warp">
<view
:class="
oItem.inventory === 0
<view :class="oItem.inventory === 0
? 'item_Warp item_Warp_no_warp'
: item.selectVal === oItem.n
? 'item_Warp item_Warp_yes_warp'
: 'item_Warp'
"
v-for="(oItem, oIndex) in item.items"
:key="oItem.n"
@click="clickSpecification(oIndex, item, oItem)"
>
" v-for="(oItem, oIndex) in item.items" :key="oItem.n"
@click="clickSpecification(oIndex, item, oItem)">
{{ oItem.n }}
</view>
</view>
@@ -344,26 +250,14 @@
<view class="quantity_but" @click="quantityFun('add')">+</view>
</view>
</view>
<view
v-if="specificationShowType === 'buy'"
class="specification_buy_but"
@click="addCart(true)"
>去支付</view
>
<view
v-else-if="specificationShowType === 'addCart'"
class="specification_buy_but"
@click="addCart(false)"
>加入购物车</view
>
<view v-if="specificationShowType === 'buy'" class="specification_buy_but" @click="addCart(true)">去支付</view>
<view v-else-if="specificationShowType === 'addCart'" class="specification_buy_but" @click="addCart(false)">
加入购物车
</view>
<view v-else class="product_but_right popup_buts">
<view class="but_comm join_warp" @click="addCart(false)"
>加入购物车</view
>
<view class="but_comm buy_warp" @click="addCart(true)"
>立即购买</view
>
<view class="but_comm join_warp" @click="addCart(false)">加入购物车</view>
<view class="but_comm buy_warp" @click="addCart(true)">立即购买</view>
</view>
</view>
</view>
@@ -372,12 +266,7 @@
<up-modal :show="serviceShow" :showConfirmButton="false">
<view class="slot-content">
<view class="close_warp" @click="serviceShow = false">
<up-image
src="/static/common/close.png"
width="20"
height="20"
bgColor="#f1f6ff00"
></up-image>
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">{{
@@ -390,17 +279,13 @@
}}</view>
</view>
<view class="but_">
<view
class="but_copy"
@click="
<view class="but_copy" @click="
copyMobile(
source === 'supply_chain'
? CLOUD_SERVICE_PHONE_NUMBER
: CUSTOMER_SERVICE_PHONE_NUMBER
)
"
>复制号码</view
>
">复制号码</view>
<view class="but_close" @click="serviceShow = false">取消</view>
</view>
</view>
@@ -411,61 +296,36 @@
<view class="uni-banner">
<view class="banner_box">
<view class="title_">温馨提示</view>
<view class="msg_"
>该商家暂未开通供应链权限,请联系供应链客服开通授权。</view
>
<view class="msg_">该商家暂未开通供应链权限,请联系供应链客服开通授权。</view>
<view class="phone_">{{ CLOUD_SERVICE_PHONE_NUMBER }}</view>
<view class="but_">
<view
class="but_b"
@click="copyMobile(CLOUD_SERVICE_PHONE_NUMBER)"
>立即联系</view
>
<view class="but_b" @click="copyMobile(CLOUD_SERVICE_PHONE_NUMBER)">立即联系</view>
</view>
</view>
</view>
</view>
</up-overlay>
<!-- 选择地址 -->
<up-popup
v-model:show="addressShow"
:round="10"
:closeOnClickOverlay="false"
:closeable="true"
:safeAreaInsetBottom="false"
@close="checkAddressShow(false, null, 0, 0)"
>
<up-popup v-model:show="addressShow" :round="10" :closeOnClickOverlay="false" :closeable="true"
:safeAreaInsetBottom="false" @close="checkAddressShow(false, null, 0, 0)">
<view class="address_popup_warp">
<view class="address_popup_title">收件地址</view>
<view class="address_popup_content">
<view class="address_popup_content_add" @click="addAdress">
+ 新增地址</view
>
+ 新增地址</view>
<Address @valueFunc="getAddressValueFunc" />
</view>
<view class="popup_but" @click="addressOk"> 确认 </view>
</view>
</up-popup>
<SharePopup
ref="share"
v-if="shareOpen"
:show="shareShow"
@close="onClose"
@share="onShare"
:id="id"
:text="orderInfo.name ? orderInfo.name : ''"
:price="orderInfo.minPrice ? orderInfo.minPrice : ''"
:tu="swiperList.length && swiperList[0]"
></SharePopup>
<SharePopup ref="share" v-if="shareOpen" :show="shareShow" @close="onClose" @share="onShare" :id="id"
:text="orderInfo.name ? orderInfo.name : ''" :price="orderInfo.minPrice ? orderInfo.minPrice : ''"
:tu="swiperList.length && swiperList[0]"></SharePopup>
<view class="hideCanvasView">
<canvas
id="myCanvas"
canvas-id="myCanvas"
:style="{
<canvas id="myCanvas" canvas-id="myCanvas" :style="{
height: bgObj.height + 'px',
width: bgObj.width + 'px',
}"
></canvas>
}"></canvas>
</view>
</view>
</template>
@@ -526,7 +386,7 @@ export default {
serviceShow: false, // 联系客服弹框
openShow: false,
source: null, // 来源:供应链,自营
ji: 0,
isShowCart: 0,
selectAddress: {}, // 选择的地址
postage: null, // 邮费
adressInfo: "",
@@ -542,6 +402,8 @@ export default {
tmpImg: "",
isShareUrl: false,
isSplash: false,
isCoupon: false, // 是否是优惠券商品
curAmount: 0, // 当前人剩余优惠券金额
};
},
onBackPress(options) {
@@ -557,6 +419,10 @@ export default {
},
onLoad(options) {
const id = options.id;
this.isCoupon = options.isPar;
if (this.isCoupon && options.curAmount) {
this.curAmount = options.curAmount;
}
const source = options.source;
this.isSplash = options.isSplash;
console.log("isSplash", this.isSplash == "true");
@@ -965,10 +831,13 @@ export default {
const params = {
id: this.id,
};
if(this.isCoupon){
params.type = -1;
}
const resp = await getGoodsDetail(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
this.ji = data.type == 3 ? 1 : 0;
this.isShowCart = data.type == 3 ? 1 : 0;
// 商品图
if (data.goodsGraph) {
this.swiperList = data.goodsGraph.split(",");
@@ -1034,7 +903,7 @@ export default {
return;
}
const source = this.source;
if (type == "n" && this.ji == 1) {
if (type == "n" && (this.isShowCart == 1 || this.isCoupon)) {
type = "buy";
}
console.log("afsdfsd", source, type);
@@ -1075,6 +944,9 @@ export default {
const params = {
id: this.id,
};
if(this.isCoupon){
params.type = -1;
}
const resp = await getGoodsSpecs(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
@@ -1189,12 +1061,24 @@ export default {
goodsNum: this.orderInfo.quantity, // 商品数量
};
console.log("selectTempl", selectTempl);
if (this.ji == 1) {
if (this.isShowCart == 1 || this.isCoupon) {
params["specsId"] = selectTempl;
console.log("----------", params, this.isCoupon, this.orderInfo.buyDeductionValue, this.orderInfo.quantity, this.curAmount);
const buyCouponvalue = Number((this.orderInfo.buyDeduction * (this.orderInfo.quantity || 1)).toFixed(2)) || 0;
if (this.isCoupon && buyCouponvalue > this.curAmount) {
uni.showToast({
title: `您当前优惠券金额不足`,
icon: "none", // 可选 success/loading/none
duration: 2000, // 持续时长,单位ms
});
return;
}
uni.navigateTo({
url: `/pages/order_package/order_submit/order_submit?sed=${JSON.stringify(
params
)}&address=${this.selectAddress?.id}`,
)}&address=${this.selectAddress?.id}&isCoupon=${this.isCoupon}`,
});
return;
}
@@ -1308,6 +1192,24 @@ export default {
text-decoration-line: line-through;
margin-left: 10rpx;
}
&.buy_deduction {
width: 100%;
display: flex;
justify-content: space-between;
.buy_deduction_value {
font-weight: 500;
font-size: 26rpx;
color: #7A35F6;
margin-left: 10rpx;
}
.buy_deduction_label {
font-size: 24rpx;
color: #E88900;
}
}
}
.content_data_title {
@@ -1338,6 +1240,7 @@ export default {
padding: 32rpx;
box-sizing: border-box;
margin-top: 24rpx;
.tui-list {
width: 100%;
height: 104rpx;
@@ -1347,6 +1250,7 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: 24rpx;
.tui-box {
width: 64rpx;
min-height: 100%;
@@ -1354,6 +1258,7 @@ export default {
flex-direction: column;
align-items: center;
justify-content: space-between;
image {
width: 64rpx;
height: 64rpx;
@@ -1536,7 +1441,7 @@ export default {
.product_content {
margin-left: 10rpx;
display: grid;
// display: grid;
}
.price_content_warp {
@@ -1578,6 +1483,7 @@ export default {
font-weight: 500;
font-size: 24rpx;
color: #808080;
margin-top: 16rpx;
}
}
@@ -1668,6 +1574,7 @@ export default {
}
.open_Show {
/* 弹出层形式的广告 */
.uni-banner {
display: flex;
@@ -1731,6 +1638,7 @@ export default {
}
}
}
.hideCanvasView {
width: 100%;
height: 100%;
-116
View File
@@ -1,116 +0,0 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header :title="name" >
<!-- #ifndef MP-WEIXIN -->
<template v-slot:right>
<u-icon name="share-fill" @click="onShare" color="#333" size="24"></u-icon>
</template>
<!-- #endif -->
</Header>
<view class="setting-view">
<view class="name-box">
<PingItem @ok="onJumpShop" style="margin-top:24rpx" :obj="item" v-for="(item,index) in dataList" :key="index"></PingItem>
</view>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import MyBtn from '@/components/common/my-btn.vue'
import { searchList } from '@/api/product.js';
import { getCascadeCategory } from '@/api/common.js';
import PingItem from "@/components/shop/ping-item.vue";
import func from '@/utils/func.js';
export default {
components: { Header, TopSafe,MyBtn,PingItem },
data() {
return {
dataList:[
],
name:null,
id:0
};
},
onShow() {
},
onLoad(option) {
if(option && option.id){
this.id = Number(option.id);
this.name = option.name;
this.init();
}
},
methods: {
init() {
this.getSearchList();
},
async getSearchList(){
const params = {
page: 1,
pageSize: 99,
categoryId:this.id
}
const resp = await searchList(params);
if(resp && resp.bizcode === 100){
this.dataList = resp.data || [];
}
},
onJumpShop(id){
uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id='+id,
})
},
onShare(){
uni.navigateTo({
url: '/pages/other_package/invite_friends/invite_friends',
})
}
}
}
</script>
<style lang="scss" scoped>
.bottom-btn{
width: 100%;
margin-bottom:92rpx;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
}
.setting-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
.name-box {
width: 100%;
border-radius: 16rpx;
height: 100%;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: flex-start;
box-sizing: border-box;
}
}
</style>
-173
View File
@@ -1,173 +0,0 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="信任桥优选专区" >
<!-- #ifndef MP-WEIXIN -->
<template v-slot:right>
<u-icon name="share-fill" @click="onShare" color="#333" size="24"></u-icon>
</template>
<!-- #endif -->
</Header>
<view class="swiper-view">
<up-swiper
:list="swiperList"
style="width:100%"
circular
></up-swiper>
</view>
<view class="mid-panel">
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
<view style="margin:0 12rpx">信任桥优选</view>
<up-image src="/static/common/jingxuan_right.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
</view>
<view class="setting-view">
<YouItem @ok="onJumpShop" style="margin-bottom:24rpx" :obj="item" v-for="(item,index) in dataList" :key="index"></YouItem>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import MyBtn from '@/components/common/my-btn.vue'
import YouItem from '@/components/shop/you-item.vue'
import { searchList } from '@/api/product.js';
import { getCarouselImage } from '@/api/common.js';
export default {
components: { Header, TopSafe,MyBtn,YouItem },
data() {
return {
dataList:[
],
swiperList: ['https://cdn.uviewui.com/uview/swiper/swiper1.png'],
};
},
onShow() {
},
onLoad() {
this.init();
this.getCarouselImage();
},
methods: {
init() {
this.getSearchList();
},
async getSearchList(){
const params = {
type:1,
page:1,
pageSize:99,
}
const resp = await searchList(params);
if(resp && resp.bizcode === 100){
this.dataList = resp.data || [];
}
},
async getCarouselImage(){
const params={
pageUi:4,
}
const resp = await getCarouselImage(params);
if(resp && resp.bizcode === 100){
const data = resp.data || [];
this.swiperList = data.length !== 0 ? data.map(obj=>obj.carouselImage) : [];
}
},
onJumpShop(id){
uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id='+id,
})
},
onShare(){
uni.navigateTo({
url: '/pages/other_package/invite_friends/invite_friends',
})
}
}
}
</script>
<style lang="scss" scoped>
.bottom-btn{
width: 100%;
margin-bottom:92rpx;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
}
.mid-panel{
width:100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height:120rpx;
min-height:120rpx;
}
.swiper-view{
width:100%;
height:268rpx;
min-height:268rpx;
display: flex;
}
.setting-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
.name-box{
width:100%;
border-radius: 16rpx;
display: flex;
flex-direction: column;
background-color: #fff;
padding: 64rpx 32rpx;
box-sizing: border-box;
margin-top:24rpx;
.mid-view{
width:100%;
padding: 40rpx 32rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
border:2rpx solid #eaeaea;
border-radius: 16rpx;
margin-top:48rpx;
}
.top-view{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
}
.input-view{
border-radius: 20rpx;
margin-top:52rpx;
width:100%;
padding: 0 32rpx;
min-height:104rpx;
display: flex;
flex-direction: row;
align-items: center;
background-color: #f5f5f5;
box-sizing: border-box;
}
}
}
</style>
+164 -87
View File
@@ -1,29 +1,39 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="兑换券专区" >
<Header :isBack="false">
<!-- #ifndef MP-WEIXIN -->
<template v-slot:right>
<u-icon name="share-fill" @click="onShare" color="#333" size="24"></u-icon>
<template v-slot:left>
<u-icon size="36rpx" name="arrow-left" color="#000" @click="goback"></u-icon>
抵扣券专区: {{ balanceData.curAmount || 0 }}
</template>
<!-- #endif -->
</Header>
<view class="swiper-view">
<up-swiper
:list="swiperList"
style="width:100%"
circular
></up-swiper>
<view :class="['swiper-item', { 'active': currentItem === item.key }]" v-for="(item, index) in swiperList"
:key="index" @click="onClickItem(item)">
<view class="swiper-item-content">{{ item.label }}</view>
</view>
</view>
<view class="mid-panel">
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
<view style="margin:0 12rpx">信任桥兑换</view>
<up-image src="/static/common/jingxuan_right.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
<view class="name-box">
<mescroll-uni ref="mescrollRef" @down="downCallback" @up="upCallback" :up="upOption" :down="downOption"
@init="mescrollInit" :fixed="false">
<!-- 原来单个 v-for 替换成两列 -->
<view class="mescrollUniView">
<view class="fall-col">
<PingItem v-for="(item, i) in leftList" :key="item.id" :obj="item" @ok="onJumpShop"
style="margin-top: 24rpx" />
</view>
<view class="setting-view">
<FenItem @ok="onJumpShop" style="margin-top:24rpx" :obj="item" v-for="(item,index) in dataList" :key="index"></FenItem>
<view class="fall-col">
<PingItem v-for="(item, i) in rightList" :key="item.id" :obj="item" @ok="onJumpShop"
style="margin-top: 24rpx" />
</view>
</view>
</mescroll-uni>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
@@ -32,19 +42,49 @@
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue'
import MyBtn from '@/components/common/my-btn.vue'
import FenItem from '@/components/shop/fen-item.vue'
import { searchList } from '@/api/product.js';
import { getCarouselImage } from '@/api/common.js';
import { getAcctBalance } from "@/api/finance.js";
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue";
import PingItem from "@/components/shop/ping-item.vue";
export default {
components: { Header, TopSafe,MyBtn,FenItem },
mixins: [MescrollMixin],
components: { Header, TopSafe, MyBtn, PingItem, MescrollUni, },
data() {
return {
dataList: [],
swiperList: ['https://cdn.uviewui.com/uview/swiper/swiper1.png'],
};
swiperList: [
{ key: 0, label: '全部', minDeduction: 0, maxDeduction: 999999 },
{ key: 1, label: '<300积分', minDeduction: 0, maxDeduction: 299.99 },
{ key: 2, label: '300-500积分', minDeduction: 300, maxDeduction: 499.99 },
{ key: 3, label: '500-1000积分', minDeduction: 500, maxDeduction: 999.99 },
{ key: 4, label: '>1000积分', minDeduction: 1000, maxDeduction: 999999 },
],
currentItem: 0,
downOption: {
auto: false,
textColor: "#333",
bgColor: "rgba(0,0,0,0)",
},
onShow() {
upOption: {
auto: false,
page: {
size: 10,
},
noMoreSize: 10,
empty: {
tip: `空空如也`,
},
textColor: "#333",
bgColor: "rgba(0,0,0,0)",
},
leftList: [],
rightList: [],
mescroll: null,
balanceData: {},
};
},
onLoad() {
this.init();
@@ -52,38 +92,92 @@ export default {
methods: {
init() {
this.getSearchList();
this.getCarouselImage();
this.getAcctBalance();
},
async getCarouselImage(){
const params={
pageUi:6,
}
const resp = await getCarouselImage(params);
async getAcctBalance() {
const resp = await getAcctBalance();
let data = [];
if (resp && resp.bizcode === 100) {
const data = resp.data || [];
this.swiperList = data.length !== 0 ? data.map(obj=>obj.carouselImage) : [];
data = resp.data || [];
}
this.balanceData = data.filter(item => item.categoty === 'vcoin')[0] || {};
},
async getSearchList(){
onClickItem(item) {
this.currentItem = item.key;
this.getSearchList(item);
},
mescrollInit(mescroll) {
this.mescroll = mescroll;
},
upCallback(page) {
let currentSwiperItem = this.swiperList.find(item => item.key === this.currentItem) || {};
let params = {
type: -1,
page: page.num,
pageSize: page.size,
minDeduction: currentSwiperItem.minDeduction || 0,
maxDeduction: currentSwiperItem.maxDeduction || 999999,
};
searchList(params).then((res) => {
let curPageLen = res.data.length;
if (page.num === 1) this.dataList = [];
this.dataList = this.dataList.concat(res.data);
this.waterfall();
this.mescroll.endBySize(curPageLen, res.total);
});
},
downCallback() {
this.$nextTick(() => {
this.mescroll && this.mescroll.resetUpScroll();
});
},
async getSearchList(item = {}) {
const params = {
type:3,
type: -1,
page: 1,
pageSize: 99,
minDeduction: item.minDeduction || 0,
maxDeduction: item.maxDeduction || 999999,
}
const resp = await searchList(params);
if (resp && resp.bizcode === 100) {
this.dataList = resp.data || [];
this.waterfall();
}
},
waterfall() {
this.leftList = this.dataList
.map((item, index) => {
if (index % 2 == 0) return item;
return null;
})
.filter(Boolean);
this.rightList = this.dataList
.map((item, index) => {
if (index % 2 != 0) return item;
return null;
})
.filter(Boolean);
console.log(this.leftList, this.rightList);
},
onJumpShop(id) {
uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id='+id,
url: '/pages/other_package/productInfo/productInfo?id=' + id + '&isPar=true&curAmount=' + this.balanceData.curAmount || 0,
})
},
onShare() {
uni.navigateTo({
url: '/pages/other_package/invite_friends/invite_friends',
})
},
goback() {
uni.navigateBack()
}
}
}
@@ -101,70 +195,53 @@ export default {
position: relative;
}
.mid-panel{
width:100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height:120rpx;
min-height:120rpx;
}
.swiper-view {
width: 100%;
height:268rpx;
min-height:268rpx;
display: flex;
}
.setting-view {
width: 100%;
height: calc(100% - 88rpx - 268rpx - 156rpx - var(--status-bar-height));
display: flex;
flex-direction: column;
align-items: center;
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
.name-box{
width:100%;
border-radius: 16rpx;
display: flex;
flex-direction: column;
background-color: #fff;
padding: 64rpx 32rpx;
box-sizing: border-box;
margin-top:24rpx;
.mid-view{
width:100%;
padding: 40rpx 32rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
border:2rpx solid #eaeaea;
border-radius: 16rpx;
margin-top:48rpx;
}
.top-view{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
}
.input-view{
border-radius: 20rpx;
margin-top:52rpx;
width:100%;
padding: 0 32rpx;
min-height:104rpx;
height: 80rpx;
display: flex;
flex-direction: row;
align-items: center;
background-color: #f5f5f5;
background: #FFFFFF;
overflow-x: auto;
white-space: nowrap;
padding: 0 16rpx;
box-sizing: border-box;
.swiper-item {
padding: 0 16rpx;
height: 100%;
color: #666;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-sizing: border-box;
&.active {
color: #7A35F6;
border-bottom: 4rpx solid #7A35F6;
}
}
}
.name-box {
width: 100%;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
}
.mescrollUniView {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 24rpx;
.fall-col {
width: 332rpx;
height: 100%;
}
}
</style>
+1 -10
View File
@@ -35,16 +35,7 @@
@init="mescrollInit"
:fixed="false"
>
<!-- <view class="mescrollUniView">
<PingItem
@ok="onJumpShop"
style="margin-top: 24rpx"
:obj="item"
v-for="(item, index) in dataList"
:key="index"
></PingItem>
</view> -->
<!-- 原来单个 v-for 替换成两列 -->
<view class="mescrollUniView">
<view class="fall-col">
@@ -115,6 +106,7 @@ export default {
},
leftList: [],
rightList: [],
mescroll: null,
};
},
onLoad() {
@@ -226,7 +218,6 @@ export default {
<style lang="scss" scoped>
.content-two {
height: calc(100vh);
background-color: $app-bj;
}
.head-view {
+5 -4
View File
@@ -3,11 +3,12 @@
// export const BASE_URL="http://cl55un59859.vicp.fun:24346"; // 测试环境
export const BASE_URL = "https://api.tbmall.xin"; //生产
export const MILD_BASE_URL = "https://agent.tbmall.xin/"; //中台生产
// export const BASE_URL = "https://api.tbmall.xin"; //生产
// export const MILD_BASE_URL = "https://agent.tbmall.xin/"; //中台生产
//
// export const BASE_URL ='https://api.o.tbmall.xin'; // 本地测试
// export const MILD_BASE_URL = "https://agent.o.tbmall.xin/"; //中台测试
export const BASE_URL ='https://api.o.tbmall.xin'; // 本地测试
export const MILD_BASE_URL = "https://agent.o.tbmall.xin/"; //中台测试
// https://h.o.tbmall.xin/#/
export const SHARE_URL = 'https://h.tbmall.xin';