index.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606
  1. <template>
  2. <view v-if="pageShow" class="page"
  3. :class="bgTabVal==2?'fullsize noRepeat':bgTabVal==1?'repeat ysize':'noRepeat ysize'"
  4. :style="'background-color:'+bgColor+';background-image: url('+bgPic+');min-height:'+windowHeight+'px;'">
  5. <view v-if="!errorNetwork" :style="colorStyle">
  6. <skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
  7. bgcolor="#FFF"></skeleton>
  8. <view class="index skeleton" :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
  9. <!-- #ifdef H5 -->
  10. <view v-for="(item, index) in styleConfig" :key="index">
  11. <component :is="item.name" :index="index" :dataConfig="item" @changeBarg="changeBarg"
  12. @changeTab="changeTab" :tempArr="tempArr" :iSshowH="iSshowH" @detail="goDetail"
  13. :isSortType="isSortType" @bindSortId="bindSortId" @bindHeight="bindHeight" :isFixed="isFixed">
  14. </component>
  15. </view>
  16. <!-- #endif -->
  17. <!-- #ifdef MP || APP-PLUS -->
  18. <block v-for="(item, index) in styleConfig" :key="index">
  19. <!-- <activeParty v-if="item.name == 'activeParty'" :dataConfig="item" :isSortType="isSortType">
  20. </activeParty> -->
  21. <!-- <articleList v-if="item.name == 'articleList'" :dataConfig="item" :isSortType="isSortType">
  22. </articleList> -->
  23. <!-- <bargain v-if="item.name == 'bargain'" :dataConfig="item" @changeBarg="changeBarg"
  24. :isSortType="isSortType"></bargain> -->
  25. <!-- <blankPage v-if="item.name == 'blankPage'" :dataConfig="item" :isSortType="isSortType"></blankPage> -->
  26. <!-- <combination v-if="item.name == 'combination'" :dataConfig="item" :isSortType="isSortType">
  27. </combination> -->
  28. <!-- <coupon v-if="item.name == 'coupon'" :dataConfig="item" :isSortType="isSortType"></coupon> -->
  29. <!-- <customerService v-if="item.name == 'customerService'" :dataConfig="item" :isSortType="isSortType">
  30. </customerService> -->
  31. <!-- <goodList v-if="item.name == 'goodList'" :dataConfig="item" @detail="goDetail"
  32. :isSortType="isSortType"></goodList> -->
  33. <!-- <guide v-if="item.name == 'guide'" :dataConfig="item" :isSortType="isSortType"></guide> -->
  34. <headerSerch v-if="item.name == 'headerSerch'" :dataConfig="item"></headerSerch>
  35. <!-- <liveBroadcast v-if="item.name == 'liveBroadcast'" :dataConfig="item" :isSortType="isSortType">
  36. </liveBroadcast> -->
  37. <menus v-if="item.name == 'menus'" :dataConfig="item" :isSortType="isSortType"></menus>
  38. <news v-if="item.name == 'news'" :dataConfig="item" :isSortType="isSortType"></news>
  39. <!-- <pictureCube v-if="item.name == 'pictureCube'" :dataConfig="item" :isSortType="isSortType">
  40. </pictureCube> -->
  41. <promotionList v-if="item.name == 'promotionList'" :dataConfig="item" @changeTab="changeTab"
  42. :tempArr="tempArr" :iSshowH="iSshowH" @detail="goDetail" :isSortType="isSortType">
  43. </promotionList>
  44. <!-- <richText v-if="item.name == 'richText'" :dataConfig="item" :isSortType="isSortType"></richText> -->
  45. <!-- <seckill v-if="item.name == 'seckill'" :dataConfig="item" :isSortType="isSortType"></seckill> -->
  46. <swiperBg v-if="item.name == 'swiperBg'" :dataConfig="item" :isSortType="isSortType"></swiperBg>
  47. <!-- <swipers v-if="item.name == 'swipers'" :dataConfig="item" :isSortType="isSortType"></swipers> -->
  48. <tabNav v-if="item.name == 'tabNav'" :dataConfig="item" @bindHeight="bindHeighta"
  49. @bindSortId="bindSortId" :isFixed="isFixed"></tabNav>
  50. <!-- <titles v-if="item.name == 'titles'" :dataConfig="item" :isSortType="isSortType"></titles> -->
  51. </block>
  52. <!-- #endif -->
  53. <!-- 分类商品模块 -->
  54. <!-- #ifdef APP-PLUS -->
  55. <view class="sort-product" v-if="isSortType == 1" style="margin-top: 0;">
  56. <scroll-view scroll-x="true" style="background: #fff;">
  57. <view class="sort-box" v-if="sortList.children && sortList.children.length">
  58. <view class="sort-item" v-for="(item, index) in sortList.children" :key="index"
  59. @click="changeSort(item, index)" :class="{ on: curSort == index }">
  60. <image :src="item.pic" mode="" v-if="item.pic"></image>
  61. <image src="/static/images/sort-img.png" mode="" v-else></image>
  62. <view class="txt">{{ item.cate_name }}</view>
  63. </view>
  64. </view>
  65. </scroll-view>
  66. <view class="product-list" v-if="goodList.length">
  67. <view class="product-item" v-for="(item, index) in goodList" @click="goGoodsDetail(item)">
  68. <image :src="item.image"></image>
  69. <span class="pictrue_log_big pictrue_log_class"
  70. v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
  71. <span class="pictrue_log_big pictrue_log_class"
  72. v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
  73. <span class="pictrue_log_big pictrue_log_class"
  74. v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
  75. <view class="info">
  76. <view class="title line1">{{ item.store_name }}</view>
  77. <view class="price-box">
  78. <text>{{$t(`¥`)}}</text>
  79. {{ item.price }}
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <Loading :loaded="loaded" :loading="loading"></Loading>
  85. <view class="" v-if="goodList.length == 0 && loaded">
  86. <view class="emptyBox">
  87. <image :src="imgHost + '/statics/images/no-thing.png'"></image>
  88. <view class="tips">{{$t(`暂无商品,去看点别的吧`)}}</view>
  89. </view>
  90. <recommend :hostProduct="hostProduct"></recommend>
  91. </view>
  92. </view>
  93. <!-- #endif -->
  94. <!-- #ifndef APP-PLUS -->
  95. <view class="sort-product" v-if="isSortType == 1" :style="{ marginTop: sortMpTop + 'px' }">
  96. <scroll-view scroll-x="true" style="background: #fff;">
  97. <view class="sort-box" v-if="sortList.children && sortList.children.length">
  98. <view class="sort-item" v-for="(item, index) in sortList.children" :key="index"
  99. @click="changeSort(item, index)" :class="{ on: curSort == index }">
  100. <image :src="item.pic" mode="" v-if="item.pic"></image>
  101. <image src="/static/images/sort-img.png" mode="" v-else></image>
  102. <view class="txt">{{ item.cate_name }}</view>
  103. </view>
  104. </view>
  105. </scroll-view>
  106. <view class="product-list" v-if="goodList.length">
  107. <view class="product-item" v-for="(item, index) in goodList" @click="goGoodsDetail(item)">
  108. <image :src="item.image"></image>
  109. <span class="pictrue_log_big pictrue_log_class"
  110. v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
  111. <span class="pictrue_log_big pictrue_log_class"
  112. v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
  113. <span class="pictrue_log_big pictrue_log_class"
  114. v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
  115. <span class="pictrue_log_big pictrue_log_class" v-if="item.checkCoupon">{{$t(`券`)}}</span>
  116. <view class="info">
  117. <view class="title line2">{{ item.store_name }}</view>
  118. <view class="price-box">
  119. <text>{{$t(`¥`)}}</text>
  120. {{ item.price }}
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. <Loading :loaded="loaded" :loading="loading"></Loading>
  126. <view class="" v-if="goodList.length == 0 && loaded">
  127. <view class="emptyBox">
  128. <image :src="imgHost + '/statics/images/no-thing.png'"></image>
  129. <view class="tips">{{$t(`暂无数据`)}}</view>
  130. </view>
  131. <recommend :hostProduct="hostProduct"></recommend>
  132. </view>
  133. </view>
  134. <!-- #endif -->
  135. <!-- <view class="loadingicon acea-row row-center-wrapper" v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
  136. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  137. {{ loadTitle }}
  138. </view> -->
  139. <!-- #ifdef MP -->
  140. <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" :isGoIndex="false"></authorize> -->
  141. <!-- #endif -->
  142. <couponWindow :window="isCouponShow" @onColse="couponClose" :couponImage="couponObj.image"
  143. :couponList="couponObj.list"></couponWindow>
  144. <view class="uni-p-b-98" v-if="footerStatus"></view>
  145. <view v-if="site_config" class="site-config" @click="goICP">{{ site_config }}</view>
  146. <!-- <pageFooter v-if="footerStatus"></pageFooter> -->
  147. <view class="foot" v-if="newData.status && newData.status.status">
  148. <view class="page-footer" id="target" :style="{'background-color':newData.bgColor.color[0].item}">
  149. <view class="foot-item" v-for="(item,index) in newData.menuList" :key="index"
  150. @click="goRouter(item)">
  151. <block v-if="item.link == activeRouter">
  152. <image :src="item.imgList[0]"></image>
  153. <view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">
  154. {{$t(item.name)}}
  155. </view>
  156. </block>
  157. <block v-else>
  158. <image :src="item.imgList[1]"></image>
  159. <view class="txt" :style="{color:newData.txtColor.color[0].item}">{{$t(item.name)}}
  160. </view>
  161. </block>
  162. <div class="count-num"
  163. v-if="item.link === '/pages/order_addcart/order_addcart' && countNum > 0">
  164. {{countNum}}
  165. </div>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <view v-else>
  172. <view class="error-network">
  173. <image :src="imgHost + '/statics/images/error-network.png'"></image>
  174. <view class="title">{{$t(`网络连接断开`)}}</view>
  175. <view class="con">
  176. <view class="label">{{$t(`请检查情况:`)}}:</view>
  177. <view class="item">· {{$t(`在设置中是否已开启网络权限:`)}}</view>
  178. <view class="item">· {{$t(`当前是否处于弱网环境`)}}</view>
  179. <view class="item">· {{$t(`版本是否过低,升级试试吧`)}}</view>
  180. </view>
  181. <view class="btn" @click="reconnect">{{$t(`重新连接`)}}</view>
  182. </view>
  183. </view>
  184. <!-- #ifdef APP-PLUS -->
  185. <app-update v-if="!privacyStatus" ref="appUpdate" :force="true" :tabbar="false"></app-update>
  186. <view class="privacy-wrapper" v-if="privacyStatus">
  187. <view class="privacy-box">
  188. <view class="title">{{$t(`服务协议与隐私政策`)}}</view>
  189. <view class="content">
  190. {{$t(`请务必审慎阅读、充分理解“服务协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志等个
  191. 人信息。你可以在“设置”中查看、变更、删除个人信息并管理你的授权。`)}}<br>
  192. {{$t(`你可以阅读`)}}<navigator url="/pages/users/privacy/index?type=3">{{$t(`《服务协议与隐私政策》`)}}</navigator>
  193. {{$t(`了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。`)}}
  194. </view>
  195. <view class="btn-box">
  196. <view class="btn-item" @click="confirmApp">{{$t(`我同意`)}}</view>
  197. <view class="btn" @click="closeModel">{{$t(`残忍拒绝`)}}</view>
  198. </view>
  199. </view>
  200. </view>
  201. <!-- #endif -->
  202. </view>
  203. </template>
  204. <script>
  205. const app = getApp();
  206. import colors from "@/mixins/color";
  207. import couponWindow from '@/components/couponWindow/index';
  208. import {
  209. getCouponV2,
  210. getCouponNewUser,
  211. siteConfig
  212. } from '@/api/api.js';
  213. import {
  214. getNavigation
  215. } from '@/api/public.js';
  216. // #ifdef H5
  217. import mConfig from './components/index.js';
  218. // #endif
  219. // #ifdef MP || APP-PLUS
  220. import authorize from '@/components/Authorize';
  221. import activeParty from './components/activeParty';
  222. import headerSerch from './components/headerSerch';
  223. import swipers from './components/swipers';
  224. import coupon from './components/coupon';
  225. import articleList from './components/articleList';
  226. import bargain from './components/bargain';
  227. import blankPage from './components/blankPage';
  228. import combination from './components/combination';
  229. import customerService from './components/customerService';
  230. import goodList from './components/goodList';
  231. import guide from './components/guide';
  232. import liveBroadcast from './components/liveBroadcast';
  233. import menus from './components/menus';
  234. import news from './components/news';
  235. import pictureCube from './components/pictureCube';
  236. import promotionList from './components/promotionList';
  237. import richText from './components/richText';
  238. import seckill from './components/seckill';
  239. import swiperBg from './components/swiperBg';
  240. import tabNav from './components/tabNav';
  241. import titles from './components/titles';
  242. import appUpdate from "@/components/update/app-update.vue";
  243. import {
  244. getTempIds
  245. } from '@/api/api.js';
  246. import {
  247. SUBSCRIBE_MESSAGE,
  248. TIPS_KEY
  249. } from '@/config/cache';
  250. // #endif
  251. import {
  252. mapGetters
  253. } from 'vuex';
  254. import {
  255. getDiy,
  256. getIndexData
  257. } from '@/api/api.js';
  258. import {
  259. getGroomList,
  260. getCategoryList,
  261. getProductslist,
  262. getProductHot
  263. } from '@/api/store.js';
  264. import {
  265. goShopDetail
  266. } from '@/libs/order.js';
  267. import {
  268. getCartCounts,
  269. } from '@/api/order.js';
  270. import {
  271. toLogin
  272. } from '@/libs/login.js';
  273. import { HTTP_REQUEST_URL } from '@/config/app';
  274. import pageFooter from '@/components/pageFooter/index.vue';
  275. import Loading from '@/components/Loading/index.vue';
  276. import recommend from '@/components/recommend';
  277. export default {
  278. computed: mapGetters(['isLogin', 'uid']),
  279. mixins: [colors],
  280. components: {
  281. recommend,
  282. Loading,
  283. pageFooter,
  284. couponWindow,
  285. // #ifdef H5
  286. ...mConfig,
  287. // #endif
  288. // #ifdef MP || APP-PLUS
  289. authorize,
  290. activeParty,
  291. headerSerch,
  292. swipers,
  293. coupon,
  294. articleList,
  295. bargain,
  296. blankPage,
  297. combination,
  298. customerService,
  299. goodList,
  300. guide,
  301. liveBroadcast,
  302. menus,
  303. pictureCube,
  304. news,
  305. promotionList,
  306. richText,
  307. seckill,
  308. swiperBg,
  309. tabNav,
  310. titles,
  311. appUpdate, //APP更新
  312. // #endif
  313. },
  314. computed: mapGetters(['isLogin', 'cartNum']),
  315. data() {
  316. return {
  317. imgHost: HTTP_REQUEST_URL,
  318. showSkeleton: true, //骨架屏显示隐藏
  319. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  320. styleConfig: [],
  321. tempArr: [],
  322. goodType: 3,
  323. loading: false,
  324. loadend: false,
  325. loadTitle: this.$t(`下拉加载更多`), //提示语
  326. page: 1,
  327. limit: this.$config.LIMIT,
  328. iSshowH: false,
  329. numConfig: 0,
  330. code: '',
  331. isCouponShow: false,
  332. couponObj: {},
  333. couponObjs: {
  334. show: false
  335. },
  336. shareInfo: {},
  337. footConfig: {},
  338. isSortType: 0,
  339. sortList: '',
  340. sortAll: [],
  341. goodPage: 1,
  342. goodList: [],
  343. newData: {},
  344. sid: 0,
  345. curSort: 0,
  346. sortMpTop: 0,
  347. loaded: false,
  348. loading: false,
  349. hostProduct: [],
  350. hotScroll: false,
  351. hotPage: 1,
  352. hotLimit: 10,
  353. domOffsetTop: 50,
  354. // #ifdef APP-PLUS || MP
  355. isFixed: true,
  356. // #endif
  357. // #ifdef H5
  358. isFixed: false,
  359. // #endif
  360. site_config: '',
  361. errorNetwork: false, // 是否断网
  362. privacyStatus: false, // 隐私政策是否同意过
  363. footerStatus: false,
  364. isHeaderSerch: false,
  365. bgColor: '',
  366. bgPic: '',
  367. bgTabVal: '',
  368. pageShow: true,
  369. windowHeight: 0,
  370. activeRouter: '',
  371. countNum: 0
  372. };
  373. },
  374. onPullDownRefresh() {
  375. this.diyData();
  376. },
  377. created(options) {
  378. let that = this
  379. this.$nextTick(function () {
  380. uni.getSystemInfo({
  381. success: function (res) {
  382. that.windowHeight = res.windowHeight;
  383. }
  384. });
  385. })
  386. // getNavigation().then(res => {
  387. // this.newData = res.data
  388. // if (this.newData.status && this.newData.status.status) {
  389. // uni.hideTabBar()
  390. // } else {
  391. // uni.showTabBar()
  392. // }
  393. // })
  394. uni.hideTabBar()
  395. let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
  396. let curRoute = routes[routes.length - 1].route //获取当前页面路由
  397. this.activeRouter = '/' + curRoute
  398. // #ifdef APP-PLUS
  399. uni.setStorageSync("privacyStatus", true);
  400. // try {
  401. // let val = uni.getStorageSync('privacyStatus') || false
  402. // if (!val) {
  403. // this.privacyStatus = true
  404. // }
  405. // } catch (e) {}
  406. // #endif
  407. this.diyData();
  408. this.getIndexData();
  409. // #ifdef MP
  410. this.getTempIds();
  411. // #endif
  412. // #ifndef APP-PLUS
  413. siteConfig().then(res => {
  414. this.site_config = res.data.record_No
  415. }).catch(err => {
  416. console.error(err.msg);
  417. });
  418. // #endif
  419. // 优惠券弹窗
  420. // var newDates = new Date().toLocaleDateString();
  421. if (this.isLogin) {
  422. this.getCoupon();
  423. getCartCounts().then(res => {
  424. this.countNum = res.data.count
  425. this.$store.commit('indexData/setCartNum', res.data.count > 99 ? '..' : res.data.count +
  426. '')
  427. if (res.data.count > 0) {
  428. wx.setTabBarBadge({
  429. index: Number(uni.getStorageSync('FOOTER_ADDCART')) || 2,
  430. text: res.data.count + ''
  431. })
  432. } else {
  433. wx.hideTabBarRedDot({
  434. index: Number(uni.getStorageSync('FOOTER_ADDCART')) || 2
  435. })
  436. }
  437. });
  438. }
  439. },
  440. // onReady() {
  441. // let that = this
  442. // uni.getSystemInfo({
  443. // success: function(res) { // res - 各种参数
  444. // let info = uni.createSelectorQuery().select(".hander"); // 获取某个元素
  445. // info.boundingClientRect(function(data) { //data - 各种参数
  446. // let view = res.windowHeight - data.height
  447. // that.heightHome = view
  448. // }).exec()
  449. // }
  450. // });
  451. // },
  452. watch: {
  453. isLogin: {
  454. deep: true, //深度监听设置为 true
  455. handler: function (newV, oldV) {
  456. // 优惠券弹窗
  457. var newDates = new Date().toLocaleDateString();
  458. if (newV) {
  459. try {
  460. var oldDate = uni.getStorageSync('oldDate') || '';
  461. } catch { }
  462. if (oldDate != newDates) {
  463. this.getCoupon();
  464. }
  465. }
  466. }
  467. }
  468. },
  469. onReady() { },
  470. methods: {
  471. // #ifdef APP-PLUS
  472. // 同意隐私协议
  473. confirmApp() {
  474. uni.setStorageSync('privacyStatus', true)
  475. this.privacyStatus = false
  476. },
  477. // 关闭Model
  478. closeModel() {
  479. //退出app
  480. uni.getSystemInfo({
  481. success: function (res) { // 判断为安卓的手机
  482. if (res.platform == 'android') { // 安卓退出app
  483. plus.runtime.quit();
  484. } else { // 判断为ios的手机,退出App
  485. plus.ios.import("UIApplication").sharedApplication().performSelector("exit");
  486. }
  487. }
  488. })
  489. },
  490. // #endif
  491. // 重新链接
  492. reconnect() {
  493. uni.showLoading({
  494. title: this.$t(`加载中`)
  495. })
  496. this.diyData();
  497. this.getIndexData();
  498. getShare().then(res => {
  499. this.shareInfo = res.data;
  500. });
  501. },
  502. goICP() {
  503. // #ifdef H5
  504. window.open('http://beian.miit.gov.cn/');
  505. // #endif
  506. // #ifdef MP
  507. uni.navigateTo({
  508. url: `/pages/annex/web_view/index?url=https://beian.miit.gov.cn/`
  509. });
  510. // #endif
  511. },
  512. bindHeighta(data) {
  513. // #ifdef APP-PLUS
  514. this.sortMpTop = data.top + data.height;
  515. // #endif
  516. },
  517. bindHeight(data) {
  518. uni.hideLoading();
  519. this.domOffsetTop = data.top;
  520. },
  521. // 去商品详情
  522. goGoodsDetail(item) {
  523. goShopDetail(item, this.uid).then(res => {
  524. uni.navigateTo({
  525. url: `/pages/goods_details/index?id=${item.id}`
  526. });
  527. });
  528. },
  529. /**
  530. * 获取我的推荐
  531. */
  532. get_host_product: function () {
  533. let that = this;
  534. if (that.hotScroll) return;
  535. getProductHot(that.hotPage, that.hotLimit).then(res => {
  536. that.hotPage++;
  537. that.hotScroll = res.data.length < that.hotLimit;
  538. that.hostProduct = that.hostProduct.concat(res.data);
  539. // that.$set(that, 'hostProduct', res.data)
  540. });
  541. },
  542. // 分类点击
  543. changeSort(item, index) {
  544. if (this.curSort == index) return;
  545. this.curSort = index;
  546. this.sid = item.id;
  547. this.goodList = [];
  548. this.goodPage = 1;
  549. this.loaded = false;
  550. this.getGoodsList();
  551. },
  552. // 获取分类id
  553. bindSortId(data) {
  554. this.isSortType = data == -99 ? 0 : 1;
  555. this.getProductList(data);
  556. if (this.hostProduct.length == 0) {
  557. this.get_host_product();
  558. }
  559. },
  560. getProductList(data) {
  561. let tempObj = '';
  562. this.curSort = 0;
  563. this.loaded = false;
  564. if (this.sortAll.length > 0) {
  565. this.sortAll.forEach((el, index) => {
  566. if (el.id == data) {
  567. this.$set(this, 'sortList', el);
  568. this.sid = el.children.length ? el.children[0].id : '';
  569. }
  570. });
  571. this.goodList = [];
  572. this.goodPage = 1;
  573. this.$nextTick(() => {
  574. if (this.sortList != '') this.getGoodsList();
  575. });
  576. } else {
  577. getCategoryList().then(res => {
  578. this.sortAll = res.data;
  579. res.data.forEach((el, index) => {
  580. if (el.id == data) {
  581. this.sortList = el;
  582. this.sid = el.children.length ? el.children[0].id : '';
  583. }
  584. });
  585. this.goodList = [];
  586. this.goodPage = 1;
  587. this.$nextTick(() => {
  588. if (this.sortList != '') this.getGoodsList();
  589. });
  590. });
  591. }
  592. },
  593. getGoodsList() {
  594. if (this.loading || this.loaded) return;
  595. this.loading = true;
  596. getProductslist({
  597. sid: this.sid,
  598. keyword: '',
  599. priceOrder: '',
  600. salesOrder: '',
  601. news: 0,
  602. page: this.goodPage,
  603. limit: 10,
  604. cid: this.sortList.id
  605. }).then(res => {
  606. this.loading = false;
  607. this.loaded = res.data.length < 10;
  608. this.goodPage++;
  609. this.goodList = this.goodList.concat(res.data);
  610. });
  611. },
  612. // 新用户优惠券
  613. getNewCoupon() {
  614. const oldUser = uni.getStorageSync('oldUser') || 0;
  615. if (!oldUser) {
  616. getCouponNewUser().then(res => {
  617. const {
  618. data
  619. } = res;
  620. if (data.show) {
  621. if (data.list.length) {
  622. this.isCouponShow = true;
  623. this.couponObj = data;
  624. uni.setStorageSync('oldUser', 1);
  625. }
  626. } else {
  627. uni.setStorageSync('oldUser', 1);
  628. }
  629. });
  630. }
  631. },
  632. // 优惠券弹窗
  633. getCoupon() {
  634. const tagDate = uni.getStorageSync('tagDate') || '',
  635. nowDate = new Date().toLocaleDateString();
  636. if (tagDate === nowDate) {
  637. this.getNewCoupon();
  638. } else {
  639. getCouponV2().then(res => {
  640. const {
  641. data
  642. } = res;
  643. if (data.list.length) {
  644. this.isCouponShow = true;
  645. this.couponObj = data;
  646. uni.setStorageSync('tagDate', new Date().toLocaleDateString());
  647. } else {
  648. this.getNewCoupon();
  649. }
  650. });
  651. }
  652. },
  653. // 优惠券弹窗关闭
  654. couponClose() {
  655. this.isCouponShow = false;
  656. if (!uni.getStorageSync('oldUser')) {
  657. this.getNewCoupon();
  658. }
  659. },
  660. onLoadFun() { },
  661. // #ifdef H5
  662. // 获取url后面的参数
  663. getQueryString(name) {
  664. var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  665. var reg_rewrite = new RegExp('(^|/)' + name + '/([^/]*)(/|$)', 'i');
  666. var r = window.location.search.substr(1).match(reg);
  667. var q = window.location.pathname.substr(1).match(reg_rewrite);
  668. if (r != null) {
  669. return unescape(r[2]);
  670. } else if (q != null) {
  671. return unescape(q[2]);
  672. } else {
  673. return null;
  674. }
  675. },
  676. // #endif
  677. // #ifdef MP
  678. getTempIds() {
  679. let messageTmplIds = wx.getStorageSync(SUBSCRIBE_MESSAGE);
  680. if (!messageTmplIds) {
  681. getTempIds().then(res => {
  682. if (res.data) wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
  683. });
  684. }
  685. },
  686. // #endif
  687. // 对象转数组
  688. objToArr(data) {
  689. let obj = Object.keys(data);
  690. let m = obj.map(key => data[key]);
  691. return m;
  692. },
  693. diyData() {
  694. let that = this;
  695. let value = {
  696. "1666235374470000": {
  697. "name": "headerSerch",
  698. "timestamp": "1666235374470000",
  699. "setUp": {
  700. "tabVal": 0
  701. },
  702. "bgColor": {
  703. "title": "背景颜色(渐变)",
  704. "name": "bgColor",
  705. "default": [
  706. {
  707. "item": "#F62C2C"
  708. },
  709. {
  710. "item": "#F96E29"
  711. }
  712. ],
  713. "color": [
  714. {
  715. "item": "rgba(29,176,252,1)"
  716. },
  717. {
  718. "item": "rgba(64,209,244,1)"
  719. }
  720. ]
  721. },
  722. "boxStyle": {
  723. "title": "边框样式",
  724. "name": "boxStyle",
  725. "type": 0,
  726. "list": [
  727. {
  728. "val": "圆角",
  729. "icon": "iconPic_fillet"
  730. },
  731. {
  732. "val": "直角",
  733. "icon": "iconPic_square"
  734. }
  735. ]
  736. },
  737. "txtStyle": {
  738. "title": "文本位置",
  739. "name": "txtStyle",
  740. "type": 1,
  741. "list": [
  742. {
  743. "val": "居左",
  744. "icon": "icondoc_left"
  745. },
  746. {
  747. "val": "居中",
  748. "icon": "icondoc_center"
  749. }
  750. ]
  751. },
  752. "prConfig": {
  753. "title": "背景边距",
  754. "val": 8,
  755. "min": 0
  756. },
  757. "mbConfig": {
  758. "title": "页面间距",
  759. "val": 0,
  760. "min": 0
  761. },
  762. "hotWords": {
  763. "list": [
  764. {
  765. "val": ""
  766. }
  767. ]
  768. },
  769. "logoConfig": {
  770. "type": 1,
  771. "header": "设置logo",
  772. "title": "",
  773. "url": "https://demo26.crmeb.net/uploads/attach/2022/10/20221009/7436ee5680bc5d67c46a6017939475e5.png"
  774. },
  775. "id": "id1665385357481000"
  776. },
  777. "1666235374470001": {
  778. "name": "swiperBg",
  779. "timestamp": "1666235374470001",
  780. "setUp": {
  781. "tabVal": 1
  782. },
  783. "swiperConfig": {
  784. "title": "最多可添加10张图片,建议宽度750px;鼠标拖拽左侧圆点可调整图片 顺序",
  785. "maxList": 10,
  786. "list": [
  787. {
  788. "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220928/8903e1c331b95263270d1bf558315eea.jpg",
  789. "info": [
  790. {
  791. "title": "标题",
  792. "value": "电商社交",
  793. "tips": "选填,不超过4个字",
  794. "max": 4
  795. },
  796. {
  797. "title": "链接",
  798. "value": "/pages/goods_cate/goods_cate",
  799. "tips": "请输入链接",
  800. "max": 100
  801. }
  802. ]
  803. },
  804. {
  805. "img": "https://qiniu.crmeb.net/attach/2021/10/78c7c20211011171437256.png",
  806. "info": [
  807. {
  808. "title": "标题",
  809. "value": "今日推荐",
  810. "tips": "选填,不超过4个字",
  811. "max": 4
  812. },
  813. {
  814. "title": "链接",
  815. "value": "/pages/extension/customer_list/chat",
  816. "tips": "请输入链接",
  817. "max": 100
  818. }
  819. ]
  820. },
  821. {
  822. "img": "https://qiniu.crmeb.net/attach/2021/10/ce66b202110111714168104.png",
  823. "info": [
  824. {
  825. "title": "标题",
  826. "value": "超值爆款",
  827. "tips": "选填,不超过4个字",
  828. "max": 4
  829. },
  830. {
  831. "title": "链接",
  832. "value": "/pages/users/user_sgin/index",
  833. "tips": "请输入链接",
  834. "max": 100
  835. }
  836. ]
  837. }
  838. ]
  839. },
  840. "isShow": {
  841. "title": "是否显示背景色",
  842. "val": false
  843. },
  844. "bgColor": {
  845. "title": "背景颜色(渐变)",
  846. "default": [
  847. {
  848. "item": "#F62C2C"
  849. },
  850. {
  851. "item": "#F96E29"
  852. }
  853. ],
  854. "color": [
  855. {
  856. "item": "rgba(29,176,252,1)"
  857. },
  858. {
  859. "item": "rgba(64,209,244,1)"
  860. }
  861. ]
  862. },
  863. "dotColor": {
  864. "title": "指示器颜色",
  865. "default": [
  866. {
  867. "item": "#fff"
  868. }
  869. ],
  870. "color": [
  871. {
  872. "item": "rgba(29,176,252,1)"
  873. }
  874. ]
  875. },
  876. "lrConfig": {
  877. "title": "左右边距",
  878. "val": 11,
  879. "min": 0
  880. },
  881. "mbConfig": {
  882. "title": "页面间距",
  883. "val": 10,
  884. "min": 0
  885. },
  886. "docConfig": {
  887. "cname": "swiper",
  888. "title": "指示器样式",
  889. "type": 0,
  890. "list": [
  891. {
  892. "val": "圆形",
  893. "icon": "iconDot"
  894. },
  895. {
  896. "val": "直线",
  897. "icon": "iconSquarepoint"
  898. },
  899. {
  900. "val": "数字",
  901. "icon": "iconshuzi"
  902. },
  903. {
  904. "val": "无指示器",
  905. "icon": "iconjinyong"
  906. }
  907. ]
  908. },
  909. "txtStyle": {
  910. "title": "指示器位置",
  911. "type": 2,
  912. "list": [
  913. {
  914. "val": "居左",
  915. "icon": "icondoc_left"
  916. },
  917. {
  918. "val": "居中",
  919. "icon": "icondoc_center"
  920. },
  921. {
  922. "val": "居右",
  923. "icon": "icondoc_right"
  924. }
  925. ]
  926. },
  927. "imgConfig": {
  928. "cname": "docStyle",
  929. "title": "轮播图样式",
  930. "type": 0,
  931. "list": [
  932. {
  933. "val": "圆角",
  934. "icon": "iconPic_fillet"
  935. },
  936. {
  937. "val": "直角",
  938. "icon": "iconPic_square"
  939. }
  940. ]
  941. },
  942. "id": "id1665385357481001"
  943. },
  944. "1666235374470002": {
  945. "name": "news",
  946. "timestamp": "1666235374470002",
  947. "setUp": {
  948. "tabVal": 1
  949. },
  950. "txtStyle": {
  951. "title": "文本位置",
  952. "name": "txtStyle",
  953. "type": 0,
  954. "list": [
  955. {
  956. "val": "居左",
  957. "icon": "icondoc_left",
  958. "style": "left"
  959. },
  960. {
  961. "val": "居中",
  962. "icon": "icondoc_center",
  963. "style": "center"
  964. },
  965. {
  966. "val": "居右",
  967. "icon": "icondoc_right",
  968. "style": "right"
  969. }
  970. ]
  971. },
  972. "bgColor": {
  973. "title": "背景颜色",
  974. "default": [
  975. {
  976. "item": "#fff"
  977. }
  978. ],
  979. "color": [
  980. {
  981. "item": "#fff"
  982. }
  983. ]
  984. },
  985. "txtColor": {
  986. "title": "文字颜色",
  987. "default": [
  988. {
  989. "item": "#333"
  990. }
  991. ],
  992. "color": [
  993. {
  994. "item": "#333"
  995. }
  996. ]
  997. },
  998. "listConfig": {
  999. "title": "最多可添加10个版块;鼠标拖拽左侧圆点可调整版块顺序",
  1000. "max": 10,
  1001. "list": [
  1002. {
  1003. "chiild": [
  1004. {
  1005. "title": "标题",
  1006. "val": "标准版4.5正式发布,大家快来体验",
  1007. "max": 30,
  1008. "pla": "选填,不超过30个字",
  1009. "empty": true
  1010. },
  1011. {
  1012. "title": "链接",
  1013. "val": "/pages/extension/news_details/index?id=128",
  1014. "max": 200,
  1015. "pla": "请输入连接"
  1016. }
  1017. ]
  1018. }
  1019. ],
  1020. "tabCur": 0
  1021. },
  1022. "bgStyle": {
  1023. "title": "背景样式",
  1024. "name": "bgStyle",
  1025. "type": 1,
  1026. "list": [
  1027. {
  1028. "val": "直角",
  1029. "icon": "iconPic_square"
  1030. },
  1031. {
  1032. "val": "圆角",
  1033. "icon": "iconPic_fillet"
  1034. }
  1035. ]
  1036. },
  1037. "prConfig": {
  1038. "title": "背景边距",
  1039. "val": 10,
  1040. "min": 0
  1041. },
  1042. "mbConfig": {
  1043. "title": "页面间距",
  1044. "val": 10,
  1045. "min": 0
  1046. },
  1047. "logoConfig": {
  1048. "header": "图标设置",
  1049. "title": "最多可添加1张图片,建议宽度130 * 36px",
  1050. "url": "https://qiniu.crmeb.net/attach/2021/11/6d4fe202111181229083421.png"
  1051. },
  1052. "id": "id1665385357481002"
  1053. },
  1054. "1666235374470003": {
  1055. "name": "menus",
  1056. "timestamp": "1666235374470003",
  1057. "setUp": {
  1058. "tabVal": 0
  1059. },
  1060. "tabConfig": {
  1061. "title": "展示样式",
  1062. "tabVal": 1,
  1063. "type": 1,
  1064. "tabList": [
  1065. {
  1066. "name": "单行展示",
  1067. "icon": "icondanhang"
  1068. },
  1069. {
  1070. "name": "多行展示",
  1071. "icon": "iconduohang"
  1072. }
  1073. ]
  1074. },
  1075. "rowsNum": {
  1076. "title": "显示行数",
  1077. "name": "rowsNum",
  1078. "type": 0,
  1079. "list": [
  1080. {
  1081. "val": "2行",
  1082. "icon": "icon2hang"
  1083. },
  1084. {
  1085. "val": "3行",
  1086. "icon": "icon3hang"
  1087. },
  1088. {
  1089. "val": "4行",
  1090. "icon": "icon4hang"
  1091. }
  1092. ]
  1093. },
  1094. "menuStyle": {
  1095. "title": "图标样式",
  1096. "name": "menuStyle",
  1097. "type": 1,
  1098. "list": [
  1099. {
  1100. "val": "方形",
  1101. "icon": "iconPic_square"
  1102. },
  1103. {
  1104. "val": "圆形",
  1105. "icon": "icondayuanjiao"
  1106. }
  1107. ]
  1108. },
  1109. "number": {
  1110. "title": "显示个数",
  1111. "name": "number",
  1112. "type": 2,
  1113. "list": [
  1114. {
  1115. "val": "3个",
  1116. "icon": "icon3ge"
  1117. },
  1118. {
  1119. "val": "4个",
  1120. "icon": "icon4ge1"
  1121. },
  1122. {
  1123. "val": "5个",
  1124. "icon": "icon5ge1"
  1125. }
  1126. ]
  1127. },
  1128. "pointerStyle": {
  1129. "title": "指示器样式",
  1130. "name": "pointerStyle",
  1131. "type": 2,
  1132. "list": [
  1133. {
  1134. "val": "长条",
  1135. "icon": "iconSquarepoint"
  1136. },
  1137. {
  1138. "val": "圆形",
  1139. "icon": "iconDot"
  1140. },
  1141. {
  1142. "val": "无指示器",
  1143. "icon": "iconjinyong"
  1144. }
  1145. ]
  1146. },
  1147. "bgStyle": {
  1148. "title": "背景样式",
  1149. "name": "bgStyle",
  1150. "type": 1,
  1151. "list": [
  1152. {
  1153. "val": "直角",
  1154. "icon": "iconPic_square"
  1155. },
  1156. {
  1157. "val": "圆角",
  1158. "icon": "iconPic_fillet"
  1159. }
  1160. ]
  1161. },
  1162. "prConfig": {
  1163. "title": "背景边距",
  1164. "val": 10,
  1165. "min": 0
  1166. },
  1167. "menuConfig": {
  1168. "title": "最多可添加1张图片,建议宽度90 * 90px",
  1169. "maxList": 100,
  1170. "list": [
  1171. {
  1172. "img": "https://qiniu.crmeb.net/attach/2021/09/02d9e202109101106364468.png",
  1173. "info": [
  1174. {
  1175. "title": "标题",
  1176. "value": "预约自提",
  1177. "tips": "选填,不超过4个字",
  1178. "max": 4
  1179. },
  1180. {
  1181. "title": "链接",
  1182. "value": "/pages/goods_details/index?id=109",
  1183. "tips": "请输入链接",
  1184. "max": 100
  1185. }
  1186. ]
  1187. },
  1188. {
  1189. "img": "https://qiniu.crmeb.net/attach/2021/09/4a21a202109101106368349.png",
  1190. "info": [
  1191. {
  1192. "title": "标题",
  1193. "value": "领优惠券",
  1194. "tips": "选填,不超过4个字",
  1195. "max": 4
  1196. },
  1197. {
  1198. "title": "链接",
  1199. "value": "/pages/users/user_get_coupon/index",
  1200. "tips": "请输入链接",
  1201. "max": 100
  1202. }
  1203. ]
  1204. },
  1205. {
  1206. "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220916/d09d2286f960697ab7e1fb9d2595605f.png",
  1207. "info": [
  1208. {
  1209. "title": "标题",
  1210. "value": "特价限购",
  1211. "tips": "选填,不超过4个字",
  1212. "max": 4
  1213. },
  1214. {
  1215. "title": "链接",
  1216. "value": "/pages/goods_details/index?id=116",
  1217. "tips": "请输入链接",
  1218. "max": 100
  1219. }
  1220. ]
  1221. },
  1222. {
  1223. "img": "https://qiniu.crmeb.net/attach/2021/09/9d74b20210910110637104.png",
  1224. "info": [
  1225. {
  1226. "title": "标题",
  1227. "value": "新闻资讯",
  1228. "tips": "选填,不超过4个字",
  1229. "max": 4
  1230. },
  1231. {
  1232. "title": "链接",
  1233. "value": "/pages/extension/news_list/index",
  1234. "tips": "请输入链接",
  1235. "max": 100
  1236. }
  1237. ]
  1238. },
  1239. {
  1240. "img": "https://qiniu.crmeb.net/attach/2021/09/1c95120210910110636424.png",
  1241. "info": [
  1242. {
  1243. "title": "标题",
  1244. "value": "助力砍价",
  1245. "tips": "选填,不超过4个字",
  1246. "max": 4
  1247. },
  1248. {
  1249. "title": "链接",
  1250. "value": "/pages/activity/goods_bargain/index",
  1251. "tips": "请输入链接",
  1252. "max": 100
  1253. }
  1254. ]
  1255. },
  1256. {
  1257. "img": "https://qiniu.crmeb.net/attach/2021/09/23332202109101106361126.png",
  1258. "info": [
  1259. {
  1260. "title": "标题",
  1261. "value": "限时秒杀",
  1262. "tips": "选填,不超过4个字",
  1263. "max": 4
  1264. },
  1265. {
  1266. "title": "链接",
  1267. "value": "/pages/activity/goods_seckill/index",
  1268. "tips": "请输入链接",
  1269. "max": 100
  1270. }
  1271. ]
  1272. },
  1273. {
  1274. "img": "https://qiniu.crmeb.net/attach/2021/09/34f81202109101106357549.png",
  1275. "info": [
  1276. {
  1277. "title": "标题",
  1278. "value": "积分商城",
  1279. "tips": "选填,不超过4个字",
  1280. "max": 4
  1281. },
  1282. {
  1283. "title": "链接",
  1284. "value": "/pages/points_mall/index",
  1285. "tips": "请输入链接",
  1286. "max": 100
  1287. }
  1288. ]
  1289. },
  1290. {
  1291. "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220916/06c63d52fc6772917540d47076606680.png",
  1292. "info": [
  1293. {
  1294. "title": "标题",
  1295. "value": "成团返佣",
  1296. "tips": "选填,不超过4个字",
  1297. "max": 4
  1298. },
  1299. {
  1300. "title": "链接",
  1301. "value": "/pages/activity/goods_combination_details/index?id=23",
  1302. "tips": "请输入链接",
  1303. "max": 100
  1304. }
  1305. ]
  1306. },
  1307. {
  1308. "img": "https://demo26.crmeb.net/uploads/attach/2022/09/20220916/e31cdcb6fa7660aee45912ef572cc114.png",
  1309. "info": [
  1310. {
  1311. "title": "标题",
  1312. "value": "用户足迹",
  1313. "tips": "选填,不超过4个字",
  1314. "max": 4
  1315. },
  1316. {
  1317. "title": "链接",
  1318. "value": "/pages/users/visit_list/index",
  1319. "tips": "请输入链接",
  1320. "max": 100
  1321. }
  1322. ]
  1323. },
  1324. {
  1325. "img": "https://qiniu.crmeb.net/attach/2021/09/f4598202109101106358762.png",
  1326. "info": [
  1327. {
  1328. "title": "标题",
  1329. "value": "幸运转盘",
  1330. "tips": "选填,不超过4个字",
  1331. "max": 4
  1332. },
  1333. {
  1334. "title": "链接",
  1335. "value": "/pages/goods/lottery/grids/index?type=1",
  1336. "tips": "请输入链接",
  1337. "max": 100
  1338. }
  1339. ]
  1340. }
  1341. ]
  1342. },
  1343. "pointerColor": {
  1344. "title": "指示器颜色",
  1345. "name": "pointerColor",
  1346. "default": [
  1347. {
  1348. "item": "#f44"
  1349. }
  1350. ],
  1351. "color": [
  1352. {
  1353. "item": "#f44"
  1354. }
  1355. ]
  1356. },
  1357. "bgColor": {
  1358. "title": "背景颜色",
  1359. "name": "bgColor",
  1360. "default": [
  1361. {
  1362. "item": "#fff"
  1363. }
  1364. ],
  1365. "color": [
  1366. {
  1367. "item": "#fff"
  1368. }
  1369. ]
  1370. },
  1371. "titleColor": {
  1372. "title": "文字颜色",
  1373. "name": "themeColor",
  1374. "default": [
  1375. {
  1376. "item": "#333333"
  1377. }
  1378. ],
  1379. "color": [
  1380. {
  1381. "item": "rgba(51,51,51,1)"
  1382. }
  1383. ]
  1384. },
  1385. "mbConfig": {
  1386. "title": "页面间距",
  1387. "val": 12,
  1388. "min": 0
  1389. },
  1390. "id": "id1665385357481003"
  1391. },
  1392. "1666235374470005": {
  1393. "name": "combination",
  1394. "timestamp": "1666235374470005",
  1395. "setUp": {
  1396. "tabVal": 1
  1397. },
  1398. "numConfig": {
  1399. "val": 3
  1400. },
  1401. "priceShow": {
  1402. "title": "是否显示价格",
  1403. "val": true
  1404. },
  1405. "bntShow": {
  1406. "title": "是否显示按钮",
  1407. "val": true
  1408. },
  1409. "titleShow": {
  1410. "title": "是否显示名称",
  1411. "val": true
  1412. },
  1413. "pinkShow": {
  1414. "title": "是否显示拼团标签",
  1415. "val": true
  1416. },
  1417. "joinShow": {
  1418. "title": "是否显示参团标签",
  1419. "val": true
  1420. },
  1421. "txtColor": {
  1422. "title": "文字背景色",
  1423. "name": "themeColor",
  1424. "default": [
  1425. {
  1426. "item": "rgba(255,68,68,0.1)"
  1427. }
  1428. ],
  1429. "color": [
  1430. {
  1431. "item": "rgba(208,240,255,1)"
  1432. }
  1433. ]
  1434. },
  1435. "conStyle": {
  1436. "title": "背景样式",
  1437. "name": "conStyle",
  1438. "type": 1,
  1439. "list": [
  1440. {
  1441. "val": "直角",
  1442. "icon": "iconPic_square"
  1443. },
  1444. {
  1445. "val": "圆角",
  1446. "icon": "iconPic_fillet"
  1447. }
  1448. ]
  1449. },
  1450. "bgColor": {
  1451. "title": "背景颜色",
  1452. "name": "themeColor",
  1453. "default": [
  1454. {
  1455. "item": "#fff"
  1456. }
  1457. ],
  1458. "color": [
  1459. {
  1460. "item": "#fff"
  1461. }
  1462. ]
  1463. },
  1464. "prConfig": {
  1465. "title": "背景边距",
  1466. "val": 10,
  1467. "min": 0
  1468. },
  1469. "themeColor": {
  1470. "title": "主题风格",
  1471. "name": "themeColor",
  1472. "default": [
  1473. {
  1474. "item": "#E93323"
  1475. }
  1476. ],
  1477. "color": [
  1478. {
  1479. "item": "rgba(29,176,252,1)"
  1480. }
  1481. ]
  1482. },
  1483. "mbConfig": {
  1484. "title": "页面间距",
  1485. "val": 12,
  1486. "min": 0
  1487. },
  1488. "lrConfig": {
  1489. "title": "左右边距",
  1490. "val": 10,
  1491. "min": 0
  1492. },
  1493. "imgConfig": {
  1494. "title": "最多可添加1张图片,建议宽度18 * 18px",
  1495. "url": "https://qiniu.crmeb.net/attach/2021/11/238c5202111181433515309.gif"
  1496. },
  1497. "id": "id1665385357481005"
  1498. },
  1499. "1666235374470006": {
  1500. "name": "bargain",
  1501. "timestamp": "1666235374470006",
  1502. "setUp": {
  1503. "tabVal": 1
  1504. },
  1505. "numConfig": {
  1506. "val": 3
  1507. },
  1508. "priceShow": {
  1509. "title": "是否显示价格",
  1510. "val": true
  1511. },
  1512. "bntShow": {
  1513. "title": "是否显示按钮",
  1514. "val": true
  1515. },
  1516. "themeColor": {
  1517. "title": "主题风格",
  1518. "name": "themeColor",
  1519. "default": [
  1520. {
  1521. "item": "#E93323"
  1522. }
  1523. ],
  1524. "color": [
  1525. {
  1526. "item": "rgba(29,176,252,1)"
  1527. }
  1528. ]
  1529. },
  1530. "titleColor": {
  1531. "title": "标题颜色",
  1532. "name": "txtColor",
  1533. "default": [
  1534. {
  1535. "item": "#FF6000"
  1536. }
  1537. ],
  1538. "color": [
  1539. {
  1540. "item": "rgba(255,152,0,1)"
  1541. }
  1542. ]
  1543. },
  1544. "bgColor": {
  1545. "title": "背景颜色",
  1546. "name": "bgColor",
  1547. "default": [
  1548. {
  1549. "item": "#FDDBB2"
  1550. },
  1551. {
  1552. "item": "#FDEFC6"
  1553. }
  1554. ],
  1555. "color": [
  1556. {
  1557. "item": "#FDDBB2"
  1558. },
  1559. {
  1560. "item": "#FDEFC6"
  1561. }
  1562. ]
  1563. },
  1564. "bgStyle": {
  1565. "title": "背景样式",
  1566. "name": "bgStyle",
  1567. "type": 1,
  1568. "list": [
  1569. {
  1570. "val": "直角",
  1571. "icon": "iconPic_square"
  1572. },
  1573. {
  1574. "val": "圆角",
  1575. "icon": "iconPic_fillet"
  1576. }
  1577. ]
  1578. },
  1579. "prConfig": {
  1580. "title": "背景边距",
  1581. "val": 10,
  1582. "min": 0
  1583. },
  1584. "productGap": {
  1585. "title": "商品间距",
  1586. "val": 10,
  1587. "min": 0
  1588. },
  1589. "mbCongfig": {
  1590. "title": "页面间距",
  1591. "val": 0,
  1592. "min": 0
  1593. },
  1594. "id": "id1665385357481006"
  1595. },
  1596. "1666235374470007": {
  1597. "name": "seckill",
  1598. "timestamp": "1666235374470007",
  1599. "setUp": {
  1600. "tabVal": 1
  1601. },
  1602. "countDownColor": {
  1603. "title": "倒计时背景色",
  1604. "name": "countDownColor",
  1605. "default": [
  1606. {
  1607. "item": "rgba(252,60,62,0.09)"
  1608. }
  1609. ],
  1610. "color": [
  1611. {
  1612. "item": "rgba(255,255,255,0.09)"
  1613. }
  1614. ]
  1615. },
  1616. "themeColor": {
  1617. "title": "主题风格",
  1618. "name": "themeColor",
  1619. "default": [
  1620. {
  1621. "item": "#E93323"
  1622. }
  1623. ],
  1624. "color": [
  1625. {
  1626. "item": "rgba(29,176,255,1)"
  1627. }
  1628. ]
  1629. },
  1630. "conStyle": {
  1631. "title": "背景样式",
  1632. "name": "conStyle",
  1633. "type": 1,
  1634. "list": [
  1635. {
  1636. "val": "直角",
  1637. "icon": "iconPic_square"
  1638. },
  1639. {
  1640. "val": "圆角",
  1641. "icon": "iconPic_fillet"
  1642. }
  1643. ]
  1644. },
  1645. "bgColor": {
  1646. "title": "背景颜色",
  1647. "name": "themeColor",
  1648. "default": [
  1649. {
  1650. "item": "#fff"
  1651. }
  1652. ],
  1653. "color": [
  1654. {
  1655. "item": "#fff"
  1656. }
  1657. ]
  1658. },
  1659. "prConfig": {
  1660. "title": "背景边距",
  1661. "val": 10,
  1662. "min": 0
  1663. },
  1664. "priceShow": {
  1665. "title": "是否显示价格",
  1666. "val": true
  1667. },
  1668. "discountShow": {
  1669. "title": "是否显示折扣标签",
  1670. "val": true
  1671. },
  1672. "titleShow": {
  1673. "title": "是否显示名称",
  1674. "val": true
  1675. },
  1676. "seckillShow": {
  1677. "title": "抢购标签",
  1678. "val": true
  1679. },
  1680. "numberConfig": {
  1681. "val": 3
  1682. },
  1683. "lrConfig": {
  1684. "title": "左右边距",
  1685. "val": 10,
  1686. "min": 0
  1687. },
  1688. "mbConfig": {
  1689. "title": "页面间距",
  1690. "val": 0,
  1691. "min": 0
  1692. },
  1693. "imgConfig": {
  1694. "title": "最多可添加1张图片,建议宽度18 * 18px",
  1695. "url": "https://demo26.crmeb.net/uploads/attach/2022/09/20220930/e537a7fc631006d3571d7a8574438b03.gif"
  1696. },
  1697. "id": "id1665385357481007"
  1698. },
  1699. "1666235374470009": {
  1700. "name": "promotionList",
  1701. "timestamp": "1666235374470009",
  1702. "setUp": {
  1703. "tabVal": 1
  1704. },
  1705. "productList": {
  1706. "title": "促销列表"
  1707. },
  1708. "titleConfig": {
  1709. "title": "标题位置",
  1710. "type": 2,
  1711. "list": [
  1712. {
  1713. "val": "居左",
  1714. "icon": "icondoc_left"
  1715. },
  1716. {
  1717. "val": "居中",
  1718. "icon": "icondoc_center"
  1719. },
  1720. {
  1721. "val": "居右",
  1722. "icon": "icondoc_right"
  1723. }
  1724. ]
  1725. },
  1726. "titleShow": {
  1727. "title": "是否显示商品名称",
  1728. "val": true
  1729. },
  1730. "opriceShow": {
  1731. "title": "是否显示商品原价",
  1732. "val": true
  1733. },
  1734. "priceShow": {
  1735. "title": "是否显示商品价格",
  1736. "val": true
  1737. },
  1738. "couponShow": {
  1739. "title": "是否显示优惠券",
  1740. "val": true
  1741. },
  1742. "tabConfig": {
  1743. "title": "最多可添加4个版块;鼠标拖拽左侧圆点可调整版块顺序",
  1744. "max": 4,
  1745. "tabCur": 3,
  1746. "list": [
  1747. {
  1748. "chiild": [
  1749. {
  1750. "title": "标题",
  1751. "val": "首发新品",
  1752. "max": 4,
  1753. "pla": "选填,不超过四个字"
  1754. },
  1755. {
  1756. "title": "简介",
  1757. "val": "最新出炉",
  1758. "max": 4,
  1759. "pla": "选填,不超过四个字"
  1760. }
  1761. ],
  1762. "link": {
  1763. "title": "链接",
  1764. "activeVal": 3,
  1765. "optiops": [
  1766. {
  1767. "type": 0,
  1768. "value": 1,
  1769. "label": "精品推荐"
  1770. },
  1771. {
  1772. "type": 1,
  1773. "value": 2,
  1774. "label": "热门榜单"
  1775. },
  1776. {
  1777. "type": 2,
  1778. "value": 3,
  1779. "label": "首发新品"
  1780. },
  1781. {
  1782. "type": 3,
  1783. "value": 4,
  1784. "label": "促销单品"
  1785. }
  1786. ]
  1787. }
  1788. },
  1789. {
  1790. "chiild": [
  1791. {
  1792. "title": "标题",
  1793. "val": "精品推荐",
  1794. "max": 4,
  1795. "pla": "选填,不超过四个字"
  1796. },
  1797. {
  1798. "title": "简介",
  1799. "val": "猜你喜欢",
  1800. "max": 4,
  1801. "pla": "选填,不超过四个字"
  1802. }
  1803. ],
  1804. "link": {
  1805. "title": "链接",
  1806. "activeVal": 1,
  1807. "optiops": [
  1808. {
  1809. "type": 0,
  1810. "value": 1,
  1811. "label": "精品推荐"
  1812. },
  1813. {
  1814. "type": 1,
  1815. "value": 2,
  1816. "label": "热门榜单"
  1817. },
  1818. {
  1819. "type": 2,
  1820. "value": 3,
  1821. "label": "首发新品"
  1822. },
  1823. {
  1824. "type": 3,
  1825. "value": 4,
  1826. "label": "促销单品"
  1827. }
  1828. ]
  1829. }
  1830. },
  1831. {
  1832. "chiild": [
  1833. {
  1834. "title": "标题",
  1835. "val": "热门榜单",
  1836. "max": 4,
  1837. "pla": "选填,不超过四个字"
  1838. },
  1839. {
  1840. "title": "简介",
  1841. "val": "好评如云",
  1842. "max": 4,
  1843. "pla": "选填,不超过四个字"
  1844. }
  1845. ],
  1846. "link": {
  1847. "title": "链接",
  1848. "activeVal": 2,
  1849. "optiops": [
  1850. {
  1851. "type": 0,
  1852. "value": 1,
  1853. "label": "精品推荐"
  1854. },
  1855. {
  1856. "type": 1,
  1857. "value": 2,
  1858. "label": "热门榜单"
  1859. },
  1860. {
  1861. "type": 2,
  1862. "value": 3,
  1863. "label": "首发新品"
  1864. },
  1865. {
  1866. "type": 3,
  1867. "value": 4,
  1868. "label": "促销单品"
  1869. }
  1870. ]
  1871. }
  1872. },
  1873. {
  1874. "chiild": [
  1875. {
  1876. "title": "标题",
  1877. "val": "促销单品",
  1878. "max": 4,
  1879. "pla": "选填,不超过四个字"
  1880. },
  1881. {
  1882. "title": "简介",
  1883. "val": "多买多销",
  1884. "max": 4,
  1885. "pla": "选填,不超过四个字"
  1886. }
  1887. ],
  1888. "link": {
  1889. "title": "链接",
  1890. "activeVal": 4,
  1891. "optiops": [
  1892. {
  1893. "type": 0,
  1894. "value": 1,
  1895. "label": "精品推荐"
  1896. },
  1897. {
  1898. "type": 1,
  1899. "value": 2,
  1900. "label": "热门榜单"
  1901. },
  1902. {
  1903. "type": 2,
  1904. "value": 3,
  1905. "label": "首发新品"
  1906. },
  1907. {
  1908. "type": 3,
  1909. "value": 4,
  1910. "label": "促销单品"
  1911. }
  1912. ]
  1913. }
  1914. }
  1915. ]
  1916. },
  1917. "themeColor": {
  1918. "title": "主题风格",
  1919. "name": "themeColor",
  1920. "default": [
  1921. {
  1922. "item": "#F95429"
  1923. }
  1924. ],
  1925. "color": [
  1926. {
  1927. "item": "rgba(29,176,252,1)"
  1928. }
  1929. ]
  1930. },
  1931. "fontColor": {
  1932. "title": "价格颜色",
  1933. "name": "fontColor",
  1934. "default": [
  1935. {
  1936. "item": "#e93323"
  1937. }
  1938. ],
  1939. "color": [
  1940. {
  1941. "item": "rgba(253,80,47,1)"
  1942. }
  1943. ]
  1944. },
  1945. "labelColor": {
  1946. "title": "活动标签",
  1947. "name": "labelColor",
  1948. "default": [
  1949. {
  1950. "item": "#e93323"
  1951. }
  1952. ],
  1953. "color": [
  1954. {
  1955. "item": "rgba(29,176,252,1)"
  1956. }
  1957. ]
  1958. },
  1959. "mbConfig": {
  1960. "title": "页面间距",
  1961. "val": 0,
  1962. "min": 0
  1963. },
  1964. "numConfig": {
  1965. "val": 9
  1966. },
  1967. "id": "id1665385357481008"
  1968. },
  1969. "1666235390875000": {
  1970. "name": "pageFoot",
  1971. "setUp": {
  1972. "tabVal": 0
  1973. },
  1974. "status": {
  1975. "title": "是否自定义",
  1976. "name": "status",
  1977. "status": true
  1978. },
  1979. "txtColor": {
  1980. "title": "文字颜色",
  1981. "name": "txtColor",
  1982. "default": [
  1983. {
  1984. "item": "#282828"
  1985. }
  1986. ],
  1987. "color": [
  1988. {
  1989. "item": "rgba(51,51,51,1)"
  1990. }
  1991. ]
  1992. },
  1993. "activeTxtColor": {
  1994. "title": "选中文字颜色",
  1995. "name": "txtColor",
  1996. "default": [
  1997. {
  1998. "item": "#F62C2C"
  1999. }
  2000. ],
  2001. "color": [
  2002. {
  2003. "item": "rgba(29,176,252,1)"
  2004. }
  2005. ]
  2006. },
  2007. "bgColor": {
  2008. "title": "背景颜色",
  2009. "name": "bgColor",
  2010. "default": [
  2011. {
  2012. "item": "#fff"
  2013. }
  2014. ],
  2015. "color": [
  2016. {
  2017. "item": "#fff"
  2018. }
  2019. ]
  2020. },
  2021. "menuList": [
  2022. {
  2023. "imgList": [
  2024. "https://qiniu.crmeb.net/attach/2021/11/bdf25202111181452426458.png",
  2025. "https://qiniu.crmeb.net/attach/2021/11/aaf1b202111181452576658.png"
  2026. ],
  2027. "name": "首页",
  2028. "link": "/pages/index/index"
  2029. },
  2030. {
  2031. "imgList": [
  2032. "https://demo26.crmeb.net/uploads/attach/2022/09/20220923/14367a2fecd502f51978ed6ea09afe19.png",
  2033. "https://qiniu.crmeb.net/attach/2021/11/59d4a202111181453208678.png"
  2034. ],
  2035. "name": "分类",
  2036. "link": "/pages/goods_cate/goods_cate"
  2037. },
  2038. {
  2039. "imgList": [
  2040. "https://qiniu.crmeb.net/attach/2021/11/076ac202111181453294517.png",
  2041. "https://qiniu.crmeb.net/attach/2021/11/201c9202111181453378599.png"
  2042. ],
  2043. "name": "购物车",
  2044. "link": "/pages/order_addcart/order_addcart"
  2045. },
  2046. {
  2047. "imgList": [
  2048. "https://qiniu.crmeb.net/attach/2021/11/f04cf20211118145343755.png",
  2049. "https://qiniu.crmeb.net/attach/2021/11/3a141202111181453495771.png"
  2050. ],
  2051. "name": "我的",
  2052. "link": "/pages/user/index"
  2053. }
  2054. ],
  2055. "id": "idundefined"
  2056. }
  2057. }
  2058. getDiy(0).then(res => {
  2059. setTimeout(() => {
  2060. this.isNodes++;
  2061. }, 0);
  2062. this.errorNetwork = false
  2063. let data = res.data;
  2064. if (data.is_bg_color) {
  2065. this.bgColor = data.color_picker
  2066. }
  2067. if (data.is_bg_pic) {
  2068. this.bgPic = data.bg_pic
  2069. this.bgTabVal = data.bg_tab_val
  2070. }
  2071. this.pageShow = data.is_show
  2072. uni.setNavigationBarTitle({
  2073. title: res.data.title
  2074. });
  2075. let temp = [];
  2076. let lastArr = that.objToArr(value);
  2077. lastArr.forEach((item, index, arr) => {
  2078. if (item.name == 'headerSerch') {
  2079. this.isHeaderSerch = true
  2080. }
  2081. if (item.name == 'pageFoot') {
  2082. console.log(item.status)
  2083. if (item.status && item.status.status) {
  2084. this.newData = item
  2085. setTimeout((e) => {
  2086. that.$set(that, 'footerStatus', true);
  2087. console.log(this.footerStatus)
  2088. }, 50)
  2089. }
  2090. uni.setStorageSync('FOOTER_BAR', item.status && item.status.status ? true :
  2091. false)
  2092. item.menuList.map((path, index) => {
  2093. if (path.link === '/pages/order_addcart/order_addcart') {
  2094. uni.setStorageSync('FOOTER_ADDCART', index)
  2095. }
  2096. })
  2097. arr.splice(index, 1);
  2098. }
  2099. if (item.name == 'promotionList') {
  2100. that.numConfig = item.numConfig.val;
  2101. that.goodType = item.tabConfig.list[0].link.activeVal;
  2102. that.getGroomList();
  2103. }
  2104. if (item.name == 'tabNav') {
  2105. // #ifndef APP-PLUS
  2106. // uni.showLoading({
  2107. // title: '加载中',
  2108. // mask: true,
  2109. // });
  2110. // #endif
  2111. // setTimeout(function() {
  2112. // uni.hideLoading();
  2113. // }, 8000);
  2114. }
  2115. temp = arr;
  2116. });
  2117. function sortNumber(a, b) {
  2118. return a.timestamp - b.timestamp;
  2119. }
  2120. temp.sort(sortNumber)
  2121. that.styleConfig = temp;
  2122. setTimeout(() => {
  2123. this.showSkeleton = false
  2124. }, 300)
  2125. uni.stopPullDownRefresh({
  2126. success: (e) => { },
  2127. });
  2128. }).catch(error => {
  2129. // #ifdef APP-PLUS
  2130. if (error.status) {
  2131. uni.hideLoading()
  2132. if (that.errorNetwork) {
  2133. uni.showToast({
  2134. title: this.$t(`连接失败`),
  2135. icon: 'none',
  2136. duration: 2000
  2137. })
  2138. }
  2139. this.errorNetwork = true
  2140. this.showSkeleton = false;
  2141. }
  2142. // #endif
  2143. });
  2144. },
  2145. getIndexData() { },
  2146. changeBarg(item) {
  2147. if (!this.isLogin) {
  2148. toLogin();
  2149. } else {
  2150. uni.navigateTo({
  2151. url: `/pages/activity/goods_bargain_details/index?id=${item.id}&bargain=${this.$store.state.app.uid}`
  2152. });
  2153. }
  2154. },
  2155. // 促销列表的点击事件;
  2156. changeTab(type) {
  2157. this.goodType = type;
  2158. this.tempArr = [];
  2159. this.page = 1;
  2160. this.loadend = false;
  2161. let onloadH = true;
  2162. this.getGroomList(onloadH);
  2163. },
  2164. // 精品推荐
  2165. getGroomList(onloadH) {
  2166. let that = this;
  2167. let type = that.goodType;
  2168. if (that.loadend) return false;
  2169. if (that.loading) return false;
  2170. if (onloadH) {
  2171. that.$set(that, 'iSshowH', true);
  2172. }
  2173. getGroomList(type, {
  2174. page: that.page,
  2175. limit: this.numConfig
  2176. })
  2177. .then(({
  2178. data
  2179. }) => {
  2180. that.$set(that, 'iSshowH', false);
  2181. let maxPage = Math.ceil(this.numConfig / this.limit);
  2182. let list = data.list,
  2183. loadend = list.length < that.limit || that.page >= maxPage;
  2184. let tempArr = that.$util.SplitArray(list, that.tempArr);
  2185. that.$set(that, 'tempArr', tempArr.slice(0, this.numConfig));
  2186. that.loadend = loadend;
  2187. that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
  2188. that.page = that.page + 1;
  2189. that.loading = false;
  2190. })
  2191. .catch(res => {
  2192. that.loading = false;
  2193. that.loadTitle = that.$t(`加载更多`);
  2194. });
  2195. },
  2196. goRouter(item) {
  2197. var pages = getCurrentPages();
  2198. var page = (pages[pages.length - 1]).$page.fullPath;
  2199. if (item.link == page) return
  2200. uni.switchTab({
  2201. url: item.link,
  2202. fail(err) {
  2203. uni.redirectTo({
  2204. url: item.link
  2205. })
  2206. }
  2207. })
  2208. },
  2209. goDetail(item) {
  2210. goShopDetail(item, this.$store.state.app.uid).then(res => {
  2211. uni.navigateTo({
  2212. url: `/pages/goods_details/index?id=${item.id}`
  2213. });
  2214. });
  2215. },
  2216. onsollBotton() {
  2217. console.log('????', this.isSortType)
  2218. if (this.isSortType == 0) {
  2219. // this.getGroomList();
  2220. } else {
  2221. this.getGoodsList();
  2222. }
  2223. }
  2224. },
  2225. onReachBottom: function () {
  2226. },
  2227. onPageScroll(e) {
  2228. // #ifdef H5
  2229. if (this.isHeaderSerch) {
  2230. if (e.scrollTop > this.domOffsetTop) {
  2231. this.isFixed = true;
  2232. }
  2233. if (e.scrollTop < this.domOffsetTop) {
  2234. this.$nextTick(() => {
  2235. this.isFixed = false;
  2236. });
  2237. }
  2238. } else {
  2239. this.isFixed = false
  2240. }
  2241. // #endif
  2242. },
  2243. //#ifdef MP
  2244. onShareAppMessage() {
  2245. return {
  2246. title: this.shareInfo.title,
  2247. path: '/pages/index/index'
  2248. };
  2249. },
  2250. //分享到朋友圈
  2251. onShareTimeline: function () {
  2252. return {
  2253. title: this.shareInfo.title,
  2254. imageUrl: this.shareInfo.img
  2255. };
  2256. }
  2257. //#endif
  2258. };
  2259. </script>
  2260. <style lang="scss">
  2261. // page {
  2262. // padding-bottom: 50px;
  2263. // }
  2264. .pictrue_log_class {
  2265. background-color: var(--view-theme);
  2266. }
  2267. .page {
  2268. padding-bottom: 50px;
  2269. }
  2270. .ysize {
  2271. background-size: 100%;
  2272. }
  2273. .fullsize {
  2274. background-size: 100% 100%;
  2275. }
  2276. .repeat {
  2277. background-repeat: repeat;
  2278. }
  2279. .noRepeat {
  2280. background-repeat: no-repeat;
  2281. }
  2282. .privacy-wrapper {
  2283. z-index: 999;
  2284. position: fixed;
  2285. left: 0;
  2286. top: 0;
  2287. width: 100%;
  2288. height: 100%;
  2289. background: #7F7F7F;
  2290. .privacy-box {
  2291. position: absolute;
  2292. left: 50%;
  2293. top: 50%;
  2294. transform: translate(-50%, -50%);
  2295. width: 560rpx;
  2296. padding: 50rpx 45rpx 0;
  2297. background: #fff;
  2298. border-radius: 20rpx;
  2299. .title {
  2300. text-align: center;
  2301. font-size: 32rpx;
  2302. text-align: center;
  2303. color: #333;
  2304. font-weight: 700;
  2305. }
  2306. .content {
  2307. margin-top: 20rpx;
  2308. line-height: 1.5;
  2309. font-size: 26rpx;
  2310. color: #666;
  2311. navigator {
  2312. display: inline-block;
  2313. color: #E93323;
  2314. }
  2315. }
  2316. .btn-box {
  2317. margin-top: 40rpx;
  2318. text-align: center;
  2319. font-size: 30rpx;
  2320. .btn-item {
  2321. height: 82rpx;
  2322. line-height: 82rpx;
  2323. background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
  2324. color: #fff;
  2325. border-radius: 41rpx;
  2326. }
  2327. .btn {
  2328. padding: 30rpx 0;
  2329. }
  2330. }
  2331. }
  2332. }
  2333. .error-network {
  2334. position: fixed;
  2335. left: 0;
  2336. top: 0;
  2337. display: flex;
  2338. flex-direction: column;
  2339. align-items: center;
  2340. width: 100%;
  2341. height: 100%;
  2342. padding-top: 40rpx;
  2343. background: #fff;
  2344. image {
  2345. width: 414rpx;
  2346. height: 336rpx;
  2347. }
  2348. .title {
  2349. position: relative;
  2350. top: -40rpx;
  2351. font-size: 32rpx;
  2352. color: #666;
  2353. }
  2354. .con {
  2355. font-size: 24rpx;
  2356. color: #999;
  2357. .label {
  2358. margin-bottom: 20rpx;
  2359. }
  2360. .item {
  2361. margin-bottom: 20rpx;
  2362. }
  2363. }
  2364. .btn {
  2365. display: flex;
  2366. align-items: center;
  2367. justify-content: center;
  2368. width: 508rpx;
  2369. height: 86rpx;
  2370. margin-top: 100rpx;
  2371. border: 1px solid #D74432;
  2372. color: #E93323;
  2373. font-size: 30rpx;
  2374. border-radius: 120rpx;
  2375. }
  2376. }
  2377. .sort-product {
  2378. margin-top: 20rpx;
  2379. .sort-box {
  2380. display: flex;
  2381. width: 100%;
  2382. border-radius: 16rpx;
  2383. padding: 30rpx 0;
  2384. .sort-item {
  2385. width: 20%;
  2386. display: flex;
  2387. flex-direction: column;
  2388. align-items: center;
  2389. justify-content: center;
  2390. flex-shrink: 0;
  2391. image {
  2392. width: 90rpx;
  2393. height: 90rpx;
  2394. border-radius: 50%;
  2395. }
  2396. .txt {
  2397. color: #272727;
  2398. font-size: 24rpx;
  2399. margin-top: 10rpx;
  2400. overflow: hidden;
  2401. white-space: nowrap;
  2402. text-overflow: ellipsis;
  2403. width: 140rpx;
  2404. text-align: center;
  2405. }
  2406. .pictrues {
  2407. width: 90rpx;
  2408. height: 90rpx;
  2409. background: #f8f8f8;
  2410. border-radius: 50%;
  2411. margin: 0 auto;
  2412. }
  2413. .icon-gengduo1 {
  2414. color: #333;
  2415. }
  2416. &.on {
  2417. .txt {
  2418. color: #fc4141;
  2419. }
  2420. image {
  2421. border: 1px solid #fc4141;
  2422. }
  2423. }
  2424. }
  2425. }
  2426. .product-list {
  2427. display: flex;
  2428. flex-wrap: wrap;
  2429. justify-content: space-between;
  2430. margin-top: 30rpx;
  2431. padding: 0 20rpx;
  2432. .product-item {
  2433. position: relative;
  2434. width: 344rpx;
  2435. background: #fff;
  2436. border-radius: 10rpx;
  2437. margin-bottom: 20rpx;
  2438. display: flex;
  2439. flex-direction: column;
  2440. image {
  2441. width: 100%;
  2442. height: 344rpx;
  2443. border-radius: 10rpx 10rpx 0 0;
  2444. }
  2445. .info {
  2446. flex: 1;
  2447. padding: 14rpx 16rpx;
  2448. display: flex;
  2449. flex-direction: column;
  2450. justify-content: space-between;
  2451. .title {
  2452. font-size: 28rpx;
  2453. }
  2454. .price-box {
  2455. font-size: 34rpx;
  2456. font-weight: 700;
  2457. margin-top: 8px;
  2458. color: #fc4141;
  2459. text {
  2460. font-size: 26rpx;
  2461. }
  2462. }
  2463. }
  2464. }
  2465. }
  2466. }
  2467. .emptyBox {
  2468. text-align: center;
  2469. padding-top: 20rpx;
  2470. .tips {
  2471. color: #aaa;
  2472. font-size: 26rpx;
  2473. padding-bottom: 20rpx;
  2474. }
  2475. image {
  2476. width: 414rpx;
  2477. height: 304rpx;
  2478. }
  2479. }
  2480. .site-config {
  2481. margin-top: 40rpx;
  2482. font-size: 24rpx;
  2483. text-align: center;
  2484. color: #666;
  2485. &.fixed {
  2486. position: fixed;
  2487. bottom: 69px;
  2488. left: 0;
  2489. width: 100%;
  2490. }
  2491. }
  2492. .page-footer {
  2493. position: fixed;
  2494. bottom: 0;
  2495. z-index: 30;
  2496. display: flex;
  2497. align-items: center;
  2498. justify-content: space-around;
  2499. width: 100%;
  2500. height: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  2501. height: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  2502. box-sizing: border-box;
  2503. border-top: solid 1rpx #F3F3F3;
  2504. background-color: #fff;
  2505. box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
  2506. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  2507. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  2508. .foot-item {
  2509. display: flex;
  2510. width: max-content;
  2511. align-items: center;
  2512. justify-content: center;
  2513. flex-direction: column;
  2514. position: relative;
  2515. .count-num {
  2516. position: absolute;
  2517. display: flex;
  2518. justify-content: center;
  2519. align-items: center;
  2520. width: 40rpx;
  2521. height: 40rpx;
  2522. top: 0rpx;
  2523. right: -15rpx;
  2524. color: #fff;
  2525. font-size: 20rpx;
  2526. background-color: #FD502F;
  2527. border-radius: 50%;
  2528. padding: 4rpx;
  2529. }
  2530. }
  2531. .foot-item image {
  2532. height: 50rpx;
  2533. width: 50rpx;
  2534. text-align: center;
  2535. margin: 0 auto;
  2536. }
  2537. .foot-item .txt {
  2538. font-size: 24rpx;
  2539. &.active {}
  2540. }
  2541. }
  2542. </style>