build(custom): 修正提交规范

This commit is contained in:
2023-11-09 19:49:24 +08:00
parent 76d57cea37
commit 29c1d4280f
105 changed files with 29374 additions and 18618 deletions

View File

@@ -1,4 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '活动订单',
})
navigationBarTitleText: "活动订单",
});

View File

@@ -1,11 +1,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import {
useLoad,
useReachBottom,
showToast,
navigateTo,
setStorageSync,
useLoad,
useReachBottom,
showToast,
navigateTo,
setStorageSync,
} from "@tarojs/taro";
import Pay from "@/components/Pay.vue";
import { getActiveOrderList, deleteActiveOrder } from "@/api/goods";
@@ -16,116 +16,116 @@ const tabValue = ref(0);
const isShowPay = ref(false);
const tabsList = ref([
{
title: "全部",
value: 0,
num: 0,
},
{
title: "待付款",
value: 1,
num: 0,
},
{
title: "待使用",
value: 2,
num: 0,
},
{
title: "已使用",
value: 3,
num: 0,
},
{
title: "已失效",
value: 4,
num: 0,
},
{
title: "全部",
value: 0,
num: 0,
},
{
title: "待付款",
value: 1,
num: 0,
},
{
title: "待使用",
value: 2,
num: 0,
},
{
title: "已使用",
value: 3,
num: 0,
},
{
title: "已失效",
value: 4,
num: 0,
},
]);
const jfInfo = ref({});
interface OrderList {
oid: string;
add_time: string;
status: number;
BindGoods: {
cover: string;
name: string;
number: number;
};
count: number;
oid: string;
add_time: string;
status: number;
BindGoods: {
cover: string;
name: string;
number: number;
};
count: number;
number: number;
}
const orderList = ref<OrderList[]>([]);
useLoad((options) => {
console.log(options);
// tabValue.value = Number(options.type);
getList();
console.log(options);
// tabValue.value = Number(options.type);
getList();
});
const countInfo = ref<any>({});
const getTj = async () => {
try {
const res = await getOrderStatistics({
type: 1,
});
countInfo.value = res.data.data;
console.log(res);
tabsList.value[0].num = countInfo.value.A;
tabsList.value[1].num = countInfo.value.B;
tabsList.value[2].num = countInfo.value.C;
tabsList.value[3].num = countInfo.value.D;
tabsList.value[4].num = countInfo.value.F;
} catch (error) {
showToast({
title: error.msg,
icon: "none",
});
}
try {
const res = await getOrderStatistics({
type: 1,
});
countInfo.value = res.data.data;
console.log(res);
tabsList.value[0].num = countInfo.value.A;
tabsList.value[1].num = countInfo.value.B;
tabsList.value[2].num = countInfo.value.C;
tabsList.value[3].num = countInfo.value.D;
tabsList.value[4].num = countInfo.value.F;
} catch (error) {
showToast({
title: error.msg,
icon: "none",
});
}
};
const getList = async () => {
try {
const res = await getActiveOrderList({
status: tabValue.value,
});
console.log(res);
orderList.value = res.data.data;
} catch (error) {
showToast({
title: error.msg,
icon: "none",
});
}
getTj();
try {
const res = await getActiveOrderList({
status: tabValue.value,
});
console.log(res);
orderList.value = res.data.data;
} catch (error) {
showToast({
title: error.msg,
icon: "none",
});
}
getTj();
};
const tabChange = (index: number) => {
tabValue.value = index;
getList();
tabValue.value = index;
getList();
};
useReachBottom(() => {
console.log("useReachBottom");
console.log("useReachBottom");
});
const openPay = (item: OrderList) => {
isShowPay.value = true;
jfInfo.value = item;
isShowPay.value = true;
jfInfo.value = item;
};
const errPay = () => {
isShowPay.value = false;
showToast({
title: "支付失败",
icon: "none",
});
jfInfo.value = {};
getList();
isShowPay.value = false;
showToast({
title: "支付失败",
icon: "none",
});
jfInfo.value = {};
getList();
};
// const successPay = (val: boolean) => {
@@ -139,239 +139,233 @@ const errPay = () => {
// };
const closePay = () => {
isShowPay.value = false;
showToast({
title: "支付取消",
icon: "none",
});
jfInfo.value = {};
getList();
isShowPay.value = false;
showToast({
title: "支付取消",
icon: "none",
});
jfInfo.value = {};
getList();
};
const toDetail = (item: any) => {
setStorageSync("item", item);
navigateTo({
url: `/pages/users/order_list_detail/index?Id=${item.oid}&type=1`,
});
setStorageSync("item", item);
navigateTo({
url: `/pages/users/order_list_detail/index?Id=${item.oid}&type=1`,
});
};
const delOrder = async (oid: string) => {
try {
const res = await deleteActiveOrder({
oid,
});
console.log(res);
getList();
} catch (error) {
showToast({
title: error.msg,
icon: "none",
});
}
try {
const res = await deleteActiveOrder({
oid,
});
console.log(res);
getList();
} catch (error) {
showToast({
title: error.msg,
icon: "none",
});
}
};
</script>
<template>
<view>
<view class="topTips">
<view>
<view style="font-weight: bold">订单信息</view>
<view style="font-size: 15px"
>总消费(){{ countInfo.Total || 0 }}
</view>
</view>
<image src="../static/user/order_list_top.png" />
<view>
<view class="topTips">
<view>
<view style="font-weight: bold">订单信息</view>
<view style="font-size: 15px"
>总消费(){{ countInfo.Total || 0 }}
</view>
<view class="tabs-box">
<view
v-for="item in tabsList"
:key="item.value"
@click="tabChange(item.value)"
>
<view class="text">{{ item.title }}</view>
<view>{{ item.num }}</view>
<view
class="line"
:class="{ lineColor: item.value === tabValue }"
></view>
</view>
</view>
<image src="../static/user/order_list_top.png" />
</view>
<view class="tabs-box">
<view
v-for="item in tabsList"
:key="item.value"
@click="tabChange(item.value)"
>
<view class="text">{{ item.title }}</view>
<view>{{ item.num }}</view>
<view
class="line"
:class="{ lineColor: item.value === tabValue }"
></view>
</view>
</view>
<view v-if="orderList.length > 0">
<view class="order-card" v-for="(item, index) in orderList" :key="index">
<view class="top">
<view>{{ item.add_time.slice(0, 19).replace("T", " ") }}</view>
<view style="color: red">{{
item.status === 0
? "待付款"
: item.status === 1
? "待使用"
: item.status === 2
? "已使用"
: "已失效"
}}</view>
</view>
<view v-if="orderList.length > 0">
<view
class="order-card"
v-for="(item, index) in orderList"
:key="index"
>
<view class="top">
<view>{{
item.add_time.slice(0, 19).replace("T", " ")
}}</view>
<view style="color: red">{{
item.status === 0
? "待付款"
: item.status === 1
? "待使用"
: item.status === 2
? "已使用"
: "已失效"
}}</view>
</view>
<view class="line"></view>
<view class="center">
<view class="top">
<image :src="item.BindGoods.cover" />
<view class="title">{{ item.BindGoods.name }} </view>
<view class="right">
<view>{{ item.number }}</view>
<!-- <view>x{{ item.count }}</view> -->
</view>
</view>
<!-- <view
<view class="line"></view>
<view class="center">
<view class="top">
<image :src="item.BindGoods.cover" />
<view class="title">{{ item.BindGoods.name }} </view>
<view class="right">
<view>{{ item.number }}</view>
<!-- <view>x{{ item.count }}</view> -->
</view>
</view>
<!-- <view
class="bom"
style="text-align: right; font-size: 13px"
>
{{ item.count }}件商品,实付():
<text style="color: red">{{ item.number }}</text>
</view> -->
</view>
<view class="line"></view>
<view class="btn">
<nut-button
v-if="item.status === 0"
plain
size="small"
type="primary"
@click="delOrder(item.oid)"
>删除订单
</nut-button>
<nut-button
style="margin-left: 5px"
size="small"
type="primary"
@click="toDetail(item)"
>查看详情
</nut-button>
<nut-button
style="margin-left: 5px"
size="small"
type="primary"
v-if="item.status === 0"
@click="openPay(item)"
>立即付款
</nut-button>
</view>
</view>
</view>
<nut-empty v-else description="暂无订单"></nut-empty>
<pay
:isShowPay="isShowPay"
payType="wx"
@errPay="errPay"
@closePay="closePay"
:jfInfo="jfInfo"
/>
<view class="line"></view>
<view class="btn">
<nut-button
v-if="item.status === 0"
plain
size="small"
type="primary"
@click="delOrder(item.oid)"
>删除订单
</nut-button>
<nut-button
style="margin-left: 5px"
size="small"
type="primary"
@click="toDetail(item)"
>查看详情
</nut-button>
<nut-button
style="margin-left: 5px"
size="small"
type="primary"
v-if="item.status === 0"
@click="openPay(item)"
>立即付款
</nut-button>
</view>
</view>
</view>
<nut-empty v-else description="暂无订单"></nut-empty>
<pay
:isShowPay="isShowPay"
payType="wx"
@errPay="errPay"
@closePay="closePay"
:jfInfo="jfInfo"
/>
</view>
</template>
<style lang="scss">
.topTips {
box-sizing: border-box;
width: 100%;
background-color: #ff0000;
color: #ffffff;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
width: 100%;
background-color: #ff0000;
color: #ffffff;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
image {
width: 150px;
height: 150px;
}
image {
width: 150px;
height: 150px;
}
}
.tabs-box {
display: flex;
flex-direction: row;
justify-content: space-between;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: auto;
background-color: #fff;
padding: 0 20px;
text-align: center;
.text {
margin: 10px 20px;
align-items: center;
height: auto;
background-color: #fff;
padding: 0 20px;
text-align: center;
}
.text {
margin: 10px 20px;
align-items: center;
}
.line {
margin: 0 auto;
width: 50px;
height: 5px;
border-radius: 30px;
transition: all 0.3s ease-in-out;
}
.line {
margin: 0 auto;
width: 50px;
height: 5px;
border-radius: 30px;
transition: all 0.3s ease-in-out;
}
.lineColor {
background-color: #ff0000;
}
.lineColor {
background-color: #ff0000;
}
}
.order-card {
width: 95%;
box-sizing: border-box;
margin: 15px auto;
background-color: #fff;
border-radius: 10px;
padding: 20px;
width: 95%;
box-sizing: border-box;
margin: 15px auto;
background-color: #fff;
border-radius: 10px;
padding: 20px;
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px;
}
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px;
}
.top {
display: flex;
justify-content: space-between;
align-items: center;
}
.btn {
display: flex;
justify-content: flex-end;
align-items: center;
}
.center {
.top {
display: flex;
justify-content: space-between;
align-items: center;
}
.btn {
display: flex;
justify-content: flex-end;
align-items: center;
}
.center {
.top {
display: flex;
justify-content: space-between;
// align-items: flex-start;
image {
width: 150px;
height: 150px;
}
.title {
margin-left: 10px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
width: 350px;
}
.right {
margin-left: 10px;
font-size: 28px;
text-align: right;
}
}
display: flex;
justify-content: space-between;
// align-items: flex-start;
image {
width: 150px;
height: 150px;
}
.title {
margin-left: 10px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
width: 350px;
}
.right {
margin-left: 10px;
font-size: 28px;
text-align: right;
}
}
}
}
</style>

