本平台禁止使用不合法信用卡和储蓄卡充值,一经发现封禁账号及设备,情节严重将报警处理!
+
本平台严厉打击刷单类诈骗行为,一旦发现我平台将追究其法律责任,同时保留追究损失的权利;我们呼吁用户如有收到以兼职赚钱为名义诱骗刷单的行为,请联系客服举报!情节严重者我们将交于警方处理,如执意配合刷单行为造成的损失我们平台概不负责!
-
+
{
block
size="large"
color="rgba(255, 240, 51, 1)"
+ @click="payHandler"
>立即充值
+
+
+
+
+
![]()
+
+
+ 向{{ userInfoNick }}(用户ID;{{ userInfoErbanNo }})充值{{ selectItem ? selectItem.money : "" }}元?
+
+
+
\ No newline at end of file
diff --git a/src/pages/Login.vue b/src/pages/Login.vue
deleted file mode 100644
index 83344a1..0000000
--- a/src/pages/Login.vue
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/pages/h5.vue b/src/pages/h5.vue
deleted file mode 100644
index d070fde..0000000
--- a/src/pages/h5.vue
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
- 立即下载
-
-
-
-
粤ICP备1000000000号-1 粤公网安备00000000000000
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/pages/web.vue b/src/pages/web.vue
deleted file mode 100644
index ac10ebe..0000000
--- a/src/pages/web.vue
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/routes/routes.ts b/src/routes/routes.ts
index 95212eb..f2989cc 100644
--- a/src/routes/routes.ts
+++ b/src/routes/routes.ts
@@ -1,7 +1,6 @@
const routes = [
{ path: "/", name: "root", redirect: "/home" },
{ path: "/home", name: "home", meta: { power: true }, component: () => import("../pages/Home.vue") },
- // { path: "/loginfo", name: "loginfo", component: () => import("../pages/Login.vue") },
{ path: "/nonetwork:text?", name: "nonetwork", props: true, component: () => import("../pages/error/NoNetwork.vue") },
{ path: "/noaccess/:text?", name: "noaccess", props: true, component: () => import("../pages/error/NoAccess.vue") },
{ path: "/empty/:text?", name: "empty", props: true, component: () => import("../pages/error/NoData.vue") },
diff --git a/src/store/baseInfo.ts b/src/store/baseInfo.ts
deleted file mode 100644
index b7a6728..0000000
--- a/src/store/baseInfo.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { defineStore } from "pinia";
-import { ref, computed } from "vue";
-import { getUserInfo } from "../api";
-
-const baseInfo = defineStore("baseInfo", () => {
- const user = ref
({});
- const loginUserInfo = () => {
- return new Promise((resolve, reject) => {
- getUserInfo({})
- .then((res: any) => {
- const { errcode, data } = res;
- if (errcode === 0) {
- const info = data.data;
- user.value = info;
- }
- resolve(res);
- })
- .catch((err: any) => {
- reject(err);
- });
- });
- };
- const userInfo = computed(() => {
- return user;
- });
-
- return { loginUserInfo, userInfo };
-});
-
-export default baseInfo;
\ No newline at end of file
diff --git a/src/store/pay.ts b/src/store/pay.ts
index c1bec63..9031ffb 100644
--- a/src/store/pay.ts
+++ b/src/store/pay.ts
@@ -1,7 +1,8 @@
import { ref, computed } from "vue";
import { defineStore } from "pinia";
-import { showFailToast } from "vant";
-import { chargeprodList, chargeUser } from "@/api/index";
+import { showNotify, showToast } from "vant";
+import { chargeprodList, chargeUser, submitPay } from "@/api/index";
+import { onBridgeReady } from "@/wx/index";
const pay = defineStore("pay", () => {
@@ -9,6 +10,12 @@ const pay = defineStore("pay", () => {
const dataId = ref("");
const channel = ref("");
+ const initParams = (data:any) => {
+ openId.value = data.openId || "";
+ dataId.value = data.dataId || "";
+ channel.value = data.channel || "";
+ };
+
const payLsit = ref>([]);
const receiveUser = ref({});
@@ -28,19 +35,36 @@ const pay = defineStore("pay", () => {
});
});
};
-
+
+
+ const selectItemIndex = ref(0);
+
+ const selectItem = computed(() => {
+ if (payLsit.value.length > 0) {
+ return payLsit.value[selectItemIndex.value];
+ }
+ else {
+ return null;
+ }
+ });
+
+ const setSelectIndex = (value: number) => {
+ selectItemIndex.value = value;
+ };
+
+
const getChargeUser = (erbanNo: string | number) => {
return new Promise((resolve, reject) => {
- chargeUser({erbanNo: erbanNo})
+ chargeUser({ erbanNo: erbanNo })
.then((res: any) => {
const { code, data, message } = res;
if (code === 200) {
receiveUser.value = data;
- }else if(code === 1404) {
- showFailToast(message || "您输入的账号不存在");
+ } else if (code === 1404) {
+ showNotify({ type: "warning", message: "您输入的账号不存在" });
}
- else{
- showFailToast(message);
+ else {
+ showNotify({ type: "warning", message: message });
}
resolve(res);
})
@@ -50,12 +74,66 @@ const pay = defineStore("pay", () => {
});
};
-
+ const wxConfig = ref({});
+
+ const payRequest = (data:any) => {
+ const params = Object.assign({
+ chargeProdId: selectItem.value.chargeProdId,
+ openId: openId.value,
+ app: "toupai",
+ data: dataId.value,
+ channel: channel.value
+ }, data);
+ return new Promise((resolve, reject) => {
+ submitPay(params)
+ .then((res: any) => {
+ const { code, data, message } = res;
+ if (code === 200) {
+ wxConfig.value = {
+ timeStamp: data.timestamp, //时间戳
+ nonceStr: data.nonce_str,
+ package: data.prepay_id,
+ paySign: data.sign,
+ appid: data.appid,
+ signType: data.sign_type
+ };
+ onBridgeReady(wxConfig.value);
+ resolve(res);
+ }
+ else if (code === 10108){
+ showToast("充值金额过大,需要进行身份认证");
+ } else if (code === 4002) {
+ showToast("该手机号未注册账号");
+ } else if (code === 1404) {
+ showToast("用户ID不存在");
+ } else if (code === 10960) {
+ showToast("功能暂未开放");
+ } else if (code === 1412) {
+ showToast("请输入用户ID进行充值");
+ } else if (code === 4005) {
+ showToast("订单超时,请重新进入页面操作!");
+ } else if (code === 7064) {
+ showToast("你的账号已被封禁,无法充值!");
+ } else {
+ showToast(message);
+ }
+ })
+ .catch((err: any) => {
+ reject(err);
+ });
+ });
+ };
+
+
const prizeList = computed(() => {
return payLsit.value;
});
- return { openId, dataId, channel, getChargeprod, getChargeUser, prizeList };
+ const receiveUserInfo = computed(() => {
+ return receiveUser.value;
+ });
+
+ return { openId, dataId, channel, getChargeprod, getChargeUser, prizeList, receiveUserInfo, selectItem, selectItemIndex, setSelectIndex, payRequest, initParams };
});
export default pay;
\ No newline at end of file
diff --git a/src/wx/index.ts b/src/wx/index.ts
index 96b777d..24c250c 100644
--- a/src/wx/index.ts
+++ b/src/wx/index.ts
@@ -1,6 +1,4 @@
-import { useRouter } from "vue-router";
-
-const router = useRouter();
+import { showDialog } from "vant";
const onBridgeReady = function (data: any) {
const { appid, timeStamp, nonceStr, signType, paySign } = data;
@@ -9,7 +7,7 @@ const onBridgeReady = function (data: any) {
"appId": appid,
"timeStamp": timeStamp,
"nonceStr": nonceStr,
- "package": data,
+ "package": data.package,
"signType": signType,
"paySign": paySign
},
@@ -17,12 +15,14 @@ const onBridgeReady = function (data: any) {
if (res.err_msg === "get_brand_wcpay_request:ok") {// 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
window.location.reload();
} else if (res.err_msg === "get_brand_wcpay_request:fail") {
- router.replace({
- path: "/payfailed"
+ showDialog({
+ title: "充值提示",
+ message: "充值失败!请稍后重试!"
});
} else {
- router.replace({
- path: "/payfailed"
+ showDialog({
+ title: "充值提示",
+ message: "充值失败!"
});
}
}