store_cate1.vue 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298
  1. <template>
  2. <view>
  3. <view class="headerBg">
  4. <image :src="info.background_image" mode="aspectFill" class="image"></image>
  5. <view class="shade"></view>
  6. <!-- #ifdef MP || APP -->
  7. <view :style="{height: getHeight.barTop+'px'}"></view>
  8. <view :style="{height: getHeight.barHeight+'px'}"></view>
  9. <!-- #endif -->
  10. <view style="height: 224rpx;"></view>
  11. </view>
  12. <view class="page acea-row row-column">
  13. <view class="search-box" :style="{height: headerHeight ? (headerHeight+'px') : 'auto'}">
  14. <view class="input-box" id="input-box" :class="{fixed: scrollTop > 0}">
  15. <!-- #ifdef MP || APP -->
  16. <view :style="{height: getHeight.barTop+'px'}"></view>
  17. <!-- #endif -->
  18. <!-- 顶部搜索框 -->
  19. <!-- #ifdef MP -->
  20. <view class="input-wrapper acea-row row-middle" :style="{height: getHeight.barHeight+'px'}">
  21. <view class="menu_box flex-center" @tap="moreNav">
  22. <text class="iconfont icon-a-icon_menu1x"></text>
  23. </view>
  24. <navigator url="/pages/goods/goods_search/index" class="input acea-row row-middle" hover-class="none">
  25. <text class="iconfont icon-ic_search"></text>搜索商品
  26. </navigator>
  27. <view v-if="info.store_splicing_switch" class="group-btn" @click="onCollage">
  28. <image :src="imgHost+'/statics/images/group-btn.png'" mode="aspectFit" class="img"></image>
  29. </view>
  30. <view :style="{width: getHeight.barWidth+'px'}"></view>
  31. </view>
  32. <!-- #endif -->
  33. <!-- #ifndef MP -->
  34. <view class="input-wrapper acea-row row-middle">
  35. <view class="menu_box flex-center" @tap="moreNav">
  36. <text class="iconfont icon-a-icon_menu1x"></text>
  37. </view>
  38. <navigator url="/pages/goods/goods_search/index" class="input acea-row row-middle" hover-class="none">
  39. <text class="iconfont icon-ic_search"></text>搜索商品
  40. </navigator>
  41. <!-- #ifdef H5 -->
  42. <view v-if="info.store_splicing_switch && $wechat.isWeixin()" class="group-btn" @click="onCollage">
  43. <image :src="imgHost+'/statics/images/group-btn.png'" mode="aspectFit" class="img"></image>
  44. </view>
  45. <!-- #endif -->
  46. </view>
  47. <!-- #endif -->
  48. </view>
  49. </view>
  50. <!-- 门店地址详情 -->
  51. <view class="store-section">
  52. <view class="panel">
  53. <view class="acea-row row-middle store-name">
  54. <view class="name-wrap">
  55. <navigator :url="'/pages/store/info/index?store_id='+info.id" hover-class="none" class="acea-row row-middle name-inner">
  56. <text class="iconfont icon-ic_mall"></text>
  57. <view class="name line1">{{info.name}}</view>
  58. <text class="iconfont icon-ic_rightarrow"></text>
  59. </navigator>
  60. </view>
  61. <view class="switch acea-row" v-if="deliveryList.length > 1">
  62. <view v-for="(item, index) in deliveryList" :key="item.key" :class="{ on: switchNum == item.key }" class="btn" @click="swithFn(item.key)">
  63. {{item.name}}
  64. </view>
  65. </view>
  66. <view class="tips" v-else-if="deliveryList.length == 1">门店支持{{deliveryList[0].name}}</view>
  67. </view>
  68. <view class="address-wrap acea-row row-bottom">
  69. <view class="address-box">
  70. <view class="time">营业时间:{{info.day_time}}</view>
  71. <view class="address-info">
  72. <text class="distance">距您{{info.range}}km</text>
  73. {{info.address}}{{info.detailed_address}}
  74. </view>
  75. </view>
  76. <view class="acea-row btn-box">
  77. <view class="btn" @click="showMaoLocation">
  78. <text class="iconfont icon-ic_location5"></text>
  79. <view class="">地图</view>
  80. </view>
  81. <view class="btn" @click="goKefu">
  82. <text class="iconfont icon-ic_customerservice"></text>
  83. <view class="">客服</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="category acea-row" v-if="level == 3">
  90. <scroll-view scroll-x="true" class="scroll-view">
  91. <view class="item" :class="{ on: navOneActive == index }" v-for="(item,index) in categoryList" :key="item.id" @click="tapNavOne(item,index)">
  92. <view class="img-box">
  93. <image :src="item.pic" class="img"></image>
  94. </view>
  95. <view class="title">{{item.cate_name}}</view>
  96. </view>
  97. </scroll-view>
  98. <view class="btn acea-row row-column row-center row-middle" @click="navOneOpen">
  99. <view class="">全</view>
  100. <view class="">部</view>
  101. <image class="w-28 h-28 block mt-8" src="@/static/img/all_pic.png"></image>
  102. <image src="../static/shade.png" class="img"></image>
  103. </view>
  104. </view>
  105. <view class="conter acea-row" id="conter-box">
  106. <view class="aside-box">
  107. <scroll-view scroll-y="true" class="aside" :class="{ fixed: scrollTop && conterTop <= headerHeight }" :style="{ top: headerHeight+'px' }">
  108. <view class='item' :class="{
  109. on: index==navActive,
  110. btr: index-1==navActive,
  111. bbr: index+1==navActive
  112. }" v-for="(item,index) in categoryErList" :key="index" @click="tapNav(index,item)">
  113. <view class="inner acea-row row-center-wrapper">
  114. <text>{{item.cate_name}}</text>
  115. </view>
  116. </view>
  117. <view class="cartIcon-placeholder"></view>
  118. <view class="safe-area-inset-bottom"></view>
  119. </scroll-view>
  120. </view>
  121. <view class="wrapper">
  122. <view class="bgcolor-box">
  123. <view class="bgcolor acea-row" :class="{ fixed: scrollTop && conterTop <= headerHeight }" :style="{ top: headerHeight+'px' }">
  124. <view class="longTab acea-row row-middle">
  125. <scroll-view scroll-x="true" style="white-space: nowrap;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="true">
  126. <view class="longItem" :style='"width:"+isWidth+"px"' :class="index===tabClick?'click':''" v-for="(item,index) in categoryThreeList" :key="index"
  127. @click="longClick(index,item)">
  128. <view class="inner">{{item.cate_name}}</view>
  129. </view>
  130. </scroll-view>
  131. </view>
  132. <view class="openList">
  133. <view class="btn" @click="openTap">
  134. <text class="iconfont icon-ic_downarrow"></text>
  135. </view>
  136. <image src="../static/shade.png" class="img"></image>
  137. </view>
  138. </view>
  139. </view>
  140. <!--商品列表 -->
  141. <goodClass :tempArr="tempArr" :isLogin="isLogin" @gocartduo="goCartDuo" @gocartdan="goCartDan" @ChangeCartNumDan="ChangeCartNumDan" @detail="goDetail"></goodClass>
  142. <view class='loadingicon acea-row row-center-wrapper' v-if="tempArr.length">
  143. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  144. </view>
  145. <emptyPage v-if="page>1 && !tempArr.length" title="暂无商品,去看点别的吧~"></emptyPage>
  146. <view class="safe-area-inset-bottom"></view>
  147. </view>
  148. </view>
  149. <view class="footer">
  150. <view class="inner-box" :class="{ open: footerOpen }">
  151. <view class="inner acea-row row-between row-middle">
  152. <view class="acea-row row-bottom" style="flex-wrap: nowrap;">
  153. <BaseMoney :money="totalPrice" symbolSize="32" integerSize="48" decimalSize="32" color="#FFFFFF"></BaseMoney>
  154. <view style="white-space: nowrap;" class="detail-btn" @click="getCartLists">查看明细<text class="iconfont icon-ic_uparrow"></text></view>
  155. </view>
  156. <view class="btn" @click="subOrder">去结算({{cartNum}})</view>
  157. </view>
  158. </view>
  159. <view class="cartIcon" @click="getCartLists">
  160. <uni-badge :text="cartNum" absolute="rightTop" :offset="[6, 4]" :custom-style="{background: 'var(--view-theme)'}">
  161. <view class="image-wrap">
  162. <image src="@/static/img/cart_pic.png" class="image"></image>
  163. </view>
  164. </uni-badge>
  165. </view>
  166. </view>
  167. </view>
  168. <!-- </scroll-view> -->
  169. <!-- #ifdef H5 || MP -->
  170. <tuiDrawer :visible="collageVisible" :zIndex="970" :maskZIndex="960" mode="bottom" backgroundColor="transparent" @close="onCollageClose">
  171. <view class="dialog">
  172. <view class="dialog-head acea-row row-between row-middle">
  173. <view>发起「一起拼」</view>
  174. <view class="btn" @click="onCollageClose">
  175. <text class="iconfont icon-ic_close"></text>
  176. </view>
  177. </view>
  178. <view class="dialog-body">
  179. <view class="navbar">
  180. <view class="navbar-bg"></view>
  181. <view class="active-bg acea-row row-bottom" :class="{'row-right':collageDelivery==1}">
  182. <image v-if="collageDelivery==1" class="image2" src="../static/navbar-right-2.png"></image>
  183. <image class="image1" src="../static/navbar-left-1.png"></image>
  184. <image v-if="collageDelivery==2" class="image2" src="../static/navbar-left-2.png"></image>
  185. </view>
  186. <view class="inner acea-row">
  187. <view v-for="(item, index) in deliveryList" :key="item.key" :class="{ on: collageDelivery == item.key }" class="item acea-row row-center-wrapper"
  188. @click="collageDeliveryChange(item, index)">
  189. <text :class="'iconfont '+item.icon"></text>
  190. {{item.name}}
  191. </view>
  192. </view>
  193. </view>
  194. <view class="dialog-content" :class="{
  195. btl:collageIndex==deliveryList.length-1,
  196. btr:!collageIndex
  197. }">
  198. <scroll-view v-if="collageDelivery == 1 && addressList.length" scroll-y="true" class="address-box">
  199. <view class="list">
  200. <view v-for="(item, index) in addressList" :key="item.id" :class="{ on: item.id == addressId }" class="item acea-row row-middle" @click="onAddressChange(item)">
  201. <view class="text">
  202. <view class="info">{{item.province}}{{item.city}}{{item.district}}{{item.street}}{{item.detail}}</view>
  203. <view class="name">{{item.real_name}} {{item.phone}}</view>
  204. </view>
  205. <text class="iconfont icon-ic_complete"></text>
  206. </view>
  207. </view>
  208. </scroll-view>
  209. <navigator v-if="collageDelivery == 1 && !addressList.length" class="link" url="/pages/users/user_address/index?fromType=1" hover-class="none">
  210. <view class="title acea-row row-between-wrapper">
  211. <view>添加配送地址</view>
  212. <text class="iconfont icon-ic_rightarrow"></text>
  213. </view>
  214. <view>您还未添加配送地址,先去添加地址再下单吧~</view>
  215. </navigator>
  216. <view v-if="collageDelivery == 2" class="store-box acea-row">
  217. <view class="text">
  218. <view class="name">{{collageStore.name}}</view>
  219. <view class="info acea-row">
  220. <text class="iconfont icon-ic_location51"></text>
  221. <view class="value">{{collageStore.address}}{{collageStore.detailed_address}}</view>
  222. </view>
  223. <view class="info acea-row">
  224. <text class="iconfont icon-icon_clock"></text>
  225. <view class="value">营业时间:{{collageStore.day_time}}</view>
  226. </view>
  227. </view>
  228. <view class="map-box">
  229. <image src="../static/map2.png" class="map"></image>
  230. <view class="img-box">
  231. <image :src="collageStore.image" class="img"></image>
  232. <view class="range">距您{{collageStore.range}}km</view>
  233. <view class="dot"></view>
  234. </view>
  235. </view>
  236. </view>
  237. <view class="btn-box acea-row row-center-wrapper" v-if="collageDelivery == 1 && addressList.length">
  238. <navigator url="/pages/users/user_address/index?fromType=1" hover-class="none">
  239. 添加地址
  240. <text class="iconfont icon-ic_rightarrow"></text>
  241. </navigator>
  242. </view>
  243. </view>
  244. </view>
  245. <view class="dialog-foot">
  246. <view class="btn" @click="initCollage">发起拼单</view>
  247. </view>
  248. </view>
  249. </tuiDrawer>
  250. <!-- #endif -->
  251. <!-- 分类购物车下拉列表 -->
  252. <cartList :marginBottom="74" :cartData="cartData" @closeList="closeList" @ChangeCartNumDan="ChangeCartList" @ChangeSubDel="ChangeSubDel" @ChangeOneDel="ChangeOneDel"></cartList>
  253. <!-- 产品属性组件 -->
  254. <productWindow :attr="attr" :isShow='1' :iSplus='1' :iScart='1' :type="2" @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNumDuo" @attrVal="attrVal"
  255. @iptCartNum="iptCartNum" @goCat="goCatNum" :is_vip="is_vip" id='product-window'></productWindow>
  256. <!-- 客服弹窗 -->
  257. <Kefu ref="kefu" @closeKefu="closeKefu" :customerList="customerList" :customerType="customerType"></Kefu>
  258. <homeList :currentPage="currentPage" :navH="getHeight.barTop+40" :openNavList="diyProduct.navList"></homeList>
  259. <tuiDrawer :visible="!iSlong" mode="top" backgroundColor="transparent" @close="closeTap">
  260. <view class="downTab acea-row row-column">
  261. <!-- #ifdef MP -->
  262. <view :style="{height: getHeight.barTop+'px'}"></view>
  263. <view :style="{height: getHeight.barHeight+'px'}"></view>
  264. <!-- #endif -->
  265. <view class="title">{{categoryTitle}}</view>
  266. <scroll-view scroll-y="true" class="scroll-view">
  267. <view class="children">
  268. <view class="acea-row row-middle">
  269. <view class="item line1" :class="index===tabClick?'click':''" v-for="(item,index) in categoryThreeList" :key="index" @click="longClick(index,item)">
  270. <view class="inner">{{item.cate_name}}</view>
  271. </view>
  272. </view>
  273. </view>
  274. </scroll-view>
  275. <view class="btn acea-row row-center-wrapper" @click="closeTap">
  276. 点击收起<text class="iconfont icon-ic_uparrow"></text>
  277. </view>
  278. </view>
  279. </tuiDrawer>
  280. <tuiDrawer :visible="oneVisible" mode="top" backgroundColor="transparent" @close="navOneClose">
  281. <view class="category-dialog acea-row row-column">
  282. <!-- #ifdef MP -->
  283. <view :style="{height: getHeight.barTop+'px'}"></view>
  284. <view :style="{height: getHeight.barHeight+'px'}"></view>
  285. <!-- #endif -->
  286. <scroll-view scroll-y="true" class="scroll-view">
  287. <view class="acea-row" style="flex-wrap: wrap;">
  288. <view class="item" :class="{ on: navOneActive == index }" v-for="(item,index) in categoryList" :key="item.id" @click="tapNavOne(item,index)">
  289. <view class="img-box">
  290. <image :src="item.pic" class="img"></image>
  291. </view>
  292. <view class="title">{{item.cate_name}}</view>
  293. </view>
  294. </view>
  295. </scroll-view>
  296. <view class="btn acea-row row-center-wrapper" @click="navOneClose">
  297. 点击收起<text class="iconfont icon-ic_uparrow"></text>
  298. </view>
  299. </view>
  300. </tuiDrawer>
  301. </view>
  302. </template>
  303. <script>
  304. import {
  305. vcartList,
  306. getCartCounts,
  307. cartDel
  308. } from '@/api/order.js';
  309. import {
  310. getCategoryList,
  311. getAttr,
  312. postCartNum,
  313. initCollage,
  314. hasCollage,
  315. isWithin,
  316. } from '@/api/store.js';
  317. import {
  318. getProducts,
  319. getCustomerList,
  320. getStoreCategory,
  321. getStoreBrand
  322. } from '@/api/new_store.js';
  323. import productWindow from '@/components/productWindow/index';
  324. import goodClass from '@/components/goodClass';
  325. import cartList from '@/components/cartList';
  326. import {
  327. getAddressList,
  328. } from '@/api/user.js';
  329. import Kefu from '@/components/kefu/index.vue';
  330. import homeList from '@/components/homeList/index.vue';
  331. import tuiDrawer from '@/components/tui-drawer/tui-drawer.vue';
  332. import emptyPage from '@/components/emptyPage.vue';
  333. import {
  334. mapState,
  335. mapGetters
  336. } from 'vuex';
  337. import {
  338. goShopDetail
  339. } from '@/libs/order.js';
  340. import {
  341. toLogin
  342. } from '@/libs/login.js';
  343. import {
  344. HTTP_REQUEST_URL
  345. } from '@/config/app';
  346. export default {
  347. computed: {
  348. ...mapState({
  349. cartNum: state => state.indexData.cartNum
  350. }),
  351. ...mapGetters(['isLogin', 'uid', 'cartNum', 'diyCategory', 'diyProduct']),
  352. level() {
  353. return this.diyCategory.level
  354. },
  355. },
  356. components: {
  357. productWindow,
  358. goodClass,
  359. cartList,
  360. Kefu,
  361. homeList,
  362. tuiDrawer,
  363. emptyPage,
  364. },
  365. props: {
  366. info: {
  367. type: Object,
  368. default: {}
  369. },
  370. customerType: {
  371. type: Number,
  372. default: 1
  373. },
  374. },
  375. provide: {
  376. parent: {}
  377. },
  378. data() {
  379. return {
  380. getHeight: this.$util.getWXStatusHeight(),
  381. imgHost: HTTP_REQUEST_URL,
  382. deliveryList: [{
  383. name: '自提',
  384. key: 2,
  385. icon: 'icon-icon_shop1'
  386. },
  387. {
  388. name: '配送',
  389. key: 1,
  390. icon: 'icon-icon_electromobile'
  391. },
  392. ],
  393. switchNum: 1,
  394. categoryList: [],
  395. navOneActive: 0,
  396. navActive: 0,
  397. categoryTitle: '',
  398. categoryErList: [],
  399. tabLeft: 0,
  400. isWidth: 0, //每个导航栏占位
  401. tabClick: 0, //导航栏被点击
  402. iSlong: true,
  403. tempArr: [],
  404. loading: false,
  405. loadend: false,
  406. loadTitle: '加载更多',
  407. page: 1,
  408. limit: 10,
  409. cid: 0, //一级分类
  410. sid: 0, //二级分类
  411. tid: 0, //三级分类
  412. delivery_type: 3, // 配送方式
  413. isAuto: false, //没有授权的不会自动授权
  414. attr: {
  415. cartAttr: false,
  416. productAttr: [],
  417. productSelect: {},
  418. deliveryType: [],
  419. },
  420. productValue: [],
  421. attrValue: '', //已选属性
  422. storeName: '', //多属性产品名称
  423. id: 0,
  424. cartData: {
  425. cartList: [],
  426. iScart: false
  427. },
  428. totalPrice: 0.00,
  429. lengthCart: 0,
  430. is_vip: 0, //是否是会员
  431. cart_num: 0,
  432. storeInfo: {},
  433. // #ifdef H5 || MP
  434. collageVisible: false,
  435. collageDelivery: 2,
  436. collageIndex: 0,
  437. collageStore: this.info,
  438. collageAddress: {}, // 选择的配送地址
  439. isSplicingPlatform: true,
  440. // #endif
  441. customerList: [], // 客服数据
  442. footerOpen: false,
  443. categoryTwoList: [],
  444. categoryThreeList: [],
  445. currentPage: false,
  446. addressList: [], // 地址列表
  447. oneVisible: false,
  448. headerHeight: 0,
  449. conterTop: 0,
  450. scrollTop: 0, //已滚动的距离
  451. addressId: 0, // 配送地址id
  452. }
  453. },
  454. watch: {
  455. // #ifdef H5 || MP
  456. collageDelivery() {
  457. this.collageStore = this.info;
  458. }
  459. // #endif
  460. },
  461. mounted() {
  462. let that = this;
  463. let default_delivery = this.info.default_delivery;
  464. for (let i = 0; i < this.deliveryList.length; i++) {
  465. if (this.deliveryList[i].key == 2 && (!this.info.store_self_mention || !this.info.is_store)) {
  466. this.deliveryList.splice(i, 1);
  467. i--;
  468. }
  469. }
  470. if (this.deliveryList.length == 1) {
  471. default_delivery = this.deliveryList[0].key;
  472. }
  473. // 获取设备宽度
  474. uni.getSystemInfo({
  475. success(e) {
  476. that.isWidth = e.windowWidth / 5
  477. that.windowHeight = e.windowHeight
  478. }
  479. });
  480. uni.$on('newAttrNum', (data) => {
  481. if (data.length) {
  482. this.tempArr.forEach((item) => {
  483. data.forEach(j => {
  484. if (item.id == j.id) {
  485. item.cart_num = j.num
  486. }
  487. })
  488. })
  489. this.getCartList(1);
  490. }
  491. })
  492. uni.$on('newCartNum', (data) => {
  493. if (data.length) {
  494. this.tempArr.forEach((item) => {
  495. data.forEach(j => {
  496. if (item.id == j.product_id) {
  497. item.cart_num = 0
  498. }
  499. })
  500. })
  501. this.getCartList(1);
  502. }
  503. })
  504. let view = uni.createSelectorQuery().in(this).select("#conter-box");
  505. // 页面滚动
  506. uni.$on('onPageScroll', ({
  507. scrollTop
  508. }) => {
  509. this.scrollTop = scrollTop;
  510. this.footerOpen = false;
  511. view
  512. .boundingClientRect((data) => {
  513. this.conterTop = data.top;
  514. })
  515. .exec();
  516. });
  517. // 页面滚动到底部
  518. uni.$on('onReachBottom', () => {
  519. this.getProducts();
  520. });
  521. uni.$on('activeAddress', () => {
  522. this.getAddressList();
  523. });
  524. // #ifdef H5
  525. this.isSplicingPlatform = this.$wechat.isWeixin();
  526. // #endif
  527. // #ifdef H5 || MP
  528. if (this.isSplicingPlatform && this.info.store_splicing_switch) {
  529. this.collageDelivery = this.info.is_store ? 2 : 1;
  530. uni.$on('activeFn', data => {
  531. this.collageStore = data;
  532. });
  533. }
  534. // #endif
  535. this.switchNumFun(default_delivery);
  536. that.getAllCategory();
  537. that.getCartNum();
  538. that.getAddressList();
  539. },
  540. methods: {
  541. // #ifdef H5 || MP
  542. showMaoLocation() {
  543. let data = {
  544. latitude: Number(this.collageStore.latitude),
  545. longitude: Number(this.collageStore.longitude),
  546. name: this.collageStore.name,
  547. address: `${this.collageStore.address}`,
  548. };
  549. // #ifdef H5
  550. if (this.$wechat.isWeixin()) {
  551. data.scale = 13;
  552. return this.$wechat.seeLocation(data);
  553. }
  554. // #endif
  555. uni.openLocation(data);
  556. },
  557. // 点击拼单
  558. onCollage() {
  559. if (!this.isLogin) {
  560. return toLogin();
  561. }
  562. hasCollage().then(res => {
  563. const collageId = res.data.collageId;
  564. if (collageId) {
  565. uni.navigateTo({
  566. url: `/pages/store/group_buy/index?collage_id=${collageId}`
  567. });
  568. } else {
  569. this.collageVisible = true;
  570. }
  571. });
  572. },
  573. // 发起拼单
  574. initCollage() {
  575. let data = {
  576. store_id: this.collageStore.id,
  577. address_id: this.addressId || 0,
  578. shipping_type: this.collageDelivery == 1 ? 3 : 2
  579. };
  580. initCollage(data).then(res => {
  581. this.collageVisible = false;
  582. uni.navigateTo({
  583. url: `/pages/store/group_buy/index?collage_id=${res.data.collageId}`
  584. });
  585. }).catch(err => {
  586. this.$util.Tips({
  587. title: err
  588. });
  589. });
  590. },
  591. // 选择配送地址
  592. onAddressChange(data) {
  593. isWithin({
  594. store_id: this.collageStore.id,
  595. address_id: data.id
  596. }).then(() => {
  597. this.addressId = data.id;
  598. }).catch(() => {
  599. this.$util.Tips({
  600. title: '您选择的地址超出门店配送范围,请重新选择'
  601. });
  602. });
  603. },
  604. onCollageClose() {
  605. this.collageVisible = false;
  606. },
  607. // 选择自提、配送
  608. collageDeliveryChange(item, index) {
  609. if (item.key != 2 || this.info.is_store) {
  610. this.collageDelivery = item.key;
  611. this.collageIndex = index;
  612. }
  613. },
  614. // #endif
  615. getNoCart() {
  616. if (this.cartNum <= 0) {
  617. this.tempArr.forEach((item) => {
  618. item.cart_num = 0
  619. })
  620. this.totalPrice = 0;
  621. }
  622. },
  623. updateFun(e) {
  624. if (e.cartNum) {
  625. this.tempArr.forEach((item) => {
  626. if (item.id == e.id) {
  627. item.cart_num = e.cartNum
  628. }
  629. })
  630. }
  631. },
  632. // 商品列表
  633. getProducts() {
  634. let that = this;
  635. if (that.loadend) return;
  636. if (that.loading) return;
  637. that.loading = true;
  638. getProducts({
  639. page: that.page,
  640. limit: that.limit,
  641. type: 1,
  642. cid: that.cid,
  643. sid: that.sid,
  644. tid: that.tid,
  645. store_id: that.info.id,
  646. delivery_type: that.delivery_type,
  647. }).then(res => {
  648. let list = res.data,
  649. loadend = list.length < that.limit;
  650. that.tempArr = that.$util.SplitArray(list, that.tempArr);
  651. that.$set(that, 'tempArr', that.tempArr);
  652. that.loading = false;
  653. that.loadend = loadend;
  654. that.loadTitle = loadend ? "没有更多内容啦~" : "加载更多";
  655. that.page = that.page + 1;
  656. this.$nextTick(() => {
  657. const query = uni.createSelectorQuery().in(this);
  658. query
  659. .select("#input-box")
  660. .boundingClientRect((data) => {
  661. this.headerHeight = data.height;
  662. })
  663. .exec();
  664. })
  665. }).catch(err => {
  666. that.loading = false;
  667. that.loadTitle = '加载更多'
  668. });
  669. },
  670. // 切换自提方式
  671. swithFn(num) {
  672. this.switchNumFun(num);
  673. this.page = 1;
  674. this.loadend = false;
  675. this.tempArr = []
  676. this.getProducts()
  677. },
  678. switchNumFun(num) {
  679. switch (num) {
  680. case 1:
  681. this.switchNum = 1
  682. this.delivery_type = '3'
  683. break;
  684. case 2:
  685. this.switchNum = 2
  686. this.delivery_type = '2'
  687. break;
  688. }
  689. },
  690. // 跳转到门店列表
  691. goMap() {
  692. uni.navigateTo({
  693. // #ifdef APP
  694. url: `/pages/store/mapnvue/index?province=${this.info.province}&city=${this.info.city}&area=${this.info.area}`
  695. // #endif
  696. // #ifndef APP
  697. url: `/pages/store/map/index?province=${this.info.province}&city=${this.info.city}&area=${this.info.area}`
  698. // #endif
  699. })
  700. },
  701. // 生成订单;
  702. subOrder: function() {
  703. let that = this,
  704. list = that.cartData.cartList,
  705. ids = [];
  706. if (list.length) {
  707. list.forEach(item => {
  708. if (item.attrStatus && item.status) {
  709. ids.push(item.id)
  710. }
  711. });
  712. uni.navigateTo({
  713. url: '/pages/goods/order_confirm/index?is_store=1&cartId=' + ids.join(',') +
  714. '&delivery_type=' + that.delivery_type + '&store_id=' + that.info.id
  715. });
  716. that.cartData.iScart = false;
  717. } else {
  718. return that.$util.Tips({
  719. title: '请选择产品'
  720. });
  721. }
  722. },
  723. // 计算总价;
  724. getTotalPrice: function() {
  725. let that = this,
  726. list = that.cartData.cartList,
  727. totalPrice = 0.00;
  728. list.forEach(item => {
  729. if (item.attrStatus && item.status) {
  730. totalPrice = that.$util.$h.Add(totalPrice, that.$util.$h.Mul(item.cart_num, item
  731. .truePrice));
  732. }
  733. })
  734. // if(num){
  735. // data.forEach(item => {
  736. // totalPrice = that.$util.$h.Sub(totalPrice, that.$util.$h.Mul(item.cart_num, item.sum_price));
  737. // })
  738. // }
  739. that.$set(that, 'totalPrice', totalPrice);
  740. },
  741. ChangeSubDel: function(event) {
  742. let that = this,
  743. list = that.cartData.cartList,
  744. ids = [],
  745. storeId = uni.getStorageSync('user_store_id');
  746. list.forEach(item => {
  747. ids.push(item.id)
  748. });
  749. cartDel(ids.join(","), storeId).then(res => {
  750. that.$set(that.cartData, 'cartList', []);
  751. that.cartData.iScart = false;
  752. that.totalPrice = 0.00;
  753. that.page = 1;
  754. that.loadend = false;
  755. that.tempArr = [];
  756. that.getProducts();
  757. that.getCartNum();
  758. })
  759. },
  760. ChangeOneDel: function(id, index) {
  761. let that = this,
  762. list = that.cartData.cartList,
  763. storeId = uni.getStorageSync('user_store_id');
  764. cartDel(id.toString(), storeId).then(res => {
  765. list.splice(index, 1);
  766. if (!list.length) {
  767. that.cartData.iScart = false;
  768. that.page = 1;
  769. that.loadend = false;
  770. that.tempArr = [];
  771. that.getProducts();
  772. };
  773. that.getCartNum();
  774. })
  775. },
  776. getCartLists() {
  777. if (this.footerOpen) {
  778. this.getCartList();
  779. } else {
  780. this.footerOpen = true;
  781. }
  782. },
  783. getCartList(iSshow) {
  784. let that = this;
  785. let data = {
  786. store_id: that.info.id
  787. };
  788. vcartList(data).then(res => {
  789. that.$set(that.cartData, 'cartList', res.data);
  790. if (res.data.length) {
  791. that.$set(that.cartData, 'iScart', iSshow ? false : !that.cartData.iScart);
  792. } else {
  793. that.$set(that.cartData, 'iScart', false);
  794. }
  795. that.getTotalPrice();
  796. })
  797. },
  798. closeList(e) {
  799. this.$set(this.cartData, 'iScart', e);
  800. },
  801. getCartNum: function() {
  802. let that = this;
  803. getCartCounts(0, that.info.id).then(res => {
  804. this.$store.commit('indexData/setCartNum', res.data.count)
  805. });
  806. },
  807. onMyEvent: function() {
  808. this.$set(this.attr, 'cartAttr', false);
  809. },
  810. /**
  811. * 默认选中属性
  812. *
  813. */
  814. DefaultSelect: function() {
  815. let productAttr = this.attr.productAttr;
  816. let value = [];
  817. for (let key in this.productValue) {
  818. if (this.productValue[key].stock > 0) {
  819. value = this.attr.productAttr.length ? key.split(",") : [];
  820. break;
  821. }
  822. }
  823. for (let i = 0; i < productAttr.length; i++) {
  824. this.$set(productAttr[i], "index", value[i]);
  825. }
  826. //sort();排序函数:数字-英文-汉字;
  827. let productSelect = this.productValue[value.join(",")];
  828. if (productSelect && productAttr.length) {
  829. this.$set(
  830. this.attr.productSelect,
  831. "store_name",
  832. this.storeName
  833. );
  834. this.$set(this.attr.productSelect, "image", productSelect.image);
  835. this.$set(this.attr.productSelect, "price", productSelect.price);
  836. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  837. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  838. this.$set(this.attr.productSelect, "cart_num", 1);
  839. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  840. this.$set(this, "attrValue", value.join(","));
  841. } else if (!productSelect && productAttr.length) {
  842. this.$set(
  843. this.attr.productSelect,
  844. "store_name",
  845. this.storeName
  846. );
  847. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  848. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  849. this.$set(this.attr.productSelect, "stock", 0);
  850. this.$set(this.attr.productSelect, "unique", "");
  851. this.$set(this.attr.productSelect, "cart_num", 0);
  852. this.$set(this, "attrValue", "");
  853. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  854. } else if (!productSelect && !productAttr.length) {
  855. this.$set(
  856. this.attr.productSelect,
  857. "store_name",
  858. this.storeName
  859. );
  860. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  861. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  862. this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
  863. this.$set(
  864. this.attr.productSelect,
  865. "unique",
  866. this.storeInfo.unique || ""
  867. );
  868. this.$set(this.attr.productSelect, "cart_num", 1);
  869. this.$set(this, "attrValue", "");
  870. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  871. }
  872. },
  873. /**
  874. * 属性变动赋值
  875. *
  876. */
  877. ChangeAttr: function(res) {
  878. let productSelect = this.productValue[res];
  879. if (productSelect && productSelect.stock > 0) {
  880. this.$set(this.attr.productSelect, "image", productSelect.image);
  881. this.$set(this.attr.productSelect, "price", productSelect.price);
  882. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  883. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  884. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  885. this.$set(this.attr.productSelect, "cart_num", 1);
  886. this.$set(this, "attrValue", res);
  887. } else if (productSelect && productSelect.stock == 0) {
  888. this.$set(this.attr.productSelect, "image", productSelect.image);
  889. this.$set(this.attr.productSelect, "price", productSelect.price);
  890. this.$set(this.attr.productSelect, "stock", 0);
  891. this.$set(this.attr.productSelect, "unique", "");
  892. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  893. this.$set(this.attr.productSelect, "cart_num", 0);
  894. this.$set(this, "attrValue", "");
  895. } else {
  896. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  897. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  898. this.$set(this.attr.productSelect, "stock", 0);
  899. this.$set(this.attr.productSelect, "unique", "");
  900. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  901. this.$set(this.attr.productSelect, "cart_num", 0);
  902. this.$set(this, "attrValue", "");
  903. }
  904. },
  905. attrVal(val) {
  906. this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val
  907. .indexn]);
  908. },
  909. /**
  910. * 购物车手动填写
  911. *
  912. */
  913. iptCartNum: function(e) {
  914. this.$set(this.attr.productSelect, 'cart_num', e);
  915. },
  916. // 点击默认单属性购物车
  917. goCartDan(item, index) {
  918. if (!this.isLogin) {
  919. this.getIsLogin();
  920. } else {
  921. this.tempArr[index].cart_num = 1;
  922. this.$set(this, 'tempArr', this.tempArr);
  923. this.goCat(0, item.id, 1);
  924. }
  925. },
  926. // 改变单属性购物车
  927. ChangeCartNumDan(changeValue, index, item) {
  928. let num = this.tempArr[index];
  929. let stock = this.tempArr[index].stock;
  930. this.ChangeCartNum(changeValue, num, stock, 0, item.id);
  931. },
  932. // 改变多属性购物车
  933. ChangeCartNumDuo(changeValue) {
  934. //获取当前变动属性
  935. let productSelect = this.productValue[this.attrValue];
  936. //如果没有属性,赋值给商品默认库存
  937. if (productSelect === undefined && !this.attr.productAttr.length)
  938. productSelect = this.attr.productSelect;
  939. //无属性值即库存为0;不存在加减;
  940. if (productSelect === undefined) return;
  941. let stock = productSelect.stock || 0;
  942. let num = this.attr.productSelect;
  943. this.ChangeCartNum(changeValue, num, stock, 1);
  944. },
  945. // 已经加入购物车时的购物加减;
  946. ChangeCartList(changeValue, index) {
  947. let list = this.cartData.cartList;
  948. let num = list[index];
  949. let stock = list[index].trueStock;
  950. this.ChangeCartNum(changeValue, num, stock, 0, num.product_id, index, 1);
  951. if (!list.length) {
  952. this.cartData.iScart = false;
  953. this.page = 1;
  954. this.loadend = false;
  955. this.tempArr = [];
  956. this.getProducts();
  957. }
  958. },
  959. // 购物车加减计算函数
  960. ChangeCartNum(changeValue, num, stock, isDuo, id, index, cart) {
  961. if (changeValue) {
  962. num.cart_num++;
  963. if (num.cart_num > stock) {
  964. if (isDuo) {
  965. this.$set(this.attr.productSelect, "cart_num", stock ? stock : 1);
  966. this.$set(this, "cart_num", stock ? stock : 1);
  967. } else {
  968. num.cart_num = stock ? stock : 0;
  969. this.$set(this, 'tempArr', this.tempArr);
  970. this.$set(this.cartData, 'cartList', this.cartData.cartList);
  971. }
  972. return this.$util.Tips({
  973. title: "该产品没有更多库存了"
  974. });
  975. } else {
  976. if (!isDuo) {
  977. if (cart) {
  978. this.goCat(0, id, 1, 1, num.product_attr_unique);
  979. this.getTotalPrice();
  980. this.tempArr.forEach((item) => {
  981. if (item.id == id) {
  982. item.cart_num++;
  983. }
  984. })
  985. } else {
  986. this.goCat(0, id, 1);
  987. }
  988. } else {
  989. this.tempArr.forEach((item) => {
  990. if (item.id == id) {
  991. item.cart_num++;
  992. }
  993. })
  994. }
  995. }
  996. } else {
  997. num.cart_num--;
  998. if (num.cart_num == 0) {
  999. this.cartData.cartList.splice(index, 1);
  1000. if (isDuo) {
  1001. this.$set(this.attr.productSelect, "cart_num", 1);
  1002. this.$set(this, "cart_num", 1);
  1003. }
  1004. }
  1005. if (num.cart_num < 0) {
  1006. if (isDuo) {
  1007. this.$set(this.attr.productSelect, "cart_num", 1);
  1008. this.$set(this, "cart_num", 1);
  1009. } else {
  1010. num.cart_num = 0;
  1011. this.$set(this, 'tempArr', this.tempArr);
  1012. this.$set(this.cartData, 'cartList', this.cartData.cartList);
  1013. }
  1014. } else {
  1015. if (!isDuo) {
  1016. if (cart) {
  1017. this.goCat(0, id, 0, 1, num.product_attr_unique);
  1018. this.getTotalPrice();
  1019. this.tempArr.forEach((item) => {
  1020. if (item.id == id) {
  1021. item.cart_num--;
  1022. }
  1023. })
  1024. } else {
  1025. this.goCat(0, id, 0);
  1026. }
  1027. } else {
  1028. this.tempArr.forEach((item) => {
  1029. if (item.id == id) {
  1030. item.cart_num--;
  1031. }
  1032. })
  1033. }
  1034. }
  1035. }
  1036. },
  1037. // 多规格加入购物车;
  1038. goCatNum() {
  1039. this.goCat(1, this.id, 1);
  1040. },
  1041. /*
  1042. * 加入购物车
  1043. */
  1044. goCat: function(duo, id, type, cart, unique) {
  1045. let that = this;
  1046. if (duo) {
  1047. let productSelect = that.productValue[this.attrValue];
  1048. //如果有属性,没有选择,提示用户选择
  1049. if (
  1050. that.attr.productAttr.length &&
  1051. productSelect === undefined
  1052. )
  1053. return that.$util.Tips({
  1054. title: "产品库存不足,请选择其它属性"
  1055. });
  1056. }
  1057. let q = {
  1058. product_id: id,
  1059. num: duo ? that.attr.productSelect.cart_num : 1,
  1060. type: type,
  1061. unique: duo ? that.attr.productSelect.unique : cart ? unique : ""
  1062. };
  1063. postCartNum(q)
  1064. .then(function(res) {
  1065. if (duo) {
  1066. that.attr.cartAttr = false;
  1067. that.$util.Tips({
  1068. title: "添加购物车成功"
  1069. });
  1070. // that.page = 1;
  1071. // that.loadend = false;
  1072. that.tempArr.forEach((item, index) => {
  1073. if (item.id == that.id) {
  1074. let arrtStock = that.attr.productSelect.stock
  1075. let objNum = parseInt(item.cart_num) + parseInt(that.attr.productSelect
  1076. .cart_num);
  1077. item.cart_num = objNum > arrtStock ? arrtStock : objNum
  1078. }
  1079. })
  1080. // that.productslist();
  1081. }
  1082. that.getCartNum();
  1083. if (!cart) {
  1084. that.getCartList(1);
  1085. }
  1086. })
  1087. .catch(err => {
  1088. return that.$util.Tips({
  1089. title: err
  1090. });
  1091. });
  1092. },
  1093. goCartDuo(item) {
  1094. if (!this.isLogin) {
  1095. this.getIsLogin();
  1096. } else {
  1097. // uni.showLoading({
  1098. // title: '加载中'
  1099. // });
  1100. this.storeName = item.store_name;
  1101. this.getAttrs(item.id);
  1102. this.$set(this, 'id', item.id);
  1103. this.$set(this.attr, 'cartAttr', true);
  1104. }
  1105. },
  1106. getIsLogin() {
  1107. toLogin();
  1108. },
  1109. // 商品详情接口;
  1110. getAttrs(id) {
  1111. let that = this;
  1112. getAttr(id, 0).then(res => {
  1113. // uni.hideLoading();
  1114. that.$set(that.attr, 'productAttr', res.data.productAttr);
  1115. that.$set(that, 'productValue', res.data.productValue);
  1116. that.$set(that, 'is_vip', res.data.storeInfo.is_vip);
  1117. that.$set(that, 'storeInfo', res.data.storeInfo);
  1118. that.DefaultSelect();
  1119. })
  1120. },
  1121. // 去详情页
  1122. goDetail(item) {
  1123. goShopDetail(item, this.uid).catch(res => {
  1124. uni.navigateTo({
  1125. url: `/pages/goods_details/index?id=${item.id}&fromType=1`
  1126. });
  1127. });
  1128. },
  1129. openTap() {
  1130. this.iSlong = false
  1131. },
  1132. closeTap() {
  1133. this.iSlong = true
  1134. },
  1135. // 分类数据
  1136. getAllCategory: function() {
  1137. let that = this;
  1138. getStoreCategory().then(res => {
  1139. let data = res.data;
  1140. that.categoryList = data;
  1141. if (that.level == 2) {
  1142. that.categoryErList = that.categoryList;
  1143. } else {
  1144. that.categoryErList = that.categoryList[0].children ? that.categoryList[0].children : [];
  1145. }
  1146. that.categoryThreeList = that.categoryErList[0].children ? that.categoryErList[0]
  1147. .children : [];
  1148. if (this.categoryThreeList.length) {
  1149. this.categoryThreeList.unshift({
  1150. cate_name: '全部商品',
  1151. id: 0
  1152. })
  1153. }
  1154. that.categoryTitle = that.categoryList[0].cate_name;
  1155. that.cid = that.categoryList[0].id;
  1156. if (that.level == 2) {
  1157. that.sid = that.categoryThreeList[0].id;
  1158. } else {
  1159. that.sid = that.categoryErList[0].id;
  1160. }
  1161. // that.switchNumFun(that.info.default_delivery);
  1162. that.getProducts();
  1163. })
  1164. },
  1165. tapNav(index, item) {
  1166. this.navActive = index;
  1167. this.tabClick = 0;
  1168. this.categoryThreeList = item.children || [];
  1169. if (!this.categoryThreeList[0] || this.categoryThreeList[0].id) {
  1170. this.categoryThreeList.unshift({
  1171. cate_name: '全部商品',
  1172. id: 0
  1173. });
  1174. }
  1175. if (this.level == 2) {
  1176. this.cid = item.id;
  1177. this.sid = 0;
  1178. } else {
  1179. this.sid = item.id;
  1180. this.tid = 0;
  1181. }
  1182. this.page = 1;
  1183. this.loadend = false;
  1184. this.tempArr = [];
  1185. this.getProducts();
  1186. },
  1187. // 导航栏点击
  1188. longClick(index, item) {
  1189. if (this.categoryThreeList.length > 3) {
  1190. this.tabLeft = (index - 1) * (this.isWidth + 6) //设置下划线位置
  1191. };
  1192. this.tabClick = index; //设置导航点击了哪一个
  1193. // this.iSlong = true;
  1194. if (this.level == 2) {
  1195. this.sid = item.id;
  1196. } else {
  1197. this.tid = item.id;
  1198. }
  1199. this.page = 1;
  1200. this.loadend = false;
  1201. this.tempArr = [];
  1202. this.getProducts();
  1203. },
  1204. // 打开客服
  1205. goKefu() {
  1206. this.getCustomerList()
  1207. this.$refs.kefu.show = true
  1208. },
  1209. // 获取客服列表数据
  1210. getCustomerList() {
  1211. getCustomerList(this.info.id).then(res => {
  1212. this.customerList = res.data
  1213. })
  1214. },
  1215. // 关闭客服
  1216. closeKefu() {
  1217. this.$refs.kefu.show = false
  1218. },
  1219. tapNavOne(item, index) {
  1220. this.navOneActive = index;
  1221. this.navActive = 0;
  1222. this.tabClick = 0;
  1223. this.categoryErList = item.children;
  1224. this.categoryThreeList = this.categoryErList[0].children || [];
  1225. if (!this.categoryThreeList[0] || this.categoryThreeList[0].id) {
  1226. this.categoryThreeList.unshift({
  1227. cate_name: '全部商品',
  1228. id: 0
  1229. });
  1230. }
  1231. this.categoryTitle = item.cate_name;
  1232. this.cid = item.id;
  1233. this.sid = item.children[0] ? item.children[0].id : 0;
  1234. this.tid = 0;
  1235. this.page = 1;
  1236. this.loadend = false;
  1237. this.tempArr = [];
  1238. this.getProducts();
  1239. },
  1240. moreNav() {
  1241. this.currentPage = !this.currentPage;
  1242. },
  1243. goAddressPages() {
  1244. uni.navigateTo({
  1245. url: '/pages/users/user_address_list/index?isCollage=1&store_id=' + this.info.id
  1246. });
  1247. },
  1248. navOneOpen() {
  1249. this.oneVisible = true;
  1250. },
  1251. navOneClose() {
  1252. this.oneVisible = false;
  1253. },
  1254. getAddressList() {
  1255. getAddressList({
  1256. page: 1,
  1257. limit: 100
  1258. }).then(res => {
  1259. let addressList = res.data;
  1260. this.addressList = addressList;
  1261. })
  1262. }
  1263. },
  1264. }
  1265. </script>
  1266. <style lang="scss">
  1267. .cartIcon-placeholder {
  1268. height: 132rpx;
  1269. }
  1270. .safe-area-inset-bottom {
  1271. height: constant(safe-area-inset-bottom);
  1272. height: env(safe-area-inset-bottom);
  1273. }
  1274. .input-wrapper {
  1275. position: relative;
  1276. height: 78rpx;
  1277. padding: 0 24rpx;
  1278. .input {
  1279. flex: 1;
  1280. min-width: 0;
  1281. height: 58rpx;
  1282. padding-left: 24rpx;
  1283. border-radius: 29rpx;
  1284. background: rgba(255, 255, 255, 0.2);
  1285. font-size: 24rpx;
  1286. color: #FFFFFF;
  1287. .iconfont {
  1288. margin-right: 16rpx;
  1289. font-size: 32rpx;
  1290. }
  1291. }
  1292. }
  1293. /deep/.product-window.joinCart {
  1294. z-index: 999;
  1295. }
  1296. ::-webkit-scrollbar {
  1297. width: 0;
  1298. height: 0;
  1299. color: transparent;
  1300. display: none
  1301. }
  1302. .page {
  1303. position: relative;
  1304. flex-wrap: nowrap;
  1305. min-height: 100vh;
  1306. /deep/.mask {
  1307. z-index: 99;
  1308. }
  1309. /deep/.attrProduct {
  1310. .mask {
  1311. z-index: 100;
  1312. }
  1313. }
  1314. .header {
  1315. /* #ifdef H5 */
  1316. padding: 0 20rpx 20rpx;
  1317. /* #endif */
  1318. .pageIndex {
  1319. width: 68rpx;
  1320. height: 68rpx;
  1321. border-radius: 50%;
  1322. background-color: #F7F7F7;
  1323. .iconfont {
  1324. color: #666666;
  1325. font-size: 30rpx;
  1326. }
  1327. }
  1328. .search {
  1329. flex: 1;
  1330. height: 58rpx;
  1331. border-radius: 29rpx;
  1332. background: rgba(255, 255, 255, 0.2);
  1333. font-size: 24rpx;
  1334. padding: 0 24rpx;
  1335. color: #FFFFFF;
  1336. .iconfont {
  1337. font-size: 32rpx;
  1338. margin-right: 16rpx;
  1339. color: #FFFFFF;
  1340. }
  1341. }
  1342. }
  1343. .conter {
  1344. flex-wrap: nowrap;
  1345. flex: 1;
  1346. background: #FFFFFF;
  1347. .aside-box {
  1348. width: 168rpx;
  1349. }
  1350. .aside {
  1351. width: 168rpx;
  1352. height: 100%;
  1353. background: #F5F5F5;
  1354. .item {
  1355. height: 100rpx;
  1356. width: 100%;
  1357. font-size: 26rpx;
  1358. color: #333333;
  1359. .inner {
  1360. position: relative;
  1361. height: 100%;
  1362. }
  1363. &.on {
  1364. background: #FFFFFF;
  1365. width: 100%;
  1366. text-align: center;
  1367. color: var(--view-theme);
  1368. font-weight: 500;
  1369. position: relative;
  1370. .inner::after {
  1371. content: "";
  1372. position: absolute;
  1373. width: 6rpx;
  1374. height: 48rpx;
  1375. background: var(--view-theme);
  1376. border-radius: 0 4rpx 4rpx 0;
  1377. left: 0
  1378. }
  1379. }
  1380. &.btr {
  1381. background: #FFFFFF;
  1382. .inner {
  1383. border-top-right-radius: 24rpx;
  1384. background: #F5F5F5;
  1385. }
  1386. }
  1387. &.bbr {
  1388. background: #FFFFFF;
  1389. .inner {
  1390. border-bottom-right-radius: 24rpx;
  1391. background: #F5F5F5;
  1392. }
  1393. }
  1394. }
  1395. }
  1396. .wrapper {
  1397. flex: 1;
  1398. flex-wrap: nowrap;
  1399. min-width: 0;
  1400. .bgcolor-box {
  1401. height: 104rpx;
  1402. }
  1403. .bgcolor {
  1404. flex-wrap: nowrap;
  1405. height: 104rpx;
  1406. background: #FFFFFF;
  1407. top: 0;
  1408. right: 0;
  1409. left: 168rpx;
  1410. z-index: 10;
  1411. }
  1412. .longTab {
  1413. flex: 1;
  1414. min-width: 0;
  1415. .longItem {
  1416. display: inline-block;
  1417. height: 56rpx;
  1418. border-radius: 28rpx;
  1419. margin-left: 16rpx;
  1420. background: #F5F5F5;
  1421. vertical-align: middle;
  1422. text-align: center;
  1423. font-size: 24rpx;
  1424. line-height: 54rpx;
  1425. color: #333333;
  1426. .inner {
  1427. height: 56rpx;
  1428. border: 1rpx solid transparent;
  1429. border-radius: 28rpx;
  1430. background-clip: content-box;
  1431. transform: rotateZ(360deg);
  1432. }
  1433. &.click {
  1434. background: var(--view-theme);
  1435. color: var(--view-theme);
  1436. .inner {
  1437. background-color: rgba(255, 255, 255, 0.9);
  1438. }
  1439. }
  1440. }
  1441. .underlineBox {
  1442. height: 3px;
  1443. width: 20%;
  1444. display: flex;
  1445. align-content: center;
  1446. justify-content: center;
  1447. transition: .5s;
  1448. .underline {
  1449. width: 33rpx;
  1450. height: 4rpx;
  1451. background-color: #FFFFFF;
  1452. }
  1453. }
  1454. }
  1455. .openList {
  1456. position: relative;
  1457. width: 92rpx;
  1458. text-align: center;
  1459. line-height: 104rpx;
  1460. .btn {
  1461. display: inline-block;
  1462. width: 56rpx;
  1463. height: 56rpx;
  1464. border-radius: 50%;
  1465. background: #F5F5F5;
  1466. vertical-align: middle;
  1467. line-height: 56rpx;
  1468. }
  1469. .iconfont {
  1470. vertical-align: middle;
  1471. font-size: 32rpx;
  1472. color: #333333;
  1473. }
  1474. .img {
  1475. position: absolute;
  1476. top: 0;
  1477. left: 0;
  1478. width: 18rpx;
  1479. height: 100%;
  1480. transform: translateX(-50%);
  1481. }
  1482. }
  1483. .goodsList {
  1484. margin-top: 0rpx;
  1485. padding: 0 30rpx 0 20rpx;
  1486. /deep/.item {
  1487. margin-bottom: 33rpx !important;
  1488. .text {
  1489. font-size: 26rpx;
  1490. }
  1491. .bottom {
  1492. .sales {
  1493. .money {
  1494. font-size: 34rpx;
  1495. text {
  1496. font-size: 26rpx;
  1497. }
  1498. }
  1499. }
  1500. .cart {
  1501. .pictrue {
  1502. width: 50rpx;
  1503. height: 50rpx;
  1504. }
  1505. }
  1506. }
  1507. }
  1508. }
  1509. }
  1510. }
  1511. .store-address {
  1512. width: 100%;
  1513. margin-top: 15rpx;
  1514. position: relative;
  1515. padding: 12rpx 30rpx 0 30rpx;
  1516. height: 185rpx;
  1517. background-color: #fff;
  1518. .address {
  1519. font-size: 32rpx;
  1520. font-weight: 500;
  1521. color: #333333;
  1522. .name {
  1523. max-width: 400rpx;
  1524. }
  1525. .icon-xiangyou {
  1526. font-size: 24rpx;
  1527. margin-left: 10rpx;
  1528. }
  1529. }
  1530. .distance {
  1531. margin-top: 16rpx;
  1532. font-size: 24rpx;
  1533. font-weight: 400;
  1534. color: #999999;
  1535. }
  1536. .time {
  1537. margin-top: 16rpx;
  1538. font-size: 24rpx;
  1539. font-weight: 400;
  1540. color: #333333;
  1541. }
  1542. }
  1543. }
  1544. .group-btn {
  1545. width: 80rpx;
  1546. height: 64rpx;
  1547. border-radius: 50%;
  1548. margin-left: 16rpx;
  1549. .img {
  1550. width: 100%;
  1551. height: 100%;
  1552. }
  1553. }
  1554. /* #ifdef H5 || MP */
  1555. .dialog {
  1556. padding: 44rpx 20rpx 0;
  1557. padding-bottom: constant(safe-area-inset-bottom);
  1558. padding-bottom: env(safe-area-inset-bottom);
  1559. border-radius: 40rpx 40rpx 0 0;
  1560. background: linear-gradient(180deg, #F5F5F5 0%, #F5F5F5 0%, #FFFFFF 100%);
  1561. }
  1562. .dialog-head {
  1563. padding: 0 24rpx;
  1564. font-weight: 500;
  1565. font-size: 32rpx;
  1566. color: #333333;
  1567. .btn {
  1568. width: 40rpx;
  1569. height: 40rpx;
  1570. cursor: pointer;
  1571. .iconfont {
  1572. font-size: 40rpx;
  1573. color: #BBBBBB;
  1574. }
  1575. }
  1576. }
  1577. .dialog-body {
  1578. margin-top: 48rpx;
  1579. .navbar {
  1580. flex-shrink: 0;
  1581. position: relative;
  1582. height: 82rpx;
  1583. .navbar-bg {
  1584. position: absolute;
  1585. top: 0;
  1586. left: 0;
  1587. width: 100%;
  1588. height: 190rpx;
  1589. border-radius: 16rpx 16rpx 0 0;
  1590. background: #EEEEEE;
  1591. }
  1592. .active-bg {
  1593. position: absolute;
  1594. bottom: 0;
  1595. left: 0;
  1596. width: 100%;
  1597. height: 96rpx;
  1598. .image1 {
  1599. width: 50%;
  1600. height: 100%;
  1601. }
  1602. .image2 {
  1603. width: 48rpx;
  1604. height: 78rpx;
  1605. }
  1606. }
  1607. .inner {
  1608. position: absolute;
  1609. bottom: 0;
  1610. left: 0;
  1611. width: 100%;
  1612. height: 100%;
  1613. .item {
  1614. flex: 1;
  1615. min-width: 0;
  1616. font-size: 28rpx;
  1617. line-height: 44rpx;
  1618. color: #666666;
  1619. .iconfont {
  1620. display: none;
  1621. margin-right: 8rpx;
  1622. font-size: 36rpx;
  1623. }
  1624. &.on {
  1625. font-weight: 500;
  1626. font-size: 32rpx;
  1627. color: var(--view-theme);
  1628. .iconfont {
  1629. display: inline-block;
  1630. }
  1631. }
  1632. }
  1633. }
  1634. }
  1635. .dialog-content {
  1636. position: relative;
  1637. border-radius: 0 0 16rpx 16rpx;
  1638. background: #FFFFFF;
  1639. &.btl {
  1640. border-top-left-radius: 24rpx;
  1641. }
  1642. &.btr {
  1643. border-top-right-radius: 24rpx;
  1644. }
  1645. .link {
  1646. padding: 40rpx 32rpx;
  1647. font-size: 22rpx;
  1648. line-height: 30rpx;
  1649. color: #999999;
  1650. .title {
  1651. margin-bottom: 16rpx;
  1652. font-weight: 500;
  1653. font-size: 28rpx;
  1654. line-height: 40rpx;
  1655. color: #333333;
  1656. }
  1657. .iconfont {
  1658. font-size: 32rpx;
  1659. }
  1660. }
  1661. }
  1662. .address-box {
  1663. height: 388rpx;
  1664. .list {
  1665. padding: 36rpx 32rpx;
  1666. }
  1667. .item {
  1668. margin-top: 32rpx;
  1669. color: #333333;
  1670. &:first-child {
  1671. margin-top: 0;
  1672. }
  1673. .text {
  1674. flex: 1;
  1675. }
  1676. .info {
  1677. font-weight: 500;
  1678. font-size: 28rpx;
  1679. line-height: 40rpx;
  1680. }
  1681. .name {
  1682. margin-top: 8rpx;
  1683. font-size: 22rpx;
  1684. line-height: 30rpx;
  1685. color: #999999;
  1686. }
  1687. .iconfont {
  1688. visibility: hidden;
  1689. font-size: 36rpx;
  1690. }
  1691. &.on {
  1692. color: var(--view-theme);
  1693. .name {
  1694. color: var(--view-theme);
  1695. }
  1696. .iconfont {
  1697. visibility: visible;
  1698. }
  1699. }
  1700. }
  1701. }
  1702. .btn-box {
  1703. height: 88rpx;
  1704. font-size: 24rpx;
  1705. line-height: 34rpx;
  1706. color: #666666;
  1707. .iconfont {
  1708. margin-left: 4rpx;
  1709. font-size: 24rpx;
  1710. }
  1711. }
  1712. .store-box {
  1713. padding: 40rpx 28rpx 40rpx 32rpx;
  1714. .text {
  1715. flex: 1;
  1716. }
  1717. .name {
  1718. font-weight: 500;
  1719. font-size: 28rpx;
  1720. line-height: 40rpx;
  1721. color: #333333;
  1722. }
  1723. .info {
  1724. margin-top: 16rpx;
  1725. font-size: 22rpx;
  1726. line-height: 30rpx;
  1727. color: #999999;
  1728. }
  1729. .value {
  1730. flex: 1;
  1731. }
  1732. .iconfont {
  1733. margin-right: 12rpx;
  1734. font-size: 22rpx;
  1735. }
  1736. .map-box {
  1737. position: relative;
  1738. width: 188rpx;
  1739. height: 104rpx;
  1740. margin-left: 32rpx;
  1741. .map {
  1742. width: 100%;
  1743. height: 100%;
  1744. }
  1745. .img-box {
  1746. position: absolute;
  1747. bottom: 16rpx;
  1748. left: 50%;
  1749. width: 52rpx;
  1750. height: 52rpx;
  1751. padding: 6rpx;
  1752. border-radius: 6rpx;
  1753. background: #FFFFFF;
  1754. box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0, 0, 0, 0.0784);
  1755. transform: translateX(-50%);
  1756. }
  1757. .img {
  1758. width: 100%;
  1759. height: 100%;
  1760. border-radius: 6rpx;
  1761. }
  1762. .range {
  1763. position: absolute;
  1764. top: -40rpx;
  1765. left: 50%;
  1766. height: 36rpx;
  1767. padding: 0 16rpx;
  1768. border-radius: 6rpx;
  1769. background: #FFFFFF;
  1770. box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(0, 0, 0, 0.0784);
  1771. transform: translateX(-50%);
  1772. white-space: nowrap;
  1773. font-size: 20rpx;
  1774. line-height: 36rpx;
  1775. color: #333333;
  1776. &::after {
  1777. content: "";
  1778. position: absolute;
  1779. bottom: 0;
  1780. left: 50%;
  1781. width: 0;
  1782. height: 0;
  1783. border-width: 5rpx 9rpx;
  1784. border-style: solid;
  1785. border-color: #FFFFFF transparent transparent;
  1786. transform: translate(-50%, 100%);
  1787. }
  1788. }
  1789. .dot {
  1790. position: absolute;
  1791. bottom: -10rpx;
  1792. left: 50%;
  1793. width: 6rpx;
  1794. height: 6rpx;
  1795. border-radius: 50%;
  1796. background: var(--view-theme);
  1797. transform: translateX(-50%);
  1798. }
  1799. }
  1800. }
  1801. }
  1802. .dialog-foot {
  1803. padding: 20rpx 0;
  1804. .btn {
  1805. height: 72rpx;
  1806. border-radius: 36rpx;
  1807. background: var(--view-theme);
  1808. text-align: center;
  1809. font-weight: 500;
  1810. font-size: 26rpx;
  1811. line-height: 72rpx;
  1812. color: #FFFFFF;
  1813. }
  1814. }
  1815. /* #endif */
  1816. .store-section {
  1817. padding: 20rpx;
  1818. .panel {
  1819. padding: 0 32rpx 32rpx;
  1820. border-radius: 16rpx;
  1821. background: #FFFFFF;
  1822. }
  1823. .store-name {
  1824. height: 92rpx;
  1825. .name-wrap {
  1826. flex: 1;
  1827. min-width: 0;
  1828. }
  1829. .name-inner {
  1830. display: inline-flex;
  1831. max-width: 100%;
  1832. }
  1833. .name {
  1834. flex: 1;
  1835. min-width: 0;
  1836. margin: 0 8rpx 0 10rpx;
  1837. font-weight: 500;
  1838. font-size: 30rpx;
  1839. color: #333333;
  1840. }
  1841. .iconfont {
  1842. font-size: 32rpx;
  1843. color: #333333;
  1844. }
  1845. .tips {
  1846. font-size: 24rpx;
  1847. color: var(--view-theme);
  1848. }
  1849. }
  1850. .address-wrap {
  1851. .address-box {
  1852. flex: 1;
  1853. min-width: 0;
  1854. font-size: 22rpx;
  1855. color: #666666;
  1856. }
  1857. .address-info {
  1858. margin-top: 20rpx;
  1859. line-height: 34rpx;
  1860. }
  1861. .distance {
  1862. position: relative;
  1863. padding-right: 12rpx;
  1864. margin-right: 12rpx;
  1865. &::after {
  1866. content: "";
  1867. position: absolute;
  1868. top: 50%;
  1869. right: 0;
  1870. width: 1rpx;
  1871. height: 18rpx;
  1872. background: #CCCCCC;
  1873. transform: translateY(-50%);
  1874. }
  1875. }
  1876. .btn {
  1877. position: relative;
  1878. padding-left: 24rpx;
  1879. margin-left: 24rpx;
  1880. text-align: center;
  1881. font-size: 20rpx;
  1882. color: #333333;
  1883. &::before {
  1884. content: "";
  1885. position: absolute;
  1886. top: 50%;
  1887. left: 0;
  1888. width: 2rpx;
  1889. height: 24rpx;
  1890. background: #EEEEEE;
  1891. transform: translateY(-50%);
  1892. }
  1893. &:first-child::before {
  1894. display: none;
  1895. }
  1896. .iconfont {
  1897. display: inline-block;
  1898. margin-bottom: 8rpx;
  1899. font-size: 40rpx;
  1900. }
  1901. }
  1902. }
  1903. .switch {
  1904. width: 192rpx;
  1905. height: 48rpx;
  1906. background: #F5F5F5;
  1907. border-radius: 24rpx;
  1908. margin-left: 24rpx;
  1909. .btn {
  1910. width: 96rpx;
  1911. height: 48rpx;
  1912. border-radius: 24rpx;
  1913. text-align: center;
  1914. font-size: 24rpx;
  1915. line-height: 48rpx;
  1916. color: #999999;
  1917. &.on {
  1918. background: var(--view-theme);
  1919. color: #FFFFFF;
  1920. }
  1921. }
  1922. }
  1923. }
  1924. .headerBg {
  1925. position: absolute;
  1926. top: 0;
  1927. right: 0;
  1928. left: 0;
  1929. .image {
  1930. position: absolute;
  1931. top: 0;
  1932. left: 0;
  1933. width: 100%;
  1934. height: 100%;
  1935. }
  1936. .shade {
  1937. position: absolute;
  1938. top: 0;
  1939. left: 0;
  1940. width: 100%;
  1941. height: 100%;
  1942. background: linear-gradient(180deg, rgba(0, 0, 0, 0.4047) 0%, #F5F5F5 100%);
  1943. }
  1944. }
  1945. .category {
  1946. flex-wrap: nowrap;
  1947. border-bottom: 1rpx solid #EEEEEE;
  1948. background: #FFFFFF;
  1949. .scroll-view {
  1950. flex: 1;
  1951. min-width: 0;
  1952. padding-left: 20rpx;
  1953. white-space: nowrap;
  1954. }
  1955. .item {
  1956. display: inline-block;
  1957. padding: 24rpx 0;
  1958. margin-right: 8rpx;
  1959. vertical-align: middle;
  1960. &.on {
  1961. .img-box {
  1962. border-color: var(--view-theme);
  1963. }
  1964. .title {
  1965. background: linear-gradient(90deg, var(--view-gradient) 0%, var(--view-theme) 100%);
  1966. color: #FFFFFF;
  1967. }
  1968. }
  1969. }
  1970. .img-box {
  1971. width: 104rpx;
  1972. height: 104rpx;
  1973. padding: 6rpx;
  1974. border: 3rpx solid transparent;
  1975. border-radius: 50%;
  1976. margin: 0 auto;
  1977. }
  1978. .img {
  1979. width: 92rpx;
  1980. height: 92rpx;
  1981. border-radius: 50%;
  1982. }
  1983. .title {
  1984. width: 120rpx;
  1985. height: 40rpx;
  1986. border-radius: 20rpx;
  1987. margin-top: 8rpx;
  1988. text-align: center;
  1989. font-size: 24rpx;
  1990. line-height: 40rpx;
  1991. color: #333333;
  1992. }
  1993. .btn {
  1994. position: relative;
  1995. flex-wrap: nowrap;
  1996. width: 72rpx;
  1997. font-size: 24rpx;
  1998. line-height: 34rpx;
  1999. color: #333333;
  2000. .img {
  2001. position: absolute;
  2002. top: 0;
  2003. left: 0;
  2004. width: 22rpx;
  2005. height: 100%;
  2006. transform: translateX(-50%);
  2007. }
  2008. }
  2009. }
  2010. .downTab {
  2011. flex-wrap: nowrap;
  2012. max-height: 820rpx;
  2013. border-radius: 0rpx 0rpx 32rpx 32rpx;
  2014. background: #FFFFFF;
  2015. .title {
  2016. padding: 32rpx 0 24rpx 30rpx;
  2017. font-size: 32rpx;
  2018. line-height: 44rpx;
  2019. color: #333333;
  2020. }
  2021. .scroll-view {
  2022. flex: 1;
  2023. min-height: 0;
  2024. box-sizing: border-box;
  2025. }
  2026. .children {
  2027. padding: 0 0 8rpx 30rpx;
  2028. margin: 0 -24rpx 0 0;
  2029. .item {
  2030. width: 154rpx;
  2031. height: 56rpx;
  2032. border-radius: 28rpx;
  2033. margin: 0 24rpx 24rpx 0;
  2034. background: #F5F5F5;
  2035. text-align: center;
  2036. font-size: 24rpx;
  2037. line-height: 56rpx;
  2038. color: #333333;
  2039. .inner {
  2040. width: 154rpx;
  2041. height: 56rpx;
  2042. border: 1rpx solid transparent;
  2043. border-radius: 28rpx;
  2044. background-clip: content-box;
  2045. transform: rotateZ(360deg);
  2046. }
  2047. &.click {
  2048. background: var(--view-theme);
  2049. color: var(--view-theme);
  2050. .inner {
  2051. background-color: rgba(255, 255, 255, 0.9);
  2052. }
  2053. }
  2054. }
  2055. }
  2056. .btn {
  2057. height: 80rpx;
  2058. font-size: 24rpx;
  2059. color: #999999;
  2060. .iconfont {
  2061. margin-left: 4rpx;
  2062. font-size: 24rpx;
  2063. }
  2064. }
  2065. }
  2066. .category-dialog {
  2067. border-radius: 0rpx 0rpx 32rpx 32rpx;
  2068. background: #FFFFFF;
  2069. .scroll-view {
  2070. flex: 1;
  2071. min-height: 0;
  2072. padding-left: 32rpx;
  2073. }
  2074. .item {
  2075. display: inline-block;
  2076. margin-right: 22rpx;
  2077. margin-bottom: 26rpx;
  2078. vertical-align: middle;
  2079. &.on {
  2080. .img-box {
  2081. border-color: var(--view-theme);
  2082. }
  2083. .title {
  2084. background: linear-gradient(90deg, var(--view-gradient) 0%, var(--view-theme) 100%);
  2085. color: #FFFFFF;
  2086. }
  2087. }
  2088. }
  2089. .img-box {
  2090. width: 104rpx;
  2091. height: 104rpx;
  2092. padding: 6rpx;
  2093. border: 3rpx solid transparent;
  2094. border-radius: 50%;
  2095. margin: 0 auto;
  2096. }
  2097. .img {
  2098. width: 92rpx;
  2099. height: 92rpx;
  2100. border-radius: 50%;
  2101. }
  2102. .title {
  2103. width: 120rpx;
  2104. height: 40rpx;
  2105. border-radius: 20rpx;
  2106. margin-top: 8rpx;
  2107. text-align: center;
  2108. font-size: 24rpx;
  2109. line-height: 40rpx;
  2110. color: #333333;
  2111. }
  2112. .btn {
  2113. position: relative;
  2114. flex-wrap: nowrap;
  2115. height: 80rpx;
  2116. font-size: 24rpx;
  2117. line-height: 34rpx;
  2118. color: #999999;
  2119. .iconfont {
  2120. margin-left: 4rpx;
  2121. font-size: 24rpx;
  2122. }
  2123. }
  2124. }
  2125. // .input-box.fixed {
  2126. // background: #FFFFFF;
  2127. // top: 0;
  2128. // right: 0;
  2129. // left: 0;
  2130. // z-index: 10;
  2131. // .input {
  2132. // background: #F5F5F5;
  2133. // color: #999999;
  2134. // }
  2135. // .menu_box .iconfont {
  2136. // color: #333333;
  2137. // }
  2138. // }
  2139. </style>