feat(custom): build
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { showToast, useLoad, getStorageSync } from "@tarojs/taro";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getIntegralDetail, getBeanDetail, getGiftRecord } from "@/api/user";
|
||||
|
||||
// Taro.setStorageSync("token", "ok_OL66Ej4_lkQKNA0AwxnGwGyXo");
|
||||
|
||||
const tabValue = ref(1);
|
||||
|
||||
const tabsList = ref([
|
||||
@@ -44,13 +46,22 @@ const tabChange = (index: number) => {
|
||||
page.value.PageNum = 1;
|
||||
};
|
||||
|
||||
const data = ref<any>([]);
|
||||
interface DataType {
|
||||
goods_name: string;
|
||||
add_time: string;
|
||||
number: number;
|
||||
order_number: number;
|
||||
type: number;
|
||||
oid: string;
|
||||
}
|
||||
|
||||
const data = ref<DataType[]>([]);
|
||||
|
||||
const userInfo = ref<any>({});
|
||||
|
||||
useLoad(() => {
|
||||
Taro.useLoad(() => {
|
||||
getList();
|
||||
userInfo.value = getStorageSync("userInfo");
|
||||
userInfo.value = Taro.getStorageSync("userInfo");
|
||||
});
|
||||
|
||||
const page = ref({
|
||||
@@ -84,7 +95,7 @@ const getList = async () => {
|
||||
data.value = res.data.data || [];
|
||||
page.value.ItemCount = res.data.count;
|
||||
} catch (error) {
|
||||
showToast({
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
});
|
||||
@@ -95,14 +106,14 @@ const getList = async () => {
|
||||
<template>
|
||||
<view>
|
||||
<view class="card">
|
||||
<!-- <view class="greeting">Hello! YuanHuakk</view> -->
|
||||
<!-- <view class="greeting">Hello! YuanHuakk</view>-->
|
||||
<view class="info">
|
||||
<view class="left">
|
||||
<view>
|
||||
<view class="num">豆子: {{ userInfo.pulse }}</view>
|
||||
<view class="num">豆子: {{ userInfo.data?.pulse }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="num">积分: {{ userInfo.integral }}</view>
|
||||
<view class="num">积分: {{ userInfo.data?.integral }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <image class="img" src="https://picdm.sunbangyan.cn/2023/08/15/ste192.png"/> -->
|
||||
@@ -123,13 +134,9 @@ const getList = async () => {
|
||||
</view>
|
||||
<view v-if="data.length > 0">
|
||||
<view v-if="tabValue === 1 || tabValue === 3">
|
||||
<view
|
||||
class="card-list"
|
||||
v-for="(item, index) in (data as any[])"
|
||||
:key="index"
|
||||
>
|
||||
<view class="card-list" v-for="(item, index) in data" :key="index">
|
||||
<view class="left">
|
||||
<view>商品:{{ item.goods_name }}</view>
|
||||
<view>订单:{{ item.oid }}</view>
|
||||
<view>时间:{{ item.add_time.slice(0, 10) }}</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
@@ -139,38 +146,29 @@ const getList = async () => {
|
||||
</view>
|
||||
<view v-if="tabValue === 3" style="color: red"
|
||||
>+
|
||||
<text>{{ item.number }} </text>
|
||||
<text>{{ item.number }}</text>
|
||||
积分
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="tabValue === 2">
|
||||
<view
|
||||
class="card-list"
|
||||
v-for="(item, index) in (data as any[])"
|
||||
:key="index"
|
||||
>
|
||||
<view class="card-list" v-for="(item, index) in data" :key="index">
|
||||
<view class="left">
|
||||
<view class="text">商品:{{ item.goods_name }}</view>
|
||||
<view>金额:{{ item.order_number }}元</view>
|
||||
<view class="text">订单:{{ item.oid }}</view>
|
||||
<view>时间:{{ item.add_time.slice(0, 10) }}</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view style="color: red"
|
||||
>+
|
||||
<text>{{ item.number }} </text>
|
||||
<text>{{ item.number }}</text>
|
||||
豆子
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="tabValue === 4">
|
||||
<view
|
||||
class="card-list"
|
||||
v-for="(item, index) in (data as any[])"
|
||||
:key="index"
|
||||
>
|
||||
<view class="card-list" v-for="(item, index) in data" :key="index">
|
||||
<view class="left">
|
||||
<view class="text">类型:{{ computerType(item.type) }}</view>
|
||||
<view>时间:{{ item.add_time.slice(0, 10) }}</view>
|
||||
@@ -178,7 +176,7 @@ const getList = async () => {
|
||||
<view class="right">
|
||||
<view style="color: red"
|
||||
>+
|
||||
<text>{{ item.number }} </text>
|
||||
<text>{{ item.number }}</text>
|
||||
豆子
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user