Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
XDJK
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wechatminiprogram
XDJK
Commits
41f02a61
Commit
41f02a61
authored
Jan 16, 2021
by
liuquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.1.7
U:修改地址添加判断
parent
a05a1e25
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
35 deletions
+86
-35
packageA/drugOrder/drugOrder.js
+40
-25
packageA/drugOrderDetail/drugOrderDetail.js
+16
-2
packageA/drugOrderDetail/drugOrderDetail.wxml
+1
-1
packageA/logistics/logistics.js
+1
-0
project.config.json
+6
-0
utils/config.js
+3
-2
utils/service.js
+19
-5
No files found.
packageA/drugOrder/drugOrder.js
View file @
41f02a61
const
Service
=
require
(
'../../utils/service.js'
);
const
{
debouce
}
=
require
(
'../../utils/util.js'
);
//防抖函数
const
{
debouce
}
=
require
(
'../../utils/util.js'
);
//防抖函数
const
Util
=
require
(
'../../utils/util.js'
);
Page
({
...
...
@@ -13,7 +15,7 @@ Page({
winH
:
null
,
},
showview
:
false
,
list
:[]
list
:
[]
},
/**
...
...
@@ -45,7 +47,7 @@ Page({
},
1500
);
},
//删除订单
deleBtn
:
debouce
(
function
(
e
)
{
deleBtn
:
debouce
(
function
(
e
)
{
var
that
=
this
wx
.
showModal
({
content
:
'是否确认删除订单'
,
...
...
@@ -64,13 +66,13 @@ Page({
})
that
.
getList
(
that
.
data
.
nav
)
}
}).
catch
((
Error
)
=>
{
}).
catch
((
Error
)
=>
{
console
.
warn
(
'error:'
,
Error
);
// 获取会话资料失败的相关信息
});
}
}
})
},
1000
,
true
),
},
1000
,
true
),
//获取列表
getList
:
function
(
status
)
{
var
that
=
this
...
...
@@ -80,19 +82,19 @@ Page({
status
:
status
};
Service
.
buyDrugList
(
data
).
then
((
res
)
=>
{
console
.
log
(
"getList"
,
res
)
console
.
log
(
"getList"
,
res
)
if
(
res
.
code
==
1
)
{
that
.
setData
({
list
:
res
.
data
,
showview
:
true
})
}
else
{
}
else
{
that
.
setData
({
list
:
[],
showview
:
true
})
wx
.
showToast
({
title
:
res
.
msg
,
title
:
res
.
msg
,
})
}
}).
catch
(
function
(
Error
)
{
...
...
@@ -109,7 +111,7 @@ Page({
_this
.
getList
(
e
.
currentTarget
.
dataset
.
index
)
},
//确认收货
confirmReceipt
:
debouce
(
function
(
e
)
{
confirmReceipt
:
debouce
(
function
(
e
)
{
let
that
=
this
let
data
=
{
unionid
:
wx
.
getStorageSync
(
'data'
).
unionid
,
...
...
@@ -120,7 +122,7 @@ Page({
success
(
ress
)
{
if
(
ress
.
confirm
)
{
Service
.
confirmReceipt
(
data
).
then
((
res
)
=>
{
console
.
log
(
"confirmReceipt"
,
res
)
console
.
log
(
"confirmReceipt"
,
res
)
wx
.
showToast
({
title
:
res
.
msg
,
})
...
...
@@ -131,7 +133,7 @@ Page({
}
}
})
},
1000
,
true
),
},
1000
,
true
),
// 查看物流-待发货
// goLogistics1: function (e) {
// console.log(1,e.currentTarget.dataset.id)
...
...
@@ -139,37 +141,49 @@ Page({
// url: e.currentTarget.dataset.src +'?img=' + e.currentTarget.dataset.img + '&status=' + e.currentTarget.dataset.status + '&num=' + e.currentTarget.dataset.num + '&tel=' + e.currentTarget.dataset.tel + '&ordernumber=' + e.currentTarget.dataset.ordernumber+'&com='+e.currentTarget.dataset.com +'&address='+JSON.stringify(e.currentTarget.dataset.address),
// })
// },
/**
/**
*修改地址-待发货2
*/
editAddress
:
debouce
(
function
(
e
){
editAddress
:
debouce
(
function
(
e
)
{
Service
.
isEditAddress
({
ordernumber
:
e
.
currentTarget
.
dataset
.
ordernumber
}).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
wx
.
navigateTo
({
url
:
'/packageA/addsite/addsite?item='
+
JSON
.
stringify
(
e
.
currentTarget
.
dataset
.
address
)
+
'&ordernumber='
+
e
.
currentTarget
.
dataset
.
ordernumber
+
'&type=1'
,
url
:
'/packageA/addsite/addsite?item='
+
JSON
.
stringify
(
e
.
currentTarget
.
dataset
.
address
)
+
'&ordernumber='
+
e
.
currentTarget
.
dataset
.
ordernumber
+
'&type=1'
,
})
}
else
{
wx
.
showToast
({
title
:
res
.
msg
,
icon
:
'success'
,
mask
:
true
})
}
})
},
1000
,
true
),
},
1000
,
true
),
/**
* 订单详情-待发货2,已发货3,已完成4
*/
goOrderDetail
:
debouce
(
function
(
e
)
{
goOrderDetail
:
debouce
(
function
(
e
)
{
wx
.
navigateTo
({
url
:
'/packageA/drugOrderDetail/drugOrderDetail?id='
+
e
.
currentTarget
.
dataset
.
id
,
})
},
1000
,
true
),
},
1000
,
true
),
//查看物流-待收货+已完成
goLogistics
:
debouce
(
function
(
e
)
{
goLogistics
:
debouce
(
function
(
e
)
{
wx
.
navigateTo
({
url
:
e
.
currentTarget
.
dataset
.
src
+
"?num="
+
e
.
currentTarget
.
dataset
.
num
+
'&tel='
+
e
.
currentTarget
.
dataset
.
tel
+
'&ordernumber='
+
e
.
currentTarget
.
dataset
.
ordernumber
+
'&img='
+
e
.
currentTarget
.
dataset
.
img
+
'&status='
+
e
.
currentTarget
.
dataset
.
status
+
'&com='
+
e
.
currentTarget
.
dataset
.
com
+
'&address='
+
JSON
.
stringify
(
e
.
currentTarget
.
dataset
.
address
),
url
:
e
.
currentTarget
.
dataset
.
src
+
"?num="
+
e
.
currentTarget
.
dataset
.
num
+
'&tel='
+
e
.
currentTarget
.
dataset
.
tel
+
'&ordernumber='
+
e
.
currentTarget
.
dataset
.
ordernumber
+
'&img='
+
e
.
currentTarget
.
dataset
.
img
+
'&status='
+
e
.
currentTarget
.
dataset
.
status
+
'&com='
+
e
.
currentTarget
.
dataset
.
com
+
'&address='
+
JSON
.
stringify
(
e
.
currentTarget
.
dataset
.
address
),
})
},
1000
,
true
),
},
1000
,
true
),
/**
* 立即支付
*/
goPay
:
debouce
(
function
(
e
)
{
goPay
:
debouce
(
function
(
e
)
{
let
that
=
this
;
let
data
=
{
prescription
:
e
.
currentTarget
.
dataset
.
id
,
prescription
:
e
.
currentTarget
.
dataset
.
id
,
patient_unionid
:
wx
.
getStorageSync
(
'data'
).
unionid
,
isquick
:
e
.
currentTarget
.
dataset
.
isquick
isquick
:
e
.
currentTarget
.
dataset
.
isquick
}
Service
.
getPayStatus
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
...
...
@@ -178,12 +192,12 @@ Page({
wx
.
navigateTo
({
url
:
'/packageA/drugOrderInfo/drugOrderInfo?scene='
+
e
.
currentTarget
.
dataset
.
id
+
"&isQuick="
+
e
.
currentTarget
.
dataset
.
isquick
,
})
}
else
if
(
res
.
code
==
2
)
{
}
else
if
(
res
.
code
==
2
)
{
wx
.
showToast
({
title
:
res
.
msg
,
icon
:
'none'
})
}
})
},
1000
,
true
),
},
1000
,
true
),
})
\ No newline at end of file
packageA/drugOrderDetail/drugOrderDetail.js
View file @
41f02a61
...
...
@@ -134,11 +134,25 @@ Page({
/**
*修改地址-待发货2
*/
editAddress
:
Util
.
debouce
(
function
(
e
){
editAddress
:
Util
.
debouce
(
function
(
e
)
{
Service
.
isEditAddress
({
ordernumber
:
e
.
currentTarget
.
dataset
.
ordernumber
}).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
wx
.
navigateTo
({
url
:
'/packageA/addsite/addsite?item='
+
JSON
.
stringify
(
e
.
currentTarget
.
dataset
.
address
)
+
'&ordernumber='
+
e
.
currentTarget
.
dataset
.
ordernumber
,
})
},
1000
,
true
),
}
else
{
wx
.
showToast
({
title
:
res
.
msg
,
icon
:
'success'
,
mask
:
true
})
}
})
},
1000
,
true
),
/**
* 查看处方
* type 0 处方 1 用药建议
...
...
packageA/drugOrderDetail/drugOrderDetail.wxml
View file @
41f02a61
...
...
@@ -108,7 +108,7 @@
<view class="ordertitle">订单详情</view>
<view class="row ordernumber">
<view>订单编号:<text style="color:#333;">{{item.ordernumber}}</text></view>
<view class="copy" bindtap="copy" data-c="
C20191202000152
">复制订单</view>
<view class="copy" bindtap="copy" data-c="
{{item.ordernumber}}
">复制订单</view>
</view>
<view>支付时间:{{item.create_time}}</view>
</view>
...
...
packageA/logistics/logistics.js
View file @
41f02a61
...
...
@@ -35,6 +35,7 @@ Page({
mobileTail
:
options
.
tel
.
substring
(
options
.
tel
.
length
-
4
),
})
}
console
.
log
(
"options"
,
options
)
var
list
=
options
.
num
.
split
(
','
)
var
comlist
=
options
.
com
.
split
(
','
)
that
.
setData
({
...
...
project.config.json
View file @
41f02a61
...
...
@@ -119,6 +119,12 @@
"pathName"
:
"pages/prescription/order/order"
,
"query"
:
"scene=1322"
,
"scene"
:
null
},
{
"name"
:
"物流模板信息"
,
"pathName"
:
"packageA/logistics/logistics"
,
"query"
:
"id=978&num=SF1334982552976&tel=17801017172&ordernumber=20210106215421&img=https://www.xiaodongai.com/xiaodongai/ceshi/Uploads/Drug/2020-04-11/5e916ffe83129.jpg&status=3&address={
\"
id
\"
:7343,
\"
openid
\"
:
\"
oYQX40BtoLUP4sbDt8iKxO-CcQ74
\"
,
\"
unionid
\"
:
\"
oHhp80YULOSNxEltQNTTkRqjzNrI
\"
,
\"
name
\"
:
\"
小孔5
\"
,
\"
phone
\"
:
\"
17801017172
\"
,
\"
take_over
\"
:
\"
北京市北京市通州区
\"
,
\"
detail_address
\"
:
\"
北京市北京市通州区小懂科技
\"
,
\"
create_time
\"
:
\"
1610531672
\"
,
\"
update_time
\"
:null,
\"
status
\"
:0,
\"
is_default
\"
:0,
\"
province
\"
:
\"
北京市
\"
,
\"
city
\"
:
\"
北京市
\"
,
\"
area
\"
:
\"
通州区
\"
}&com="
,
"scene"
:
1014
}
]
}
...
...
utils/config.js
View file @
41f02a61
...
...
@@ -13,8 +13,8 @@ var HOST = 'https://www.xiaodongai.com/xiaodongai/kongtian/';
var
HOST_info
=
'https://vivshi.com/xiaodongai/kongtian/'
;
// 弃用
//
var HOST_yiyuan="https://www.xiaodongai.com/xiaodong_yiyuan/xd_admin/public/index.php/apitest/";//互联网医院测试
var
HOST_yiyuan
=
"https://www.xiaodongai.com/xiaodong_yiyuan/xd_admin/public/index.php/api/"
;
//互联网医院正式
var
HOST_yiyuan
=
"https://www.xiaodongai.com/xiaodong_yiyuan/xd_admin/public/index.php/apitest/"
;
//互联网医院测试
//
var HOST_yiyuan="https://www.xiaodongai.com/xiaodong_yiyuan/xd_admin/public/index.php/api/";//互联网医院正式
const
url
=
{
getUserSig
:
HOST
+
'wechatIm.php?s=/Im/wechat_get_sign'
,
//获取usersig以及userID
getOpenId
:
HOST
+
'applet.php?s=Applet/getopenid'
,
///获取openid
...
...
@@ -57,6 +57,7 @@ const url = {
prescriptionPay
:
HOST
+
"wechatIteration.php?s=/Prescription/zfxds"
,
//支付
addAddress
:
HOST
+
"wechatIteration.php?s=/Prescription/address"
,
//新增地址
editAddress
:
HOST
+
"wechatIteration.php?s=/Prescription/editAddress"
,
//修改地址
isEditAddress
:
HOST
+
"wechatIteration.php?s=/Prescription/canEditAddress"
,
//判断是否可修改地址
addressList
:
HOST
+
"wechatIteration.php?s=/Prescription/listAddress"
,
//地址列表
defaultAddress
:
HOST
+
"wechatIteration.php?s=/Prescription/addressDefault"
,
//默认地址
getDrugList
:
HOST
+
"wechatIteration.php?s=/Prescription/openDrug"
,
//处方列表
...
...
utils/service.js
View file @
41f02a61
...
...
@@ -158,7 +158,8 @@ function isDrugEnough(orderid) {
}
return
wxRequest
.
postRequest
(
isDrugEnoughUrl
,
data
);
}
/** 药方支付
/**
* 药方支付
* @param {*} param.orderid 订单id
* @param {*} param.ordernumber 订单号
* @param {*} param.address 地址id
...
...
@@ -167,7 +168,8 @@ function prescriptionPay(param) {
var
prescriptionPayUrl
=
config
.
url
.
prescriptionPay
;
//支付
return
wxRequest
.
postRequest
(
prescriptionPayUrl
,
param
);
}
/** 新增药方地址
/**
* 新增药方地址
* @param {*} param.openid 用户openid
* @param {*} param.unionid 用户唯一标识
* @param {*} param.name 用户姓名
...
...
@@ -179,7 +181,8 @@ function addAddress(param) {
var
addAddressUrl
=
config
.
url
.
addAddress
;
return
wxRequest
.
postRequest
(
addAddressUrl
,
param
);
}
/** 修改药方地址
/**
* 修改药方地址
* @param {*} param.id 地址id
* @param {*} param.name 用户姓名
* @param {*} param.phone 用户手机
...
...
@@ -190,7 +193,16 @@ function editAddress(param) {
var
editAddressUrl
=
config
.
url
.
editAddress
;
//支付
return
wxRequest
.
postRequest
(
editAddressUrl
,
param
);
}
/**药方地址列表
/**
* 是否可修改收货地址
* @param {*} param.ordernumber //订单号
*/
function
isEditAddress
(
param
){
var
isEditAddressUrl
=
config
.
url
.
isEditAddress
;
//支付
return
wxRequest
.
postRequest
(
isEditAddressUrl
,
param
);
}
/**
* 药方地址列表
* @param {*} param.openid 地址id
* @param {*} param.unionid 用户姓名
*/
...
...
@@ -198,7 +210,8 @@ function addressList(param) {
var
addressListUrl
=
config
.
url
.
addressList
;
//支付
return
wxRequest
.
postRequest
(
addressListUrl
,
param
);
}
/** 药方默认地址
/**
* 药方默认地址
* @param {*} param.addressId 地址id
* @param {*} param.openid 用户openid
* @param {*} param.unionid 用户唯一id
...
...
@@ -612,6 +625,7 @@ module.exports = {
prescriptionPay
:
prescriptionPay
,
//药方支付
addAddress
:
addAddress
,
//新增地址
editAddress
:
editAddress
,
//修改地址
isEditAddress
:
isEditAddress
,
//判断是否修改地址
addressList
:
addressList
,
//地址列表
defaultAddress
:
defaultAddress
,
//地址详情
isReport
:
isReport
,
//检测是否允许查看报告
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment