feat(custom): 新增消息订阅
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-08-27 17:06:59 +08:00
parent f199320de0
commit 1d8532eccf
104 changed files with 2350 additions and 2477 deletions

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "手机号登录",
navigationBarTitleText: '手机号登录',
});

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "我的推广",
navigationBarTitleText: '我的推广',
});

View File

@@ -5,8 +5,7 @@
class="item"
v-for="(item, index) in list"
:key="index"
@click="clickItem(item)"
>
@click="clickItem(item)">
<view class="text">
<IconFont :name="item.icon" color="red" size="30" />
<view>{{ item.label }}</view>
@@ -15,7 +14,7 @@
<view style="width: 45%"></view>
</view>
<!-- 二维码弹窗 -->
<nut-popup :style="{ padding: '30px 50px' }" v-model:visible="show">
<nut-popup :style="{padding: '30px 50px'}" v-model:visible="show">
<view class="popup">
<view>推荐人二维码绑定</view>
<image style="margin-top: 10px" :src="urlCode" />
@@ -25,30 +24,30 @@
</template>
<script setup lang="ts">
import { ref } from "vue";
import { IconFont } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import { getRefereeCode } from "@/api/user";
import {ref} from 'vue';
import {IconFont} from '@nutui/icons-vue-taro';
import Taro from '@tarojs/taro';
import {getRefereeCode} from '@/api/user';
const show = ref(false);
const urlCode = ref("");
const urlCode = ref('');
const list = ref([
{
id: 1,
icon: "scan",
label: "推广名片",
icon: 'scan',
label: '推广名片',
},
{
id: 2,
icon: "date",
label: "积分明细",
icon: 'date',
label: '积分明细',
},
{
id: 3,
icon: "my2",
label: "推广用户",
icon: 'my2',
label: '推广用户',
},
]);
@@ -58,7 +57,7 @@ const clickItem = async (item: any) => {
// "token"
// )}`;
Taro.showLoading({
title: "加载中",
title: '加载中',
mask: true,
});
const res = await getRefereeCode();
@@ -67,11 +66,11 @@ const clickItem = async (item: any) => {
Taro.hideLoading();
} else if (item.id === 2) {
Taro.navigateTo({
url: "/pages/users/distribution/integral/index",
url: '/pages/users/distribution/integral/index',
});
} else {
Taro.navigateTo({
url: "/pages/users/distribution/userlist/index",
url: '/pages/users/distribution/userlist/index',
});
}
};

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "积分明细",
navigationBarTitleText: '积分明细',
});

View File

@@ -4,8 +4,7 @@
<view
class="card-list"
v-for="(item, index) in (data as any[])"
:key="index"
>
:key="index">
<view class="left">
<view>昵称{{ item.nick_name }}</view>
<view>订单号{{ item.oid }}</view>
@@ -21,8 +20,7 @@
v-model="page.PageNum"
:total-items="page.ItemCount"
:items-per-page="page.PageSize"
@change="pageChange"
/>
@change="pageChange" />
</view>
<view v-else>
<nut-empty description="暂无积分明细" />
@@ -31,9 +29,9 @@
</template>
<script setup lang="ts">
import { useLoad, showToast } from "@tarojs/taro";
import { ref } from "vue";
import { getTGIntegralDetail } from "../../../../api/user";
import {useLoad, showToast} from '@tarojs/taro';
import {ref} from 'vue';
import {getTGIntegralDetail} from '../../../../api/user';
const data = ref([]);
@@ -61,7 +59,7 @@ const getData = async () => {
data.value = res.data.data || [];
page.value.ItemCount = res.data.count;
} catch (error) {
showToast({ title: error.msg, icon: "none" });
showToast({title: error.msg, icon: 'none'});
}
};
</script>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "推广人统计",
navigationBarTitleText: '推广人统计',
});

View File

