diff --git a/api/activity.js b/api/activity.js index cc8feb6..5ca75fe 100644 --- a/api/activity.js +++ b/api/activity.js @@ -302,7 +302,10 @@ export function storeActivityQrcode(data) { // 活动商品专区 export function storeActivityProduct(data) { - return request.get(`storeActivity/product`, data, { - noAuth: true - }); + return request.get(`storeActivity/product`, data); +} + +// 活动区域列表 +export function storeActivityDistrict(data) { + return request.get(`storeActivity/district`, data); } diff --git a/components/shortPopup.vue b/components/shortPopup.vue index 5e334f8..e04ebb0 100644 --- a/components/shortPopup.vue +++ b/components/shortPopup.vue @@ -22,7 +22,7 @@ {{leftPrice}}.{{rightPrice}} - 订货价 + {{datas.store_name}} diff --git a/components/shortPopupActive.vue b/components/shortPopupActive.vue index b107236..9f95187 100644 --- a/components/shortPopupActive.vue +++ b/components/shortPopupActive.vue @@ -20,9 +20,13 @@ - {{leftPrice}}.{{rightPrice}} - - 订货价 + + {{leftPrice2}}.{{rightPrice2}} + + 原价: ¥{{leftPrice}}.{{rightPrice}} + + {{leftPrice}}.{{rightPrice}} + {{datas.store_name}} @@ -56,11 +60,11 @@ - + {{isBuy?'立即购买':'加入购物车'}} @@ -74,6 +78,7 @@ getProductDetail } from '@/api/store.js'; import { Toast } from '../libs/uniApi'; +import { data } from '../uni_modules/uview-ui/libs/mixin/mixin'; export default { name: "shortPopup", props: { @@ -120,6 +125,12 @@ import { Toast } from '../libs/uniApi'; }, rightPrice(){ return this.sku[this.changeSkuKey]?.price?.split('.')[1]||'00'; + }, + leftPrice2(){ + return this.datas.limited_price.split('.')[0]||'0'; + }, + rightPrice2(){ + return this.datas.limited_price.split('.')[1]||'00'; } }, methods: { diff --git a/pages/columnGoods/goods_search/index.vue b/pages/columnGoods/goods_search/index.vue index c97da21..3979aea 100644 --- a/pages/columnGoods/goods_search/index.vue +++ b/pages/columnGoods/goods_search/index.vue @@ -231,7 +231,7 @@ } }, navigatorBack(){ - if(this.searchValue!==''&&this.searchValue!==undefined&&this.searchValue!==null){ + if(this.searchValue!==undefined&&this.searchValue!==null){ uni.navigateBack({ success:()=> { uni.$emit('searchValue', this.searchValue); diff --git a/pages/index/index.vue b/pages/index/index.vue index a077e29..fbc969a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -144,7 +144,7 @@ - + - - {{ item.product.price.split('.')[0] }}.{{item.product.price.split('.')[1]}} 限时特惠 - - - - + + + + 此区域没有找到活动商品,切换其他地方试试呢 + @@ -47,7 +62,7 @@ import authorize from "@/components/Authorize.vue"; import { getUserInfo } from '@/api/user.js'; import shortPopupActive from "@/components/shortPopupActive.vue" - import { storeActivityProduct } from "@/api/activity.js" + import { storeActivityProduct, storeActivityDistrict } from "@/api/activity.js" import { cloudWarehouse } from '@/api/requesta.js' @@ -75,24 +90,31 @@ show: false, isAuto: false, //没有授权的不会自动授权 isShowAuth: false, //是否隐藏授权 + addressList: [], goodsList: [], - street_id: '', goodsNum: 0, can_buy: 0, // 是否可以购买, 0不可以, 1可以 } }, onLoad(options) { - this.street_id = options.street_id; + this.address = { + street_id: options.street_id, + townName: options.townName + } }, onShow() { this.getUserInfo(); this.loadList(); this.cartFn(); - this.address = this.$store.state.storage.address; + this.loadAddressList(); }, methods: { - changeAddress(){ - + changeAddress(e){ + this.address = { + street_id: this.addressList[e.detail.value].street_code, + townName: this.addressList[e.detail.value].street_name + } + this.loadList(); }, back() { uni.navigateBack() @@ -108,7 +130,7 @@ let location = ''; if(this.$store.state.storage.location.lat) location = this.$store.state.storage.location.lat + ',' + this.$store.state.storage.location.long; storeActivityProduct({ - street_code: this.$store.state.storage.address.street_id, + street_code: this.address.street_id, activity_id: 2, //默认传2 location: location, source: 105 @@ -119,6 +141,14 @@ Toast(e.msg||e.message||e) }) }, + loadAddressList(){ + storeActivityDistrict().then(res=>{ + this.addressList = res.data; + if(!this.addressList.find(item=>item.street_code==this.address.street_id)){ + this.address.street_id = '' + } + }) + }, // 获取规格名称 getSkuName(item){ return Object.keys(item.sku).join('/')||null; @@ -229,8 +259,9 @@ .r_name { width: 100%; - height: 64rpx; - line-height: 32rpx; + height: 80rpx; + font-size: 28rpx; + line-height: 40rpx; text-overflow: ellipsis; display: -webkit-box; /* 使用弹性盒子布局 */ -webkit-box-orient: vertical; /* 设置为垂直方向布局 */ @@ -239,8 +270,8 @@ .mer-labels{ background-color: #f84221; color: #fff; - font-size: 16rpx; - padding: 2rpx 6rpx; + font-size: 18rpx; + padding: 4rpx 8rpx; border-radius: 5rpx; margin-right: 8rpx; } @@ -273,7 +304,7 @@ padding-left: 15rpx; border-radius: 0 60rpx 60rpx 0; .qiang{ - width: 100rpx; + width: 160rpx; height: 60rpx; display: flex; justify-content: center;