diff --git a/api/store.js b/api/store.js index 05852b2..e91880e 100644 --- a/api/store.js +++ b/api/store.js @@ -92,6 +92,7 @@ export function getProducts(q) { }); } + /* * 商品详情 * */ @@ -265,3 +266,23 @@ export function storeListApi(data) { login: false }); } + + + +/* + * 文章列表 + * */ +export function getArticle(q) { + return request.get("/article/list", q, { + login: false + }); +} + +/* + * 文章详情 + * */ +export function getArticleDetail(q) { + return request.get("/article/details/" + q.id,{ + login: false + }); +} \ No newline at end of file diff --git a/components/vSwiper.vue b/components/vSwiper.vue index 0ed0c6c..a350292 100644 --- a/components/vSwiper.vue +++ b/components/vSwiper.vue @@ -2,8 +2,8 @@ - - + + 标题标题标题标题标题 @@ -38,7 +38,11 @@ swiperIndex: e.detail.current }); }, - + toDetial(id){ + uni.navigateTo({ + url: '/pages/life/articleDetail/index?id='+id + }) + }, previewImg() { uni.previewImage({ urls: this.imgs @@ -52,7 +56,7 @@ .swiper-block { width: 670rpx; height: 300rpx; - margin: 60rpx auto; + margin: 0 auto; } .swiper-item { @@ -85,11 +89,15 @@ font-size: 32rpx; font-weight: 500; color: #fff; + margin-bottom: 10rpx; } .content{ color: #fff; font-size: 26rpx; } + .content view{ + margin-right: 50rpx; + } .active { transform: scale(1.02); transition: all 0.2s ease-in 0s; diff --git a/config/index.js b/config/index.js index 844be21..8e1318a 100644 --- a/config/index.js +++ b/config/index.js @@ -1,7 +1,7 @@ // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api' -// export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api' -export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api' +export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api' +// export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api' // export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api' // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api' diff --git a/main.js b/main.js index 48c4502..aa97064 100644 --- a/main.js +++ b/main.js @@ -45,8 +45,6 @@ Object.defineProperty(Vue.prototype, '$yroute', { }, }) -console.log(Vue.prototype) -console.log(Object.getPrototypeOf(Vue)) let deviceType = '' // #ifdef APP-PLUS diff --git a/package-lock.json b/package-lock.json index 91a8cc8..eade2a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,31 @@ { + "name": "zhaoshangMiniApp-uniapp", + "lockfileVersion": 2, "requires": true, - "lockfileVersion": 1, + "packages": { + "": { + "dependencies": { + "async-validator": "^4.0.7", + "dayjs": "^1.10.7", + "uview-ui": "^1.8.4" + } + }, + "node_modules/async-validator": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/async-validator/download/async-validator-4.0.7.tgz?cache=0&sync_timestamp=1634529502627&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fasync-validator%2Fdownload%2Fasync-validator-4.0.7.tgz", + "integrity": "sha1-A0oP0hA6ay6/AQ2nUYO+wpkkev4=" + }, + "node_modules/dayjs": { + "version": "1.10.7", + "resolved": "https://registry.nlark.com/dayjs/download/dayjs-1.10.7.tgz?cache=0&sync_timestamp=1631266519235&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdayjs%2Fdownload%2Fdayjs-1.10.7.tgz", + "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==" + }, + "node_modules/uview-ui": { + "version": "1.8.4", + "resolved": "https://registry.npm.taobao.org/uview-ui/download/uview-ui-1.8.4.tgz", + "integrity": "sha1-4yu/I3lCHTGQIuMk4ct7U4fTvUQ=" + } + }, "dependencies": { "async-validator": { "version": "4.0.7", diff --git a/package.json b/package.json index 07b57b1..db9b875 100644 --- a/package.json +++ b/package.json @@ -4,4 +4,4 @@ "dayjs": "^1.10.7", "uview-ui": "^1.8.4" } -} +} \ No newline at end of file diff --git a/pages.json b/pages.json index 3dda68e..d508a42 100644 --- a/pages.json +++ b/pages.json @@ -255,8 +255,9 @@ { "path": "pages/life/index", "style": { + "navigationStyle": "custom", "navigationBarTitleText": "生活", - "enablePullDownRefresh": true + "enablePullDownRefresh": true } }, { @@ -290,7 +291,18 @@ "navigationBarTitleText": "详情预览" } }, - + { + "path": "pages/life/articleList/index", + "style": { + "navigationBarTitleText": "资讯列表" + } + }, + { + "path": "pages/life/articleDetail/index", + "style": { + "navigationBarTitleText": "资讯详情" + } + }, { "path": "pages/activity/index", "style": { diff --git a/pages/home/index.vue b/pages/home/index.vue index 2652fac..aaf2eb9 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -96,7 +96,7 @@ 立即抢购 - + data-i --> @@ -114,7 +114,7 @@ {{item.cname}} {{item.detailedDescription}} 了解详情 - + diff --git a/pages/life/articleDetail/index.vue b/pages/life/articleDetail/index.vue new file mode 100644 index 0000000..e5f5a83 --- /dev/null +++ b/pages/life/articleDetail/index.vue @@ -0,0 +1,111 @@ + + + + + + diff --git a/pages/life/articleList/index.vue b/pages/life/articleList/index.vue new file mode 100644 index 0000000..fbddb76 --- /dev/null +++ b/pages/life/articleList/index.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/pages/life/index.vue b/pages/life/index.vue index a873776..67b84e5 100644 --- a/pages/life/index.vue +++ b/pages/life/index.vue @@ -1,6 +1,6 @@