diff --git a/api/mine/wallet.js b/api/mine/wallet.js
new file mode 100644
index 0000000..32aa5fd
--- /dev/null
+++ b/api/mine/wallet.js
@@ -0,0 +1,11 @@
+
+import request from '@/utils/request'
+
+// 我的账户 /api/front/user/center/my/account
+export function getMyWalletAPI() {
+ return request({
+ url: '/api/front/user/center/my/account',
+ method: 'get',
+ })
+}
+
diff --git a/api/myOrder/index.js b/api/myOrder/index.js
new file mode 100644
index 0000000..54717fe
--- /dev/null
+++ b/api/myOrder/index.js
@@ -0,0 +1,137 @@
+import request from '@/utils/request'
+
+// 查询工单列表
+export function getReservationList(params) {
+ return request({
+ url: '/api/front/car/user/center/reservation/order/list',
+ method: 'get',
+ params
+ })
+}
+// 积分商品订单列表 /api/front/integral/product/order/list
+export function getIntegralOrderList(params) {
+ return request({
+ url: '/api/front/integral/product/order/list',
+ method: 'get',
+ params
+ })
+}
+//积分商品订单详情 /api/front/integral/product/order/info/{id}
+export function getIntegralOrderDetail(id) {
+ return request({
+ url: `/api/front/integral/product/order/info/${id}`,
+ method: 'get',
+ })
+}
+//积分商品订单取消 /api/front/card/product/order/cancel/{orderNo}
+export function getIntegralOrderCancel(orderNo) {
+ return request({
+ url: `/api/front/integral/product/order/cancel/${orderNo}`,
+ method: 'post',
+ })
+}
+//卡券订单列表 /api/front/card/product/order/list
+export function getCardOrderList(params) {
+ return request({
+ url: '/api/front/card/product/order/list',
+ method: 'get',
+ params
+ })
+}
+//卡券订单详情
+export function getCardOrderDetail(id) {
+ return request({
+ url: `/api/front/card/product/order/detail/${id}`,
+ method: 'get',
+ })
+}
+//卡券订单取消 /api/front/card/product/order/cancel/{orderNo}
+export function getCardOrderCancel(orderNo) {
+ return request({
+ url: `/api/front/card/product/order/cancel/${orderNo}`,
+ method: 'post',
+ })
+}
+// 卡券订单申请退款/api/front/card/product/order/refund
+export function getCardOrderRefund(data) {
+ return request({
+ url: `/api/front/card/product/order/refund`,
+ method: 'post',
+ data
+ })
+}
+//卡券订单退款详情/api/front/card/product/order/refund/detail/{orderNo}
+export function getCardOrderRefundDetail(orderNo) {
+ return request({
+ url: `/api/front/card/product/order/refund/detail/${orderNo}`,
+ method: 'get',
+ })
+}
+//通过卡券订单编号获取卡券可使用门店列表 /api/front/card/product/order/merchant/list/{id}
+export function getCardMerchantList(orderNo) {
+ return request({
+ url: `/api/front/card/product/order/merchant/list/${orderNo}`,
+ method: 'get',
+ })
+}
+//删除工单 /api/front/car/user/center/delete/reservation/order/{id}
+export function deleteCenterOrder(id) {
+ return request({
+ url: `/api/front/car/user/center/delete/reservation/order/${id}`,
+ method: 'post',
+ })
+}
+//取消工单 /api/front/car/user/center/cancel/reservation/order/{id}
+export function getCancelOrderCancel(id) {
+ return request({
+ url: `/api/front/car/user/center/cancel/reservation/order/${id}`,
+ method: 'post',
+ })
+}
+//工单详情 /api/front/car/user/center/info
+export function getCancelOrderDetail(params) {
+ return request({
+ url: `/api/front/car/user/center/info`,
+ method: 'get',
+ params
+ })
+}
+//工单评价 /api/front/integral/product/order/reply/save
+export function getCarOrderSave(data) {
+ return request({
+ url: `/api/front/car/user/center/reply`,
+ method: 'post',
+ data
+ })
+}
+//工单评价详情 /api/front/merchant/reservation/reply/detail/{id}
+export function getCarOrderDetail(id) {
+ return request({
+ url: `/api/front/merchant/reservation/reply/detail/${id}`,
+ method: 'get',
+ })
+}
+//我的工单评价列表
+export function getCarOrderReplyList(params) {
+ return request({
+ url: `/api/front/car/user/center/reply/list`,
+ method: 'get',
+ params
+ })
+}
+//卡券订单评价 /api/front/card/product/order/reply
+export function getRrontOrderReply(data) {
+ return request({
+ url: `/api/front/card/product/order/reply`,
+ method: 'post',
+ data
+ })
+}
+// 卡券订单评价列表 /api/front/card/product/order/reply/list
+export function getFrontOrderReplyList(params) {
+ return request({
+ url: `/api/front/card/product/order/reply/list`,
+ method: 'get',
+ params
+ })
+}
\ No newline at end of file
diff --git a/api/system/user.js b/api/system/user.js
index 49a28b1..dcb0b85 100644
--- a/api/system/user.js
+++ b/api/system/user.js
@@ -1,9 +1,39 @@
-import request from '@/utils/request'
-
-// 查询用户个人信息
-export function getUserInfo() {
- return request({
- url: '/api/front/user/info',
- method: 'get'
- })
+import request from '@/utils/request'
+
+// 查询用户个人信息
+export function getUserInfo() {
+ return request({
+ url: '/api/front/user/info',
+ method: 'get'
+ })
}
+
+// 查询用户个人信息
+export function getUserUserInfo() {
+ return request({
+ url: '/api/front/user/user/info',
+ method: 'get'
+ })
+}
+//个人中心/api/front/user/center/info
+ export function userCenterInfo(id) {
+ return request({
+ url: `/api/front/user/center/info`,
+ method: 'get'
+ })
+ }
+ // 个人中心首页 /api/front/user/center/user/personal/center
+ export function userCenterPersonalInfo(id) {
+ return request({
+ url: `/api/front/user/center/user/personal/center`,
+ method: 'get'
+ })
+ }
+ //编辑个人资料 /api/front/user/user/edit
+ export function getUserEdit(data) {
+ return request({
+ url: `/api/front/user/user/edit`,
+ method: 'post',
+ data
+ })
+ }
\ No newline at end of file
diff --git a/api/user/index.js b/api/user/index.js
index ad28779..89b9799 100644
--- a/api/user/index.js
+++ b/api/user/index.js
@@ -78,4 +78,76 @@ export function cardUserRecord(data) {
method: 'post',
data
})
-}
\ No newline at end of file
+}
+ //我的活动 /api/front/card/product/order/help/list
+ export function getCardHelpList(params) {
+ return request({
+ url: '/api/front/card/product/order/help/list',
+ method: 'get',
+ params
+ })
+ }
+ //用户详情 /api/front/community/user/home/page/{id}
+ export function userInfo(id) {
+ return request({
+ url: `/api/front/community/user/home/page/${id}`,
+ method: 'get'
+ })
+ }
+
+ //我的收藏 卡券商品收藏 列表/api/front/card/product/collect/product/list
+ export function getCardCollectList(params) {
+ return request({
+ url: '/api/front/card/product/collect/product/list',
+ method: 'get',
+ params
+ })
+ }
+ // 我的收藏 积分商品收藏列表 / /api/front/integral/product/reply/product/list
+ export function getCardReplyList(params) {
+ return request({
+ url: '/api/front/integral/product/reply/product/list',
+ method: 'get',
+ params
+ })
+ }
+ // 核销券(卡券)列表
+ export function getFrontCardList(params) {
+ return request({
+ url: '/api/front/card/user/page/list',
+ method: 'get',
+ params
+ })
+ }
+ //卡券门店列表
+ export function getFrontCardUserList(data) {
+ return request({
+ url: '/api/front/card/user/merchant/list',
+ method: 'post',
+ data
+ })
+ }
+ // 优惠券列表 /api/front/coupon/user/list
+ export function getFrontCouponUserList(params) {
+ return request({
+ url: '/api/front/coupon/user/list',
+ method: 'get',
+ params
+ })
+ }
+ //修改卡券 /api/front/card/user/edit
+ export function cardUserEdit(data) {
+ return request({
+ url: '/api/front/card/user/edit',
+ method: 'post',
+ data
+ })
+ }
+ //卡券详情 /api/front/card/user/info/{id}
+ export function cardUserInfo(id) {
+ return request({
+ url: `/api/front/card/user/info/${id}`,
+ method: 'get'
+ })
+ }
+
\ No newline at end of file
diff --git a/data/address_a.js b/data/address_a.js
new file mode 100644
index 0000000..b17d909
--- /dev/null
+++ b/data/address_a.js
@@ -0,0 +1,1472 @@
+module.exports = {
+ "select_list": [
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "W",
+ "X",
+ "Y",
+ "Z"
+ ],
+ "city_list": {
+ "A": [
+ {
+ "code": "152900",
+ "city": "阿拉善盟"
+ },
+ {
+ "code": "210300",
+ "city": "鞍山"
+ },
+ {
+ "code": "340800",
+ "city": "安庆"
+ },
+ {
+ "code": "410500",
+ "city": "安阳"
+ },
+ {
+ "code": "513200",
+ "city": "阿坝藏族羌族自治州"
+ },
+ {
+ "code": "520400",
+ "city": "安顺"
+ },
+ {
+ "code": "542500",
+ "city": "阿里地区"
+ },
+ {
+ "code": "610900",
+ "city": "安康"
+ },
+ {
+ "code": "652900",
+ "city": "阿克苏地区"
+ },
+ {
+ "code": "654300",
+ "city": "阿勒泰地区"
+ },
+ {
+ "code": "820100",
+ "city": "澳门半岛"
+ }
+ ],
+ "B": [
+ {
+ "code": "110100",
+ "city": "北京"
+ },
+ {
+ "code": "130600",
+ "city": "保定"
+ },
+ {
+ "code": "150200",
+ "city": "包头"
+ },
+ {
+ "code": "150800",
+ "city": "巴彦淖尔"
+ },
+ {
+ "code": "210500",
+ "city": "本溪"
+ },
+ {
+ "code": "220600",
+ "city": "白山"
+ },
+ {
+ "code": "220800",
+ "city": "白城"
+ },
+ {
+ "code": "340300",
+ "city": "蚌埠"
+ },
+ {
+ "code": "371600",
+ "city": "滨州"
+ },
+ {
+ "code": "450500",
+ "city": "北海"
+ },
+ {
+ "code": "451000",
+ "city": "百色"
+ },
+ {
+ "code": "511900",
+ "city": "巴中"
+ },
+ {
+ "code": "522400",
+ "city": "毕节地区"
+ },
+ {
+ "code": "530500",
+ "city": "保山"
+ },
+ {
+ "code": "610300",
+ "city": "宝鸡"
+ },
+ {
+ "code": "620400",
+ "city": "白银"
+ },
+ {
+ "code": "652700",
+ "city": "博尔塔拉蒙古自治州"
+ },
+ {
+ "code": "652800",
+ "city": "巴音郭楞蒙古自治州"
+ }
+ ],
+ "C": [
+ {
+ "code": "130800",
+ "city": "承德"
+ },
+ {
+ "code": "130900",
+ "city": "沧州"
+ },
+ {
+ "code": "140400",
+ "city": "长治"
+ },
+ {
+ "code": "150400",
+ "city": "赤峰"
+ },
+ {
+ "code": "211300",
+ "city": "朝阳"
+ },
+ {
+ "code": "220100",
+ "city": "长春"
+ },
+ {
+ "code": "320400",
+ "city": "常州"
+ },
+ {
+ "code": "341100",
+ "city": "滁州"
+ },
+ {
+ "code": "341700",
+ "city": "池州"
+ },
+ {
+ "code": "430100",
+ "city": "长沙"
+ },
+ {
+ "code": "430700",
+ "city": "常德"
+ },
+ {
+ "code": "431000",
+ "city": "郴州"
+ },
+ {
+ "code": "445100",
+ "city": "潮州"
+ },
+ {
+ "code": "451400",
+ "city": "崇左"
+ },
+ {
+ "code": "510100",
+ "city": "成都"
+ },
+ {
+ "code": "500100",
+ "city": "重庆"
+ },
+ {
+ "code": "532300",
+ "city": "楚雄彝族自治州"
+ },
+ {
+ "code": "542100",
+ "city": "昌都地区"
+ },
+ {
+ "code": "652300",
+ "city": "昌吉回族自治州"
+ }
+ ],
+ "D": [
+ {
+ "code": "140200",
+ "city": "大同"
+ },
+ {
+ "code": "210200",
+ "city": "大连"
+ },
+ {
+ "code": "210600",
+ "city": "丹东"
+ },
+ {
+ "code": "230600",
+ "city": "大庆"
+ },
+ {
+ "code": "232700",
+ "city": "大兴安岭地区"
+ },
+ {
+ "code": "370500",
+ "city": "东营"
+ },
+ {
+ "code": "371400",
+ "city": "德州"
+ },
+ {
+ "code": "441900",
+ "city": "东莞"
+ },
+ {
+ "code": "510600",
+ "city": "德阳"
+ },
+ {
+ "code": "511700",
+ "city": "达州"
+ },
+ {
+ "code": "532900",
+ "city": "大理白族自治州"
+ },
+ {
+ "code": "533100",
+ "city": "德宏傣族景颇族自治州"
+ },
+ {
+ "code": "533400",
+ "city": "迪庆藏族自治州"
+ },
+ {
+ "code": "621100",
+ "city": "定西"
+ }
+ ],
+ "E": [
+ {
+ "code": "150600",
+ "city": "鄂尔多斯"
+ },
+ {
+ "code": "420700",
+ "city": "鄂州"
+ },
+ {
+ "code": "422800",
+ "city": "恩施土家族苗族自治州"
+ }
+ ],
+ "F": [
+ {
+ "code": "210400",
+ "city": "抚顺"
+ },
+ {
+ "code": "210900",
+ "city": "阜新"
+ },
+ {
+ "code": "341200",
+ "city": "阜阳"
+ },
+ {
+ "code": "350100",
+ "city": "福州"
+ },
+ {
+ "code": "361000",
+ "city": "抚州"
+ },
+ {
+ "code": "440600",
+ "city": "佛山"
+ },
+ {
+ "code": "450600",
+ "city": "防城港"
+ }
+ ],
+ "G": [
+ {
+ "code": "360700",
+ "city": "赣州"
+ },
+ {
+ "code": "440100",
+ "city": "广州"
+ },
+ {
+ "code": "450300",
+ "city": "桂林"
+ },
+ {
+ "code": "450800",
+ "city": "贵港"
+ },
+ {
+ "code": "510800",
+ "city": "广元"
+ },
+ {
+ "code": "511600",
+ "city": "广安"
+ },
+ {
+ "code": "513300",
+ "city": "甘孜藏族自治州"
+ },
+ {
+ "code": "520100",
+ "city": "贵阳"
+ },
+ {
+ "code": "623000",
+ "city": "甘南藏族自治州"
+ },
+ {
+ "code": "632600",
+ "city": "果洛藏族自治州"
+ },
+ {
+ "code": "640400",
+ "city": "固原"
+ },
+ {
+ "code": "710200",
+ "city": "高雄"
+ }
+ ],
+ "H": [
+ {
+ "code": "130400",
+ "city": "邯郸"
+ },
+ {
+ "code": "131100",
+ "city": "衡水"
+ },
+ {
+ "code": "150100",
+ "city": "呼和浩特"
+ },
+ {
+ "code": "150700",
+ "city": "呼伦贝尔"
+ },
+ {
+ "code": "211400",
+ "city": "葫芦岛"
+ },
+ {
+ "code": "230100",
+ "city": "哈尔滨"
+ },
+ {
+ "code": "230400",
+ "city": "鹤岗"
+ },
+ {
+ "code": "231100",
+ "city": "黑河"
+ },
+ {
+ "code": "320800",
+ "city": "淮安"
+ },
+ {
+ "code": "330100",
+ "city": "杭州"
+ },
+ {
+ "code": "330500",
+ "city": "湖州"
+ },
+ {
+ "code": "340100",
+ "city": "合肥"
+ },
+ {
+ "code": "340400",
+ "city": "淮南"
+ },
+ {
+ "code": "340600",
+ "city": "淮北"
+ },
+ {
+ "code": "341000",
+ "city": "黄山"
+ },
+ {
+ "code": "371700",
+ "city": "菏泽"
+ },
+ {
+ "code": "410600",
+ "city": "鹤壁"
+ },
+ {
+ "code": "420200",
+ "city": "黄石"
+ },
+ {
+ "code": "421100",
+ "city": "黄冈"
+ },
+ {
+ "code": "430400",
+ "city": "衡阳"
+ },
+ {
+ "code": "431200",
+ "city": "怀化"
+ },
+ {
+ "code": "441300",
+ "city": "惠州"
+ },
+ {
+ "code": "441600",
+ "city": "河源"
+ },
+ {
+ "code": "451100",
+ "city": "贺州"
+ },
+ {
+ "code": "451200",
+ "city": "河池"
+ },
+ {
+ "code": "460100",
+ "city": "海口"
+ },
+ {
+ "code": "532500",
+ "city": "红河哈尼族彝族自治州"
+ },
+ {
+ "code": "610700",
+ "city": "汉中"
+ },
+ {
+ "code": "632100",
+ "city": "海东地区"
+ },
+ {
+ "code": "632200",
+ "city": "海北藏族自治州"
+ },
+ {
+ "code": "632300",
+ "city": "黄南藏族自治州"
+ },
+ {
+ "code": "632500",
+ "city": "海南藏族自治州"
+ },
+ {
+ "code": "632800",
+ "city": "海西蒙古族藏族自治州"
+ },
+ {
+ "code": "652200",
+ "city": "哈密地区"
+ },
+ {
+ "code": "653200",
+ "city": "和田地区"
+ }
+ ],
+ "J": [
+ {
+ "code": "140500",
+ "city": "晋城"
+ },
+ {
+ "code": "140700",
+ "city": "晋中"
+ },
+ {
+ "code": "210700",
+ "city": "锦州"
+ },
+ {
+ "code": "220200",
+ "city": "吉林"
+ },
+ {
+ "code": "230300",
+ "city": "鸡西"
+ },
+ {
+ "code": "230800",
+ "city": "佳木斯"
+ },
+ {
+ "code": "330400",
+ "city": "嘉兴"
+ },
+ {
+ "code": "330700",
+ "city": "金华"
+ },
+ {
+ "code": "360200",
+ "city": "景德镇"
+ },
+ {
+ "code": "360400",
+ "city": "九江"
+ },
+ {
+ "code": "360800",
+ "city": "吉安"
+ },
+ {
+ "code": "370100",
+ "city": "济南"
+ },
+ {
+ "code": "370800",
+ "city": "济宁"
+ },
+ {
+ "code": "410800",
+ "city": "焦作"
+ },
+ {
+ "code": "420800",
+ "city": "荆门"
+ },
+ {
+ "code": "421000",
+ "city": "荆州"
+ },
+ {
+ "code": "440700",
+ "city": "江门"
+ },
+ {
+ "code": "445200",
+ "city": "揭阳"
+ },
+ {
+ "code": "620200",
+ "city": "嘉峪关"
+ },
+ {
+ "code": "620300",
+ "city": "金昌"
+ },
+ {
+ "code": "620900",
+ "city": "酒泉"
+ },
+ {
+ "code": "710500",
+ "city": "金门县"
+ },
+ {
+ "code": "710700",
+ "city": "基隆"
+ },
+ {
+ "code": "710900",
+ "city": "嘉义"
+ },
+ {
+ "code": "810200",
+ "city": "九龙"
+ }
+ ],
+ "K": [
+ {
+ "code": "410200",
+ "city": "开封"
+ },
+ {
+ "code": "530100",
+ "city": "昆明"
+ },
+ {
+ "code": "650200",
+ "city": "克拉玛依"
+ },
+ {
+ "code": "653000",
+ "city": "克孜勒苏柯尔克孜自治州"
+ },
+ {
+ "code": "653100",
+ "city": "喀什地区"
+ }
+ ],
+ "L": [
+ {
+ "code": "131000",
+ "city": "廊坊"
+ },
+ {
+ "code": "411100",
+ "city": "漯河"
+ },
+ {
+ "code": "141000",
+ "city": "临汾"
+ },
+ {
+ "code": "141100",
+ "city": "吕梁"
+ },
+ {
+ "code": "211000",
+ "city": "辽阳"
+ },
+ {
+ "code": "220400",
+ "city": "辽源"
+ },
+ {
+ "code": "320700",
+ "city": "连云港"
+ },
+ {
+ "code": "331100",
+ "city": "丽水"
+ },
+ {
+ "code": "341500",
+ "city": "六安"
+ },
+ {
+ "code": "350800",
+ "city": "龙岩"
+ },
+ {
+ "code": "371200",
+ "city": "莱芜"
+ },
+ {
+ "code": "371300",
+ "city": "临沂"
+ },
+ {
+ "code": "371500",
+ "city": "聊城"
+ },
+ {
+ "code": "410300",
+ "city": "洛阳"
+ },
+ {
+ "code": "510500",
+ "city": "泸州"
+ },
+ {
+ "code": "431300",
+ "city": "娄底"
+ },
+ {
+ "code": "450200",
+ "city": "柳州"
+ },
+ {
+ "code": "451300",
+ "city": "来宾"
+ },
+ {
+ "code": "511100",
+ "city": "乐山"
+ },
+ {
+ "code": "513400",
+ "city": "凉山彝族自治州"
+ },
+ {
+ "code": "520200",
+ "city": "六盘水"
+ },
+ {
+ "code": "530700",
+ "city": "丽江"
+ },
+ {
+ "code": "530900",
+ "city": "临沧"
+ },
+ {
+ "code": "540100",
+ "city": "拉萨"
+ },
+ {
+ "code": "542600",
+ "city": "林芝地区"
+ },
+ {
+ "code": "620100",
+ "city": "兰州"
+ },
+ {
+ "code": "621200",
+ "city": "陇南"
+ },
+ {
+ "code": "622900",
+ "city": "临夏回族自治州"
+ },
+ {
+ "code": "820200",
+ "city": "离岛"
+ }
+ ],
+ "M": [
+ {
+ "code": "231000",
+ "city": "牡丹江"
+ },
+ {
+ "code": "340500",
+ "city": "马鞍山"
+ },
+ {
+ "code": "440900",
+ "city": "茂名"
+ },
+ {
+ "code": "441400",
+ "city": "梅州"
+ },
+ {
+ "code": "510700",
+ "city": "绵阳"
+ },
+ {
+ "code": "511400",
+ "city": "眉山"
+ }
+ ],
+ "N": [
+ {
+ "code": "320100",
+ "city": "南京"
+ },
+ {
+ "code": "320600",
+ "city": "南通"
+ },
+ {
+ "code": "330200",
+ "city": "宁波"
+ },
+ {
+ "code": "350700",
+ "city": "南平"
+ },
+ {
+ "code": "350900",
+ "city": "宁德"
+ },
+ {
+ "code": "360100",
+ "city": "南昌"
+ },
+ {
+ "code": "411300",
+ "city": "南阳"
+ },
+ {
+ "code": "450100",
+ "city": "南宁"
+ },
+ {
+ "code": "511000",
+ "city": "内江"
+ },
+ {
+ "code": "511300",
+ "city": "南充"
+ },
+ {
+ "code": "533300",
+ "city": "怒江傈僳族自治州"
+ },
+ {
+ "code": "542400",
+ "city": "那曲地区"
+ },
+ {
+ "code": "710600",
+ "city": "南投县"
+ }
+ ],
+ "P": [
+ {
+ "code": "211100",
+ "city": "盘锦"
+ },
+ {
+ "code": "350300",
+ "city": "莆田"
+ },
+ {
+ "code": "410900",
+ "city": "濮阳"
+ },
+ {
+ "code": "360300",
+ "city": "萍乡"
+ },
+ {
+ "code": "410400",
+ "city": "平顶山"
+ },
+ {
+ "code": "510400",
+ "city": "攀枝花"
+ },
+ {
+ "code": "530800",
+ "city": "普洱"
+ },
+ {
+ "code": "620800",
+ "city": "平凉"
+ }
+ ],
+ "Q": [
+ {
+ "code": "130300",
+ "city": "秦皇岛"
+ },
+ {
+ "code": "230200",
+ "city": "齐齐哈尔"
+ },
+ {
+ "code": "230900",
+ "city": "七台河"
+ },
+ {
+ "code": "350500",
+ "city": "泉州"
+ },
+ {
+ "code": "370200",
+ "city": "青岛"
+ },
+ {
+ "code": "441800",
+ "city": "清远"
+ },
+ {
+ "code": "450700",
+ "city": "钦州"
+ },
+ {
+ "code": "522300",
+ "city": "黔西南布依族苗族自治州"
+ },
+ {
+ "code": "522600",
+ "city": "黔东南苗族侗族自治州"
+ },
+ {
+ "code": "522700",
+ "city": "黔南布依族苗族自治州"
+ },
+ {
+ "code": "530300",
+ "city": "曲靖"
+ },
+ {
+ "code": "621000",
+ "city": "庆阳"
+ }
+ ],
+ "R": [
+ {
+ "code": "371100",
+ "city": "日照"
+ },
+ {
+ "code": "542300",
+ "city": "日喀则地区"
+ }
+ ],
+ "S": [
+ {
+ "code": "130100",
+ "city": "石家庄"
+ },
+ {
+ "code": "140600",
+ "city": "朔州"
+ },
+ {
+ "code": "210100",
+ "city": "沈阳"
+ },
+ {
+ "code": "220300",
+ "city": "四平"
+ },
+ {
+ "code": "220700",
+ "city": "松原"
+ },
+ {
+ "code": "230500",
+ "city": "双鸭山"
+ },
+ {
+ "code": "231200",
+ "city": "绥化"
+ },
+ {
+ "code": "310100",
+ "city": "上海"
+ },
+ {
+ "code": "320500",
+ "city": "苏州"
+ },
+ {
+ "code": "321300",
+ "city": "宿迁"
+ },
+ {
+ "code": "330600",
+ "city": "绍兴"
+ },
+ {
+ "code": "341300",
+ "city": "宿州"
+ },
+ {
+ "code": "350400",
+ "city": "三明"
+ },
+ {
+ "code": "361100",
+ "city": "上饶"
+ },
+ {
+ "code": "411200",
+ "city": "三门峡"
+ },
+ {
+ "code": "411400",
+ "city": "商丘"
+ },
+ {
+ "code": "420300",
+ "city": "十堰"
+ },
+ {
+ "code": "421300",
+ "city": "随州"
+ },
+ {
+ "code": "430500",
+ "city": "邵阳"
+ },
+ {
+ "code": "440200",
+ "city": "韶关"
+ },
+ {
+ "code": "440300",
+ "city": "深圳"
+ },
+ {
+ "code": "440500",
+ "city": "汕头"
+ },
+ {
+ "code": "441500",
+ "city": "汕尾"
+ },
+ {
+ "code": "460200",
+ "city": "三亚"
+ },
+ {
+ "code": "510900",
+ "city": "遂宁"
+ },
+ {
+ "code": "542200",
+ "city": "山南地区"
+ },
+ {
+ "code": "611000",
+ "city": "商洛"
+ },
+ {
+ "code": "640200",
+ "city": "石嘴山"
+ }
+ ],
+ "T": [
+ {
+ "code": "120100",
+ "city": "天津"
+ },
+ {
+ "code": "130200",
+ "city": "唐山"
+ },
+ {
+ "code": "140100",
+ "city": "太原"
+ },
+ {
+ "code": "150500",
+ "city": "通辽"
+ },
+ {
+ "code": "211200",
+ "city": "铁岭"
+ },
+ {
+ "code": "220500",
+ "city": "通化"
+ },
+ {
+ "code": "321200",
+ "city": "泰州"
+ },
+ {
+ "code": "331000",
+ "city": "台州"
+ },
+ {
+ "code": "340700",
+ "city": "铜陵"
+ },
+ {
+ "code": "370900",
+ "city": "泰安"
+ },
+ {
+ "code": "522200",
+ "city": "铜仁地区"
+ },
+ {
+ "code": "610200",
+ "city": "铜川"
+ },
+ {
+ "code": "620500",
+ "city": "天水"
+ },
+ {
+ "code": "652100",
+ "city": "吐鲁番地区"
+ },
+ {
+ "code": "654200",
+ "city": "塔城地区"
+ },
+ {
+ "code": "710100",
+ "city": "台北"
+ },
+ {
+ "code": "710300",
+ "city": "台南"
+ },
+ {
+ "code": "710400",
+ "city": "台中"
+ }
+ ],
+ "W": [
+ {
+ "code": "150300",
+ "city": "乌海"
+ },
+ {
+ "code": "150900",
+ "city": "乌兰察布"
+ },
+ {
+ "code": "320200",
+ "city": "无锡"
+ },
+ {
+ "code": "330300",
+ "city": "温州"
+ },
+ {
+ "code": "340200",
+ "city": "芜湖"
+ },
+ {
+ "code": "370700",
+ "city": "潍坊"
+ },
+ {
+ "code": "371000",
+ "city": "威海"
+ },
+ {
+ "code": "420100",
+ "city": "武汉"
+ },
+ {
+ "code": "450400",
+ "city": "梧州"
+ },
+ {
+ "code": "532600",
+ "city": "文山壮族苗族自治州"
+ },
+ {
+ "code": "610500",
+ "city": "渭南"
+ },
+ {
+ "code": "620600",
+ "city": "武威"
+ },
+ {
+ "code": "640300",
+ "city": "吴忠"
+ },
+ {
+ "code": "650100",
+ "city": "乌鲁木齐"
+ }
+ ],
+ "X": [
+ {
+ "code": "130500",
+ "city": "邢台"
+ },
+ {
+ "code": "140900",
+ "city": "忻州"
+ },
+ {
+ "code": "152200",
+ "city": "兴安盟"
+ },
+ {
+ "code": "152500",
+ "city": "锡林郭勒盟"
+ },
+ {
+ "code": "320300",
+ "city": "徐州"
+ },
+ {
+ "code": "341800",
+ "city": "宣城"
+ },
+ {
+ "code": "350200",
+ "city": "厦门"
+ },
+ {
+ "code": "360500",
+ "city": "新余"
+ },
+ {
+ "code": "410700",
+ "city": "新乡"
+ },
+ {
+ "code": "411000",
+ "city": "许昌"
+ },
+ {
+ "code": "411500",
+ "city": "信阳"
+ },
+ {
+ "code": "420600",
+ "city": "襄阳"
+ },
+ {
+ "code": "420900",
+ "city": "孝感"
+ },
+ {
+ "code": "421200",
+ "city": "咸宁"
+ },
+ {
+ "code": "430300",
+ "city": "湘潭"
+ },
+ {
+ "code": "433100",
+ "city": "湘西土家族苗族自治州"
+ },
+ {
+ "code": "532800",
+ "city": "西双版纳"
+ },
+ {
+ "code": "610100",
+ "city": "西安"
+ },
+ {
+ "code": "610400",
+ "city": "咸阳"
+ },
+ {
+ "code": "630100",
+ "city": "西宁"
+ },
+ {
+ "code": "710800",
+ "city": "新竹"
+ },
+ {
+ "code": "810100",
+ "city": "香港岛"
+ },
+ {
+ "code": "810300",
+ "city": "新界"
+ }
+ ],
+ "Y": [
+ {
+ "code": "140300",
+ "city": "阳泉"
+ },
+ {
+ "code": "140800",
+ "city": "运城"
+ },
+ {
+ "code": "210800",
+ "city": "营口"
+ },
+ {
+ "code": "222400",
+ "city": "延边朝鲜族自治州"
+ },
+ {
+ "code": "230700",
+ "city": "伊春"
+ },
+ {
+ "code": "320900",
+ "city": "盐城"
+ },
+ {
+ "code": "321000",
+ "city": "扬州"
+ },
+ {
+ "code": "360600",
+ "city": "鹰潭"
+ },
+ {
+ "code": "360900",
+ "city": "宜春"
+ },
+ {
+ "code": "370600",
+ "city": "烟台"
+ },
+ {
+ "code": "420500",
+ "city": "宜昌"
+ },
+ {
+ "code": "430600",
+ "city": "岳阳"
+ },
+ {
+ "code": "430900",
+ "city": "益阳"
+ },
+ {
+ "code": "431100",
+ "city": "永州"
+ },
+ {
+ "code": "441700",
+ "city": "阳江"
+ },
+ {
+ "code": "445300",
+ "city": "云浮"
+ },
+ {
+ "code": "450900",
+ "city": "玉林"
+ },
+ {
+ "code": "511500",
+ "city": "宜宾"
+ },
+ {
+ "code": "511800",
+ "city": "雅安"
+ },
+ {
+ "code": "530400",
+ "city": "玉溪"
+ },
+ {
+ "code": "610600",
+ "city": "延安"
+ },
+ {
+ "code": "610800",
+ "city": "榆林"
+ },
+ {
+ "code": "632700",
+ "city": "玉树藏族自治州"
+ },
+ {
+ "code": "640100",
+ "city": "银川"
+ },
+ {
+ "code": "654000",
+ "city": "伊犁哈萨克自治州"
+ }
+ ],
+ "Z": [
+ {
+ "code": "130700",
+ "city": "张家口"
+ },
+ {
+ "code": "321100",
+ "city": "镇江"
+ },
+ {
+ "code": "330800",
+ "city": "衢州"
+ },
+ {
+ "code": "330900",
+ "city": "舟山"
+ },
+ {
+ "code": "341600",
+ "city": "亳州"
+ },
+ {
+ "code": "350600",
+ "city": "漳州"
+ },
+ {
+ "code": "370300",
+ "city": "淄博"
+ },
+ {
+ "code": "370400",
+ "city": "枣庄"
+ },
+ {
+ "code": "410100",
+ "city": "郑州"
+ },
+ {
+ "code": "411600",
+ "city": "周口"
+ },
+ {
+ "code": "411700",
+ "city": "驻马店"
+ },
+ {
+ "code": "430200",
+ "city": "株洲"
+ },
+ {
+ "code": "430800",
+ "city": "张家界"
+ },
+ {
+ "code": "440400",
+ "city": "珠海"
+ },
+ {
+ "code": "440800",
+ "city": "湛江"
+ },
+ {
+ "code": "441200",
+ "city": "肇庆"
+ },
+ {
+ "code": "442000",
+ "city": "中山"
+ },
+ {
+ "code": "510300",
+ "city": "自贡"
+ },
+ {
+ "code": "512000",
+ "city": "资阳"
+ },
+ {
+ "code": "520300",
+ "city": "遵义"
+ },
+ {
+ "code": "530600",
+ "city": "昭通"
+ },
+ {
+ "code": "620700",
+ "city": "张掖"
+ },
+ {
+ "code": "640500",
+ "city": "中卫"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/data/menu.js b/data/menu.js
index e67127a..4226ff1 100644
--- a/data/menu.js
+++ b/data/menu.js
@@ -1,47 +1,47 @@
export const mineMenu = [{
id: 1,
name: '我的消息',
- url: '/pages/message/message'
+ url: '/pages/driver/message/message'
}, {
id: 2,
name: '我的订单',
- url: '/pages/mine/my_order/my_order'
+ url: '/pages/driver/mine/my_order/my_order'
}, {
id: 3,
name: '我的活动',
- url: '/pages/mine/my_activity/my_activity'
+ url: '/pages/driver/mine/my_activity/my_activity'
}, {
id: 4,
name: '天天打卡',
- url: '/pages/welfare/task/task'
+ url: '/pages/driver/welfare/task/task'
}, {
id: 5,
name: '我的钱包',
- url: '/pages/mine/wallet/wallet'
+ url: '/pages/driver/mine/wallet/wallet'
}, {
id: 6,
name: '我的收藏',
- url: '/pages/mine/my_favorite/my_favorite'
+ url: '/pages/driver/mine/my_favorite/my_favorite'
}, {
id: 7,
name: '邀请有礼',
- url: '/pages/welfare/invite/invite'
+ url: '/pages/driver/welfare/invite/invite'
}, {
id: 8,
name: '绑定微信',
- url: '/pages/mine/binding_wx/binding_wx'
+ url: '/pages/driver/mine/binding_wx/binding_wx'
}, {
id: 9,
name: '我的认证',
- url: '/pages/mine/my_authentication/my_authentication'
+ url: '/pages/driver/mine/my_authentication/my_authentication'
}, {
id: 10,
name: '车辆信息',
- url: '/pages/mine/car_info/car_info'
+ url: '/pages/driver/mine/car_info/car_info'
}, {
id: 11,
name: '我的卡包',
- url: '/pages/mine/my_card_bag/my_card_bag'
+ url: '/pages/driver/mine/my_card_bag/my_card_bag'
}, {
id: 12,
name: '商务合作',
@@ -49,9 +49,9 @@ export const mineMenu = [{
}, {
id: 13,
name: '常见问题',
- url: '/pages/mine/common_problem/common_problem'
+ url: '/pages/driver/mine/common_problem/common_problem'
}, {
id: 14,
name: '关于我们',
- url: '/pages/mine/about_us/about_us'
+ url: '/pages/driver/mine/about_us/about_us'
}, ]
\ No newline at end of file
diff --git a/data/tabsData2.js b/data/tabsData2.js
new file mode 100644
index 0000000..122b371
--- /dev/null
+++ b/data/tabsData2.js
@@ -0,0 +1,146 @@
+export const tabsList1 = [{
+ name: '租车',
+ value: 1
+}, {
+ name: '买车',
+ value: 2
+}, {
+ name: '动态',
+ value: 3
+}, {
+ name: '问答',
+ value: 4
+}, {
+ name: '咨询',
+ value: 5
+}, {
+ name: '积分',
+ value: 6
+}, {
+ name: '卡券',
+ value: 7
+}]
+
+export const tabsList2 = [{
+ name: '全部',
+ value: -1
+}, {
+ name: '助力中',
+ value: 0
+}, {
+ name: '助理成功',
+ value: 1
+}, {
+ name: '助力失败',
+ value: 2
+}]
+export const tabsList3 = [{
+ name: '全部',
+ value: 1
+}, {
+ name: '未提车',
+ value: 2
+}, {
+ name: '已完成',
+ value: 3
+}, {
+ name: '已退款',
+ value: 4
+}]
+export const tabsList4 = [{
+ name: '全部',
+ value: 1
+}, {
+ name: '未提车',
+ value: 2
+}, {
+ name: '租赁期',
+ value: 3
+}, {
+ name: '已完成',
+ value: 4
+}, {
+ name: '评价',
+ value: 5
+}, {
+ name: '已退款',
+ value: 6
+}]
+export const tabsList5 = [{
+ name: '工单订单',
+ value: 1
+}, {
+ name: '积分订单',
+ value: 2
+}, {
+ name: '卡券订单',
+ value: 3
+}]
+export const tabsList6 = [{
+ name: '全部',
+ value: -1
+}, {
+ name: '代付款',
+ value: 0
+}, {
+ name: '待使用',
+ value: 1
+}, {
+ name: '已完成',
+ value: 2
+}]
+
+export const tabsList7 = [{
+ name: '全部',
+ value: 1,
+ type: 'all'
+}, {
+ name: '待受理',
+ value: 2,
+ type: 'ucheck'
+}, {
+ name: '已确认',
+ value: 3,
+ type: 'notArrive'
+}, {
+ name: '已完成',
+ value: 4,
+ type: 'finish'
+}, {
+ name: '已驳回',
+ value: 5,
+ type: 'reject'
+}]
+
+export const indexTabList = [{
+ name: '广场',
+ value: 1,
+ type: 'true'
+}, {
+ name: '关注',
+ value: 3,
+ type: 'true'
+}, {
+ name: '转租',
+ value: 2,
+ type: 'true'
+}, {
+ name: '此地',
+ value: 4,
+ type: 'true'
+}, {
+ name: '咨询',
+ value: 5,
+ type: 'true'
+
+}]
+export const tabsList8 = [{
+ name: '全部卡券',
+ value: 1
+}, {
+ name: '限时优惠',
+ value: 2
+}, {
+ name: '助力抢券',
+ value: 3
+}]
\ No newline at end of file
diff --git a/js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.js b/js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.js
new file mode 100644
index 0000000..595b65b
--- /dev/null
+++ b/js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.js
@@ -0,0 +1,1122 @@
+/**
+ * 微信小程序JavaScriptSDK
+ *
+ * @version 1.2
+ * @date 2019-03-06
+ */
+
+var ERROR_CONF = {
+ KEY_ERR: 311,
+ KEY_ERR_MSG: 'key格式错误',
+ PARAM_ERR: 310,
+ PARAM_ERR_MSG: '请求参数信息有误',
+ SYSTEM_ERR: 600,
+ SYSTEM_ERR_MSG: '系统错误',
+ WX_ERR_CODE: 1000,
+ WX_OK_CODE: 200
+};
+var BASE_URL = 'https://apis.map.qq.com/ws/';
+var URL_SEARCH = BASE_URL + 'place/v1/search';
+var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
+var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
+var URL_CITY_LIST = BASE_URL + 'district/v1/list';
+var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
+var URL_DISTANCE = BASE_URL + 'distance/v1/';
+var URL_DIRECTION = BASE_URL + 'direction/v1/';
+var MODE = {
+ driving: 'driving',
+ transit: 'transit'
+};
+var EARTH_RADIUS = 6378136.49;
+var Utils = {
+ /**
+ * md5加密方法
+ * 版权所有©2011 Sebastian Tschan,https://blueimp.net
+ */
+ safeAdd(x, y) {
+ var lsw = (x & 0xffff) + (y & 0xffff);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xffff);
+ },
+ bitRotateLeft(num, cnt) {
+ return (num << cnt) | (num >>> (32 - cnt));
+ },
+ md5cmn(q, a, b, x, s, t) {
+ return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b);
+ },
+ md5ff(a, b, c, d, x, s, t) {
+ return this.md5cmn((b & c) | (~b & d), a, b, x, s, t);
+ },
+ md5gg(a, b, c, d, x, s, t) {
+ return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t);
+ },
+ md5hh(a, b, c, d, x, s, t) {
+ return this.md5cmn(b ^ c ^ d, a, b, x, s, t);
+ },
+ md5ii(a, b, c, d, x, s, t) {
+ return this.md5cmn(c ^ (b | ~d), a, b, x, s, t);
+ },
+ binlMD5(x, len) {
+ /* append padding */
+ x[len >> 5] |= 0x80 << (len % 32);
+ x[((len + 64) >>> 9 << 4) + 14] = len;
+
+ var i;
+ var olda;
+ var oldb;
+ var oldc;
+ var oldd;
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for (i = 0; i < x.length; i += 16) {
+ olda = a;
+ oldb = b;
+ oldc = c;
+ oldd = d;
+
+ a = this.md5ff(a, b, c, d, x[i], 7, -680876936);
+ d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586);
+ c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819);
+ b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
+ a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897);
+ d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
+ c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
+ b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983);
+ a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
+ d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
+ c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063);
+ b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
+ a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
+ d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101);
+ c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
+ b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
+
+ a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510);
+ d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
+ c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713);
+ b = this.md5gg(b, c, d, a, x[i], 20, -373897302);
+ a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691);
+ d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083);
+ c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335);
+ b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848);
+ a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438);
+ d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
+ c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961);
+ b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
+ a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
+ d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784);
+ c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
+ b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
+
+ a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558);
+ d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
+ c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
+ b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556);
+ a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
+ d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
+ c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632);
+ b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
+ a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174);
+ d = this.md5hh(d, a, b, c, x[i], 11, -358537222);
+ c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979);
+ b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189);
+ a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487);
+ d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835);
+ c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520);
+ b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651);
+
+ a = this.md5ii(a, b, c, d, x[i], 6, -198630844);
+ d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
+ c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
+ b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055);
+ a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
+ d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
+ c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523);
+ b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
+ a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
+ d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744);
+ c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
+ b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
+ a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070);
+ d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
+ c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259);
+ b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551);
+
+ a = this.safeAdd(a, olda);
+ b = this.safeAdd(b, oldb);
+ c = this.safeAdd(c, oldc);
+ d = this.safeAdd(d, oldd);
+ }
+ return [a, b, c, d];
+ },
+ binl2rstr(input) {
+ var i;
+ var output = '';
+ var length32 = input.length * 32;
+ for (i = 0; i < length32; i += 8) {
+ output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff);
+ }
+ return output;
+ },
+ rstr2binl(input) {
+ var i;
+ var output = [];
+ output[(input.length >> 2) - 1] = undefined;
+ for (i = 0; i < output.length; i += 1) {
+ output[i] = 0;
+ }
+ var length8 = input.length * 8;
+ for (i = 0; i < length8; i += 8) {
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32);
+ }
+ return output;
+ },
+ rstrMD5(s) {
+ return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8));
+ },
+ rstrHMACMD5(key, data) {
+ var i;
+ var bkey = this.rstr2binl(key);
+ var ipad = [];
+ var opad = [];
+ var hash;
+ ipad[15] = opad[15] = undefined;
+ if (bkey.length > 16) {
+ bkey = this.binlMD5(bkey, key.length * 8);
+ }
+ for (i = 0; i < 16; i += 1) {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5c5c5c5c;
+ }
+ hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8);
+ return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128));
+ },
+ rstr2hex(input) {
+ var hexTab = '0123456789abcdef';
+ var output = '';
+ var x;
+ var i;
+ for (i = 0; i < input.length; i += 1) {
+ x = input.charCodeAt(i);
+ output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f);
+ }
+ return output;
+ },
+ str2rstrUTF8(input) {
+ return unescape(encodeURIComponent(input));
+ },
+ rawMD5(s) {
+ return this.rstrMD5(this.str2rstrUTF8(s));
+ },
+ hexMD5(s) {
+ return this.rstr2hex(this.rawMD5(s));
+ },
+ rawHMACMD5(k, d) {
+ return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d));
+ },
+ hexHMACMD5(k, d) {
+ return this.rstr2hex(this.rawHMACMD5(k, d));
+ },
+
+ md5(string, key, raw) {
+ if (!key) {
+ if (!raw) {
+ return this.hexMD5(string);
+ }
+ return this.rawMD5(string);
+ }
+ if (!raw) {
+ return this.hexHMACMD5(key, string);
+ }
+ return this.rawHMACMD5(key, string);
+ },
+ /**
+ * 得到md5加密后的sig参数
+ * @param {Object} requestParam 接口参数
+ * @param {String} sk签名字符串
+ * @param {String} featrue 方法名
+ * @return 返回加密后的sig参数
+ */
+ getSig(requestParam, sk, feature, mode) {
+ var sig = null;
+ var requestArr = [];
+ Object.keys(requestParam).sort().forEach(function(key){
+ requestArr.push(key + '=' + requestParam[key]);
+ });
+ if (feature == 'search') {
+ sig = '/ws/place/v1/search?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'suggest') {
+ sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'reverseGeocoder') {
+ sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'geocoder') {
+ sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'getCityList') {
+ sig = '/ws/district/v1/list?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'getDistrictByCityId') {
+ sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'calculateDistance') {
+ sig = '/ws/distance/v1/?' + requestArr.join('&') + sk;
+ }
+ if (feature == 'direction') {
+ sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk;
+ }
+ sig = this.md5(sig);
+ return sig;
+ },
+ /**
+ * 得到终点query字符串
+ * @param {Array|String} 检索数据
+ */
+ location2query(data) {
+ if (typeof data == 'string') {
+ return data;
+ }
+ var query = '';
+ for (var i = 0; i < data.length; i++) {
+ var d = data[i];
+ if (!!query) {
+ query += ';';
+ }
+ if (d.location) {
+ query = query + d.location.lat + ',' + d.location.lng;
+ }
+ if (d.latitude && d.longitude) {
+ query = query + d.latitude + ',' + d.longitude;
+ }
+ }
+ return query;
+ },
+
+ /**
+ * 计算角度
+ */
+ rad(d) {
+ return d * Math.PI / 180.0;
+ },
+ /**
+ * 处理终点location数组
+ * @return 返回终点数组
+ */
+ getEndLocation(location){
+ var to = location.split(';');
+ var endLocation = [];
+ for (var i = 0; i < to.length; i++) {
+ endLocation.push({
+ lat: parseFloat(to[i].split(',')[0]),
+ lng: parseFloat(to[i].split(',')[1])
+ })
+ }
+ return endLocation;
+ },
+
+ /**
+ * 计算两点间直线距离
+ * @param a 表示纬度差
+ * @param b 表示经度差
+ * @return 返回的是距离,单位m
+ */
+ getDistance(latFrom, lngFrom, latTo, lngTo) {
+ var radLatFrom = this.rad(latFrom);
+ var radLatTo = this.rad(latTo);
+ var a = radLatFrom - radLatTo;
+ var b = this.rad(lngFrom) - this.rad(lngTo);
+ var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2)));
+ distance = distance * EARTH_RADIUS;
+ distance = Math.round(distance * 10000) / 10000;
+ return parseFloat(distance.toFixed(0));
+ },
+ /**
+ * 使用微信接口进行定位
+ */
+ getWXLocation(success, fail, complete) {
+ wx.getLocation({
+ type: 'gcj02',
+ success: success,
+ fail: fail,
+ complete: complete
+ });
+ },
+
+ /**
+ * 获取location参数
+ */
+ getLocationParam(location) {
+ if (typeof location == 'string') {
+ var locationArr = location.split(',');
+ if (locationArr.length === 2) {
+ location = {
+ latitude: location.split(',')[0],
+ longitude: location.split(',')[1]
+ };
+ } else {
+ location = {};
+ }
+ }
+ return location;
+ },
+
+ /**
+ * 回调函数默认处理
+ */
+ polyfillParam(param) {
+ param.success = param.success || function () { };
+ param.fail = param.fail || function () { };
+ param.complete = param.complete || function () { };
+ },
+
+ /**
+ * 验证param对应的key值是否为空
+ *
+ * @param {Object} param 接口参数
+ * @param {String} key 对应参数的key
+ */
+ checkParamKeyEmpty(param, key) {
+ if (!param[key]) {
+ var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
+ param.fail(errconf);
+ param.complete(errconf);
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * 验证参数中是否存在检索词keyword
+ *
+ * @param {Object} param 接口参数
+ */
+ checkKeyword(param){
+ return !this.checkParamKeyEmpty(param, 'keyword');
+ },
+
+ /**
+ * 验证location值
+ *
+ * @param {Object} param 接口参数
+ */
+ checkLocation(param) {
+ var location = this.getLocationParam(param.location);
+ if (!location || !location.latitude || !location.longitude) {
+ var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
+ param.fail(errconf);
+ param.complete(errconf);
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * 构造错误数据结构
+ * @param {Number} errCode 错误码
+ * @param {Number} errMsg 错误描述
+ */
+ buildErrorConfig(errCode, errMsg) {
+ return {
+ status: errCode,
+ message: errMsg
+ };
+ },
+
+ /**
+ *
+ * 数据处理函数
+ * 根据传入参数不同处理不同数据
+ * @param {String} feature 功能名称
+ * search 地点搜索
+ * suggest关键词提示
+ * reverseGeocoder逆地址解析
+ * geocoder地址解析
+ * getCityList获取城市列表:父集
+ * getDistrictByCityId获取区县列表:子集
+ * calculateDistance距离计算
+ * @param {Object} param 接口参数
+ * @param {Object} data 数据
+ */
+ handleData(param,data,feature){
+ if (feature == 'search') {
+ var searchResult = data.data;
+ var searchSimplify = [];
+ for (var i = 0; i < searchResult.length; i++) {
+ searchSimplify.push({
+ id: searchResult[i].id || null,
+ title: searchResult[i].title || null,
+ latitude: searchResult[i].location && searchResult[i].location.lat || null,
+ longitude: searchResult[i].location && searchResult[i].location.lng || null,
+ address: searchResult[i].address || null,
+ category: searchResult[i].category || null,
+ tel: searchResult[i].tel || null,
+ adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
+ city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
+ district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
+ province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
+ })
+ }
+ param.success(data, {
+ searchResult: searchResult,
+ searchSimplify: searchSimplify
+ })
+ } else if (feature == 'suggest') {
+ var suggestResult = data.data;
+ var suggestSimplify = [];
+ for (var i = 0; i < suggestResult.length; i++) {
+ suggestSimplify.push({
+ adcode: suggestResult[i].adcode || null,
+ address: suggestResult[i].address || null,
+ category: suggestResult[i].category || null,
+ city: suggestResult[i].city || null,
+ district: suggestResult[i].district || null,
+ id: suggestResult[i].id || null,
+ latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
+ longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
+ province: suggestResult[i].province || null,
+ title: suggestResult[i].title || null,
+ type: suggestResult[i].type || null
+ })
+ }
+ param.success(data, {
+ suggestResult: suggestResult,
+ suggestSimplify: suggestSimplify
+ })
+ } else if (feature == 'reverseGeocoder') {
+ var reverseGeocoderResult = data.result;
+ var reverseGeocoderSimplify = {
+ address: reverseGeocoderResult.address || null,
+ latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
+ longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
+ adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
+ city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null,
+ district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null,
+ nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null,
+ province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null,
+ street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null,
+ street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null,
+ recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null,
+ rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null
+ };
+ if (reverseGeocoderResult.pois) {//判断是否返回周边poi
+ var pois = reverseGeocoderResult.pois;
+ var poisSimplify = [];
+ for (var i = 0;i < pois.length;i++) {
+ poisSimplify.push({
+ id: pois[i].id || null,
+ title: pois[i].title || null,
+ latitude: pois[i].location && pois[i].location.lat || null,
+ longitude: pois[i].location && pois[i].location.lng || null,
+ address: pois[i].address || null,
+ category: pois[i].category || null,
+ adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
+ city: pois[i].ad_info && pois[i].ad_info.city || null,
+ district: pois[i].ad_info && pois[i].ad_info.district || null,
+ province: pois[i].ad_info && pois[i].ad_info.province || null
+ })
+ }
+ param.success(data,{
+ reverseGeocoderResult: reverseGeocoderResult,
+ reverseGeocoderSimplify: reverseGeocoderSimplify,
+ pois: pois,
+ poisSimplify: poisSimplify
+ })
+ } else {
+ param.success(data, {
+ reverseGeocoderResult: reverseGeocoderResult,
+ reverseGeocoderSimplify: reverseGeocoderSimplify
+ })
+ }
+ } else if (feature == 'geocoder') {
+ var geocoderResult = data.result;
+ var geocoderSimplify = {
+ title: geocoderResult.title || null,
+ latitude: geocoderResult.location && geocoderResult.location.lat || null,
+ longitude: geocoderResult.location && geocoderResult.location.lng || null,
+ adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
+ province: geocoderResult.address_components && geocoderResult.address_components.province || null,
+ city: geocoderResult.address_components && geocoderResult.address_components.city || null,
+ district: geocoderResult.address_components && geocoderResult.address_components.district || null,
+ street: geocoderResult.address_components && geocoderResult.address_components.street || null,
+ street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null,
+ level: geocoderResult.level || null
+ };
+ param.success(data,{
+ geocoderResult: geocoderResult,
+ geocoderSimplify: geocoderSimplify
+ });
+ } else if (feature == 'getCityList') {
+ var provinceResult = data.result[0];
+ var cityResult = data.result[1];
+ var districtResult = data.result[2];
+ param.success(data,{
+ provinceResult: provinceResult,
+ cityResult: cityResult,
+ districtResult: districtResult
+ });
+ } else if (feature == 'getDistrictByCityId') {
+ var districtByCity = data.result[0];
+ param.success(data, districtByCity);
+ } else if (feature == 'calculateDistance') {
+ var calculateDistanceResult = data.result.elements;
+ var distance = [];
+ for (var i = 0; i < calculateDistanceResult.length; i++){
+ distance.push(calculateDistanceResult[i].distance);
+ }
+ param.success(data, {
+ calculateDistanceResult: calculateDistanceResult,
+ distance: distance
+ });
+ } else if (feature == 'direction') {
+ var direction = data.result.routes;
+ param.success(data,direction);
+ } else {
+ param.success(data);
+ }
+ },
+
+ /**
+ * 构造微信请求参数,公共属性处理
+ *
+ * @param {Object} param 接口参数
+ * @param {Object} param 配置项
+ * @param {String} feature 方法名
+ */
+ buildWxRequestConfig(param, options, feature) {
+ var that = this;
+ options.header = { "content-type": "application/json" };
+ options.method = 'GET';
+ options.success = function (res) {
+ var data = res.data;
+ if (data.status === 0) {
+ that.handleData(param, data, feature);
+ } else {
+ param.fail(data);
+ }
+ };
+ options.fail = function (res) {
+ res.statusCode = ERROR_CONF.WX_ERR_CODE;
+ param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ };
+ options.complete = function (res) {
+ var statusCode = +res.statusCode;
+ switch(statusCode) {
+ case ERROR_CONF.WX_ERR_CODE: {
+ param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ break;
+ }
+ case ERROR_CONF.WX_OK_CODE: {
+ var data = res.data;
+ if (data.status === 0) {
+ param.complete(data);
+ } else {
+ param.complete(that.buildErrorConfig(data.status, data.message));
+ }
+ break;
+ }
+ default:{
+ param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
+ }
+
+ }
+ };
+ return options;
+ },
+
+ /**
+ * 处理用户参数是否传入坐标进行不同的处理
+ */
+ locationProcess(param, locationsuccess, locationfail, locationcomplete) {
+ var that = this;
+ locationfail = locationfail || function (res) {
+ res.statusCode = ERROR_CONF.WX_ERR_CODE;
+ param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ };
+ locationcomplete = locationcomplete || function (res) {
+ if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
+ param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+ }
+ };
+ if (!param.location) {
+ that.getWXLocation(locationsuccess, locationfail, locationcomplete);
+ } else if (that.checkLocation(param)) {
+ var location = Utils.getLocationParam(param.location);
+ locationsuccess(location);
+ }
+ }
+};
+
+
+class QQMapWX {
+
+ /**
+ * 构造函数
+ *
+ * @param {Object} options 接口参数,key 为必选参数
+ */
+ constructor(options) {
+ if (!options.key) {
+ throw Error('key值不能为空');
+ }
+ this.key = options.key;
+ };
+
+ /**
+ * POI周边检索
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 参数对象结构可以参考
+ * @see http://lbs.qq.com/webservice_v1/guide-search.html
+ */
+ search(options) {
+ var that = this;
+ options = options || {};
+
+ Utils.polyfillParam(options);
+
+ if (!Utils.checkKeyword(options)) {
+ return;
+ }
+
+ var requestParam = {
+ keyword: options.keyword,
+ orderby: options.orderby || '_distance',
+ page_size: options.page_size || 10,
+ page_index: options.page_index || 1,
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.address_format) {
+ requestParam.address_format = options.address_format;
+ }
+
+ if (options.filter) {
+ requestParam.filter = options.filter;
+ }
+
+ var distance = options.distance || "1000";
+ var auto_extend = options.auto_extend || 1;
+ var region = null;
+ var rectangle = null;
+
+ //判断城市限定参数
+ if (options.region) {
+ region = options.region;
+ }
+
+ //矩形限定坐标(暂时只支持字符串格式)
+ if (options.rectangle) {
+ rectangle = options.rectangle;
+ }
+
+ var locationsuccess = function (result) {
+ if (region && !rectangle) {
+ //城市限定参数拼接
+ requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ } else if (rectangle && !region) {
+ //矩形搜索
+ requestParam.boundary = "rectangle(" + rectangle + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ } else {
+ requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")";
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
+ }
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SEARCH,
+ data: requestParam
+ }, 'search'));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ };
+
+ /**
+ * sug模糊检索
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 参数对象结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-suggestion.html
+ */
+ getSuggestion(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (!Utils.checkKeyword(options)) {
+ return;
+ }
+
+ var requestParam = {
+ keyword: options.keyword,
+ region: options.region || '全国',
+ region_fix: options.region_fix || 0,
+ policy: options.policy || 0,
+ page_size: options.page_size || 10,//控制显示条数
+ page_index: options.page_index || 1,//控制页数
+ get_subpois : options.get_subpois || 0,//返回子地点
+ output: 'json',
+ key: that.key
+ };
+ //长地址
+ if (options.address_format) {
+ requestParam.address_format = options.address_format;
+ }
+ //过滤
+ if (options.filter) {
+ requestParam.filter = options.filter;
+ }
+ //排序
+ if (options.location) {
+ var locationsuccess = function (result) {
+ requestParam.location = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SUGGESTION,
+ data: requestParam
+ }, "suggest"));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ } else {
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_SUGGESTION,
+ data: requestParam
+ }, "suggest"));
+ }
+ };
+
+ /**
+ * 逆地址解析
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-gcoder.html
+ */
+ reverseGeocoder(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+ var requestParam = {
+ coord_type: options.coord_type || 5,
+ get_poi: options.get_poi || 0,
+ output: 'json',
+ key: that.key
+ };
+ if (options.poi_options) {
+ requestParam.poi_options = options.poi_options
+ }
+
+ var locationsuccess = function (result) {
+ requestParam.location = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_GET_GEOCODER,
+ data: requestParam
+ }, 'reverseGeocoder'));
+ };
+ Utils.locationProcess(options, locationsuccess);
+ };
+
+ /**
+ * 地址解析
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-geocoder.html
+ */
+ geocoder(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'address')) {
+ return;
+ }
+
+ var requestParam = {
+ address: options.address,
+ output: 'json',
+ key: that.key
+ };
+
+ //城市限定
+ if (options.region) {
+ requestParam.region = options.region;
+ }
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_GET_GEOCODER,
+ data: requestParam
+ },'geocoder'));
+ };
+
+
+ /**
+ * 获取城市列表
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-region.html
+ */
+ getCityList(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+ var requestParam = {
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_CITY_LIST,
+ data: requestParam
+ },'getCityList'));
+ };
+
+ /**
+ * 获取对应城市ID的区县列表
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-region.html
+ */
+ getDistrictByCityId(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'id')) {
+ return;
+ }
+
+ var requestParam = {
+ id: options.id || '',
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId');
+ }
+
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_AREA_LIST,
+ data: requestParam
+ },'getDistrictByCityId'));
+ };
+
+ /**
+ * 用于单起点到多终点的路线距离(非直线距离)计算:
+ * 支持两种距离计算方式:步行和驾车。
+ * 起点到终点最大限制直线距离10公里。
+ *
+ * 新增直线距离计算。
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * http://lbs.qq.com/webservice_v1/guide-distance.html
+ */
+ calculateDistance(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'to')) {
+ return;
+ }
+
+ var requestParam = {
+ mode: options.mode || 'walking',
+ to: Utils.location2query(options.to),
+ output: 'json',
+ key: that.key
+ };
+
+ if (options.from) {
+ options.location = options.from;
+ }
+
+ //计算直线距离
+ if(requestParam.mode == 'straight'){
+ var locationsuccess = function (result) {
+ var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标
+ var data = {
+ message:"query ok",
+ result:{
+ elements:[]
+ },
+ status:0
+ };
+ for (var i = 0; i < locationTo.length; i++) {
+ data.result.elements.push({//将坐标存入
+ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng),
+ duration:0,
+ from:{
+ lat: result.latitude,
+ lng:result.longitude
+ },
+ to:{
+ lat: locationTo[i].lat,
+ lng: locationTo[i].lng
+ }
+ });
+ }
+ var calculateResult = data.result.elements;
+ var distanceResult = [];
+ for (var i = 0; i < calculateResult.length; i++) {
+ distanceResult.push(calculateResult[i].distance);
+ }
+ return options.success(data,{
+ calculateResult: calculateResult,
+ distanceResult: distanceResult
+ });
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ } else {
+ var locationsuccess = function (result) {
+ requestParam.from = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance');
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: URL_DISTANCE,
+ data: requestParam
+ },'calculateDistance'));
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ }
+ };
+
+ /**
+ * 路线规划:
+ *
+ * @param {Object} options 接口参数对象
+ *
+ * 请求参数结构可以参考
+ * https://lbs.qq.com/webservice_v1/guide-road.html
+ */
+ direction(options) {
+ var that = this;
+ options = options || {};
+ Utils.polyfillParam(options);
+
+ if (Utils.checkParamKeyEmpty(options, 'to')) {
+ return;
+ }
+
+ var requestParam = {
+ output: 'json',
+ key: that.key
+ };
+
+ //to格式处理
+ if (typeof options.to == 'string') {
+ requestParam.to = options.to;
+ } else {
+ requestParam.to = options.to.latitude + ',' + options.to.longitude;
+ }
+ //初始化局部请求域名
+ var SET_URL_DIRECTION = null;
+ //设置默认mode属性
+ options.mode = options.mode || MODE.driving;
+
+ //设置请求域名
+ SET_URL_DIRECTION = URL_DIRECTION + options.mode;
+
+ if (options.from) {
+ options.location = options.from;
+ }
+
+ if (options.mode == MODE.driving) {
+ if (options.from_poi) {
+ requestParam.from_poi = options.from_poi;
+ }
+ if (options.heading) {
+ requestParam.heading = options.heading;
+ }
+ if (options.speed) {
+ requestParam.speed = options.speed;
+ }
+ if (options.accuracy) {
+ requestParam.accuracy = options.accuracy;
+ }
+ if (options.road_type) {
+ requestParam.road_type = options.road_type;
+ }
+ if (options.to_poi) {
+ requestParam.to_poi = options.to_poi;
+ }
+ if (options.from_track) {
+ requestParam.from_track = options.from_track;
+ }
+ if (options.waypoints) {
+ requestParam.waypoints = options.waypoints;
+ }
+ if (options.policy) {
+ requestParam.policy = options.policy;
+ }
+ if (options.plate_number) {
+ requestParam.plate_number = options.plate_number;
+ }
+ }
+
+ if (options.mode == MODE.transit) {
+ if (options.departure_time) {
+ requestParam.departure_time = options.departure_time;
+ }
+ if (options.policy) {
+ requestParam.policy = options.policy;
+ }
+ }
+
+ var locationsuccess = function (result) {
+ requestParam.from = result.latitude + ',' + result.longitude;
+ if (options.sig) {
+ requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction',options.mode);
+ }
+ wx.request(Utils.buildWxRequestConfig(options, {
+ url: SET_URL_DIRECTION,
+ data: requestParam
+ }, 'direction'));
+ };
+
+ Utils.locationProcess(options, locationsuccess);
+ }
+};
+
+module.exports = QQMapWX;
\ No newline at end of file
diff --git a/js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.min.js b/js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.min.js
new file mode 100644
index 0000000..8fa1477
--- /dev/null
+++ b/js_sdk/qqmap-wx-jssdk/qqmap-wx-jssdk.min.js
@@ -0,0 +1 @@
+var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: 'key格式错误', PARAM_ERR: 310, PARAM_ERR_MSG: '请求参数信息有误', SYSTEM_ERR: 600, SYSTEM_ERR_MSG: '系统错误', WX_ERR_CODE: 1000, WX_OK_CODE: 200 }; var BASE_URL = 'https://apis.map.qq.com/ws/'; var URL_SEARCH = BASE_URL + 'place/v1/search'; var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; var URL_CITY_LIST = BASE_URL + 'district/v1/list'; var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; var URL_DISTANCE = BASE_URL + 'distance/v1/'; var URL_DIRECTION = BASE_URL + 'direction/v1/'; var MODE = { driving: 'driving', transit: 'transit' }; var EARTH_RADIUS = 6378136.49; var Utils = { safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff) }, bitRotateLeft(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }, md5cmn(q, a, b, x, s, t) { return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b) }, md5ff(a, b, c, d, x, s, t) { return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) }, md5gg(a, b, c, d, x, s, t) { return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) }, md5hh(a, b, c, d, x, s, t) { return this.md5cmn(b ^ c ^ d, a, b, x, s, t) }, md5ii(a, b, c, d, x, s, t) { return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) }, binlMD5(x, len) { x[len >> 5] |= 0x80 << (len % 32); x[((len + 64) >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda = a; oldb = b; oldc = c; oldd = d; a = this.md5ff(a, b, c, d, x[i], 7, -680876936); d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); b = this.md5gg(b, c, d, a, x[i], 20, -373897302); a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); d = this.md5hh(d, a, b, c, x[i], 11, -358537222); c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); a = this.md5ii(a, b, c, d, x[i], 6, -198630844); d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); a = this.safeAdd(a, olda); b = this.safeAdd(b, oldb); c = this.safeAdd(c, oldc); d = this.safeAdd(d, oldd) } return [a, b, c, d] }, binl2rstr(input) { var i; var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff) } return output }, rstr2binl(input) { var i; var output = []; output[(input.length >> 2) - 1] = undefined; for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32) } return output }, rstrMD5(s) { return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) }, rstrHMACMD5(key, data) { var i; var bkey = this.rstr2binl(key); var ipad = []; var opad = []; var hash; ipad[15] = opad[15] = undefined; if (bkey.length > 16) { bkey = this.binlMD5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c } hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) }, rstr2hex(input) { var hexTab = '0123456789abcdef'; var output = ''; var x; var i; for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i); output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) } return output }, str2rstrUTF8(input) { return unescape(encodeURIComponent(input)) }, rawMD5(s) { return this.rstrMD5(this.str2rstrUTF8(s)) }, hexMD5(s) { return this.rstr2hex(this.rawMD5(s)) }, rawHMACMD5(k, d) { return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) }, hexHMACMD5(k, d) { return this.rstr2hex(this.rawHMACMD5(k, d)) }, md5(string, key, raw) { if (!key) { if (!raw) { return this.hexMD5(string) } return this.rawMD5(string) } if (!raw) { return this.hexHMACMD5(key, string) } return this.rawHMACMD5(key, string) }, getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; Object.keys(requestParam).sort().forEach(function (key) { requestArr.push(key + '=' + requestParam[key]) }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk } if (feature == 'suggest') { sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk } if (feature == 'reverseGeocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'geocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'getCityList') { sig = '/ws/district/v1/list?' + requestArr.join('&') + sk } if (feature == 'getDistrictByCityId') { sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk } if (feature == 'calculateDistance') { sig = '/ws/distance/v1/?' + requestArr.join('&') + sk } if (feature == 'direction') { sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk } sig = this.md5(sig); return sig }, location2query(data) { if (typeof data == 'string') { return data } var query = ''; for (var i = 0; i < data.length; i++) { var d = data[i]; if (!!query) { query += ';' } if (d.location) { query = query + d.location.lat + ',' + d.location.lng } if (d.latitude && d.longitude) { query = query + d.latitude + ',' + d.longitude } } return query }, rad(d) { return d * Math.PI / 180.0 }, getEndLocation(location) { var to = location.split(';'); var endLocation = []; for (var i = 0; i < to.length; i++) { endLocation.push({ lat: parseFloat(to[i].split(',')[0]), lng: parseFloat(to[i].split(',')[1]) }) } return endLocation }, getDistance(latFrom, lngFrom, latTo, lngTo) { var radLatFrom = this.rad(latFrom); var radLatTo = this.rad(latTo); var a = radLatFrom - radLatTo; var b = this.rad(lngFrom) - this.rad(lngTo); var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); distance = distance * EARTH_RADIUS; distance = Math.round(distance * 10000) / 10000; return parseFloat(distance.toFixed(0)) }, getWXLocation(success, fail, complete) { wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }) }, getLocationParam(location) { if (typeof location == 'string') { var locationArr = location.split(','); if (locationArr.length === 2) { location = { latitude: location.split(',')[0], longitude: location.split(',')[1] } } else { location = {} } } return location }, polyfillParam(param) { param.success = param.success || function () { }; param.fail = param.fail || function () { }; param.complete = param.complete || function () { } }, checkParamKeyEmpty(param, key) { if (!param[key]) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误'); param.fail(errconf); param.complete(errconf); return true } return false }, checkKeyword(param) { return !this.checkParamKeyEmpty(param, 'keyword') }, checkLocation(param) { var location = this.getLocationParam(param.location); if (!location || !location.latitude || !location.longitude) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); param.fail(errconf); param.complete(errconf); return false } return true }, buildErrorConfig(errCode, errMsg) { return { status: errCode, message: errMsg } }, handleData(param, data, feature) { if (feature == 'search') { var searchResult = data.data; var searchSimplify = []; for (var i = 0; i < searchResult.length; i++) { searchSimplify.push({ id: searchResult[i].id || null, title: searchResult[i].title || null, latitude: searchResult[i].location && searchResult[i].location.lat || null, longitude: searchResult[i].location && searchResult[i].location.lng || null, address: searchResult[i].address || null, category: searchResult[i].category || null, tel: searchResult[i].tel || null, adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, province: searchResult[i].ad_info && searchResult[i].ad_info.province || null }) } param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }) } else if (feature == 'suggest') { var suggestResult = data.data; var suggestSimplify = []; for (var i = 0; i < suggestResult.length; i++) { suggestSimplify.push({ adcode: suggestResult[i].adcode || null, address: suggestResult[i].address || null, category: suggestResult[i].category || null, city: suggestResult[i].city || null, district: suggestResult[i].district || null, id: suggestResult[i].id || null, latitude: suggestResult[i].location && suggestResult[i].location.lat || null, longitude: suggestResult[i].location && suggestResult[i].location.lng || null, province: suggestResult[i].province || null, title: suggestResult[i].title || null, type: suggestResult[i].type || null }) } param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }) } else if (feature == 'reverseGeocoder') { var reverseGeocoderResult = data.result; var reverseGeocoderSimplify = { address: reverseGeocoderResult.address || null, latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null }; if (reverseGeocoderResult.pois) { var pois = reverseGeocoderResult.pois; var poisSimplify = []; for (var i = 0; i < pois.length; i++) { poisSimplify.push({ id: pois[i].id || null, title: pois[i].title || null, latitude: pois[i].location && pois[i].location.lat || null, longitude: pois[i].location && pois[i].location.lng || null, address: pois[i].address || null, category: pois[i].category || null, adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, city: pois[i].ad_info && pois[i].ad_info.city || null, district: pois[i].ad_info && pois[i].ad_info.district || null, province: pois[i].ad_info && pois[i].ad_info.province || null }) } param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify, pois: pois, poisSimplify: poisSimplify }) } else { param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify }) } } else if (feature == 'geocoder') { var geocoderResult = data.result; var geocoderSimplify = { title: geocoderResult.title || null, latitude: geocoderResult.location && geocoderResult.location.lat || null, longitude: geocoderResult.location && geocoderResult.location.lng || null, adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, province: geocoderResult.address_components && geocoderResult.address_components.province || null, city: geocoderResult.address_components && geocoderResult.address_components.city || null, district: geocoderResult.address_components && geocoderResult.address_components.district || null, street: geocoderResult.address_components && geocoderResult.address_components.street || null, street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, level: geocoderResult.level || null }; param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }) } else if (feature == 'getCityList') { var provinceResult = data.result[0]; var cityResult = data.result[1]; var districtResult = data.result[2]; param.success(data, { provinceResult: provinceResult, cityResult: cityResult, districtResult: districtResult }) } else if (feature == 'getDistrictByCityId') { var districtByCity = data.result[0]; param.success(data, districtByCity) } else if (feature == 'calculateDistance') { var calculateDistanceResult = data.result.elements; var distance = []; for (var i = 0; i < calculateDistanceResult.length; i++) { distance.push(calculateDistanceResult[i].distance) } param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }) } else if (feature == 'direction') { var direction = data.result.routes; param.success(data, direction) } else { param.success(data) } }, buildWxRequestConfig(param, options, feature) { var that = this; options.header = { "content-type": "application/json" }; options.method = 'GET'; options.success = function (res) { var data = res.data; if (data.status === 0) { that.handleData(param, data, feature) } else { param.fail(data) } }; options.fail = function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; options.complete = function (res) { var statusCode = +res.statusCode; switch (statusCode) { case ERROR_CONF.WX_ERR_CODE: { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); break } case ERROR_CONF.WX_OK_CODE: { var data = res.data; if (data.status === 0) { param.complete(data) } else { param.complete(that.buildErrorConfig(data.status, data.message)) } break } default: { param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) } } }; return options }, locationProcess(param, locationsuccess, locationfail, locationcomplete) { var that = this; locationfail = locationfail || function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; locationcomplete = locationcomplete || function (res) { if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) } }; if (!param.location) { that.getWXLocation(locationsuccess, locationfail, locationcomplete) } else if (that.checkLocation(param)) { var location = Utils.getLocationParam(param.location); locationsuccess(location) } } }; class QQMapWX { constructor(options) { if (!options.key) { throw Error('key值不能为空') } this.key = options.key }; search(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, orderby: options.orderby || '_distance', page_size: options.page_size || 10, page_index: options.page_index || 1, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } var distance = options.distance || "1000"; var auto_extend = options.auto_extend || 1; var region = null; var rectangle = null; if (options.region) { region = options.region } if (options.rectangle) { rectangle = options.rectangle } var locationsuccess = function (result) { if (region && !rectangle) { requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else if (rectangle && !region) { requestParam.boundary = "rectangle(" + rectangle + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else { requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')) }; Utils.locationProcess(options, locationsuccess) }; getSuggestion(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, region: options.region || '全国', region_fix: options.region_fix || 0, policy: options.policy || 0, page_size: options.page_size || 10, page_index: options.page_index || 1, get_subpois: options.get_subpois || 0, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } if (options.location) { var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) }; Utils.locationProcess(options, locationsuccess) } else { if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) } }; reverseGeocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { coord_type: options.coord_type || 5, get_poi: options.get_poi || 0, output: 'json', key: that.key }; if (options.poi_options) { requestParam.poi_options = options.poi_options } var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')) }; Utils.locationProcess(options, locationsuccess) }; geocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'address')) { return } var requestParam = { address: options.address, output: 'json', key: that.key }; if (options.region) { requestParam.region = options.region } if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')) }; getCityList(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')) }; getDistrictByCityId(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'id')) { return } var requestParam = { id: options.id || '', output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')) }; calculateDistance(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { mode: options.mode || 'walking', to: Utils.location2query(options.to), output: 'json', key: that.key }; if (options.from) { options.location = options.from } if (requestParam.mode == 'straight') { var locationsuccess = function (result) { var locationTo = Utils.getEndLocation(requestParam.to); var data = { message: "query ok", result: { elements: [] }, status: 0 }; for (var i = 0; i < locationTo.length; i++) { data.result.elements.push({ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), duration: 0, from: { lat: result.latitude, lng: result.longitude }, to: { lat: locationTo[i].lat, lng: locationTo[i].lng } }) } var calculateResult = data.result.elements; var distanceResult = []; for (var i = 0; i < calculateResult.length; i++) { distanceResult.push(calculateResult[i].distance) } return options.success(data, { calculateResult: calculateResult, distanceResult: distanceResult }) }; Utils.locationProcess(options, locationsuccess) } else { var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')) }; Utils.locationProcess(options, locationsuccess) } }; direction(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { output: 'json', key: that.key }; if (typeof options.to == 'string') { requestParam.to = options.to } else { requestParam.to = options.to.latitude + ',' + options.to.longitude } var SET_URL_DIRECTION = null; options.mode = options.mode || MODE.driving; SET_URL_DIRECTION = URL_DIRECTION + options.mode; if (options.from) { options.location = options.from } if (options.mode == MODE.driving) { if (options.from_poi) { requestParam.from_poi = options.from_poi } if (options.heading) { requestParam.heading = options.heading } if (options.speed) { requestParam.speed = options.speed } if (options.accuracy) { requestParam.accuracy = options.accuracy } if (options.road_type) { requestParam.road_type = options.road_type } if (options.to_poi) { requestParam.to_poi = options.to_poi } if (options.from_track) { requestParam.from_track = options.from_track } if (options.waypoints) { requestParam.waypoints = options.waypoints } if (options.policy) { requestParam.policy = options.policy } if (options.plate_number) { requestParam.plate_number = options.plate_number } } if (options.mode == MODE.transit) { if (options.departure_time) { requestParam.departure_time = options.departure_time } if (options.policy) { requestParam.policy = options.policy } } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) } wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')) }; Utils.locationProcess(options, locationsuccess) } }; module.exports = QQMapWX;
\ No newline at end of file
diff --git a/pages.json b/pages.json
index cc2af52..b286386 100644
--- a/pages.json
+++ b/pages.json
@@ -1,5 +1,11 @@
{
"pages": [{
+ "path": "pages/driver/index/index",
+ "style": {
+ "navigationBarTitleText": "发现",
+ "navigationStyle": "custom"
+ }
+ },{
"path": "pages/repair/tabbar/repair",
"style": {
"navigationBarTitleText" : "首页",
@@ -479,12 +485,6 @@
"style": {
"navigationBarTitleText": "浏览文本"
}
- },{
- "path": "pages/driver/index/index",
- "style": {
- "navigationBarTitleText": "发现",
- "navigationStyle": "custom"
- }
},
{
"path": "pages/driver/mine/index",
@@ -518,6 +518,426 @@
"enablePullDownRefresh" : false,
"navigationStyle": "custom"
}
+ },
+ {
+ "path": "pages/driver/mine/my_order/my_order",
+ "style": {
+ "navigationBarTitleText": "我的订单",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_activity/my_activity",
+ "style": {
+ "navigationBarTitleText": "我的活动",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/welfare/task/task",
+ "style": {
+ "navigationBarTitleText": "天天打卡",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/wallet/wallet",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_favorite/my_favorite",
+ "style": {
+ "navigationBarTitleText": "我的收藏",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },{
+ "path": "pages/driver/welfare/invite/invite",
+ "style": {
+ "navigationBarTitleText": "邀请有礼",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/binding_wx/binding_wx",
+ "style": {
+ "navigationBarTitleText": "绑定微信",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_authentication/my_authentication",
+ "style": {
+ "navigationBarTitleText": "我的认证",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/car_info/car_info",
+ "style": {
+ "navigationBarTitleText": "车辆信息",
+ "enablePullDownRefresh": false
+ }
+ },{
+ "path": "pages/driver/mine/car_info/carUnbind",
+ "style": {
+ "navigationBarTitleText": "解绑车辆",
+ "enablePullDownRefresh": false
+ }
+ },{
+ "path": "pages/driver/serve/repair/re_binding",
+ "style": {
+ "navigationBarTitleText": "绑定车辆",
+ "enablePullDownRefresh" : false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_card_bag/my_card_bag",
+ "style": {
+ "navigationBarTitleText": "我的卡包",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/common_problem/common_problem",
+ "style": {
+ "navigationBarTitleText": "常见问题",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/about_us/about_us",
+ "style": {
+ "navigationBarTitleText": "关于我们",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_user/my_user",
+ "style": {
+ "navigationBarTitleText": "个人资料",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/set/set",
+ "style": {
+ "navigationBarTitleText": "设置",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_ttention/my_ttention",
+ "style": {
+ "navigationBarTitleText": "我的关注",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_integral/my_integral",
+ "style": {
+ "navigationBarTitleText": "我的积分",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/personal_center/personal_center",
+ "style": {
+ "navigationBarTitleText": "个人中心",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/serveOrder/serve_order",
+ "style": {
+ "navigationBarTitleText": "服务订单",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/rentCars/rent_order",
+ "style": {
+ "navigationBarTitleText": "租车订单",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/buyCars/buy_cars_order",
+ "style": {
+ "navigationBarTitleText": "买车订单",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_evaluate/my_evaluate",
+ "style": {
+ "navigationBarTitleText": "我的评价",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_evaluate/my_card_evaluate",
+ "style": {
+ "navigationBarTitleText": "我的评价",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/refund/refund",
+ "style": {
+ "navigationBarTitleText": "申请退款",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_evaluate/my_review",
+ "style": {
+ "navigationBarTitleText": "评价详情",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_evaluate/evaluate_issue",
+ "style": {
+ "navigationBarTitleText": "发布评价",
+ "enablePullDownRefresh": false
+ }
+ } ,{
+ "path": "pages/driver/serve/coupons/payresult",
+ "style": {
+ "navigationBarTitleText": "支付结果",
+ "enablePullDownRefresh" : false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/serveOrder/serve_particulars",
+ "style": {
+ "navigationBarTitleText": "服务订单卡券详情",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/serveOrder/integral_particulars",
+ "style": {
+ "navigationBarTitleText": "服务订单积分详情",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/serveOrder/work_particulars",
+ "style": {
+ "navigationBarTitleText": "服务订单工单详情",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_evaluate/my_review",
+ "style": {
+ "navigationBarTitleText": "评价详情",
+ "enablePullDownRefresh": false
+ }
+ }, {
+ "path": "pages/driver/serve/coupons/coupons",
+ "style": {
+ "navigationBarTitleText": "卡券",
+ "enablePullDownRefresh" : false
+ }
+ }, {
+ "path": "pages/driver/serve/coupons/cou_order",
+ "style": {
+ "navigationBarTitleText": "确认订单",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/coupons/cou_detail_reply",
+ "style": {
+ "navigationBarTitleText": "用户评价",
+ // "navigationStyle": "custom",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/coupons/cou_card",
+ "style": {
+ "navigationBarTitleText": "选择优惠券",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path" : "pages/driver/mine/my_activity/detail",
+ "style" :
+ {
+ "navigationBarTitleText" : "卡券详情",
+ "enablePullDownRefresh" : false,
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_card_bag/card_detail_page",
+ "style": {
+ "navigationBarTitleText": "核销券",
+ "enablePullDownRefresh": false
+ }
+ }, {
+ "path": "pages/driver/serve/coupons/cou_detail",
+ "style": {
+ // "navigationBarTitleText": "卡券详情"
+ "navigationStyle": "custom",
+ "enablePullDownRefresh" : false
+ }
+ }, {
+ "path": "pages/driver/serve/coupons/cou_store",
+ "style": {
+ "navigationBarTitleText": "门店列表",
+ "enablePullDownRefresh" : false
+ }
+ }, {
+ "path": "pages/driver/serve/activity_list",
+ "style": {
+ "navigationBarTitleText": "助力活动",
+ // "navigationStyle": "custom",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/hot_list",
+ "style": {
+ "navigationBarTitleText": "热销推荐",
+ // "navigationStyle": "custom",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path" : "pages/driver/welfare/rightsInterests/rightsInterests",
+ "style" :
+ {
+ "navigationBarTitleText" : "积分权益",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/repair/repair",
+ "style": {
+ "navigationBarTitleText": "维修",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/repair/re_create/select_store",
+ "style": {
+ "navigationBarTitleText": "常规保养",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path" : "pages/driver/welfare/rightsInterests/rightsInterests_particulars",
+ "style" :
+ {
+ "navigationBarTitleText" : "积分权益商品详情",
+ "enablePullDownRefresh" : false,
+ "navigationStyle": "custom"
+ }
+ }, {
+ "path" : "pages/driver/welfare/rightsInterests/confirm_order",
+ "style" :
+ {
+ "navigationBarTitleText" : "确认订单",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path" : "pages/driver/welfare/payment_state/payment_state",
+ "style" :
+ {
+ "navigationBarTitleText" : "支付结果",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/repair/re_create/select_city",
+ "style": {
+ "navigationBarTitleText": "搜索城市",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/repair/re_create/select_time",
+ "style": {
+ "navigationBarTitleText": "预约时间",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/repair/re_create/result",
+ "style": {
+ "navigationBarTitleText": "维修预约",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/repair/re_create/reservation",
+ "style": {
+ "navigationBarTitleText": "维修预约",
+ "enablePullDownRefresh" : false
+ }
+ },{
+ "path": "pages/driver/serve/repair/realname",
+ "style": {
+ "navigationBarTitleText": "完善资料",
+ "enablePullDownRefresh" : false
+ }
+ },
+ {
+ "path": "pages/driver/mine/my_order/refund/refund_x",
+ "style": {
+ "navigationBarTitleText": "退款详情",
+ "enablePullDownRefresh": false
+ }
+ }, {
+ "path": "pages/driver/welfare/task/integral",
+ "style": {
+ "navigationBarTitleText": "积分明细",
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#F2F5F9"
+ }
+ }, {
+ "path": "pages/driver/mine/wallet/topUp",
+ "style": {
+ "navigationBarTitleText": "钱包充值"
+ }
+ }, {
+ "path": "pages/driver/mine/wallet/withdrawDeposit",
+ "style": {
+ "navigationBarTitleText": "提现"
+ }
+ },
+ {
+ "path": "pages/driver/welfare/invite/invite_register",
+ "style": {
+ "navigationBarTitleText": "邀请注册",
+ "enablePullDownRefresh": false
+ }
+ },{
+ "path" : "pages/driver/index/post",
+ "style" : {
+ "navigationBarTitleText" : "",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/driver/welfare/invite/invite_commission",
+ "style": {
+ "navigationBarTitleText": "邀请购买",
+ "enablePullDownRefresh": false
+ }
+ },{
+ "path": "pages/driver/welfare/invite/invite_poster",
+ "style": {
+ "navigationBarTitleText": "邀请海报",
+ "enablePullDownRefresh": false,
+ "navigationStyle": "custom"
+ }
}
],
"tabBar": {
diff --git a/pages/driver/index/index.vue b/pages/driver/index/index.vue
index e1ba0d0..0dd39d4 100644
--- a/pages/driver/index/index.vue
+++ b/pages/driver/index/index.vue
@@ -28,7 +28,7 @@
搜索
-
+
diff --git a/pages/driver/message/message.vue b/pages/driver/message/message.vue
index 4383128..4b0f938 100644
--- a/pages/driver/message/message.vue
+++ b/pages/driver/message/message.vue
@@ -61,7 +61,7 @@
-
+
@@ -78,7 +78,7 @@
@@ -149,13 +150,6 @@
}
.page-header-withdraw-deposit {
- width: 130rpx;
- height: 56rpx;
- border-radius: 28rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #FFFFFF;
- background: rgba(137, 215, 211, 1);
}
.page-header-title {
diff --git a/pages/driver/welfare/payment_state/payment_state.vue b/pages/driver/welfare/payment_state/payment_state.vue
index 4edd425..95ec486 100644
--- a/pages/driver/welfare/payment_state/payment_state.vue
+++ b/pages/driver/welfare/payment_state/payment_state.vue
@@ -42,12 +42,12 @@
methods: {
toMyCardBagPage() {
uni.redirectTo({
- url: '/pages/mine/my_order/serveOrder/serve_order'
+ url: '/pages/driver/mine/my_order/serveOrder/serve_order'
})
},
toHomePage() {
uni.switchTab({
- url: '/pages/index/index'
+ url: '/pages/driver/index/index'
});
}
},
diff --git a/pages/driver/welfare/rightsInterests/confirm_order.vue b/pages/driver/welfare/rightsInterests/confirm_order.vue
index e1b16dd..d6749b1 100644
--- a/pages/driver/welfare/rightsInterests/confirm_order.vue
+++ b/pages/driver/welfare/rightsInterests/confirm_order.vue
@@ -205,11 +205,11 @@
frontPayintegral(obj).then(res => {
this.paymentShow = false
uni.navigateTo({
- url: `/pages/welfare/payment_state/payment_state?resultType=res`
+ url: `/pages/driver/welfare/payment_state/payment_state?resultType=res`
})
}).catch(err => {
uni.navigateTo({
- url: `/pages/welfare/payment_state/payment_state?resultType=err`
+ url: `/pages/driver/welfare/payment_state/payment_state?resultType=err`
})
})
} else {
diff --git a/pages/driver/welfare/rightsInterests/rightsInterests.vue b/pages/driver/welfare/rightsInterests/rightsInterests.vue
index 328892a..d86a67a 100644
--- a/pages/driver/welfare/rightsInterests/rightsInterests.vue
+++ b/pages/driver/welfare/rightsInterests/rightsInterests.vue
@@ -60,7 +60,7 @@
//详情
navParticularsFn(item) {
uni.navigateTo({
- url: `/pages/welfare/rightsInterests/rightsInterests_particulars?id=${item.id}`
+ url: `/pages/driver/welfare/rightsInterests/rightsInterests_particulars?id=${item.id}`
})
}
},
diff --git a/pages/driver/welfare/rightsInterests/rightsInterests_particulars.vue b/pages/driver/welfare/rightsInterests/rightsInterests_particulars.vue
index 3c421d7..e7e8896 100644
--- a/pages/driver/welfare/rightsInterests/rightsInterests_particulars.vue
+++ b/pages/driver/welfare/rightsInterests/rightsInterests_particulars.vue
@@ -1,6 +1,6 @@
-
+
@@ -180,7 +180,7 @@
let id = this.commodityDeta.id
let commodityNum = this.commodityNum
uni.navigateTo({
- url: `/pages/welfare/rightsInterests/confirm_order?id=${id}&commodityNum=${commodityNum}`
+ url: `/pages/driver/welfare/rightsInterests/confirm_order?id=${id}&commodityNum=${commodityNum}`
})
},
//弹出层
@@ -191,7 +191,7 @@
navBackFn(type) {
if (type == 'tabbar') {
uni.switchTab({
- url: '/pages/index/index'
+ url: '/pages/driver/index/index'
})
} else {
uni.navigateBack()
diff --git a/pages/driver/welfare/task/task.vue b/pages/driver/welfare/task/task.vue
index 28b75a8..894e186 100644
--- a/pages/driver/welfare/task/task.vue
+++ b/pages/driver/welfare/task/task.vue
@@ -95,7 +95,7 @@
let form = {category: this.current}
console.log(form);
taskList(form).then(res => {
- console.log(res);
+ // console.log(res);
this.taskList = res.data
})
},
@@ -116,7 +116,7 @@
})
} else {
uni.switchTab({
- url: '/pages/index/index'
+ url: '/pages/driver/index/index'
})
}
}
@@ -128,7 +128,7 @@
//积分明细
navIntegFn() {
uni.navigateTo({
- url: '/pages/welfare/task/integral'
+ url: '/pages/driver/welfare/task/integral'
})
}
}
diff --git a/pages/login/driver-login.vue b/pages/login/driver-login.vue
index 8e8f3ef..26738fd 100644
--- a/pages/login/driver-login.vue
+++ b/pages/login/driver-login.vue
@@ -52,7 +52,7 @@
resendCodeTime: 60,
timer: null,
form: {
- phone: '18875843298',
+ phone: '18739735805',
captcha: '999999'
},
rules: {
@@ -116,13 +116,14 @@
},
// 登录
loginSumbit() {
- uni.$u.toast('司机模块开发中')
- return
+ // uni.$u.toast('司机模块开发中')
+ // return
if (this.agree) {
this.$refs.uForm.validate().then(res => {
userLogin(this.form).then(res => {
console.log(res.data.token);
setToken(res.data.token)
+ uni.setStorageSync('userType', 'driver')
uni.switchTab({
url: '/pages/driver/index/index'
});
diff --git a/pages/login/server-login.vue b/pages/login/server-login.vue
index f0151b4..828dc0c 100644
--- a/pages/login/server-login.vue
+++ b/pages/login/server-login.vue
@@ -66,7 +66,7 @@
timer: null,
identityName: '车商',
identityList: [[
- {keyName: 'platform', text: '平台'},
+ // {keyName: 'platform', text: '平台'},
{keyName: 'repair', text: '维修店'},
{keyName: 'carDealers', text: '车商'}
]],
diff --git a/permission.js b/permission.js
index adfd214..0dafbf6 100644
--- a/permission.js
+++ b/permission.js
@@ -1,50 +1,58 @@
-import { getToken } from '@/utils/auth'
-
-// 登录页面
-const loginPage1 = "/pages/login/driver-login"
-const loginPage2 = "/pages/login/server-login"
-
-
-// 页面白名单
-const whiteList = [
- '/pages/login/driver-login',
- '/pages/login/server-login',
- '/pages/repair/tabbar/repair'
-]
-
-// 检查地址白名单
-function checkWhite(url) {
- const path = url.split('?')[0]
- return whiteList.indexOf(path) !== -1
-}
-
-// 页面跳转验证拦截器
-let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
-list.forEach(item => {
- uni.addInterceptor(item, {
- invoke(to) {
- if (getToken()) {
- if (to.url === loginPage1 || to.url === loginPage2) {
- console.log('用户身份', uni.getStorageSync('userType'));
- let userType = uni.getStorageSync('userType')
- if(userType == 'repair') {
- uni.switchTab({
- url: '/pages/repair/tabbar/repair'
- })
- }
- }
- return true
- } else {
- if (checkWhite(to.url)) {
- return true
- }
- console.log("触发页面验证拦截", to.url)
- uni.reLaunch({ url: loginPage1 })
- return false
- }
- },
- fail(err) {
- console.log(err)
- }
- })
-})
+import { getToken } from '@/utils/auth'
+
+// 登录页面
+const loginPage1 = "/pages/login/driver-login"
+const loginPage2 = "/pages/login/server-login"
+
+
+// 页面白名单
+const whiteList = [
+ '/pages/login/driver-login',
+ '/pages/login/server-login',
+ '/pages/repair/tabbar/repair'
+]
+
+// 检查地址白名单
+function checkWhite(url) {
+ const path = url.split('?')[0]
+ return whiteList.indexOf(path) !== -1
+}
+
+// 页面跳转验证拦截器
+let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
+list.forEach(item => {
+ uni.addInterceptor(item, {
+ invoke(to) {
+ if (getToken()) {
+ if (to.url === loginPage1 || to.url === loginPage2) {
+ console.log('用户身份', uni.getStorageSync('userType'));
+ let userType = uni.getStorageSync('userType')
+ if(userType == 'repair') {
+ uni.switchTab({
+ url: '/pages/repair/tabbar/repair'
+ })
+ }else if(userType == 'carDealers'){
+ uni.switchTab({
+ url: '/pages/carShop/message/message'
+ })
+ }else if(userType == 'driver'){
+ uni.switchTab({
+ url: '/pages/driver/index/index'
+ })
+ }
+ }
+ return true
+ } else {
+ if (checkWhite(to.url)) {
+ return true
+ }
+ console.log("触发页面验证拦截", to.url)
+ uni.reLaunch({ url: loginPage1 })
+ return false
+ }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
+})
diff --git a/static/scss/currency.css b/static/scss/currency.css
index ee437ff..3aa4955 100644
--- a/static/scss/currency.css
+++ b/static/scss/currency.css
@@ -34,9 +34,18 @@ image {
.f-38 {
font-size: 38rpx;
}
+.f-40 {
+ font-size: 40rpx
+}
.f-48 {
font-size: 48rpx
}
+.f-50 {
+ font-size: 50rpx;
+}
+.f-52 {
+ font-size: 52rpx;
+}
.f-56 {
font-size: 56rpx;
}
@@ -56,6 +65,9 @@ image {
.black {
color: #000;
}
+.c000{
+ color: #000;
+}
.white {
color: #fff
}
@@ -86,9 +98,6 @@ image {
.c444 {
color: #444444;
}
-.c555 {
- color: #555555;
-}
.c999 {
color: #999999;
}
@@ -118,6 +127,20 @@ image {
.text-right {
text-align: right;
}
+/* 文字 */
+.line-one {
+ white-space: nowrap; /* 不换行 */
+ overflow: hidden; /* 隐藏超出部分 */
+ text-overflow: ellipsis; /* 使用省略号表示被裁切的内容 */
+}
+.line-two {
+ display: -webkit-box; /* 必须 */
+ overflow: hidden; /* 必须 */
+ text-overflow: ellipsis; /* 必须 */
+ /* white-space: nowrap; */ /* 必须 */
+ -webkit-line-clamp: 2; /* 指定行数 */
+ -webkit-box-orient: vertical; /* 必须 */
+}
/* 边框 */
.border-bottom {
border-bottom: 1rpx solid #000;
@@ -194,6 +217,9 @@ image {
.mt-5 {
margin-top: 50rpx;
}
+.mt-6 {
+ margin-top: 60rpx;
+}
.mt-8 {
margin-top: 80rpx;
}
@@ -206,6 +232,9 @@ image {
.ml-3 {
margin-left: 30rpx;
}
+.ml-4 {
+ margin-left: 40rpx;
+}
.mr-2 {
margin-right: 20rpx;
}