-
+
-
-
-
-
- 客服
-
-
-
-
-
-
-
- 收件人
-
-
-
-
- 请注意, 是快递收件人的姓名
-
-
-
-
-
-
- 手机号
-
-
-
-
-
-
-
-
-
-
- 请注意, 是快递的收件联系方式
-
-
-
-
-
-
-
- 请确认:您当前校区为{{school.schoolName}}
- 如有误,请点击调整
-
-
-
-
-
更 新
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
更 新
-
-
-
-
-
-
-
-
-
-
- {{school.schoolName}}
- 暂未开通
-
-
-
- 0元投入
-
-
-
-
- 全方位扶持
-
-
-
-
- 锻炼管理能力
-
-
-
-
- 服务同学,结交朋友
-
-
-
-
- 享受月薪+提成
-
-
-
-
-
-
-
-
- 服务说明
-
-
10秒下单,快递到寝
-
即使方寸大小的校园,也确保位置实时精确
-
-
- 支付金额
-
-
-
-
- {{smallprice}}元/件
- 普通快递
-
-
- {{bigprice}}元/件
- 比箱装饮料重或大
-
-
-
如未能取到快递,自动退还全部费用
-
大件实际为普通,自动退还多余费用
-
- 支付
-
-
-
-
-
-
-
-
- 确认
-
-
-
-
-
-
-
-
-
- 捎带快递
-
-
-
-
-
- 我的捎带
-
-
-
@@ -892,531 +102,174 @@ const app = getApp().$wepy.$options
wepy.page({
store,
-
hooks: {
- // // Page 级别 hook, 只对当前 Page 的 setData 生效。
- // 'before-setData': function(dirty) {
- // if (Math.random() < 0.2) {
- // console.log('setData canceled')
- // return false // Cancel setData
- // }
- // dirty.time = +new Date()
- // return dirty
- // }
- },
- mixins: [testMixin],
- onShareTimeline: function (res){
- return {
- title: '十秒下单,快速到寝',
- path: '/pages/index',
- query: '',
- imageUrl: '../assets/main-logo.png'
- }
- },
- onShareAppMessage: function (res) {
- return {
- title: '十秒下单,快速到寝',
- path: '/pages/index',
- imageUrl: '../assets/main-logo.png'
- }
},
- data: {
- screenWidth: app.config.screenWidth,
- screenHeight: app.config.screenHeight,
- x: app.config.screenWidth,
- y: 550,
- paytype: 1,
- showMark: false,
- showUnOpenSheet: false,
- showPaySheet: false,
- school: {},
- schoolSearchResult: [],
- showChangeSchoolSheet: false,
- schoolIconUrl: '',
- active: 0,
- messageComp: '',
- messagePacketCode: '',
- messageConfirmed: false,
- carrierCoList: ['德邦', 'EMS',
- '百世', '国通', '汇通', '联邦', '申通', '顺丰', '天天', '菜鸟', '韵达', '圆通', '邮政', '中铁', '中通', '宅急送', '中邮', '中环', '京东'],
-
- dormitoryList: [],
- showDormitorySheet: false,
- smallprice: '2',
- bigprice: '5',
-
- amdeadline: '',
- pmdeadline: '',
- showAddressSheet: false,
- addressSheet_Name: '',
- addressSheet_Phone: '',
- addressSheet_Dormitory: '',
- addressSheet_Floor: '',
- addressSheet_Room: '',
- address: '',
- messageText: '',
-
- remarkText: '',
- remarkList: [{
- label: '晚上再送', checked: false
- }, {
- label: '我很着急', checked: false
- }, {
- label: '请敲门', checked: false
- }, {
- label: '易碎物品', checked: false
- }, {
- label: '冷藏物品 请勿暴晒', checked: false
- }],
+ mixins: [testMixin],
- showMessageParse: true
+ data: {
+ orderList: []
},
computed: {},
methods: {
- touched(){
- let _that = this
- wx.nextTick(() => {
- _that.$wx.setData({
- x: this.screenWidth,
- y: this.y
- })
- })
- },
- drapChange(e) {
- this.y = e.$wx.detail.y
- },
- getPhoneNumber (e) {
- e = e.$wx
- let _that = this
+ item_click(item){
+ wx.setStorageSync("order", item);
- wx.login({
- success: res => {
- let param = {
- encryptedData: encodeURIComponent(e.detail.encryptedData),
- iv: encodeURIComponent(e.detail.iv),
- code: res.code
- }
- http.post('/getWxPhone', param).then(data => {
- _that.addressSheet_Phone = data.data.phoneNumber
- })
- }
+ wx.navigateTo({
+ url: '/pages/approvePreview'
})
},
- pay(){
- var d = new Date();
- let h = d.getHours()
- let m = d.getMinutes()
- if(h<12&&this.amdeadline){
- if(h+':'+m>this.amdeadline){
- wx.showToast({
- title: '上午提交订单截止时间为'+this.amdeadline+', 请于12点之后重新提交',
- icon: 'none',
- duration: 4000
- })
- return
- }
- }
- if(h>=12&&this.pmdeadline){
- if(h+':'+m>this.pmdeadline){
- wx.showToast({
- title: '下午提交订单截止时间'+this.pmdeadline+', 请明天重新提交',
- icon: 'none',
- duration: 4000
- })
- return
- }
- }
- if (!this.messageComp || !this.messagePacketCode) {
- wx.showToast({
- title: '未识别成功,请自行输入快递公司以及取货码',
- icon: 'none',
- duration: 4000
- })
- return
- }
- this.messageConfirmed = true
- if(!this.address){
- wx.showToast({
- title: '请填写正确的收货地址',
- icon: 'none',
- duration: 4000
- })
- return
- }
+ scanBtClick(){
- let _that = this
- let param = {yuan: this.paytype===1?this.smallprice:this.bigprice}
- http.post('/task/pay',param).then(data => {
- data = data.data
-
- wx.requestPayment({
- timeStamp: data.timeStamp,
- nonceStr: data.nonceStr,
- package: data.packageValue,
- signType: 'MD5',
- paySign: data.paySign,
- success (res) {
- _that.taskSubmit()
- },
- fail (res) {
+ wx.scanCode({
+ success: (res) => {
+ if (!res) {
wx.showToast({
- title: '支付失败',
- icon: 'none',
- duration: 3000,
- mask:true
+ title: '扫描二维码错误',
+ icon: 'error',
+ duration: 3000
})
-
+ return
}
- })
-
- })
- },
- openChange(){
- this.showAddressSheet = false
- this.showUnOpenSheet = false
- this.showChangeSchoolSheet = true
- },
- know(){
- this.showMark = false
- wx.setStorageSync("know",true)
- },
- apply(){
- },
- mallClick(){
- wx.showToast({
- title: '超市功能尚未开启,尽请期待',
- icon: 'none',
- duration: 4000
- })
- },
- closeUnOpen(){
- this.showUnOpenSheet = false
- },
- updateSchool(){
- this.showChangeSchoolSheet = false
- let s = this.schoolSearchResult.find(v=>{
- return v.checked
- })
- wx.setStorageSync('schoolID',s.schoolID)
- this.$wx.onShow()
- },
- schoolItmeClick(item){
- let i = JSON.parse(JSON.stringify(item))
- let l = JSON.parse(JSON.stringify(this.schoolSearchResult))
-
- l.map(v=>{
- v.checked = v.schoolName === i.schoolName
- return v
- })
- this.schoolSearchResult = l
- },
- onChange(detail){
- this.searchText = detail.$wx.detail
- if(!this.searchText){
- this.schoolSearchResult = []
- return
- }
- let param = {
- searchText: this.searchText
- }
- http.post('/school/search',param).then(data => {
- this.schoolSearchResult = data.data
- })
- },
- closeSchoolSheet(){
- this.showChangeSchoolSheet = false
- },
- closePaySheet(){
- this.showPaySheet = false
- },
- onTabChange(event){
- this.active = event.$wx.detail
-
- if(this.active === 0){
-
- }else{
- wx.switchTab({
- url: '/pages/progress'
- })
- }
- },
- taskSubmit(){
- //TODO 学校是否开启的判断
-
- if (!this.messageComp || !this.messagePacketCode) {
- wx.showToast({
- title: '未识别成功,请自行输入快递公司以及取货码',
- icon: 'none',
- duration: 4000
- })
- return
- }
- this.messageConfirmed = true
- if(!this.address){
- wx.showToast({
- title: '请填写正确的收货地址',
- icon: 'none',
- duration: 4000
+ var order = res.path;
+ if(!order){
+ order = res.result
+ }
+ if(order.indexOf("=")!==-1){
+ order = order.split("=")[1]
+ }
+ if(order.indexOf('PO') === -1){
+ wx.showToast({
+ title: '二维码非法,请您扫描配送单二维码',
+ icon: 'error',
+ duration: 3000
+ })
+ return
+ }
+ //将货单号,储存到缓存中
+ wx.setStorageSync("order", order);
+ wx.navigateTo({
+ url: '/pages/approvePreview'
})
- return
- }
-
- let remark = this.remarkText
- this.remarkList.forEach(item=>{
- if(item.checked){
- remark+= item.label
+ // let role = wx.getStorageSync("role");
+ // if(role === '验货员'){
+ // wx.navigateTo({
+ // url: '../inspectionPreview/inspectionPreview'
+ // })
+ // }else {
+ // wx.navigateTo({
+ // url: '../nosignpreview/nosignpreview'
+ // })
+ // }
}
})
+ }
+ },
+ onShow() {
+ let usernam = wx.getStorageSync("username");
+ let rol = wx.getStorageSync("role");
+ let pla = wx.getStorageSync("plat");
- let param = {
- remark: remark,
- phone: this.address.phone,
- addressID: this.address.addressID,
- receiverName: this.address.name,
- parcelInfo: this.messageText,
- courierCompany: this.messageComp,
- pickupCode: this.messagePacketCode,
- pay: this.paytype===1?this.smallprice:this.bigprice
- }
-
- http.post('/task/submit',param).then(data => {
- this.closePaySheet()
- wx.showToast({
- title: '提交成功!',
- icon: 'success',
- duration: 4000
- })
- return
+ if(usernam&&rol){
+ let ktzCo = wx.getStorageSync("ktzCode");
- })
- },
- updateAddress() {
- if (!this.addressSheet_Name) {
- wx.showToast({
- title: '请输入收件人姓名',
- icon: 'none',
- duration: 4000
- })
- return
- }
- if (!this.addressSheet_Phone) {
- wx.showToast({
- title: '请输入收件人电话',
- icon: 'none',
- duration: 4000
- })
- return
+ let param = { 审批角色: rol }
+ if(ktzCo){
+ param.课题组编号 = ktzCo
}
- if (!this.addressSheet_Dormitory || this.addressSheet_Dormitory === '其他') {
- wx.showToast({
- title: '请选择宿舍楼',
- icon: 'none',
- duration: 4000
- })
- return
- }
- if (!this.addressSheet_Floor) {
- wx.showToast({
- title: '请输入楼层',
- icon: 'none',
- duration: 4000
- })
- return
- }
- if (!this.addressSheet_Room) {
- wx.showToast({
- title: '请输入房间号',
- icon: 'none',
- duration: 4000
- })
- return
+ if(pla === 'fwh'){
+ wx.setStorageSync('urlPrefix','https://www.tmallab.com/fwhj')
+ }else{
+ wx.setStorageSync('urlPrefix','https://www.tmallab.com/pkunxyj')
}
- http.post('/address/updateAddress', {
- dormitoryName: this.addressSheet_Dormitory,
- floor: this.addressSheet_Floor,
- room: this.addressSheet_Room,
- name: this.addressSheet_Name,
- phone: this.addressSheet_Phone
- }).then(res => {
- if(res.code === 200){
- this.address = res.data
- this.showAddressSheet = false
+ http.post('/JPost?query=vue_审批list', param).then(res => {
+ if(res.flag === "1"){
+ this.orderList = res.data.map(v=>{
+ return v['订单号']
+ })
+ let l = Array.from(new Set(this.orderList))
+ this.orderList = l
+ }else{
+ this.orderList = []
}
})
+ }
+ },
+ onLoad(options) {
+ if(options.scene){
+ var scene = decodeURIComponent(options.scene);
- },
+ console.log(scene)
+ var arrPara = scene.split(",");
- confirmMessage() {
- if (!this.messageComp || !this.messagePacketCode) {
- wx.showToast({
- title: '未识别成功,请自行输入快递公司以及取货码',
- icon: 'none',
- duration: 4000
- })
- return
- }
- this.messageConfirmed = true
- },
- messageInput() {
- this.messageConfirmed = false
- this.messageComp = ''
- this.messagePacketCode = ''
- for (var idx in this.carrierCoList) {
- let item = this.carrierCoList[idx]
- if (this.messageText.indexOf(item) !== -1) {
- this.messageComp = item
- break
- }
- }
- this.messagePacketCode = this.parsePaketCode(this.messageText)
- },
- remarkCheck(e, item) {
- this.remarkList[e].checked = !this.remarkList[e].checked
- },
- DormitoryConfirm() {
- this.showDormitorySheet = false
- },
- onDormitorySelect(event) {
- const { picker, value, index } = event.$wx.detail
- this.addressSheet_Dormitory = value
- },
- closeDormitorySheet() {
- this.showDormitorySheet = false
- },
- domi_input_tap() {
- this.showDormitorySheet = true
- },
- closeAddressSheet() {
- this.showAddressSheet = false
- },
- cleanMessage() {
- this.messageText = ''
- },
- parsePaketCode(str) {
- let result = ''
- var pattern = /\d{1,}(\-|\/|.)\d{1,}\1\d{1,}/
- var arr = str.match(pattern)
- if (arr && arr.length > 0) {
- result = arr[0]
- return result
- }
- pattern = /\d{1,}(\-|\/|.)\d{1,6}/
-
- arr = str.match(pattern)
- if (arr && arr.length > 0 && !result) {
- result = arr[0]
- return result
- }
+ var role = arrPara[0]
+ var username = arrPara[1]
+ var plat = arrPara[3]
- pattern = /\d{1,}(\_|\/|.)\d{1,6}/
+ wx.setStorageSync("plat", plat);
- arr = str.match(pattern)
- if (arr && arr.length > 0 && !result) {
- result = arr[0]
- return result
+ if(role==='JS0010'){
+ role = 'JSXXXX'
}
- pattern = /\d{1,}(\_|\/|.)\d{1,}\1\d{1,}/
- var arr = str.match(pattern)
- if (arr && arr.length > 0) {
- result = arr[0]
- return result
- }
-
- pattern = /\d{2,}/
+ wx.setStorageSync("username", username);
+ wx.setStorageSync("role", role);
- arr = str.match(pattern)
- if (arr && arr.length > 0 && !result) {
- result = arr[0]
+ try {
+ var ktzCode = arrPara[2]
+ wx.setStorageSync("ktzCode", ktzCode);
+ }catch (e){
+ console.log(e)
}
- return result
- },
- getPhone() {
- },initSchool(){
- let schoolID = wx.getStorageSync('schoolID')
- this.schoolIconUrl = app.config.urlPrefix+'/school/icon/'+schoolID
- http.get('/school/info/'+schoolID).then(res => {
- this.school = res.data
- if(res.data.deleted === 1){
- this.showUnOpenSheet = true
- }
- })
}
- },
- onShow() {
- this.showMark = !wx.getStorageSync("know")
- // this.showMark = true
- this.active = 0
- //TODO 初始化学校 id
- if(!wx.getStorageSync('schoolID')){
- wx.setStorageSync('schoolID', 2)
- }
- const _that = this
+ let usernam = wx.getStorageSync("username");
+ let rol = wx.getStorageSync("role");
- http.post('/schoolconfig/getBySchool').then(res => {
- if(res.data){
- if(res.data.bigprice){
- this.bigprice = res.data.bigprice
- }
- if(res.data.smallprice){
- this.smallprice = res.data.smallprice
- }
- if(res.data.smallprice){
- this.smallprice = res.data.smallprice
- }
- if(res.data.amdeadline){
- this.amdeadline = res.data.amdeadline
- }
+ let pla = wx.getStorageSync("plat");
+ let ktzCo = wx.getStorageSync("ktzCode");
- if(res.data.pmdeadline){
- this.pmdeadline = res.data.pmdeadline
+ if(!usernam||!rol||!pla){
+ wx.showModal({
+ title: "提示",
+ showCancel: false,
+ content: '请登录网页扫码登录此小程序',
+ //点击确认返回main界面
+ success: function (res) {
}
- }
- })
+ })
+ return
+ }
- wx.login({
- success(res) {
- var code = res.code
- http.post('/wxLogin', { code: code }).then(data => {
- let customerID = data.data.customerID
- if (customerID) {
- wx.setStorageSync('customerID', customerID)
- }
- http.post('/address/getAddressByUser').then(data => {
- data = data.data
- if (data) {
- _that.address = data
- _that.addressSheet_Dormitory = data.dormitoryName
- _that.addressSheet_Floor = data.floor
- _that.addressSheet_Name = data.name
- _that.addressSheet_Phone = data.phone
- _that.addressSheet_Room = data.room
- } else {
- _that.address = null
- }
- })
- _that.initSchool()
+ if(pla === 'fwh'){
+ wx.setStorageSync('urlPrefix','https://www.tmallab.com/fwhj')
+ }else{
+ wx.setStorageSync('urlPrefix','https://www.tmallab.com/pkunxyj')
+ }
- http.post('/dormitory/getBySchool', { pageIndex: 1, pageSize: 100 }).then(res => {
- _that.dormitoryList = res.data.map(v => {
- return v.name
- })
- _that.dormitoryList.unshift('其他')
- })
+ let param = { 审批角色: rol }
+ if(ktzCo){
+ param.课题组编号 = ktzCo
+ }
+ http.post('/JPost?query=vue_审批list', param).then(res => {
+ if(res.flag === "1"){
+ this.orderList = res.data.map(v=>{
+ return v['订单号']
})
+ let l = Array.from(new Set(this.orderList))
+ this.orderList = l
+ }else{
+ this.orderList = []
}
})
-
}
})
@@ -1426,12 +279,14 @@ navigationBarTextStyle: "white",
navigationBarBackgroundColor: "#45C9C3",
navigationBarTitleText: '小树懒捎带',
usingComponents: {
+"van-empty": "module:@vant/weapp/lib/empty/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",
diff --git a/src/pages/progress.wpy b/src/pages/progress.wpy
index 2bf1e956becb7b2969f53eb5d8a84e5430a94a8f..ca9908c9feb1ebc7acfb4bfce8fbb3d6ef9ab293 100644
--- a/src/pages/progress.wpy
+++ b/src/pages/progress.wpy
@@ -415,7 +415,7 @@ import store from '../store'
import testMixin from '../mixins/test'
import http from '../common/http.js'
-const app = getApp().$wepy.$options
+const prefix = wx.getStorageSync('urlPrefix')
wepy.page({
@@ -448,7 +448,7 @@ wepy.page({
},
sub(item) {
wx.requestSubscribeMessage({
- tmplIds: ['CGlLzkCZy2Q5XaMvRw1-9gfHy_CRhk4_6LuXhKK2vI4','Lr1MlntU2DKsuxtrlTJT_d3uxOeIvKjIsjzHSKUpUOI','8VhR4ruZ-b6kZRzSzQ4TwIoQKtz7ODjkkHCgAsalFSE'],
+ tmplIds: ['Lr1MlntU2DKsuxtrlTJT_d3uxOeIvKjIsjzHSKUpUOI','CGlLzkCZy2Q5XaMvRw1-9gfHy_CRhk4_6LuXhKK2vI4','8VhR4ruZ-b6kZRzSzQ4TwIoQKtz7ODjkkHCgAsalFSE'],
success (res) {
wx.showToast({
title: '订阅成功',
@@ -468,10 +468,9 @@ wepy.page({
},
photo1(item){
if(item.takeCredentials){
- console.log(app.config.urlPrefix+'/download/'+item.takeCredentials)
wx.previewImage({
- current: app.config.urlPrefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接
- urls: [app.config.urlPrefix+'/download/'+item.takeCredentials]
+ current: prefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接
+ urls: [prefix+'/download/'+item.takeCredentials]
})
}else{
wx.showToast({
@@ -485,8 +484,8 @@ wepy.page({
if(item.takeCredentials){
wx.previewImage({
- current: app.config.urlPrefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接
- urls: [app.config.urlPrefix+'/download/'+item.takeCredentials]
+ current: prefix+'/download/'+item.takeCredentials, // 当前显示图片的http链接
+ urls: [prefix+'/download/'+item.takeCredentials]
})
}else{
wx.showToast({
@@ -499,8 +498,8 @@ wepy.page({
photo3(item){
if(item.innerSendCredentials){
wx.previewImage({
- current: app.config.urlPrefix+'/download/'+item.innerSendCredentials, // 当前显示图片的http链接
- urls: [app.config.urlPrefix+'/download/'+item.innerSendCredentials]
+ current: prefix+'/download/'+item.innerSendCredentials, // 当前显示图片的http链接
+ urls: [prefix+'/download/'+item.innerSendCredentials]
})
}else{
wx.showToast({