Compare commits

..

No commits in common. '9463a158aa065ab3a5f38ac0000090797f5a5326' and 'a2c031743c1acabe4cf83b430f14f29cff17ad69' have entirely different histories.

  1. 30
      app.js
  2. 8
      app.json
  3. 0
      images/我的1.png
  4. 0
      images/我的2.png
  5. 0
      images/绑定微信.png
  6. 0
      images/首页1.png
  7. 0
      images/首页2.png
  8. 2
      pages/about/about.wxml
  9. 127
      pages/feedback/feedback.js
  10. 20
      pages/feedback/feedback.wxml
  11. 51
      pages/feedback/feedback.wxss
  12. 4
      pages/index/index.js
  13. 1
      pages/index/index.wxml
  14. 3
      pages/index/index.wxss
  15. 34
      pages/login/login.js
  16. 1
      pages/login/login.wxml
  17. 2
      project.config.json
  18. 4
      project.private.config.json
  19. 126
      utils/http.js

@ -13,33 +13,7 @@ App({
}
})
},
globalData: {
// 本地环境
baseUrl:'http://192.168.51.22:8201/mall-portal',
// 线上环境
// baseUrl:'https://portal-api.macrozheng.com',
token: '',
userInfo:{},
bindvx:null
},
judLogin(){
wx.showModal({
title: '提示',
content: '尊敬的用户您还未登录,请先登录',
confirmText:'去登陆',
complete: (res) => {
if (res.confirm) {
wx.navigateTo({
url: '../login/login',
})
};
if (res.cancel) {
console.log('用户点击取消');
}
}
})
},
userInfo: null
}
})

