index.vue 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269
  1. <template>
  2. <view class="app-container">
  3. <view class="home-container">
  4. <block>
  5. <view class="top-container">
  6. <image src="@/static/home/top_bg.png" mode="widthFix" class="bg"></image>
  7. <view class="content">
  8. <view class="title" :style="cuStyle">广佛格力商城</view>
  9. <view class="header-container">
  10. <view class="left" @tap="getLocation">
  11. <image src="@/static/home/dingweitus.png"></image>
  12. <text style="color: #ffffff;">{{currentPosition||''}}</text>
  13. </view>
  14. </view>
  15. <view class="search">
  16. <image src="@/static/icon/search.png" class=""></image>
  17. <input v-model="keyword" @confirm="searchSubmit" type="text" confirm-type="search"
  18. placeholder="搜索商品名称或型号">
  19. </view>
  20. <view class="shangjiakapian">
  21. <view class="shangjiatupiand">
  22. <image style="width: 100%;height: 310rpx;" src="@/static/home/shangjiabeijing.png"
  23. class=""></image>
  24. <view class="nirongdd">
  25. <view style="color:#ffffff;font-size: 36rpx;margin-bottom: 16rpx;">
  26. {{websitData.name||''}}
  27. </view>
  28. <view
  29. style="margin-bottom: 16rpx;display: flex;justify-content: flex-start;align-items: center;">
  30. <view
  31. style="color:#ffffff;font-size: 24rpx;box-sizing: border-box;padding: 8rpx 18rpx;border-radius: 20rpx;background: rgba(245, 245,245,0.2);margin-right: 20rpx;">
  32. {{websitData.type||''}}
  33. </view>
  34. <view style="color:#ffffff;font-size: 24rpx;">
  35. {{websitData.websitNumber||''}}
  36. </view>
  37. </view>
  38. <view style="color:#ffffff;font-size: 24rpx;">地址:{{websitData.address||''}}</view>
  39. </view>
  40. <view
  41. style="display: flex;justify-content: space-between;align-items: center;width: 100%;height: 100rpx;position: absolute;left: 0;bottom: 0;right: 0;background: rgba(245, 245,245,0.3);">
  42. <view style="width: 50%;display: flex;justify-content: center;align-items: center;"
  43. @click="dakaidaoh">
  44. <image style="width: 40rpx;height: 40rpx;" src="@/static/home/juliduoyuan.png"
  45. class=""></image>
  46. <view style="font-size: 28rpx;color: #ffffff;margin-left: 20rpx;">
  47. 距您{{distancess||''}}KM
  48. </view>
  49. </view>
  50. <view
  51. style="width: 6rpx;height: 50rpx;border-radius: 3rpx;background:rgba(245, 245,245,0.6);">
  52. </view>
  53. <view style="width: 50%;display: flex;justify-content: center;align-items: center;"
  54. @click="bodasjdh(websitData.mobile||'')">
  55. <image style="width: 40rpx;height: 40rpx;" src="@/static/home/dianhuaaa.png"
  56. class=""></image>
  57. <view style="font-size: 28rpx;color: #ffffff;margin-left: 20rpx;">电话</view>
  58. </view>
  59. </view>
  60. <image @click="chakanyyzz" style="width: 50rpx;height: 50rpx;position: absolute; top: 30%; right: 40rpx;"
  61. src="@/static/home/yinyangzhiz.png"></image>
  62. </view>
  63. <view class="shangjiakapiandibubiaos">
  64. <view class="shangjiakapiandibuItem">
  65. <view>官方直营</view>
  66. </view>
  67. <view class="shangjiakapiandibuItem">
  68. <view>急速发货</view>
  69. </view>
  70. <view class="shangjiakapiandibuItem">
  71. <view>全场包邮</view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="swiper-container" v-if=" bannerList.length > 0">
  78. <swiper @change="changeBanner" :autoplay="true">
  79. <block v-for="(item, index) in bannerList" :key='index'>
  80. <swiper-item>
  81. <image :src="item.imgSrc" mode="aspectFill"
  82. @tap="toMiniProgram(item.appId, item.linkUrl)" v-if="item.type === 2"></image>
  83. <image :src="item.imgSrc" mode="aspectFill" @tap="toActivityList(item.goodsId)"
  84. v-if="item.type === 3"></image>
  85. <image :src="item.imgSrc" mode="aspectFill" @tap="toGoodsDetail(item.goodsId)" v-else>
  86. </image>
  87. </swiper-item>
  88. </block>
  89. </swiper>
  90. <view class="dots-conatiner">
  91. <view class="con" :style="'width:'+(bannerList.length * 20)+'rpx;'">
  92. <view class="dot" :style=" 'transform:translateX('+ (bannerCurrent * 100) +'%)' "></view>
  93. </view>
  94. </view>
  95. </view>
  96. </block>
  97. <!-- --------------------------------- -->
  98. <view class="caidanrukou">
  99. <view class="dangecaidanrukou" @click="goodsClassify">
  100. <view>
  101. <image class="tupiancaidan" src="@/static/home/fenlei.png"></image>
  102. </view>
  103. <view class="dangecaidanrukouTitle">商品分类</view>
  104. </view>
  105. <view class="dangecaidanrukou" @click="couponList">
  106. <view>
  107. <image class="tupiancaidan" src="@/static/home/youhuiquan.png"></image>
  108. </view>
  109. <view class="dangecaidanrukouTitle">优惠卡券</view>
  110. </view>
  111. <view class="dangecaidanrukou" @click="orderListPage">
  112. <view>
  113. <image class="tupiancaidan" src="@/static/home/dingdan.png"></image>
  114. </view>
  115. <view class="dangecaidanrukouTitle">我的订单</view>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="sptjyangshi">
  120. 商品推荐
  121. </view>
  122. <view class="top-container2">
  123. <view class="tab">
  124. <view class="item" :class="screenType === 0 ? 'current':''" @tap="changeScreen(0)">综合</view>
  125. <view class="item" :class="screenType === 1 ? 'current':''" @tap="changeScreen(1)">销量</view>
  126. <view class="item" :class="screenType === 2 || screenType === 3 ? 'current':''" @tap="changeScreen(2)">
  127. 价格
  128. <image src="@/static/icon/price_1.png" v-if="screenType === 2"></image>
  129. <image src="@/static/icon/price_2.png" v-if="screenType === 3"></image>
  130. <image src="@/static/icon/price_0.png" v-if="screenType != 2 && screenType != 3"></image>
  131. </view>
  132. <view class="item" :class="screenType === 4 ? 'current':''" @tap="changeScreen(4)">上架时间</view>
  133. </view>
  134. <!-- 切换商品卡片样式 -->
  135. <!-- <view class="icon">
  136. <image src="@/static/icon/show_1.png" v-if="showType == 1" @tap="showType = 2"></image>
  137. <image src="@/static/icon/show_2.png" v-if="showType == 2" @tap="showType = 1"></image>
  138. </view> -->
  139. </view>
  140. <view class="goods-waterfall-list" v-show="showType == 1">
  141. <view class="left">
  142. <block v-for="(item, index) in goodsList" :key='index'>
  143. <view class="item" v-if="index%2==0" @tap="toGoodsDetail(item.goodsId)">
  144. <view class="image">
  145. <image :src="item.imgUrl" mode="aspectFill" class="img"></image>
  146. <image :src="item.logo" mode="aspectFill" class="water" v-if="item.isShowWater"></image>
  147. </view>
  148. <view class="content">
  149. <view class="title ellipsis-2">{{item.goodsName}}</view>
  150. <view class="tags" v-if="item.tags1 && item.tags1.length > 0">
  151. <view class="it" v-for="(it, idx) in item.tags1" :key="idx">{{it}}</view>
  152. </view>
  153. <view class="price">
  154. <view class="price-1">¥{{item.goodsPrice | numToFixed}}</view>
  155. <view class="price-2">¥{{item.orgGoodsPrice | numToFixed}}</view>
  156. </view>
  157. <view class="tags2" v-if="item.tags2 && item.tags2.length > 0">
  158. <view class="it" v-for="(it, idx) in item.tags2" :key="idx">{{it}}</view>
  159. </view>
  160. <view class="text">销量:{{item.soldNum}}</view>
  161. </view>
  162. </view>
  163. </block>
  164. </view>
  165. <view class="right">
  166. <block v-for="(item, index) in goodsList" :key='index'>
  167. <view class="item" v-if="index%2==1" @tap="toGoodsDetail(item.goodsId)">
  168. <view class="image">
  169. <image :src="item.imgUrl" mode="aspectFill" class="img"></image>
  170. <image :src="item.logo" mode="aspectFill" class="water" v-if="item.isShowWater"></image>
  171. </view>
  172. <view class="content">
  173. <view class="title ellipsis-2">{{item.goodsName}}</view>
  174. <view class="tags" v-if="item.tags1 && item.tags1.length > 0">
  175. <view class="it" v-for="(it, idx) in item.tags1" :key="idx">{{it}}</view>
  176. </view>
  177. <view class="price">
  178. <view class="price-1">¥{{item.goodsPrice | numToFixed}}</view>
  179. <view class="price-2">¥{{item.orgGoodsPrice | numToFixed}}</view>
  180. </view>
  181. <view class="tags2" v-if="item.tags2 && item.tags2.length > 0">
  182. <view class="it" v-for="(it, idx) in item.tags2" :key="idx">{{it}}</view>
  183. </view>
  184. <view class="text">销量:{{item.soldNum}}</view>
  185. </view>
  186. </view>
  187. </block>
  188. </view>
  189. </view>
  190. <view class="goods-row-list" v-show="showType == 2">
  191. <block v-for="(item, index) in goodsList" :key='index'>
  192. <view class="item" @tap="toGoodsDetail(item.goodsId)">
  193. <view class="image">
  194. <image :src="item.imgUrl" mode="aspectFill" class="img"></image>
  195. <image :src="item.logo" mode="aspectFill" class="water" v-if="item.isShowWater"></image>
  196. </view>
  197. <view class="right">
  198. <view>
  199. <view class="title ellipsis-2">{{item.goodsName}}</view>
  200. <view class="tags" v-if="item.tags1 && item.tags1.length > 0">
  201. <view class="it" v-for="(it, idx) in item.tags1" :key="idx">{{it}}</view>
  202. </view>
  203. </view>
  204. <view>
  205. <view class="bottom">
  206. <view class="price">
  207. <view class="price-1">¥{{item.goodsPrice | numToFixed}}</view>
  208. <view class="price-2">¥{{item.orgGoodsPrice | numToFixed}}</view>
  209. </view>
  210. <view class="text">销量:{{item.soldNum}}</view>
  211. </view>
  212. </view>
  213. </view>
  214. </view>
  215. </block>
  216. </view>
  217. <no-data v-if="!goodsList.length" :showText="'暂无商品'"></no-data>
  218. <loading-text v-if="goodsList.length" :loading="loading" :noMore="noMore"></loading-text>
  219. <!-- <drag-button :isDock="true" :customBar="true" ref="dragButton"></drag-button> -->
  220. <!-- <HomePageA :homePage="homePage" :templateInfo="templateInfo" /> -->
  221. <!-- <HomePageB :homePage="homePage" :templateInfo="templateInfo" /> -->
  222. <!-- <HomePageC :homePage="homePage" :templateInfo="templateInfo" /> -->
  223. <view v-if="isSharePyq">
  224. <image
  225. src="https://zfire-train.oss-cn-guangzhou.aliyuncs.com/train/pic/1657090568346be106ca9-dd33-48d2-b06b-e4a02b06f2a2.png"
  226. mode="widthFix" style="width: 100%" @tap="clickPyq"></image>
  227. </view>
  228. <!-- 购买弹窗 -->
  229. <view class="global-mask" v-show="isBuyDialog"></view>
  230. <view class="buyDialog" v-show="isBuyDialog">
  231. <view class="close">
  232. <image src="@/static/icon/close.png" @tap="isBuyDialog = false"></image>
  233. </view>
  234. <view class="goods" v-if="orderDetail.orderDetails && orderDetail.orderDetails.length == 1">
  235. <image :src="orderDetail.orderDetails[0].imgUrl" mode="aspectFill"></image>
  236. <view class="name ellipsis-2">{{orderDetail.orderDetails[0].goodsName}}</view>
  237. <view class="des ellipsis">{{orderDetail.orderDetails[0].goodsSpecValue}}</view>
  238. </view>
  239. <view class="goodsList" v-if="orderDetail.orderDetails && orderDetail.orderDetails.length > 1">
  240. <block v-for="(item, index) in orderDetail.orderDetails" :key='index'>
  241. <view class="item">
  242. <image :src="item.imgUrl" mode="aspectFill"></image>
  243. <view class="right">
  244. <view class="name ellipsis-2">{{item.goodsName}}</view>
  245. <view class="des ellipsis">{{item.goodsSpecValue}}</view>
  246. </view>
  247. </view>
  248. </block>
  249. </view>
  250. <view class="num">共<text>{{orderDetail.totalNum}}</text>件商品</view>
  251. <view class="price">需支付金额:<text>¥{{orderDetail.payAmount}}</text></view>
  252. <view class="button" @tap="payment">立即支付</view>
  253. </view>
  254. <!-- 优惠券提醒 -->
  255. <view class="global-mask" v-show="isCouponDialog"></view>
  256. <view class="couponDialog" v-show="isCouponDialog">
  257. <image src="@/static/home/cp_dialog.png" mode="widthFix"></image>
  258. <view class="bottom">
  259. <view class="text">你有优惠券即将到期,请尽快使用!</view>
  260. <view class="btn-group">
  261. <view class="button left" @tap="isCouponDialog = false">关闭</view>
  262. <view class="button right" @tap="toMyCoupon">去看看</view>
  263. </view>
  264. </view>
  265. </view>
  266. <!-- 领取优惠券弹窗 -->
  267. <view class="global-mask" v-show="isReceiveDialog"></view>
  268. <view class="couponDialog" v-show="isReceiveDialog">
  269. <image src="@/static/home/cp_dialog.png" mode="widthFix"></image>
  270. <view class="bottom">
  271. <view class="text">你有一张优惠券可领取!</view>
  272. <view class="btn-group onlyOne">
  273. <view class="button right" @tap="receiveCoupon">立即领取</view>
  274. </view>
  275. </view>
  276. </view>
  277. <modal-dialog showTitle="提示" showText="领取成功" :isShowDialog="isReceiveCouponDialog && isReceiveSuccess"
  278. @cancel="isReceiveCouponDialog = false" @confirm="toMyCoupon()" confirmText="去看看"></modal-dialog>
  279. <modal-dialog showTitle="提示" :showText="'领取失败:'+failMessage"
  280. :isShowDialog="isReceiveCouponDialog && !isReceiveSuccess" @cancel="isReceiveCouponDialog = false"
  281. :isShowConfirm="false" cancelText="关闭"></modal-dialog>
  282. </view>
  283. </template>
  284. <script>
  285. import HomePageA from "@/pages/index/components/home-page-a";
  286. import HomePageB from "@/pages/index/components/home-page-b";
  287. import HomePageC from "@/pages/index/components/home-page-c";
  288. import {
  289. mapState
  290. } from 'vuex';
  291. import {
  292. appId
  293. } from '@/utils/config.js';
  294. import modalDialog from '@/components/modalDialog.vue';
  295. export default {
  296. components: {
  297. HomePageA,
  298. HomePageB,
  299. HomePageC,
  300. modalDialog,
  301. },
  302. data() {
  303. return {
  304. configInfo: uni.getStorageSync('configInfo'),
  305. templateInfo: uni.getStorageSync('templateInfo'),
  306. isBuyDialog: false, // 是否显示购买弹窗(业务员代客下单时产生)
  307. orderDetail: {}, // 订单详情(购买弹窗需要)
  308. scene: { // 页面参数(扫码进入小程序时产生)
  309. type: '',
  310. goodsId: '',
  311. orderId: '',
  312. serviceId: '',
  313. couponId: '',
  314. },
  315. isCouponDialog: false, // 是否显示过期优惠券弹窗
  316. isReceiveCouponDialog: false,
  317. isReceiveSuccess: true,
  318. failMessage: '',
  319. isReceiveDialog: false,
  320. isSmsReceive: false,
  321. homePage: 0,
  322. isSharePyq: false,
  323. keyword: "",
  324. screenType: '',
  325. goodsList: [],
  326. pageNum: 1,
  327. pageSize: 8,
  328. noMore: false,
  329. loading: false,
  330. showType: 2,
  331. bannerList: [], // 轮播图列表
  332. bannerCurrent: 0, // 轮播图当前值
  333. distancess: "",
  334. currentPosition: ''
  335. }
  336. },
  337. computed: {
  338. ...mapState(['userInfo', 'isLogin', 'userId', 'websitData']),
  339. cuStyle() {
  340. return `height:${this.CustomBar-this.StatusBar}px; padding-top:${this.StatusBar}px;`
  341. },
  342. },
  343. watch: {
  344. nowDate() {
  345. let hh = this.nowDate.getHours(),
  346. mm = this.nowDate.getMinutes(),
  347. ss = this.nowDate.getSeconds();
  348. let hs = [10, 12, 15, 18, 20];
  349. if (mm == 0 && ss == 0 && hs.indexOf(hh) >= 0) {
  350. setTimeout(() => {
  351. this.getSeckillTimeList();
  352. }, 1000)
  353. }
  354. },
  355. websitData() {
  356. }
  357. },
  358. // 页面滚动
  359. onPageScroll(res) {
  360. uni.$emit('onPageScroll', res.scrollTop);
  361. },
  362. // // 下拉刷新
  363. // onPullDownRefresh() {
  364. // if (this.isSharePyq) {
  365. // return false;
  366. // }
  367. // uni.$emit('onPullDownRefresh');
  368. // // this.getHomePage();
  369. // },
  370. // // 上拉加载
  371. // onReachBottom() {
  372. // uni.$emit('onReachBottom');
  373. // },
  374. // 下拉刷新
  375. onPullDownRefresh() {
  376. if (this.isSharePyq) {
  377. return false;
  378. }
  379. uni.$emit('onPullDownRefresh');
  380. this.pageNum = 1;
  381. this.getGoodsList();
  382. this.getBannerList();
  383. this.chishuhuade();
  384. },
  385. // 上拉加载
  386. onReachBottom() {
  387. this.getGoodsList(1);
  388. uni.$emit('onReachBottom');
  389. },
  390. // 页面隐藏
  391. onHide() {
  392. uni.$emit('onHide');
  393. },
  394. // 页面显示
  395. async onShow() {
  396. this.chishuhuade()
  397. var obj = wx.getLaunchOptionsSync()
  398. if (obj.scene == 1154) {
  399. return this.isSharePyq = true;
  400. }
  401. await this.$onLaunched;
  402. },
  403. // 页面加载
  404. async onLoad({
  405. scene,
  406. goodsId,
  407. serviceId,
  408. mobile,
  409. smsServiceId,
  410. otherType,
  411. appOrderId
  412. }) {
  413. await this.$onLaunched;
  414. // uni.showLoading({
  415. // title: '加载中'
  416. // });
  417. this.getConfig();
  418. this.checkCoupon();
  419. this.getBannerList();
  420. // // 点击短信链接进入小程序
  421. // if (smsServiceId) {
  422. // this.bindUser(smsServiceId);
  423. // if (this.userInfo.type !== "SERVICE") {
  424. // this.isSmsReceive = true;
  425. // this.isReceiveDialog = true;
  426. // }
  427. // }
  428. // // 从师傅端app跳转进入小程序
  429. // if (appOrderId) {
  430. // this.appOrderPay(appOrderId);
  431. // }
  432. // if (otherType) {
  433. // if (otherType === 'groupbuyList') {
  434. // uni.navigateTo({
  435. // url: '/pages/mine/groupbuy/list'
  436. // })
  437. // }
  438. // }
  439. if (serviceId) {
  440. this.bindUser(serviceId);
  441. }
  442. // 点击商品链接进入小程序
  443. if (goodsId) {
  444. this.toGoodsDetail(goodsId);
  445. }
  446. // 扫码进入小程序
  447. if (scene) {
  448. // 拿scene的id去获取
  449. this.$axios({
  450. url: '/common/scene',
  451. method: 'get',
  452. params: {
  453. scene: scene,
  454. }
  455. }).then(res => {
  456. let newScene = res.data.split("&");
  457. this.scene.type = newScene[0];
  458. this.scene.serviceId = newScene[2];
  459. // 如果是商品
  460. if (newScene[0] == 'goods') {
  461. this.scene.goodsId = newScene[1];
  462. this.toGoodsDetail(this.scene.goodsId);
  463. }
  464. // 如果是商城分享码
  465. else if (newScene[0] == 'bind') {
  466. }
  467. // 如果是订单
  468. else if (newScene[0] == 'order') {
  469. this.scene.orderId = newScene[1];
  470. this.getOrderInfo();
  471. }
  472. // 如果是优惠券
  473. else if (newScene[0] == 'coupon') {
  474. this.scene.couponId = newScene[1];
  475. this.isReceiveDialog = true;
  476. // this.receiveCoupon(this.scene.couponId);
  477. }
  478. // // 如果是团购分享码
  479. // else if (newScene[0] == 'promotion_group') {
  480. // uni.navigateTo({
  481. // url: '/pages/mine/groupbuy/list'
  482. // })
  483. // }
  484. if (this.scene.serviceId) {
  485. this.bindUser(this.scene.serviceId);
  486. }
  487. })
  488. }
  489. this.getGoodsList();
  490. },
  491. // 分享
  492. onShareAppMessage(options) {
  493. if (options && options.from == 'button') {
  494. // 来自页面内的转发按钮
  495. } else {
  496. // 点击微信右上角的分享按钮
  497. }
  498. return {
  499. title: `${this.userInfo.nickName}向你推荐了「${this.configInfo.minAppName}」小程序`,
  500. path: '/pages/index/index?serviceId=' + this.userId,
  501. query: {},
  502. success: function(res) {
  503. if (res.errMsg == 'shareAppMessage:ok') {
  504. this.$successToast('分享完成');
  505. }
  506. }
  507. }
  508. },
  509. onShareTimeline() {
  510. return {
  511. title: `${this.userInfo.nickName}向你推荐了「${this.configInfo.minAppName}」小程序`,
  512. query: 'serviceId=' + this.userId,
  513. success: function(res) {
  514. if (res.errMsg == 'shareAppMessage:ok') {
  515. this.$successToast('分享完成');
  516. }
  517. }
  518. }
  519. },
  520. methods: {
  521. chakanyyzz(){
  522. uni.navigateTo({
  523. url: '/pages/index/chakanyyzz'
  524. })
  525. },
  526. chishuhuade(){
  527. uni.getLocation({
  528. type: 'gcj02',
  529. success: res => {
  530. this.$axios({
  531. url: '/user/user/detail',
  532. method: 'get',
  533. params: {
  534. userId: this.userId,
  535. lat: res.latitude,
  536. lng: res.longitude,
  537. },
  538. }).then((res) => {
  539. this.distancess = res.data.distance
  540. });
  541. this.$axios({
  542. url: '/user/address',
  543. method: 'post',
  544. params: {
  545. lat: res.latitude,
  546. lng: res.longitude,
  547. },
  548. }).then((res) => {
  549. var {
  550. provinceName,
  551. cityName,
  552. areaName,
  553. name
  554. } = res.data
  555. this.currentPosition = `${provinceName}${cityName}${areaName}${name}`
  556. });
  557. },
  558. fail: err => {
  559. }
  560. })
  561. },
  562. goodsClassify() {
  563. uni.switchTab({
  564. url: '/pages/goods/classify'
  565. });
  566. },
  567. couponList() {
  568. uni.navigateTo({
  569. url: '/pages/mine/coupon/list'
  570. })
  571. },
  572. orderListPage() {
  573. uni.navigateTo({
  574. url: '/pages/mine/order/list'
  575. })
  576. },
  577. // 打开导航
  578. dakaidaoh() {
  579. console.log(this.websitData.lat,this.websitData.lng)
  580. uni.openLocation({
  581. latitude: Number(this.websitData.lat),
  582. longitude: Number(this.websitData.lng),
  583. success: function() {
  584. console.log('success');
  585. }
  586. });
  587. },
  588. // 拨打商家电话
  589. bodasjdh(phoneNumber) {
  590. console.log(2222)
  591. if (phoneNumber) {
  592. uni.makePhoneCall({
  593. phoneNumber: phoneNumber
  594. });
  595. } else {
  596. uni.showModal({
  597. title: '提示',
  598. content: '商家没有手机号码!',
  599. success: (res) => {
  600. if (res.confirm) {} else if (res.cancel) {}
  601. }
  602. });
  603. }
  604. },
  605. // 获取轮播图列表
  606. getBannerList() {
  607. this.$axios({
  608. url: '/common/list/page',
  609. method: 'get',
  610. params: {
  611. pageNum: 1,
  612. pageSize: 10,
  613. state: true
  614. }
  615. }).then(res => {
  616. this.bannerList = res.data.records;
  617. }).finally(res => {})
  618. },
  619. // 切换广告图
  620. changeBanner(e) {
  621. this.bannerCurrent = e.detail.current;
  622. },
  623. // 跳转小程序
  624. toMiniProgram(appId, path) {
  625. wx.navigateToMiniProgram({
  626. appId,
  627. path,
  628. extraData: {},
  629. envVersion: 'release',
  630. success(res) {}
  631. });
  632. },
  633. // 进入活动列表
  634. toActivityList(type) {
  635. if (type == 2) {
  636. this.closeDialog();
  637. }
  638. uni.navigateTo({
  639. url: '/packageGoods/pages/activity?type=' + type
  640. })
  641. },
  642. getLocation() {
  643. if (!this.userInfo?.serviceWorkerBean?.websitId) {
  644. uni.navigateTo({
  645. url: '/pages/address/list'
  646. })
  647. }
  648. },
  649. searchSubmit() {
  650. if (this.keyword) {
  651. this.pageNum = 1;
  652. this.getGoodsList();
  653. }
  654. },
  655. // 获取页面模版
  656. async getHomePage() {
  657. const result = await new Promise((resolve, reject) => {
  658. this.$axios({
  659. url: '/renovation/detail',
  660. method: 'get',
  661. }).then(res => {
  662. if (res.data) {
  663. uni.setStorageSync('templateInfo', res.data);
  664. this.templateInfo = res.data;
  665. this.homePage = res.data.templateType;
  666. resolve(res.data.templateType);
  667. }
  668. }).catch(res => {
  669. this.homePage = 1;
  670. resolve(1);
  671. })
  672. })
  673. return result;
  674. },
  675. // 获取配置信息
  676. getConfig() {
  677. this.$axios({
  678. url: '/common/config/get',
  679. method: 'get',
  680. }).then(res => {
  681. if (res.data) {
  682. uni.setStorageSync('configInfo', res.data);
  683. }
  684. })
  685. },
  686. // 绑定用户关系
  687. bindUser(serviceId) {
  688. if (this.userInfo?.userId) {
  689. if (!this.userInfo?.serviceWorkerBean) {
  690. this.$axios({
  691. url: '/user/bind',
  692. params: {
  693. serviceId: serviceId,
  694. userId: this.userId,
  695. }
  696. }).then(res => {
  697. console.log('绑定成功:' + res.message);
  698. })
  699. }
  700. } else {
  701. setTimeout(() => {
  702. this.bindUser(serviceId)
  703. }, 100)
  704. }
  705. },
  706. // 点击分享朋友圈的图
  707. clickPyq() {
  708. this.$toast('请前往小程序使用完整服务');
  709. },
  710. // app订单支付
  711. appOrderPay(appOrderId) {
  712. let that = this;
  713. this.$axios({
  714. url: '/common/online/pay',
  715. method: 'post',
  716. params: {
  717. key: appOrderId,
  718. openId: uni.getStorageSync('userInfo').openId,
  719. }
  720. }).then(res => {
  721. if (!res.data) return false;
  722. let data = JSON.parse(res.data.codeUrl);
  723. wx.requestPayment({
  724. timeStamp: data.timeStamp,
  725. nonceStr: data.nonceStr,
  726. package: data.package,
  727. signType: 'RSA',
  728. paySign: data.paySign,
  729. success: (res) => {
  730. that.$successToast('支付成功');
  731. },
  732. fail: (err) => {
  733. that.$toast('支付失败');
  734. }
  735. })
  736. })
  737. },
  738. // 进入商品详情
  739. toGoodsDetail(id) {
  740. if (!id) {
  741. return false;
  742. }
  743. this.$axios({
  744. url: '/goods/detail',
  745. method: 'get',
  746. params: {
  747. goodsId: id,
  748. userId: this.userId,
  749. },
  750. })
  751. .then((res) => {
  752. uni.navigateTo({
  753. url: '/packageGoods/pages/detail?id=' + id
  754. })
  755. })
  756. .catch((res) => {
  757. uni.switchTab({
  758. url: '/pages/goods/all'
  759. });
  760. })
  761. .finally((res) => {});
  762. },
  763. // 检查是否有优惠券过期
  764. checkCoupon() {
  765. this.$axios({
  766. url: '/coupon/timeout',
  767. method: 'get',
  768. params: {},
  769. }).then(res => {
  770. if (res.data) {
  771. this.isCouponDialog = true;
  772. }
  773. })
  774. },
  775. // 进入我的优惠券
  776. toMyCoupon() {
  777. this.isCouponDialog = false;
  778. this.isReceiveCouponDialog = false;
  779. uni.navigateTo({
  780. url: '/pages/mine/coupon/list'
  781. })
  782. },
  783. // 领取优惠券
  784. receiveCoupon(id) {
  785. if (!this.isLogin) {
  786. return uni.navigateTo({
  787. url: '/pages/login/index'
  788. })
  789. }
  790. if (this.isSmsReceive) {
  791. this.$axios({
  792. url: '/coupon/obtain',
  793. method: 'get',
  794. params: {
  795. userId: '',
  796. couponId: ''
  797. }
  798. }).then(res => {
  799. this.isReceiveDialog = false;
  800. this.isReceiveSuccess = true;
  801. this.isReceiveCouponDialog = true;
  802. }).catch(res => {
  803. this.failMessage = res.message;
  804. this.isReceiveDialog = false;
  805. this.isReceiveSuccess = false;
  806. this.isReceiveCouponDialog = true;
  807. })
  808. } else {
  809. this.$axios({
  810. url: '/coupon/transfer/coupon',
  811. method: 'get',
  812. params: {
  813. userCouponId: this.scene.couponId
  814. }
  815. }).then(res => {
  816. this.isReceiveDialog = false;
  817. this.isReceiveSuccess = true;
  818. this.isReceiveCouponDialog = true;
  819. }).catch(res => {
  820. this.failMessage = res.message;
  821. this.isReceiveDialog = false;
  822. this.isReceiveSuccess = false;
  823. this.isReceiveCouponDialog = true;
  824. })
  825. }
  826. },
  827. // 获取订单信息
  828. getOrderInfo() {
  829. this.$axios({
  830. url: '/order/detail',
  831. method: 'get',
  832. params: {
  833. orderId: this.scene.orderId
  834. }
  835. }).then(res => {
  836. if (res.data && res.data.orderStatus === 'NOPAY') {
  837. this.orderDetail = res.data;
  838. this.isBuyDialog = true;
  839. } else {
  840. return this.$toast('二维码已失效,请重新生成');
  841. }
  842. })
  843. },
  844. // 支付
  845. payment() {
  846. let that = this;
  847. if (!this.isLogin) {
  848. uni.navigateTo({
  849. url: '/pages/login/index'
  850. })
  851. } else {
  852. this.$axios({
  853. url: '/order/wait/pay',
  854. params: {
  855. userId: this.userId,
  856. orderId: this.scene.orderId,
  857. },
  858. isLoading: 1,
  859. }).then(res => {
  860. uni.getProvider({
  861. service: 'payment',
  862. success: (e) => {
  863. uni.requestPayment({
  864. provider: e.provider[0],
  865. orderInfo: res.data,
  866. timeStamp: res.data.timeStamp,
  867. nonceStr: res.data.nonceStr,
  868. package: res.data.payPackage,
  869. signType: 'MD5',
  870. paySign: res.data.paySign,
  871. success: (res) => {
  872. that.$successToast('支付成功');
  873. that.isBuyDialog = false;
  874. that.requestMessage();
  875. },
  876. fail: (err) => {
  877. that.$toast('支付失败');
  878. }
  879. })
  880. }
  881. })
  882. })
  883. }
  884. },
  885. // 消息推送
  886. requestMessage() {
  887. let that = this;
  888. uni.showModal({
  889. title: '温馨提示',
  890. content: '为更好的促进您与买家的交流,需要在您的订单成交时向您发送消息',
  891. confirmText: "同意",
  892. cancelText: "拒绝",
  893. success: function(res) {
  894. if (res.confirm) {
  895. let tmplIds = [that.configInfo.template];
  896. uni.requestSubscribeMessage({
  897. tmplIds: tmplIds,
  898. success(res) {
  899. let status = null;
  900. tmplIds.map((item, index) => {
  901. if (res[item] == 'accept') {
  902. status = 'accept';
  903. }
  904. })
  905. if (status == 'accept') {
  906. that.$successToast('订阅成功');
  907. } else {
  908. that.$toast('订阅取消');
  909. }
  910. },
  911. fail(res) {
  912. console.log(res);
  913. that.$toast('订阅失败');
  914. }
  915. })
  916. } else if (res.cancel) {
  917. uni.showModal({
  918. title: '温馨提示',
  919. content: '拒绝后您将无法获取实时的与卖家(买家)的交易消息',
  920. confirmText: "知道了",
  921. showCancel: false,
  922. success: function(res) {
  923. }
  924. });
  925. }
  926. }
  927. });
  928. },
  929. // ------------------------------------
  930. // 切换筛选类型
  931. changeScreen(type) {
  932. if (type != 2) {
  933. if (this.screenType !== type) {
  934. this.screenType = type;
  935. } else {
  936. this.screenType = '';
  937. }
  938. } else {
  939. if (this.screenType != 2 && this.screenType != 3) {
  940. this.screenType = 2;
  941. } else if (this.screenType == 2) {
  942. this.screenType = 3;
  943. } else {
  944. this.screenType = '';
  945. }
  946. }
  947. this.pageNum = 1;
  948. this.getGoodsList();
  949. },
  950. // 获取商品列表
  951. getGoodsList(loadMore) {
  952. if (this.noMore && loadMore) return;
  953. this.noMore = false
  954. if (!loadMore) {
  955. this.pageNum = 1;
  956. } else {
  957. this.loading = true;
  958. }
  959. this.$axios({
  960. url: '/goods/list/sort/page',
  961. method: 'get',
  962. params: {
  963. pageNum: this.pageNum,
  964. pageSize: this.pageSize,
  965. categoryId: '',
  966. sort: this.screenType,
  967. keyword: this.keyword
  968. },
  969. isLoading: !loadMore
  970. }).then(res => {
  971. res.data.records.forEach(item => {
  972. if (item.logo && item.logoStartTime) {
  973. item.isShowWater = this.$compareTime(item.logoStartTime, item.logoEndTime);
  974. } else {
  975. item.isShowWater = false;
  976. }
  977. })
  978. let _list = res.data.records;
  979. let pageTotal = res.data.pages;
  980. if (this.pageNum >= pageTotal) {
  981. this.noMore = true;
  982. }
  983. if (_list.length) {
  984. this.pageNum += 1
  985. }
  986. if (loadMore) {
  987. this.goodsList = this.goodsList.concat(_list);
  988. this.loading = false;
  989. } else {
  990. this.goodsList = _list;
  991. }
  992. uni.stopPullDownRefresh();
  993. })
  994. },
  995. }
  996. }
  997. </script>
  998. <style lang="scss">
  999. .shangjiakapian {
  1000. width: 100%;
  1001. height: auto;
  1002. border-radius: 30rpx;
  1003. overflow: hidden;
  1004. background: #ffffff;
  1005. margin-top: 30rpx;
  1006. .shangjiatupiand {
  1007. position: relative;
  1008. .nirongdd {
  1009. position: absolute;
  1010. top: 0;
  1011. left: 0;
  1012. right: 0;
  1013. bottom: 0;
  1014. box-sizing: border-box;
  1015. padding: 26rpx;
  1016. }
  1017. }
  1018. .shangjiakapiandibubiaos {
  1019. width: 100%;
  1020. display: flex;
  1021. justify-content: space-between;
  1022. align-items: center;
  1023. .shangjiakapiandibuItem {
  1024. width: 33.33%;
  1025. height: auto;
  1026. box-sizing: border-box;
  1027. padding: 16rpx;
  1028. display: flex;
  1029. justify-content: center;
  1030. align-items: center;
  1031. font-size: 20rpx;
  1032. color: red;
  1033. }
  1034. }
  1035. }
  1036. .header-container {
  1037. display: flex;
  1038. align-items: center;
  1039. justify-content: space-between;
  1040. padding: 0 10rpx 10rpx;
  1041. .left {
  1042. display: flex;
  1043. align-items: center;
  1044. image {
  1045. width: 48rpx;
  1046. height: 48rpx;
  1047. }
  1048. }
  1049. }
  1050. .top-container {
  1051. position: relative;
  1052. .bg {
  1053. display: block;
  1054. width: 750rpx;
  1055. position: absolute;
  1056. top: 0;
  1057. z-index: 0;
  1058. }
  1059. .content {
  1060. width: 710rpx;
  1061. padding: 0 20rpx;
  1062. position: relative;
  1063. z-index: 1;
  1064. }
  1065. .title {
  1066. display: flex;
  1067. align-items: center;
  1068. justify-content: center;
  1069. color: #FFFFFF;
  1070. font-size: 36rpx;
  1071. }
  1072. .search {
  1073. background: #FFFFFF;
  1074. height: 64rpx;
  1075. display: flex;
  1076. align-items: center;
  1077. border-radius: 64rpx;
  1078. padding: 0 20rpx;
  1079. margin-top: 20rpx;
  1080. image {
  1081. width: 28rpx;
  1082. height: 28rpx;
  1083. }
  1084. input {
  1085. width: 100%;
  1086. padding-left: 15rpx;
  1087. }
  1088. }
  1089. }
  1090. .classify-container {
  1091. margin-top: 40rpx;
  1092. position: relative;
  1093. z-index: 1;
  1094. padding: 0 20rpx;
  1095. .content {
  1096. border-radius: 20rpx;
  1097. padding-top: 30rpx;
  1098. display: flex;
  1099. flex-wrap: wrap;
  1100. background: #FFFFFF;
  1101. .item {
  1102. display: flex;
  1103. flex-direction: column;
  1104. align-items: center;
  1105. width: 142rpx;
  1106. margin-bottom: 30rpx;
  1107. image {
  1108. width: 78rpx;
  1109. height: 78rpx;
  1110. display: block;
  1111. border-radius: 50%;
  1112. overflow: hidden;
  1113. }
  1114. text {
  1115. font-size: 24rpx;
  1116. color: #666666;
  1117. margin-top: 10rpx;
  1118. width: 150rpx;
  1119. text-align: center;
  1120. }
  1121. }
  1122. }
  1123. }
  1124. .notice-container {
  1125. padding: 0 20rpx;
  1126. margin-top: 20rpx;
  1127. .content {
  1128. display: flex;
  1129. align-items: center;
  1130. height: 100rpx;
  1131. background: #FFFFFF;
  1132. border-radius: 20rpx;
  1133. }
  1134. .left {
  1135. display: flex;
  1136. align-items: center;
  1137. justify-content: center;
  1138. width: 96rpx;
  1139. height: 48rpx;
  1140. margin-right: 20rpx;
  1141. border-right: 2rpx solid #E5E5E5;
  1142. image {
  1143. width: 60rpx;
  1144. height: 30rpx;
  1145. display: block;
  1146. }
  1147. }
  1148. .swiper {
  1149. height: 100rpx;
  1150. flex: 1;
  1151. padding-right: 20rpx;
  1152. ::v-deep swiper-item {
  1153. display: block;
  1154. height: 100rpx;
  1155. width: 100%;
  1156. line-height: 100rpx;
  1157. }
  1158. }
  1159. }
  1160. .coupon-container {
  1161. position: relative;
  1162. margin-top: 20rpx;
  1163. padding: 0 20rpx;
  1164. .bg {
  1165. display: block;
  1166. width: 100%;
  1167. }
  1168. .list {
  1169. position: absolute;
  1170. top: 80rpx;
  1171. z-index: 1;
  1172. }
  1173. .list1 {
  1174. .item {
  1175. position: relative;
  1176. margin-bottom: 20rpx;
  1177. margin-left: 16rpx;
  1178. .cp {
  1179. width: 688rpx;
  1180. height: 178rpx;
  1181. display: block;
  1182. }
  1183. .content {
  1184. position: absolute;
  1185. left: 0;
  1186. top: 0;
  1187. width: 710rpx;
  1188. height: 160rpx;
  1189. display: flex;
  1190. align-items: center;
  1191. .left {
  1192. width: 210rpx;
  1193. display: flex;
  1194. align-items: center;
  1195. justify-content: center;
  1196. flex-direction: column;
  1197. .price {
  1198. font-size: 48rpx;
  1199. color: #FFFFFF;
  1200. }
  1201. .text {
  1202. color: #FFFFFF;
  1203. font-size: 28rpx;
  1204. }
  1205. }
  1206. .right {
  1207. display: flex;
  1208. align-items: center;
  1209. justify-content: space-between;
  1210. padding: 0 20rpx;
  1211. width: 470rpx;
  1212. height: 150rpx;
  1213. box-sizing: border-box;
  1214. .main {
  1215. width: 430rpx;
  1216. height: 150rpx;
  1217. padding: 16rpx 0 8rpx;
  1218. box-sizing: border-box;
  1219. display: flex;
  1220. flex-direction: column;
  1221. justify-content: space-between;
  1222. .row1 {
  1223. font-size: 28rpx;
  1224. line-height: 32rpx;
  1225. height: 64rpx;
  1226. }
  1227. .row2 {
  1228. font-size: 24rpx;
  1229. line-height: 28rpx;
  1230. color: #999999;
  1231. display: flex;
  1232. justify-content: space-between;
  1233. align-items: center;
  1234. }
  1235. }
  1236. }
  1237. }
  1238. }
  1239. }
  1240. .list2 {
  1241. display: flex;
  1242. .item {
  1243. position: relative;
  1244. margin-bottom: 20rpx;
  1245. &:first-child {
  1246. margin-left: 16rpx;
  1247. }
  1248. .cp {
  1249. width: 342rpx;
  1250. height: 308rpx;
  1251. display: block;
  1252. }
  1253. .content {
  1254. position: absolute;
  1255. left: 0;
  1256. top: 0;
  1257. width: 342rpx;
  1258. height: 328rpx;
  1259. display: flex;
  1260. flex-direction: column;
  1261. align-items: center;
  1262. .top {
  1263. width: 324rpx;
  1264. height: 130rpx;
  1265. display: flex;
  1266. align-items: center;
  1267. justify-content: center;
  1268. flex-direction: column;
  1269. .price {
  1270. font-size: 48rpx;
  1271. color: #FFFFFF;
  1272. line-height: 48rpx;
  1273. margin-top: 16rpx;
  1274. }
  1275. .text {
  1276. color: #FFFFFF;
  1277. font-size: 28rpx;
  1278. line-height: 28rpx;
  1279. margin-top: 10rpx;
  1280. }
  1281. }
  1282. .bottom {
  1283. width: 324rpx;
  1284. height: 160rpx;
  1285. padding: 16rpx;
  1286. box-sizing: border-box;
  1287. display: flex;
  1288. flex-direction: column;
  1289. justify-content: space-between;
  1290. align-items: center;
  1291. .name {
  1292. font-size: 28rpx;
  1293. text-align: left;
  1294. line-height: 32rpx;
  1295. width: 100%;
  1296. }
  1297. .date {
  1298. font-size: 24rpx;
  1299. color: #999999;
  1300. text-align: left;
  1301. width: 100%;
  1302. line-height: 28rpx;
  1303. }
  1304. }
  1305. }
  1306. }
  1307. }
  1308. .list3 {
  1309. display: flex;
  1310. align-items: center;
  1311. .left {
  1312. display: flex;
  1313. width: 630rpx;
  1314. overflow-x: scroll;
  1315. }
  1316. .right {
  1317. width: 80rpx;
  1318. display: flex;
  1319. justify-content: center;
  1320. .text {
  1321. width: 48rpx;
  1322. height: 200rpx;
  1323. border-radius: 48rpx;
  1324. background: #FFFFFF;
  1325. display: flex;
  1326. flex-direction: column;
  1327. align-items: center;
  1328. justify-content: center;
  1329. text {
  1330. font-size: 28rpx;
  1331. color: #FF3F42;
  1332. line-height: 32rpx;
  1333. }
  1334. image {
  1335. width: 32rpx;
  1336. height: 32rpx;
  1337. display: block;
  1338. flex-shrink: 0;
  1339. margin-top: 10rpx;
  1340. }
  1341. }
  1342. }
  1343. .item {
  1344. position: relative;
  1345. margin-bottom: 20rpx;
  1346. &:first-child {
  1347. margin-left: 16rpx;
  1348. }
  1349. .cp {
  1350. width: 278rpx;
  1351. height: 308rpx;
  1352. display: block;
  1353. }
  1354. .content {
  1355. position: absolute;
  1356. left: 0;
  1357. top: 0;
  1358. width: 278rpx;
  1359. height: 328rpx;
  1360. display: flex;
  1361. flex-direction: column;
  1362. align-items: center;
  1363. .top {
  1364. width: 260rpx;
  1365. height: 130rpx;
  1366. display: flex;
  1367. align-items: center;
  1368. justify-content: center;
  1369. flex-direction: column;
  1370. .price {
  1371. font-size: 48rpx;
  1372. color: #FFFFFF;
  1373. line-height: 48rpx;
  1374. margin-top: 16rpx;
  1375. }
  1376. .text {
  1377. color: #FFFFFF;
  1378. font-size: 28rpx;
  1379. line-height: 28rpx;
  1380. margin-top: 10rpx;
  1381. }
  1382. }
  1383. .bottom {
  1384. width: 260rpx;
  1385. height: 160rpx;
  1386. padding: 16rpx;
  1387. box-sizing: border-box;
  1388. display: flex;
  1389. flex-direction: column;
  1390. justify-content: space-between;
  1391. align-items: center;
  1392. .name {
  1393. font-size: 28rpx;
  1394. text-align: left;
  1395. line-height: 32rpx;
  1396. width: 100%;
  1397. }
  1398. .date {
  1399. font-size: 24rpx;
  1400. color: #999999;
  1401. text-align: left;
  1402. width: 100%;
  1403. line-height: 28rpx;
  1404. }
  1405. }
  1406. }
  1407. }
  1408. }
  1409. .button {
  1410. width: 120rpx;
  1411. height: 40rpx;
  1412. border-radius: 40rpx;
  1413. font-size: 24rpx;
  1414. flex-shrink: 0;
  1415. box-sizing: border-box;
  1416. display: flex;
  1417. justify-content: center;
  1418. align-items: center;
  1419. &.gary {
  1420. background: #AAAAAA;
  1421. color: #FFFFFF;
  1422. border: 1px solid #AAAAAA;
  1423. }
  1424. &.red {
  1425. background: #C434FF;
  1426. color: #FFFFFF;
  1427. border: 1px solid #C434FF;
  1428. }
  1429. &.white {
  1430. color: #FF3F42;
  1431. border: 1px solid #FF3F42;
  1432. }
  1433. }
  1434. }
  1435. .myManager-container {
  1436. padding: 0 20rpx;
  1437. .content {
  1438. display: flex;
  1439. justify-content: space-between;
  1440. align-items: center;
  1441. background: #FFFFFF;
  1442. border-radius: 20rpx;
  1443. padding: 20rpx;
  1444. .left {
  1445. display: flex;
  1446. align-items: center;
  1447. image {
  1448. width: 100rpx;
  1449. height: 100rpx;
  1450. border-radius: 50%;
  1451. }
  1452. .main {
  1453. font-size: 28rpx;
  1454. line-height: 48rpx;
  1455. margin-left: 20rpx;
  1456. }
  1457. }
  1458. .right {
  1459. width: 160rpx;
  1460. height: 60rpx;
  1461. line-height: 60rpx;
  1462. border-radius: 60rpx;
  1463. text-align: center;
  1464. font-size: 28rpx;
  1465. color: #E43B38;
  1466. border: 1px solid #E43B38;
  1467. }
  1468. }
  1469. }
  1470. .seckill-container {
  1471. position: relative;
  1472. margin-top: 20rpx;
  1473. min-height: 340rpx;
  1474. .bg {
  1475. display: block;
  1476. width: 750rpx;
  1477. position: absolute;
  1478. top: 0;
  1479. z-index: 0;
  1480. }
  1481. .content {
  1482. width: 710rpx;
  1483. padding: 0 20rpx;
  1484. position: relative;
  1485. z-index: 1;
  1486. }
  1487. .time-list {
  1488. display: flex;
  1489. overflow-x: scroll;
  1490. padding-top: 90rpx;
  1491. padding-bottom: 40rpx;
  1492. .item {
  1493. display: flex;
  1494. flex-direction: column;
  1495. align-items: center;
  1496. flex-shrink: 0;
  1497. width: 140rpx;
  1498. margin-right: 48rpx;
  1499. .time {
  1500. font-size: 32rpx;
  1501. color: #FFFFFF;
  1502. }
  1503. .tag {
  1504. width: 140rpx;
  1505. height: 44rpx;
  1506. border-radius: 44rpx;
  1507. border: 1px solid #FFFFFF;
  1508. font-size: 24rpx;
  1509. color: #FFFFFF;
  1510. box-sizing: border-box;
  1511. margin-top: 12rpx;
  1512. display: flex;
  1513. align-items: center;
  1514. justify-content: center;
  1515. }
  1516. &.current {
  1517. .tag {
  1518. background: #FFFFFF;
  1519. color: #FF3F42;
  1520. }
  1521. }
  1522. }
  1523. }
  1524. .product-list {
  1525. .item {
  1526. background: #FFFFFF;
  1527. border-radius: 10rpx;
  1528. display: flex;
  1529. padding: 20rpx;
  1530. margin-bottom: 20rpx;
  1531. image {
  1532. display: block;
  1533. width: 180rpx;
  1534. height: 180rpx;
  1535. flex-shrink: 0;
  1536. }
  1537. .right {
  1538. width: 490rpx;
  1539. box-sizing: border-box;
  1540. padding-left: 20rpx;
  1541. .title {
  1542. font-size: 30rpx;
  1543. color: #333333;
  1544. line-height: 36rpx;
  1545. font-weight: 600;
  1546. }
  1547. .des {
  1548. font-size: 24rpx;
  1549. line-height: 30rpx;
  1550. color: #999999;
  1551. margin-top: 6rpx;
  1552. }
  1553. .stock-sales {
  1554. display: flex;
  1555. justify-content: space-between;
  1556. align-items: center;
  1557. margin-top: 10rpx;
  1558. font-size: 24rpx;
  1559. color: #666666;
  1560. .stock {
  1561. display: flex;
  1562. align-items: center;
  1563. text {
  1564. font-size: 24rpx;
  1565. color: #666666;
  1566. }
  1567. .progress-box {
  1568. width: 140rpx;
  1569. border-radius: 6px;
  1570. overflow: hidden;
  1571. margin-left: 10rpx;
  1572. }
  1573. }
  1574. }
  1575. .bottom {
  1576. display: flex;
  1577. justify-content: space-between;
  1578. align-items: center;
  1579. margin-top: 10rpx;
  1580. .price {
  1581. display: flex;
  1582. flex-direction: column;
  1583. }
  1584. .price-1 {
  1585. font-size: 32rpx;
  1586. color: #FF3F42;
  1587. line-height: 36rpx;
  1588. }
  1589. .price-2 {
  1590. font-size: 26rpx;
  1591. color: #666666;
  1592. line-height: 30rpx;
  1593. text-decoration: line-through;
  1594. }
  1595. .btn {
  1596. width: 110rpx;
  1597. height: 44rpx;
  1598. background: #FF3F42;
  1599. border-radius: 5rpx;
  1600. font-size: 28rpx;
  1601. color: #FFFFFF;
  1602. text-align: center;
  1603. line-height: 44rpx;
  1604. }
  1605. .btn2 {
  1606. width: 110rpx;
  1607. height: 44rpx;
  1608. background: #AAAAAA;
  1609. border-radius: 5rpx;
  1610. font-size: 28rpx;
  1611. color: #FFFFFF;
  1612. text-align: center;
  1613. line-height: 44rpx;
  1614. }
  1615. }
  1616. }
  1617. }
  1618. }
  1619. .loadmore {
  1620. background: #FFFFFF;
  1621. border-radius: 10rpx;
  1622. display: flex;
  1623. justify-content: center;
  1624. align-items: center;
  1625. height: 88rpx;
  1626. }
  1627. }
  1628. .recom-container {
  1629. margin-top: 30rpx;
  1630. .top {
  1631. background: #FFFFFF;
  1632. padding: 30rpx 0 0;
  1633. .title {
  1634. display: flex;
  1635. align-items: center;
  1636. justify-content: center;
  1637. margin-bottom: 10rpx;
  1638. image {
  1639. width: 300rpx;
  1640. height: 40rpx;
  1641. display: block;
  1642. }
  1643. }
  1644. .tab {
  1645. display: flex;
  1646. margin-left: -10rpx;
  1647. .item {
  1648. display: flex;
  1649. flex-direction: column;
  1650. align-items: center;
  1651. flex-shrink: 0;
  1652. font-size: 28rpx;
  1653. color: #666666;
  1654. height: 80rpx;
  1655. line-height: 80rpx;
  1656. position: relative;
  1657. padding: 0 30rpx;
  1658. &.current {
  1659. color: #FF3F42;
  1660. font-weight: 600;
  1661. &::after {
  1662. content: '';
  1663. display: block;
  1664. width: 50rpx;
  1665. height: 6rpx;
  1666. background: #FF3F42;
  1667. position: absolute;
  1668. bottom: 0;
  1669. left: 50%;
  1670. margin-left: -25rpx;
  1671. }
  1672. }
  1673. }
  1674. }
  1675. }
  1676. .list {
  1677. display: flex;
  1678. flex-wrap: wrap;
  1679. padding: 20rpx;
  1680. .item {
  1681. width: 348rpx;
  1682. background: #FFFFFF;
  1683. margin-right: 14rpx;
  1684. margin-bottom: 20rpx;
  1685. border-radius: 20rpx;
  1686. overflow: hidden;
  1687. &:nth-child(2n) {
  1688. margin-right: 0;
  1689. }
  1690. .image {
  1691. width: 348rpx;
  1692. height: 348rpx;
  1693. flex-shrink: 0;
  1694. position: relative;
  1695. .img {
  1696. width: 348rpx;
  1697. height: 348rpx;
  1698. display: block;
  1699. }
  1700. .water {
  1701. width: 348rpx;
  1702. height: 348rpx;
  1703. display: block;
  1704. position: absolute;
  1705. left: 0;
  1706. top: 0;
  1707. z-index: 1;
  1708. }
  1709. }
  1710. .content {
  1711. padding: 15rpx 20rpx;
  1712. .title {
  1713. font-size: 30rpx;
  1714. color: #333333;
  1715. line-height: 36rpx;
  1716. font-weight: 600;
  1717. height: 72rpx;
  1718. }
  1719. .bottom {
  1720. display: flex;
  1721. justify-content: space-between;
  1722. align-items: center;
  1723. margin-top: 10rpx;
  1724. .price {
  1725. display: flex;
  1726. flex-direction: column;
  1727. }
  1728. .price-1 {
  1729. font-size: 32rpx;
  1730. color: #FF3F42;
  1731. line-height: 36rpx;
  1732. }
  1733. .price-2 {
  1734. font-size: 26rpx;
  1735. color: #666666;
  1736. line-height: 30rpx;
  1737. text-decoration: line-through;
  1738. }
  1739. .btn {
  1740. width: 60rpx;
  1741. height: 60rpx;
  1742. background: #FE781F;
  1743. border-radius: 50%;
  1744. display: flex;
  1745. align-items: center;
  1746. justify-content: center;
  1747. image {
  1748. width: 41rpx;
  1749. height: 36rpx;
  1750. display: block;
  1751. }
  1752. }
  1753. }
  1754. }
  1755. }
  1756. }
  1757. }
  1758. .app-container {
  1759. background: #F4F2F2;
  1760. box-sizing: border-box;
  1761. }
  1762. .couponDialog {
  1763. position: fixed;
  1764. top: 30%;
  1765. left: 75rpx;
  1766. z-index: 999;
  1767. width: 600rpx;
  1768. background: #FFFFFF;
  1769. border-radius: 20rpx;
  1770. image {
  1771. width: 600rpx;
  1772. }
  1773. .bottom {
  1774. padding: 0 40rpx 50rpx;
  1775. .text {
  1776. font-size: 32rpx;
  1777. line-height: 48rpx;
  1778. text-align: center;
  1779. }
  1780. .btn-group {
  1781. display: flex;
  1782. justify-content: space-between;
  1783. margin-top: 50rpx;
  1784. .button {
  1785. width: 240rpx;
  1786. height: 72rpx;
  1787. border-radius: 72rpx;
  1788. border: 1px solid #FF3F42;
  1789. font-size: 32rpx;
  1790. line-height: 72rpx;
  1791. text-align: center;
  1792. &.left {
  1793. color: #FF3F42;
  1794. }
  1795. &.right {
  1796. color: #FFFFFF;
  1797. background: #FF3F42;
  1798. }
  1799. }
  1800. &.onlyOne {
  1801. justify-content: center;
  1802. .button {
  1803. width: 300rpx;
  1804. }
  1805. }
  1806. }
  1807. }
  1808. }
  1809. .buyDialog {
  1810. position: fixed;
  1811. top: 30%;
  1812. left: 100rpx;
  1813. z-index: 999;
  1814. width: 550rpx;
  1815. background: #FFFFFF;
  1816. border-radius: 10rpx;
  1817. box-sizing: border-box;
  1818. padding: 20rpx 20rpx 30rpx;
  1819. display: flex;
  1820. flex-direction: column;
  1821. align-items: center;
  1822. .close {
  1823. width: 100%;
  1824. display: flex;
  1825. justify-content: flex-end;
  1826. image {
  1827. width: 32rpx;
  1828. height: 32rpx;
  1829. display: block;
  1830. }
  1831. }
  1832. .goods {
  1833. margin-top: 10rpx;
  1834. image {
  1835. width: 410rpx;
  1836. height: 300rpx;
  1837. display: block;
  1838. }
  1839. .name {
  1840. font-size: 28rpx;
  1841. line-height: 34rpx;
  1842. margin-top: 16rpx;
  1843. }
  1844. .des {
  1845. font-size: 26rpx;
  1846. color: #666666;
  1847. line-height: 30rpx;
  1848. margin-top: 10rpx;
  1849. }
  1850. }
  1851. .goodsList {
  1852. max-height: 400rpx;
  1853. overflow-y: scroll;
  1854. margin-top: 10rpx;
  1855. .item {
  1856. display: flex;
  1857. padding: 10rpx 20rpx;
  1858. image {
  1859. width: 120rpx;
  1860. height: 120rpx;
  1861. display: block;
  1862. flex-shrink: 0;
  1863. }
  1864. .right {
  1865. width: 334rpx;
  1866. margin-left: 16rpx;
  1867. .name {
  1868. font-size: 28rpx;
  1869. line-height: 34rpx;
  1870. margin-top: 8rpx;
  1871. }
  1872. .des {
  1873. font-size: 26rpx;
  1874. color: #666666;
  1875. line-height: 30rpx;
  1876. margin-top: 10rpx;
  1877. }
  1878. }
  1879. }
  1880. }
  1881. .num {
  1882. margin-top: 10rpx;
  1883. line-height: 40rpx;
  1884. text {
  1885. color: #FF3F42;
  1886. font-size: 32rpx;
  1887. font-weight: 600;
  1888. margin: 0 10rpx;
  1889. }
  1890. }
  1891. .price {
  1892. margin-top: 8rpx;
  1893. line-height: 40rpx;
  1894. text {
  1895. color: #FF3F42;
  1896. font-size: 32rpx;
  1897. font-weight: 600;
  1898. }
  1899. }
  1900. .button {
  1901. width: 300rpx;
  1902. height: 64rpx;
  1903. line-height: 64rpx;
  1904. text-align: center;
  1905. background: #FF3F42;
  1906. border-radius: 64rpx;
  1907. font-size: 28rpx;
  1908. color: #FFFFFF;
  1909. margin-top: 20rpx;
  1910. }
  1911. }
  1912. // ---------------------------------------------
  1913. .swiper-container {
  1914. position: relative;
  1915. margin-top: 20rpx;
  1916. swiper {
  1917. height: 350rpx;
  1918. }
  1919. image {
  1920. height: 350rpx;
  1921. width: 710rpx;
  1922. display: block;
  1923. margin: 0 auto 0;
  1924. border-radius: 15rpx;
  1925. overflow: hidden;
  1926. }
  1927. .dots-conatiner {
  1928. position: absolute;
  1929. width: 100%;
  1930. bottom: 40rpx;
  1931. display: flex;
  1932. align-items: center;
  1933. justify-content: center;
  1934. .con {
  1935. border-radius: 4rpx;
  1936. overflow: hidden;
  1937. height: 4rpx;
  1938. background-color: rgba($color: #FFFFFF, $alpha: 0.3);
  1939. }
  1940. .dot {
  1941. width: 20rpx;
  1942. height: 4rpx;
  1943. background-color: #FFFFFF;
  1944. transition: all .3s;
  1945. }
  1946. }
  1947. }
  1948. // ---------------------------------------------
  1949. .caidanrukou {
  1950. width: 95%;
  1951. height: auto;
  1952. border-radius: 30rpx;
  1953. overflow: hidden;
  1954. background: #ffffff;
  1955. margin: 30rpx auto;
  1956. padding: 30rpx;
  1957. box-sizing: border-box;
  1958. display: flex;
  1959. justify-content: space-between;
  1960. align-items: center;
  1961. .dangecaidanrukou {
  1962. width: 33.33%;
  1963. height: auto;
  1964. display: flex;
  1965. justify-content: center;
  1966. align-items: center;
  1967. flex-direction: column;
  1968. .tupiancaidan {
  1969. width: 80rpx;
  1970. height: 80rpx;
  1971. }
  1972. .dangecaidanrukouTitle {
  1973. font-size: 28rpx;
  1974. font-weight: 500;
  1975. }
  1976. }
  1977. }
  1978. // ---------------------------------------------
  1979. .sptjyangshi {
  1980. width: 100%;
  1981. font-size: 34rpx;
  1982. font-weight: bold;
  1983. box-sizing: border-box;
  1984. padding: 30rpx 20rpx;
  1985. }
  1986. .top-container2 {
  1987. background: #FFFFFF;
  1988. display: flex;
  1989. padding: 0 20rpx;
  1990. align-items: center;
  1991. box-sizing: border-box;
  1992. .tab {
  1993. flex: 1;
  1994. display: flex;
  1995. // padding: 0 80rpx 0 30rpx;
  1996. padding: 0 30rpx 0 30rpx;
  1997. box-sizing: border-box;
  1998. justify-content: space-between;
  1999. .item {
  2000. height: 88rpx;
  2001. display: flex;
  2002. align-items: center;
  2003. justify-content: center;
  2004. font-size: 30rpx;
  2005. color: #666666;
  2006. &.current {
  2007. color: #FF3F42;
  2008. }
  2009. image {
  2010. width: 18rpx;
  2011. height: 30rpx;
  2012. display: block;
  2013. margin-left: 10rpx;
  2014. }
  2015. }
  2016. }
  2017. .icon {
  2018. padding-right: 10rpx;
  2019. image {
  2020. width: 36rpx;
  2021. height: 36rpx;
  2022. display: block;
  2023. }
  2024. }
  2025. }
  2026. </style>