This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "活动订单",
|
||||
navigationBarTitleText: '活动订单',
|
||||
});
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import {ref} from 'vue';
|
||||
import {
|
||||
useLoad,
|
||||
useReachBottom,
|
||||
showToast,
|
||||
navigateTo,
|
||||
setStorageSync,
|
||||
} from "@tarojs/taro";
|
||||
import Pay from "@/components/Pay.vue";
|
||||
import { getActiveOrderList, deleteActiveOrder } from "@/api/goods";
|
||||
import { getOrderStatistics } from "@/api/order";
|
||||
} from '@tarojs/taro';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
import {getActiveOrderList, deleteActiveOrder} from '@/api/goods';
|
||||
import {getOrderStatistics} from '@/api/order';
|
||||
|
||||
const tabValue = ref(0);
|
||||
|
||||
@@ -17,27 +17,27 @@ const isShowPay = ref(false);
|
||||
|
||||
const tabsList = ref([
|
||||
{
|
||||
title: "全部",
|
||||
title: '全部',
|
||||
value: 0,
|
||||
num: 0,
|
||||
},
|
||||
{
|
||||
title: "待付款",
|
||||
title: '待付款',
|
||||
value: 1,
|
||||
num: 0,
|
||||
},
|
||||
{
|
||||
title: "待使用",
|
||||
title: '待使用',
|
||||
value: 2,
|
||||
num: 0,
|
||||
},
|
||||
{
|
||||
title: "已使用",
|
||||
title: '已使用',
|
||||
value: 3,
|
||||
num: 0,
|
||||
},
|
||||
{
|
||||
title: "已失效",
|
||||
title: '已失效',
|
||||
value: 4,
|
||||
num: 0,
|
||||
},
|
||||
@@ -60,7 +60,7 @@ interface OrderList {
|
||||
|
||||
const orderList = ref<OrderList[]>([]);
|
||||
|
||||
useLoad((options) => {
|
||||
useLoad(options => {
|
||||
console.log(options);
|
||||
// tabValue.value = Number(options.type);
|
||||
getList();
|
||||
@@ -83,7 +83,7 @@ const getTj = async () => {
|
||||
} catch (error) {
|
||||
showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -98,7 +98,7 @@ const getList = async () => {
|
||||
} catch (error) {
|
||||
showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
getTj();
|
||||
@@ -110,7 +110,7 @@ const tabChange = (index: number) => {
|
||||
};
|
||||
|
||||
useReachBottom(() => {
|
||||
console.log("useReachBottom");
|
||||
console.log('useReachBottom');
|
||||
});
|
||||
|
||||
const openPay = (item: OrderList) => {
|
||||
@@ -121,8 +121,8 @@ const openPay = (item: OrderList) => {
|
||||
const errPay = () => {
|
||||
isShowPay.value = false;
|
||||
showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
title: '支付失败',
|
||||
icon: 'none',
|
||||
});
|
||||
jfInfo.value = {};
|
||||
getList();
|
||||
@@ -141,15 +141,15 @@ const errPay = () => {
|
||||
const closePay = () => {
|
||||
isShowPay.value = false;
|
||||
showToast({
|
||||
title: "支付取消",
|
||||
icon: "none",
|
||||
title: '支付取消',
|
||||
icon: 'none',
|
||||
});
|
||||
jfInfo.value = {};
|
||||
getList();
|
||||
};
|
||||
|
||||
const toDetail = (item: any) => {
|
||||
setStorageSync("item", item);
|
||||
setStorageSync('item', item);
|
||||
navigateTo({
|
||||
url: `/pages/users/order_list_detail/index?Id=${item.oid}&type=1`,
|
||||
});
|
||||
@@ -165,7 +165,7 @@ const delOrder = async (oid: string) => {
|
||||
} catch (error) {
|
||||
showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -186,29 +186,25 @@ const delOrder = async (oid: string) => {
|
||||
<view
|
||||
v-for="item in tabsList"
|
||||
:key="item.value"
|
||||
@click="tabChange(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 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>{{ item.add_time.slice(0, 19).replace('T', ' ') }}</view>
|
||||
<view style="color: red"
|
||||
>{{
|
||||
item.status === 0
|
||||
? "待付款"
|
||||
? '待付款'
|
||||
: item.status === 1
|
||||
? "待使用"
|
||||
? '待使用'
|
||||
: item.status === 2
|
||||
? "已使用"
|
||||
: "已失效"
|
||||
? '已使用'
|
||||
: '已失效'
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
@@ -264,8 +260,7 @@ const delOrder = async (oid: string) => {
|
||||
payType="wx"
|
||||
@errPay="errPay"
|
||||
@closePay="closePay"
|
||||
:jfInfo="jfInfo"
|
||||
/>
|
||||
:jfInfo="jfInfo" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "活动商品",
|
||||
navigationBarTitleText: '活动商品',
|
||||
});
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
<view @click="hotGoodsDetail">
|
||||
<IconFont
|
||||
name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
|
||||
size="40"
|
||||
/>
|
||||
size="40" />
|
||||
<view>我的订单</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -47,8 +46,7 @@
|
||||
class="good"
|
||||
v-for="item in (merdata as any)"
|
||||
:key="item.ID"
|
||||
@click.stop="toMerDetails(item)"
|
||||
>
|
||||
@click.stop="toMerDetails(item)">
|
||||
<image :src="(item.head_photo as string)" />
|
||||
<view class="good-text-box">
|
||||
<text class="good-text">{{ item.name }}</text>
|
||||
@@ -58,7 +56,7 @@
|
||||
userLocalNum.t,
|
||||
userLocalNum.l,
|
||||
Number(item.lat),
|
||||
Number(item.lon)
|
||||
Number(item.lon),
|
||||
)
|
||||
}}</text
|
||||
>
|
||||
@@ -69,14 +67,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import {ref} from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {
|
||||
// getActiveGoods,
|
||||
getMerList,
|
||||
} from "../../../api/goods";
|
||||
import { IconFont } from "@nutui/icons-vue-taro";
|
||||
import { calculateDistance } from "@/utils";
|
||||
} from '../../../api/goods';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import {calculateDistance} from '@/utils';
|
||||
|
||||
// const list = ref<any>([]);
|
||||
|
||||
@@ -112,8 +110,8 @@ const userLocalNum = ref({
|
||||
|
||||
const get_mer_list = async () => {
|
||||
Taro.getLocation({
|
||||
type: "wgs84",
|
||||
success: (res) => {
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
userLocalNum.value.l = res.longitude;
|
||||
userLocalNum.value.t = res.latitude;
|
||||
},
|
||||
@@ -129,7 +127,7 @@ const get_mer_list = async () => {
|
||||
};
|
||||
|
||||
const toMerDetails = (item: any) => {
|
||||
Taro.setStorageSync("mer_info", item);
|
||||
Taro.setStorageSync('mer_info', item);
|
||||
Taro.navigateTo({
|
||||
url: `/pages/mer/mer_detail/index`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user