This commit is contained in:
@fawn-nine
2024-07-05 13:14:47 +08:00
parent 989f802f1a
commit eefd8f4e83
5 changed files with 241 additions and 100 deletions

View File

@@ -46,6 +46,8 @@ const courtConfig = {
// #endif // #endif
} }
}; };
// 订单编号的正则
const orderRegular = /[0-9]\d{31}$/;
//手机号验证正则表达式 //手机号验证正则表达式
// (中国大陆) // (中国大陆)
const phoneRegular = /^1\d{10}$/; const phoneRegular = /^1\d{10}$/;
@@ -59,5 +61,6 @@ const passwordRegular = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;
export default Object.assign({ export default Object.assign({
phoneRegular, phoneRegular,
mailRegular, mailRegular,
passwordRegular passwordRegular,
orderRegular
}, courtConfig); }, courtConfig);

View File

@@ -286,8 +286,11 @@
<span style="color: #666;margin-right: 10rpx;float: left;">发货时间 : </span> <span style="color: #666;margin-right: 10rpx;float: left;">发货时间 : </span>
<text style="font-size: 24rpx;color: #666;">{{orderContet.shippingTime}}</text> <text style="font-size: 24rpx;color: #666;">{{orderContet.shippingTime}}</text>
</view> --> </view> -->
<view class=""></view>
</view> </view>
<view class="" style="text-align: center; width: 100%;">
<text @click="gotoWorkOrder" style="color: cadetblue; font-size: 26rpx;">订单有问题?去申诉</text>
</view>
</view> </view>
</view> </view>
<view class="goods_nav_box"> <view class="goods_nav_box">
@@ -536,6 +539,11 @@ export default {
}, },
methods: { methods: {
gotoWorkOrder(){
uni.navigateTo({
url:`/pages/user/workOrder?name=order`
})
},
async goBuyJie(data) { async goBuyJie(data) {
console.log("index at line 532:", data); console.log("index at line 532:", data);
if (data.text == "继续付款") { if (data.text == "继续付款") {

View File

@@ -380,7 +380,7 @@ export default {
url: "/pages/mine/aboutUs/index", url: "/pages/mine/aboutUs/index",
type: "pageJump", type: "pageJump",
}, },
//{ name: "设置", url: "/pages/mine/set/index", type: "pageJump" }, { name: "问题反馈/申诉", url: "/pages/user/workOrder", type: "workOrder" },
// { name: "退出登录", type: "quitLogin" }, // { name: "退出登录", type: "quitLogin" },
// { name: "注销帐号", type: "loginOut" }, // { name: "注销帐号", type: "loginOut" },
], ],
@@ -445,6 +445,12 @@ export default {
//注销账号 //注销账号
this.logout(); this.logout();
break; break;
case "workOrder":
uni.navigateTo({
url:`${v.url}?name=userPage`
})
// this.onPageJump(v.url);
break;
} }
}, },
// 获得操作系统 // 获得操作系统

View File

@@ -97,8 +97,9 @@
<button @click="onSubmit" class="active" v-if="btnShow"> </button> <button @click="onSubmit" class="active" v-if="btnShow"> </button>
<button v-else> </button> <button v-else> </button>
</view> </view>
<view class="loginHelp" v-if="submitClickNum > 0"> <!-- <view class="loginHelp" v-if="submitClickNum > 0"> -->
<text>登陆遇到问题</text><text class="link" @click="onPageJump('/pages/user/workOrder','login')">去反馈问题</text> <view class="loginHelp">
<text>登录遇到问题</text><text class="link" @click="onPageJump('/pages/user/workOrder','login')">去反馈问题</text>
</view> </view>
<!-- <view class="password_register" style="margin: 0 auto; text-align: center; display: block;"> <!-- <view class="password_register" style="margin: 0 auto; text-align: center; display: block;">
<button @click="onPageJump('/pages/user/register')">注册账号</button> <button @click="onPageJump('/pages/user/register')">注册账号</button>

View File

