Merge branch 'master' of http://gitea.zianxin.com:8418/zianxin/biz-mobile-react-cloud
This commit is contained in:
commit
64540d3ad0
5 files changed
+84
-68
No files matched your search
@@ -36,7 +36,8 @@ VITE_APP_DEV_SERVICE = http://123.156.230.15:8089/api/ # 线上
|
||||
|
||||
# ******************** start 生产环境 start ****************
|
||||
#VITE_APP_PROD_SERVICE = http://123.156.228.134:48080/app-api
|
||||
VITE_APP_PROD_SERVICE = http://59.202.170.152:81/api
|
||||
#VITE_APP_PROD_SERVICE = http://59.202.170.152:81/api
|
||||
VITE_APP_PROD_SERVICE = https://stgl.pj.gov.cn/api
|
||||
# ******************** end 生产环境 end ********************
|
||||
|
||||
# VITE_DEV_ENV = dev
|
||||
|
||||
@@ -37,7 +37,10 @@ onLoad((options: any) => {
|
||||
if (!isEmpty(options.id)) {
|
||||
state.detailId = options.id
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
state.header = hooks.useDefaultHeader()
|
||||
=======
|
||||
>>>>>>> c3eaafa5d0575ebd0fa74be0180c5cfe8a9901ea
|
||||
})
|
||||
onShow(() => {
|
||||
getDetail()
|
||||
@@ -102,7 +105,10 @@ const doSubmit = async () => {
|
||||
images: [],
|
||||
applyReason: applyForm.reasonStr,
|
||||
applyDescription: applyForm.remark,
|
||||
<<<<<<< HEAD
|
||||
applyPicUrls: applyPicUrls.value,
|
||||
=======
|
||||
>>>>>>> c3eaafa5d0575ebd0fa74be0180c5cfe8a9901ea
|
||||
}
|
||||
try {
|
||||
uni.showLoading({ title: "申请中...", mask: false })
|
||||
@@ -187,6 +193,7 @@ const doSubmit = async () => {
|
||||
</tm-picker>
|
||||
</view>
|
||||
<view class="flex-col justify-center card p-x-20rpx p-y-30rpx m-b-20rpx">
|
||||
<<<<<<< HEAD
|
||||
<view class="sub-text-28">补充凭证图片</view>
|
||||
<view class="m-t-20rpx">
|
||||
<tm-upload-photo
|
||||
@@ -200,6 +207,7 @@ const doSubmit = async () => {
|
||||
<view class="sub-text-20 c-red!">注:图片大小不超过5M,最多上传6张</view>
|
||||
</view>
|
||||
<view class="flex-col justify-center card p-x-20rpx p-y-30rpx m-b-20rpx">
|
||||
======= >>>>>>> c3eaafa5d0575ebd0fa74be0180c5cfe8a9901ea
|
||||
<view class="sub-text-28">相关描述</view>
|
||||
<view class="m-t-20rpx">
|
||||
<tm-input
|
||||
|
||||
@@ -3,6 +3,8 @@ import { ref, reactive } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
import { isEmpty } from "radash"
|
||||
|
||||
import { filePath } from "@@/utils/file"
|
||||
|
||||
import { hooks, router, constant } from "@@/index"
|
||||
import { merchantApi, userApi, walletApi } from "@@/api"
|
||||
import isDevEnv from "@/sheep/utils/isDevEnv"
|
||||
@@ -64,7 +66,6 @@ const getUserInfo = () => {
|
||||
const userStorage = uni.getStorageSync(userInfoKey)
|
||||
if (!isEmpty(userStorage)) {
|
||||
state.userInfo = userStorage
|
||||
console.log(state.userInfo, "state.userInfo")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +158,7 @@ const onTabLogin = () => {
|
||||
<image
|
||||
class="w-100rpx h-100rpx rounded-full"
|
||||
v-if="state.userInfo?.sysUser?.avatar"
|
||||
:src="state.userInfo.sysUser.avatar"
|
||||
:src="filePath(state.userInfo.sysUser.avatar)"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<image class="w-100rpx h-100rpx rounded-full" v-else src="/static/icon/default-avatar.png" mode="aspectFill" />
|
||||
|
||||
+65
-63
@@ -1,83 +1,85 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { ref, reactive } from "vue"
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app"
|
||||
|
||||
import { hooks, constant, router } from "@@/index";
|
||||
import { userApi } from "@@/api";
|
||||
import { hooks, constant, router } from "@@/index"
|
||||
import { userApi } from "@@/api"
|
||||
|
||||
const data = {};
|
||||
const data = {}
|
||||
const state = reactive<any>({
|
||||
userInfo: null,
|
||||
});
|
||||
userInfo: null,
|
||||
})
|
||||
const applyForm = reactive<any>({
|
||||
username: "",
|
||||
password: "",
|
||||
});
|
||||
username: "",
|
||||
password: "",
|
||||
})
|
||||
const applyFormRules = reactive<any>({
|
||||
username: [{ required: true, message: "请输入用户名" }],
|
||||
password: [{ required: true, message: "请输入密码" }],
|
||||
});
|
||||
username: [{ required: true, message: "请输入用户名" }],
|
||||
password: [{ required: true, message: "请输入密码" }],
|
||||
})
|
||||
|
||||
onLoad(() => { });
|
||||
onLoad(() => {})
|
||||
|
||||
onShow(() => {
|
||||
const userInfoKey = constant.storageConstant.USERINFO;
|
||||
state.userInfo = uni.getStorageSync(userInfoKey);
|
||||
});
|
||||
const userInfoKey = constant.storageConstant.USERINFO
|
||||
state.userInfo = uni.getStorageSync(userInfoKey)
|
||||
})
|
||||
|
||||
const applyFormRef = ref<any>(null);
|
||||
const applyFormRef = ref<any>(null)
|
||||
const doSubmit = async () => {
|
||||
applyFormRef.value.submit();
|
||||
const { isPass } = applyFormRef.value.validate();
|
||||
if (!isPass) return;
|
||||
const tokenKey = constant.storageConstant.TOKEN;
|
||||
const userInfoKey = constant.storageConstant.USERINFO;
|
||||
uni.removeStorageSync(tokenKey)
|
||||
uni.showLoading({ title: "登录中...", mask: true });
|
||||
const res = await userApi.login({
|
||||
...applyForm,
|
||||
grant_type: 'password',
|
||||
scope: 'server',
|
||||
});
|
||||
if (res.code != 0) {
|
||||
uni.showToast({ title: res.msg + ",登录失败,请重新登录", icon: "error" });
|
||||
return;
|
||||
}
|
||||
uni.setStorageSync(tokenKey, res.data);
|
||||
const { data: userData } = await userApi.userInfo();
|
||||
uni.setStorageSync(userInfoKey, userData);
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: "登录成功", icon: "none" });
|
||||
router.back();
|
||||
};
|
||||
applyFormRef.value.submit()
|
||||
const { isPass } = applyFormRef.value.validate()
|
||||
if (!isPass) return
|
||||
const tokenKey = constant.storageConstant.TOKEN
|
||||
const userInfoKey = constant.storageConstant.USERINFO
|
||||
uni.removeStorageSync(tokenKey)
|
||||
uni.showLoading({ title: "登录中...", mask: true })
|
||||
const res = await userApi.login({
|
||||
...applyForm,
|
||||
grant_type: "password",
|
||||
scope: "server",
|
||||
})
|
||||
if (res.code != 0) {
|
||||
uni.showToast({ title: res.msg + ",登录失败,请重新登录", icon: "error" })
|
||||
return
|
||||
}
|
||||
uni.setStorageSync(tokenKey, res.data)
|
||||
const { data: userData } = await userApi.userInfo()
|
||||
uni.setStorageSync(userInfoKey, userData)
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: "登录成功", icon: "none" })
|
||||
router.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<crud-layout title="登录" bg="/static/page/blue-bg.png">
|
||||
<view class="h-30rpx" />
|
||||
<view class="card p-x-30rpx p-y-40rpx">
|
||||
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
|
||||
<tm-form-item name="username" label="用户名" :showBottom="false">
|
||||
<tm-input v-model="applyForm.username" placeholder="请输入用户名.." />
|
||||
</tm-form-item>
|
||||
<view class="h-30rpx" />
|
||||
<tm-form-item name="password" label="验证码" :showBottom="false">
|
||||
<tm-input password showEye v-model="applyForm.password" placeholder="请输入用户密码.." />
|
||||
</tm-form-item>
|
||||
</tm-form>
|
||||
</view>
|
||||
<view v-if="state.detailType != 'view'"
|
||||
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
|
||||
@tap="doSubmit">
|
||||
登录
|
||||
</view>
|
||||
</crud-layout>
|
||||
<crud-layout title="登录" bg="/static/page/blue-bg.png">
|
||||
<view class="h-30rpx" />
|
||||
<view class="card p-x-30rpx p-y-40rpx">
|
||||
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
|
||||
<tm-form-item name="username" label="用户名" :showBottom="false">
|
||||
<tm-input v-model="applyForm.username" placeholder="请输入用户名.." />
|
||||
</tm-form-item>
|
||||
<view class="h-30rpx" />
|
||||
<tm-form-item name="password" label="密码" :showBottom="false">
|
||||
<tm-input password showEye v-model="applyForm.password" placeholder="请输入用户密码.." />
|
||||
</tm-form-item>
|
||||
</tm-form>
|
||||
</view>
|
||||
<view
|
||||
v-if="state.detailType != 'view'"
|
||||
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
|
||||
@tap="doSubmit"
|
||||
>
|
||||
登录
|
||||
</view>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep() {
|
||||
.tmFormItemLabel {
|
||||
padding-bottom: 10rpx !important;
|
||||
}
|
||||
.tmFormItemLabel {
|
||||
padding-bottom: 10rpx !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -8,7 +8,7 @@ import { walletApi, payApi } from "@@/api"
|
||||
|
||||
const data = {
|
||||
payType: [
|
||||
{ text: "模拟支付", disabled: false, type: "0", value: "mock" },
|
||||
// { text: "模拟支付", disabled: false, type: "0", value: "mock" },
|
||||
{ text: "微信支付", disabled: true, type: "1", value: "wx_pub" },
|
||||
{ text: "支付宝支付", disabled: true, type: "2", value: "alipay_wap" },
|
||||
],
|
||||
@@ -16,7 +16,7 @@ const data = {
|
||||
|
||||
const state = reactive<any>({
|
||||
walletId: null,
|
||||
currentPayType: "0",
|
||||
currentPayType: null,
|
||||
currentRecharge: 0,
|
||||
userInfo: {},
|
||||
detail: {},
|
||||
@@ -56,6 +56,10 @@ const doPay = async () => {
|
||||
uni.showToast({ title: "请选择充值金额", icon: "none" })
|
||||
return
|
||||
}
|
||||
if (state.currentPayType == undefined) {
|
||||
uni.showToast({ title: "请选择支付方式", icon: "none" })
|
||||
return
|
||||
}
|
||||
try {
|
||||
uni.showLoading({ title: "充值中...", mask: true })
|
||||
const targetRecharge = state.rechargeList[state.currentRecharge]
|
||||
|
||||
Reference in new issue
Block a user