index3.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568
  1. <template>
  2. <view class="hx-store" @touchstart="touchStart" @touchend="touchEnd">
  3. <hx-navbar
  4. :fixed="true"
  5. :color="['#ffffff','#888888']"
  6. barPlaceholder="hidden"
  7. transparent="auto"
  8. :back="false"
  9. :rightSlot="false"
  10. :background-color="[245,245,245]"
  11. @scroll="navbarScroll">
  12. <block slot="left">
  13. <view class="" style="margin-left: 6px; font-size: 22px;">
  14. <!-- <uni-icons type="arrowleft" :color="navSearchColor" size="24" weight="bold"/> -->
  15. <i class="hxicon-back"></i>
  16. </view>
  17. </block>
  18. <view class="ctn">
  19. <view class="searchCtn" :style="{'width':navSearchWidth + '%','background-color':'rgba(230,230,230,'+ navSearchBgOpacity +')'}">
  20. <!-- <uni-icons type="search" size="22" :color="navSearchColor" weight="bold"/> -->
  21. <i class="hxicon-search"></i>
  22. <input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @confirm="confirm" style="font-size: 14px;" :style="{'opacity':navSearchBgOpacity ,'color':navSearchColor}">
  23. </view>
  24. <view class="leftBox" style="font-size: 22px;">
  25. <i class="hxicon-favor"></i>
  26. <i class="hxicon-more"></i>
  27. <!-- <uni-icons type="star" size="22" weight="bold" :color="navSearchColor"/>
  28. <uni-icons type="more-filled" weight="bold" size="22" :color="navSearchColor"/> -->
  29. </view>
  30. <view class="jrNull"></view>
  31. </view>
  32. <!-- <block slot="right">
  33. <view class="" style="display: flex;width: 100%;justify-content: space-between;">
  34. <uni-icons type="star" size="22" weight="bold" :color="navSearchColor"/>
  35. <uni-icons type="more-filled" weight="bold" size="22" :color="navSearchColor"/>
  36. </view>
  37. </block> -->
  38. </hx-navbar>
  39. <jumpBall :start.sync="num" :element.sync="element" @msg="jbMsg" :speed="animaTime" :index="9999"/>
  40. <!-- 头部 -->
  41. <view class="header">
  42. <image class="header-bg" :src="storeData.banner" mode=""></image>
  43. <view :class="showStoreBox ? 'header-bg-gray' : 'header-bg-black'"></view>
  44. <view class="header-top-Placeholder" ></view>
  45. <view class="container storeInfo hx-shadow" :style="{height:storeInfoBoxHeight + 'px'}">
  46. <image class="storeAvatar hx-shadow" :src="storeData.avatar" mode=""></image>
  47. <view class="hx-txt-18 hx-color-black hx-txt-weigth hx-mb-10 ">
  48. 十里桃花
  49. </view>
  50. <view class="hx-txt-14 hx-color-black ">
  51. 店家说明,本店放心吃,地方名才
  52. </view>
  53. <!-- <view class="">
  54. 后续再扩展优惠券,满减,折扣,活动等功能
  55. </view> -->
  56. <view class="shrink-box">
  57. <i class="hxicon" :class="showStoreBox ? 'icon-fold' : 'icon-unfold'" @click="showStoreBox = !showStoreBox"></i>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 主体 -->
  62. <view class="main" :style="{height: mainHeight}" >
  63. <!-- <view class="" :style="{display:showZz}" style="position: absolute;top: 0;bottom: 0;left: 0;width: 100%; background: #3F536E;z-index: 999;opacity: 0.5;">
  64. 遮罩
  65. </view> -->
  66. <view class="QS-tabs-box" :style="{'top': 'calc(44px + ' + statusBarHeight + 'px)','background-color':'rgba(245,245,245,'+ navSearchBgOpacity +')'}">
  67. <view class="" style="width: 210px;height: 100%;">
  68. <view class="hx-tabs">
  69. <view class="hx-tabs-item" v-for="(item,i) in tabs" :key="i" :class="{'hx-tabs-active': swiperCurrent == i}" @click="swiperChange(i)" :style="{transition: transtionTime + 'ms'}">
  70. <text>{{item.name}}</text>
  71. </view>
  72. <view class="hx-tabs-slider-box" :style="{transition: transtionTime + 'ms',left:swiperCurrentSliderLeft + 'px'}">
  73. <view class="hx-tabs-slider"></view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <swiper
  79. id="mainSwiper"
  80. style="height: 100%;"
  81. :current="swiperCurrent"
  82. :duration="transtionTime"
  83. @transition="transition"
  84. @animationfinish="animationfinish">
  85. <!-- 购物 -->
  86. <swiper-item class="swiper-item" >
  87. <view class="scroll-items">
  88. <view class="category-list">
  89. <!-- 左侧分类导航 -->
  90. <scroll-view :scroll-y="true" class="left" >
  91. <view v-for="item in categoryList" :key="item.id" class="row" :class="{active: item.id == currentId}" @click="showCategory(item)">
  92. <view class="text">
  93. {{item.name}}
  94. </view>
  95. <view class="row-number" v-if="item.number">
  96. {{item.number}}
  97. </view>
  98. </view>
  99. </scroll-view>
  100. <!-- 右侧子导航 -->
  101. <scroll-view scroll-with-animation :scroll-y="true" class="right" @scroll="asideScroll" :scroll-top="tabScrollTop" >
  102. <view class="goodsListBox">
  103. <view class="category" v-for="item in categoryList" :key="item.id" :id="'goodsBox'+item.id" >
  104. <view class="s-item">{{item.name}}</view>
  105. <view class="list" >
  106. <view class="box" v-for="(rowData,i) in goodsList" :key="rowData.id" v-if="item.id == rowData.type_id">
  107. <!-- 商品列表 -->
  108. <!-- <m-store-pro @touchOnGoods="touchOnGoods" :rowData="box"></m-store-pro>
  109. -->
  110. <!-- 商品列表 -->
  111. <view class="m-store-item">
  112. <view class="m-img" @click="hrefGoodsInfo(rowData.id)">
  113. <image style="width: 100%;height: 100%;" :src="rowData.img" mode="aspectFit"></image>
  114. </view>
  115. <view class="m-text">
  116. <view class="m-title" @click="hrefGoodsInfo(rowData.id)">
  117. {{rowData.name}}
  118. </view>
  119. <view class="m-descripe">
  120. {{rowData.descripe}}
  121. </view>
  122. <view class="m-price-box">
  123. <view class="symbol">¥</view>
  124. <view class="m-price">{{rowData.price}}</view>
  125. <view class="m-old-price" v-if="rowData.oldprice">
  126. <text>¥{{rowData.oldprice}}</text>
  127. </view>
  128. </view>
  129. <view class="m-distance" >
  130. <view :class="'addEle_' + i" class="jumpPosition">
  131. </view>
  132. <hx-number-box @change="addGoodsChange" :value="rowData.number" :rowData="rowData" :clickTime="animaTime + 100" @addChange="touchOnAddGoods('.addEle_' + i,rowData)"></hx-number-box>
  133. <!-- <image @click="touchOnAddGoods('.addEle_' + i,rowData)" style="width:20px;height: 20px;" src="../../static/img/icon/shop_icon_buy.png" mode="aspectFit"></image>
  134. -->
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </scroll-view>
  143. </view>
  144. </view>
  145. </swiper-item>
  146. <!-- 评价 -->
  147. <swiper-item class="swiper-item" >
  148. <scroll-view scroll-y style="height: 100%;width: 100%;background-color: #ffffff;" @scroll="asideScroll">
  149. <view class="scroll-items evaluate-box" >
  150. <view class="evaluate-box-header">
  151. </view>
  152. <view class="evaluate-box-body">
  153. </view>
  154. <hx-comment :listData="commentList"></hx-comment>
  155. </view>
  156. </scroll-view>
  157. </swiper-item>
  158. <!-- 商家 -->
  159. <swiper-item class="swiper-item" >
  160. <view class="scroll-items business-box">
  161. <view class="info-list hx-mt-15">
  162. <view class="info-list-container">
  163. <i class="hxicon-location"></i>
  164. <text>{{ storeData.address }}</text>
  165. </view>
  166. </view>
  167. <view class="info-list hx-mt-15 ">
  168. <view class="info-list-container hx-bb">
  169. <i class="hxicon-time"></i>
  170. <text>配送时间:{{ storeData.delivery_time }}</text>
  171. </view>
  172. </view>
  173. <view class=" info-list">
  174. <view class="info-list-container" @click="goCall(storeData.telephone)">
  175. <i class="hxicon-phone"></i>
  176. <text style="flex: 1;">商家电话:{{ storeData.telephone }}</text>
  177. <view class="right">
  178. <text>拨打</text><i class="hxicon-right"></i>
  179. </view>
  180. </view>
  181. </view>
  182. <view class="info-list hx-mt-15">
  183. <view class="info-list-container" @click="showStoreBoxFunc">
  184. <i class="hxicon-new" style="color:#ff3333"></i>
  185. <text style="flex: 1;">商家当前热门活动</text>
  186. <view class="right">
  187. <text>查看</text><i class="hxicon-right"></i>
  188. </view>
  189. </view>
  190. </view>
  191. </view>
  192. </swiper-item>
  193. </swiper>
  194. </view>
  195. <!-- 购物车 -->
  196. <view class="foot" @touchmove.stop.prevent="mpClear" :style="{height: footHeight}" v-if="showFoot">
  197. <view class="zz" @click="hideShoppingCar"></view>
  198. <view class="btn-box">
  199. <view class="btn-box-left" @click="contact">
  200. <view class="imgBox">
  201. <image src="../../static/store/contact.png" mode=""></image>
  202. </view>
  203. <text>联系商家</text>
  204. </view>
  205. <view class="btn-box-line"></view>
  206. <view class="btn-box-center" @click="showShoppingCar">
  207. <view class="cart" :animation="cartAnimationData">
  208. <view class="tag cartNum" v-if="goodsTotalNumber>0">{{goodsTotalNumber}}</view>
  209. <image :src="goodsTotalNumber ? '/static/store/cart.png' : '/static/store/cart2.png'" mode=""></image>
  210. </view>
  211. <view class="priceBox">
  212. <view class="hx-txt-18 hx-color-white" v-if="goodsTotalPrice>0">
  213. ¥{{goodsTotalPrice}}
  214. </view>
  215. <view class="hx-txt-10 hx-color-gray">
  216. 另需配送费¥{{shippingDees}}
  217. </view>
  218. </view>
  219. </view>
  220. <view class="btn-box-right">
  221. <view class="jiesuan" v-if="goodsTotalPrice>0 && goodsTotalPrice >= startingPrice" @click="jiesuan">
  222. 去结算
  223. </view>
  224. <view class="pscj hx-txt-10 hx-color-gray" v-else>
  225. <text v-if="startingPrice>0">差¥{{-(goodsTotalPrice-startingPrice)}}起送</text>
  226. </view>
  227. </view>
  228. </view>
  229. <view class="cart-box" :style="{display: showCar ? 'flex' : 'none'}">
  230. <view class="box-container rebate-box" v-if="showDiscount">
  231. <text>已享100减25</text>
  232. </view>
  233. <view class="box-container operating-box">
  234. <view class="operating-box_right">
  235. </view>
  236. <view class="operating-box_left clear" @click="clearShoppingCart">
  237. <i class="hxicon-delete"></i>
  238. <text>清空购物车</text>
  239. </view>
  240. </view>
  241. <view class=" goods-box">
  242. <view class="" style="flex: 1;">
  243. <scroll-view scroll-y="true" class="goods-list-scroll" :scroll-top="carGoodsScrollTop">
  244. <view class="goods-list">
  245. <view class="box" v-for="(rowData,i) in shoppCart" :key="i" v-if="rowData.number>0">
  246. <view class="m-store-item">
  247. <view class="m-img">
  248. <image style="width: 100%;height: 100%;" :src="rowData.img" mode="aspectFit"></image>
  249. </view>
  250. <view class="m-text">
  251. <view class="m-title">
  252. {{rowData.name}}
  253. </view>
  254. <view class="m-descripe">
  255. {{rowData.descripe}}
  256. </view>
  257. <view class="m-price-box" >
  258. <view class="symbol">¥</view>
  259. <view class="m-price">{{rowData.price}}</view>
  260. <view class="m-old-price" v-if="rowData.oldprice">
  261. <text>¥{{rowData.oldprice}}</text>
  262. </view>
  263. </view>
  264. <view class="m-distance" >
  265. <view :class="'addEle2_' + i" class="jumpPosition">
  266. </view>
  267. <hx-number-box @change="addGoodsChange" :value="rowData.number" :rowData="rowData" :clickTime="animaTime + 100" @addChange="touchOnAddGoods('.addEle2_' + i,rowData)"></hx-number-box>
  268. </view>
  269. </view>
  270. </view>
  271. </view>
  272. </view>
  273. </scroll-view>
  274. </view>
  275. </view>
  276. </view>
  277. </view>
  278. </view>
  279. </template>
  280. <script>
  281. import uniIcons from '@/components/uni-icons/uni-icons.vue';
  282. import hxNavbar from '@/components/hx-navbar/hx-navbar.vue';
  283. import jumpBall from '@/components/hx-jump-ball/hx-jump-ball.vue';
  284. import hxNumberBox from "@/components/uni-number-box/uni-number-box.vue";
  285. import hxComment from "@/components/hx-comment/hx-comment.vue";
  286. //引入测试数据
  287. import testData from "@/common/testdata.js";
  288. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  289. export default {
  290. components: {
  291. jumpBall,
  292. hxNavbar,
  293. uniIcons,
  294. hxNumberBox,
  295. hxComment
  296. },
  297. data() {
  298. return {
  299. //商家信息
  300. storeData: [],
  301. //商品列表
  302. goodsList: [],
  303. //商品分类信息列表
  304. categoryList: [],
  305. //评论列表
  306. commentList: [],
  307. navSearchWidth: 10,
  308. navSearchBgOpacity: 0,
  309. navSearchColor: '#ffffff',
  310. navHeadHeight: 44,
  311. //默认禁止商品栏滚动
  312. goodsBoxScroll: false,
  313. statusBarHeight,
  314. //动画时间
  315. animaTime: 300,
  316. //商家盒子高度
  317. storeInfoBoxHeight: 100,
  318. //展开门店信息容器
  319. showStoreBox: false,
  320. num:1,
  321. element: [],
  322. cartAnimation: {},
  323. cartAnimationData: {},
  324. //tabs
  325. tabs: [
  326. {name:'购物'},
  327. {name:'评价'},
  328. {name:'商家'},
  329. ],
  330. swiperCurrent: 0,
  331. dx: 0,
  332. swiperCurrentSliderLeft: 0,
  333. transtionTime:100,
  334. //购物车
  335. shoppingCartAll:[],
  336. //显示购物车
  337. showFoot:true,
  338. //配送费
  339. shippingDees: 0,
  340. //配送起步价
  341. startingPrice:0,
  342. //购物车商品价格合计
  343. goodsTotalPrice: 0,
  344. //购物车商品数量合计
  345. goodsTotalNumber: 0,
  346. //购物车
  347. shoppCart: [],
  348. //foot 高度
  349. footHeight: '0',
  350. //显示购物车
  351. showCar: false,
  352. //购物车中商品滚动条位置
  353. carGoodsScrollTop: 0,
  354. //购物车缓存 Storage 名称
  355. shoppingCartStorageName: 'shopping_cart',
  356. sizeCalcState: false,
  357. tabScrollTop: 0,
  358. mainHeight: 0,
  359. currentId:1,
  360. //购物车显示折扣
  361. showDiscount:true,
  362. //手指触摸滑动
  363. touchData:{},
  364. //页面滚动条距离顶部的距离
  365. pageScrollTop: 0
  366. }
  367. },
  368. onLoad() {
  369. this.cartAnimation = uni.createAnimation({
  370. duration: 800,
  371. timingFunction: "ease",
  372. delay: 0
  373. });
  374. let sysInfo = uni.getSystemInfoSync();
  375. //屏幕高度 - 头部导航高度 - 状态栏高度 - 分页高度
  376. this.mainHeight = sysInfo.screenHeight - 43 - statusBarHeight - 40 + 'px';
  377. },
  378. mounted() {
  379. let that = this
  380. uni.showLoading({
  381. title: '加载中'
  382. });
  383. //模拟请求数据
  384. setTimeout(()=>{
  385. //商家信息
  386. that.storeData = testData.storeData,
  387. //商品列表
  388. that.goodsList = testData.goodsData;
  389. //商品分类信息列表
  390. that.categoryList = testData.categoryData;
  391. //评论列表
  392. that.commentList = testData.commentData,
  393. setTimeout(()=>{
  394. that.init();
  395. uni.hideLoading();
  396. },500)
  397. },1000)
  398. },
  399. watch:{
  400. showStoreBox(val,oldVal){
  401. if(val == true){
  402. this.showStoreBoxFunc();
  403. }else{
  404. this.hiddenStoreBoxFunc();
  405. }
  406. }
  407. },
  408. onPageScroll(e) {
  409. let that = this
  410. },
  411. methods: {
  412. init(){
  413. let that = this;
  414. //假设这是从后台获取的商品数据
  415. let goods = this.goodsList;
  416. //商品初始化
  417. for(let i in goods){
  418. goods[i].purchases = 3
  419. }
  420. let carts = uni.getStorageSync(that.shoppingCartStorageName) || [];
  421. //根据缓存数据 获取购物车中属于本商店的商品
  422. for(let i in carts){
  423. if(carts[i].store_id == that.storeData.store_id){
  424. that.shoppCart = carts[i].shopping_cart;
  425. break;
  426. }
  427. }
  428. for(let i in that.shoppCart){
  429. for(let j in goods){
  430. if(goods[j].id == that.shoppCart[i].id){
  431. goods[j].number = that.shoppCart[i].number
  432. }
  433. }
  434. //计算商品总价
  435. that.goodsTotalPrice += that.shoppCart[i].total
  436. //商品总数量
  437. that.goodsTotalNumber += that.shoppCart[i].number
  438. }
  439. //初始化商品列表
  440. that.goodsList = goods;
  441. //初始化起步价和配送费
  442. that.starting_price = that.storeData.starting_price;
  443. that.shipping_dees = that.storeData.shipping_dees;
  444. that.setLabelNumber();
  445. this.calcSize();
  446. },
  447. //导航栏滑动时的操作
  448. navbarScroll(scroll){
  449. let top = scroll.scrollTop
  450. let that = this
  451. this.pageScrollTop = scroll.scrollTop
  452. if(top < 120){
  453. if(this.navSearchWidth >= 3){
  454. if(top<3){
  455. this.navSearchWidth = 3
  456. this.navSearchBgOpacity = 0
  457. this.navSearchColor = '#ffffff'
  458. }else{
  459. let n = top * (120/100)
  460. if(n > 100){
  461. n = 100
  462. }
  463. this.navSearchWidth = n
  464. this.navSearchBgOpacity = top * (1/100)
  465. this.navSearchColor = '#888888'
  466. }
  467. }
  468. }else{
  469. this.navSearchWidth = 100
  470. this.navSearchBgOpacity = 1
  471. this.navSearchColor = '#888888'
  472. }
  473. },
  474. jbMsg(res){
  475. let that = this;
  476. that.cartAnimation.matrix(1, 0, 0, 0.7, 0, 7).step({duration: 100})
  477. that.cartAnimationData = that.cartAnimation.export();
  478. //动画在app端有bug,所以必须写延迟才能解决
  479. setTimeout(function() {
  480. that.cartAnimation.matrix(1, 0, 0, 1, 0, 0).step({duration: 150});
  481. that.cartAnimationData = that.cartAnimation.export();
  482. },100);
  483. },
  484. swiperChange(index) {
  485. this.swiperCurrent = index;
  486. this.swiperCurrentSliderLeft= 70 * index;
  487. },
  488. transition({ detail: { dx } }) {
  489. // this.$refs.tabs.setDx(dx);
  490. },
  491. animationfinish({detail: { current }}) {
  492. /* this.$refs.tabs.setFinishCurrent(current); */
  493. this.swiperCurrent = current;
  494. this.current = current;
  495. this.swiperChange(current);
  496. this.showFoot = current == 0 && this.showStoreBox != true ? true : false;
  497. },
  498. //一级分类点击
  499. showCategory(item){
  500. this.calcSize();
  501. this.currentId = item.id;
  502. let index = this.categoryList.findIndex(sitem=>sitem.id === item.id);
  503. this.tabScrollTop = this.categoryList[index].top;
  504. },
  505. //右侧栏滚动
  506. asideScroll(e){
  507. let that = this;
  508. this.calcSize();
  509. let scrollTop = Math.round(e.detail.scrollTop);
  510. let tabs = this.categoryList.filter(item=>item.top <= scrollTop).reverse();
  511. if(tabs.length > 0){
  512. this.currentId = tabs[0].id;
  513. }
  514. if(scrollTop > 0){
  515. uni.createSelectorQuery().select(".main").fields({
  516. scrollOffset: true,
  517. rect: true,
  518. },(res)=>{
  519. res.top = Math.round(res.top)
  520. if(res.top > 111){
  521. that.navbarScroll({scroll:150})
  522. uni.pageScrollTo({
  523. duration:0,
  524. scrollTop:res.top
  525. })
  526. }
  527. }).exec()
  528. }
  529. },
  530. //计算右侧栏每个tab的高度等信息
  531. calcSize(event){
  532. let h = 0;
  533. this.categoryList.forEach(item=>{
  534. let view = uni.createSelectorQuery().select("#goodsBox" + item.id);
  535. view.fields({
  536. size: true
  537. }, data => {
  538. item.top = h;
  539. h += Math.round(data.height);
  540. item.bottom = h;
  541. }).exec();
  542. })
  543. this.sizeCalcState = true;
  544. },
  545. //小球跳跃动画
  546. touchOnAddGoods(ele,data){
  547. this.element = [ele,'.cart'];
  548. this.num ++;
  549. },
  550. //新增商品计算价格
  551. addGoodsChange(number,rowData){
  552. number = Number(number)
  553. var that = this;
  554. let shoppCart = this.shoppCart;
  555. let totalPrice = 0;
  556. let totalNumber = 0;
  557. let existedGoods = false;
  558. //检查该商品是否为第一次添加,如果为第二次添加,则直接修改商品数量,并计算出合计
  559. for(var i in shoppCart){
  560. //非第一次添加
  561. if(shoppCart[i].id == rowData.id){
  562. shoppCart[i].number = rowData.number = number;
  563. shoppCart[i].total = number * shoppCart[i].price
  564. existedGoods = true;
  565. break;
  566. }
  567. }
  568. //第一次添加
  569. if(!existedGoods){
  570. rowData.number = number;
  571. rowData.total = number * rowData.price
  572. shoppCart.push(rowData);
  573. }
  574. //计算总商品数量和总价
  575. for(var i in shoppCart){
  576. //总价
  577. totalPrice += shoppCart[i].total
  578. totalNumber += shoppCart[i].number
  579. }
  580. //更改商品列表中的已购买数量
  581. for(let i in that.goodsList){
  582. if(that.goodsList[i].id == rowData.id){
  583. that.goodsList[i] = rowData
  584. break;
  585. }
  586. }
  587. that.shoppCart = shoppCart;
  588. if(that.goodsTotalPrice < totalPrice){
  589. //更具小球动画延时更改数据
  590. setTimeout(function(){
  591. that.goodsTotalPrice = totalPrice
  592. that.goodsTotalNumber = totalNumber
  593. },that.animaTime + 150);
  594. }else{
  595. that.goodsTotalPrice = totalPrice
  596. that.goodsTotalNumber = totalNumber
  597. }
  598. //门店第一次添加该商品
  599. let isFirstAddGoods = true;
  600. that.storeData.shopping_cart = that.shoppCart;
  601. for(let i in that.shoppingCartAll){
  602. if(that.shoppingCartAll[i].store_id == that.storeData.store_id){
  603. that.shoppingCartAll[i] = that.storeData
  604. isFirstAddGoods = false
  605. }
  606. }
  607. that.setLabelNumber();
  608. if(isFirstAddGoods === true){
  609. that.shoppingCartAll.push(that.storeData)
  610. }
  611. if(that.goodsTotalNumber == 0){
  612. that.hideShoppingCar();
  613. }
  614. //购物车商品数据缓存至本地
  615. uni.setStorageSync(that.shoppingCartStorageName,that.shoppingCartAll);
  616. },
  617. //计算每类商品购买的总数
  618. setLabelNumber(){
  619. let that = this;
  620. //计算每一类购买商品的总数量
  621. for(let j in that.categoryList){
  622. let n = 0;
  623. for(var i in that.shoppCart){
  624. if(that.shoppCart[i].type_id == that.categoryList[j].id){
  625. n += that.shoppCart[i].number;
  626. }
  627. }
  628. that.categoryList[j].number = n;
  629. }
  630. },
  631. //去结算
  632. jiesuan(){
  633. uni.showModal({
  634. title:"",
  635. content:"去结算"
  636. })
  637. },
  638. //联系商家
  639. contact(){
  640. uni.showModal({
  641. title:"",
  642. content:"联系商家"
  643. })
  644. },
  645. showStoreBoxFunc(){
  646. this.storeInfoBoxHeight = uni.getSystemInfoSync().screenHeight-136;
  647. this.$set(this.$data,'showFoot',false);
  648. this.showStoreBox = true;
  649. uni.pageScrollTo({
  650. duration:0,
  651. scrollTop:0
  652. })
  653. },
  654. hiddenStoreBoxFunc(){
  655. this.storeInfoBoxHeight = 100;
  656. this.showStoreBox = false;
  657. if(this.swiperCurrent == 0){
  658. this.$set(this.$data,'showFoot',true);
  659. }
  660. },
  661. mpClear(e) {
  662. // TODO nvue 取消冒泡
  663. e.stopPropagation()
  664. },
  665. //显示购物车
  666. showShoppingCar(){
  667. if(this.goodsTotalNumber == 0){
  668. return;
  669. }
  670. this.footHeight = '100%';
  671. this.showCar = true;
  672. this.carGoodsScrollTop = 0;
  673. },
  674. //隐藏购物车
  675. hideShoppingCar(){
  676. this.footHeight = '0';
  677. this.showCar = false;
  678. },
  679. //清空该门店的购物车
  680. clearShoppingCart(){
  681. let that = this;
  682. that.shoppCart = [];
  683. that.storeData.shopping_cart = [];
  684. for(let i in that.shoppingCartAll){
  685. if(that.shoppingCartAll[i].store_id == that.storeData.store_id){
  686. that.shoppingCartAll[i] = that.storeData
  687. }
  688. }
  689. uni.setStorageSync(that.shoppingCartStorageName,that.shoppingCartAll);
  690. for(let i in that.goodsList){
  691. that.goodsList[i].number = 0;
  692. }
  693. for(let i in that.categoryList){
  694. that.categoryList[i].number = 0;
  695. }
  696. //购物车商品价格合计
  697. that.goodsTotalPrice = 0;
  698. //购物车商品数量合计
  699. that.goodsTotalNumber = 0;
  700. that.hideShoppingCar();
  701. },
  702. hrefGoodsInfo(id){
  703. uni.navigateTo({
  704. url: '/pages/product/product?id=' + id
  705. });
  706. },
  707. //拨打电话
  708. goCall(phone){
  709. if(!phone){
  710. return;
  711. }
  712. uni.makePhoneCall({
  713. phoneNumber: phone //仅为示例
  714. });
  715. },
  716. touchStart(e){
  717. this.touchData.clientX=e.changedTouches[0].clientX;
  718. this.touchData.clientY=e.changedTouches[0].clientY;
  719. },
  720. touchEnd(e){
  721. const subX=e.changedTouches[0].clientX-this.touchData.clientX;
  722. const subY=e.changedTouches[0].clientY - this.touchData.clientY;
  723. if(subY>50 || subY<-50){
  724. if(subY>50){
  725. //console.log('下滑')
  726. if(this.pageScrollTop == 0){
  727. //this.showStoreBox=true;
  728. }
  729. }else if(subY<-50){
  730. //console.log('上滑')
  731. this.showStoreBox= false;
  732. }else{
  733. //console.log('上下滑无效')
  734. }
  735. }else{
  736. if(subX>100){
  737. //console.log('右滑')
  738. }else if(subX<-100){
  739. //console.log('左滑')
  740. }else{
  741. //console.log('左右滑无效')
  742. }
  743. }
  744. }
  745. }
  746. }
  747. </script>
  748. <style lang="scss">
  749. //主题颜色
  750. $hx-theme-color: #FFC107;
  751. $hx-theme-color-light: #FFEB3B;
  752. .add{
  753. position: fixed;
  754. right: 60upx;
  755. top: 300upx;
  756. z-index: 999;
  757. }
  758. .ctn{
  759. /* border: 1px solid #e3e3e3; */
  760. width: 100%;
  761. display: flex;
  762. justify-content: flex-end;
  763. overflow: hidden;
  764. align-items: center;
  765. .searchCtn{
  766. display: flex;
  767. border-radius: 80upx;
  768. padding: 8upx 12upx;
  769. line-height: 44upx;
  770. background: #e0e0e0;
  771. overflow: hidden;
  772. align-items: center;
  773. min-width: 22px;
  774. }
  775. .leftBox{
  776. display: flex;
  777. width: 53px;
  778. justify-content: space-between;
  779. flex: none;
  780. margin: 0 8px;
  781. }
  782. .jrNull{
  783. /* #ifdef MP */
  784. width: 95px;
  785. flex: none;
  786. /* #endif */
  787. }
  788. }
  789. page{
  790. background: #ffffff;
  791. }
  792. .hx-bb{
  793. border-bottom: 1px solid $uni-border-color;
  794. }
  795. .hx-txt-10{
  796. font-size: 10px;
  797. }
  798. .hx-txt-12{
  799. font-size: 12px;
  800. }
  801. .hx-txt-14{
  802. font-size: 14px;
  803. }
  804. .hx-txt-16{
  805. font-size: 16px;
  806. }
  807. .hx-txt-18{
  808. font-size: 18px;
  809. }
  810. .hx-txt-22{
  811. font-size: 22px;
  812. }
  813. .hx-color-gray{
  814. color: #bbbbbb;
  815. }
  816. .hx-color-white{
  817. color: #FFFFFF;
  818. }
  819. .hx-color-black{
  820. color: #333333;
  821. }
  822. .hx-txt-weigth{
  823. font-weight: bold;
  824. }
  825. .hx-mb-10{
  826. margin-bottom: 10px;
  827. }
  828. .hx-mt-15{
  829. margin-top: 15px;
  830. }
  831. .hx-shadow{
  832. box-shadow: 0px 6upx 16upx rgba(173, 173, 173, 0.2);
  833. }
  834. .hx-store{
  835. .header{
  836. position: relative;
  837. min-height: 230px;
  838. &-bg{
  839. position: absolute;
  840. left: 0;
  841. top: 0;
  842. z-index: 2;
  843. width: 100%;
  844. height: 142px;
  845. }
  846. &-bg-black{
  847. position: absolute;
  848. left: 0;
  849. top: 142px;
  850. bottom: 0;
  851. z-index: 1;
  852. background-color: #ffffff;
  853. width: 100%;
  854. transition: background-color 0.2s;
  855. }
  856. &-bg-gray{
  857. position: absolute;
  858. left: 0;
  859. top: 142px;
  860. bottom: -16px;
  861. z-index: 1;
  862. background-color: #afafaf;
  863. width: 100%;
  864. transition: background-color 0.2s;
  865. }
  866. &-top-Placeholder{
  867. height: 105px;
  868. }
  869. .storeInfo{
  870. position: relative;
  871. z-index: 2;
  872. background: #ffffff;
  873. height: 100px;
  874. border-radius: 6px;
  875. padding: 12px;
  876. margin-bottom: 4px;
  877. transition: all 0.2s;
  878. .shrink-box{
  879. position: absolute;
  880. bottom: 0;
  881. left: 0;
  882. right: 0;
  883. text-align: center;
  884. font-size: 20px;
  885. color: #a2a8ab;
  886. }
  887. .storeAvatar{
  888. position: absolute;
  889. width: 50px;
  890. height: 50px;
  891. right: 16px;
  892. top: -25px;
  893. background: #ffffff;
  894. border-radius: 4px;
  895. }
  896. }
  897. }
  898. .container{
  899. margin: 0 32upx;
  900. }
  901. .QS-tabs-box{
  902. width: 100%;
  903. position: sticky;
  904. top: calc(44px + var(--status-bar-height));
  905. z-index: 10;
  906. background-color: white;
  907. border-bottom: 1px solid #efefef;
  908. height: 40px;
  909. .hx-tabs{
  910. position: relative;
  911. display: flex;
  912. height:100%;
  913. &-item{
  914. display: flex;
  915. flex-direction: row;
  916. justify-content: center;
  917. align-items: center;
  918. width: 70px;
  919. color:#666666;
  920. text{
  921. font-size: 16px;
  922. }
  923. }
  924. &-active{
  925. color:#333333;
  926. font-weight: bold;
  927. }
  928. &-slider-box{
  929. position: absolute;
  930. display: flex;
  931. justify-content: center;
  932. bottom: 0;
  933. width: 70px;
  934. }
  935. &-slider{
  936. display: flex;
  937. background: #f6d200;
  938. width: 30px;
  939. height: 3px;
  940. }
  941. }
  942. }
  943. .main{
  944. position: relative;
  945. background-color: #ffffff;
  946. #mainSwiper{
  947. background-color: #eeeeee;
  948. position: sticky;
  949. top: calc(40px + 44px + var(--status-bar-height));
  950. .scroll-items{
  951. // 商品列表样式
  952. .category-list{
  953. width: 100%;
  954. background-color: #fff;
  955. display: flex;
  956. padding-bottom: 50px;
  957. .left,.right{
  958. background: #fff;
  959. position: absolute;
  960. top:0;
  961. bottom: 0upx;
  962. }
  963. .left{
  964. width: 24%;
  965. left: 0upx;
  966. background-color: #f6f3f3;
  967. .row{
  968. width: 100%;
  969. height: 45px;
  970. display: flex;
  971. align-items: center;
  972. overflow: hidden;
  973. position: relative;
  974. .text{
  975. width: 100%;
  976. font-size: 14px;
  977. color:#999999;
  978. overflow: hidden;
  979. text-overflow: ellipsis;
  980. display: -webkit-box;
  981. -webkit-box-orient: vertical;
  982. -webkit-line-clamp: 2;
  983. text-align: center;
  984. padding: 0 16px;
  985. }
  986. &-number{
  987. position: absolute;
  988. width: 18px;
  989. height: 18px;
  990. right: 4px;
  991. top: 4px;
  992. background: #ff5722;
  993. border-radius: 50%;
  994. line-height: 18px;
  995. text-align: center;
  996. font-size: 10px;
  997. color: #ffffff;
  998. }
  999. &.active{
  1000. height: 45px;
  1001. background-color: #fff;
  1002. .text{
  1003. font-size: 14px;
  1004. }
  1005. }
  1006. }
  1007. .row:last-child{
  1008. margin-bottom: 200upx;
  1009. }
  1010. }
  1011. .right{
  1012. width: 76%;
  1013. left: 24%;
  1014. .goodsListBox{
  1015. padding-bottom: 100px;
  1016. .category{
  1017. // width: 94%;
  1018. padding: 0 15px 10px 15px;
  1019. .s-item{
  1020. height: 45px;
  1021. line-height: 45px;
  1022. font-size: 16px;
  1023. background: #ffffff;
  1024. color: #555555;
  1025. position: sticky;
  1026. top: 0;
  1027. z-index: 18;
  1028. }
  1029. .list:last-child{
  1030. margin-bottom: 0;
  1031. }
  1032. .list{
  1033. margin-bottom: 20px;
  1034. width: 100%;
  1035. display: flex;
  1036. flex-wrap: wrap;
  1037. .box:first-child{
  1038. .m-store-item{
  1039. margin-top: 0;
  1040. }
  1041. }
  1042. .box{
  1043. width: 100%;
  1044. .m-store-item{
  1045. display: flex;
  1046. flex-direction: row;
  1047. width: 100%;
  1048. justify-content: space-between;
  1049. align-items: flex-end;
  1050. margin-top: 15px;
  1051. margin-bottom: 15px;
  1052. .m-img{
  1053. flex: 0 0 85px;
  1054. height: 85px;
  1055. background: #eee;
  1056. border-radius: 4px;
  1057. }
  1058. .m-text{
  1059. flex: 1;
  1060. position: relative;
  1061. height: 85px;
  1062. padding: 0 6px;
  1063. display: flex;
  1064. align-content: space-between;
  1065. flex-direction: column;
  1066. .m-title{
  1067. font-size: 16px;
  1068. color:#555555;
  1069. height: 21px;
  1070. font-weight: bold;
  1071. }
  1072. .m-descripe{
  1073. font-size: 12px;
  1074. color:#999999;
  1075. margin-top: 5px;
  1076. height: 35px;
  1077. }
  1078. .m-price-box{
  1079. height: 24px;
  1080. font-weight: bold;
  1081. display: flex;
  1082. flex-direction: row;
  1083. align-items: flex-end;
  1084. .symbol{
  1085. color:#ff582b;
  1086. font-size: 12px;
  1087. }
  1088. .m-price{
  1089. position: relative;
  1090. top: 2px;
  1091. font-size: 18px;
  1092. color:#ff582b;
  1093. }
  1094. .m-old-price{
  1095. margin-left: 3px;
  1096. display: flex;
  1097. flex-direction: row;
  1098. font-size: 10px;
  1099. color:#999999;
  1100. margin-top: 5upx;
  1101. text-decoration: line-through;
  1102. font-weight: normal;
  1103. }
  1104. }
  1105. .m-distance{
  1106. position: absolute;
  1107. right: 0;
  1108. bottom: -4px;
  1109. z-index: 16;
  1110. color:#b2b2b2;
  1111. font-size: 20upx;
  1112. text-align: right;
  1113. .jumpPosition{
  1114. position: absolute;
  1115. bottom: 23px;
  1116. right: 0;
  1117. z-index: 2;
  1118. width: 28px;
  1119. height: 28px;
  1120. }
  1121. }
  1122. }
  1123. }
  1124. }
  1125. }
  1126. }
  1127. }
  1128. }
  1129. }
  1130. }
  1131. .evaluate-box{
  1132. }
  1133. .business-box{
  1134. .info-list{
  1135. background: #ffffff;
  1136. padding: 0 15px;
  1137. &-container{
  1138. line-height: 46px;
  1139. height: 46px;
  1140. display: flex;
  1141. flex-direction: row;
  1142. [class*="hxicon-"]="hxicon-"]{
  1143. color: #a2a2a2;
  1144. margin-right: 8px;
  1145. }
  1146. text{
  1147. font-size: 14px;
  1148. }
  1149. .right{
  1150. float: right;
  1151. color: #dddddd;
  1152. display: flex;
  1153. flex-direction: row;
  1154. align-items:center;
  1155. [class*="hxicon-"]{
  1156. color: #dddddd;
  1157. margin-right: 0;
  1158. font-size: 16px;
  1159. }
  1160. }
  1161. }
  1162. }
  1163. }
  1164. }
  1165. }
  1166. .foot{
  1167. position: fixed;
  1168. display: flex;
  1169. z-index: 999;
  1170. justify-content:center;
  1171. align-items : center;
  1172. bottom: 0;
  1173. height: 100%;
  1174. width: 100%;
  1175. /*width: calc(100% - 32px);*/
  1176. .btn-box{
  1177. position:absolute;
  1178. display: flex;
  1179. bottom: 6px;
  1180. justify-content:center;
  1181. align-items : center;
  1182. margin:0;
  1183. height: 45px;
  1184. width: calc(100% - 32px);
  1185. z-index: 9;
  1186. &-left{
  1187. background: #222222;
  1188. border-top-left-radius:50px;
  1189. border-top-right-radius:9px;
  1190. border-bottom-left-radius:50px;
  1191. border-bottom-right-radius:9px;
  1192. padding-left: 6upx;
  1193. display: flex;
  1194. flex-direction:column;
  1195. justify-content:center;
  1196. align-self: center;
  1197. width: 70px;
  1198. height: 100%;
  1199. color: #f6d200;
  1200. text-align: center;
  1201. .imgBox{
  1202. display: flex;
  1203. text-align: center;
  1204. justify-content:center;
  1205. image{
  1206. width: 20px;
  1207. height: 20px;
  1208. }
  1209. }
  1210. text{
  1211. font-size: 20upx;
  1212. }
  1213. }
  1214. &-line{
  1215. background: #ffffff;
  1216. width: 2px;
  1217. height: 100%;
  1218. }
  1219. &-center{
  1220. height: 100%;
  1221. flex: auto;
  1222. display: flex;
  1223. justify-content:flex-start;
  1224. align-self: center;
  1225. align-items: center;
  1226. background: #222222;
  1227. border-top-left-radius:8upx;
  1228. border-bottom-left-radius:8upx;
  1229. padding-left: 10upx;
  1230. .cart{
  1231. position: relative;
  1232. width: 36px;
  1233. height: 36px;
  1234. image{
  1235. width: 100%;
  1236. height: 100%;
  1237. }
  1238. .tag{
  1239. position: absolute;
  1240. right: 12upx;
  1241. top: 16upx;
  1242. height: 18px;
  1243. width: 18px;
  1244. background-color: #ff4000;
  1245. color: #ffffff;
  1246. border-radius: 50%;
  1247. z-index: 1;
  1248. font-size: 10px;
  1249. text-align: center;
  1250. line-height: 18px;
  1251. }
  1252. }
  1253. .priceBox{
  1254. flex: auto;
  1255. }
  1256. }
  1257. &-right{
  1258. width: 70px;
  1259. height: 100%;
  1260. position: relative;
  1261. display: flex;
  1262. justify-content:flex-start;
  1263. align-self: center;
  1264. align-items: center;
  1265. .pscj{
  1266. width: 100%;
  1267. height: 100%;
  1268. border-top-right-radius:100upx;
  1269. border-bottom-right-radius:100upx;
  1270. background: #222222;
  1271. text-align: center;
  1272. display: flex;
  1273. justify-content:center;
  1274. align-self: center;
  1275. align-items: center;
  1276. }
  1277. .jiesuan{
  1278. width: 100%;
  1279. height: 100%;
  1280. font-size: 28upx;
  1281. border-top-right-radius:100upx;
  1282. border-bottom-right-radius:100upx;
  1283. text-align: center;
  1284. display: flex;
  1285. justify-content:center;
  1286. align-self: center;
  1287. align-items: center;
  1288. background: linear-gradient(45deg, $hx-theme-color-light, $hx-theme-color);
  1289. font-weight: bold;
  1290. color: #222222;
  1291. }
  1292. }
  1293. }
  1294. .zz{
  1295. position: absolute;
  1296. top: 0;
  1297. left: 0;
  1298. right: 0;
  1299. bottom: 0;
  1300. background-color: rgba(0,0,0,.7);
  1301. z-index: 1;
  1302. }
  1303. .cart-box{
  1304. display: flex;
  1305. justify-content: flex-start;
  1306. flex-flow: column;
  1307. background: #ffffff;
  1308. position: absolute;
  1309. bottom: 0;
  1310. z-index: 2;
  1311. max-height: 66%;
  1312. padding-bottom: 62px;
  1313. border-top-left-radius: 16px;
  1314. border-top-right-radius: 16px;
  1315. overflow: hidden;
  1316. width: 100%;
  1317. .rebate-box{
  1318. height: 30px;
  1319. background: #FFC107;
  1320. color: #FF9900;
  1321. text-align: center;
  1322. line-height: 30px;
  1323. font-size: 14px;
  1324. }
  1325. .box-container{
  1326. box-sizing: border-box;
  1327. padding:0 16px;
  1328. }
  1329. .operating-box{
  1330. font-size: 12px;
  1331. line-height: 40px;
  1332. height: 40px;
  1333. border-bottom: 1px solid #f6f6f6;
  1334. color: #666666;
  1335. display: flex;
  1336. flex-direction: row;
  1337. &_right{
  1338. flex: 1;
  1339. }
  1340. &_left{
  1341. display: flex;
  1342. flex-direction: row;
  1343. }
  1344. }
  1345. .goods-box{
  1346. height: 100%;
  1347. overflow: hidden;
  1348. flex: 1;
  1349. display: flex;
  1350. .goods-list-scroll{
  1351. height: 100%;
  1352. .goods-list{
  1353. width: 100%;
  1354. display: flex;
  1355. flex-wrap: wrap;
  1356. .box{
  1357. width: 100%;
  1358. border-bottom: 1px solid #f6f6f6;
  1359. box-sizing: border-box;
  1360. padding: 0 16px;
  1361. .m-store-item{
  1362. display: flex;
  1363. flex-direction: row;
  1364. width: 100%;
  1365. justify-content: space-between;
  1366. align-items: flex-end;
  1367. padding-top: 15px;
  1368. padding-bottom: 15px;
  1369. .m-img{
  1370. flex: 0 0 85px;
  1371. height: 85px;
  1372. background: #eee;
  1373. border-radius: 4px;
  1374. }
  1375. .m-text{
  1376. flex: 1;
  1377. position: relative;
  1378. height: 85px;
  1379. padding: 0 6px;
  1380. display: flex;
  1381. align-content: space-between;
  1382. flex-direction: column;
  1383. .m-title{
  1384. font-size: 16px;
  1385. color:#555555;
  1386. height: 21px;
  1387. font-weight: bold;
  1388. }
  1389. .m-descripe{
  1390. font-size: 12px;
  1391. color:#999999;
  1392. margin-top: 5px;
  1393. height: 35px;
  1394. }
  1395. .m-price-box{
  1396. height: 24px;
  1397. font-weight: bold;
  1398. display: flex;
  1399. flex-direction: row;
  1400. align-items: flex-end;
  1401. .symbol{
  1402. color:#ff582b;
  1403. font-size: 12px;
  1404. }
  1405. .m-price{
  1406. position: relative;
  1407. top: 2px;
  1408. font-size: 18px;
  1409. color:#ff582b;
  1410. }
  1411. .m-old-price{
  1412. margin-left: 3px;
  1413. display: flex;
  1414. flex-direction: row;
  1415. font-size: 10px;
  1416. color:#999999;
  1417. margin-top: 5upx;
  1418. text-decoration: line-through;
  1419. font-weight: normal;
  1420. }
  1421. }
  1422. .m-distance{
  1423. position: absolute;
  1424. right: 0;
  1425. bottom: -4px;
  1426. z-index: 16;
  1427. color:#b2b2b2;
  1428. font-size: 20upx;
  1429. text-align: right;
  1430. .jumpPosition{
  1431. position: absolute;
  1432. bottom: 23px;
  1433. right: 0;
  1434. z-index: 2;
  1435. width: 28px;
  1436. height: 28px;
  1437. }
  1438. }
  1439. }
  1440. }
  1441. }
  1442. }
  1443. }
  1444. }
  1445. }
  1446. }
  1447. }
  1448. </style>