【优化】清理小程序前端未使用文件及组件

This commit is contained in:
大灰灰
2022-09-16 00:20:47 +08:00
parent 150eaf267d
commit aa84a56fc9
10 changed files with 8 additions and 700 deletions

View File

@@ -1,14 +1,13 @@
<template>
<view class="coreshop-copyright">
<view class="coreshop-font-xs">
<!--© {{shopName}} 品牌运营-->
© 小小助农 品牌运营
© {{shopName}} 品牌运营
</view>
<!--<view class="coreshop-font-xs" v-if="shopBeiAn">
<view class="coreshop-font-xs" v-if="shopBeiAn">
<view>备案号{{shopBeiAn}}</view>
</view>-->
</view>
<view class="coreshop-font-xs">
软件技术支持怀化南山田舍科技有限公司
Powered by CoreShop
</view>
</view>
</template>

View File

@@ -1,130 +0,0 @@
<template>
<!-- 首页标题栏轮播图整合插件 -->
<view class="banner-swiper-wrap">
<!-- 标题栏 -->
<view class="u-navbar u-navbar-fixed" :style="[navbarStyle]">
<view class="u-status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<view class="u-navbar-inner" :style="[navbarInnerStyle]">
<view class="u-back-wrap">
<view class="u-icon-wrap u-back-text u-line-1 coreshop-text-white coreshop-font-20">
<u--image :showLoading="true" src="/static/images/logo/logo2.png" width="223px" height="50px"></u--image>
</view>
</view>
<view hover-class="hover-search" class="search-box coreshop-flex u-row-center u-col-center coreshop-margin-right-10" @tap="goSearch">
<u-icon name="search" color="#fff" size="24"></u-icon>
</view>
</view>
</view>
</view>
</template>
<script>
// 获取系统状态栏的高度
let systemInfo = uni.getSystemInfoSync();
let menuButtonInfo = {};
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
// #endif
/**
* home-head-轮播卡片,主要为了处理数据
* @property {Array} list 轮播图数据,
* @property {String} mode 指示器模式
*/
export default {
components: {},
data() {
return {
navBgImage: '',
changeNavBackground: false,
swiperCur: 0,
statusBarHeight: systemInfo.statusBarHeight
};
},
props: {
coreshopdata: {
// type: Object,
required: true,
},
isScorll: {
type: Boolean,
default: false
}
},
watch: {
isScorll(newValue, oldValue) {
this.changeNavBackground = newValue;
this.navBgImage = this.coreshopdata.parameters.list[this.swiperCur].image;
}
},
computed: {
// 导航栏内部盒子的样式
navbarInnerStyle() {
let style = {};
style.height = this.navbarHeight + 'px';
// #ifdef MP
let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
style.marginRight = rightButtonWidth + 'px';
// #endif
return style;
},
// 整个导航栏的样式
navbarStyle() {
let style = {};
style.zIndex = this.$u.zIndex.navbar;
style.background = this.changeNavBackground ? `url(${this.navBgImage}) no-repeat top / 100% auto` : 'none';
Object.assign(style, this.background);
return style;
},
navbarHeight() {
// #ifdef APP-PLUS || H5
return 44;
// #endif
// #ifdef MP
return systemInfo.platform == 'ios' ? 44 : 48;
// #endif
}
},
created() {
this.navBgImage = this.coreshopdata.parameters.list[0].image;
},
methods: {
onSwiper(e) {
var item = this.coreshopdata.parameters.list[e];
if (item) {
this.showSliderInfo(item.linkType, item.linkValue);
}
},
onChange(e) {
this.swiperCur = e.detail.current;
}
}
};
</script>
<style lang="scss" scoped>
@mixin vue-flex($direction: row) { /* #ifndef APP-NVUE */ display: flex; flex-direction: $direction; /* #endif */ }
// 轮播
.banner-swiper-wrap { height: 260px; position: relative; z-index: 100;
.search-box { width: 25px; height: 25px; background: rgba(#000, 0.18); border-radius: 100%; justify-content: center; }
.hover-search { background: rgba(#fff, 0.18); }
}
.u-navbar { width: 100%; }
.u-navbar-fixed { position: fixed; left: 0; right: 0; top: 0; z-index: 991; }
.u-status-bar { width: 100%; }
.u-navbar-inner {
@include vue-flex;
justify-content: space-between;
position: relative;
align-items: center;
}
.u-back-wrap {
@include vue-flex;
align-items: center;
flex: 1;
flex-grow: 0;
padding: 0px 7px 7px 5px;
}
</style>

View File

@@ -1,326 +0,0 @@
<template>
<view class="coreshop-header-slot-wrap coreshop-justify-center" :style="[navbarStyle]">
<view class="coreshop-slot-btns coreshop-flex coreshop-flex-nowrap coreshop-self-start" :style="{
background: backgroundColor,
borderColor :leftIconColor
}">
<u-icon name="home-fill" :color="leftIconColor" :size="leftIconSize" @tap="isGoBack" v-if="showHomeIcon && showLeftOneBtn"></u-icon>
<u-icon name="arrow-left-double" :color="leftIconColor" :size="leftIconSize" @tap="isGoBack" v-if="!showHomeIcon && showLeftOneBtn"></u-icon>
<view class="coreshop-slot-cut-off" :style="{
borderLeftColor: leftIconColor,
}" v-if="showLeftOneBtn"></view>
<u-icon name="list-dot" color="#fff" :color="leftIconColor" size="18" @click="doShowPopup"></u-icon>
</view>
<view class="coreshop-text-white coreshop-font-32 coreshop-header-title">
<view class="u-title u-line-1"
:style="{
color: titleColor,
fontSize: titleSize + 'px',
fontWeight: titleBold ? 'bold' : 'normal'
}">
{{ title }}
</view>
</view>
<view v-show="isShowPopup" class="coreshop-mark">
<u-overlay :show="isShowPopup" @click="maskClick"></u-overlay>
<view class="poptip">
<view class="poptip-arrow poptip-arrow-top"><em></em><i></i></view>
<!--增值业务-->
<view class="coreshop-padding-5 coreshop-bg-white coreshop-margin-top-10 coreshop-user-info-tools-box">
<view class="coreshop-padding-10 tools-view">
<view class="coreshop-text-black coreshop-text-bold coreshop-font-lg tools-title">增值业务</view>
</view>
<view class="coreshop-tools-list-box">
<u-grid :col="4" :border="false">
<u-grid-item v-for="(item,i) in vas" :key="i" v-if="item.showItem" @click="goRoute(item.router)">
<u-icon :name="item.icon" :size="25" color="#666"></u-icon>
<view class="grid-text">{{ item.name }}</view>
</u-grid-item>
</u-grid>
</view>
</view>
<!--我的服务-->
<view class="coreshop-padding-5 coreshop-bg-white coreshop-margin-top-10 coreshop-user-info-tools-box">
<view class="coreshop-padding-10 tools-view">
<view class="coreshop-text-black coreshop-text-bold coreshop-font-lg tools-title">我的服务</view>
</view>
<view class="coreshop-tools-list-box">
<u-grid :col="4" :border="false">
<u-grid-item v-for="(item,i) in utilityMenus" :key="i" @click="navigateToHandle(item.router)">
<u-icon :name="item.icon" :size="25" color="#666"></u-icon>
<view class="grid-text">{{ item.name }}</view>
</u-grid-item>
</u-grid>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { mapMutations, mapActions, mapState } from 'vuex';
export default {
name: "coreshop-navbar-slot",
props: {
// 左侧按钮组背景颜色
backgroundColor: {
type: String,
default: '#fff'
},
// 左侧按钮组边框颜色
borderColor: {
type: String,
default: '#fff'
},
// 是否显示第一个按钮
showLeftOneBtn: {
type: Boolean,
default: true
},
// 返回箭头的颜色
leftIconColor: {
type: String,
default: '#fff'
},
// 左边返回的图标
leftIconName: {
type: String,
default: 'nav-back'
},
// 左边返回图标的大小px
leftIconSize: {
type: [String, Number],
default: '22'
},
// 导航栏标题
title: {
type: String,
default: ''
},
// 标题的宽度如果需要自定义右侧内容且右侧内容很多时可能需要减少这个宽度单位px
titleWidth: {
type: [String, Number],
default: '125'
},
// 标题的颜色
titleColor: {
type: String,
default: '#606266'
},
// 标题字体是否加粗
titleBold: {
type: Boolean,
default: false
},
// 标题的字体大小
titleSize: {
type: [String, Number],
default: 16
},
// 对象形式,因为用户可能定义一个纯色,或者线性渐变的颜色
background: {
type: Object,
default() {
return {
}
}
}
},
data() {
return {
isShowPopup: false,
showHomeIcon: false,
utilityMenus: {
myCoupon: {
name: '我的优惠券',
icon: 'coupon',
router: '/pages/member/coupon/index',
showItem: true
},
myBalance: {
name: '我的余额',
icon: 'rmb-circle',
router: '/pages/member/balance/index/index',
showItem: true
},
myInvoice: {
name: '我的发票',
icon: 'calendar',
router: '/pages/member/invoice/index',
showItem: true
},
myServices: {
name: '我的服务卡',
icon: 'bell',
router: '/pages/member/serviceOrder/index/index',
showItem: true
},
myIntegral: {
name: '我的积分',
icon: 'integral',
router: '/pages/member/integral/index',
showItem: true
},
myAddress: {
name: '地址管理',
icon: 'map',
router: '/pages/member/address/list/list',
showItem: true
},
myCollection: {
name: '我的收藏',
icon: 'bookmark',
router: '/pages/member/collection/index',
showItem: true
},
myHistory: {
name: '我的足迹',
icon: 'bag',
router: '/pages/member/history/index',
showItem: true
},
},
vas: {
storeMap: {
name: '门店列表',
icon: 'home',
router: '/pages/storeMap/storeMap',
showItem: false
},
servicePackage: {
name: '服务商品',
icon: 'list-dot',
router: '/pages/serviceGoods/index/index',
showItem: true
},
coupons: {
name: '优惠券',
icon: 'red-packet',
router: '/pages/coupon/coupon',
showItem: true
},
pinTuan: {
name: '拼团',
icon: 'grid',
router: '/pages/activity/pinTuan/list/list',
showItem: true
},
seckill: {
name: '秒杀',
icon: 'clock',
router: '/pages/activity/seckill/list/list',
showItem: true
},
groupBuying: {
name: '团购',
icon: 'trash',
router: '/pages/activity/groupBuying/list/list',
showItem: true
},
solitaire: {
name: '接龙',
icon: 'bag',
router: '/pages/activity/solitaire/list/list',
showItem: true
},
},
};
},
computed: {
...mapState({
hasLogin: state => state.hasLogin,
userInfo: state => state.userInfo,
}),
hasLogin: {
get() {
return this.$store.state.hasLogin;
},
set(val) {
this.$store.commit('hasLogin', val);
}
},
// 整个导航栏的样式
navbarStyle() {
let style = {};
// 合并用户传递的背景色对象
Object.assign(style, this.background);
return style;
},
},
mounted() {
let pages = getCurrentPages();
var page = pages[pages.length - 2];
console.log(page);
if (!page) {
this.showHomeIcon = true;
}
console.log(this.showHomeIcon);
},
methods: {
navigateToHandle(pageUrl) {
this.isShowPopup = false;
uni.showLoading({
title: '跳转中...'
});
if (!this.hasLogin) {
this.$store.commit('showLoginTip', true);
uni.hideLoading();
return false;
}
uni.hideLoading();
this.$u.route(pageUrl)
},
isGoBack() {
this.isShowPopup = false;
if (this.showHomeIcon) {
uni.switchTab({
url: '/pages/index/default/default'
});
} else {
uni.navigateBack();
}
},
doShowPopup() {
this.isShowPopup = true;
},
// 遮罩被点击
maskClick() {
this.isShowPopup = false;
},
}
};
</script>
<style scoped lang="scss">
.coreshop-mark { position: fixed; top: 90px; left: 0; right: 0; z-index: 10074; width: 100%;
.poptip { position: absolute; top: 0px; left: 0px; line-height: 16px; color: #db7c22; font-size: 12px; background: #fff; border: solid 1px #ffbb76; border-radius: 10px; box-shadow: 0 0 3px #ddd; margin: 0 10px; width: calc(100% - 20px); padding: 10px; z-index: 10072; }
.poptip-arrow { position: absolute; overflow: hidden; font-style: normal; font-family: simsun; font-size: 12px; text-shadow: 0 0 2px #ccc;
em { color: #ffbb76; }
i { color: #fffcef; text-shadow: none; }
}
.poptip-arrow em, .poptip-arrow i { position: absolute; left: 0; top: 0; font-style: normal; }
.poptip-arrow-top { height: 12px; width: 22px; left: 66px; margin-left: -12px; }
.poptip-arrow-bottom { height: 6px; width: 12px; left: 12px; margin-left: -6px; }
.poptip-arrow-left, .poptip-arrow-right { height: 12px; width: 6px; top: 12px; margin-top: -6px; }
.poptip-arrow-top { top: -8px;
em { top: -1px; }
i { top: 0px; }
}
.poptip-arrow-bottom { bottom: -6px;
em { top: -8px; }
i { top: -9px; }
}
.poptip-arrow-left { left: -6px;
em { left: 1px; }
i { left: 2px; }
}
.poptip-arrow-right { right: -6px;
em { left: -6px; }
i { left: -7px; }
}
}
</style>

View File

@@ -1,67 +0,0 @@
<template>
<view class="coreshop-padding-bottom-10">
<view class="select-item" v-for="(item, index) in specList" :key="index">
<view class="coreshop-text-black coreshop-margin-10 coreshop-solid-bottom coreshop-padding-bottom-10">{{ index }}</view>
<view class="select-btn">
<button class="sku-btn coreshop-margin-5 coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between" :class="spes.cla" v-for="(spes, key) in item" :key="key" @click="specChangeSpes(index, key)">
<u-avatar :src="spes.image" size="25" class="coreshop-margin-right-10 coreshop-margin-top-10" style="margin-left: -10px;"></u-avatar>
{{ spes.name }}
</button>
</view>
</view>
</view>
</template>
<script>
export default {
name: "spec",
data() {
return {
specList: {}
}
},
props: {
// 默认picker选中项索引
spesData: {
required: true
}
},
created() {
// #ifdef H5 || APP-PLUS
this.specList = JSON.parse(this.spesData);
// #endif
},
watch: {
spesData: function (val) {
console.log('watch');
let d = JSON.parse(val);
this.specList = d;
}
},
methods: {
specChangeSpes(v, k) {
let newData = {
v: v,
k: k
}
this.$emit("changeSpes", newData);
},
changeSpecData() {
this.specList = {};
}
}
}
</script>
<style scoped lang="scss">
.selected { border: 1px solid #ff0000; background-color: #fff5f6; color: #ff0000; }
.not-selected { border: 1px solid #ccc; }
.none { border: 1px dashed #ccc; color: #888; display: none; }
.select-item { padding: 10px 0; border-bottom: 1px solid #f3f3f3;
.select-btn { position: relative; margin-top: 8px; width: 100%; overflow: auto;
.sku-btn { font-size: 12px; border-radius: 5px; float: left; padding: 0 5px;
.u-avatar { top: 5px; }
}
.sku-btn.light { border: 0.5px dashed; }
.sku-btn[disabled] { color: #aaaaaa; }
}
}
</style>

View File

@@ -1,52 +0,0 @@
<template>
<view class="coreshop-bg-white">
<u-swiper :list="swiperItems" :height="swiperHeight" :interval="swiperDuration" keyName="image" @click="taped" circular radius="0"></u-swiper>
</view>
</template>
<script>
export default {
name: "coreshopimgSlide",
props: {
coreshopdata: {
// type: Object,
required: true,
}
},
data() {
return {
swiperItems: [],
swiperHeight: 130,
swiperDuration: 2500,
};
},
computed: {
count() {
return (this.coreshopdata.parameters.list.length > 0)
}
},
components: {},
created() {
var data = this.coreshopdata.parameters.list;
for (var i = 0; i < data.length; i++) {
let moder = {
image: data[i].image == '/images/empty-banner.png' ? '/static/images/common/empty-banner.png' : data[i].image,
opentype: 'click',
url: '',
title: data[i].linkType,
linkType: data[i].linkType,
linkValue: data[i].linkValue,
}
this.swiperItems.push(moder);
}
this.swiperHeight = this.coreshopdata.parameters.height;
this.swiperDuration = this.coreshopdata.parameters.duration;
},
watch: {},
methods: {
taped: function (e) {
this.showSliderInfo(this.swiperItems[e].linkType, this.swiperItems[e].linkValue);
},
}
}
</script>

View File

@@ -1,110 +0,0 @@
<template>
<view>
<block v-for="(item,index) in coreshopdata" :key="index">
<!--搜索修复-->
<coreshopsearch :coreshopdata="item" v-if="item.widgetCode=='search' "></coreshopsearch>
<!--切换-->
<coreshoptabbar :coreshopdata="item" v-if="item.widgetCode=='tabBar' "></coreshoptabbar>
<!--公告修复-->
<coreshopnotice :coreshopdata="item" v-if="item.widgetCode=='notice' "></coreshopnotice>
<!--图片轮播修复-->
<coreshopimgSlide :coreshopdata="item" v-if="item.widgetCode=='imgSlide' "></coreshopimgSlide>
<!--优惠券修复-->
<coreshopcoupon :coreshopdata="item" v-if="item.widgetCode=='coupon' "></coreshopcoupon>
<!--空格修复-->
<coreshopblank :coreshopdata="item" v-if="item.widgetCode=='blank' "></coreshopblank>
<!--多行文本输入区修复-->
<coreshoptextarea :coreshopdata="item" v-if="item.widgetCode=='textarea' "></coreshoptextarea>
<!--视频修复-->
<coreshopvideo :coreshopdata="item" v-if="item.widgetCode=='video' "></coreshopvideo>
<!--图片集修复-->
<coreshopimgWindow :coreshopdata="item" v-if="item.widgetCode=='imgWindow' "></coreshopimgWindow>
<!--图片--修复-->
<coreshopimgSingle :coreshopdata="item" v-if="item.widgetCode=='imgSingle' "></coreshopimgSingle>
<!--商品修复-->
<coreshopgoods :coreshopdata="item" v-if="item.widgetCode=='goods' "></coreshopgoods>
<!--商品选项卡修复-->
<coreshopgoodTabBar :coreshopdata="item" v-if="item.widgetCode=='goodTabBar' "></coreshopgoodTabBar>
<!--文章修复-->
<coreshoparticle :coreshopdata="item" v-if="item.widgetCode=='article' "></coreshoparticle>
<!--文章分类修复-->
<coreshoparticleClassify :coreshopdata="item" v-if="item.widgetCode=='articleClassify' "></coreshoparticleClassify>
<!--宫格自定义导航修复-->
<coreshopnavBar :coreshopdata="item" v-if="item.widgetCode=='navBar' "></coreshopnavBar>
<!--团购修复-->
<coreshopgroupPurchase :coreshopdata="item" v-if="item.widgetCode=='groupPurchase' "></coreshopgroupPurchase>
<!--浏览记录修复-->
<coreshoprecord :coreshopdata="item" v-if="item.widgetCode=='record' "></coreshoprecord>
<!--拼团修复-->
<coreshoppinTuan :coreshopdata="item" v-if="item.widgetCode=='pinTuan' "></coreshoppinTuan>
<!--服务修复-->
<coreshopservice :coreshopdata="item" v-if="item.widgetCode=='service' "></coreshopservice>
<!--弹窗广告-->
<coreshopadpop :coreshopdata="item" v-if="item.widgetCode=='adpop' "></coreshopadpop>
<!--文本内容修复-->
<coreshopContent :coreshopdata="item" v-if="item.widgetCode=='content' "></coreshopContent>
</block>
</view>
</template>
<script>
import coreshopimgSlide from '@/components/nsts-page/coreshop-imgSlide.vue'
import coreshopsearch from '@/components/coreshop-page/coreshop-search.vue'
import coreshopnotice from '@/components/coreshop-page/coreshop-notice.vue'
import coreshopcoupon from '@/components/coreshop-page/coreshop-coupon.vue'
import coreshopblank from '@/components/coreshop-page/coreshop-blank.vue'
import coreshoptextarea from '@/components/coreshop-page/coreshop-textarea.vue'
import coreshopvideo from '@/components/coreshop-page/coreshop-video.vue'
import coreshopimgWindow from '@/components/coreshop-page/coreshop-imgWindow.vue'
import coreshopimgSingle from '@/components/coreshop-page/coreshop-imgSingle.vue'
import coreshopgoods from '@/components/coreshop-page/coreshop-goods.vue'
import coreshopgoodTabBar from '@/components/coreshop-page/coreshop-goodTabBar.vue'
import coreshoparticle from '@/components/coreshop-page/coreshop-article.vue'
import coreshoparticleClassify from '@/components/coreshop-page/coreshop-articleClassify.vue'
import coreshopnavBar from '@/components/coreshop-page/coreshop-navBar.vue'
import coreshopgroupPurchase from '@/components/coreshop-page/coreshop-groupPurchase.vue'
import coreshoprecord from '@/components/coreshop-page/coreshop-record.vue'
import coreshoppinTuan from '@/components/coreshop-page/coreshop-pinTuan.vue'
import coreshopservice from '@/components/coreshop-page/coreshop-service.vue'
import coreshoptabbar from '@/components/coreshop-page/coreshop-tabbar.vue'
import coreshopadpop from '@/components/coreshop-page/coreshop-adpop.vue'
import coreshopContent from '@/components/coreshop-page/coreshop-content.vue'
export default {
name: 'nsts-page',
components: {
coreshopimgSlide,
coreshopsearch,
coreshopnotice,
coreshopcoupon,
coreshopblank,
coreshoptextarea,
coreshopvideo,
coreshopimgWindow,
coreshopimgSingle,
coreshopgoods,
coreshopgoodTabBar,
coreshoparticle,
coreshoparticleClassify,
coreshopnavBar,
coreshopgroupPurchase,
coreshoprecord,
coreshoppinTuan,
coreshopservice,
coreshoptabbar,
coreshopadpop,
coreshopContent
},
props: {
coreshopdata: {
default: function () {
return []
}
},
isScorll: {
type: Boolean,
default: true
}
}
}
</script>

View File

@@ -6,7 +6,7 @@
<!--无网络组件-->
<u-no-network></u-no-network>
<!--头部组件-->
<u-navbar :is-back="false" :title="appTitle" :background="background" :title-color="titleColor" :custom-back="about" safeAreaInsetTop fixed placeholder @leftClick="goNavigateBack"></u-navbar>
<u-navbar leftIcon="search" :title="appTitle" safeAreaInsetTop fixed placeholder @leftClick="goSearch"></u-navbar>
<!--首页模块化组合组件-->
<coreshop-page :coreshopdata="pageData"></coreshop-page>
<!--版权组件-->

View File

@@ -8,7 +8,7 @@
<!--头部组件-->
<u-navbar leftIcon="search" :title="appTitle" safeAreaInsetTop fixed placeholder @leftClick="goSearch"></u-navbar>
<!--首页模块化组合组件-->
<nsts-page :coreshopdata="pageData" :isScorll="isScorll"></nsts-page>
<coreshop-page :coreshopdata="pageData"></coreshop-page>
<!--版权组件-->
<coreshop-copyright v-if="copy"></coreshop-copyright>
<!--客服组件-->

View File

@@ -355,7 +355,7 @@
showItem: true
},
calendar: {
name: '日历签到',
name: '签到',
icon: 'calendar',
router: '/pages/activity/checkIn/checkIn/checkIn',
showItem: true
@@ -394,15 +394,9 @@
hasLogin: state => state.hasLogin,
userInfo: state => state.userInfo,
}),
shopMobile() {
return this.$store.state.config.shopMobile || 0;
},
InvoiceSwitch() {
return this.$store.state.config.invoiceSwitch || 2;
},
StoreSwitch() {
return this.$store.state.config.storeSwitch || 0;
},
hasLogin: {
get() {
return this.$store.state.hasLogin;

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB