李双庆 1 year ago
parent
commit
2f5687317c
  1. 23
      api/medication.js
  2. 57
      api/member.js
  3. 8
      common/config.js
  4. 50
      common/util.js
  5. 43
      components/AQ/AQUplodeImgMulti.vue
  6. 76
      pages/common/feedback.vue

23
api/medication.js

@ -1,23 +0,0 @@
import http from '../common/axios.js'
// 账号密码登录
function medication_login(data) {
let url = '/dnseyeapi/Login/login'
return http.post(url, data).then(res => {
return res;
})
}
//登录
function login(data) {
let url = '/login'
return http.get(url,data).then(res => {
return res;
})
}
export default {
login,
medication_login,
}

57
api/member.js

@ -1,44 +1,4 @@
import http from '../common/axios.js' import http from '../common/axios.js'
// 账号密码登录
function medication_login(data) {
let url = '/dnseyeapi/Login/login'
return http.post(url, data).then(res => {
return res;
})
}
//登录
function login(data) {
let url = '/login'
return http.get(url,data).then(res => {
return res;
})
}
//获取学员信息 //获取学员信息
function member(data) { function member(data) {
@ -48,10 +8,19 @@ function member(data) {
}) })
} }
export default { export default {
login,
medication_login,
member, member,
// 业务员端配置项(关于我们)
setFeedback(data) {
let url = '/member/set_feedback'
return http.post(url,data).then(res => {
return res;
})
},
login(data) {
let url = '/login'
return http.get(url,data).then(res => {
return res;
})
},
} }

8
common/config.js

@ -1,10 +1,10 @@
// 线上地址 // 线上地址
const Api_url='http://146.56.228.75:20021/api' // const Api_url='http://146.56.228.75:20021/api'
const img_domian = 'http://146.56.228.75:20021/' // const img_domian = 'http://146.56.228.75:20021/'
//本地测试地址 //本地测试地址
// const Api_url='http://zhjw.cc/api' const Api_url='http://zhjw.cc/api'
// const img_domian = 'http://zhjw.cc/' const img_domian = 'http://zhjw.cc/'
const IsDemo = false const IsDemo = false

50
common/util.js

