更新活动
This commit is contained in:
parent
61083bc7b1
commit
bcd7e001c4
@ -301,7 +301,8 @@ export function storeActivityQrcode(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 活动商品专区
|
// 活动商品专区
|
||||||
|
|
||||||
export function storeActivityProduct(data) {
|
export function storeActivityProduct(data) {
|
||||||
return request.get(`storeActivity/product`, data);
|
return request.get(`storeActivity/product`, data, {
|
||||||
|
noAuth: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
523
components/shortPopupActive.vue
Normal file
523
components/shortPopupActive.vue
Normal file
@ -0,0 +1,523 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<uni-popup ref="popupRef" type="bottom" @change="changeShow">
|
||||||
|
<view class="pop">
|
||||||
|
<scroll-view scroll-y class="scroll">
|
||||||
|
<view class="image">
|
||||||
|
<swiper class="swiper" :current="current" autoplay style="width: 100%;height: 100%;" @change="changeCurrent">
|
||||||
|
<block v-if="product.slider_image && product.slider_image.length>0">
|
||||||
|
<swiper-item v-for="(item,index) in product.slider_image" :key="index">
|
||||||
|
<image class="img" :src="item"></image>
|
||||||
|
</swiper-item>
|
||||||
|
</block>
|
||||||
|
<swiper-item v-else>
|
||||||
|
<image class="img" :src="datas.image||defualtImg"></image>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view class="current">{{current+1}}/{{product.slider_image && product.slider_image.length||1}}</view>
|
||||||
|
<image class="close" src="@/static/images/icon/close.png" @click="close()"></image>
|
||||||
|
<view class="border"></view>
|
||||||
|
</view>
|
||||||
|
<view class="white_card">
|
||||||
|
<view class="flex flex_end">
|
||||||
|
<view class="price">¥<text class="pro">{{leftPrice}}.</text>{{rightPrice}}
|
||||||
|
</view>
|
||||||
|
<view>订货价</view>
|
||||||
|
</view>
|
||||||
|
<view class="short_name">{{datas.store_name}}</view>
|
||||||
|
<view class="flex">
|
||||||
|
<view class="shop_name">
|
||||||
|
<image class="icon" src="@/static/images/icon/short.png"></image>
|
||||||
|
<view>{{datas.merchant.mer_name}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-line></u-line>
|
||||||
|
<block name="规格选中" v-for="(att, indexw) in attr" :key="indexw">
|
||||||
|
<view class="m_title">{{att.attr_name}}</view>
|
||||||
|
<view class="flex" style="flex-wrap: wrap;">
|
||||||
|
<view class="attr" :class="{'attr_active': item.check}"
|
||||||
|
v-for="(item, indexn) in att.attr_value" :key="indexn"
|
||||||
|
@click="changeAttr(indexw, indexn)">
|
||||||
|
{{item.attr}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<view class="m_title num">
|
||||||
|
<view>购买数量</view>
|
||||||
|
<view class="input">
|
||||||
|
<view class="input_item sub" @click="subCartNum">-</view>
|
||||||
|
<input class="input_item input_view" v-model="cart_num" type="number" @input="inputCartNum" />
|
||||||
|
<view class="input_item plus" @click="plusCartNum">+</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
商品库存 <text style="margin-left: 20rpx;">{{(sku[changeSkuKey] && sku[changeSkuKey].stock)||change.stock}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="button">
|
||||||
|
<view class="b_icon" @click="navgoCart()">
|
||||||
|
<image src="@/static/images/icon/car.png"></image>
|
||||||
|
<view>购物车</view>
|
||||||
|
<view class="badge" v-if="goodsNum">{{goodsNum}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click.stop="$u.throttle(addcart, 1500)"> {{isBuy?'立即购买':'加入购物车'}} </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
postCartAdd,
|
||||||
|
getProductDetail
|
||||||
|
} from '@/api/store.js';
|
||||||
|
import { Toast } from '../libs/uniApi';
|
||||||
|
export default {
|
||||||
|
name: "shortPopup",
|
||||||
|
props: {
|
||||||
|
source:{
|
||||||
|
type: Number,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
isBuy: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isShow: false, //当前是否打开弹窗
|
||||||
|
defualtImg: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230130/00ebcfdf75684f5494c0193075055d1.png',
|
||||||
|
datas: {
|
||||||
|
image: '',
|
||||||
|
store_name: '',
|
||||||
|
merchant: {
|
||||||
|
mer_name: ''
|
||||||
|
},
|
||||||
|
price: '',
|
||||||
|
},
|
||||||
|
product: {},
|
||||||
|
attrValue: [],
|
||||||
|
attr: [], //多级规格
|
||||||
|
changeSkuKey: '', //多级规格选中的key
|
||||||
|
sku: {}, //规格
|
||||||
|
sku_key_list: [], //规格名称列表
|
||||||
|
changeSkuKey: '', //选中的规格名称
|
||||||
|
change: {
|
||||||
|
stock: ''
|
||||||
|
},
|
||||||
|
cart_num: 1, //购买数量
|
||||||
|
goodsNum: 0, //购物车数量
|
||||||
|
current: 0, //轮播图当前滑块
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
computed:{
|
||||||
|
leftPrice(){
|
||||||
|
return this.sku[this.changeSkuKey]?.price?.split('.')[0]||'0';
|
||||||
|
},
|
||||||
|
rightPrice(){
|
||||||
|
return this.sku[this.changeSkuKey]?.price?.split('.')[1]||'00';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 注入参数,
|
||||||
|
setDatas(datas, goodsNum) {
|
||||||
|
getProductDetail(datas.product_id).then((res)=>{
|
||||||
|
this.attr = res.data.attr;
|
||||||
|
if(this.attr.length>0) this.attr.forEach((item, index)=>{
|
||||||
|
this.changeAttr(index, 0);
|
||||||
|
})
|
||||||
|
else this.changeSkuKey = '';
|
||||||
|
})
|
||||||
|
this.goodsNum = goodsNum;
|
||||||
|
this.datas = datas;
|
||||||
|
this.product = datas.product;
|
||||||
|
this.attrValue = datas.product?.attrValue;
|
||||||
|
this.change = this.attrValue[0];
|
||||||
|
this.cart_num = 1;
|
||||||
|
this.sku = datas.sku||{};
|
||||||
|
this.sku_key_list = Object.keys(this.sku);
|
||||||
|
},
|
||||||
|
// 输入购买数量
|
||||||
|
inputCartNum(e) {
|
||||||
|
if(this.sku){
|
||||||
|
if (+e.detail.value > this.sku[this.changeSkuKey].stock) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '不能超出库存哦'
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.cart_num = this.sku[this.changeSkuKey].stock;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else if (this.change.stock <= this.cart_num) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '不能超出库存哦'
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.cart_num = this.change.stock;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 减少购买数量
|
||||||
|
subCartNum() {
|
||||||
|
if (this.cart_num <= 1) {
|
||||||
|
return uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '最少要买一件哦'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.cart_num--;
|
||||||
|
},
|
||||||
|
// 增加购买数量
|
||||||
|
plusCartNum() {
|
||||||
|
return Toast('最多购买一件哦');
|
||||||
|
if(this.sku){
|
||||||
|
if (this.sku[this.changeSkuKey].stock <= this.cart_num) {
|
||||||
|
return uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '不能超出库存哦'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else if (this.change.stock <= this.cart_num) {
|
||||||
|
return uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '不能超出库存哦'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.cart_num++;
|
||||||
|
},
|
||||||
|
changeAttr: function(indexw, indexn) {
|
||||||
|
let that = this;
|
||||||
|
this.$set(this.attr[indexw], 'index', this.attr[indexw].attr_values[indexn]);
|
||||||
|
this.attr[indexw].attr_value.forEach((item, index)=>{
|
||||||
|
if(index==indexn)item.check = true;
|
||||||
|
else item.check = false;
|
||||||
|
})
|
||||||
|
let value = that.getCheckedValue().join(",");
|
||||||
|
this.changeSkuKey = value;
|
||||||
|
},
|
||||||
|
//获取被选中属性;
|
||||||
|
getCheckedValue: function() {
|
||||||
|
let productAttr = this.attr;
|
||||||
|
let value = [];
|
||||||
|
for (let i = 0; i < productAttr.length; i++) {
|
||||||
|
for (let j = 0; j < productAttr[i].attr_values.length; j++) {
|
||||||
|
if (productAttr[i].index === productAttr[i].attr_values[j]) {
|
||||||
|
value.push(productAttr[i].attr_values[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
// 加入购物车
|
||||||
|
addcart() {
|
||||||
|
if (this.sku[this.changeSkuKey]) {
|
||||||
|
if (this.cart_num > this.sku[this.changeSkuKey].stock) return uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '不能超出库存哦'
|
||||||
|
})
|
||||||
|
let data = {
|
||||||
|
cart_num: this.cart_num,
|
||||||
|
is_new: 0,
|
||||||
|
product_attr_unique: this.sku[this.changeSkuKey].unique,
|
||||||
|
product_id: this.datas.product_id,
|
||||||
|
product_type: this.datas.product_type,
|
||||||
|
source: this.source,
|
||||||
|
spread_id: "",
|
||||||
|
}
|
||||||
|
let that = this
|
||||||
|
let res = postCartAdd({
|
||||||
|
...data
|
||||||
|
}).then((res, err) => {
|
||||||
|
if(this.isBuy) return uni.navigateTo({
|
||||||
|
url: `/pages/users/order_confirm/index?cartId=${res.data.cart_id}&type_id=${this.datas.merchant.type_id}&source=${this.source}`
|
||||||
|
});
|
||||||
|
uni.showToast({
|
||||||
|
title: "加入成功",
|
||||||
|
duration: 1000,
|
||||||
|
})
|
||||||
|
this.$emit('addCart');
|
||||||
|
this.close();
|
||||||
|
if(this.isBuy){
|
||||||
|
this.navgoCart();
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err,
|
||||||
|
icon: "none",
|
||||||
|
duration: 1000,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '商品规格不存在'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 滑动轮播图
|
||||||
|
changeCurrent(e){
|
||||||
|
this.current = e.detail.current;
|
||||||
|
},
|
||||||
|
navgoCart(url=null) {
|
||||||
|
if(!url) {
|
||||||
|
if(this.source) url = '/pages/order_addcart/order_addcart?source='+this.source;
|
||||||
|
else url = '/pages/order_addcart/order_addcart';
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.$refs.popupRef.open();
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$refs.popupRef.close();
|
||||||
|
},
|
||||||
|
changeShow(e) {
|
||||||
|
this.isShow = e.show;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.pop {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.scroll{
|
||||||
|
height: calc(90vh - 150rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_end {
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.image {
|
||||||
|
height: 750rpx;
|
||||||
|
width: 750rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.current{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 70rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
width: 67rpx;
|
||||||
|
height: 37rpx;
|
||||||
|
background: rgba(#333, 0.2);
|
||||||
|
border-radius: 11rpx 11rpx 11rpx 11rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-family: PingFang SC-Regular, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close {
|
||||||
|
position: absolute;
|
||||||
|
top: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
width: 50.82rpx;
|
||||||
|
height: 50.82rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -1rpx;
|
||||||
|
left: 0;
|
||||||
|
background-color: #fff;
|
||||||
|
height: 40rpx;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 40rpx 40rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.white_card {
|
||||||
|
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
margin: 0 28rpx;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
color: #737373;
|
||||||
|
font-size: 26.29rpx;
|
||||||
|
|
||||||
|
.price {
|
||||||
|
font-size: 35rpx;
|
||||||
|
font-family: SF Pro Display-Semibold, SF Pro Display;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #F84221;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
|
||||||
|
.pro {
|
||||||
|
font-size: 49.07rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.short_name {
|
||||||
|
font-size: 33rpx;
|
||||||
|
font-family: PingFang SC-Semibold, PingFang SC;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop_name {
|
||||||
|
display: flex;
|
||||||
|
background: #FEF5F3;
|
||||||
|
padding: 0 16rpx;
|
||||||
|
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 31.54rpx;
|
||||||
|
height: 31.54rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.m_title {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: PingFang SC-Medium, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 31rpx;
|
||||||
|
margin-bottom: 21rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attr {
|
||||||
|
opacity: 1;
|
||||||
|
border: 1rpx solid #F84221;
|
||||||
|
color: #333333;
|
||||||
|
padding: 15rpx 30rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
height: 63rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
border-radius: 63rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attr_active{
|
||||||
|
// background-color: #FEF5F3;
|
||||||
|
// color: #F84221;
|
||||||
|
background-color: #F84221;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.num {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.input {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 48rpx;
|
||||||
|
|
||||||
|
.input_item {
|
||||||
|
width: 44rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 40rpx;
|
||||||
|
border: 2rpx solid #fff;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input_view {
|
||||||
|
width: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub {
|
||||||
|
border: 2rpx solid #FCB9AD;
|
||||||
|
border-radius: 7rpx 0rpx 0rpx 7rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #B3B3B3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plus {
|
||||||
|
border: 2rpx solid #FCB9AD;
|
||||||
|
border-radius: 0rpx 7rpx 7rpx 0rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #B3B3B3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
padding: 28rpx;
|
||||||
|
margin-bottom: 28rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
||||||
|
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
|
||||||
|
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
||||||
|
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
|
||||||
|
|
||||||
|
.b_icon {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 19rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #333333;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 50.82rpx;
|
||||||
|
height: 50.82rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
position: absolute;
|
||||||
|
top: -5rpx;
|
||||||
|
right: -10rpx;
|
||||||
|
color: #fff;
|
||||||
|
min-width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 24rpx;
|
||||||
|
background: #F84221;
|
||||||
|
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||||
|
border: 2rpx solid #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 575rpx;
|
||||||
|
height: 84rpx;
|
||||||
|
background: linear-gradient(270deg, #FF6D20 0%, #F84221 100%);
|
||||||
|
border-radius: 42rpx 42rpx 42rpx 42rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: PingFang SC-Medium, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -11,8 +11,8 @@ let httpApiFive
|
|||||||
let wsApi
|
let wsApi
|
||||||
|
|
||||||
// 在打包之前请检查当前环境是否正确
|
// 在打包之前请检查当前环境是否正确
|
||||||
// const env = 'dev'; // 开发
|
const env = 'dev'; // 开发
|
||||||
const env = 'prod'; // 生产
|
// const env = 'prod'; // 生产
|
||||||
// const env = 'prew'; // 预上线
|
// const env = 'prew'; // 预上线
|
||||||
|
|
||||||
switch (env) {
|
switch (env) {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
"name" : "惠农生活",
|
"name" : "惠农生活",
|
||||||
"appid" : "__UNI__3A527D1",
|
"appid" : "__UNI__3A527D1",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.7.7",
|
"versionName" : "1.7.8",
|
||||||
"versionCode" : 177,
|
"versionCode" : 178,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@ -84,7 +84,9 @@
|
|||||||
},
|
},
|
||||||
"permissionPhoneState" : {
|
"permissionPhoneState" : {
|
||||||
"request" : "none" //拨打电话权限关闭
|
"request" : "none" //拨打电话权限关闭
|
||||||
}
|
},
|
||||||
|
"targetSdkVersion" : 30,
|
||||||
|
"minSdkVersion" : 23
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios" : {
|
"ios" : {
|
||||||
|
@ -362,7 +362,7 @@ import activityCard from "@/components/activityCard.vue"
|
|||||||
},
|
},
|
||||||
//获取商品列表
|
//获取商品列表
|
||||||
list(isPage=false, id) {
|
list(isPage=false, id) {
|
||||||
// if(!id) return that.list2(true, ''); // 定位没有获取到时,直接推荐
|
if(!id||this.loadend) return this.list2(true, ''); // 定位没有获取到时,直接推荐
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.loadend&&!isPage) return;
|
if (that.loadend&&!isPage) return;
|
||||||
if (that.loading&&!isPage) return;
|
if (that.loading&&!isPage) return;
|
||||||
@ -384,7 +384,7 @@ import activityCard from "@/components/activityCard.vue"
|
|||||||
limit: that.where.limit,
|
limit: that.where.limit,
|
||||||
street_id: id,
|
street_id: id,
|
||||||
type_id: '17,10',
|
type_id: '17,10',
|
||||||
location: this.latitude + ',' + this.longitude
|
location: `${this.latitude||''},${this.longitude||''}`
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
// console.log(222)
|
// console.log(222)
|
||||||
let list = res.data.list;
|
let list = res.data.list;
|
||||||
@ -601,7 +601,7 @@ import activityCard from "@/components/activityCard.vue"
|
|||||||
this.list(true, this.street_id)
|
this.list(true, this.street_id)
|
||||||
},
|
},
|
||||||
selfLocation() {
|
selfLocation() {
|
||||||
if (uni.getStorageSync('RejectTarget')) return;
|
if (uni.getStorageSync('RejectTarget')) return this.list(true, '');
|
||||||
if (uni.getStorageSync('loction') == true) {
|
if (uni.getStorageSync('loction') == true) {
|
||||||
this.isshow = false
|
this.isshow = false
|
||||||
this.list(true, '')
|
this.list(true, '')
|
||||||
@ -688,6 +688,7 @@ import activityCard from "@/components/activityCard.vue"
|
|||||||
uni.setStorageSync("RejectTarget", true)
|
uni.setStorageSync("RejectTarget", true)
|
||||||
Toast('定位失败,请检查定位权限是否开启')
|
Toast('定位失败,请检查定位权限是否开启')
|
||||||
this.street = '定位失败'
|
this.street = '定位失败'
|
||||||
|
this.list2(true, '')
|
||||||
|
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: "获取定位超时",
|
// title: "获取定位超时",
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"></image>
|
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/back.png"></image>
|
||||||
<view class="b_body">
|
<view class="b_body">
|
||||||
<view class="b_content">
|
<view class="b_content">
|
||||||
|
<view style="padding-bottom: 16rpx;">当前活动区域为 <text style="color: #f84221;margin-left: 5rpx;" @click="changeAddress">[ {{address.townName||'未选择'}} ] , 点击切换</text></view>
|
||||||
<view v-if="item.product" v-for="(item, index) in goodsList" class="short_item" @click="clickProduct(item)">
|
<view v-if="item.product" v-for="(item, index) in goodsList" class="short_item" @click="clickProduct(item)">
|
||||||
<image class="image" :src="item.product.image"></image>
|
<image class="image" :src="item.product.image"></image>
|
||||||
<view class="short_item_right">
|
<view class="short_item_right">
|
||||||
@ -23,7 +24,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="r_btn" v-if="item.product && item.product.price">
|
<view class="r_btn" v-if="item.product && item.product.price">
|
||||||
<view>¥<text style="font-size: 33rpx;">{{ item.product.price.split('.')[0] }}.</text>{{item.product.price.split('.')[1]}} 限时特惠</view>
|
<view>¥<text style="font-size: 33rpx;">{{ item.product.price.split('.')[0] }}.</text>{{item.product.price.split('.')[1]}} 限时特惠</view>
|
||||||
<view class="qiang">抢</view>
|
<view class="qiang" :class="{'no_qiang': !can_buy}">抢</view>
|
||||||
<!-- <image src="@/static/images/icon/plus.png" style="width: 40rpx;height: 40rpx;border-radius: 40rpx;"></image> -->
|
<!-- <image src="@/static/images/icon/plus.png" style="width: 40rpx;height: 40rpx;border-radius: 40rpx;"></image> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -31,7 +32,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<shortPopup ref="shortPopupRef" @addCart="loadCart" :source="103" isBuy></shortPopup>
|
<shortPopupActive ref="shortPopupRef" @addCart="loadCart" :source="105" isBuy></shortPopupActive>
|
||||||
<u-modal :show="show" :closeOnClickOverlay="true" :title="`[${activity.title}]`"
|
<u-modal :show="show" :closeOnClickOverlay="true" :title="`[${activity.title}]`"
|
||||||
content="选择活动后只有完成活动任务后才可参加另一个活动, 确定要参与这个活动吗" cancelText="我再想想" confirmText="参加活动" confirmColor="#e54841"
|
content="选择活动后只有完成活动任务后才可参加另一个活动, 确定要参与这个活动吗" cancelText="我再想想" confirmText="参加活动" confirmColor="#e54841"
|
||||||
@cancel="show = false" @confirm="joinA()" showCancelButton></u-modal>
|
@cancel="show = false" @confirm="joinA()" showCancelButton></u-modal>
|
||||||
@ -45,7 +46,7 @@
|
|||||||
import { Toast } from "../../../libs/uniApi";
|
import { Toast } from "../../../libs/uniApi";
|
||||||
import authorize from "@/components/Authorize.vue";
|
import authorize from "@/components/Authorize.vue";
|
||||||
import { getUserInfo } from '@/api/user.js';
|
import { getUserInfo } from '@/api/user.js';
|
||||||
import shortPopup from "@/components/shortPopup.vue"
|
import shortPopupActive from "@/components/shortPopupActive.vue"
|
||||||
import { storeActivityProduct } from "@/api/activity.js"
|
import { storeActivityProduct } from "@/api/activity.js"
|
||||||
import {
|
import {
|
||||||
cloudWarehouse
|
cloudWarehouse
|
||||||
@ -57,7 +58,7 @@
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
authorize,
|
authorize,
|
||||||
shortPopup
|
shortPopupActive
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -67,12 +68,17 @@
|
|||||||
activity: {
|
activity: {
|
||||||
title: ''
|
title: ''
|
||||||
},
|
},
|
||||||
|
address: {
|
||||||
|
townName: '',
|
||||||
|
street_id: ''
|
||||||
|
},
|
||||||
show: false,
|
show: false,
|
||||||
isAuto: false, //没有授权的不会自动授权
|
isAuto: false, //没有授权的不会自动授权
|
||||||
isShowAuth: false, //是否隐藏授权
|
isShowAuth: false, //是否隐藏授权
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
street_id: '',
|
street_id: '',
|
||||||
goodsNum: 0
|
goodsNum: 0,
|
||||||
|
can_buy: 0, // 是否可以购买, 0不可以, 1可以
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@ -82,8 +88,12 @@
|
|||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
this.loadList();
|
this.loadList();
|
||||||
this.cartFn();
|
this.cartFn();
|
||||||
|
this.address = this.$store.state.storage.address;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeAddress(){
|
||||||
|
|
||||||
|
},
|
||||||
back() {
|
back() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},
|
},
|
||||||
@ -100,8 +110,10 @@
|
|||||||
storeActivityProduct({
|
storeActivityProduct({
|
||||||
street_code: this.$store.state.storage.address.street_id,
|
street_code: this.$store.state.storage.address.street_id,
|
||||||
activity_id: 2, //默认传2
|
activity_id: 2, //默认传2
|
||||||
location: location
|
location: location,
|
||||||
|
source: 105
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
this.can_buy = res.data.can_buy;
|
||||||
this.goodsList = res.data.list;
|
this.goodsList = res.data.list;
|
||||||
}).catch(e=>{
|
}).catch(e=>{
|
||||||
Toast(e.msg||e.message||e)
|
Toast(e.msg||e.message||e)
|
||||||
@ -113,6 +125,10 @@
|
|||||||
},
|
},
|
||||||
// 点击商品
|
// 点击商品
|
||||||
clickProduct(data){
|
clickProduct(data){
|
||||||
|
if(!this.address.townName) return Toast('请先选择活动区域')
|
||||||
|
if(!this.can_buy){
|
||||||
|
return Toast('活动限购一件, 您已经买过了哦~')
|
||||||
|
}
|
||||||
this.$refs.shortPopupRef.setDatas(data, this.goodsNum);
|
this.$refs.shortPopupRef.setDatas(data, this.goodsNum);
|
||||||
this.$refs.shortPopupRef.open();
|
this.$refs.shortPopupRef.open();
|
||||||
},
|
},
|
||||||
@ -123,7 +139,7 @@
|
|||||||
// 购物车信息
|
// 购物车信息
|
||||||
cartFn() {
|
cartFn() {
|
||||||
getCartCounts({
|
getCartCounts({
|
||||||
source: 103,
|
source: 105,
|
||||||
// product_type: 98
|
// product_type: 98
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.goodsNum = res.data[0].count
|
this.goodsNum = res.data[0].count
|
||||||
@ -268,6 +284,9 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
.no_qiang{
|
||||||
|
background-color: #7f7f7f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.r_street{
|
.r_street{
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user