feat: 实现分类商品、装修商品、店铺商品的加购一键登录;商品详情分类标题和描述修改;店铺底部导航被遮挡问题修复。
This commit is contained in:
parent
fe66032d7e
commit
6cab276416
@ -790,6 +790,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-drawer>
|
</uni-drawer>
|
||||||
|
|
||||||
|
<loginPopup :show="showLoginPopup" @close="closeLoginPopup"></loginPopup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -798,6 +800,7 @@ import uniDrawer from "@/components/uni-drawer.vue";
|
|||||||
import uniTag from "@/components/uni-tag/uni-tag.vue";
|
import uniTag from "@/components/uni-tag/uni-tag.vue";
|
||||||
import { mapMutations, mapState } from "vuex";
|
import { mapMutations, mapState } from "vuex";
|
||||||
import $ from "../helpers/util";
|
import $ from "../helpers/util";
|
||||||
|
import loginPopup from "@/components/loginPopup.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@ -987,12 +990,15 @@ export default {
|
|||||||
shareTitle: "",
|
shareTitle: "",
|
||||||
chatUrl: "",
|
chatUrl: "",
|
||||||
timer: null,
|
timer: null,
|
||||||
|
|
||||||
|
showLoginPopup: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
uniDrawer,
|
uniDrawer,
|
||||||
uniTag,
|
uniTag,
|
||||||
|
loginPopup,
|
||||||
},
|
},
|
||||||
computed: mapState([
|
computed: mapState([
|
||||||
"Config",
|
"Config",
|
||||||
@ -1254,6 +1260,10 @@ export default {
|
|||||||
"getUserInfo",
|
"getUserInfo",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
closeLoginPopup() {
|
||||||
|
this.showLoginPopup = false;
|
||||||
|
},
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
await this.$store.dispatch(`getCartList`, (data) => {
|
await this.$store.dispatch(`getCartList`, (data) => {
|
||||||
this.cartList = data.items;
|
this.cartList = data.items;
|
||||||
@ -1902,6 +1912,11 @@ export default {
|
|||||||
|
|
||||||
//列表购物车
|
//列表购物车
|
||||||
addCart: async function (e) {
|
addCart: async function (e) {
|
||||||
|
if (!this.hasLogin) {
|
||||||
|
this.showLoginPopup = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let index = e.currentTarget.dataset.index;
|
let index = e.currentTarget.dataset.index;
|
||||||
let step = parseInt(e.currentTarget.dataset.step);
|
let step = parseInt(e.currentTarget.dataset.step);
|
||||||
|
|||||||
@ -888,6 +888,8 @@
|
|||||||
}" v-if="item.eltmType == 103"></guess-you-like>
|
}" v-if="item.eltmType == 103"></guess-you-like>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<loginPopup :show="showLoginPopup" @close="closeLoginPopup"></loginPopup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -897,6 +899,7 @@ import diyCountdown from "../../components/themes/diy-countdown";
|
|||||||
|
|
||||||
import guessYouLike from "@/components/product-list.vue";
|
import guessYouLike from "@/components/product-list.vue";
|
||||||
import storeLists from "@/components/store-lists.vue";
|
import storeLists from "@/components/store-lists.vue";
|
||||||
|
import loginPopup from "@/components/loginPopup.vue";
|
||||||
|
|
||||||
import { mapState, mapMutations } from "vuex";
|
import { mapState, mapMutations } from "vuex";
|
||||||
import $ from "../../helpers/util";
|
import $ from "../../helpers/util";
|
||||||
@ -908,6 +911,7 @@ export default {
|
|||||||
storeLists,
|
storeLists,
|
||||||
wxParse,
|
wxParse,
|
||||||
diyCountdown,
|
diyCountdown,
|
||||||
|
loginPopup,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
BgConfig: {
|
BgConfig: {
|
||||||
@ -984,6 +988,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
w: 0, //windowWidth
|
w: 0, //windowWidth
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
showLoginPopup: false,
|
||||||
chatUrl: "",
|
chatUrl: "",
|
||||||
initX: "690",
|
initX: "690",
|
||||||
initY: "1336",
|
initY: "1336",
|
||||||
@ -1056,12 +1061,21 @@ export default {
|
|||||||
"showCartNum",
|
"showCartNum",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
closeLoginPopup() {
|
||||||
|
this.showLoginPopup = false;
|
||||||
|
},
|
||||||
|
|
||||||
getGoodsStatus (item){
|
getGoodsStatus (item){
|
||||||
return item?.product_quantity == 0 || item?.item_quantity == 0
|
return item?.product_quantity == 0 || item?.item_quantity == 0
|
||||||
},
|
},
|
||||||
|
|
||||||
async addCart(item) {
|
async addCart(item) {
|
||||||
|
|
||||||
|
if (!this.hasLogin) {
|
||||||
|
this.showLoginPopup = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (item?.product_quantity == 0 || item?.item_quantity == 0) {
|
if (item?.product_quantity == 0 || item?.item_quantity == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
|
|||||||
@ -1,135 +1,167 @@
|
|||||||
<template name="shoptheme1">
|
<template name="shoptheme1">
|
||||||
<view>
|
<view>
|
||||||
<view class="m-supermarket-ad">
|
<view class="m-supermarket-ad">
|
||||||
<view v-if="(commonTPL.AdContent.F1ProductContents.length>0)">
|
<view v-if="commonTPL.AdContent.F1ProductContents.length > 0">
|
||||||
<!-- <view class="m-supermarket-tip-list">
|
<!-- <view class="m-supermarket-tip-list">
|
||||||
<navigator :url="'/pages/product/list?is_store_flag=' + (commonTPL.isStoreFlag) + '&store_category_id=' + (item.store_product_cat_id) + '&cname=' + (item.name)"
|
<navigator :url="'/pages/product/list?is_store_flag=' + (commonTPL.isStoreFlag) + '&store_category_id=' + (item.store_product_cat_id) + '&cname=' + (item.name)"
|
||||||
v-for="(item, i) in commonTPL.smallCategory" :key="i" class="m-supermarket-tip-item">
|
v-for="(item, i) in commonTPL.smallCategory" :key="i" class="m-supermarket-tip-item">
|
||||||
<label>{{item.name}}</label>
|
<label>{{item.name}}</label>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="m-product-list m-listv">
|
<view class="m-product-list m-listv">
|
||||||
<navigator v-for="(item, i) in commonTPL.AdContent.F1ProductContents" :key="i" :url="'/pages/product/detail?is_store_flag=' + (commonTPL.isStoreFlag) + '&pid=' + (item.ProductContentID)"
|
<navigator
|
||||||
class="m-product-item">
|
v-for="(item, i) in commonTPL.AdContent.F1ProductContents"
|
||||||
<view class="m-product-img">
|
:key="i"
|
||||||
<image :src="(item.ImagePath)" mode="aspectFill" />
|
:url="
|
||||||
</view>
|
'/pages/product/detail?is_store_flag=' +
|
||||||
<view class="m-product-info">
|
commonTPL.isStoreFlag +
|
||||||
<view class="m-product-name">
|
'&pid=' +
|
||||||
<label>{{item.ProductName}}</label>
|
item.ProductContentID
|
||||||
</view>
|
"
|
||||||
<view class="m-product-price">
|
class="m-product-item"
|
||||||
<block v-if="item.item_color[0].item_sale_price">
|
>
|
||||||
<label>{{__('¥')}}</label>{{number_format(item.item_color[0].item_sale_price, 2)}}
|
<view class="m-product-img">
|
||||||
</block>
|
<image :src="item.ImagePath" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
|
<view class="m-product-info">
|
||||||
|
<view class="m-product-name">
|
||||||
|
<label>{{ item.ProductName }}</label>
|
||||||
|
</view>
|
||||||
|
<view class="m-product-price">
|
||||||
|
<block v-if="item.item_color[0].item_sale_price">
|
||||||
|
<label>{{ __("¥") }}</label
|
||||||
|
>{{ number_format(item.item_color[0].item_sale_price, 2) }}
|
||||||
|
</block>
|
||||||
|
|
||||||
<block v-if="item.product_unit_points">
|
<block v-if="item.product_unit_points">
|
||||||
<label style="margin: 0rpx 10rpx;">+</label><label style="font-size:32rpx">{{number_format(item.product_unit_points)}}</label> <label>{{__('积分')}}</label>
|
<label style="margin: 0rpx 10rpx">+</label
|
||||||
</block>
|
><label style="font-size: 32rpx">{{
|
||||||
|
number_format(item.product_unit_points)
|
||||||
|
}}</label>
|
||||||
|
<label>{{ __("积分") }}</label>
|
||||||
|
</block>
|
||||||
|
|
||||||
<block v-if="item.product_unit_sp">
|
<block v-if="item.product_unit_sp">
|
||||||
<label style="margin: 0rpx 10rpx;">+</label><label style="font-size:32rpx">{{item.product_unit_sp}}</label> <label>{{__('众宝')}}</label>
|
<label style="margin: 0rpx 10rpx">+</label
|
||||||
</block>
|
><label style="font-size: 32rpx">{{
|
||||||
<view class="btn_addcard" @click.stop="handleAddcard(item, $event)"></view>
|
item.product_unit_sp
|
||||||
</view>
|
}}</label>
|
||||||
</view>
|
<label>{{ __("众宝") }}</label>
|
||||||
</navigator>
|
</block>
|
||||||
</view>
|
<view
|
||||||
</view>
|
class="btn_addcard"
|
||||||
<view class="m-nullcontent" v-else>
|
@click.stop="handleAddcard(item, $event)"
|
||||||
<view class="m-nullpage-middle">
|
></view>
|
||||||
<label class="iconfont icon-meiyougengduo"></label>
|
</view>
|
||||||
<view class="m-null-tip">
|
</view>
|
||||||
<text>{{__('亲~什么都没有')}}</text>
|
</navigator>
|
||||||
<text>{{__('暂时没有商品哦')}}</text>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="m-nullcontent" v-else>
|
||||||
</view>
|
<view class="m-nullpage-middle">
|
||||||
</view>
|
<label class="iconfont icon-meiyougengduo"></label>
|
||||||
</view>
|
<view class="m-null-tip">
|
||||||
|
<text>{{ __("亲~什么都没有") }}</text>
|
||||||
|
<text>{{ __("暂时没有商品哦") }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<loginPopup :show="showLoginPopup" @close="closeLoginPopup"></loginPopup>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import $ from "../../helpers/util";
|
||||||
|
import loginPopup from "@/components/loginPopup.vue";
|
||||||
|
import { mapMutations, mapState } from "vuex";
|
||||||
|
|
||||||
import $ from "../../helpers/util";
|
export default {
|
||||||
|
name: "shoptheme1",
|
||||||
export default {
|
props: {
|
||||||
name: "shoptheme1",
|
commonTPL: {
|
||||||
props: {
|
type: Object,
|
||||||
commonTPL: {
|
default() {
|
||||||
type: Object,
|
return {
|
||||||
default () {
|
isStoreFlag: 1,
|
||||||
return {
|
ProductInfo: {},
|
||||||
isStoreFlag: 1,
|
addCar: false,
|
||||||
ProductInfo: {},
|
count: 0,
|
||||||
addCar: false,
|
windowHeight: 0,
|
||||||
count: 0,
|
categoryname: "",
|
||||||
windowHeight: 0,
|
click6: true,
|
||||||
categoryname: "",
|
cid: 0,
|
||||||
click6: true,
|
cartlist: {},
|
||||||
cid: 0,
|
isdata: false,
|
||||||
cartlist: {},
|
select_cart_ids: [],
|
||||||
isdata: false,
|
tapindex: 1,
|
||||||
select_cart_ids: [],
|
viewtype: 0,
|
||||||
tapindex: 1,
|
shopInfo: {},
|
||||||
viewtype: 0,
|
pdlist: [],
|
||||||
shopInfo: {},
|
sort: 2,
|
||||||
pdlist: [],
|
ispage: true,
|
||||||
sort: 2,
|
flag: true,
|
||||||
ispage: true,
|
distance: 0,
|
||||||
flag: true,
|
istop: false,
|
||||||
distance: 0,
|
TemplateKey: "",
|
||||||
istop: false,
|
smallCategory: {},
|
||||||
TemplateKey: "",
|
AdContent: {},
|
||||||
smallCategory: {},
|
post: {
|
||||||
AdContent: {},
|
store_id: 0,
|
||||||
post: {
|
orderby: 1,
|
||||||
store_id: 0,
|
sort: 2,
|
||||||
orderby: 1,
|
isnew: false,
|
||||||
sort: 2,
|
curpage: 1,
|
||||||
isnew: false,
|
},
|
||||||
curpage: 1
|
formdate: "",
|
||||||
},
|
pageId: 0,
|
||||||
formdate: "",
|
};
|
||||||
pageId: 0
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
components: {
|
||||||
},
|
loginPopup,
|
||||||
data() {
|
},
|
||||||
return {}
|
data() {
|
||||||
},
|
return {
|
||||||
created: function() {},
|
showLoginPopup: false,
|
||||||
methods: {
|
};
|
||||||
handleAddcard(data, event){
|
},
|
||||||
this.$emit('addCart', data)
|
computed: mapState(["hasLogin"]),
|
||||||
}
|
created: function () {},
|
||||||
}
|
methods: {
|
||||||
}
|
handleAddcard(data, event) {
|
||||||
|
this.$emit("addCart", data);
|
||||||
|
},
|
||||||
|
closeLoginPopup() {
|
||||||
|
this.showLoginPopup = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// @import "../../styles/_variables";
|
// @import "../../styles/_variables";
|
||||||
|
|
||||||
// @import '../../styles/layout.scss';
|
// @import '../../styles/layout.scss';
|
||||||
// @import '../../styles/store_themes.scss';
|
// @import '../../styles/store_themes.scss';
|
||||||
// @import '../../styles/store_tpl.scss';
|
// @import '../../styles/store_tpl.scss';
|
||||||
.m-product-info{
|
.m-product-info {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
.m-product-price{
|
.m-product-price {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
.btn_addcard{
|
.btn_addcard {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 20rpx;
|
right: 20rpx;
|
||||||
bottom: 8rpx;
|
bottom: 8rpx;
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
background: url(https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/static/xcxfile/appicon/pc1.png) center no-repeat;
|
background: url(https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/static/xcxfile/appicon/pc1.png)
|
||||||
background-size: cover;
|
center no-repeat;
|
||||||
|
background-size: cover;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@ -1746,16 +1746,16 @@ export default {
|
|||||||
ispage: false,
|
ispage: false,
|
||||||
|
|
||||||
shareData: {
|
shareData: {
|
||||||
shareText: "澜驰商城系统,支持原生App、微信小程序,邀请你一起体验!",
|
shareText: "同城特惠,一站式购买小发精选好物。",
|
||||||
shareTitle: "澜驰商城系统,支持原生App、微信小程序,邀请你一起体验!",
|
shareTitle: "大型综合体商城,30分钟送货到家",
|
||||||
href: "https://www.suteshop.com",
|
href: "https://gpxscs.cn/",
|
||||||
image: "",
|
image: "",
|
||||||
price: 0,
|
price: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
shareText: "澜驰商城系统,支持原生App、微信小程序,邀请你一起体验!",
|
shareText: "同城特惠,一站式购买小发精选好物。",
|
||||||
shareTitle: "澜驰商城系统,支持原生App、微信小程序,邀请你一起体验!",
|
shareTitle: "大型综合体商城,30分钟送货到家",
|
||||||
href: "https://www.suteshop.com",
|
href: "https://gpxscs.cn/",
|
||||||
image: "",
|
image: "",
|
||||||
|
|
||||||
shareBoxFlag: 0,
|
shareBoxFlag: 0,
|
||||||
|
|||||||
@ -142,7 +142,7 @@ export default {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 10;
|
z-index: 100;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
|||||||
@ -573,6 +573,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<MyTabbar :current="1" :cartNum="cartNum" :storeId="shopInfo.store_id" :categoryId="shopInfo.category_id"></MyTabbar>
|
<MyTabbar :current="1" :cartNum="cartNum" :storeId="shopInfo.store_id" :categoryId="shopInfo.category_id"></MyTabbar>
|
||||||
|
|
||||||
|
<loginPopup :show="showLoginPopup" @close="closeLoginPopup"></loginPopup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -640,6 +642,7 @@ import shoptheme6 from "../../components/themes/shoptheme6.vue";
|
|||||||
import diy from "../../components/themes/diy.vue";
|
import diy from "../../components/themes/diy.vue";
|
||||||
import uniTag from "@/components/uni-tag/uni-tag.vue";
|
import uniTag from "@/components/uni-tag/uni-tag.vue";
|
||||||
import MyTabbar from "./components/tabbar.vue";
|
import MyTabbar from "./components/tabbar.vue";
|
||||||
|
import loginPopup from "@/components/loginPopup.vue";
|
||||||
|
|
||||||
import favorite from "@/helpers/favorite";
|
import favorite from "@/helpers/favorite";
|
||||||
|
|
||||||
@ -704,7 +707,8 @@ export default {
|
|||||||
loadStoreCategoryComplete: false, // 加载店铺配置信息完成
|
loadStoreCategoryComplete: false, // 加载店铺配置信息完成
|
||||||
isRest:true,
|
isRest:true,
|
||||||
showBackTop: false,
|
showBackTop: false,
|
||||||
scrollThreshold: 600
|
scrollThreshold: 600,
|
||||||
|
showLoginPopup: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapState([
|
computed: mapState([
|
||||||
@ -728,6 +732,7 @@ export default {
|
|||||||
uniTag,
|
uniTag,
|
||||||
wxParse,
|
wxParse,
|
||||||
MyTabbar,
|
MyTabbar,
|
||||||
|
loginPopup,
|
||||||
},
|
},
|
||||||
|
|
||||||
onBackPress({ from }) {
|
onBackPress({ from }) {
|
||||||
@ -836,6 +841,10 @@ export default {
|
|||||||
"getStoreInfo",
|
"getStoreInfo",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
closeLoginPopup() {
|
||||||
|
this.showLoginPopup = false;
|
||||||
|
},
|
||||||
|
|
||||||
// 返回顶部
|
// 返回顶部
|
||||||
scrollToTop() {
|
scrollToTop() {
|
||||||
uni.pageScrollTo({
|
uni.pageScrollTo({
|
||||||
@ -863,6 +872,11 @@ export default {
|
|||||||
SKU_Id: item.item_id,
|
SKU_Id: item.item_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!this.hasLogin) {
|
||||||
|
this.showLoginPopup = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(item?.product_quantity == 0){
|
if(item?.product_quantity == 0){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user