完成了登录模块
This commit is contained in:
parent
7c934ded5f
commit
3fe9c3c209
5
app.json
5
app.json
|
@ -1,8 +1,9 @@
|
||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/projectModule/projectDetail/projectDetail",
|
|
||||||
"pages/projectModule/projectList/projectList",
|
|
||||||
"pages/loginModule/pwdLogin/pwdLogin",
|
"pages/loginModule/pwdLogin/pwdLogin",
|
||||||
|
"pages/projectModule/projectList/projectList",
|
||||||
|
"pages/projectModule/projectNotice/projectNotice",
|
||||||
|
"pages/projectModule/projectDetail/projectDetail",
|
||||||
"pages/loginModule/register/register",
|
"pages/loginModule/register/register",
|
||||||
"pages/projectModule/applyCode/applyCode",
|
"pages/projectModule/applyCode/applyCode",
|
||||||
"pages/projectModule/userProject/userProject",
|
"pages/projectModule/userProject/userProject",
|
||||||
|
|
|
@ -41,12 +41,16 @@ Page({
|
||||||
}
|
}
|
||||||
// 3. 请求验证码
|
// 3. 请求验证码
|
||||||
wx.request({
|
wx.request({
|
||||||
url: baseUrl + '/userInfo/code',
|
url: baseUrl + '/userInfo/code/pwd',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: { templateString: phone },
|
data: { templateString: phone },
|
||||||
success: () => {
|
success: (res) => {
|
||||||
wx.showToast({ title: '验证码已发送', icon: 'none' });
|
if (res.data.code === 1) {
|
||||||
this._startCountdown(60);
|
wx.showToast({ title: '验证码已发送', icon: 'none' });
|
||||||
|
this._startCountdown(60);
|
||||||
|
} else {
|
||||||
|
wx.showToast({ title: res.data.message, icon: 'none' });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
wx.showToast({ title: '发送失败,请重试', icon: 'none' });
|
wx.showToast({ title: '发送失败,请重试', icon: 'none' });
|
||||||
|
@ -96,14 +100,14 @@ Page({
|
||||||
newPwd: '请输入新密码',
|
newPwd: '请输入新密码',
|
||||||
confirmPwd: '请再次输入新密码'
|
confirmPwd: '请再次输入新密码'
|
||||||
})) return;
|
})) return;
|
||||||
// 2. 密码一致
|
|
||||||
if (newPwd !== confirmPwd) {
|
|
||||||
return wx.showToast({ title: '两次密码不一致', icon: 'none' });
|
|
||||||
}
|
|
||||||
// 3. 格式校验手机号
|
// 3. 格式校验手机号
|
||||||
if (!/^1\d{10}$/.test(phone)) {
|
if (!/^1\d{10}$/.test(phone)) {
|
||||||
return wx.showToast({ title: '手机号格式不正确', icon: 'none' });
|
return wx.showToast({ title: '手机号格式不正确', icon: 'none' });
|
||||||
}
|
}
|
||||||
|
// 2. 密码一致
|
||||||
|
if (newPwd !== confirmPwd) {
|
||||||
|
return wx.showToast({ title: '两次密码不一致', icon: 'none' });
|
||||||
|
}
|
||||||
// 4. 发起重置请求
|
// 4. 发起重置请求
|
||||||
wx.request({
|
wx.request({
|
||||||
url: baseUrl + '/userInfo/mini/forgetPwd',
|
url: baseUrl + '/userInfo/mini/forgetPwd',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<view class="flex-col page">
|
<view class="flex-col page">
|
||||||
<image
|
<image
|
||||||
class="self-center image"
|
class="self-center image"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=f8bf0cb3ec8201f89a31727a655c0709.png"
|
src="https://img.picui.cn/free/2025/05/19/682a0dbe4085c.png"
|
||||||
/>
|
/>
|
||||||
<text class="self-center text">欢迎登陆—青橙校园</text>
|
<text class="self-center text">欢迎登陆—青橙校园</text>
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
}
|
}
|
||||||
.section_2 {
|
.section_2 {
|
||||||
margin-right: 4.42rpx;
|
margin-right: 4.42rpx;
|
||||||
padding: 20.16rpx 16.88rpx 19.22rpx;
|
padding: 25.16rpx 16.88rpx 24.22rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-radius: 9.38rpx;
|
border-radius: 9.38rpx;
|
||||||
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
box-shadow: 0rpx 3.75rpx 7.5rpx #00000040;
|
||||||
|
|
|
@ -63,12 +63,16 @@ Page({
|
||||||
|
|
||||||
// 3. 发送验证码请求
|
// 3. 发送验证码请求
|
||||||
wx.request({
|
wx.request({
|
||||||
url: baseUrl + '/userInfo/code',
|
url: baseUrl + '/userInfo/code/pwd',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: { templateString: phone },
|
data: { templateString: phone },
|
||||||
success: () => {
|
success: (res) => {
|
||||||
wx.showToast({ title: '验证码已发送', icon: 'none' });
|
if (res.data.code === 1) {
|
||||||
this._startCountdown(60);
|
wx.showToast({ title: '验证码已发送', icon: 'none' });
|
||||||
|
this._startCountdown(60);
|
||||||
|
} else {
|
||||||
|
wx.showToast({ title: res.data.message, icon: 'none' });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
wx.showToast({ title: '发送失败,请重试', icon: 'none' });
|
wx.showToast({ title: '发送失败,请重试', icon: 'none' });
|
||||||
|
@ -114,17 +118,24 @@ Page({
|
||||||
const { loginType, phone, credential, isAgree } = this.data;
|
const { loginType, phone, credential, isAgree } = this.data;
|
||||||
|
|
||||||
// 非空校验(手机号、密码/验证码、协议)
|
// 非空校验(手机号、密码/验证码、协议)
|
||||||
if (!validate(this.data, {
|
if (!phone.trim()) {
|
||||||
phone: '请输入手机号',
|
wx.showToast({ title: '请输入手机号', icon: 'none' });
|
||||||
credential: loginType === 'password' ? '请输入密码' : '请输入验证码',
|
|
||||||
isAgree: '请先同意用户协议'
|
|
||||||
})) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 手机号格式校验
|
// 手机号格式校验
|
||||||
if (!/^1\d{10}$/.test(phone)) {
|
if (!/^1\d{10}$/.test(phone)) {
|
||||||
return wx.showToast({ title: '手机号格式不正确', icon: 'none' });
|
return wx.showToast({ title: '手机号格式不正确', icon: 'none' });
|
||||||
}
|
}
|
||||||
|
if (!validate(this.data, {
|
||||||
|
credential: loginType === 'password' ? '请输入密码' : '请输入验证码',
|
||||||
|
})) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 2. 再单独校验协议勾选
|
||||||
|
if (!this.data.isAgree) {
|
||||||
|
wx.showToast({ title: '请先同意用户协议', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 组装请求
|
// 组装请求
|
||||||
const url = loginType === 'password'
|
const url = loginType === 'password'
|
||||||
|
@ -145,10 +156,17 @@ Page({
|
||||||
// ← 新增:将 token 存到本地缓存
|
// ← 新增:将 token 存到本地缓存
|
||||||
wx.setStorageSync('token', token);
|
wx.setStorageSync('token', token);
|
||||||
|
|
||||||
wx.showToast({ title: '登录成功', icon: 'success' });
|
wx.showToast({
|
||||||
wx.navigateTo({
|
title: '登录成功',
|
||||||
url: '/pages/projectModule/projectList/projectList'
|
icon: 'success',
|
||||||
|
duration: 1000
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/pages/projectModule/projectList/projectList',
|
||||||
|
})
|
||||||
|
}, 1000); // 1000ms = 1秒
|
||||||
} else {
|
} else {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: res.data.message || '登录失败',
|
title: res.data.message || '登录失败',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<view class="flex-col page">
|
<view class="flex-col page">
|
||||||
<image
|
<image
|
||||||
class="self-center image"
|
class="self-center image"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=f8bf0cb3ec8201f89a31727a655c0709.png"
|
src="https://img.picui.cn/free/2025/05/19/682a0dbe4085c.png"
|
||||||
/>
|
/>
|
||||||
<text class="self-center text">欢迎登陆—青橙校园</text>
|
<text class="self-center text">欢迎登陆—青橙校园</text>
|
||||||
<view class="flex-col self-stretch group">
|
<view class="flex-col self-stretch group">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { url } from "../../../request";
|
import { baseUrl } from "../../../request";
|
||||||
import { requestAsync } from "../../../utils/request";
|
import { requestAsync } from "../../../utils/request";
|
||||||
import { validate } from "../../../utils/validate";
|
import { validate } from "../../../utils/validate";
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ Page({
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
nickname: 'cxz',
|
nickname: '',
|
||||||
phone: '13888610253',
|
phone: '',
|
||||||
captcha: '111111',
|
captcha: '',
|
||||||
inviteCode: '123456',
|
inviteCode: '',
|
||||||
password: '123456',
|
password: '',
|
||||||
agree: false,
|
agree: false,
|
||||||
sending: false,
|
sending: false,
|
||||||
count: 60,
|
count: 60,
|
||||||
|
@ -21,12 +21,16 @@ Page({
|
||||||
|
|
||||||
sendSmsCode() {
|
sendSmsCode() {
|
||||||
const { phone } = this.data;
|
const { phone } = this.data;
|
||||||
|
if (!phone.trim()) {
|
||||||
|
wx.showToast({ title: '请输入手机号', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!/^1\d{10}$/.test(phone)) {
|
if (!/^1\d{10}$/.test(phone)) {
|
||||||
wx.showToast({ title: '请输入有效的手机号', icon: 'none' });
|
wx.showToast({ title: '请输入有效的手机号', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wx.request({
|
wx.request({
|
||||||
url: url + '/userInfo/code',
|
url: baseUrl + '/userInfo/code/register',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
header: { 'content-type': 'application/json' },
|
header: { 'content-type': 'application/json' },
|
||||||
data: {
|
data: {
|
||||||
|
@ -78,16 +82,8 @@ Page({
|
||||||
|
|
||||||
// 注册按钮点击
|
// 注册按钮点击
|
||||||
async onRegister() {
|
async onRegister() {
|
||||||
if (!this.data.agree) {
|
|
||||||
wx.showToast({
|
|
||||||
title: '请先勾选同意协议',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 调用通用校验,失败时已提示并 return
|
// 调用通用校验,失败时已提示并 return
|
||||||
if (!validate(this.data, {
|
if (!validate(this.data, {
|
||||||
agree: '请先勾选同意协议',
|
|
||||||
nickname: '请输入昵称',
|
nickname: '请输入昵称',
|
||||||
phone: '请输入手机号',
|
phone: '请输入手机号',
|
||||||
captcha: '请输入验证码',
|
captcha: '请输入验证码',
|
||||||
|
@ -96,9 +92,14 @@ Page({
|
||||||
})) {
|
})) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 2. 再单独校验协议勾选
|
||||||
|
if (!this.data.agree) {
|
||||||
|
wx.showToast({ title: '请先同意用户协议', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { nickname, phone, captcha, inviteCode, password } = this.data;
|
const { nickname, phone, captcha, inviteCode, password } = this.data;
|
||||||
const res = await requestAsync({
|
const res = await requestAsync({
|
||||||
url: url + '/userInfo/register',
|
url: baseUrl + '/userInfo/register',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
header: { 'content-type': 'application/json' },
|
header: { 'content-type': 'application/json' },
|
||||||
data: {
|
data: {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<view class="flex-col page">
|
<view class="flex-col page">
|
||||||
<image
|
<image
|
||||||
class="self-center image"
|
class="self-center image"
|
||||||
src="https://ide.code.fun/api/image?token=68274ca04ae84d00122fcf90&name=f8bf0cb3ec8201f89a31727a655c0709.png"
|
src="https://img.picui.cn/free/2025/05/19/682a0dbe4085c.png"
|
||||||
/>
|
/>
|
||||||
<text class="self-center text">欢迎登陆—青橙校园</text>
|
<text class="self-center text">欢迎登陆—青橙校园</text>
|
||||||
<view class="flex-col self-stretch group">
|
<view class="flex-col self-stretch group">
|
||||||
|
|
|
@ -1,65 +1,94 @@
|
||||||
// pages/projectModule/applyCode/applyCode.js
|
const { baseUrl } = require('../../../request');
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
data: {
|
||||||
|
projectId: '', // 项目id
|
||||||
|
promoCodeDesc: '', // 富文本推广码说明
|
||||||
|
salespersonName: '',
|
||||||
|
salespersonPhone: '',
|
||||||
|
mode: 'add' // 'add'(新增) or 'view'(查看资料)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 生命周期函数--监听页面加载
|
|
||||||
*/
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
this.setData({
|
||||||
},
|
projectId: options.id || '',
|
||||||
/**
|
promoCodeDesc: decodeURIComponent(options.desc || ''),
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
mode: options.mode || 'add',
|
||||||
*/
|
salespersonName: options.name ? decodeURIComponent(options.name) : '',
|
||||||
onReady() {
|
salespersonPhone: options.phone ? decodeURIComponent(options.phone) : ''
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
// 输入绑定
|
||||||
* 生命周期函数--监听页面显示
|
onNameInput(e) {
|
||||||
*/
|
// 仅在新增模式允许编辑
|
||||||
onShow() {
|
if (this.data.mode !== 'view') {
|
||||||
|
this.setData({ salespersonName: e.detail.value });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPhoneInput(e) {
|
||||||
|
if (this.data.mode !== 'view') {
|
||||||
|
this.setData({ salespersonPhone: e.detail.value });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
// 申请资料报备
|
||||||
* 生命周期函数--监听页面隐藏
|
onApply() {
|
||||||
*/
|
// 如果是查看模式,阻止提交
|
||||||
onHide() {
|
if (this.data.mode === 'view') return;
|
||||||
|
|
||||||
},
|
const { salespersonName, salespersonPhone, projectId } = this.data;
|
||||||
|
|
||||||
/**
|
if (!salespersonName.trim()) {
|
||||||
* 生命周期函数--监听页面卸载
|
wx.showToast({ title: '请输入业务员姓名', icon: 'none' });
|
||||||
*/
|
return;
|
||||||
onUnload() {
|
}
|
||||||
|
const phoneReg = /^1[3-9]\d{9}$/;
|
||||||
},
|
if (!salespersonPhone.trim()) {
|
||||||
|
wx.showToast({ title: '请输入手机号', icon: 'none' });
|
||||||
/**
|
return;
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
}
|
||||||
*/
|
if (!phoneReg.test(salespersonPhone.trim())) {
|
||||||
onPullDownRefresh() {
|
wx.showToast({ title: '手机号格式不正确', icon: 'none' });
|
||||||
|
return;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
|
const token = wx.getStorageSync('token');
|
||||||
|
wx.request({
|
||||||
|
url: baseUrl + '/promoCodeApply/apply',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
'Authorization': token,
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
salespersonName,
|
||||||
|
salespersonPhone,
|
||||||
|
projectId
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '申请成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
wx.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.message || '申请失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '网络错误',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
|
@ -2,17 +2,32 @@
|
||||||
<view class="flex-col section">
|
<view class="flex-col section">
|
||||||
<view class="flex-col section_2">
|
<view class="flex-col section_2">
|
||||||
<text class="self-start font text">业务员姓名</text>
|
<text class="self-start font text">业务员姓名</text>
|
||||||
<input class="flex-col justify-start items-start view text-wrapper input" placeholder="请输入" />
|
<input class="flex-col justify-start items-start view text-wrapper input"
|
||||||
|
placeholder="请输入"
|
||||||
|
value="{{salespersonName}}"
|
||||||
|
bindinput="onNameInput"
|
||||||
|
disabled="{{mode === 'view'}}" />
|
||||||
<view class="self-stretch divider"></view>
|
<view class="self-stretch divider"></view>
|
||||||
<text class="self-start font text_3">业务员手机号</text>
|
<text class="self-start font text_3">业务员手机号</text>
|
||||||
<input class="flex-col justify-start items-start view text-wrapper input_1" placeholder="请输入" />
|
<input class="flex-col justify-start items-start view text-wrapper input_1"
|
||||||
|
placeholder="请输入"
|
||||||
|
value="{{salespersonPhone}}"
|
||||||
|
bindinput="onPhoneInput"
|
||||||
|
disabled="{{mode === 'view'}}" />
|
||||||
<view class="self-stretch divider"></view>
|
<view class="self-stretch divider"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col group">
|
<view style="padding-top: {{mode === 'view' ? '0' : '80.63rpx'}}" class="flex-col group">
|
||||||
<view class="flex-col justify-start items-center text-wrapper_2">
|
<!-- “申请资料报备”按钮只在新增模式显示 -->
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper_2"
|
||||||
|
bindtap="onApply"
|
||||||
|
wx:if="{{mode !== 'view'}}">
|
||||||
<text class="font text_4">申请资料报备</text>
|
<text class="font text_4">申请资料报备</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col justify-start section_3 mt-27"><view class="section_4"></view></view>
|
<view class="flex-col justify-start section_3 mt-27">
|
||||||
|
<view class="section_4">
|
||||||
|
<rich-text class="promo-desc" nodes="{{promoCodeDesc}}"></rich-text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
|
@ -67,8 +67,6 @@
|
||||||
margin-left: 42.19rpx;
|
margin-left: 42.19rpx;
|
||||||
margin-right: 44.06rpx;
|
margin-right: 44.06rpx;
|
||||||
background-color: #ffffff00;
|
background-color: #ffffff00;
|
||||||
height: 808.58rpx;
|
|
||||||
border: solid 1.88rpx #000000;
|
|
||||||
}
|
}
|
||||||
.input {
|
.input {
|
||||||
padding: 13.13rpx 18.75rpx 15rpx 18.75rpx;
|
padding: 13.13rpx 18.75rpx 15rpx 18.75rpx;
|
||||||
|
|
|
@ -1,72 +1,141 @@
|
||||||
Page({
|
const { baseUrl } = require('../../../request');
|
||||||
|
|
||||||
/**
|
Page({
|
||||||
* 页面的初始数据
|
|
||||||
*/
|
|
||||||
data: {
|
data: {
|
||||||
items: [null, null, null],
|
projectDetail: {},
|
||||||
items_1: [null, null, null],
|
notificationList: [],
|
||||||
items_2: [null, null, null],
|
settlementDetailList: [],
|
||||||
activeTab: 0
|
promoCodeList: [],
|
||||||
|
activeTab: 0,
|
||||||
|
id: null,
|
||||||
|
showPromoPop: false,
|
||||||
|
currentQrcode: '',
|
||||||
|
currentPromoLink: ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onLoad(options) {
|
||||||
|
const id = options.id;
|
||||||
|
this.setData({ id });
|
||||||
|
},
|
||||||
|
|
||||||
|
// 每次页面展示都刷新(含navigateBack返回时)
|
||||||
|
onShow() {
|
||||||
|
// 防止id为null
|
||||||
|
if (this.data.id) {
|
||||||
|
this.fetchProjectDetail(this.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
fetchProjectDetail(id) {
|
||||||
|
const token = wx.getStorageSync('token');
|
||||||
|
wx.request({
|
||||||
|
url: baseUrl + '/project/query/id', // 替换为你的接口地址
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
Authorization: token
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
id
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
const detail = res.data.data || {};
|
||||||
|
this.setData({
|
||||||
|
projectDetail: detail,
|
||||||
|
notificationList: detail.projectNotificationVOList || [],
|
||||||
|
settlementDetailList: detail.projectAllDetailVOList || [],
|
||||||
|
promoCodeList: detail.promoCodeApplyVOList || []
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.message || '数据获取失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
wx.showToast({
|
||||||
|
title: '网络错误',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
switchTab(e) {
|
switchTab(e) {
|
||||||
const idx = +e.currentTarget.dataset.index;
|
const idx = +e.currentTarget.dataset.index;
|
||||||
this.setData({ activeTab: idx });
|
this.setData({ activeTab: idx });
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
// “开码记录”跳tab
|
||||||
* 生命周期函数--监听页面加载
|
goToPromoTab() {
|
||||||
*/
|
this.setData({ activeTab: 1 });
|
||||||
onLoad(options) {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
// “新增推广码”跳转
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
addPromoCode() {
|
||||||
*/
|
const id = this.data.id;
|
||||||
onReady() {
|
const promoCodeDesc = this.data.projectDetail.applyPromoCodeDesc || '';
|
||||||
|
// encodeURIComponent 防止有特殊字符
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/projectModule/applyCode/applyCode?id=${id}&desc=${encodeURIComponent(promoCodeDesc)}&mode=add`
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
// “结算明细”跳转
|
||||||
* 生命周期函数--监听页面显示
|
goToSettlementDetail() {
|
||||||
*/
|
wx.navigateTo({
|
||||||
onShow() {
|
url: '/pages/settlementDetail/settlementDetail' // 替换为你的页面路径
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
// 推广码-查看资料
|
||||||
* 生命周期函数--监听页面隐藏
|
goToPromoMaterial(e) {
|
||||||
*/
|
const id = e.currentTarget.dataset.id; // 项目id
|
||||||
onHide() {
|
const name = e.currentTarget.dataset.name; // 业务员姓名
|
||||||
|
const phone = e.currentTarget.dataset.phone; // 业务员手机号
|
||||||
|
const promoCodeDesc = this.data.projectDetail.applyPromoCodeDesc || '';
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/projectModule/applyCode/applyCode?id=${id}&desc=${encodeURIComponent(promoCodeDesc)}&mode=view&name=${encodeURIComponent(name)}&phone=${encodeURIComponent(phone)}`
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
// 弹出作业码弹窗
|
||||||
* 生命周期函数--监听页面卸载
|
onShowPromoPop(e) {
|
||||||
*/
|
const qrcode = e.currentTarget.dataset.qrcode;
|
||||||
onUnload() {
|
const link = e.currentTarget.dataset.link;
|
||||||
|
this.setData({
|
||||||
|
showPromoPop: true,
|
||||||
|
currentQrcode: qrcode,
|
||||||
|
currentPromoLink: link
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
onClosePromoPop() {
|
||||||
|
this.setData({ showPromoPop: false });
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 复制推广码
|
||||||
|
copyPromoCode(e) {
|
||||||
|
const code = e.currentTarget.dataset.code;
|
||||||
|
wx.setClipboardData({
|
||||||
|
data: code,
|
||||||
|
success: function () {
|
||||||
|
wx.showToast({
|
||||||
|
title: '复制成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
goToNotificationDetail(e) {
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
const id = e.currentTarget.dataset.id;
|
||||||
*/
|
wx.navigateTo({
|
||||||
onPullDownRefresh() {
|
url: `/pages/projectModule/projectNotice/projectNotice?id=${id}` // 路径请根据你的项目实际调整
|
||||||
|
});
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 页面上拉触底事件的处理函数
|
|
||||||
*/
|
|
||||||
onReachBottom() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户点击右上角分享
|
|
||||||
*/
|
|
||||||
onShareAppMessage() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
});
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
{
|
{
|
||||||
"usingComponents": {}
|
"usingComponents": {
|
||||||
|
"promo-pop": "../promoPop/promoPop"
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -3,13 +3,13 @@
|
||||||
<view class="flex-row items-center">
|
<view class="flex-row items-center">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image"
|
class="shrink-0 image"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=8eafcf3d54491c51c90f97a31451bc70.png"
|
src="{{projectDetail.projectImage}}"
|
||||||
/>
|
/>
|
||||||
<view class="flex-col flex-1 group_1 ml-20">
|
<view class="flex-col flex-1 group_1 ml-20">
|
||||||
<text class="self-start font text">美团省钱包</text>
|
<text class="self-start font text">{{projectDetail.projectName}}</text>
|
||||||
<view class="flex-row items-center self-stretch mt-7">
|
<view class="flex-row items-center self-stretch mt-7">
|
||||||
<text class="flex-1 font_2 text_2">不限制推广方式、不限美团新老用户,要求美团闪购新用户或...</text>
|
<text class="flex-1 font_2 text_2">{{projectDetail.projectDescription}}</text>
|
||||||
<view class="flex-row items-center shrink-0 section ml-13">
|
<view class="flex-row items-center shrink-0 section ml-13" bindtap="goToSettlementDetail">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_2"
|
class="shrink-0 image_2"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=454188c52cef0841952f46f00fe340b4.png"
|
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=454188c52cef0841952f46f00fe340b4.png"
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="self-start group_2 mt-7">
|
<view class="self-start group_2 mt-7">
|
||||||
<text class="font_2 text_4">最高价</text>
|
<text class="font_2 text_4">最高价</text>
|
||||||
<text class="font_4 text_5">¥7</text>
|
<text class="font_4 text_5">¥{{projectDetail.projectPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -40,6 +40,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col group_6 ">
|
<view class="flex-col group_6 ">
|
||||||
|
<!-- 项目详情tab -->
|
||||||
<view wx:if="{{ activeTab === 0 }}" class="flex-col section_3">
|
<view wx:if="{{ activeTab === 0 }}" class="flex-col section_3">
|
||||||
<view class="flex-row items-center">
|
<view class="flex-row items-center">
|
||||||
<image
|
<image
|
||||||
|
@ -50,20 +51,20 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col mt-13">
|
<view class="flex-col mt-13">
|
||||||
<view
|
<view
|
||||||
class="flex-row justify-center items-center relative list-item_1 mt-18"
|
class="flex-row justify-center items-center relative list-item_1 mt-8"
|
||||||
wx:for="{{items}}"
|
wx:for="{{notificationList}}"
|
||||||
wx:for-item="item"
|
wx:key="id"
|
||||||
wx:for-index="index"
|
bindtap="goToNotificationDetail"
|
||||||
wx:key="index"
|
data-id="{{item.id}}"
|
||||||
>
|
>
|
||||||
<view class="flex-col justify-start items-center text-wrapper pos">
|
<view class="flex-col justify-start items-center text-wrapper pos">
|
||||||
<text class="font_3 text_9">最新</text>
|
<text class="font_3 text_9">最新</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="font_6 text_10">美团省钱包-春季活动价格上调通知~</text>
|
<text class="font_6 text_10">{{item.notificationTitle}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{ activeTab === 0 }}" class="flex-col section_4">
|
<view wx:if="{{ activeTab === 0 }}" class="flex-col section_4">
|
||||||
<view class="flex-row items-center">
|
<view class="flex-row items-center">
|
||||||
<image
|
<image
|
||||||
class="image_4"
|
class="image_4"
|
||||||
|
@ -79,51 +80,48 @@
|
||||||
<view class="flex-col group_8">
|
<view class="flex-col group_8">
|
||||||
<view
|
<view
|
||||||
class="flex-row justify-between items-center section_6"
|
class="flex-row justify-between items-center section_6"
|
||||||
wx:for="{{items_1}}"
|
wx:for="{{settlementDetailList}}"
|
||||||
wx:for-item="item"
|
wx:key="id"
|
||||||
wx:for-index="index"
|
|
||||||
wx:key="index"
|
|
||||||
>
|
>
|
||||||
<text class="font_7 text_12">3.6元购买30元券包</text>
|
<text class="font_7 text_12">{{item.projectDetailName}}</text>
|
||||||
<text class="font_4 text_13">0.30</text>
|
<text class="font_4 text_13">{{item.projectSettlementPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{ activeTab === 0 }}" class="flex-col list">
|
<!-- 结算说明/项目说明/项目流程,图标已补充 -->
|
||||||
|
<view wx:if="{{ activeTab === 0 }}" class="flex-col list">
|
||||||
<view class="flex-col relative section_7">
|
<view class="flex-col relative section_7">
|
||||||
<text class="self-start font_5 text_15">结算说明</text>
|
<text class="self-start font_5 text_15">结算说明</text>
|
||||||
<view class="self-stretch section_8 view_2"></view>
|
|
||||||
<image
|
<image
|
||||||
class="image_5 pos_4"
|
class="image_5 pos_4"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
|
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
|
||||||
/>
|
/>
|
||||||
|
<rich-text class="self-stretch section_8 view_2" nodes="{{projectDetail.settlementDesc}}"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col relative section_1 mt-21">
|
<view class="flex-col relative section_1 mt-21">
|
||||||
<text class="self-start font_5 text_1">项目说明</text>
|
<text class="self-start font_5 text_1">项目说明</text>
|
||||||
<view class="self-stretch section_8"></view>
|
|
||||||
<image
|
<image
|
||||||
class="image_5 pos_5"
|
class="image_5 pos_5"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
|
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
|
||||||
/>
|
/>
|
||||||
|
<rich-text class="self-stretch section_8" nodes="{{projectDetail.projectDesc}}"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col relative section_1 mt-21">
|
<view class="flex-col relative section_1 mt-21">
|
||||||
<text class="self-start font_5 text_1">项目说明</text>
|
<text class="self-start font_5 text_1">项目流程</text>
|
||||||
<view class="self-stretch section_8"></view>
|
|
||||||
<image
|
<image
|
||||||
class="image_5 pos_6"
|
class="image_5 pos_6"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
|
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=3e6eb5208e8ac55c7b94af5272899bbb.png"
|
||||||
/>
|
/>
|
||||||
|
<rich-text class="self-stretch section_8" nodes="{{projectDetail.projectFlow}}"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{ activeTab === 1 }}"
|
<!-- 我的推广码tab -->
|
||||||
class="flex-col list_2">
|
<view wx:if="{{ activeTab === 1 }}" class="flex-col list_2">
|
||||||
<view
|
<view
|
||||||
class="flex-col relative list-item_2 mt-18"
|
class="flex-col relative list-item_2 mt-18"
|
||||||
wx:for="{{items_2}}"
|
wx:for="{{promoCodeList}}"
|
||||||
wx:for-item="item"
|
wx:key="id"
|
||||||
wx:for-index="index"
|
|
||||||
wx:key="index"
|
|
||||||
>
|
>
|
||||||
<view class="flex-col justify-start items-start text-wrapper_2">
|
<view class="flex-col justify-start items-start text-wrapper_2">
|
||||||
<text class="font_8 text_16">审核通过</text>
|
<text class="font_8 text_16">审核通过</text>
|
||||||
|
@ -131,24 +129,32 @@
|
||||||
<view class="flex-col group_13">
|
<view class="flex-col group_13">
|
||||||
<view class="flex-row justify-between items-center self-stretch">
|
<view class="flex-row justify-between items-center self-stretch">
|
||||||
<view class="flex-col group_9">
|
<view class="flex-col group_9">
|
||||||
<text class="self-stretch font_9">业务员:陈新知 15888610253</text>
|
<text class="self-stretch font_9">业务员:{{item.salespersonName}} {{item.salespersonPhone}}</text>
|
||||||
<text class="self-start font_10 text_17">绑定日期:2025-05-16 19:09</text>
|
<text class="self-start font_10 text_17">绑定日期:{{item.createTime}}</text>
|
||||||
<view class="flex-row items-center self-stretch group_11">
|
<view class="flex-row items-center self-stretch group_11">
|
||||||
<text class="font_11 text_18">推广码id:ykhlshy118</text>
|
<text class="font_11 text_18">推广码id:{{item.promoCodeInfoKey}}</text>
|
||||||
<text class="font_12 text_19 ml-5">复制</text>
|
<text class="font_12 text_19 ml-5" bindtap="copyPromoCode" data-code="{{item.promoCodeInfoKey}}">复制</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
class="image_6"
|
class="image_6"
|
||||||
src="https://ide.code.fun/api/image?token=6827630f4ae84d00122fd0c8&name=104fd70b7b2ec03ffa2797e80a16a13a.png"
|
src="https://img.picui.cn/free/2025/05/18/6829ff0fb5ed6.png"
|
||||||
|
bindtap="onShowPromoPop"
|
||||||
|
data-qrcode="{{item.promoCodeImage}}"
|
||||||
|
data-link="{{item.promoCodeLink}}"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<text class="self-end font_13 text_27">查看推广码</text>
|
<text class="self-end font_13 text_27" bindtap="onShowPromoPop"
|
||||||
|
data-qrcode="{{item.promoCodeImage}}"
|
||||||
|
data-link="{{item.promoCodeLink}}"
|
||||||
|
>查看推广码</text>
|
||||||
<view class="flex-row self-stretch group_12">
|
<view class="flex-row self-stretch group_12">
|
||||||
<view class="flex-col justify-start items-center text-wrapper_3">
|
<view class="flex-col justify-start items-center text-wrapper_3" bindtap="goToSettlementDetail">
|
||||||
<text class="font_14 text_21">结算明细</text>
|
<text class="font_14 text_21">结算明细</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col justify-start items-center text-wrapper_4 ml-12">
|
<view class="flex-col justify-start items-center text-wrapper_4 ml-12" bindtap="goToPromoMaterial" data-id="{{item.projectId}}"
|
||||||
|
data-name="{{item.salespersonName}}"
|
||||||
|
data-phone="{{item.salespersonPhone}}">
|
||||||
<text class="font_15 text_22">查看资料</text>
|
<text class="font_15 text_22">查看资料</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -159,7 +165,15 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row mt-57 foot-bottom">
|
<view class="flex-row mt-57 foot-bottom">
|
||||||
<view class="flex-col justify-start items-center text-wrapper_5"><text class="font_5 text_23">开码记录</text></view>
|
<view class="flex-col justify-start items-center text-wrapper_5" bindtap="goToPromoTab"><text class="font_5 text_23">开码记录</text></view>
|
||||||
<view class="flex-col justify-start items-center text-wrapper_6"><text class="font_5 text_24">新增推广码</text></view>
|
<view class="flex-col justify-start items-center text-wrapper_6" bindtap="addPromoCode"><text class="font_5 text_24">新增推广码</text></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<promo-pop
|
||||||
|
show="{{showPromoPop}}"
|
||||||
|
qrcode="{{currentQrcode}}"
|
||||||
|
link="{{currentPromoLink}}"
|
||||||
|
close-icon="https://ide.code.fun/api/image?token=6829dc904ae84d00122fe075&name=f319b81f1964ad8f099a67a770941d6a.png"
|
||||||
|
bind:close="onClosePromoPop"
|
||||||
|
/>
|
||||||
|
|
|
@ -140,7 +140,7 @@
|
||||||
line-height: 25.88rpx;
|
line-height: 25.88rpx;
|
||||||
}
|
}
|
||||||
.list-item_1 {
|
.list-item_1 {
|
||||||
padding: 7.07rpx 0 5.94rpx;
|
padding: 17.07rpx 0 15.94rpx;
|
||||||
}
|
}
|
||||||
.list-item_1:first-child {
|
.list-item_1:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
@ -169,6 +169,7 @@
|
||||||
.text_10 {
|
.text_10 {
|
||||||
font-size: 26.25rpx;
|
font-size: 26.25rpx;
|
||||||
line-height: 24.49rpx;
|
line-height: 24.49rpx;
|
||||||
|
margin-left: -30%;
|
||||||
}
|
}
|
||||||
.section_4 {
|
.section_4 {
|
||||||
margin-top: 41.25rpx;
|
margin-top: 41.25rpx;
|
||||||
|
@ -230,8 +231,6 @@
|
||||||
margin-right: 2.14rpx;
|
margin-right: 2.14rpx;
|
||||||
margin-top: 35.92rpx;
|
margin-top: 35.92rpx;
|
||||||
background-color: #ffffff00;
|
background-color: #ffffff00;
|
||||||
height: 538.13rpx;
|
|
||||||
border: solid 1.88rpx #000000;
|
|
||||||
}
|
}
|
||||||
.view_2 {
|
.view_2 {
|
||||||
margin-top: 35.94rpx;
|
margin-top: 35.94rpx;
|
||||||
|
@ -298,6 +297,7 @@
|
||||||
width: 310.05rpx;
|
width: 310.05rpx;
|
||||||
}
|
}
|
||||||
.font_9 {
|
.font_9 {
|
||||||
|
width: 400rpx;
|
||||||
font-size: 24.38rpx;
|
font-size: 24.38rpx;
|
||||||
font-family: Times New Roman;
|
font-family: Times New Roman;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
|
@ -311,7 +311,7 @@
|
||||||
}
|
}
|
||||||
.text_17 {
|
.text_17 {
|
||||||
margin-top: 20.66rpx;
|
margin-top: 20.66rpx;
|
||||||
width: 279.38rpx;
|
width: 400.38rpx;
|
||||||
}
|
}
|
||||||
.group_11 {
|
.group_11 {
|
||||||
margin-top: 8.55rpx;
|
margin-top: 8.55rpx;
|
||||||
|
@ -347,9 +347,11 @@
|
||||||
}
|
}
|
||||||
.text_27 {
|
.text_27 {
|
||||||
margin-right: 25.74rpx;
|
margin-right: 25.74rpx;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 15%;
|
||||||
}
|
}
|
||||||
.group_12 {
|
.group_12 {
|
||||||
margin-top: 4.59rpx;
|
margin-top: 24.59rpx;
|
||||||
}
|
}
|
||||||
.text-wrapper_3 {
|
.text-wrapper_3 {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// pages/projectModule/projectList/projectList.js
|
|
||||||
const { baseUrl } = require('../../../request');
|
const { baseUrl } = require('../../../request');
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<text class="mt-10 font_4">最高价</text>
|
<text class="mt-10 font_4">最高价</text>
|
||||||
<text class="mt-10 font_5 text_3">¥{{item.projectPrice}}</text>
|
<text class="mt-10 font_5 text_3">¥{{item.projectPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="ml-4 flex-col items-start">
|
<view class="ml-4 flex-col items-start promo">
|
||||||
<!-- 正在推广 -->
|
<!-- 正在推广 -->
|
||||||
<text class="font_4">正在推广</text>
|
<text class="font_4">正在推广</text>
|
||||||
<text class="mt-8 font_6 text_4">{{item.currentPromotionCount}}人</text>
|
<text class="mt-8 font_6 text_4">{{item.currentPromotionCount}}人</text>
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* pages/projectModule/projectList/projectList.wxss */
|
|
||||||
|
|
||||||
/* 页面整体 */
|
/* 页面整体 */
|
||||||
.page {
|
.page {
|
||||||
|
@ -137,3 +136,7 @@
|
||||||
.mt-20 {
|
.mt-20 {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
.promo {
|
||||||
|
position: absolute;
|
||||||
|
left: 350rpx;
|
||||||
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
export const url='http://localhost:3456';
|
export const local='http://localhost:3456';
|
||||||
|
export const ip = 'http://1.94.237.210:3457';
|
||||||
export const baseUrl = 'http://localhost:3456'
|
export const baseUrl = ip;
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
*/
|
*/
|
||||||
function validate(data, rules) {
|
function validate(data, rules) {
|
||||||
for (const [field, message] of Object.entries(rules)) {
|
for (const [field, message] of Object.entries(rules)) {
|
||||||
if (!data[field]) {
|
const value = data[field];
|
||||||
|
if ((typeof value === 'string' && !value.trim()) || value == null) {
|
||||||
wx.showToast({ title: message, icon: 'none' });
|
wx.showToast({ title: message, icon: 'none' });
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user