zs hace 1 año
padre
commit
3ede2dadc7

+ 1 - 1
common/api.js

@@ -3,7 +3,7 @@ const getDomain = (uri, method, type) => {
 	let serverUrl = config.serverUrl;
 	let fileUrl = config.serverFile;
 	if (type && type == 'file') return fileUrl + `/files` + uri;
-	else return serverUrl + `/follow/v1/api` + uri;
+	else return serverUrl + uri;
 };
 // 获取token
 const getToken = () => {

+ 1 - 1
config.js

@@ -9,7 +9,7 @@ if (system.uniPlatform == 'mp-weixin') {
 }
 export default {
 	serverFile: 'https://broadcast.waityou24.cn',
-	serverUrl: 'http://192.168.1.113:15001',
+	serverUrl: 'http://192.168.1.113:8890',
 	wx_projectkey: wx_projectkey,
 	wx_miniProgram: wx_min.miniProgram,
 	system: system,

+ 12 - 14
pages/home/index.vue

@@ -36,8 +36,7 @@
 		},
 		onLoad: async function(e) {
 			const that = this;
-			that.searchToken();
-			await that.searchOther();
+			await that.searchToken();
 			await that.search();
 		},
 		methods: {
@@ -58,18 +57,17 @@
 			// 查询
 			async search() {
 				const that = this;
-				let res;
-			},
-			// 查询其他信息
-			async searchOther() {
-				const that = this;
-				let res;
-				// // 查询类型
-				// res = await that.$api(`/dictData`, 'GET', {
-				// 	type: 'home_tabs',
-				// 	is_use: '0',
-				// })
-				// if (res.errcode == '0') that.$set(that, `typeList`, res.data);
+				// 广告
+				const res = await that.$api(`/adv`, 'GET', {
+					is_use: '0'
+				})
+				if (res.errcode == '0') {
+					that.$set(that, `advertList`, res.data)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+					});
+				}
 			},
 		}
 	}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


+ 2 - 2
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -11029,7 +11029,7 @@ var _config = _interopRequireDefault(__webpack_require__(/*! ../config.js */ 38)
 var getDomain = function getDomain(uri, method, type) {
   var serverUrl = _config.default.serverUrl;
   var fileUrl = _config.default.serverFile;
-  if (type && type == 'file') return fileUrl + "/files" + uri;else return serverUrl + "/follow/v1/api" + uri;
+  if (type && type == 'file') return fileUrl + "/files" + uri;else return serverUrl + uri;
 };
 // 获取token
 var getToken = function getToken() {
@@ -11146,7 +11146,7 @@ if (system.uniPlatform == 'mp-weixin') {
 }
 var _default = {
   serverFile: 'https://broadcast.waityou24.cn',
-  serverUrl: 'http://192.168.1.113:15001',
+  serverUrl: 'http://192.168.1.113:8890',
   wx_projectkey: wx_projectkey,
   wx_miniProgram: wx_min.miniProgram,
   system: system,

+ 20 - 31
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -229,13 +229,12 @@ var _default = {
           switch (_context.prev = _context.next) {
             case 0:
               that = this;
-              that.searchToken();
-              _context.next = 4;
-              return that.searchOther();
-            case 4:
-              _context.next = 6;
+              _context.next = 3;
+              return that.searchToken();
+            case 3:
+              _context.next = 5;
               return that.search();
-            case 6:
+            case 5:
             case "end":
               return _context.stop();
           }
@@ -271,37 +270,27 @@ var _default = {
           while (1) {
             switch (_context2.prev = _context2.next) {
               case 0:
-                that = _this;
-              case 1:
+                that = _this; // 广告
+                _context2.next = 3;
+                return that.$api("/adv", 'GET', {
+                  is_use: '0'
+                });
+              case 3:
+                res = _context2.sent;
+                if (res.errcode == '0') {
+                  that.$set(that, "advertList", res.data);
+                } else {
+                  uni.showToast({
+                    title: res.errmsg
+                  });
+                }
+              case 5:
               case "end":
                 return _context2.stop();
             }
           }
         }, _callee2);
       }))();
-    },
-    // 查询其他信息
-    searchOther: function searchOther() {
-      var _this2 = this;
-      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
-        var that, res;
-        return _regenerator.default.wrap(function _callee3$(_context3) {
-          while (1) {
-            switch (_context3.prev = _context3.next) {
-              case 0:
-                that = _this2; // // 查询类型
-                // res = await that.$api(`/dictData`, 'GET', {
-                // 	type: 'home_tabs',
-                // 	is_use: '0',
-                // })
-                // if (res.errcode == '0') that.$set(that, `typeList`, res.data);
-              case 1:
-              case "end":
-                return _context3.stop();
-            }
-          }
-        }, _callee3);
-      }))();
     }
   }
 };