index - ╕▒▒╛ (2).vue 42 KB

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