feat(custom): 新增聚合积分支付
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-20 15:53:52 +08:00
parent 2646d025f4
commit 63733d0109
14 changed files with 437 additions and 409 deletions

View File

@@ -27,6 +27,15 @@
</view>
<view class="rightIcon">
<Scan style="margin-right: 20px" @click="scanCode" size="22" />
<button v-if="isLogin" open-type="contact">
<Message
color="#666666"
style="margin-right: 20px"
@click="toSetting"
size="22"
/>
</button>
<Setting style="margin-right: 20px" @click="toSetting" size="22" />
</view>
</view>
@@ -91,29 +100,19 @@
</view>
<!-- 我的服务 -->
<view class="user-center">
<view class="user-center" v-if="isLogin">
<view>我的服务</view>
<view class="box">
<template v-if="isLogin">
<view
class="box-mini"
v-for="item in userMenuList"
:key="item.id"
@click="toPage(item.url)"
>
<!-- <image :src="item.icon" /> -->
<IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view>
</view>
</template>
<button v-if="isLogin" class="box-mini" open-type="contact">
<IconFont
size="40"
name="http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png"
></IconFont>
<text class="label">联系客服</text>
</button>
<view
class="box-mini"
v-for="(item, idx) in userMenuList"
:key="idx"
@click="toPage(item.url)"
>
<!-- <image :src="item.icon" /> -->
<IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view>
</view>
</view>
</view>
@@ -130,7 +129,7 @@
@click="toPage('/pages/admin/add_order/index')"
>
<IconFont
size="50"
size="40"
:name="require('../../static/user/1-1.png')"
></IconFont>
</nut-grid-item>
@@ -141,7 +140,7 @@
@click="toPage('/pages/admin/verify/index')"
>
<IconFont
size="50"
size="40"
:name="require('../../static/user/1-2.png')"
></IconFont>
</nut-grid-item>
@@ -152,7 +151,7 @@
@click="toPage('/pages/admin/order_manage/index')"
>
<IconFont
size="50"
size="40"
:name="require('../../static/user/1-3.png')"
></IconFont>
</nut-grid-item>
@@ -163,7 +162,7 @@
@click="toPage('/pages/admin/withdrawal/index')"
>
<IconFont
size="50"
size="40"
:name="require('../../static/user/1-4.png')"
></IconFont>
</nut-grid-item>
@@ -184,7 +183,13 @@
<script lang="ts" setup>
import { ref } from "vue";
import { ArrowRight, Setting, IconFont, Scan } from "@nutui/icons-vue-taro";
import {
ArrowRight,
Setting,
IconFont,
Scan,
Message,
} from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import Auth from "@/components/Auth.vue";
import { getPersonalInfo, getPhone, bindParent } from "@/api/user";
@@ -229,10 +234,9 @@ const getUserInfo = async () => {
...res.data,
data: {
...res.data.data,
permission:
res.data.data.permission
? JSON.parse(res.data.data.permission)
: {},
permission: res.data.data.permission
? JSON.parse(res.data.data.permission)
: {},
},
};
Taro.setStorageSync("userInfo", userInfo.value);
@@ -262,13 +266,11 @@ const toOrderList = (e: number) => {
const userMenuList = ref([
{
id: 0,
label: "后结订单",
url: "/pages/users/pending_order/index",
icon: require("../../static/user/dd.png"),
},
{
id: 1,
label: "我的账户",
url: "/pages/users/account/index",
icon: "http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png",
@@ -280,23 +282,15 @@ const userMenuList = ref([
// icon: "http://jdt168.com/uploads/default/20220829/583fd6cbd729b24eab9c3cae20ae694d.png",
// },
{
id: 3,
label: "我的推广",
url: "/pages/users/distribution/index",
icon: "http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png",
},
// {
// id: 4,
// label: "关注商家",
// url: "",
// icon: "http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png",
// label: "聚合积分",
// url: "/pages/users/integral/index",
// icon: require("../../static/jhjf.png"),
// },
// {
// id: 5,
// label: '联系客服',
// url: '',
// icon: 'http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png'
// }
]);
const toSetting = () => {
@@ -370,6 +364,7 @@ const scanCode = () => {
justify-content: space-between;
box-sizing: border-box;
text-align: left;
padding-right: 20px;
.user-center-card__header__info {
margin-left: 20px;
@@ -381,6 +376,23 @@ const scanCode = () => {
.rightIcon {
height: 100px;
margin: auto;
display: flex;
justify-content: flex-start;
// align-items: center;
button {
padding: 0 !important;
margin: 0 !important;
background: transparent;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
position: relative;
top: -13px;
}
button::after {
border: none;
background: transparent;
}
}
}
@@ -433,25 +445,23 @@ const scanCode = () => {
background-color: #fff;
border-radius: 20px;
margin: 20px;
padding: 30px;
padding: 20px;
width: 710px;
box-sizing: border-box;
.box {
margin-top: 20px;
display: flex;
flex-wrap: wrap;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 20px;
box-sizing: border-box;
justify-content: flex-start;
.box-mini {
display: flex;
box-sizing: border-box;
width: 150px;
flex-direction: column;
align-items: center;
width: 150px;
margin-bottom: 20px;
margin-right: 13px;
.label {
font-size: 25px;
@@ -464,32 +474,6 @@ const scanCode = () => {
height: 80px;
}
}
button {
width: 150px;
position: relative;
margin-left: auto;
margin-right: auto;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
// font-size: 18px;
text-align: center;
text-decoration: none;
// line-height: 1;
line-height: 1.35;
// border-radius: 5px;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
color: #000000;
background-color: #fff;
height: 100%;
}
button::after {
border: none;
background: transparent;
}
}
}

View File

@@ -22,6 +22,10 @@ const tabsList = ref([
title: "活动赠送",
value: 4,
},
{
title: "聚合积分",
value: 5,
},
]);
const computerType = computed(() => {
@@ -81,13 +85,13 @@ const getList = async () => {
PageSize: page.value.PageSize,
Type: tabValue.value,
};
if (tabValue.value === 1 || tabValue.value === 3) {
if (tabValue.value === 1 || tabValue.value === 3 || tabValue.value === 5) {
res = await getBeanDetail(newData);
} else if (tabValue.value === 2) {
// delete data.value.Type;
Reflect.deleteProperty(data.value, "Type");
res = await getIntegralDetail(newData);
} else {
} else if (tabValue.value === 4) {
res = await getGiftRecord(newData);
}
data.value = res.data.data || [];
@@ -117,28 +121,31 @@ const getList = async () => {
<!-- <image class="img" src="https://picdm.sunbangyan.cn/2023/08/15/ste192.png"/> -->
</view>
</view>
<view class="tabs-box">
<view
v-for="item in tabsList"
:key="item.value"
@click="tabChange(item.value)"
>
<view class="text">{{ item.title }}</view>
<scroll-view scroll-x>
<view class="tabs-box">
<view
class="line"
:class="{ lineColor: item.value === tabValue }"
></view>
v-for="item in tabsList"
:key="item.value"
@click="tabChange(item.value)"
>
<view class="text">{{ item.title }}</view>
<view
class="line"
:class="{ lineColor: item.value === tabValue }"
></view>
</view>
</view>
</view>
</scroll-view>
<view v-if="data.length > 0">
<view v-if="tabValue === 1 || tabValue === 3">
<view v-if="tabValue === 1 || tabValue === 3 || tabValue === 5">
<view class="card-list" v-for="(item, index) in data" :key="index">
<view class="left">
<view>订单{{ item.oid }}</view>
<view>时间{{ item.add_time.slice(0, 10) }}</view>
</view>
<view class="right">
<view v-if="tabValue === 1" style="color: green"
<view v-if="tabValue === 1 || tabValue === 5" style="color: green"
>-
<text>{{ item.number }}积分</text>
</view>
@@ -245,12 +252,17 @@ const getList = async () => {
.tabs-box {
display: flex;
flex-direction: row;
justify-content: space-evenly;
// justify-content: space-evenly;
align-items: center;
height: auto;
background-color: #fff;
padding: 0 20px;
padding: 0 10px;
text-align: center;
overflow-x: auto;
view {
width: 200px;
}
.text {
margin: 10px 20px;

View File

@@ -4,6 +4,7 @@ import Taro from "@tarojs/taro";
import Pay from "@/components/Pay.vue";
import { getActiveOrderList, deleteActiveOrder } from "@/api/goods";
import { getOrderStatistics } from "@/api/order";
import { getUserPoint } from "@/api/admin";
const tabValue = ref(0);
@@ -94,13 +95,18 @@ const tabChange = (index: number) => {
getList();
};
Taro.useReachBottom(() => {
console.log("useReachBottom");
});
const openPay = (item: OrderList) => {
const openPay = async (item: OrderList) => {
isShowPay.value = true;
jfInfo.value = item.oid;
const mer_info = Taro.getStorageSync("mer_info");
const user_info = Taro.getStorageSync("userInfo");
const data = await getUserPoint({
phone: user_info.data.phone,
bid: mer_info.bid,
});
jfInfo.value = {
jh_info: data.data,
oid: item.oid,
};
};
const errPay = () => {
@@ -122,6 +128,12 @@ const closePay = () => {
getList();
};
const successPay = () => {
isShowPay.value = false;
jfInfo.value = {};
getList();
};
const toDetail = (item: any) => {
Taro.setStorageSync("item", item);
Taro.navigateTo({
@@ -271,6 +283,7 @@ const getTj = async () => {
:jfInfo="jfInfo"
:OrderType="2"
@errPay="errPay"
@successPay="successPay"
@closePay="closePay"
/>
</view>

View File

@@ -152,6 +152,7 @@
:jfInfo="jfInfo"
:OrderType="2"
@errPay="errPay"
@successPay="successPay"
@closePay="closePay"
/>
</view>
@@ -164,6 +165,7 @@ import { ref } from "vue";
import dayjs from "dayjs";
import duration from "dayjs/plugin/duration";
import Pay from "@/components/Pay.vue";
import { getUserPoint } from "@/api/admin";
dayjs.extend(duration);
@@ -218,9 +220,18 @@ const toAdder = () => {
});
};
const openPay = () => {
const openPay = async () => {
isShowPay.value = true;
jfInfo.value = Taro.getStorageSync("item");
const mer_info = Taro.getStorageSync("mer_info");
const user_info = Taro.getStorageSync("userInfo");
const data = await getUserPoint({
phone: user_info.data.phone,
bid: mer_info.bid,
});
jfInfo.value = {
jh_info: data.data,
oid: Taro.getStorageSync("item").oid,
};
};
const successPay = (val: boolean) => {

View File

@@ -17,10 +17,10 @@ const toPage = (url: string) => {
is-link
@click="toPage('/pages/users/user_setting/index')"
></nut-cell>
<nut-cell title="关于我们" is-link @click="toPage('1')"></nut-cell>
<!-- <nut-cell title="关于我们" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="资质证明" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="协议规则" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="隐私设置" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="隐私设置" is-link @click="toPage('1')"></nut-cell> -->
</nut-cell-group>
</view>
</template>