Commit 42680539 authored by miko's avatar miko

aa

parent 4fddb929
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": true, "es6": true,
"enhance": false,
"postcss": false, "postcss": false,
"preloadBackgroundData": false,
"minified": false, "minified": false,
"newFeature": true, "newFeature": true,
"coverView": true, "coverView": true,
...@@ -11,6 +13,7 @@ ...@@ -11,6 +13,7 @@
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
...@@ -22,6 +25,7 @@ ...@@ -22,6 +25,7 @@
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"enableEngineNative": false,
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": false, "useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false, "userConfirmedUseCompilerModuleSwitch": false,
...@@ -30,10 +34,30 @@ ...@@ -30,10 +34,30 @@
"minifyWXSS": true "minifyWXSS": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"appid": "wx5cda879d33846e26", "appid": "wxf362e74c32546fca",
"projectname": "mpshaodai", "projectname": "mpshaodai",
"miniprogramRoot": "weapp/", "miniprogramRoot": "weapp/",
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": {} "condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"name": "pages/approvePreview",
"pathName": "pages/approvePreview",
"query": "schoolId=4114",
"scene": null
}
]
}
}
} }
\ No newline at end of file
<style lang="less"> <style lang="less">
.container { .container {
width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
overflow-y: scroll; overflow-y: scroll;
...@@ -88,7 +89,7 @@ wepy.app({ ...@@ -88,7 +89,7 @@ wepy.app({
title_top: "24", title_top: "24",
title_text: "xxx", // iphone X + 24 title_text: "xxx", // iphone X + 24
prefix: 24, prefix: 24,
urlPrefix: 'https://api.favormylikes.com/spring/api' urlPrefix: 'https://www.tmallab.com/fwhj'
// urlPrefix: "http://127.0.0.1:8888/api" // urlPrefix: "http://127.0.0.1:8888/api"
} }
}); });
...@@ -98,6 +99,8 @@ wepy.app({ ...@@ -98,6 +99,8 @@ wepy.app({
pages: [ pages: [
'pages/index', 'pages/index',
'pages/progress', 'pages/progress',
'pages/approvePreview'
], ],
<!--"plugins": {--> <!--"plugins": {-->
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -11,7 +11,6 @@ const isLog = false ...@@ -11,7 +11,6 @@ const isLog = false
// 网络请求超时 // 网络请求超时
const timeOut = 30 * 1000 const timeOut = 30 * 1000
const prefix = app.config.urlPrefix
// MARK 网络请求 // MARK 网络请求
function get(url, data) { function get(url, data) {
...@@ -27,6 +26,8 @@ function get(url, data) { ...@@ -27,6 +26,8 @@ function get(url, data) {
if(schoolID){ if(schoolID){
header.schoolID = schoolID header.schoolID = schoolID
} }
const prefix = wx.getStorageSync('urlPrefix')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.request({ wx.request({
url: prefix+url, url: prefix+url,
...@@ -79,18 +80,15 @@ function get(url, data) { ...@@ -79,18 +80,15 @@ function get(url, data) {
// MARK 网络请求 // MARK 网络请求
function post(url, data) { function post(url, data) {
let token = wx.getStorageSync("token")
let header = { let header = {
'content-type': 'application/json', 'content-type': 'application/json',
} }
if (token){ if(url.indexOf('JPost')!==-1){
header.token = token header = {
} 'content-type': 'application/x-www-form-urlencoded',
}
let schoolID = wx.getStorageSync("schoolID")
if(schoolID){
header.schoolID = schoolID
} }
const prefix = wx.getStorageSync('urlPrefix')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.request({ wx.request({
......
<style lang="less">
.panel-title {
font-size: 36rpx;
color: black;
}
.main {
margin-bottom: 100rpx;
box-sizing: border-box;
flex: 1;
overflow-y: scroll;
width: 100%;
}
.header {
z-index: 1000;
width: 100%;
height: 170rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
.inner {
margin-top: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 490rpx;
.avatar-small {
display: flex;flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 50%;
overflow: hidden;
z-index: 90;
background: white;
width: 98rpx;
height: 98rpx;
}
.avatar-big {
z-index: 90;
display: flex;flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 50%;
background: white;
width: 138rpx;
height: 138rpx;
}
}
}
.gaishu{
margin-bottom: 25rpx;
background: white;
box-sizing: border-box;
width: 100%;
margin-top: 10rpx;
display: flex;
padding: 10rpx 30rpx;
flex-direction: column;
label{
margin-top: 20rpx;
}
}
.detail{
width: 100%;
box-sizing: border-box;
padding: 30rpx;
border-bottom: 1rpx solid #EDEDED;
view{
margin-bottom: 10rpx;
}
}
.van-image{
display: block!important;
}
</style>
<!--<wxs module="m1" lang="babel">-->
<!--const getTime = (time) => {-->
<!--let date = getDate(time);-->
<!--let hour = date.getHours();-->
<!--let mins = date.getMinutes();-->
<!--let sec = date.getSeconds();-->
<!--let milli = date.getMilliseconds();-->
<!--return `${hour}:${mins}:${sec}.${milli}`;-->
<!--}-->
<!--module.exports.getTime = getTime;-->
<!--</wxs>-->
<template>
<div class="container" style="align-items: center">
<header background="#45C9C2" title_text="预览" isShow="true"/>
<div style="width: 100%">
<div class="gaishu">
<span style="font-size: 40rpx;font-weight: 600">订单总览</span>
<span>课题组名称:{{orderList[0]['课题组名称']}}</span>
<span>请购人:{{orderList[0]['请购人姓名']}}</span>
<span>提交人:{{orderList[0]['购物车提交人姓名']}}</span>
<span>提交时间:{{orderList[0]['购物车提交时间']}}</span>
<span>经费号:{{orderList[0]['课题卡号']}}</span>
<span>合计:{{orderList[0]['总价']}}</span>
</div>
<div style="background: white;width: 100%;margin-top: 20rpx;padding-top: 20rpx">
<span style="font-size: 40rpx;font-weight: 600;margin-left: 30rpx">商品明细</span>
<div class="detail" v-for="(item,index) in orderList">
<div>{{item['品名']}}</div>
<div>{{'品牌: '+ item['品牌']+';货号:'+ item['货号']+';包装规格'+item['包装规格']}}</div>
<div>数量:{{item['数量']}}</div>
<div>成交价:{{item['成交价']}}</div>
<div>总价:{{item['成交价']*item['数量']}}</div>
</div>
</div>
</div>
<div style="width: 100%;padding: 30rpx;box-sizing: border-box;display: flex;flex-direction: column">
<van-button @tap="pass()" block type="primary">审批通过</van-button>
<van-button @tap="showRefuse()" block type="warning" style="margin-top: 20rpx">审批驳回</van-button>
<!-- <van-button @tap="history()" block type="info" style="margin-top: 20rpx">查看审批历史</van-button>-->
</div>
<van-dialog
@close="onDClose"
use-slot
@confirm="refuse"
theme="round-button"
title="填写驳回原因"
show="{{ showM }}"
>
<input style="width: 550rpx" v-model="refuse_reason" placeholder="请输入驳回原因"/>
</van-dialog>
</div>
</template>
<script>
import wepy from '@wepy/core'
import { mapState } from '@wepy/x'
import store from '../store'
import testMixin from '../mixins/test'
import http from '../common/http.js'
const app = getApp().$wepy.$options
wepy.page({
store,
hooks: {
},
mixins: [testMixin],
data: {
orderList: [],
showM: false,
refuse_reason: ''
},
computed: {},
methods: {
onDClose(){
this.showM = false
},
pass(){
let order = wx.getStorageSync("order");
let username = wx.getStorageSync("username");
let role = wx.getStorageSync("role");
const param = {
username: username, 订单id: order, 审批角色: role,
审批通过: '1', 审批说明: '', 审批人帐号: username
}
http.post('/order/orderApproval', param).then(res => {
if(res.flag === '1'){
wx.showModal({
title: "提示",
showCancel: false,
content: '审批完成',
//点击确认返回main界面
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
}else{
wx.showModal({
title: "提示",
showCancel: false,
content: res.message,
//点击确认返回main界面
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
}
})
},
showRefuse(){
this.showM = true
},
refuse(){
if(!this.refuse_reason){
wx.showToast({
title: '请输入驳回原因',
icon: 'none'
})
return
}
let order = wx.getStorageSync("order");
let username = wx.getStorageSync("username");
let role = wx.getStorageSync("role");
const param = {
username: username, 订单id: order, 审批角色: role,
审批通过: '0', 审批说明: this.refuse_reason, 审批人帐号: username
}
http.post('/order/orderApproval', param).then(res => {
this.showM = false
if(res.flag === '1'){
wx.showModal({
title: "提示",
showCancel: false,
content: '审批完成',
//点击确认返回main界面
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
}else{
wx.showModal({
title: "提示",
showCancel: false,
content: res.message,
//点击确认返回main界面
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
}
})
},
history(){
}
},
onLoad() {
let role = wx.getStorageSync("role");
let order = wx.getStorageSync("order");
http.post('/JPost?query=订单详情_mp', { 订单号: order }).then(res => {
if(res.flag === "1"){
if(res.data[0]['等待审批']!==role){
wx.showModal({
title: "提示",
showCancel: false,
content: '您当前无法审批此订单,可能尚未流转至您或者您已审批过此订单',
//点击确认返回main界面
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
return
}
this.orderList = res.data
}else{
wx.showModal({
title: "提示",
showCancel: false,
content: '未找到此订单',
//点击确认返回main界面
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
}
})
}
})
</script>
<config>
{
navigationBarTextStyle: "white",
navigationBarBackgroundColor: "#45C9C3",
navigationBarTitleText: '小树懒捎带',
usingComponents: {
"van-card": "module:@vant/weapp/lib/card/index",
"van-icon": "module:@vant/weapp/lib/icon/index",
"van-overlay": "module:@vant/weapp/lib/overlay/index",
"van-cell": "module:@vant/weapp/lib/cell/index",
"van-cell-group": "module:@vant/weapp/lib/cell-group/index",
"van-search": "module:@vant/weapp/lib/search/index",
"van-image": "module:@vant/weapp/lib/image/index",
"van-dialog": "module:@vant/weapp/lib/dialog/index",
header: '~@/components/header',
"van-picker": "module:@vant/weapp/lib/picker/index",
"van-popup": "module:@vant/weapp/lib/popup/index",
'van-button': 'module:@vant/weapp/lib/button',
"van-action-sheet": "module:@vant/weapp/lib/action-sheet/index",
"van-tabbar": "module:@vant/weapp/lib/tabbar/index",
"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index"
}
}
</config>
This diff is collapsed.
...@@ -415,7 +415,7 @@ import store from '../store' ...@@ -415,7 +415,7 @@ import store from '../store'
import testMixin from '../mixins/test' import testMixin from '../mixins/test'
import http from '../common/http.js' import http from '../common/http.js'
const app = getApp().$wepy.$options const prefix = wx.getStorageSync('urlPrefix')
wepy.page({ wepy.page({
...@@ -448,7 +448,7 @@ wepy.page({ ...@@ -448,7 +448,7 @@ wepy.page({
}, },
sub(item) { sub(item) {
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: ['CGlLzkCZy2Q5XaMvRw1-9gfHy_CRhk4_6LuXhKK2vI4','Lr1MlntU2DKsuxtrlTJT_d3uxOeIvKjIsjzHSKUpUOI','8VhR4ruZ-b6kZRzSzQ4TwIoQKtz7ODjkkHCgAsalFSE'], tmplIds: ['Lr1MlntU2DKsuxtrlTJT_d3uxOeIvKjIsjzHSKUpUOI','CGlLzkCZy2Q5XaMvRw1-9gfHy_CRhk4_6LuXhKK2vI4','8VhR4ruZ-b6kZRzSzQ4TwIoQKtz7ODjkkHCgAsalFSE'],
success (res) { success (res) {
wx.showToast({ wx.showToast({
title: '订阅成功', title: '订阅成功',
...@@ -468,10 +468,9 @@ wepy.page({ ...@@ -468,10 +468,9 @@ wepy.page({
}, },
photo1(item){ photo1(item){
if(item.takeCredentials){ if(item.takeCredentials){
console.log(app.config.urlPrefix+'/download/'+item.takeCredentials)
wx.previewImage({ wx.previewImage({
current: app.config.urlPrefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接 current: prefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接
urls: [app.config.urlPrefix+'/download/'+item.takeCredentials] urls: [prefix+'/download/'+item.takeCredentials]
}) })
}else{ }else{
wx.showToast({ wx.showToast({
...@@ -485,8 +484,8 @@ wepy.page({ ...@@ -485,8 +484,8 @@ wepy.page({
if(item.takeCredentials){ if(item.takeCredentials){
wx.previewImage({ wx.previewImage({
current: app.config.urlPrefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接 current: prefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接
urls: [app.config.urlPrefix+'/download/'+item.takeCredentials] urls: [prefix+'/download/'+item.takeCredentials]
}) })
}else{ }else{
wx.showToast({ wx.showToast({
...@@ -499,8 +498,8 @@ wepy.page({ ...@@ -499,8 +498,8 @@ wepy.page({
photo3(item){ photo3(item){
if(item.innerSendCredentials){ if(item.innerSendCredentials){
wx.previewImage({ wx.previewImage({
current: app.config.urlPrefix+'/download/'+item.innerSendCredentials, // 当前显示图片的http链接 current: prefix+'/download/'+item.innerSendCredentials, // 当前显示图片的http链接
urls: [app.config.urlPrefix+'/download/'+item.innerSendCredentials] urls: [prefix+'/download/'+item.innerSendCredentials]
}) })
}else{ }else{
wx.showToast({ wx.showToast({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment