12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606 |
- <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()
- // }
- // })
- uni.hideTabBar()
- 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>
|