index.vue 60 KB

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