style: 新增复制粘贴以及拨打电话封装模块,优化部分文件中的变量名、将冗余功能抽出、优化订单详情展示
parent
43fc159e27
commit
5dc562396c
|
@ -83,20 +83,7 @@ export default {
|
|||
this.configs.shareLink +
|
||||
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
|
||||
}
|
||||
if (content === null || content === undefined) {
|
||||
content = "";
|
||||
} else content = content + "";
|
||||
const result = h5Copy(content);
|
||||
if (result === false) {
|
||||
uni.showToast({
|
||||
title: "不支持",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "复制成功",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
this.$options.filters.setClipboard(content)
|
||||
},
|
||||
// #endif
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ export default {
|
|||
customerServiceEmail: "lili@lili.com", //客服邮箱
|
||||
imWebSrc: "https://im.pickmall.cn", //IM地址
|
||||
baseWsUrl: "wss://im-api.pickmall.cn/lili/webSocket", // IM WS 地址
|
||||
enableGetClipboard: true, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||
enableGetClipboard: false, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
|
||||
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
|
||||
/**
|
||||
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||
|
|
|
@ -9,21 +9,21 @@
|
|||
|
||||
</div>
|
||||
<!-- 物流信息 -->
|
||||
<view class="info-view logi-view">
|
||||
<view class="logi-List" v-if="logiList && logiList.traces.length != 0">
|
||||
<view class="logi-List-title">
|
||||
{{ logiList.traces[logiList.traces.length - 1].AcceptStation }}
|
||||
<view class="info-view logistics-view">
|
||||
<view class="logistics-List" v-if="logisticsList && logisticsList.traces.length != 0 ">
|
||||
<view class="logistics-List-title">
|
||||
{{ logisticsList.traces[logisticsList.traces.length - 1].AcceptStation }}
|
||||
</view>
|
||||
<view class="logi-List-time">
|
||||
{{ logiList.traces[logiList.traces.length - 1].AcceptTime }}
|
||||
<view class="logistics-List-time">
|
||||
{{ logisticsList.traces[logisticsList.traces.length - 1].AcceptTime }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="logi-List" v-else>
|
||||
<view class="logistics-List" v-else>
|
||||
<view class="verificationCode" v-if="order.verificationCode">
|
||||
券码: {{ order.verificationCode }}
|
||||
</view>
|
||||
<view v-else class="logi-List-title">
|
||||
<view v-else class="logistics-List-title">
|
||||
{{ '暂无物流信息' }}
|
||||
</view>
|
||||
</view>
|
||||
|
@ -47,12 +47,15 @@
|
|||
<view class="info-view" v-if="order.deliveryMethod == 'SELF_PICK_UP'">
|
||||
<view class="address-view">
|
||||
<view>
|
||||
<view class="address-title">
|
||||
自提点地址:<span>{{ order.storeAddressPath }}</span>
|
||||
<view class="order-info-view">
|
||||
<view class="title">自提点地址:</view>
|
||||
<view class="value address-line-height">{{ order.storeAddressPath }}</view>
|
||||
</view>
|
||||
<view class="address-title">
|
||||
联系方式:<span>{{ order.storeAddressMobile }}</span>
|
||||
<view class="order-info-view" @click="callPhone" >
|
||||
<view class="title">联系方式:</view>
|
||||
<view class="value">{{ order.storeAddressMobile }}<u-icon name='phone-fill' ></u-icon></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -62,7 +65,7 @@
|
|||
<view class="seller-view">
|
||||
<!-- 店铺名称 -->
|
||||
<view class="seller-info u-flex u-row-between">
|
||||
<view class="seller-name" @click="tostore(order)">
|
||||
<view class="seller-name" @click="goToShopPage(order)">
|
||||
<view class="name">{{ order.storeName }}</view>
|
||||
<view class="status" v-if="orderStatusList[order.orderStatus]"> {{ orderStatusList[order.orderStatus].title
|
||||
}}</view>
|
||||
|
@ -165,7 +168,7 @@
|
|||
</view>
|
||||
<view class="order-info-view">
|
||||
<view class="title">支付方式:</view>
|
||||
<view class="value">{{ orderDetail.paymentMethodValue }}</view>
|
||||
<view class="value">{{ orderDetail.paymentMethodValue || '暂无'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -173,7 +176,7 @@
|
|||
<view class="info-view" v-if="order.payStatus == 'PAID'">
|
||||
<view>
|
||||
<view class="invoice-info-view">
|
||||
<view class="ltitle">发票信息:</view>
|
||||
<view class="invoice-title">发票信息:</view>
|
||||
<view v-if="!order.needReceipt" class="value">无需发票</view>
|
||||
<view v-else class="value" @click="onReceipt(orderDetail.receipt)">查看发票</view>
|
||||
</view>
|
||||
|
@ -232,8 +235,8 @@
|
|||
@confirm="confirmRog"></u-modal>
|
||||
|
||||
<!-- 分享 -->
|
||||
<shares v-if="shareFlage" :thumbnail="orderDetail.orderItems[0].image"
|
||||
:goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlage = false" />
|
||||
<shares v-if="shareFlag" :thumbnail="orderDetail.orderItems[0].image"
|
||||
:goodsName="orderDetail.orderItems[0].goodsName" @close="shareFlag = false" />
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
@ -242,7 +245,6 @@
|
|||
import { getExpress } from "@/api/trade.js";
|
||||
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
|
||||
|
||||
import { h5Copy } from "@/js_sdk/h5-copy/h5-copy.js";
|
||||
import shares from "@/components/m-share/index"; //分享
|
||||
|
||||
import { getClearReason } from "@/api/after-sale.js";
|
||||
|
@ -254,8 +256,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
lightColor: this.$lightColor,
|
||||
logiList: "", //物流信息
|
||||
shareFlage: false, //拼团分享开关
|
||||
logisticsList: "", //物流信息
|
||||
shareFlag: false, //拼团分享开关
|
||||
orderStatusList: {
|
||||
UNPAID: {
|
||||
title: "未付款",
|
||||
|
@ -305,7 +307,10 @@ export default {
|
|||
this.sn = options.sn;
|
||||
},
|
||||
methods: {
|
||||
tostore(val) {
|
||||
callPhone(){
|
||||
this.$options.filters.callPhone(this.order.storeAddressMobile )
|
||||
},
|
||||
goToShopPage(val) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/shopPage?id=" + val.storeId,
|
||||
});
|
||||
|
@ -313,13 +318,13 @@ export default {
|
|||
// 获取物流信息
|
||||
loadLogistics(sn) {
|
||||
getExpress(sn).then((res) => {
|
||||
this.logiList = res.data.result;
|
||||
this.logisticsList = res.data.result;
|
||||
});
|
||||
},
|
||||
|
||||
// 分享当前拼团信息
|
||||
inviteGroup() {
|
||||
this.shareFlage = true;
|
||||
this.shareFlag = true;
|
||||
},
|
||||
// #TODO 这块需要写一下 目前没有拼团的详细信息
|
||||
ByUserMessage(order) {
|
||||
|
@ -360,35 +365,7 @@ export default {
|
|||
});
|
||||
},
|
||||
onCopy(sn) {
|
||||
// #ifdef H5
|
||||
if (sn === null || sn === undefined) {
|
||||
sn = "";
|
||||
} else sn = sn + "";
|
||||
const result = h5Copy(sn);
|
||||
if (result === false) {
|
||||
uni.showToast({
|
||||
title: "不支持",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "复制成功",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
uni.setClipboardData({
|
||||
data: sn,
|
||||
success: function () {
|
||||
uni.showToast({
|
||||
title: "复制成功!",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
this.$options.filters.setClipboard(sn)
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -546,7 +523,7 @@ export default {
|
|||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.logi-view {
|
||||
.logistics-view {
|
||||
justify-content: space-between;
|
||||
padding: 30rpx !important;
|
||||
margin: 0 !important;
|
||||
|
@ -566,12 +543,12 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.logi-List-title {
|
||||
.logistics-List-title {
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.logi-List-time {
|
||||
.logistics-List-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
@ -666,11 +643,14 @@ page,
|
|||
width: 140rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
flex:3;
|
||||
min-width: 160rpx;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #666;
|
||||
font-size: 24rpx;
|
||||
flex:10;
|
||||
}
|
||||
|
||||
.copy {
|
||||
|
@ -688,7 +668,7 @@ page,
|
|||
width: 100%;
|
||||
margin: 10rpx 0rpx;
|
||||
|
||||
.ltitle {
|
||||
.invoice-title {
|
||||
width: 550rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
@ -765,4 +745,7 @@ page,
|
|||
text-align: center;
|
||||
}
|
||||
}
|
||||
.address-line-height{
|
||||
line-height: 1.75;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
}}</span>
|
||||
<u-icon @click="navigateToStore(item)" size="24" style="margin-left:10rpx;" name="arrow-right"></u-icon>
|
||||
</view>
|
||||
<view class="right-col" v-if="item.canReceiveCoupon" @click="navigateToConpon(item)">
|
||||
<view class="right-col" v-if="item.canReceiveCoupon" @click="navigateToCoupon(item)">
|
||||
<div class="right-line"></div>
|
||||
<span>领劵</span>
|
||||
</view>
|
||||
|
@ -119,7 +119,7 @@
|
|||
</u-swipe-action>
|
||||
</div>
|
||||
</div>
|
||||
<u-modal v-model="deleteShow" :confirm-style="{'color':lightColor}" @confirm="delectConfirm" show-cancel-button
|
||||
<u-modal v-model="deleteShow" :confirm-style="{'color':lightColor}" @confirm="deleteConfirm" show-cancel-button
|
||||
:content="deleteContent" :async-close="true"></u-modal>
|
||||
<!-- 结账 -->
|
||||
<div class="box box6">
|
||||
|
@ -220,7 +220,6 @@ export default {
|
|||
// #endif
|
||||
},
|
||||
onPullDownRefresh(){
|
||||
console.log("132")
|
||||
this.getCardData();
|
||||
},
|
||||
/**
|
||||
|
@ -283,7 +282,7 @@ export default {
|
|||
/**
|
||||
* 点击删除
|
||||
*/
|
||||
delectConfirm() {
|
||||
deleteConfirm() {
|
||||
API_Trade.deleteSkuItem(this.goodsVal.goodsSku.id).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
uni.showToast({
|
||||
|
@ -341,7 +340,7 @@ export default {
|
|||
/**
|
||||
* 跳转到优惠券
|
||||
*/
|
||||
navigateToConpon(val) {
|
||||
navigateToCoupon(val) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/cart/coupon/couponCenter?storeId=" + val.storeId,
|
||||
});
|
||||
|
@ -512,19 +511,19 @@ export default {
|
|||
uni.stopPullDownRefresh();
|
||||
if (result.data.success) {
|
||||
this.cartDetail = result.data.result;
|
||||
let checkouted = true;
|
||||
let checkOuted = true;
|
||||
for (let i = 0; i < this.cartDetail.cartList.length; i++) {
|
||||
let item = this.cartDetail.cartList[i];
|
||||
console.log(item);
|
||||
// 循环出当前商品是否全选
|
||||
if (item.checked == 0) {
|
||||
checkouted = false;
|
||||
checkOuted = false;
|
||||
}
|
||||
// 如果有拼团活动顺便删除
|
||||
item.skuList &&
|
||||
item.skuList.forEach((sku) => {
|
||||
if (sku.checked == 0) {
|
||||
checkouted = false;
|
||||
checkOuted = false;
|
||||
}
|
||||
if(Object.keys(sku.promotionMap).length != 0)
|
||||
{
|
||||
|
@ -538,7 +537,7 @@ export default {
|
|||
|
||||
});
|
||||
}
|
||||
this.checkout = checkouted;
|
||||
this.checkout = checkOuted;
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
})
|
||||
|
|
|
@ -35,6 +35,53 @@ export function goodsFormatPrice(val) {
|
|||
return valNum.toFixed(2).split(".");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将内容复制到粘贴板
|
||||
*/
|
||||
import { h5Copy } from "@/js_sdk/h5-copy/h5-copy.js";
|
||||
export function setClipboard(val){
|
||||
// #ifdef H5
|
||||
if (val === null || val === undefined) {
|
||||
val = "";
|
||||
} else val = val + "";
|
||||
const result = h5Copy(val);
|
||||
if (result === false) {
|
||||
uni.showToast({
|
||||
title: "不支持",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "复制成功",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
uni.setClipboardData({
|
||||
data: val,
|
||||
success: function () {
|
||||
uni.showToast({
|
||||
title: "复制成功!",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
|
||||
export function callPhone(phoneNumber) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phoneNumber,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 脱敏姓名
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue