From e3513e70fa042c635e4446f987e32d804d2b4e3f Mon Sep 17 00:00:00 2001 From: quantulr <35954003+quantulr@users.noreply.github.com> Date: Wed, 8 May 2024 17:32:39 +0800 Subject: [PATCH] init commit --- api/express.js | 37 ++++ app.js | 3 +- app.json | 6 + icon/kefu.svg | 1 + icon/zaixiankefu.svg | 1 + pages/logistics_details/logistics_details.js | 27 ++- .../logistics_details/logistics_details.wxml | 10 +- .../logistics_details/logistics_details.wxss | 47 ++++- pages/my/my_address/my_address.js | 14 +- pages/my/my_order/my_order.js | 46 +++- pages/my/my_order/my_order.wxml | 173 ++++++++-------- pages/order_details/order_details.js | 6 +- pages/order_details/order_details.wxml | 22 +- pages/order_details/order_details.wxss | 32 ++- utils/md5.js | 196 ++++++++++++++++++ utils/request.js | 15 ++ 16 files changed, 522 insertions(+), 114 deletions(-) create mode 100644 api/express.js create mode 100644 icon/kefu.svg create mode 100644 icon/zaixiankefu.svg create mode 100644 utils/md5.js create mode 100644 utils/request.js diff --git a/api/express.js b/api/express.js new file mode 100644 index 0000000..b08c503 --- /dev/null +++ b/api/express.js @@ -0,0 +1,37 @@ +// const request = require("../utils/request") +const { md5 } = require("../utils/md5") +const guessExpressCom = ({ num, key, success, fail }) => { + wx.request({ + url: `https://www.kuaidi100.com/autonumber/auto?num=${num}&key=${key}`, + header: { + "Content-Type": "application/x-www-form-urlencoded" + }, + success, + fail + }) +} + +const getExpressDetail = ({ num, success, fail }) => { + const param = JSON.stringify({ com: "yuantong", num, phone: "", from: "", to: "", resultv2: "0", show: "0", order: "desc" }) + console.log(param); + wx.request({ + url: `https://poll.kuaidi100.com/poll/query.do`, + method: "POST", + header: { + "Content-Type": "application/x-www-form-urlencoded" + }, + + data: { + customer: "F9449547DFA2DD0968C0552BA286AD35", + sign: md5(`${param}AjjPbmMP4727F9449547DFA2DD0968C0552BA286AD35`, 32).toUpperCase(), + param + }, + success, + fail + }) +} + +module.exports = { + guessExpressCom, + getExpressDetail +} \ No newline at end of file diff --git a/app.js b/app.js index aa2f906..6abbb5d 100644 --- a/app.js +++ b/app.js @@ -147,7 +147,8 @@ App({ // ip: 'http://106.54.198.47/', //接口地址 ip: 'https://sanpinhuicai.com/', //接口地址 - //ip: 'http://192.168.0.199:9090/', //接口地址 + // ip: 'http://192.168.0.112:9000/', //接口地址/ + // ip: 'http://127.0.0.1:9000/', //接口地址/ //appId wx65c9560afc9cbaa7 } diff --git a/app.json b/app.json index 7b01cbc..8629730 100644 --- a/app.json +++ b/app.json @@ -97,5 +97,11 @@ "scope.userLocation": { "desc": "你的位置信息将方便您查看附近自提点" } + }, + "plugins": { + "kdPlugin": { + "version": "1.1.2", + "provider": "wx6885acbedba59c14" + } } } \ No newline at end of file diff --git a/icon/kefu.svg b/icon/kefu.svg new file mode 100644 index 0000000..b822d1d --- /dev/null +++ b/icon/kefu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icon/zaixiankefu.svg b/icon/zaixiankefu.svg new file mode 100644 index 0000000..115e08b --- /dev/null +++ b/icon/zaixiankefu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/logistics_details/logistics_details.js b/pages/logistics_details/logistics_details.js index 926c1c1..313ebcf 100644 --- a/pages/logistics_details/logistics_details.js +++ b/pages/logistics_details/logistics_details.js @@ -1,3 +1,4 @@ +const { guessExpressCom, getExpressDetail } = require("../../api/express") // pages/logistics_details/logistics_details.js Page({ @@ -5,14 +6,36 @@ Page({ * 页面的初始数据 */ data: { - + records: [], + num: "" }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + // guessExpressCom({ + // num: "YT7460149632645", + // key: "AjjPbmMP4727", + // success(resp) { + // console.log(resp); + // } + // }) + this.setData({ + num: "YT7460149632645" + }) + getExpressDetail({ + num: this.data.num, + success: (res) => { + console.log(res); + if (res.data.status === "200") { + console.log(res.data.data); + this.setData({ + records: res.data.data + }) + } + } + }) }, /** diff --git a/pages/logistics_details/logistics_details.wxml b/pages/logistics_details/logistics_details.wxml index b096132..e32be4c 100644 --- a/pages/logistics_details/logistics_details.wxml +++ b/pages/logistics_details/logistics_details.wxml @@ -1,2 +1,10 @@ -TODO: 物流详情 \ No newline at end of file + + 圆通快递:{{num}} + + + + {{item.time}} + {{item.context}} + + \ No newline at end of file diff --git a/pages/logistics_details/logistics_details.wxss b/pages/logistics_details/logistics_details.wxss index b144c7f..1b9aadb 100644 --- a/pages/logistics_details/logistics_details.wxss +++ b/pages/logistics_details/logistics_details.wxss @@ -1 +1,46 @@ -/* pages/logistics_details/logistics_details.wxss */ \ No newline at end of file +/* pages/logistics_details/logistics_details.wxss */ +.record-item { + /* padding-bottom: 48rpx; */ + display: flex; + flex-direction: column; + position: relative; + padding-left: 48rpx; +} + +.record-item:not(:last-child) { + padding-bottom: 48rpx; +} + +.time { + font-size: 24rpx; +} + +.dot { + position: absolute; + left: 0; + top: 9rpx; + width: 16rpx; + height: 16rpx; + background-color: gray; + opacity: 50%; + border-radius: 50%; + z-index: 999; +} + +.record-item:nth-child(2) .dot { + background-color: red; + opacity: 1; + width: 24rpx; + height: 24rpx; + left: -6rpx; +} + +.line { + position: absolute; + left: 8rpx; + top: 0; + height: 100%; + width: 2rpx; + background-color: gray; + opacity: 50%; +} \ No newline at end of file diff --git a/pages/my/my_address/my_address.js b/pages/my/my_address/my_address.js index 4e579d1..7a7aef6 100644 --- a/pages/my/my_address/my_address.js +++ b/pages/my/my_address/my_address.js @@ -81,22 +81,23 @@ Page({ const prevPage = pages[pages.length - 2]  // 上一页 // 调用上一个页面的setData 方法,将数据存储 - if(this.data.dataList.length>0){ + if (this.data.dataList.length > 0) { prevPage.setData({ address: dataList[index].addressProvince + dataList[index].addressCity + dataList[index].addressArea + dataList[index].addressDetailed, addressId: dataList[index].id, province: dataList[index].addressProvince, - orderPick:2, + orderPick: 2, }) - }else{ + prevPage.requestUpdateAddress && prevPage.requestUpdateAddress() + } else { prevPage.setData({ address: '选择收货方式', addressId: '', province: '', - orderPick:2, + orderPick: 2, }) } - + wx.navigateBack(); }, //编辑 @@ -156,6 +157,9 @@ Page({ } }) }, + + + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/my/my_order/my_order.js b/pages/my/my_order/my_order.js index dc7445c..95bd83f 100644 --- a/pages/my/my_order/my_order.js +++ b/pages/my/my_order/my_order.js @@ -71,7 +71,7 @@ Page({ }, //订单数据 orderList: function () { - if(time) { + if (time) { clearTimeout(time); } console.log(11111) @@ -88,7 +88,9 @@ Page({ userId: app.globalData.userId, status: this.data.type, page: this.data.page, - num: this.data.num + num: this.data.num, + addressId: undefined, + currentOrder: undefined }, success: res => { console.log(res) @@ -120,10 +122,10 @@ Page({ orderList: orderList, page: this.data.page + 1 }) - time = setInterval(()=>{ + time = setInterval(() => { this.countDown(orderList); }, 1000) - + } else { if (this.data.page != 1) { wx.showToast({ @@ -160,6 +162,22 @@ Page({ url: '/pages/expresswx/expresswx', }) }, + viewLogisticsDetails(e) { + const { logisticsNum } = e.currentTarget.dataset + wx.navigateTo({ + url: `/pages/logistics_details/logistics_details`, + }) + }, + + updateAddress(e) { + const { addressId, id: orderId } = e.currentTarget.dataset + this.setData({ + currentOrder: orderId + }) + wx.navigateTo({ + url: '/pages/my/my_address/my_address?orderAddress=true&addressId=' + addressId, + }) + }, //查看进度 after: function (e) { wx.navigateTo({ @@ -355,6 +373,23 @@ Page({ }) }, + requestUpdateAddress() { + const { addressId, currentOrder } = this.data + console.log(addressId, currentOrder,); + wx.request({ + url: app.globalData.ip + '/wisdommining/api/order/requestUpdateAddress', + method: "GET", + data: { + addressId, orderId: currentOrder + }, + success: (result) => { + wx.showToast({ + title: result.data.message, + }) + } + }) + }, + /** * 生命周期函数--监听页面初次渲染完成 */ @@ -388,6 +423,5 @@ Page({ */ onReachBottom: function () { this.orderList() - }, - + } }) \ No newline at end of file diff --git a/pages/my/my_order/my_order.wxml b/pages/my/my_order/my_order.wxml index 75ebc56..d852203 100644 --- a/pages/my/my_order/my_order.wxml +++ b/pages/my/my_order/my_order.wxml @@ -1,39 +1,39 @@ - - - 全部 - - - - 待支付 - - - - 待发货 - - - - 待收货 - - - - 退款售后 - - - - 已完成 - - - + + + 全部 + + + + 待支付 + + + + 待发货 + + + + 待收货 + + + + 退款售后 + + + + 已完成 + + + - - - {{item.status==5?'已取消':item.status==1?'待支付':item.status==2?'待发货':item.status==3?'待收货':item.status==4?'已完成':''}} - - - {{ + + + {{item.status==5?'已取消':item.status==1?'待支付':item.status==2?'待发货':item.status==3?'待收货':item.status==4?'已完成':''}} + + + {{ item.status==61?'换货审核中' :item.status==62?'退货审核中' :item.status==63&&item.orderRefundType==1?'换货申请成功' @@ -47,64 +47,65 @@ :item.status==66&&item.orderRefundType==2?'退货失败' :'' }} - - 订单编号:{{item.orderNumber}} - - - - - - {{goods.goodsName}} - - {{item.orderPayWay!=2?'¥'+goods.price:goods.price+'积分'}} - - ¥0 - - x {{goods.goodsNum}} - + + 订单编号:{{item.orderNumber}} + + + + + + {{goods.goodsName}} + + {{item.orderPayWay!=2?'¥'+goods.price:goods.price+'积分'}} + + ¥0 + + x {{goods.goodsNum}} + - - 自提 - 免运费 - - 运费{{item.orderFreight}} - - 合计{{item.orderPayWay!=2?'¥'+item.orderActualPay:item.orderOtherPay+'积分'}} - - - 您需要在{{item.timeStr}}内处理 - - - 物流查询 - 确认收货 - 立即支付 - 删除订单 + + 自提 + 免运费 + + 运费{{item.orderFreight}} + + 合计{{item.orderPayWay!=2?'¥'+item.orderActualPay:item.orderOtherPay+'积分'}} + + + 您需要在{{item.timeStr}}内处理 + + + 物流查询 + 确认收货 + 立即支付 + 删除订单 - - - - 申请退款 - - 申请退货 - 申请换货 - - 查看进度 - - - 退换货记录 + + - - + + 申请退款 + + 申请退货 + 申请换货 + + 查看进度 + + + 退换货记录 + + + + + + 修改地址 + + - - - - 暂无订单~ + + + + 暂无订单~ \ No newline at end of file diff --git a/pages/order_details/order_details.js b/pages/order_details/order_details.js index b5ea23c..641f64e 100644 --- a/pages/order_details/order_details.js +++ b/pages/order_details/order_details.js @@ -335,12 +335,12 @@ Page({ phoneNumber: '15955151737', }) }, - viewLogisticsDetails() { + viewLogisticsDetails(e) { + const { logisticsNum } = e.currentTarget.dataset wx.navigateTo({ - url: "/pages/logistics_details/logistics_details", + url: `/pages/logistics_details/logistics_details`, }) }, - /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/order_details/order_details.wxml b/pages/order_details/order_details.wxml index e6ba4af..9f9009d 100644 --- a/pages/order_details/order_details.wxml +++ b/pages/order_details/order_details.wxml @@ -11,7 +11,7 @@ - + @@ -118,8 +118,16 @@ 快速解决问题 - - + + + 客服电话 + + + + 在线客服 + + + @@ -130,15 +138,15 @@ 核销时请出示此核销码~ - - - + 删除订单 - 物流查询 + 物流查询 确认收货 diff --git a/pages/order_details/order_details.wxss b/pages/order_details/order_details.wxss index 183883f..89a54f7 100644 --- a/pages/order_details/order_details.wxss +++ b/pages/order_details/order_details.wxss @@ -323,16 +323,44 @@ page { } .contact-b { - margin-top: 20rpx; + margin-top: 32rpx; display: flex; - justify-content: space-between; + justify-content: center; align-items: center; } +.contact-bth { + display: flex; + align-items: center; +} + +.contact-bth:last-child { + margin-left: 160rpx; +} + +.open-type-contact { + position: absolute; + left: 0; + top: 0; + z-index: 99; + width: 100% !important; + height: 100%; + color: transparent !important; + border-color: transparent !important; + background-color: transparent !important; +} + .rounded-full { border-radius: 9999px; } +.logistics-btn { + margin-left: 0; + margin-right: 40rpx; + color: orange !important; + border-color: orange !important; +} + .code { width: 750rpx; height: 240rpx; diff --git a/utils/md5.js b/utils/md5.js new file mode 100644 index 0000000..7e61957 --- /dev/null +++ b/utils/md5.js @@ -0,0 +1,196 @@ +/*! + * md5js v1.0.7 + * (c) 2017-2018 penyuying + * Released under the MIT License. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.md5 = {}))); +}(this, (function (exports) { 'use strict'; + +/* +eslint-disable +*/ +function md5(text, bit) { + var sMessage = text; //this; + function RotateLeft(lValue, iShiftBits) { + return lValue << iShiftBits | lValue >>> 32 - iShiftBits; + } + function AddUnsigned(lX, lY) { + var lX4, lY4, lX8, lY8, lResult; + lX8 = lX & 0x80000000; + lY8 = lY & 0x80000000; + lX4 = lX & 0x40000000; + lY4 = lY & 0x40000000; + lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); + if (lX4 & lY4) return lResult ^ 0x80000000 ^ lX8 ^ lY8; + if (lX4 | lY4) { + if (lResult & 0x40000000) return lResult ^ 0xC0000000 ^ lX8 ^ lY8;else return lResult ^ 0x40000000 ^ lX8 ^ lY8; + } else return lResult ^ lX8 ^ lY8; + } + function F(x, y, z) { + return x & y | ~x & z; + } + function G(x, y, z) { + return x & z | y & ~z; + } + function H(x, y, z) { + return x ^ y ^ z; + } + function I(x, y, z) { + return y ^ (x | ~z); + } + function FF(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + } + function GG(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + } + function HH(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + } + function II(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + } + function ConvertToWordArray(sMessage) { + var lWordCount; + var lMessageLength = sMessage.length; + var lNumberOfWords_temp1 = lMessageLength + 8; + var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - lNumberOfWords_temp1 % 64) / 64; + var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; + var lWordArray = Array(lNumberOfWords - 1); + var lBytePosition = 0; + var lByteCount = 0; + while (lByteCount < lMessageLength) { + lWordCount = (lByteCount - lByteCount % 4) / 4; + lBytePosition = lByteCount % 4 * 8; + lWordArray[lWordCount] = lWordArray[lWordCount] | sMessage.charCodeAt(lByteCount) << lBytePosition; + lByteCount++; + } + lWordCount = (lByteCount - lByteCount % 4) / 4; + lBytePosition = lByteCount % 4 * 8; + lWordArray[lWordCount] = lWordArray[lWordCount] | 0x80 << lBytePosition; + lWordArray[lNumberOfWords - 2] = lMessageLength << 3; + lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; + return lWordArray; + } + function WordToHex(lValue) { + var WordToHexValue = "", + WordToHexValue_temp = "", + lByte, + lCount; + for (lCount = 0; lCount <= 3; lCount++) { + lByte = lValue >>> lCount * 8 & 255; + WordToHexValue_temp = "0" + lByte.toString(16); + WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2); + } + return WordToHexValue; + } + var x = Array(); + var k, AA, BB, CC, DD, a, b, c, d; + var S11 = 7, + S12 = 12, + S13 = 17, + S14 = 22; + var S21 = 5, + S22 = 9, + S23 = 14, + S24 = 20; + var S31 = 4, + S32 = 11, + S33 = 16, + S34 = 23; + var S41 = 6, + S42 = 10, + S43 = 15, + S44 = 21; + // Steps 1 and 2. Append padding bits and length and convert to words + x = ConvertToWordArray(sMessage); + // Step 3. Initialise + a = 0x67452301;b = 0xEFCDAB89;c = 0x98BADCFE;d = 0x10325476; + // Step 4. Process the message in 16-word blocks + for (k = 0; k < x.length; k += 16) { + AA = a;BB = b;CC = c;DD = d; + a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); + d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); + c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); + b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); + a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); + d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); + c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); + b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); + a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); + d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); + c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); + b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); + a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); + d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); + c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); + b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); + a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); + d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); + c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); + b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); + a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); + d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); + c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); + b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); + a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); + d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); + c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); + b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); + a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); + d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); + c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); + b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); + a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); + d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); + c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); + b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); + a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); + d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); + c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); + b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); + a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); + d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); + c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); + b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); + a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); + d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); + c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); + b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); + a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); + d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); + c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); + b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); + a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); + d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); + c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); + b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); + a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); + d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); + c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); + b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); + a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); + d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); + c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); + b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); + a = AddUnsigned(a, AA);b = AddUnsigned(b, BB);c = AddUnsigned(c, CC);d = AddUnsigned(d, DD); + } + if (bit == 32) { + return WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); + } else { + return WordToHex(b) + WordToHex(c); + } +} + +exports.md5 = md5; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/utils/request.js b/utils/request.js new file mode 100644 index 0000000..a0abd05 --- /dev/null +++ b/utils/request.js @@ -0,0 +1,15 @@ +const request = (config) => new Promise((resolve, reject) => { + wx.request({ + ...config, + success(res) { + resolve(res) + }, + fail(err) { + reject(err) + } + }) +}) + +module.exports = { + request: request +} \ No newline at end of file