@ -1,3 +1,5 @@
import {img_domian} from "./config";
function formatTime(time) { function formatTime(time) {
if (typeof time !== 'number' || time < 0) { if (typeof time !== 'number' || time < 0) {
return time return time
@ -94,10 +96,56 @@ const hexToRgba = (hex, opacity) => { //16进制颜色转rgba
return "rgba(" + parseInt("0x" + hex.slice(1, 3)) + "," + parseInt("0x" + hex.slice(3, 5)) + "," + parseInt("0x" + hex.slice(5, 7)) + "," + opacity + ")" return "rgba(" + parseInt("0x" + hex.slice(1, 3)) + "," + parseInt("0x" + hex.slice(3, 5)) + "," + parseInt("0x" + hex.slice(5, 7)) + "," + opacity + ")"
} }
/**
* 图片路径转换
* @param {String} img_path 图片地址
* @param {Object} params 参数针对商品相册里面的图片区分大中小size: bigmidsmall
*/
function img(img_path, params) {
var path = "";
if (img_path != undefined && img_path != "") {
if (img_path.split(',').length > 1) {
img_path = img_path.split(',')[0];
}
if (params && img_path != getDefaultImage().goods) {
// 过滤默认图
let arr = img_path.split(".");
let suffix = arr[arr.length - 1];
arr.pop();
arr[arr.length - 1] = arr[arr.length - 1] + "_" + params.size.toUpperCase();
arr.push(suffix);
img_path = arr.join(".");
}
if (img_path.indexOf("http://") == -1 && img_path.indexOf("https://") == -1) {
path = img_domian + "/" + img_path;
} else {
path = img_path;
}
if(img_domian.indexOf('https://') != -1){
path = path.replace('http://', 'https://');
}
}
// path += '?t=' + parseInt(new Date().getTime() / 1000);
return path;
}
/**
* 获取默认图
*/
function getDefaultImage() {
let defaultImg = store.state.defaultImg;
defaultImg.goods = img(defaultImg.goods);
defaultImg.head = img(defaultImg.head);
defaultImg.store = img(defaultImg.store);
defaultImg.article = img(defaultImg.article);
return defaultImg;
}
module.exports = { module.exports = {
formatTime, formatTime,
formatDateTime, formatDateTime,
formatLocation, formatLocation,
dateUtils, dateUtils,
hexToRgba hexToRgba,
img
} }

43
components/AQ/AQUplodeImgMulti.vue

@ -99,7 +99,7 @@ import {Api_url} from "../../common/config";
}, },
// //
uploadApiUrl: `${Api_url}api/file/image`, uploadApiUrl: `${Api_url}/file/image`,
// //
imageStyles: { imageStyles: {
@ -137,38 +137,63 @@ import {Api_url} from "../../common/config";
}, },
async uplodeFile(filePath,index){ async uplodeFile(filePath,index){
let token = uni.getStorageSync('token') || ''
// if(!token){
// //
// uni.navigateTo({
// url: '/pages/student/login/login'
// })
// }
await uni.uploadFile({ await uni.uploadFile({
url: this.uploadApiUrl, // url: this.uploadApiUrl, //
filePath: filePath, filePath: filePath,
name: 'file', name: 'file',
header: {
'token': `${token}`,//token
},
// formData: { // formData: {
// 'file': '' // 'age': ''
// }, // },
success: (uploadFileRes) => { success: (uploadFileRes) => {
let res = JSON.parse(uploadFileRes.data.replace(/\ufeff/g, "") || "{}") let res = JSON.parse(uploadFileRes.data.replace(/\ufeff/g, "") || "{}")
console.log('上传成功1',res); console.log('上传成功1',res);
if (res.code >= 0){ if (res.code == 1){
let _arr = {} let _arr = {}
// 3uni-app // 3uni-app
_arr.url = res.data.pic_url _arr.url = res.data.url
_arr.extname = res.data.file_ext _arr.extname = res.data.ext
_arr.name = res.data.pic_name _arr.name = res.data.name
console.log('xxx',_arr)
this.fileList.push(_arr) this.fileList.push(_arr)
console.log('上传成功2',_arr); console.log('上传成功2',_arr);
this.filePathArr.push(res.data.pic_path) this.filePathArr.push(res.data.path)
// //
this.emitUploadSuccess(this.filePathArr) this.emitUploadSuccess(this.filePathArr)
}else{ }else{
// //
uni.showToast({ uni.showToast({
title: res.message title: res.msg,
icon: 'none'
}) })
if(res.code == 401){
//1s
setTimeout(() => {
uni.navigateTo({
url: '/pages/student/login/login'
})
}, 1000);
}
} }
}, },
fail: (err) => { fail: (err) => {
// //
uni.showToast({ uni.showToast({
title: err.message title: err.msg,
icon: 'none'
}) })
} }
}) })

76
pages/common/feedback.vue

@ -5,7 +5,7 @@
<view class="main_section"> <view class="main_section">
<view class="section"> <view class="section">
<view class="text_input"> <view class="text_input">
<fui-textarea placeholder="请输入反馈内容"></fui-textarea> <fui-textarea placeholder="请输入反馈内容" v-model="formData.content"></fui-textarea>
</view> </view>
</view> </view>
@ -17,9 +17,10 @@
</view> </view>
</view> </view>
<view class="section"> <view class="section">
<view class="input_box"> <view class="input_box">
<fui-input label="邮箱方式" borderTop placeholder="请输入邮箱"></fui-input> <fui-input label="邮箱方式" borderTop placeholder="请输入邮箱" v-model="formData.mailbox"></fui-input>
</view> </view>
</view> </view>
@ -27,13 +28,13 @@
反馈的相关问题会第一时间通过邮箱解答 反馈的相关问题会第一时间通过邮箱解答
</view> </view>
<view class="btn">提交</view> <view class="btn" @click="submitForm()">提交</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
// import user from '@/api/user.js'; import memberApi from '@/api/member.js';
import AQUplodeImgMulti from '@/components/AQ/AQUplodeImgMulti'; import AQUplodeImgMulti from '@/components/AQ/AQUplodeImgMulti';
import AQTabber from "@/components/AQ/AQTabber" import AQTabber from "@/components/AQ/AQTabber"
@ -46,40 +47,11 @@
data() { data() {
return { return {
formData: { formData: {
images_arr: [] images_arr: [],
images:'',
content:'',
mailbox:'',
}, },
//
show_course: false, //
//
course_name: '课程', //
options_course: [{
text: '请选择课程',
value: '',
checked: true
}, {
text: '羽毛球课程1',
value: '1'
}, {
text: '篮球课程2',
value: '2'
}],
//
show_classroom: false, //
//
classroom_name: '课室', //
options_classroom: [{
text: '请选择课室',
value: '',
checked: true
}, {
text: '羽毛球201',
value: '1'
}, {
text: '篮球室101',
value: '2'
}],
} }
}, },
onLoad() {}, onLoad() {},
@ -97,6 +69,32 @@
// console.log('AQxxx1',res) // console.log('AQxxx1',res)
// console.log('AQxxx2',this.formData.member_store_certification_arr) // console.log('AQxxx2',this.formData.member_store_certification_arr)
}, },
async submitForm() {
let data = {...this.formData}
data.images = data.images_arr.join(',')
if(!data.content){
//
uni.showToast({
title:'反馈内容为必填项',
icon:'none'
})
return
}
let res = await memberApi.setFeedback(data)
if(res.code != 1){
uni.showToast({
title:res.msg,
icon:'none'
})
}else{
uni.showToast({
title:'提交成功',
icon:'none'
})
}
},
} }
} }
</script> </script>
@ -145,6 +143,10 @@
background-color: #434544 !important; background-color: #434544 !important;
} }
::v-deep textarea {
color: #fff !important;
}
::v-deep .fui-textarea__background { ::v-deep .fui-textarea__background {
border: 0; border: 0;
background-color: #434544 !important; background-color: #434544 !important;

Loading…
Cancel
Save