@ -26,14 +26,14 @@
"borderStyle": "black",
"list": [
{
"iconPath": "images/home_not.png",
"selectedIconPath": "images/home_sel.png",
"iconPath": "images/首页1.png",
"selectedIconPath": "images/首页2.png",
"pagePath": "pages/index/index",
"text": "首页"
},
{
"iconPath": "images/my_not.png",
"selectedIconPath": "images/my_sel.png",
"iconPath": "images/我的1.png",
"selectedIconPath": "images/我的2.png",
"pagePath": "pages/about/about",
"text": "我的"
}

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -12,7 +12,7 @@
<view class="back">
<view class="com">
<view class="con">
<image src="../../images/binding_wx.png" bindtap="bindWx"></image>
<image src="../../images/绑定微信.png" bindtap="bindWx"></image>
<view class="text">绑定微信</view>
</view>
<view class="con" bindtap="goQueryme">

@ -1,16 +1,15 @@
// pages/feedback/feedback.js
const request = require('../../utils/http')
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
array: ['请选择', 'bug问题', '业务问题', '功能使用问题', '其他'],
problemArray: [{
array: ['请选择 >','bug问题', '业务问题', '功能使用问题', '其他'],
objectArray: [
{
id: 0,
name: '请选择'
name: '请选择 >'
},
{
id: 1,
@ -29,117 +28,55 @@ Page({
name: '其他'
}
],
index: 0, //问题下标
problemStr:'',
//图片数组
addImgBtn: {
isBtn: true,
text: "+",
func: "addImage"
},
imageArr: [], //显示图片列表
upImageArr: [], //需要上传的图片路径
index: 0,
srxI:''
},
bindPickerChange(e) {
bindPickerChange (e) {
this.setData({
index: e.detail.value
})
},
//提交数据
goMyorder() {
if (this.data.index === 0) {
wx.showToast({
title: '请选择问题类型',
});
return;
}
var problem = this.data.problemArray[this.data.index]; //问题类型
var data = {
'type': this.data.index,
'describe': this.data.problemStr,
'imgs':this.data.upImageArr.toString
}
console.log(JSON.stringify(data))
request.post(`/feedBack/push`, data).then(res => {
wx.showToast({
title: 'title',
})
console.log(JSON.stringify(res.data))
});
// wx.switchTab({
// url: '../about/about',
// })
//判断是否选择问题类型
//当没有描述时,弹框提示,但不是强制性。
//判断是否有上传截图
//提示成功后,点击确定,返回上一页。
goMyorder(){
wx.switchTab({
url: '../about/about',
})
},
//添加图片
addImage() {
var _this = this;
addImage(){
wx.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['album'],
sizeType: ['compressed'],
success: res => {
var imgSrc = res.tempFiles[0].tempFilePath;
_this.addCallBackImage(imgSrc);
_this.upImg(imgSrc); //点击提交时统一上传
mediaType: ['image','video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success: res=>{
this.setData({
srcI:res.tempFiles[0].tempFilePath
})
console.log(this.data.srcI)
console.log(res.tempFiles[0].tempFilePath)
// this.up();
}
})
},
//显示回调图片
addCallBackImage(imageSrc) {
var temp = {
isBtn: false,
imgUrl: imageSrc,
text: imageSrc,
func: ""
};
this.data.imageArr.unshift(temp);
this.setData({
imageArr: this.data.imageArr
});
},
//上传图片接口地址
upImg(imageSrc) {
request.upImgFile(`/feedBack/upload`, imageSrc).then(res => {
var resObj = JSON.parse(res.data);
if (resObj.code > 400) {
wx.showModal({
title: '提示',
content: resObj.message,
complete: (res) => {
if (res.cancel) {}
if (res.confirm) {}
//上传失败后移除图片
}
})
} else {
//保存图片路径到数组
this.data.upImageArr.push(resObj.data.url);
}
});
},
// up(){
// console.log(this.data.srcI)
// wx.uploadFile({
// filePath: this.data.srcI,
// name: 'file',
// url: '',
// })
// },
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log("token=" + app.globalData.token);
//初始化添加按钮
this.setData({
imageArr: [this.data.addImgBtn]
});
},
/**

@ -1,7 +1,7 @@
<!--pages/feedback/feedback.wxml-->
<view class="bgColor">
<view style="background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1);padding:20rpx;min-height: 1400rpx;" >
<view class="cardBg">
<view style="background-color: #fff;padding: 20rpx 30rpx 100rpx 30rpx;border-radius: 15rpx;">
<view style="font-size: 28rpx;">
<view style="display: flex;">
<text>问题类型</text>
@ -9,22 +9,20 @@
<text class="why">{{array[index]}}</text>
</picker>
</view>
<textarea class="textarea" placeholder="补充描述,有助于更好的处理问题。" placeholder-class="place" value="{{problemStr}}"></textarea>
<textarea class="textarea" placeholder="补充描述,有助于更好的处理问题。" placeholder-class="place"></textarea>
</view>
<view style="margin-top: 60rpx; font-size: 26rpx;">
<view><text style="color: red;">*</text> 上传图片/截图</view>
<view>上传图片/截图</view>
<view class="addimg">
<block wx:for="{{imageArr}}">
<view wx:if="{{item.isBtn}}" bindtap="{{item.func}}">{{item.text}}</view>
<view wx:else style="display: flex;">
<image src="{{item.text}}"></image>
</view>
</block>
<image src="../../images/banner.png"></image>
<view bindtap="addImage">+</view>
</view>
</view>
</view>
<button class="btn" bindtap="goMyorder">提 交</button>
</view>

@ -1,40 +1,27 @@
/* pages/feedback/feedback.wxss */
page {
background: -webkit-linear-gradient(top, #27adb0, #ebf7f7, #f1f1f1)
page{
background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1)
}
.bgColor {
background: -webkit-linear-gradient(top, #27adb0, #ebf7f7, #f1f1f1);
padding: 20rpx;
min-height: 1400rpx;
}
.cardBg {
background-color: #fff;
padding: 20rpx 30rpx 100rpx 30rpx;
border-radius: 15rpx;
}
.why {
border: 1px #c5c5c5 solid;
.why{
border: 1px #333 solid;
display: inline-block;
width: 240rpx;
text-align: center;
margin-left: 25rpx;
padding: 10rpx 10rpx;
text-align: right;
margin-left: 20rpx;
padding: 3rpx 10rpx;
color: #5f5e5e;
border-radius: 5rpx;
}
.place {
.place{
color: #b3b1b1;
}
.textarea {
.textarea{
border: 2rpx #333 solid;
text-align: left;
border-radius: 10rpx;
max-width: 95%;
max-width: 450rpx;
height: 180rpx;
margin: 0 auto;
margin-top: 20rpx;
@ -42,32 +29,30 @@ page {
padding: 20rpx;
}
.addimg {
.addimg{
text-align: center;
display: flex;
flex-wrap: wrap;
justify-content: start;
justify-content: center;
margin-top: 20rpx;
width: 100%;
}
.addimg image {
.addimg image{
width: 200rpx;
height: 200rpx;
border-radius: 15rpx;
margin-right: 10rpx;
}
.addimg view {
border-radius: 10rpx;
.addimg view{
border-radius:15rpx ;
display: flex;
justify-content: center;
align-items: center;
width: 200rpx;
height: 200rpx;
border: 1rpx #c5c5c5 solid;
border:1rpx #222 solid;
}
.btn {
.btn{
background-color: #5dc2c4;
color: #fff;
margin-top: 100rpx;

@ -25,7 +25,7 @@ function initChart(canvas, width, height, dpr) {
xAxis: {
type: 'category',
data: ['一月', '二月', '三月', '四月', '五月', '六月','七月','八月','九月','十一月','十二月']
data: ['一月', '二月', '三月', '四月', '五月', '六月']
},
yAxis: {
type: 'value',
@ -67,14 +67,12 @@ Page({
})
},
//第三方物流
goThreelogistics(){
wx.navigateTo({
url: '../threeLogistics/threeLogistics',
})
},
//货运物流
goHandover(){
wx.navigateTo({
url: '../handover/handover',

@ -10,6 +10,7 @@
<view class="msg">消息:XXX医院样本转运完成,完成时间:2023年6月14日</view>
<view style="padding: 20rpx;">
<view class="back">
<view class="produck-type" bindtap="goMelogistics">

@ -9,9 +9,6 @@
}
.msg{
border-radius: 5px;
margin-top: 20rpx;
height: 30rpx;
background-color: #fff;
font-size: 26rpx;
padding: 10rpx;

@ -1,43 +1,11 @@
// pages/login/login.js
const request = require('../../utils/http')
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
username: "member", //账号
userpwd: "member123", //密码
},
getUsername(e) {
this.setData({
username: e.detail.value
})
},
getUserpwd(e) {
this.setData({
userpwd: e.detail.value
})
},
//登录请求
login() {
request.post(`/sso/login?username=${this.data.username}&password=${this.data.userpwd}`).then(res => {
console.log(res);
if (res.data.code == 200) {
app.globalData.token = res.data.data.tokenHead + res.data.data.token;
wx.showToast({
title: '登陆成功'
})
wx.reLaunch({
url: '../about/about'
});
request.get('/sso/info').then(res2 => {
app.globalData.userInfo = res2.data.data
})
}
})
},
/**

@ -1,5 +1,4 @@
<!--pages/login/login.wxml-->
<view style="padding: 40rpx 50rpx;font-size: 55rpx;color: #fff;font-weight: 600; font-family: 'Courier New', Courier, monospace;">欢迎回来!</view>
<view style="background-color: #fff; width: 650rpx; border-radius: 20rpx; margin: 0 auto; padding: 30rpx 0;">

@ -51,6 +51,6 @@
],
"include": []
},
"appid": "wxcf3a0f4fb0f7656e",
"appid": "wxf122cda1b8bbbc37",
"testRoot": "minitest/"
}

@ -1,8 +1,8 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "yyt_logistics",
"projectname": "%E7%89%A9%E6%B5%81%E7%AB%AF",
"setting": {
"compileHotReLoad": true
"compileHotReLoad": false
},
"condition": {
"miniprogram": {

@ -1,126 +0,0 @@
var app = getApp(); //引入全局app.js,我们可以在globalData中定义一些公用的数据,比如baseUrl、token
const request = function(url, options) {
let header = {
'content-type': 'application/json;charset=utf-8'
};
if (app.globalData.token) {
header.Authorization = app.globalData.token;
}
// 检查外部传递的请求头是否存在
if (options.header && typeof options.header === 'object') {
// 合并外部传递的请求头
header = Object.assign({}, header, options.header);
}
return new Promise((resolve, reject) => {
wx.request({
url: app.globalData.baseUrl + url,
method: options.method,
data: options.data,
header: header,
success: (res) => {
if (res.data.code == 500) {
wx.showModal({
showCancel: false,
title: '提示',
content: res.data.message
});
reject(res.data.message);
} else {
resolve(res);
}
},
fail: (err) => {
reject(err);
}
});
});
};
const get = function(url, data, header) {
return request(url, {
method: "GET",
data,
header
});
}
const post = function(url, data, header) {
return request(url, {
method: "POST",
data,
header
});
}
//上传图片文件
const upImgFile = function(url, imgSrc) {
let header = {
// 'content-type': 'multipart/form-data'
'content-type': 'application/json;charset=utf-8'
};
if (app.globalData.token) {
header.Authorization = app.globalData.token;
}
// 检查外部传递的请求头是否存在
// if (options.header && typeof options.header === 'object') {
// // 合并外部传递的请求头
// header = Object.assign({}, header, options.header);
// }
return new Promise((resolve, reject) => {
wx.uploadFile({
url: app.globalData.baseUrl + url,
name: "file",
filePath: imgSrc,
header: header,
formData: {
"file": "upimagefile",
},
success: function (res) {
if (res.data.code == 500) {
wx.showModal({
showCancel: false,
title: '提示',
content: res.data.message
});
reject(res.data.message);
} else {
resolve(res);
}
}
});
// wx.request({
// url: app.globalData.baseUrl + url,
// method: options.method,
// data: options.data,
// header: header,
// success: (res) => {
// if (res.data.code == 500) {
// wx.showModal({
// showCancel: false,
// title: '提示',
// content: res.data.message
// });
// reject(res.data.message);
// } else {
// resolve(res);
// }
// },
// fail: (err) => {
// reject(err);
// }
// });
});
};
//暴露出去
module.exports = {
get,
post,
upImgFile
};
Loading…
Cancel
Save