@@ -3,115 +3,125 @@
<z-nav-bar></z-nav-bar> <z-nav-bar></z-nav-bar>
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<view class="title">问题反馈</view> <view class="title">问题反馈/申诉</view>
<uni-forms :modelValue="form" :rules="rules" ref="form"> <uni-forms :modelValue="form" :rules="rules" ref="form">
<view class="input_box " style="display: flex !important; align-items: center; "> <view class="input_box " style="">
<uni-forms-item label="" name="type" label-width="0"> <uni-forms-item label="" name="type" label-width="0">
<view class=""> <view class="">
<text class="input_tit">反馈类型</text> <text class="input_tit"><i>*</i>问题类型</text>
</view> </view>
<view class="in" style="flex: 1;"> <view class="in" style="flex: 1; border: none;">
<!-- <input type="text" v-model="form.type" placeholder="请输入手机号/邮箱" /> <!-- <input type="text" v-model="form.type" placeholder="请输入手机号/邮箱" />
--> -->
<uni-data-select <uni-data-select style="width: 100%;" v-model="form.type"
v-model="form.type" :localdata="typeLIst"></uni-data-select>
:localdata="questionTypeList"
></uni-data-select>
</view> </view>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="input_box"> <view class="input_box">
<uni-forms-item label="" name="count" label-width="0"> <uni-forms-item label="" name="account" label-width="0">
<text class="input_tit">吴门医述账号:</text> <text class="input_tit"><i>*</i>吴门医述账号:</text>
<view class="in"> <view class="in">
<input type="text" v-model="form.count" placeholder="请输入手机号/邮箱" /> <input placeholder-style="font-size:26rpx" type="text" v-model="form.account"
</view> placeholder="请输入手机号/邮箱" />
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="orderNum" label-width="0">
<text class="input_tit">订单编号:</text>
<view class="in">
<input type="password" maxlength="8" v-model="form.orderNum" placeholder="请输入订单编号" />
</view>
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="note" label-width="0">
<text class="input_tit">问题描述:</text>
<view class="in">
<view class="uni-textarea">
<textarea v-model="form.note" maxlength="200" placeholder="请输入您要反馈的问题" />
</view> </view>
</view>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="input_box" v-if="form.type == 3">
<uni-forms-item label="" name="relation" label-width="0">
<text class="input_tit"><i>*</i>订单编号:</text>
<view class="in">
<input type="number" @input="relationInput" placeholder-style="font-size:26rpx"
v-model="form.relation" placeholder="请输入订单编号" />
</view>
<text v-show="relationError" style="font-size: 24rpx; color: red; margin-top: 10rpx;">请填写订单编号</text>
<text v-show="relationErrorPattern"
style="font-size: 24rpx; color: red; margin-top: 10rpx;">订单编号格式错误</text>
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="content" label-width="0">
<text class="input_tit"><i>*</i>问题描述:</text>
<view class="in">
<view class="uni-textarea">
<textarea placeholder-style="font-size:26rpx" v-model="form.content" maxlength="200"
placeholder="请输入您要反馈的问题" />
</view>
</view>
</uni-forms-item>
</view>
<view class="input_box">
<uni-forms-item label="" name="contactInformation" label-width="0">
<text class="input_tit"><i>*</i>联系电话:</text>
{{reversedMessage}}
<view class="in">
<input type="number" placeholder-style="font-size:26rpx" @input="telInput"
v-model="form.contactInformation" placeholder="请输入与您联系的手机号" />
</view>
<text v-show="telError" style="font-size: 24rpx; color: red; margin-top: 10rpx;">手机号格式错误</text>
</uni-forms-item>
</view>
<view class="input_box"> <view class="input_box">
<text class="input_tit">问题截图:</text> <text class="input_tit">问题截图:</text>
<view class="in"> <view class="in" style="border: none;">
<u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4" <u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4"
width="40" height="40" :previewFullImage="true"> width="40" height="40" :previewFullImage="true">
</u-upload> </u-upload>
<text style="font-size: 24rpx; color: #999;">可上传4张问题截图</text>
</view> </view>
<!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> --> <!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> -->
</view> </view>
<view class="input_box">
<uni-forms-item label="" name="tel" label-width="0">
<text class="input_tit">联系电话:</text>
<view class="in">
<input type="text" v-model="form.tel" placeholder="请输入与您联系的手机号" />
</view>
</uni-forms-item>
</view>
</uni-forms> </uni-forms>
<view class="btn_box"><button @click="onSubmit"> </button></view> <view class="btn_box"><button @click="onSubmit"> </button></view>
</view> </view>
</template> </template>
<script> <script>
import $http from '@/config/requestConfig.js';
import {
mapState,
mapMutations
} from 'vuex';
export default { export default {
data() { data() {
return { return {
fileList1: [], fileList1: [],
playData: {}, playData: {},
questionTypeList:[
{}
],
//手机号账号 //手机号账号
form: { form: {
count: '', // 账号 account: '', // 账号
note: '', // 描述 content: '', // 描述
images: '', //图片 image: '', //图片
tel: '', // 联系电话 contactInformation: '', // 联系电话
orderNum: '', // 订单号 relation: '', // 订单号
type: null, // 反馈类型 type: null, // 反馈类型
}, },
telError: false,
relationError: false,
relationErrorPattern:false,
rules: { rules: {
count: { account: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请输入账户名', errorMessage: '请输入账',
} }
] ]
}, },
note: { content: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请输入问题描述', errorMessage: '请输入问题描述',
} }
] ]
}, },
tel: { contactInformation: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请输入联系电话', errorMessage: '请输入联系电话',
} }
] ]
}, },
type: { type: {
@@ -119,21 +129,86 @@
required: true, required: true,
errorMessage: '请选择反馈类型', errorMessage: '请选择反馈类型',
} }
] ]
} }
}, },
pageType: '',
typeLIst: [
// { value: 0, text: "请选择" },
{
value: 1,
text: "登陆相关问题"
},
{
value: 2,
text: "账号相关问题"
},
{
value: 3,
text: "订单相关问题"
},
{
value: 4,
text: "购买相关问题"
},
{
value: 5,
text: "VIP相关问题"
},
{
value: 6,
text: "充值相关问题"
},
{
value: 7,
text: "网络暴力举报"
},
{
value: 8,
text: "其他"
},
],
}; };
}, },
//第一次加载 //第一次加载
onLoad(e) {}, onLoad(e) {
//页面显示 console.log('收到的值', e);
onShow() {}, this.pageType = e.name
switch (this.pageType) {
case "login":
this.form.type = 1
break;
case "order":
this.form.type = 3
break;
}
},
//页面显示
onShow() {
},
computed: {
...mapState(['userInfo']),
reversedMessage: function() {
// `this` 指向 vm 实例
this.form.account = this.userInfo.tel
}
},
//方法 //方法
methods: { methods: {
relationInput(e) {
this.relationError = false
this.relationErrorPattern = false
},
telInput(e) {
// console.log('键盘输入',e);
this.telError = false
},
addPic(e) { addPic(e) {
console.log("添加图片"); // console.log("添加图片");
let that = this; let that = this;
for (var i = 0; i < e.file.length; i++) { for (var i = 0; i < e.file.length; i++) {
//console.log(i,e.file[i].url) //console.log(i,e.file[i].url)
@@ -144,11 +219,10 @@
name: "file", name: "file",
formData: {}, formData: {},
success: (res) => { success: (res) => {
that.uploadPicLIst.push({ that.fileList1.push({
url: JSON.parse(res.data).url, url: JSON.parse(res.data).url,
}); });
// this.showPicsList = true console.log(that.fileList1, "that.uploadPicLIst");
console.log(that.uploadPicLIst, "that.uploadPicLIst");
}, },
fail: (error) => { fail: (error) => {
console.log("上传失败", error); console.log("上传失败", error);
@@ -156,35 +230,76 @@
}); });
} }
}, },
deletePic(val, i) { deletePic(event) {
console.log("删除图片"); this.fileList1.splice(event.index, 1)
this.uploadPicLIst.splice(i, 1);
}, },
onSubmit() { onSubmit() {
this.$refs.form.validate().then(res=>{ this.$refs.form.validate().then(res => {
console.log('表单数据信息:', res); if (this.form.type == 3) {
}).catch(err =>{ if (this.form.relation == '') {
console.log('表单错误信息:', err); this.relationError = true
}) return
return } else {
this.$http if (!this.$base.orderRegular.test(this.form.relation)) {
// .post('api/common/v1/forget_password', { this.relationErrorPattern = true
.post('book/user/setPassword', { return
phone: this.phone,
code: this.code,
// password: md5(this.password),
password: this.password
})
.then(res => {
uni.showModal({
title: "提示",
content: "密码修改成功!",
showCancel: false,
success: (res) => {
uni.navigateBack();
} }
}
}
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
// console.log('this.fileList1',_list);
this.form.image = _list.join(',')
}
if (!this.$base.phoneRegular.test(this.form.contactInformation)) {
this.telError = true
uni.showToast({
title: '手机格式不正确',
icon: 'none'
}); });
}); return;
}
// console.log('this.fileList1',this.form.image);
$http.request({
url: "common/sysFeedback/addSysFeedback",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
...this.form
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
uni.showModal({
title: "提示",
content: "提交成功!",
showCancel: false,
success: (res) => {
this.fileList1 = []
// this.$nextTick(() => {
uni.navigateBack({
delta: 1
});
// })
}
});
}).catch(e => {
// console.log('表单错误信息:', err);
uni.showToast({
title: '提交失败',
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
})
})
} }
}, },
//页面隐藏 //页面隐藏
@@ -218,16 +333,22 @@
.input_box { .input_box {
display: block; display: block;
// justify-content: space-between; // justify-content: space-between;
overflow: hidden; // overflow: hidden;
// height: 100rpx; // height: 100rpx;
padding-top: 10rpx; padding-top: 10rpx;
// border-bottom: 1rpx solid #eeeeee; // border-bottom: 1rpx solid #eeeeee;
align-items: center; align-items: center;
i {
font-size: 24rpx;
color: red;
padding-right: 10rpx;
}
.in { .in {
border: 1rpx solid #eeeeee; border: 1rpx solid #eeeeee;
border-radius: 20rpx; border-radius: 8rpx;
padding: 8rpx; padding: 8rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
@@ -238,8 +359,9 @@
} }
input { input {
flex: 1; flex: 1;
// height: 70rpx; height: 50rpx;
// line-height: 70rpx; // line-height: 70rpx;
font-size: 30rpx; font-size: 30rpx;
} }
@@ -258,6 +380,7 @@
.btn_box { .btn_box {
margin-top: 70rpx; margin-top: 70rpx;
padding-bottom: 20rpx;
button { button {
font-size: 32rpx; font-size: 32rpx;