@@ -4,8 +4,7 @@
<view
class="card-list"
v-for="(item, index) in (data as any[])"
:key="index"
>
:key="index">
<view class="left">
<image :src="item.avatarUrl" />
<view class="text">
@@ -19,8 +18,7 @@
v-model="page.PageNum"
:total-items="page.ItemCount"
:items-per-page="page.PageSize"
@change="pageChange"
/>
@change="pageChange" />
</view>
<view v-else>
<nut-empty description="暂无明细"></nut-empty>
@@ -29,9 +27,9 @@
</template>
<script setup lang="ts">
import { ref } from "vue";
import { useLoad, showToast } from "@tarojs/taro";
import { getTGUserList } from "../../../../api/user";
import {ref} from 'vue';
import {useLoad, showToast} from '@tarojs/taro';
import {getTGUserList} from '../../../../api/user';
useLoad(() => {
getData();
@@ -39,7 +37,7 @@ useLoad(() => {
const data = ref([]);
const page = ref({ PageNum: 1, PageSize: 10, ItemCount: 0 });
const page = ref({PageNum: 1, PageSize: 10, ItemCount: 0});
const pageChange = (e: number) => {
page.value.PageNum = e;
@@ -55,7 +53,7 @@ const getData = async () => {
data.value = res.data.data || [];
page.value.ItemCount = res.data.count;
} catch (error) {
showToast({ title: error.msg, icon: "none" });
showToast({title: error.msg, icon: 'none'});
}
};
</script>

View File

@@ -1,4 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "登录",
navigationStyle: "custom",
navigationBarTitleText: '登录',
navigationStyle: 'custom',
});

View File

@@ -143,24 +143,25 @@ const clickText = (type: number, text: string) => {
type="primary"
open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"
>手机号一键登录</nut-button
>
>手机号一键登录
</nut-button>
<nut-button style="margin-top: 15px" @click="toPage"
>手机号登录/注册</nut-button
>
>手机号登录/注册
</nut-button>
</view>
<view class="checkbox"
><nut-checkbox v-model="val"></nut-checkbox>
<view class="checkbox">
<nut-checkbox v-model="val"></nut-checkbox>
<view class="text">
阅读并同意
<view style="color: #fa2c1a" @click.stop="clickText(1, '用户协议')">
用户协议
</view>
&<view style="color: #fa2c1a" @click.stop="clickText(2, '隐私政策')">
隐私政策 </view
>&<view
style="color: #fa2c1a"
@click.stop="clickText(3, '积分使用规则')">
&
<view style="color: #fa2c1a" @click.stop="clickText(2, '隐私政策')">
隐私政策
</view>
&
<view style="color: #fa2c1a" @click.stop="clickText(3, '积分使用规则')">
积分使用规则
</view>
</view>

View File

@@ -1,4 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "我的订单",
navigationBarTitleText: '我的订单',
enablePullDownRefresh: true,
});

View File

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

View File

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

View File

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

View File

@@ -74,4 +74,4 @@
color: #333333;
font-size: 32px;
}
}
}

View File

