1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605 |
- <template>
- <view v-if="pageShow" class="page"
- :class="bgTabVal==2?'fullsize noRepeat':bgTabVal==1?'repeat ysize':'noRepeat ysize'"
- :style="'background-color:'+bgColor+';background-image: url('+bgPic+');min-height:'+windowHeight+'px;'">
- <view v-if="!errorNetwork" :style="colorStyle">
- <skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
- bgcolor="#FFF"></skeleton>
- <view class="index skeleton" :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
- <!-- #ifdef H5 -->
- <view v-for="(item, index) in styleConfig" :key="index">
- <component :is="item.name" :index="index" :dataConfig="item" @changeBarg="changeBarg"
- @changeTab="changeTab" :tempArr="tempArr" :iSshowH="iSshowH" @detail="goDetail"
- :isSortType="isSortType" @bindSortId="bindSortId" @bindHeight="bindHeight" :isFixed="isFixed">
- </component>
- </view>
- <!-- #endif -->
-
- <!-- #ifdef MP || APP-PLUS -->
- <block v-for="(item, index) in styleConfig" :key="index">
- <!-- <activeParty v-if="item.name == 'activeParty'" :dataConfig="item" :isSortType="isSortType">
- </activeParty> -->
- <!-- <articleList v-if="item.name == 'articleList'" :dataConfig="item" :isSortType="isSortType">
- </articleList> -->
- <!-- <bargain v-if="item.name == 'bargain'" :dataConfig="item" @changeBarg="changeBarg"
- :isSortType="isSortType"></bargain> -->
- <!-- <blankPage v-if="item.name == 'blankPage'" :dataConfig="item" :isSortType="isSortType"></blankPage> -->
- <!-- <combination v-if="item.name == 'combination'" :dataConfig="item" :isSortType="isSortType">
- </combination> -->
- <!-- <coupon v-if="item.name == 'coupon'" :dataConfig="item" :isSortType="isSortType"></coupon> -->
- <!-- <customerService v-if="item.name == 'customerService'" :dataConfig="item" :isSortType="isSortType">
- </customerService> -->
- <!-- <goodList v-if="item.name == 'goodList'" :dataConfig="item" @detail="goDetail"
- :isSortType="isSortType"></goodList> -->
- <!-- <guide v-if="item.name == 'guide'" :dataConfig="item" :isSortType="isSortType"></guide> -->
- <headerSerch v-if="item.name == 'headerSerch'" :dataConfig="item"></headerSerch>
- <!-- <liveBroadcast v-if="item.name == 'liveBroadcast'" :dataConfig="item" :isSortType="isSortType">
- </liveBroadcast> -->
- <menus v-if="item.name == 'menus'" :dataConfig="item" :isSortType="isSortType"></menus>
- <news v-if="item.name == 'news'" :dataConfig="item" :isSortType="isSortType"></news>
- <!-- <pictureCube v-if="item.name == 'pictureCube'" :dataConfig="item" :isSortType="isSortType">
- </pictureCube> -->
- <promotionList v-if="item.name == 'promotionList'" :dataConfig="item" @changeTab="changeTab"
- :tempArr="tempArr" :iSshowH="iSshowH" @detail="goDetail" :isSortType="isSortType">
- </promotionList>
- <!-- <richText v-if="item.name == 'richText'" :dataConfig="item" :isSortType="isSortType"></richText> -->
- <!-- <seckill v-if="item.name == 'seckill'" :dataConfig="item" :isSortType="isSortType"></seckill> -->
- <swiperBg v-if="item.name == 'swiperBg'" :dataConfig="item" :isSortType="isSortType"></swiperBg>
- <!-- <swipers v-if="item.name == 'swipers'" :dataConfig="item" :isSortType="isSortType"></swipers> -->
- <tabNav v-if="item.name == 'tabNav'" :dataConfig="item" @bindHeight="bindHeighta"
- @bindSortId="bindSortId" :isFixed="isFixed"></tabNav>
- <!-- <titles v-if="item.name == 'titles'" :dataConfig="item" :isSortType="isSortType"></titles> -->
- </block>
- <!-- #endif -->
- <!-- 分类商品模块 -->
- <!-- #ifdef APP-PLUS -->
- <view class="sort-product" v-if="isSortType == 1" style="margin-top: 0;">
- <scroll-view scroll-x="true" style="background: #fff;">
- <view class="sort-box" v-if="sortList.children && sortList.children.length">
- <view class="sort-item" v-for="(item, index) in sortList.children" :key="index"
- @click="changeSort(item, index)" :class="{ on: curSort == index }">
- <image :src="item.pic" mode="" v-if="item.pic"></image>
- <image src="/static/images/sort-img.png" mode="" v-else></image>
- <view class="txt">{{ item.cate_name }}</view>
- </view>
- </view>
- </scroll-view>
- <view class="product-list" v-if="goodList.length">
- <view class="product-item" v-for="(item, index) in goodList" @click="goGoodsDetail(item)">
- <image :src="item.image"></image>
- <span class="pictrue_log_big pictrue_log_class"
- v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
- <span class="pictrue_log_big pictrue_log_class"
- v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
- <span class="pictrue_log_big pictrue_log_class"
- v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
- <view class="info">
- <view class="title line1">{{ item.store_name }}</view>
- <view class="price-box">
- <text>{{$t(`¥`)}}</text>
- {{ item.price }}
- </view>
- </view>
- </view>
- </view>
- <Loading :loaded="loaded" :loading="loading"></Loading>
- <view class="" v-if="goodList.length == 0 && loaded">
- <view class="emptyBox">
- <image :src="imgHost + '/statics/images/no-thing.png'"></image>
- <view class="tips">{{$t(`暂无商品,去看点别的吧`)}}</view>
- </view>
- <recommend :hostProduct="hostProduct"></recommend>
- </view>
- </view>
- <!-- #endif -->
- <!-- #ifndef APP-PLUS -->
- <view class="sort-product" v-if="isSortType == 1" :style="{ marginTop: sortMpTop + 'px' }">
- <scroll-view scroll-x="true" style="background: #fff;">
- <view class="sort-box" v-if="sortList.children && sortList.children.length">
- <view class="sort-item" v-for="(item, index) in sortList.children" :key="index"
- @click="changeSort(item, index)" :class="{ on: curSort == index }">
- <image :src="item.pic" mode="" v-if="item.pic"></image>
- <image src="/static/images/sort-img.png" mode="" v-else></image>
- <view class="txt">{{ item.cate_name }}</view>
- </view>
- </view>
- </scroll-view>
- <view class="product-list" v-if="goodList.length">
- <view class="product-item" v-for="(item, index) in goodList" @click="goGoodsDetail(item)">
- <image :src="item.image"></image>
- <span class="pictrue_log_big pictrue_log_class"
- v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
- <span class="pictrue_log_big pictrue_log_class"
- v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
- <span class="pictrue_log_big pictrue_log_class"
- v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
- <span class="pictrue_log_big pictrue_log_class" v-if="item.checkCoupon">{{$t(`券`)}}</span>
- <view class="info">
- <view class="title line2">{{ item.store_name }}</view>
- <view class="price-box">
- <text>{{$t(`¥`)}}</text>
- {{ item.price }}
- </view>
- </view>
- </view>
- </view>
- <Loading :loaded="loaded" :loading="loading"></Loading>
- <view class="" v-if="goodList.length == 0 && loaded">
- <view class="emptyBox">
- <image :src="imgHost + '/statics/images/no-thing.png'"></image>
- <view class="tips">{{$t(`暂无数据`)}}</view>
- </view>
- <recommend :hostProduct="hostProduct"></recommend>
- </view>
- </view>
- <!-- #endif -->
- <!-- <view class="loadingicon acea-row row-center-wrapper" v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
- <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
- {{ loadTitle }}
- </view> -->
- <!-- #ifdef MP -->
- <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" :isGoIndex="false"></authorize> -->
- <!-- #endif -->
- <couponWindow :window="isCouponShow" @onColse="couponClose" :couponImage="couponObj.image"
- :couponList="couponObj.list"></couponWindow>
- <view class="uni-p-b-98" v-if="footerStatus"></view>
- <view v-if="site_config" class="site-config" @click="goICP">{{ site_config }}</view>
- <!-- <pageFooter v-if="footerStatus"></pageFooter> -->
- <view class="foot" v-if="newData.status && newData.status.status">
- <view class="page-footer" id="target" :style="{'background-color':newData.bgColor.color[0].item}">
- <view class="foot-item" v-for="(item,index) in newData.menuList" :key="index"
- @click="goRouter(item)">
- <block v-if="item.link == activeRouter">
- <image :src="item.imgList[0]"></image>
- <view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">
- {{$t(item.name)}}
- </view>
- </block>
- <block v-else>
- <image :src="item.imgList[1]"></image>
- <view class="txt" :style="{color:newData.txtColor.color[0].item}">{{$t(item.name)}}
- </view>
- </block>
- <div class="count-num"
- v-if="item.link === '/pages/order_addcart/order_addcart' && countNum > 0">
- {{countNum}}
- </div>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view v-else>
- <view class="error-network">
- <image :src="imgHost + '/statics/images/error-network.png'"></image>
- <view class="title">{{$t(`网络连接断开`)}}</view>
- <view class="con">
- <view class="label">{{$t(`请检查情况:`)}}:</view>
- <view class="item">· {{$t(`在设置中是否已开启网络权限:`)}}</view>
- <view class="item">· {{$t(`当前是否处于弱网环境`)}}</view>
- <view class="item">· {{$t(`版本是否过低,升级试试吧`)}}</view>
- </view>
- <view class="btn" @click="reconnect">{{$t(`重新连接`)}}</view>
- </view>
- </view>
- <!-- #ifdef APP-PLUS -->
- <app-update v-if="!privacyStatus" ref="appUpdate" :force="true" :tabbar="false"></app-update>
- <view class="privacy-wrapper" v-if="privacyStatus">
- <view class="privacy-box">
- <view class="title">{{$t(`服务协议与隐私政策`)}}</view>
- <view class="content">
- {{$t(`请务必审慎阅读、充分理解“服务协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志等个
- 人信息。你可以在“设置”中查看、变更、删除个人信息并管理你的授权。`)}}<br>
- {{$t(`你可以阅读`)}}<navigator url="/pages/users/privacy/index?type=3">{{$t(`《服务协议与隐私政策》`)}}</navigator>
- {{$t(`了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。`)}}
- </view>
- <view class="btn-box">
- <view class="btn-item" @click="confirmApp">{{$t(`我同意`)}}</view>
- <view class="btn" @click="closeModel">{{$t(`残忍拒绝`)}}</view>
- </view>
- </view>
- </view>
- <!-- #endif -->
- </view>
- </template>
- <script>
- const app = getApp();
- import colors from "@/mixins/color";
- import couponWindow from '@/components/couponWindow/index';
- import {
- getCouponV2,
- getCouponNewUser,
- siteConfig
- } from '@/api/api.js';
- import {
- getNavigation
- } from '@/api/public.js';
- // #ifdef H5
- import mConfig from './components/index.js';
- // #endif
- // #ifdef MP || APP-PLUS
- import authorize from '@/components/Authorize';
- import activeParty from './components/activeParty';
- import headerSerch from './components/headerSerch';
- import swipers from './components/swipers';
- import coupon from './components/coupon';
- import articleList from './components/articleList';
- import bargain from './components/bargain';
- import blankPage from './components/blankPage';
- import combination from './components/combination';
- import customerService from './components/customerService';
- import goodList from './components/goodList';
- import guide from './components/guide';
- import liveBroadcast from './components/liveBroadcast';
- import menus from './components/menus';
- import news from './components/news';
- import pictureCube from './components/pictureCube';
- import promotionList from './components/promotionList';
- import richText from './components/richText';
- import seckill from './components/seckill';
- import swiperBg from './components/swiperBg';
- import tabNav from './components/tabNav';
- import titles from './components/titles';
- import appUpdate from "@/components/update/app-update.vue";
- import {
- getTempIds
- } from '@/api/api.js';
- import {
- SUBSCRIBE_MESSAGE,
- TIPS_KEY
- } from '@/config/cache';
- // #endif
- import {
- mapGetters
- } from 'vuex';
- import {
- getDiy,
- getIndexData
- } from '@/api/api.js';
- import {
- getGroomList,
- getCategoryList,
- getProductslist,
- getProductHot
- } from '@/api/store.js';
- import {
- goShopDetail
- } from '@/libs/order.js';
- import {
- getCartCounts,
- } from '@/api/order.js';
- import {
- toLogin
- } from '@/libs/login.js';
- import { HTTP_REQUEST_URL } from '@/config/app';
- import pageFooter from '@/components/pageFooter/index.vue';
- import Loading from '@/components/Loading/index.vue';
- import recommend from '@/components/recommend';
- export default {
- computed: mapGetters(['isLogin', 'uid']),
- mixins: [colors],
- components: {
- recommend,
- Loading,
- pageFooter,
- couponWindow,
- // #ifdef H5
- ...mConfig,
- // #endif
- // #ifdef MP || APP-PLUS
- authorize,
- activeParty,
- headerSerch,
- swipers,
- coupon,
- articleList,
- bargain,
- blankPage,
- combination,
- customerService,
- goodList,
- guide,
- liveBroadcast,
- menus,
- pictureCube,
- news,
- promotionList,
- richText,
- seckill,
- swiperBg,
- tabNav,
- titles,
- appUpdate, //APP更新
- // #endif
- },
- computed: mapGetters(['isLogin', 'cartNum']),
- data() {
- return {
- imgHost: HTTP_REQUEST_URL,
- showSkeleton: true, //骨架屏显示隐藏
- isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
- styleConfig: [],
- tempArr: [],
- goodType: 3,
- loading: false,
- loadend: false,
- loadTitle: this.$t(`下拉加载更多`), //提示语
- page: 1,
- limit: this.$config.LIMIT,
- iSshowH: false,
- numConfig: 0,
- code: '',
- isCouponShow: false,
- couponObj: {},
- couponObjs: {
- show: false
- },
- shareInfo: {},
- footConfig: {},
- isSortType: 0,
- sortList: '',
- sortAll: [],
- goodPage: 1,
- goodList: [],
- newData: {},
- sid: 0,
- curSort: 0,
- sortMpTop: 0,
- loaded: false,
- loading: false,
- hostProduct: [],
- hotScroll: false,
- hotPage: 1,
- hotLimit: 10,
- domOffsetTop: 50,
- // #ifdef APP-PLUS || MP
- isFixed: true,
- // #endif
- // #ifdef H5
- isFixed: false,
- // #endif
- site_config: '',
- errorNetwork: false, // 是否断网
- privacyStatus: false, // 隐私政策是否同意过
- footerStatus: false,
- isHeaderSerch: false,
- bgColor: '',
- bgPic: '',
- bgTabVal: '',
- pageShow: true,
- windowHeight: 0,
- activeRouter: '',
- countNum: 0
- };
- },
- onPullDownRefresh() {
- this.diyData();
- },
- created(options) {
- let that = this
- this.$nextTick(function () {
- uni.getSystemInfo({
- success: function (res) {
- that.windowHeight = res.windowHeight;
- }
- });
- })
- getNavigation().then(res => {
- this.newData = res.data
- if (this.newData.status && this.newData.status.status) {
- uni.hideTabBar()
- } else {
- uni.showTabBar()
- }
- })
- let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
- let curRoute = routes[routes.length - 1].route //获取当前页面路由
- this.activeRouter = '/' + curRoute
- // #ifdef APP-PLUS
- uni.setStorageSync("privacyStatus", true);
- // try {
- // let val = uni.getStorageSync('privacyStatus') || false
- // if (!val) {
- // this.privacyStatus = true
- // }
- // } catch (e) {}
- // #endif
- this.diyData();
- this.getIndexData();
- // #ifdef MP
- this.getTempIds();
- // #endif
- // #ifndef APP-PLUS
- siteConfig().then(res => {
- this.site_config = res.data.record_No
- }).catch(err => {
- console.error(err.msg);
- });
- // #endif
- // 优惠券弹窗
- // var newDates = new Date().toLocaleDateString();
- if (this.isLogin) {
- this.getCoupon();
- getCartCounts().then(res => {
- this.countNum = res.data.count
- this.$store.commit('indexData/setCartNum', res.data.count > 99 ? '..' : res.data.count +
- '')
- if (res.data.count > 0) {
- wx.setTabBarBadge({
- index: Number(uni.getStorageSync('FOOTER_ADDCART')) || 2,
- text: res.data.count + ''
- })
- } else {
- wx.hideTabBarRedDot({
- index: Number(uni.getStorageSync('FOOTER_ADDCART')) || 2
- })
- }
- });
- }
- },
- // onReady() {
- // let that = this
- // uni.getSystemInfo({
- // success: function(res) { // res - 各种参数
- // let info = uni.createSelectorQuery().select(".hander"); // 获取某个元素
- // info.boundingClientRect(function(data) { //data - 各种参数
- // let view = res.windowHeight - data.height
- // that.heightHome = view
- // }).exec()
- // }
- // });
- // },
- watch: {
- isLogin: {
- deep: true, //深度监听设置为 true
- handler: function (newV, oldV) {
- // 优惠券弹窗
- var newDates = new Date().toLocaleDateString();
- if (newV) {
- try {
- var oldDate = uni.getStorageSync('oldDate') || '';
- } catch { }
- if (oldDate != newDates) {
- this.getCoupon();
- }
- }
- }
- }
- },
- onReady() { },
- methods: {
- // #ifdef APP-PLUS
- // 同意隐私协议
- confirmApp() {
- uni.setStorageSync('privacyStatus', true)
- this.privacyStatus = false
- },
- // 关闭Model
- closeModel() {
- //退出app
- uni.getSystemInfo({
- success: function (res) { // 判断为安卓的手机
- if (res.platform == 'android') { // 安卓退出app
- plus.runtime.quit();
- } else { // 判断为ios的手机,退出App
- plus.ios.import("UIApplication").sharedApplication().performSelector("exit");
- }
- }
- })
- },
- // #endif
- // 重新链接
- reconnect() {
- uni.showLoading({
- title: this.$t(`加载中`)
- })
- this.diyData();
- this.getIndexData();
- getShare().then(res => {
- this.shareInfo = res.data;
- });
- },
- goICP() {
- // #ifdef H5
- window.open('http://beian.miit.gov.cn/');
- // #endif
- // #ifdef MP
- uni.navigateTo({
- url: `/pages/annex/web_view/index?url=https://beian.miit.gov.cn/`
- });
- // #endif
- },
- bindHeighta(data) {
- // #ifdef APP-PLUS
- this.sortMpTop = data.top + data.height;
- // #endif
- },
- bindHeight(data) {
- uni.hideLoading();
- this.domOffsetTop = data.top;
- },
- // 去商品详情
- goGoodsDetail(item) {
- goShopDetail(item, this.uid).then(res => {
- uni.navigateTo({
- url: `/pages/goods_details/index?id=${item.id}`
- });
- });
- },
- /**
- * 获取我的推荐
- */
- get_host_product: function () {
- let that = this;
- if (that.hotScroll) return;
- getProductHot(that.hotPage, that.hotLimit).then(res => {
- that.hotPage++;
- that.hotScroll = res.data.length < that.hotLimit;
- that.hostProduct = that.hostProduct.concat(res.data);
- // that.$set(that, 'hostProduct', res.data)
- });
- },
- // 分类点击
- changeSort(item, index) {
- if (this.curSort == index) return;
- this.curSort = index;
- this.sid = item.id;
- this.goodList = [];
- this.goodPage = 1;
- this.loaded = false;
- this.getGoodsList();
- },
- // 获取分类id
- bindSortId(data) {
- this.isSortType = data == -99 ? 0 : 1;
- this.getProductList(data);
- if (this.hostProduct.length == 0) {
- this.get_host_product();
- }
- },
- getProductList(data) {
- let tempObj = '';
- this.curSort = 0;
- this.loaded = false;
- if (this.sortAll.length > 0) {
- this.sortAll.forEach((el, index) => {
- if (el.id == data) {
- this.$set(this, 'sortList', el);
- this.sid = el.children.length ? el.children[0].id : '';
- }
- });
- this.goodList = [];
- this.goodPage = 1;
- this.$nextTick(() => {
- if (this.sortList != '') this.getGoodsList();
- });
- } else {
- getCategoryList().then(res => {
- this.sortAll = res.data;
- res.data.forEach((el, index) => {
- if (el.id == data) {
- this.sortList = el;
- this.sid = el.children.length ? el.children[0].id : '';
- }
- });
- this.goodList = [];
- this.goodPage = 1;
- this.$nextTick(() => {
- if (this.sortList != '') this.getGoodsList();
- });
- });
- }
- },
- getGoodsList() {
- if (this.loading || this.loaded) return;
- this.loading = true;
- getProductslist({
- sid: this.sid,
- keyword: '',
- priceOrder: '',
- salesOrder: '',
- news: 0,
- page: this.goodPage,
- limit: 10,
- cid: this.sortList.id
- }).then(res => {
- this.loading = false;
- this.loaded = res.data.length < 10;
- this.goodPage++;
- this.goodList = this.goodList.concat(res.data);
- });
- },
- // 新用户优惠券
- getNewCoupon() {
- const oldUser = uni.getStorageSync('oldUser') || 0;
- if (!oldUser) {
- getCouponNewUser().then(res => {
- const {
- data
- } = res;
- if (data.show) {
- if (data.list.length) {
- this.isCouponShow = true;
- this.couponObj = data;
- uni.setStorageSync('oldUser', 1);
- }
- } else {
- uni.setStorageSync('oldUser', 1);
- }
- });
- }
- },
- // 优惠券弹窗
- getCoupon() {
- const tagDate = uni.getStorageSync('tagDate') || '',
- nowDate = new Date().toLocaleDateString();
- if (tagDate === nowDate) {
- this.getNewCoupon();
- } else {
- getCouponV2().then(res => {
- const {
- data
- } = res;
- if (data.list.length) {
- this.isCouponShow = true;
- this.couponObj = data;
- uni.setStorageSync('tagDate', new Date().toLocaleDateString());
- } else {
- this.getNewCoupon();
- }
- });
- }
- },
- // 优惠券弹窗关闭
- couponClose() {
- this.isCouponShow = false;
- if (!uni.getStorageSync('oldUser')) {
- this.getNewCoupon();
- }
- },
- onLoadFun() { },
- // #ifdef H5
- // 获取url后面的参数
- getQueryString(name) {
- var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
- var reg_rewrite = new RegExp('(^|/)' + name + '/([^/]*)(/|$)', 'i');
- var r = window.location.search.substr(1).match(reg);
- var q = window.location.pathname.substr(1).match(reg_rewrite);
- if (r != null) {
- return unescape(r[2]);
- } else if (q != null) {
- return unescape(q[2]);
- } else {
- return null;
- }
- },
- // #endif
- // #ifdef MP
- getTempIds() {
- let messageTmplIds = wx.getStorageSync(SUBSCRIBE_MESSAGE);
- if (!messageTmplIds) {
- getTempIds().then(res => {
- if (res.data) wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
- });
- }
- },
- // #endif
- // 对象转数组
- objToArr(data) {
- let obj = Object.keys(data);
- let m = obj.map(key => data[key]);
- return m;
- },
- diyData() {
- let that = this;
- let value = {
- "1666235374470000": {
- "name": "headerSerch",
- "timestamp": "1666235374470000",
- "setUp": {
- "tabVal": 0
- },
- "bgColor": {
- "title": "背景颜色(渐变)",
- "name": "bgColor",
- "default": [
- {
- "item": "#F62C2C"
- },
- {
- "item": "#F96E29"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- },
- {
- "item": "rgba(64,209,244,1)"
- }
- ]
- },
- "boxStyle": {
- "title": "边框样式",
- "name": "boxStyle",
- "type": 0,
- "list": [
- {
- "val": "圆角",
- "icon": "iconPic_fillet"
- },
- {
- "val": "直角",
- "icon": "iconPic_square"
- }
- ]
- },
- "txtStyle": {
- "title": "文本位置",
- "name": "txtStyle",
- "type": 1,
- "list": [
- {
- "val": "居左",
- "icon": "icondoc_left"
- },
- {
- "val": "居中",
- "icon": "icondoc_center"
- }
- ]
- },
- "prConfig": {
- "title": "背景边距",
- "val": 8,
- "min": 0
- },
- "mbConfig": {
- "title": "页面间距",
- "val": 0,
- "min": 0
- },
- "hotWords": {
- "list": [
- {
- "val": ""
- }
- ]
- },
- "logoConfig": {
- "type": 1,
- "header": "设置logo",
- "title": "",
- "url": "https://demo26.crmeb.net/uploads/attach/2022/10/20221009/7436ee5680bc5d67c46a6017939475e5.png"
- },
- "id": "id1665385357481000"
- },
- "1666235374470001": {
- "name": "swiperBg",
- "timestamp": "1666235374470001",
- "setUp": {
- "tabVal": 1
- },
- "swiperConfig": {
- "title": "最多可添加10张图片,建议宽度750px;鼠标拖拽左侧圆点可调整图片 顺序",
- "maxList": 10,
- "list": [
- {
- "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220928/8903e1c331b95263270d1bf558315eea.jpg",
- "info": [
- {
- "title": "标题",
- "value": "电商社交",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/goods_cate/goods_cate",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/10/78c7c20211011171437256.png",
- "info": [
- {
- "title": "标题",
- "value": "今日推荐",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/extension/customer_list/chat",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/10/ce66b202110111714168104.png",
- "info": [
- {
- "title": "标题",
- "value": "超值爆款",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/users/user_sgin/index",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- }
- ]
- },
- "isShow": {
- "title": "是否显示背景色",
- "val": false
- },
- "bgColor": {
- "title": "背景颜色(渐变)",
- "default": [
- {
- "item": "#F62C2C"
- },
- {
- "item": "#F96E29"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- },
- {
- "item": "rgba(64,209,244,1)"
- }
- ]
- },
- "dotColor": {
- "title": "指示器颜色",
- "default": [
- {
- "item": "#fff"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- }
- ]
- },
- "lrConfig": {
- "title": "左右边距",
- "val": 11,
- "min": 0
- },
- "mbConfig": {
- "title": "页面间距",
- "val": 10,
- "min": 0
- },
- "docConfig": {
- "cname": "swiper",
- "title": "指示器样式",
- "type": 0,
- "list": [
- {
- "val": "圆形",
- "icon": "iconDot"
- },
- {
- "val": "直线",
- "icon": "iconSquarepoint"
- },
- {
- "val": "数字",
- "icon": "iconshuzi"
- },
- {
- "val": "无指示器",
- "icon": "iconjinyong"
- }
- ]
- },
- "txtStyle": {
- "title": "指示器位置",
- "type": 2,
- "list": [
- {
- "val": "居左",
- "icon": "icondoc_left"
- },
- {
- "val": "居中",
- "icon": "icondoc_center"
- },
- {
- "val": "居右",
- "icon": "icondoc_right"
- }
- ]
- },
- "imgConfig": {
- "cname": "docStyle",
- "title": "轮播图样式",
- "type": 0,
- "list": [
- {
- "val": "圆角",
- "icon": "iconPic_fillet"
- },
- {
- "val": "直角",
- "icon": "iconPic_square"
- }
- ]
- },
- "id": "id1665385357481001"
- },
- "1666235374470002": {
- "name": "news",
- "timestamp": "1666235374470002",
- "setUp": {
- "tabVal": 1
- },
- "txtStyle": {
- "title": "文本位置",
- "name": "txtStyle",
- "type": 0,
- "list": [
- {
- "val": "居左",
- "icon": "icondoc_left",
- "style": "left"
- },
- {
- "val": "居中",
- "icon": "icondoc_center",
- "style": "center"
- },
- {
- "val": "居右",
- "icon": "icondoc_right",
- "style": "right"
- }
- ]
- },
- "bgColor": {
- "title": "背景颜色",
- "default": [
- {
- "item": "#fff"
- }
- ],
- "color": [
- {
- "item": "#fff"
- }
- ]
- },
- "txtColor": {
- "title": "文字颜色",
- "default": [
- {
- "item": "#333"
- }
- ],
- "color": [
- {
- "item": "#333"
- }
- ]
- },
- "listConfig": {
- "title": "最多可添加10个版块;鼠标拖拽左侧圆点可调整版块顺序",
- "max": 10,
- "list": [
- {
- "chiild": [
- {
- "title": "标题",
- "val": "标准版4.5正式发布,大家快来体验",
- "max": 30,
- "pla": "选填,不超过30个字",
- "empty": true
- },
- {
- "title": "链接",
- "val": "/pages/extension/news_details/index?id=128",
- "max": 200,
- "pla": "请输入连接"
- }
- ]
- }
- ],
- "tabCur": 0
- },
- "bgStyle": {
- "title": "背景样式",
- "name": "bgStyle",
- "type": 1,
- "list": [
- {
- "val": "直角",
- "icon": "iconPic_square"
- },
- {
- "val": "圆角",
- "icon": "iconPic_fillet"
- }
- ]
- },
- "prConfig": {
- "title": "背景边距",
- "val": 10,
- "min": 0
- },
- "mbConfig": {
- "title": "页面间距",
- "val": 10,
- "min": 0
- },
- "logoConfig": {
- "header": "图标设置",
- "title": "最多可添加1张图片,建议宽度130 * 36px",
- "url": "https://qiniu.crmeb.net/attach/2021/11/6d4fe202111181229083421.png"
- },
- "id": "id1665385357481002"
- },
- "1666235374470003": {
- "name": "menus",
- "timestamp": "1666235374470003",
- "setUp": {
- "tabVal": 0
- },
- "tabConfig": {
- "title": "展示样式",
- "tabVal": 1,
- "type": 1,
- "tabList": [
- {
- "name": "单行展示",
- "icon": "icondanhang"
- },
- {
- "name": "多行展示",
- "icon": "iconduohang"
- }
- ]
- },
- "rowsNum": {
- "title": "显示行数",
- "name": "rowsNum",
- "type": 0,
- "list": [
- {
- "val": "2行",
- "icon": "icon2hang"
- },
- {
- "val": "3行",
- "icon": "icon3hang"
- },
- {
- "val": "4行",
- "icon": "icon4hang"
- }
- ]
- },
- "menuStyle": {
- "title": "图标样式",
- "name": "menuStyle",
- "type": 1,
- "list": [
- {
- "val": "方形",
- "icon": "iconPic_square"
- },
- {
- "val": "圆形",
- "icon": "icondayuanjiao"
- }
- ]
- },
- "number": {
- "title": "显示个数",
- "name": "number",
- "type": 2,
- "list": [
- {
- "val": "3个",
- "icon": "icon3ge"
- },
- {
- "val": "4个",
- "icon": "icon4ge1"
- },
- {
- "val": "5个",
- "icon": "icon5ge1"
- }
- ]
- },
- "pointerStyle": {
- "title": "指示器样式",
- "name": "pointerStyle",
- "type": 2,
- "list": [
- {
- "val": "长条",
- "icon": "iconSquarepoint"
- },
- {
- "val": "圆形",
- "icon": "iconDot"
- },
- {
- "val": "无指示器",
- "icon": "iconjinyong"
- }
- ]
- },
- "bgStyle": {
- "title": "背景样式",
- "name": "bgStyle",
- "type": 1,
- "list": [
- {
- "val": "直角",
- "icon": "iconPic_square"
- },
- {
- "val": "圆角",
- "icon": "iconPic_fillet"
- }
- ]
- },
- "prConfig": {
- "title": "背景边距",
- "val": 10,
- "min": 0
- },
- "menuConfig": {
- "title": "最多可添加1张图片,建议宽度90 * 90px",
- "maxList": 100,
- "list": [
- {
- "img": "https://qiniu.crmeb.net/attach/2021/09/02d9e202109101106364468.png",
- "info": [
- {
- "title": "标题",
- "value": "预约自提",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/goods_details/index?id=109",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/09/4a21a202109101106368349.png",
- "info": [
- {
- "title": "标题",
- "value": "领优惠券",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/users/user_get_coupon/index",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220916/d09d2286f960697ab7e1fb9d2595605f.png",
- "info": [
- {
- "title": "标题",
- "value": "特价限购",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/goods_details/index?id=116",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/09/9d74b20210910110637104.png",
- "info": [
- {
- "title": "标题",
- "value": "新闻资讯",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/extension/news_list/index",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/09/1c95120210910110636424.png",
- "info": [
- {
- "title": "标题",
- "value": "助力砍价",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/activity/goods_bargain/index",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/09/23332202109101106361126.png",
- "info": [
- {
- "title": "标题",
- "value": "限时秒杀",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/activity/goods_seckill/index",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/09/34f81202109101106357549.png",
- "info": [
- {
- "title": "标题",
- "value": "积分商城",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/points_mall/index",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220916/06c63d52fc6772917540d47076606680.png",
- "info": [
- {
- "title": "标题",
- "value": "成团返佣",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/activity/goods_combination_details/index?id=23",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220916/e31cdcb6fa7660aee45912ef572cc114.png",
- "info": [
- {
- "title": "标题",
- "value": "用户足迹",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/users/visit_list/index",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- },
- {
- "img": "https://qiniu.crmeb.net/attach/2021/09/f4598202109101106358762.png",
- "info": [
- {
- "title": "标题",
- "value": "幸运转盘",
- "tips": "选填,不超过4个字",
- "max": 4
- },
- {
- "title": "链接",
- "value": "/pages/goods/lottery/grids/index?type=1",
- "tips": "请输入链接",
- "max": 100
- }
- ]
- }
- ]
- },
- "pointerColor": {
- "title": "指示器颜色",
- "name": "pointerColor",
- "default": [
- {
- "item": "#f44"
- }
- ],
- "color": [
- {
- "item": "#f44"
- }
- ]
- },
- "bgColor": {
- "title": "背景颜色",
- "name": "bgColor",
- "default": [
- {
- "item": "#fff"
- }
- ],
- "color": [
- {
- "item": "#fff"
- }
- ]
- },
- "titleColor": {
- "title": "文字颜色",
- "name": "themeColor",
- "default": [
- {
- "item": "#333333"
- }
- ],
- "color": [
- {
- "item": "rgba(51,51,51,1)"
- }
- ]
- },
- "mbConfig": {
- "title": "页面间距",
- "val": 12,
- "min": 0
- },
- "id": "id1665385357481003"
- },
- "1666235374470005": {
- "name": "combination",
- "timestamp": "1666235374470005",
- "setUp": {
- "tabVal": 1
- },
- "numConfig": {
- "val": 3
- },
- "priceShow": {
- "title": "是否显示价格",
- "val": true
- },
- "bntShow": {
- "title": "是否显示按钮",
- "val": true
- },
- "titleShow": {
- "title": "是否显示名称",
- "val": true
- },
- "pinkShow": {
- "title": "是否显示拼团标签",
- "val": true
- },
- "joinShow": {
- "title": "是否显示参团标签",
- "val": true
- },
- "txtColor": {
- "title": "文字背景色",
- "name": "themeColor",
- "default": [
- {
- "item": "rgba(255,68,68,0.1)"
- }
- ],
- "color": [
- {
- "item": "rgba(208,240,255,1)"
- }
- ]
- },
- "conStyle": {
- "title": "背景样式",
- "name": "conStyle",
- "type": 1,
- "list": [
- {
- "val": "直角",
- "icon": "iconPic_square"
- },
- {
- "val": "圆角",
- "icon": "iconPic_fillet"
- }
- ]
- },
- "bgColor": {
- "title": "背景颜色",
- "name": "themeColor",
- "default": [
- {
- "item": "#fff"
- }
- ],
- "color": [
- {
- "item": "#fff"
- }
- ]
- },
- "prConfig": {
- "title": "背景边距",
- "val": 10,
- "min": 0
- },
- "themeColor": {
- "title": "主题风格",
- "name": "themeColor",
- "default": [
- {
- "item": "#E93323"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- }
- ]
- },
- "mbConfig": {
- "title": "页面间距",
- "val": 12,
- "min": 0
- },
- "lrConfig": {
- "title": "左右边距",
- "val": 10,
- "min": 0
- },
- "imgConfig": {
- "title": "最多可添加1张图片,建议宽度18 * 18px",
- "url": "https://qiniu.crmeb.net/attach/2021/11/238c5202111181433515309.gif"
- },
- "id": "id1665385357481005"
- },
- "1666235374470006": {
- "name": "bargain",
- "timestamp": "1666235374470006",
- "setUp": {
- "tabVal": 1
- },
- "numConfig": {
- "val": 3
- },
- "priceShow": {
- "title": "是否显示价格",
- "val": true
- },
- "bntShow": {
- "title": "是否显示按钮",
- "val": true
- },
- "themeColor": {
- "title": "主题风格",
- "name": "themeColor",
- "default": [
- {
- "item": "#E93323"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- }
- ]
- },
- "titleColor": {
- "title": "标题颜色",
- "name": "txtColor",
- "default": [
- {
- "item": "#FF6000"
- }
- ],
- "color": [
- {
- "item": "rgba(255,152,0,1)"
- }
- ]
- },
- "bgColor": {
- "title": "背景颜色",
- "name": "bgColor",
- "default": [
- {
- "item": "#FDDBB2"
- },
- {
- "item": "#FDEFC6"
- }
- ],
- "color": [
- {
- "item": "#FDDBB2"
- },
- {
- "item": "#FDEFC6"
- }
- ]
- },
- "bgStyle": {
- "title": "背景样式",
- "name": "bgStyle",
- "type": 1,
- "list": [
- {
- "val": "直角",
- "icon": "iconPic_square"
- },
- {
- "val": "圆角",
- "icon": "iconPic_fillet"
- }
- ]
- },
- "prConfig": {
- "title": "背景边距",
- "val": 10,
- "min": 0
- },
- "productGap": {
- "title": "商品间距",
- "val": 10,
- "min": 0
- },
- "mbCongfig": {
- "title": "页面间距",
- "val": 0,
- "min": 0
- },
- "id": "id1665385357481006"
- },
- "1666235374470007": {
- "name": "seckill",
- "timestamp": "1666235374470007",
- "setUp": {
- "tabVal": 1
- },
- "countDownColor": {
- "title": "倒计时背景色",
- "name": "countDownColor",
- "default": [
- {
- "item": "rgba(252,60,62,0.09)"
- }
- ],
- "color": [
- {
- "item": "rgba(255,255,255,0.09)"
- }
- ]
- },
- "themeColor": {
- "title": "主题风格",
- "name": "themeColor",
- "default": [
- {
- "item": "#E93323"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,255,1)"
- }
- ]
- },
- "conStyle": {
- "title": "背景样式",
- "name": "conStyle",
- "type": 1,
- "list": [
- {
- "val": "直角",
- "icon": "iconPic_square"
- },
- {
- "val": "圆角",
- "icon": "iconPic_fillet"
- }
- ]
- },
- "bgColor": {
- "title": "背景颜色",
- "name": "themeColor",
- "default": [
- {
- "item": "#fff"
- }
- ],
- "color": [
- {
- "item": "#fff"
- }
- ]
- },
- "prConfig": {
- "title": "背景边距",
- "val": 10,
- "min": 0
- },
- "priceShow": {
- "title": "是否显示价格",
- "val": true
- },
- "discountShow": {
- "title": "是否显示折扣标签",
- "val": true
- },
- "titleShow": {
- "title": "是否显示名称",
- "val": true
- },
- "seckillShow": {
- "title": "抢购标签",
- "val": true
- },
- "numberConfig": {
- "val": 3
- },
- "lrConfig": {
- "title": "左右边距",
- "val": 10,
- "min": 0
- },
- "mbConfig": {
- "title": "页面间距",
- "val": 0,
- "min": 0
- },
- "imgConfig": {
- "title": "最多可添加1张图片,建议宽度18 * 18px",
- "url": "https://demo26.crmeb.net/uploads/attach/2022/09/20220930/e537a7fc631006d3571d7a8574438b03.gif"
- },
- "id": "id1665385357481007"
- },
- "1666235374470009": {
- "name": "promotionList",
- "timestamp": "1666235374470009",
- "setUp": {
- "tabVal": 1
- },
- "productList": {
- "title": "促销列表"
- },
- "titleConfig": {
- "title": "标题位置",
- "type": 2,
- "list": [
- {
- "val": "居左",
- "icon": "icondoc_left"
- },
- {
- "val": "居中",
- "icon": "icondoc_center"
- },
- {
- "val": "居右",
- "icon": "icondoc_right"
- }
- ]
- },
- "titleShow": {
- "title": "是否显示商品名称",
- "val": true
- },
- "opriceShow": {
- "title": "是否显示商品原价",
- "val": true
- },
- "priceShow": {
- "title": "是否显示商品价格",
- "val": true
- },
- "couponShow": {
- "title": "是否显示优惠券",
- "val": true
- },
- "tabConfig": {
- "title": "最多可添加4个版块;鼠标拖拽左侧圆点可调整版块顺序",
- "max": 4,
- "tabCur": 3,
- "list": [
- {
- "chiild": [
- {
- "title": "标题",
- "val": "首发新品",
- "max": 4,
- "pla": "选填,不超过四个字"
- },
- {
- "title": "简介",
- "val": "最新出炉",
- "max": 4,
- "pla": "选填,不超过四个字"
- }
- ],
- "link": {
- "title": "链接",
- "activeVal": 3,
- "optiops": [
- {
- "type": 0,
- "value": 1,
- "label": "精品推荐"
- },
- {
- "type": 1,
- "value": 2,
- "label": "热门榜单"
- },
- {
- "type": 2,
- "value": 3,
- "label": "首发新品"
- },
- {
- "type": 3,
- "value": 4,
- "label": "促销单品"
- }
- ]
- }
- },
- {
- "chiild": [
- {
- "title": "标题",
- "val": "精品推荐",
- "max": 4,
- "pla": "选填,不超过四个字"
- },
- {
- "title": "简介",
- "val": "猜你喜欢",
- "max": 4,
- "pla": "选填,不超过四个字"
- }
- ],
- "link": {
- "title": "链接",
- "activeVal": 1,
- "optiops": [
- {
- "type": 0,
- "value": 1,
- "label": "精品推荐"
- },
- {
- "type": 1,
- "value": 2,
- "label": "热门榜单"
- },
- {
- "type": 2,
- "value": 3,
- "label": "首发新品"
- },
- {
- "type": 3,
- "value": 4,
- "label": "促销单品"
- }
- ]
- }
- },
- {
- "chiild": [
- {
- "title": "标题",
- "val": "热门榜单",
- "max": 4,
- "pla": "选填,不超过四个字"
- },
- {
- "title": "简介",
- "val": "好评如云",
- "max": 4,
- "pla": "选填,不超过四个字"
- }
- ],
- "link": {
- "title": "链接",
- "activeVal": 2,
- "optiops": [
- {
- "type": 0,
- "value": 1,
- "label": "精品推荐"
- },
- {
- "type": 1,
- "value": 2,
- "label": "热门榜单"
- },
- {
- "type": 2,
- "value": 3,
- "label": "首发新品"
- },
- {
- "type": 3,
- "value": 4,
- "label": "促销单品"
- }
- ]
- }
- },
- {
- "chiild": [
- {
- "title": "标题",
- "val": "促销单品",
- "max": 4,
- "pla": "选填,不超过四个字"
- },
- {
- "title": "简介",
- "val": "多买多销",
- "max": 4,
- "pla": "选填,不超过四个字"
- }
- ],
- "link": {
- "title": "链接",
- "activeVal": 4,
- "optiops": [
- {
- "type": 0,
- "value": 1,
- "label": "精品推荐"
- },
- {
- "type": 1,
- "value": 2,
- "label": "热门榜单"
- },
- {
- "type": 2,
- "value": 3,
- "label": "首发新品"
- },
- {
- "type": 3,
- "value": 4,
- "label": "促销单品"
- }
- ]
- }
- }
- ]
- },
- "themeColor": {
- "title": "主题风格",
- "name": "themeColor",
- "default": [
- {
- "item": "#F95429"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- }
- ]
- },
- "fontColor": {
- "title": "价格颜色",
- "name": "fontColor",
- "default": [
- {
- "item": "#e93323"
- }
- ],
- "color": [
- {
- "item": "rgba(253,80,47,1)"
- }
- ]
- },
- "labelColor": {
- "title": "活动标签",
- "name": "labelColor",
- "default": [
- {
- "item": "#e93323"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- }
- ]
- },
- "mbConfig": {
- "title": "页面间距",
- "val": 0,
- "min": 0
- },
- "numConfig": {
- "val": 9
- },
- "id": "id1665385357481008"
- },
- "1666235390875000": {
- "name": "pageFoot",
- "setUp": {
- "tabVal": 0
- },
- "status": {
- "title": "是否自定义",
- "name": "status",
- "status": true
- },
- "txtColor": {
- "title": "文字颜色",
- "name": "txtColor",
- "default": [
- {
- "item": "#282828"
- }
- ],
- "color": [
- {
- "item": "rgba(51,51,51,1)"
- }
- ]
- },
- "activeTxtColor": {
- "title": "选中文字颜色",
- "name": "txtColor",
- "default": [
- {
- "item": "#F62C2C"
- }
- ],
- "color": [
- {
- "item": "rgba(29,176,252,1)"
- }
- ]
- },
- "bgColor": {
- "title": "背景颜色",
- "name": "bgColor",
- "default": [
- {
- "item": "#fff"
- }
- ],
- "color": [
- {
- "item": "#fff"
- }
- ]
- },
- "menuList": [
- {
- "imgList": [
- "https://qiniu.crmeb.net/attach/2021/11/bdf25202111181452426458.png",
- "https://qiniu.crmeb.net/attach/2021/11/aaf1b202111181452576658.png"
- ],
- "name": "首页",
- "link": "/pages/index/index"
- },
- {
- "imgList": [
- "https://demo26.crmeb.net/uploads/attach/2022/09/20220923/14367a2fecd502f51978ed6ea09afe19.png",
- "https://qiniu.crmeb.net/attach/2021/11/59d4a202111181453208678.png"
- ],
- "name": "分类",
- "link": "/pages/goods_cate/goods_cate"
- },
- {
- "imgList": [
- "https://qiniu.crmeb.net/attach/2021/11/076ac202111181453294517.png",
- "https://qiniu.crmeb.net/attach/2021/11/201c9202111181453378599.png"
- ],
- "name": "购物车",
- "link": "/pages/order_addcart/order_addcart"
- },
- {
- "imgList": [
- "https://qiniu.crmeb.net/attach/2021/11/f04cf20211118145343755.png",
- "https://qiniu.crmeb.net/attach/2021/11/3a141202111181453495771.png"
- ],
- "name": "我的",
- "link": "/pages/user/index"
- }
- ],
- "id": "idundefined"
- }
- }
- getDiy(0).then(res => {
- setTimeout(() => {
- this.isNodes++;
- }, 0);
- this.errorNetwork = false
- let data = res.data;
- if (data.is_bg_color) {
- this.bgColor = data.color_picker
- }
- if (data.is_bg_pic) {
- this.bgPic = data.bg_pic
- this.bgTabVal = data.bg_tab_val
- }
- this.pageShow = data.is_show
- uni.setNavigationBarTitle({
- title: res.data.title
- });
- let temp = [];
- let lastArr = that.objToArr(value);
- lastArr.forEach((item, index, arr) => {
- if (item.name == 'headerSerch') {
- this.isHeaderSerch = true
- }
- if (item.name == 'pageFoot') {
- console.log(item.status)
- if (item.status && item.status.status) {
- this.newData = item
- setTimeout((e) => {
- that.$set(that, 'footerStatus', true);
- console.log(this.footerStatus)
- }, 50)
- }
- uni.setStorageSync('FOOTER_BAR', item.status && item.status.status ? true :
- false)
- item.menuList.map((path, index) => {
- if (path.link === '/pages/order_addcart/order_addcart') {
- uni.setStorageSync('FOOTER_ADDCART', index)
- }
- })
- arr.splice(index, 1);
- }
- if (item.name == 'promotionList') {
- that.numConfig = item.numConfig.val;
- that.goodType = item.tabConfig.list[0].link.activeVal;
- that.getGroomList();
- }
- if (item.name == 'tabNav') {
- // #ifndef APP-PLUS
- // uni.showLoading({
- // title: '加载中',
- // mask: true,
- // });
- // #endif
- // setTimeout(function() {
- // uni.hideLoading();
- // }, 8000);
- }
- temp = arr;
- });
- function sortNumber(a, b) {
- return a.timestamp - b.timestamp;
- }
- temp.sort(sortNumber)
- that.styleConfig = temp;
- setTimeout(() => {
- this.showSkeleton = false
- }, 300)
- uni.stopPullDownRefresh({
- success: (e) => { },
- });
- }).catch(error => {
- // #ifdef APP-PLUS
- if (error.status) {
- uni.hideLoading()
- if (that.errorNetwork) {
- uni.showToast({
- title: this.$t(`连接失败`),
- icon: 'none',
- duration: 2000
- })
- }
- this.errorNetwork = true
- this.showSkeleton = false;
- }
- // #endif
- });
- },
- getIndexData() { },
- changeBarg(item) {
- if (!this.isLogin) {
- toLogin();
- } else {
- uni.navigateTo({
- url: `/pages/activity/goods_bargain_details/index?id=${item.id}&bargain=${this.$store.state.app.uid}`
- });
- }
- },
- // 促销列表的点击事件;
- changeTab(type) {
- this.goodType = type;
- this.tempArr = [];
- this.page = 1;
- this.loadend = false;
- let onloadH = true;
- this.getGroomList(onloadH);
- },
- // 精品推荐
- getGroomList(onloadH) {
- let that = this;
- let type = that.goodType;
- if (that.loadend) return false;
- if (that.loading) return false;
- if (onloadH) {
- that.$set(that, 'iSshowH', true);
- }
- getGroomList(type, {
- page: that.page,
- limit: this.numConfig
- })
- .then(({
- data
- }) => {
- that.$set(that, 'iSshowH', false);
- let maxPage = Math.ceil(this.numConfig / this.limit);
- let list = data.list,
- loadend = list.length < that.limit || that.page >= maxPage;
- let tempArr = that.$util.SplitArray(list, that.tempArr);
- that.$set(that, 'tempArr', tempArr.slice(0, this.numConfig));
- that.loadend = loadend;
- that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
- that.page = that.page + 1;
- that.loading = false;
- })
- .catch(res => {
- that.loading = false;
- that.loadTitle = that.$t(`加载更多`);
- });
- },
- goRouter(item) {
- var pages = getCurrentPages();
- var page = (pages[pages.length - 1]).$page.fullPath;
- if (item.link == page) return
- uni.switchTab({
- url: item.link,
- fail(err) {
- uni.redirectTo({
- url: item.link
- })
- }
- })
- },
- goDetail(item) {
- goShopDetail(item, this.$store.state.app.uid).then(res => {
- uni.navigateTo({
- url: `/pages/goods_details/index?id=${item.id}`
- });
- });
- },
- onsollBotton() {
- console.log('????', this.isSortType)
- if (this.isSortType == 0) {
- // this.getGroomList();
- } else {
- this.getGoodsList();
- }
- }
- },
- onReachBottom: function () {
- },
- onPageScroll(e) {
- // #ifdef H5
- if (this.isHeaderSerch) {
- if (e.scrollTop > this.domOffsetTop) {
- this.isFixed = true;
- }
- if (e.scrollTop < this.domOffsetTop) {
- this.$nextTick(() => {
- this.isFixed = false;
- });
- }
- } else {
- this.isFixed = false
- }
- // #endif
- },
- //#ifdef MP
- onShareAppMessage() {
- return {
- title: this.shareInfo.title,
- path: '/pages/index/index'
- };
- },
- //分享到朋友圈
- onShareTimeline: function () {
- return {
- title: this.shareInfo.title,
- imageUrl: this.shareInfo.img
- };
- }
- //#endif
- };
- </script>
- <style lang="scss">
- // page {
- // padding-bottom: 50px;
- // }
- .pictrue_log_class {
- background-color: var(--view-theme);
- }
- .page {
- padding-bottom: 50px;
- }
- .ysize {
- background-size: 100%;
- }
- .fullsize {
- background-size: 100% 100%;
- }
- .repeat {
- background-repeat: repeat;
- }
- .noRepeat {
- background-repeat: no-repeat;
- }
- .privacy-wrapper {
- z-index: 999;
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background: #7F7F7F;
- .privacy-box {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- width: 560rpx;
- padding: 50rpx 45rpx 0;
- background: #fff;
- border-radius: 20rpx;
- .title {
- text-align: center;
- font-size: 32rpx;
- text-align: center;
- color: #333;
- font-weight: 700;
- }
- .content {
- margin-top: 20rpx;
- line-height: 1.5;
- font-size: 26rpx;
- color: #666;
- navigator {
- display: inline-block;
- color: #E93323;
- }
- }
- .btn-box {
- margin-top: 40rpx;
- text-align: center;
- font-size: 30rpx;
- .btn-item {
- height: 82rpx;
- line-height: 82rpx;
- background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
- color: #fff;
- border-radius: 41rpx;
- }
- .btn {
- padding: 30rpx 0;
- }
- }
- }
- }
- .error-network {
- position: fixed;
- left: 0;
- top: 0;
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 100%;
- height: 100%;
- padding-top: 40rpx;
- background: #fff;
- image {
- width: 414rpx;
- height: 336rpx;
- }
- .title {
- position: relative;
- top: -40rpx;
- font-size: 32rpx;
- color: #666;
- }
- .con {
- font-size: 24rpx;
- color: #999;
- .label {
- margin-bottom: 20rpx;
- }
- .item {
- margin-bottom: 20rpx;
- }
- }
- .btn {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 508rpx;
- height: 86rpx;
- margin-top: 100rpx;
- border: 1px solid #D74432;
- color: #E93323;
- font-size: 30rpx;
- border-radius: 120rpx;
- }
- }
- .sort-product {
- margin-top: 20rpx;
- .sort-box {
- display: flex;
- width: 100%;
- border-radius: 16rpx;
- padding: 30rpx 0;
- .sort-item {
- width: 20%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- image {
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- }
- .txt {
- color: #272727;
- font-size: 24rpx;
- margin-top: 10rpx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- width: 140rpx;
- text-align: center;
- }
- .pictrues {
- width: 90rpx;
- height: 90rpx;
- background: #f8f8f8;
- border-radius: 50%;
- margin: 0 auto;
- }
- .icon-gengduo1 {
- color: #333;
- }
- &.on {
- .txt {
- color: #fc4141;
- }
- image {
- border: 1px solid #fc4141;
- }
- }
- }
- }
- .product-list {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- margin-top: 30rpx;
- padding: 0 20rpx;
- .product-item {
- position: relative;
- width: 344rpx;
- background: #fff;
- border-radius: 10rpx;
- margin-bottom: 20rpx;
- display: flex;
- flex-direction: column;
- image {
- width: 100%;
- height: 344rpx;
- border-radius: 10rpx 10rpx 0 0;
- }
- .info {
- flex: 1;
- padding: 14rpx 16rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .title {
- font-size: 28rpx;
- }
- .price-box {
- font-size: 34rpx;
- font-weight: 700;
- margin-top: 8px;
- color: #fc4141;
- text {
- font-size: 26rpx;
- }
- }
- }
- }
- }
- }
- .emptyBox {
- text-align: center;
- padding-top: 20rpx;
- .tips {
- color: #aaa;
- font-size: 26rpx;
- padding-bottom: 20rpx;
- }
- image {
- width: 414rpx;
- height: 304rpx;
- }
- }
- .site-config {
- margin-top: 40rpx;
- font-size: 24rpx;
- text-align: center;
- color: #666;
- &.fixed {
- position: fixed;
- bottom: 69px;
- left: 0;
- width: 100%;
- }
- }
- .page-footer {
- position: fixed;
- bottom: 0;
- z-index: 30;
- display: flex;
- align-items: center;
- justify-content: space-around;
- width: 100%;
- height: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
- height: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
- box-sizing: border-box;
- border-top: solid 1rpx #F3F3F3;
- background-color: #fff;
- box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
- padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
- padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
- .foot-item {
- display: flex;
- width: max-content;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- position: relative;
- .count-num {
- position: absolute;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 40rpx;
- height: 40rpx;
- top: 0rpx;
- right: -15rpx;
- color: #fff;
- font-size: 20rpx;
- background-color: #FD502F;
- border-radius: 50%;
- padding: 4rpx;
- }
- }
- .foot-item image {
- height: 50rpx;
- width: 50rpx;
- text-align: center;
- margin: 0 auto;
- }
- .foot-item .txt {
- font-size: 24rpx;
- &.active {}
- }
- }
- </style>
|