View File

@@ -1,4 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '活动商品',
})
navigationBarTitleText: "活动商品",
});

View File

@@ -1,26 +1,26 @@
<template>
<view>
<!-- 金刚区 -->
<view class="top-box">
<view class="item">
<view @click="hotGoodsDetail">
<IconFont
name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
size="40"
/>
<view>我的订单</view>
</view>
</view>
<view class="item">
<view></view>
</view>
<view class="item"> </view>
<view class="item">
<view></view>
</view>
<view>
<!-- 金刚区 -->
<view class="top-box">
<view class="item">
<view @click="hotGoodsDetail">
<IconFont
name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
size="40"
/>
<view>我的订单</view>
</view>
<!-- 商品列表 -->
<!-- <view class="goodBox">
</view>
<view class="item">
<view></view>
</view>
<view class="item"> </view>
<view class="item">
<view></view>
</view>
</view>
<!-- 商品列表 -->
<!-- <view class="goodBox">
<view
class="good"
v-for="item in list"
@@ -42,38 +42,38 @@
</view>
</view>
</view> -->
<view class="goodBox">
<view
class="good"
v-for="item in (merdata as any)"
:key="item.ID"
@click.stop="toMerDetails(item)"
>
<image :src="(item.head_photo as string)" />
<view class="good-text-box">
<text class="good-text">{{ item.name }}</text>
<text style="color: #999"
>距离我{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(item.lat),
Number(item.lon)
)
}}</text
>
</view>
</view>
<view class="goodBox">
<view
class="good"
v-for="item in (merdata as any)"
:key="item.ID"
@click.stop="toMerDetails(item)"
>
<image :src="(item.head_photo as string)" />
<view class="good-text-box">
<text class="good-text">{{ item.name }}</text>
<text style="color: #999"
>距离我{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(item.lat),
Number(item.lon)
)
}}</text
>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import {
// getActiveGoods,
getMerList,
// getActiveGoods,
getMerList,
} from "../../../api/goods";
import { IconFont } from "@nutui/icons-vue-taro";
import { calculateDistance } from "@/utils";
@@ -81,8 +81,8 @@ import { calculateDistance } from "@/utils";
// const list = ref<any>([]);
Taro.useLoad(() => {
// getList();
get_mer_list();
// getList();
get_mer_list();
});
// const getList = async () => {
@@ -98,109 +98,109 @@ Taro.useLoad(() => {
// };
const hotGoodsDetail = () => {
Taro.navigateTo({
url: `/pages/hotGoods/hot_list/index`,
});
Taro.navigateTo({
url: `/pages/hotGoods/hot_list/index`,
});
};
const merdata = ref([]);
const userLocalNum = ref({
l: 0,
t: 0,
l: 0,
t: 0,
});
const get_mer_list = async () => {
Taro.getLocation({
type: "wgs84",
success: (res) => {
userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude;
},
});
Taro.getLocation({
type: "wgs84",
success: (res) => {
userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude;
},
});
const res = await getMerList({
PageNum: 1,
PageSize: 10,
Btype: 1,
classid: 0,
});
merdata.value = res.data.data;
const res = await getMerList({
PageNum: 1,
PageSize: 10,
Btype: 1,
classid: 0,
});
merdata.value = res.data.data;
};
const toMerDetails = (item: any) => {
Taro.setStorageSync("mer_info", item);
Taro.navigateTo({
url: `/pages/mer/mer_detail/index`,
});
Taro.setStorageSync("mer_info", item);
Taro.navigateTo({
url: `/pages/mer/mer_detail/index`,
});
};
</script>
<style lang="scss">
.top-box {
display: flex;
justify-content: space-between;
margin: 10px 20px 0 20px;
background-color: #fff;
border-radius: 10px;
display: flex;
justify-content: space-between;
margin: 10px 20px 0 20px;
background-color: #fff;
border-radius: 10px;
.item {
width: 150px;
padding: 10px;
background-color: #fff;
text-align: center;
}
.item {
width: 150px;
padding: 10px;
background-color: #fff;
text-align: center;
}
}
.goodBox {
display: flex;
padding: 20px;
flex-wrap: wrap;
justify-content: space-between;
display: flex;
padding: 20px;
flex-wrap: wrap;
justify-content: space-between;
.good {
width: 340px;
background-color: #fff;
margin-bottom: 20px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
.good {
width: 340px;
background-color: #fff;
margin-bottom: 20px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
image {
width: 100%;
height: 350px;
}
.good-text-box {
padding: 10px;
.good-text {
flex-shrink: 0;
font-size: 28px;
color: #333;
font-weight: 400;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
}
.good-price-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.good-text-price {
font-size: 28px;
font-weight: bold;
color: #ff0000;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
image {
width: 100%;
height: 350px;
}
.good-text-box {
padding: 10px;
.good-text {
flex-shrink: 0;
font-size: 28px;
color: #333;
font-weight: 400;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-word;
}
.good-price-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.good-text-price {
font-size: 28px;
font-weight: bold;
color: #ff0000;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
}
}
</style>