@@ -20,8 +20,7 @@
<view class="center">
<nut-ellipsis
direction="end"
:content="itm.Goods.name"
></nut-ellipsis>
:content="itm.Goods.name"></nut-ellipsis>
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
</view>
<view class="num">
@@ -46,8 +45,7 @@
<nut-cell title="挂帐时间" :desc="data.payment_time"></nut-cell>
<nut-cell
title="订单状态"
:desc="get_status_text(data.status)"
></nut-cell>
:desc="get_status_text(data.status)"></nut-cell>
<nut-cell title="下单数量" :desc="String(data.count)"></nut-cell>
<nut-cell title="订单金额" :desc="String(data.payments)"></nut-cell>
<nut-cell title="应收金额" :desc="String(data.payments)"></nut-cell>
@@ -60,9 +58,9 @@
</template>
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { getUserAfterOrderDetail } from "../../../../api/user";
import {ref} from 'vue';
import Taro from '@tarojs/taro';
import {getUserAfterOrderDetail} from '../../../../api/user';
const data = ref<any>({});
@@ -75,7 +73,7 @@ Taro.useLoad((e: any) => {
const get_data = async () => {
Taro.showLoading({
title: "加载中",
title: '加载中',
});
const res = await getUserAfterOrderDetail({
bid: params.value.bid,
@@ -88,26 +86,26 @@ const get_data = async () => {
const get_color = (status: number) => {
switch (status) {
case 0:
return "#FD0100";
return '#FD0100';
case 1:
return "#03A113";
return '#03A113';
case 2:
return "#FFA938";
return '#FFA938';
}
};
const get_status_text = (status: number) => {
switch (status) {
case 0:
return "未付款";
return '未付款';
case 1:
return "已付款";
return '已付款';
case 2:
return "挂帐中";
return '挂帐中';
}
};
</script>
<style lang="scss">
@import "./index.scss";
@import './index.scss';
</style>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "个人设置",
navigationBarTitleText: '个人设置',
});

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "商户入驻",
navigationBarTitleText: '商户入驻',
});

View File

@@ -1,15 +1,15 @@
<script lang="ts" setup>
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { applyMer, getMerTypeList, getVerifyCode } from "@/api/user";
import Upload from "@/components/Upload.vue";
import Taro from '@tarojs/taro';
import {ref} from 'vue';
import {applyMer, getMerTypeList, getVerifyCode} from '@/api/user';
import Upload from '@/components/Upload.vue';
const visible = ref(false);
const merGooType = ref(false);
// 验证码按钮文字
const smsStr = ref("获取验证码");
const smsStr = ref('获取验证码');
// 验证码按钮是否禁用
const smsDisabled = ref(false);
@@ -34,23 +34,23 @@ const formValue = ref<{
bank_user: string;
address: string;
}>({
name: "",
userName: "",
phone: "",
mobile: "",
code: "",
classId: "",
merGooTypeStr: "",
name: '',
userName: '',
phone: '',
mobile: '',
code: '',
classId: '',
merGooTypeStr: '',
license: [],
front: [],
back: [],
head_photo: [],
img: [],
bank: "",
bank_card: "",
bank_name: "",
bank_user: "",
address: "",
bank: '',
bank_card: '',
bank_name: '',
bank_user: '',
address: '',
});
const merGooList = ref([]);
@@ -73,7 +73,7 @@ const getMerType = async () => {
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
icon: 'none',
});
}
};
@@ -87,22 +87,22 @@ const onOk = async () => {
front: formValue.value.front[0]?.url,
back: formValue.value.back[0]?.url,
head_photo: formValue.value.head_photo[0]?.url,
img: formValue.value.img.map((item: any) => item.url).join(","),
img: formValue.value.img.map((item: any) => item.url).join(','),
};
const res = await applyMer(data);
Taro.showToast({
title: res.msg,
icon: "none",
icon: 'none',
});
setTimeout(() => {
Taro.switchTab({
url: "/pages/index/index",
url: '/pages/index/index',
});
}, 3000);
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
icon: 'none',
});
}
visible.value = false;
@@ -116,7 +116,7 @@ const onOk = async () => {
// 获取验证码
const getSmsCode = () => {
ruleForm.value.validate("phone").then(async ({ valid }: any) => {
ruleForm.value.validate('phone').then(async ({valid}: any) => {
if (valid) {
try {
await getVerifyCode({
@@ -130,13 +130,13 @@ const getSmsCode = () => {
if (time === 0) {
clearInterval(timer);
smsDisabled.value = false;
smsStr.value = "获取验证码";
smsStr.value = '获取验证码';
}
}, 1000);
} catch (e) {
Taro.showToast({
title: e.message,
icon: "none",
icon: 'none',
});
}
}
@@ -152,12 +152,12 @@ const confirmGooType = (e: any) => {
// 提交
const submit = () => {
ruleForm.value.validate().then(({ valid, errors }: any) => {
ruleForm.value.validate().then(({valid, errors}: any) => {
if (valid) {
console.log("success", formValue.value);
console.log('success', formValue.value);
visible.value = true;
} else {
console.log("error submit!!", errors);
console.log('error submit!!', errors);
}
});
};
@@ -175,13 +175,11 @@ const submit = () => {
required: true,
message: '请输入商户名称',
},
]"
>
]">
<input
type="text"
v-model="formValue.name"
placeholder="请输入商户名称"
/>
placeholder="请输入商户名称" />
</nut-form-item>
<nut-form-item
required
@@ -192,13 +190,11 @@ const submit = () => {
required: true,
message: '请输入用户姓名',
},
]"
>
]">
<input
type="text"
v-model="formValue.userName"
placeholder="请输入真实姓名"
/>
placeholder="请输入真实姓名" />
</nut-form-item>
<nut-form-item
required
@@ -210,14 +206,12 @@ const submit = () => {
message: '请输入正确的电话号码',
regex: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
},
]"
>
]">
<input
type="text"
:maxlength="11"
v-model="formValue.phone"
placeholder="请输入联系电话"
/>
placeholder="请输入联系电话" />
</nut-form-item>
<nut-form-item
:rules="[
@@ -229,14 +223,12 @@ const submit = () => {
]"
label="店铺号码"
prop="phone"
required
>
required>
<input
v-model="formValue.mobile"
:maxlength="11"
placeholder="请输入店铺号码"
type="text"
/>
type="text" />
</nut-form-item>
<nut-form-item
required
@@ -247,15 +239,13 @@ const submit = () => {
required: true,
message: '请输入验证码',
},
]"
>
]">
<view class="yanCode">
<input
type="text"
:maxlength="6"
v-model="formValue.code"
placeholder="请输入验证码"
/>
placeholder="请输入验证码" />
<nut-button
style="width: 100px; padding: 3px"
plain
@@ -263,8 +253,7 @@ const submit = () => {
size="mini"
:disabled="smsDisabled"
round
@click="getSmsCode"
>
@click="getSmsCode">
{{ smsStr }}
</nut-button>
</view>
@@ -278,13 +267,11 @@ const submit = () => {
required: true,
message: '请输入店铺详细地址',
},
]"
>
]">
<input
type="text"
v-model="formValue.address"
placeholder="请输入店铺详细地址"
/>
placeholder="请输入店铺详细地址" />
</nut-form-item>
<nut-form-item
required
@@ -295,13 +282,11 @@ const submit = () => {
required: true,
message: '请输入法人',
},
]"
>
]">
<input
type="text"
v-model="formValue.bank_user"
placeholder="请输入法人"
/>
placeholder="请输入法人" />
</nut-form-item>
<nut-form-item
required
@@ -312,13 +297,11 @@ const submit = () => {
required: true,
message: '请输入账户名称',
},
]"
>
]">
<input
type="text"
v-model="formValue.bank_name"
placeholder="请输入账户名称"
/>
placeholder="请输入账户名称" />
</nut-form-item>
<nut-form-item
required
@@ -329,13 +312,11 @@ const submit = () => {
required: true,
message: '请输入银行名称',
},
]"
>
]">
<input
type="text"
v-model="formValue.bank"
placeholder="请输入银行名称"
/>
placeholder="请输入银行名称" />
</nut-form-item>
<nut-form-item
required
@@ -346,13 +327,11 @@ const submit = () => {
required: true,
message: '请输入银行卡号',
},
]"
>
]">
<input
type="text"
v-model="formValue.bank_card"
placeholder="请输入银行卡号"
/>
placeholder="请输入银行卡号" />
</nut-form-item>
<nut-form-item
required
@@ -363,27 +342,23 @@ const submit = () => {
required: true,
message: '请选择经营类目',
},
]"
>
]">
<input
type="text"
:disabled="true"
v-model="formValue.merGooTypeStr"
placeholder="请选择经营类目"
@click="merGooType = true"
/>
@click="merGooType = true" />
<nut-popup
position="bottom"
v-model:visible="merGooType"
:safe-area-inset-bottom="true"
:catch-move="true"
>
:catch-move="true">
<nut-picker
v-model:columns="merGooList"
title="商户类型"
@confirm="confirmGooType"
@cancel="merGooType = false"
></nut-picker>
@cancel="merGooType = false"></nut-picker>
</nut-popup>
</nut-form-item>
<nut-form-item
@@ -394,12 +369,11 @@ const submit = () => {
{
required: true,
message: '请上传营业执照',
validator: (value) => {
validator: value => {
return value.length > 0;
},
},
]"
>
]">
<Upload v-model:list="formValue.license" />
</nut-form-item>
<nut-form-item
@@ -410,12 +384,11 @@ const submit = () => {
{
required: true,
message: '法人身份证(正面)',
validator: (value) => {
validator: value => {
return value.length > 0;
},
},
]"
>
]">
<Upload v-model:list="formValue.front" />
</nut-form-item>
<nut-form-item
@@ -426,12 +399,11 @@ const submit = () => {
{
required: true,
message: '法人身份证(反面)',
validator: (value) => {
validator: value => {
return value.length > 0;
},
},
]"
>
]">
<Upload v-model:list="formValue.back" />
</nut-form-item>
<nut-form-item
@@ -442,12 +414,11 @@ const submit = () => {
{
required: true,
message: '请上传门头照',
validator: (value) => {
validator: value => {
return value.length > 0;
},
},
]"
>
]">
<Upload v-model:list="formValue.head_photo" />
</nut-form-item>
<nut-form-item
@@ -458,12 +429,11 @@ const submit = () => {
{
required: true,
message: '请上传店内照至少3张',
validator: (value) => {
validator: value => {
return value.length >= 3;
},
},
]"
>
]">
<Upload v-model:list="formValue.img" :max="5" multiple />
</nut-form-item>
@@ -479,8 +449,7 @@ const submit = () => {
title="入驻协议"
ok-text="已阅读并且同意"
v-model:visible="visible"
@ok="onOk"
>
@ok="onOk">
<view>入驻协议</view>
</nut-dialog>
</view>
@@ -488,7 +457,7 @@ const submit = () => {
<style lang="scss">
page {
background-image: url("~@/static/merchantBg.jpg");
background-image: url('~@/static/merchantBg.jpg');
background-size: 100%;
background-color: #e93423;
background-repeat: no-repeat;

View File

@@ -3,13 +3,13 @@
</template>
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getAgreement } from "../../../api/user";
import Taro from '@tarojs/taro';
import {ref} from 'vue';
import {getAgreement} from '../../../api/user';
const nodes = ref(``);
Taro.useLoad((e) => {
Taro.useLoad(e => {
Taro.setNavigationBarTitle({
title: e.name,
});
@@ -19,13 +19,13 @@ Taro.useLoad((e) => {
const get_data = async (type: string) => {
const res = await getAgreement();
switch (type) {
case "1":
case '1':
nodes.value = res.data.data.user;
break;
case "2":
case '2':
nodes.value = res.data.data.policy;
break;
case "3":
case '3':
nodes.value = res.data.data.integral;
break;
}
@@ -33,5 +33,5 @@ const get_data = async (type: string) => {
</script>
<style lang="scss">
@import "./index.scss";
@import './index.scss';
</style>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "个人资料",
navigationBarTitleText: '个人资料',
});