diff --git a/api/request.ts b/api/request.ts
index a84e750..488de56 100644
--- a/api/request.ts
+++ b/api/request.ts
@@ -2,5 +2,6 @@ export const Url = 'http://localhost:9092/api' //后端接口文档
export const testUrl = 'http://123.249.108.160:8888/api' //自己组的服务器接口地址
export const suiUrl = 'http://154.8.193.216:9092/api' //隋宇霏的接口地址
export const domain = 'https://www.carboner.cn/api'
+export const myIp = 'http://8.130.119.119:9092/api'
-export const baseUrl = testUrl
\ No newline at end of file
+export const baseUrl = Url
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index 83dab4b..1b19905 100644
--- a/manifest.json
+++ b/manifest.json
@@ -14,7 +14,7 @@
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
- "delay" : 0
+ "delay" : 0
},
"modules" : {},
/* 模块配置 */
@@ -55,7 +55,12 @@
"urlCheck" : false,
"minified" : true
},
- "usingComponents" : true
+ "usingComponents" : true,
+ "permission": {
+ "scope.userLocation": {
+ "desc": "你的位置信息将用于小程序定位"
+ }
+ }
},
"vueVersion" : "3"
}
diff --git a/pages.json b/pages.json
index 38245e6..7e1c5ab 100644
--- a/pages.json
+++ b/pages.json
@@ -1,5 +1,12 @@
{
"pages": [
+ {
+ "path" : "pages/test/test",
+ "style" :
+ {
+ "navigationBarTitleText" : ""
+ }
+ },
{
"path" : "pages/home/home",
"style" :
@@ -213,6 +220,16 @@
}
}
],
+ "plugins" : {
+ "logisticsPlugin" : {
+ "version": "2.3.0",
+ "provider": "wx9ad912bf20548d92"
+ },
+ "routePlan": {
+ "version": "1.0.19",
+ "provider": "wx50b5593e81dd937a"
+ }
+ },
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
diff --git a/pages/test/test.vue b/pages/test/test.vue
new file mode 100644
index 0000000..f5b3dea
--- /dev/null
+++ b/pages/test/test.vue
@@ -0,0 +1,302 @@
+
+
+ 先登录再查看物流
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/unpackage/dist/dev/mp-weixin/api/request.js b/unpackage/dist/dev/mp-weixin/api/request.js
index de58d7a..b628701 100644
--- a/unpackage/dist/dev/mp-weixin/api/request.js
+++ b/unpackage/dist/dev/mp-weixin/api/request.js
@@ -1,4 +1,6 @@
"use strict";
+const Url = "http://localhost:9092/api";
const testUrl = "http://123.249.108.160:8888/api";
-const baseUrl = testUrl;
+const baseUrl = Url;
exports.baseUrl = baseUrl;
+exports.testUrl = testUrl;
diff --git a/unpackage/dist/dev/mp-weixin/app.js b/unpackage/dist/dev/mp-weixin/app.js
index 426325a..0c35202 100644
--- a/unpackage/dist/dev/mp-weixin/app.js
+++ b/unpackage/dist/dev/mp-weixin/app.js
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const common_vendor = require("./common/vendor.js");
const store_index = require("./store/index.js");
if (!Math) {
+ "./pages/test/test.js";
"./pages/home/home.js";
"./pages/store-home/main/main.js";
"./pages/mine/main/main.js";
diff --git a/unpackage/dist/dev/mp-weixin/app.json b/unpackage/dist/dev/mp-weixin/app.json
index 80d0549..c4563ff 100644
--- a/unpackage/dist/dev/mp-weixin/app.json
+++ b/unpackage/dist/dev/mp-weixin/app.json
@@ -1,5 +1,6 @@
{
"pages": [
+ "pages/test/test",
"pages/home/home",
"pages/store-home/main/main",
"pages/mine/main/main",
@@ -62,5 +63,20 @@
}
]
},
+ "plugins": {
+ "logisticsPlugin": {
+ "version": "2.3.0",
+ "provider": "wx9ad912bf20548d92"
+ },
+ "routePlan": {
+ "version": "1.0.19",
+ "provider": "wx50b5593e81dd937a"
+ }
+ },
+ "permission": {
+ "scope.userLocation": {
+ "desc": "你的位置信息将用于小程序定位"
+ }
+ },
"usingComponents": {}
}
\ No newline at end of file
diff --git a/unpackage/dist/dev/mp-weixin/common/vendor.js b/unpackage/dist/dev/mp-weixin/common/vendor.js
index 1357684..06f15f0 100644
--- a/unpackage/dist/dev/mp-weixin/common/vendor.js
+++ b/unpackage/dist/dev/mp-weixin/common/vendor.js
@@ -17235,6 +17235,12 @@ function mitt(n2) {
} };
}
const pages = [
+ {
+ path: "pages/test/test",
+ style: {
+ navigationBarTitleText: ""
+ }
+ },
{
path: "pages/home/home",
style: {
@@ -17418,6 +17424,16 @@ const pages = [
}
}
];
+const plugins = {
+ logisticsPlugin: {
+ version: "2.3.0",
+ provider: "wx9ad912bf20548d92"
+ },
+ routePlan: {
+ version: "1.0.19",
+ provider: "wx50b5593e81dd937a"
+ }
+};
const globalStyle = {
navigationBarTextStyle: "black",
navigationBarTitleText: "uni-app",
@@ -17454,6 +17470,7 @@ const tabBar = {
};
const e = {
pages,
+ plugins,
globalStyle,
tabBar
};
diff --git a/unpackage/dist/dev/mp-weixin/pages/test/test.js b/unpackage/dist/dev/mp-weixin/pages/test/test.js
new file mode 100644
index 0000000..8dee9ad
--- /dev/null
+++ b/unpackage/dist/dev/mp-weixin/pages/test/test.js
@@ -0,0 +1,178 @@
+"use strict";
+const common_vendor = require("../../common/vendor.js");
+const api_request = require("../../api/request.js");
+const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
+ __name: "test",
+ setup(__props) {
+ let waybillToken = "";
+ let access_token = "";
+ const userLogin = () => {
+ common_vendor.index.request({
+ url: api_request.testUrl + "/user/login",
+ method: "POST",
+ data: {
+ userAccount: "feiyi",
+ userPassword: 123456
+ },
+ success: (res) => {
+ console.log(res);
+ }
+ });
+ };
+ const getWxLoginCode = () => {
+ common_vendor.wx$1.login({
+ success: (res) => {
+ console.log(res.code);
+ }
+ });
+ };
+ const testMap = () => {
+ common_vendor.wx$1.openLocation({
+ latitude: 45.867741,
+ longitude: 126.560037,
+ name: "哈尔滨师范大学(松北校区)",
+ address: "黑龙江省哈尔滨市呼兰区利民经济开发区师大路1号",
+ success: (res) => {
+ console.log(res);
+ }
+ });
+ };
+ const chooseAddress = () => {
+ common_vendor.wx$1.chooseAddress({
+ success: (res) => {
+ console.log(res);
+ }
+ });
+ };
+ const chooseLocation = () => {
+ common_vendor.wx$1.chooseLocation({
+ latitude: 28.58,
+ longitude: 121.48,
+ success: (res) => {
+ console.log(res);
+ }
+ });
+ };
+ const getToken = () => {
+ common_vendor.index.request({
+ url: "https://api.weixin.qq.com/cgi-bin/token",
+ method: "GET",
+ data: {
+ grant_type: "client_credential",
+ appid: "wx61b63e27bddf4ea2",
+ secret: "5ef9e1f17acd8180afe2d80199fd466e"
+ },
+ success: (res) => {
+ access_token = res.data.access_token;
+ console.log(access_token);
+ }
+ });
+ };
+ const toDelieverPage2 = () => {
+ common_vendor.index.request({
+ url: "https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/trace_waybill?access_token=" + access_token,
+ method: "POST",
+ data: {
+ openid: "oydCP7TGAWUqN_d0g3y6bbQkbe2I",
+ waybill_id: "YT8949374567344",
+ receiver_phone: "123456566",
+ goods_info: {
+ detail_list: [
+ {
+ goods_name: "测试名字",
+ goods_img_url: "https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FSnnMkwOn-1ab7a54755e0a23722c1b9dd0ae981c4.png"
+ },
+ {
+ goods_name: "测试名字2",
+ goods_img_url: "https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FSnnMkwOn-1ab7a54755e0a23722c1b9dd0ae981c4.png"
+ }
+ ]
+ }
+ },
+ success: (res) => {
+ console.log(res.data);
+ waybillToken = res.data.waybill_token;
+ plugin.openWaybillTracking({
+ waybillToken
+ });
+ }
+ });
+ };
+ var plugin = requirePlugin("logisticsPlugin");
+ const toDelieverPage = () => {
+ common_vendor.index.request({
+ url: api_request.baseUrl + "/logistics/get/info",
+ method: "POST",
+ data: {
+ id: 125125278
+ },
+ header: {
+ "cookie": common_vendor.wx$1.getStorageSync("cookie")
+ },
+ success: (res) => {
+ console.log(res.data.data);
+ waybillToken = res.data.data.waybill_token;
+ plugin.openWaybillTracking({
+ waybillToken
+ });
+ }
+ });
+ };
+ const login = () => {
+ common_vendor.index.login({
+ provider: "weixin",
+ //使用微信登录
+ success: function(loginRes) {
+ if (loginRes.code !== null) {
+ console.log("获取code:" + loginRes.code);
+ loginUser(loginRes.code);
+ } else {
+ console.log("code为空");
+ }
+ }
+ });
+ };
+ const loginUser = async (code) => {
+ const res = await common_vendor.index.request({
+ url: api_request.baseUrl + "/user/login/wx_open",
+ method: "GET",
+ data: {
+ code
+ }
+ });
+ console.log(res);
+ console.log("loginUser后台返回的==>", res.header["Set-Cookie"]);
+ common_vendor.index.removeStorageSync("cookie");
+ common_vendor.index.setStorageSync("cookie", res.header["Set-Cookie"]);
+ if (res.data.code == 1) {
+ common_vendor.index.showToast({
+ title: "登录成功",
+ duration: 2e3
+ //提示两秒
+ });
+ common_vendor.index.setStorageSync("userInfo", res.data.data);
+ } else {
+ common_vendor.index.showToast({
+ icon: "error",
+ title: "登录失败,请重试"
+ });
+ return;
+ }
+ };
+ return (_ctx, _cache) => {
+ return {
+ a: common_vendor.o(login),
+ b: common_vendor.o(toDelieverPage),
+ c: common_vendor.o(getToken),
+ d: common_vendor.o(toDelieverPage2),
+ e: common_vendor.o(chooseAddress),
+ f: common_vendor.o(chooseLocation),
+ g: common_vendor.o(testMap),
+ h: common_vendor.o(userLogin),
+ i: common_vendor.o(getWxLoginCode)
+ };
+ };
+ }
+});
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/微信小程序/课设整合/匠承非遗小程序端/jiangchengfeiyi-xiaochengxu/pages/test/test.vue"]]);
+wx.createPage(MiniProgramPage);
diff --git a/unpackage/dist/dev/mp-weixin/pages/test/test.json b/unpackage/dist/dev/mp-weixin/pages/test/test.json
new file mode 100644
index 0000000..a0812ee
--- /dev/null
+++ b/unpackage/dist/dev/mp-weixin/pages/test/test.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/unpackage/dist/dev/mp-weixin/pages/test/test.wxml b/unpackage/dist/dev/mp-weixin/pages/test/test.wxml
new file mode 100644
index 0000000..8bb4364
--- /dev/null
+++ b/unpackage/dist/dev/mp-weixin/pages/test/test.wxml
@@ -0,0 +1 @@
+先登录再查看物流
\ No newline at end of file
diff --git a/unpackage/dist/dev/mp-weixin/pages/test/test.wxss b/unpackage/dist/dev/mp-weixin/pages/test/test.wxss
new file mode 100644
index 0000000..e69de29
diff --git a/unpackage/dist/dev/mp-weixin/project.config.json b/unpackage/dist/dev/mp-weixin/project.config.json
index 674985f..9b52339 100644
--- a/unpackage/dist/dev/mp-weixin/project.config.json
+++ b/unpackage/dist/dev/mp-weixin/project.config.json
@@ -18,7 +18,7 @@
}
},
"compileType": "miniprogram",
- "libVersion": "3.7.4",
+ "libVersion": "3.7.3",
"appid": "wx61b63e27bddf4ea2",
"projectname": "FeiYi",
"condition": {
diff --git a/unpackage/dist/dev/mp-weixin/project.private.config.json b/unpackage/dist/dev/mp-weixin/project.private.config.json
index 436aeec..5802338 100644
--- a/unpackage/dist/dev/mp-weixin/project.private.config.json
+++ b/unpackage/dist/dev/mp-weixin/project.private.config.json
@@ -7,6 +7,13 @@
"condition": {
"miniprogram": {
"list": [
+ {
+ "name": "pages/home/home",
+ "pathName": "pages/home/home",
+ "query": "",
+ "launchMode": "default",
+ "scene": null
+ },
{
"name": "pages/mine/Contact/Contact",
"pathName": "pages/mine/Contact/Contact",