diff --git a/api/product.js b/api/product.js index 2226f4e..da4eaf6 100644 --- a/api/product.js +++ b/api/product.js @@ -61,4 +61,51 @@ export function getSeason(id) { * */ export function getSeasonPoster(id) { return request.get("/seasonalFood/poster/" + id, {}, {login: true}) +} + +/** + * 民宿专题 + * */ +export function getHomestay(id) { + return request.get(`/contentHomestay/${id}`, {}, {login: false}) +} + +/** + * 节日专题 + * */ +export function getFestival() { + return request.get('/contentFestival', {}, {login: false}) +} + +/* +* 非遗文化 +* */ +export function getICH() { + return request.get('/ich/index', {}, {login: false}) +} + +/* +* 非遗文化详情 +* */ +export function getICHDetails(id) { + return request.get(`/ich/content/${id}`, {}, {login: false}) +} + +/* +* 地标好物-省份列表 +* */ +export function getProvinceList() { + return request.get('/landmarkGoods/provinceList', {}, {login: false}) +} + +/* +* 地标好物-地图数据 +* */ +export function getProvince(id) { + return request.get(`/landmarkGoods/province/${id}`, {}, {login: false}) +} + +export function getProvinceGoods(parentId, keyword, page) { + const params = `?parentId=${parentId}&keyword=${keyword}&page=${page}&limit=10`; + return request.get('/landmarkGoods/productList' + params, {}, {login: false}) } \ No newline at end of file diff --git a/api/share.js b/api/share.js new file mode 100644 index 0000000..b36a748 --- /dev/null +++ b/api/share.js @@ -0,0 +1,21 @@ +import request from "@/utils/request"; + +// 天天秒杀分享图片 +export function secKillShareImage() { + return request.get('/seckill/shareImage', {}, {login: false}) +} + +// 天天秒杀商品分享图片 +export function secKillGoodsShareImage(id) { + return request.get('/seckill/shareImage/'+id, {}, {login: false}) +} + +// 千县名品分享图片 +export function famousShareImage() { + return request.get('/countyFamous/shareImage', {}, {login: false}) +} + +// 千县名品商品分享图片 +export function famousGoodsShareImage(id) { + return request.get('/countyFamous/shareImage/'+id, {}, {login: false}) +} diff --git a/components/Loading.vue b/components/Loading.vue index 1a643bc..39481e7 100644 --- a/components/Loading.vue +++ b/components/Loading.vue @@ -1,7 +1,7 @@ @@ -20,7 +20,7 @@ export default { name: "Loading", props: { - loaded: Boolean, + loadend: Boolean, loading: Boolean } }; diff --git a/components/ProductWindow.vue b/components/ProductWindow.vue index 7dfadc2..e1f954c 100644 --- a/components/ProductWindow.vue +++ b/components/ProductWindow.vue @@ -17,7 +17,7 @@ - {{ item.attrName }} 438 + {{ item.attrName }} - + + + + + \ No newline at end of file diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index d422c2e..b7f6ba9 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -4,15 +4,16 @@ - + - + - + - + {{ storeInfo.storeName }} - + + + + + - + {{ storeInfo.storeName }} @@ -110,7 +111,7 @@ - + @@ -141,7 +142,7 @@ - + {{ killInfo.storeInfo.title }} @@ -167,7 +168,7 @@ - + {{ dayInfo.title }} @@ -400,12 +401,12 @@ - - + + - + - + @@ -501,6 +502,7 @@ import {mapGetters} from "vuex"; import {diffDay, formatDateTime} from "@/utils/index"; import {getCurAddress, getLocation, getUrlParam} from "@/utils/common.js"; import cookie from "@/utils/store/cookie"; +import {famousGoodsShareImage, secKillGoodsShareImage} from "@/api/share"; export default { name: "GoodsCon", @@ -542,7 +544,7 @@ export default { id: null, partnerId: null, activityId: 0, // v4 add - from: "", // v4 add + source: "", // v4 add preInfo: {}, killInfo: {}, dayInfo: {}, @@ -582,7 +584,28 @@ export default { webUrl: this.$VUE_APP_RESOURCES_URL }; }, - computed: mapGetters(["isLogin", "location"]), + computed: mapGetters(["isLogin", "location", "userInfo"]), + onShareAppMessage() { + return new Promise(async (resolve, reject) => { + let result; + let params = `?id=${this.id}&partnerId=${this.userInfo.uid}`; + if (this.source === 'famous') { + result = await famousGoodsShareImage(this.id); + } + if (this.source === 'kill') { + result = await secKillGoodsShareImage(this.activityId); + params += `&activityId=${this.activityId}` + } + + if (result.status === 200) { + resolve({ + title: this.storeInfo.storeName, + path: '/pages/shop/GoodsCon/index' + params, + imageUrl: result.data + }) + } + }) + }, onLoad: function (options) { // test data console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync()); @@ -595,7 +618,7 @@ export default { this.id = options.id || null; this.partnerId = options.partnerId || null; this.activityId = this._route.query.activityId; - this.from = this._route.query.from || ""; + this.source = this._route.query.from || ""; } else { let obj = uni.getEnterOptionsSync(); if (options.scene != null || obj.query.scene != null) { @@ -625,7 +648,7 @@ export default { this.productCon(); this.fetchCompanyDatea(); - switch (this.from) { + switch (this.source) { case "pre": this.getPreInfo(); break; @@ -942,7 +965,7 @@ export default { that.isWenwan = res.data.isWenwan; // 给 attr 赋值,将请求回来的规格赋值给 attr - if (this.from === "") { + if (this.source === "" || this.source === 'famous') { that.$set(that.attr, "productAttr", res.data.productAttr); that.$set(that, "productValue", res.data.productValue); } @@ -1229,7 +1252,7 @@ export default { }; // v4 新增活动ID - switch (this.from) { + switch (this.source) { case "pre": q.preSaleId = Number(this.activityId) break; diff --git a/pages/shop/GoodsList/index.vue b/pages/shop/GoodsList/index.vue index ce6af5a..1b4ec27 100644 --- a/pages/shop/GoodsList/index.vue +++ b/pages/shop/GoodsList/index.vue @@ -68,7 +68,7 @@ - + {{ item.price }} + + @@ -38,6 +41,11 @@ + + + + \ No newline at end of file diff --git a/pkg_product/views/healthList.vue b/pkg_product/views/healthList.vue index 554594f..37f401c 100644 --- a/pkg_product/views/healthList.vue +++ b/pkg_product/views/healthList.vue @@ -1,31 +1,26 @@