index.vue 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270
  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. isHighAccuracy: true,
  530. geocode: true,
  531. success: res => {
  532. this.$axios({
  533. url: '/user/user/detail',
  534. method: 'get',
  535. params: {
  536. userId: this.userId,
  537. lat: res.latitude,
  538. lng: res.longitude,
  539. },
  540. }).then((res) => {
  541. this.distancess = res.data.distance
  542. });
  543. this.$axios({
  544. url: '/user/address',
  545. method: 'post',
  546. params: {
  547. lat: res.latitude,
  548. lng: res.longitude,
  549. },
  550. }).then((res) => {
  551. var {
  552. provinceName,
  553. cityName,
  554. areaName,
  555. name
  556. } = res.data
  557. this.currentPosition = `${provinceName}${cityName}${areaName}${name}`
  558. });
  559. },
  560. fail: err => {
  561. }
  562. })
  563. },
  564. goodsClassify() {
  565. uni.switchTab({
  566. url: '/pages/goods/classify'
  567. });
  568. },
  569. couponList() {
  570. uni.navigateTo({
  571. url: '/pages/mine/coupon/list'
  572. })
  573. },
  574. orderListPage() {
  575. uni.navigateTo({
  576. url: '/pages/mine/order/list'
  577. })
  578. },
  579. // 打开导航
  580. dakaidaoh() {
  581. console.log(1111)
  582. uni.openLocation({
  583. latitude: this.websitData.lat,
  584. longitude: this.websitData.lng,
  585. success: function() {
  586. console.log('success');
  587. }
  588. });
  589. },
  590. // 拨打商家电话
  591. bodasjdh(phoneNumber) {
  592. console.log(2222)
  593. if (phoneNumber) {
  594. uni.makePhoneCall({
  595. phoneNumber: phoneNumber
  596. });
  597. } else {
  598. uni.showModal({
  599. title: '提示',
  600. content: '商家没有手机号码!',
  601. success: (res) => {
  602. if (res.confirm) {} else if (res.cancel) {}
  603. }
  604. });
  605. }
  606. },
  607. // 获取轮播图列表
  608. getBannerList() {
  609. this.$axios({
  610. url: '/common/list/page',
  611. method: 'get',
  612. params: {
  613. pageNum: 1,
  614. pageSize: 10,
  615. state: true
  616. }
  617. }).then(res => {
  618. this.bannerList = res.data.records;
  619. }).finally(res => {})
  620. },
  621. // 切换广告图
  622. changeBanner(e) {
  623. this.bannerCurrent = e.detail.current;
  624. },
  625. // 跳转小程序
  626. toMiniProgram(appId, path) {
  627. wx.navigateToMiniProgram({
  628. appId,
  629. path,
  630. extraData: {},
  631. envVersion: 'release',
  632. success(res) {}
  633. });
  634. },
  635. // 进入活动列表
  636. toActivityList(type) {
  637. if (type == 2) {
  638. this.closeDialog();
  639. }
  640. uni.navigateTo({
  641. url: '/packageGoods/pages/activity?type=' + type
  642. })
  643. },
  644. getLocation() {
  645. if (!this.userInfo?.serviceWorkerBean?.websitId) {
  646. uni.navigateTo({
  647. url: '/pages/address/list'
  648. })
  649. }
  650. },
  651. searchSubmit() {
  652. if (this.keyword) {
  653. this.pageNum = 1;
  654. this.getGoodsList();
  655. }
  656. },
  657. // 获取页面模版
  658. async getHomePage() {
  659. const result = await new Promise((resolve, reject) => {
  660. this.$axios({
  661. url: '/renovation/detail',
  662. method: 'get',
  663. }).then(res => {
  664. if (res.data) {
  665. uni.setStorageSync('templateInfo', res.data);
  666. this.templateInfo = res.data;
  667. this.homePage = res.data.templateType;
  668. resolve(res.data.templateType);
  669. }
  670. }).catch(res => {
  671. this.homePage = 1;
  672. resolve(1);
  673. })
  674. })
  675. return result;
  676. },
  677. // 获取配置信息
  678. getConfig() {
  679. this.$axios({
  680. url: '/common/config/get',
  681. method: 'get',
  682. }).then(res => {
  683. if (res.data) {
  684. uni.setStorageSync('configInfo', res.data);
  685. }
  686. })
  687. },
  688. // 绑定用户关系
  689. bindUser(serviceId) {
  690. if (this.userInfo?.userId) {
  691. if (!this.userInfo?.serviceWorkerBean) {
  692. this.$axios({
  693. url: '/user/bind',
  694. params: {
  695. serviceId: serviceId,
  696. userId: this.userId,
  697. }
  698. }).then(res => {
  699. console.log('绑定成功:' + res.message);
  700. })
  701. }
  702. } else {
  703. setTimeout(() => {
  704. this.bindUser(serviceId)
  705. }, 100)
  706. }
  707. },
  708. // 点击分享朋友圈的图
  709. clickPyq() {
  710. this.$toast('请前往小程序使用完整服务');
  711. },
  712. // app订单支付
  713. appOrderPay(appOrderId) {
  714. let that = this;
  715. this.$axios({
  716. url: '/common/online/pay',
  717. method: 'post',
  718. params: {
  719. key: appOrderId,
  720. openId: uni.getStorageSync('userInfo').openId,
  721. }
  722. }).then(res => {
  723. if (!res.data) return false;
  724. let data = JSON.parse(res.data.codeUrl);
  725. wx.requestPayment({
  726. timeStamp: data.timeStamp,
  727. nonceStr: data.nonceStr,
  728. package: data.package,
  729. signType: 'RSA',
  730. paySign: data.paySign,
  731. success: (res) => {
  732. that.$successToast('支付成功');
  733. },
  734. fail: (err) => {
  735. that.$toast('支付失败');
  736. }
  737. })
  738. })
  739. },
  740. // 进入商品详情
  741. toGoodsDetail(id) {
  742. if (!id) {
  743. return false;
  744. }
  745. this.$axios({
  746. url: '/goods/detail',
  747. method: 'get',
  748. params: {
  749. goodsId: id,
  750. userId: this.userId,
  751. },
  752. })
  753. .then((res) => {
  754. uni.navigateTo({
  755. url: '/packageGoods/pages/detail?id=' + id
  756. })
  757. })
  758. .catch((res) => {
  759. uni.switchTab({
  760. url: '/pages/goods/all'
  761. });
  762. })
  763. .finally((res) => {});
  764. },
  765. // 检查是否有优惠券过期
  766. checkCoupon() {
  767. this.$axios({
  768. url: '/coupon/timeout',
  769. method: 'get',
  770. params: {},
  771. }).then(res => {
  772. if (res.data) {
  773. this.isCouponDialog = true;
  774. }
  775. })
  776. },
  777. // 进入我的优惠券
  778. toMyCoupon() {
  779. this.isCouponDialog = false;
  780. this.isReceiveCouponDialog = false;
  781. uni.navigateTo({
  782. url: '/pages/mine/coupon/list'
  783. })
  784. },
  785. // 领取优惠券
  786. receiveCoupon(id) {
  787. if (!this.isLogin) {
  788. return uni.navigateTo({
  789. url: '/pages/login/index'
  790. })
  791. }
  792. if (this.isSmsReceive) {
  793. this.$axios({
  794. url: '/coupon/obtain',
  795. method: 'get',
  796. params: {
  797. userId: '',
  798. couponId: ''
  799. }
  800. }).then(res => {
  801. this.isReceiveDialog = false;
  802. this.isReceiveSuccess = true;
  803. this.isReceiveCouponDialog = true;
  804. }).catch(res => {
  805. this.failMessage = res.message;
  806. this.isReceiveDialog = false;
  807. this.isReceiveSuccess = false;
  808. this.isReceiveCouponDialog = true;
  809. })
  810. } else {
  811. this.$axios({
  812. url: '/coupon/transfer/coupon',
  813. method: 'get',
  814. params: {
  815. userCouponId: this.scene.couponId
  816. }
  817. }).then(res => {
  818. this.isReceiveDialog = false;
  819. this.isReceiveSuccess = true;
  820. this.isReceiveCouponDialog = true;
  821. }).catch(res => {
  822. this.failMessage = res.message;
  823. this.isReceiveDialog = false;
  824. this.isReceiveSuccess = false;
  825. this.isReceiveCouponDialog = true;
  826. })
  827. }
  828. },
  829. // 获取订单信息
  830. getOrderInfo() {
  831. this.$axios({
  832. url: '/order/detail',
  833. method: 'get',
  834. params: {
  835. orderId: this.scene.orderId
  836. }
  837. }).then(res => {
  838. if (res.data && res.data.orderStatus === 'NOPAY') {
  839. this.orderDetail = res.data;
  840. this.isBuyDialog = true;
  841. } else {
  842. return this.$toast('二维码已失效,请重新生成');
  843. }
  844. })
  845. },
  846. // 支付
  847. payment() {
  848. let that = this;
  849. if (!this.isLogin) {
  850. uni.navigateTo({
  851. url: '/pages/login/index'
  852. })
  853. } else {
  854. this.$axios({
  855. url: '/order/wait/pay',
  856. params: {
  857. userId: this.userId,
  858. orderId: this.scene.orderId,
  859. },
  860. isLoading: 1,
  861. }).then(res => {
  862. uni.getProvider({
  863. service: 'payment',
  864. success: (e) => {
  865. uni.requestPayment({
  866. provider: e.provider[0],
  867. orderInfo: res.data,
  868. timeStamp: res.data.timeStamp,
  869. nonceStr: res.data.nonceStr,
  870. package: res.data.payPackage,
  871. signType: 'MD5',
  872. paySign: res.data.paySign,
  873. success: (res) => {
  874. that.$successToast('支付成功');
  875. that.isBuyDialog = false;
  876. that.requestMessage();
  877. },
  878. fail: (err) => {
  879. that.$toast('支付失败');
  880. }
  881. })
  882. }
  883. })
  884. })
  885. }
  886. },
  887. // 消息推送
  888. requestMessage() {
  889. let that = this;
  890. uni.showModal({
  891. title: '温馨提示',
  892. content: '为更好的促进您与买家的交流,需要在您的订单成交时向您发送消息',
  893. confirmText: "同意",
  894. cancelText: "拒绝",
  895. success: function(res) {
  896. if (res.confirm) {
  897. let tmplIds = [that.configInfo.template];
  898. uni.requestSubscribeMessage({
  899. tmplIds: tmplIds,
  900. success(res) {
  901. let status = null;
  902. tmplIds.map((item, index) => {
  903. if (res[item] == 'accept') {
  904. status = 'accept';
  905. }
  906. })
  907. if (status == 'accept') {
  908. that.$successToast('订阅成功');
  909. } else {
  910. that.$toast('订阅取消');
  911. }
  912. },
  913. fail(res) {
  914. console.log(res);
  915. that.$toast('订阅失败');
  916. }
  917. })
  918. } else if (res.cancel) {
  919. uni.showModal({
  920. title: '温馨提示',
  921. content: '拒绝后您将无法获取实时的与卖家(买家)的交易消息',
  922. confirmText: "知道了",
  923. showCancel: false,
  924. success: function(res) {
  925. }
  926. });
  927. }
  928. }
  929. });
  930. },
  931. // ------------------------------------
  932. // 切换筛选类型
  933. changeScreen(type) {
  934. if (type != 2) {
  935. if (this.screenType !== type) {
  936. this.screenType = type;
  937. } else {
  938. this.screenType = '';
  939. }
  940. } else {
  941. if (this.screenType != 2 && this.screenType != 3) {
  942. this.screenType = 2;
  943. } else if (this.screenType == 2) {
  944. this.screenType = 3;
  945. } else {
  946. this.screenType = '';
  947. }
  948. }
  949. this.pageNum = 1;
  950. this.getGoodsList();
  951. },
  952. // 获取商品列表
  953. getGoodsList(loadMore) {
  954. if (this.noMore && loadMore) return;
  955. this.noMore = false
  956. if (!loadMore) {
  957. this.pageNum = 1;
  958. } else {
  959. this.loading = true;
  960. }
  961. this.$axios({
  962. url: '/goods/list/sort/page',
  963. method: 'get',
  964. params: {
  965. pageNum: this.pageNum,
  966. pageSize: this.pageSize,
  967. categoryId: '',
  968. sort: this.screenType,
  969. keyword: this.keyword
  970. },
  971. isLoading: !loadMore
  972. }).then(res => {
  973. res.data.records.forEach(item => {
  974. if (item.logo && item.logoStartTime) {
  975. item.isShowWater = this.$compareTime(item.logoStartTime, item.logoEndTime);
  976. } else {
  977. item.isShowWater = false;
  978. }
  979. })
  980. let _list = res.data.records;
  981. let pageTotal = res.data.pages;
  982. if (this.pageNum >= pageTotal) {
  983. this.noMore = true;
  984. }
  985. if (_list.length) {
  986. this.pageNum += 1
  987. }
  988. if (loadMore) {
  989. this.goodsList = this.goodsList.concat(_list);
  990. this.loading = false;
  991. } else {
  992. this.goodsList = _list;
  993. }
  994. uni.stopPullDownRefresh();
  995. })
  996. },
  997. }
  998. }
  999. </script>
  1000. <style lang="scss">
  1001. .shangjiakapian {
  1002. width: 100%;
  1003. height: auto;
  1004. border-radius: 30rpx;
  1005. overflow: hidden;
  1006. background: #ffffff;
  1007. margin-top: 30rpx;
  1008. .shangjiatupiand {
  1009. position: relative;
  1010. .nirongdd {
  1011. position: absolute;
  1012. top: 0;
  1013. left: 0;
  1014. right: 0;
  1015. bottom: 0;
  1016. box-sizing: border-box;
  1017. padding: 26rpx;
  1018. }
  1019. }
  1020. .shangjiakapiandibubiaos {
  1021. width: 100%;
  1022. display: flex;
  1023. justify-content: space-between;
  1024. align-items: center;
  1025. .shangjiakapiandibuItem {
  1026. width: 33.33%;
  1027. height: auto;
  1028. box-sizing: border-box;
  1029. padding: 16rpx;
  1030. display: flex;
  1031. justify-content: center;
  1032. align-items: center;
  1033. font-size: 20rpx;
  1034. color: red;
  1035. }
  1036. }
  1037. }
  1038. .header-container {
  1039. display: flex;
  1040. align-items: center;
  1041. justify-content: space-between;
  1042. padding: 0 10rpx 10rpx;
  1043. .left {
  1044. display: flex;
  1045. align-items: center;
  1046. image {
  1047. width: 48rpx;
  1048. height: 48rpx;
  1049. }
  1050. }
  1051. }
  1052. .top-container {
  1053. position: relative;
  1054. .bg {
  1055. display: block;
  1056. width: 750rpx;
  1057. position: absolute;
  1058. top: 0;
  1059. z-index: 0;
  1060. }
  1061. .content {
  1062. width: 710rpx;
  1063. padding: 0 20rpx;
  1064. position: relative;
  1065. z-index: 1;
  1066. }
  1067. .title {
  1068. display: flex;
  1069. align-items: center;
  1070. justify-content: center;
  1071. color: #FFFFFF;
  1072. font-size: 36rpx;
  1073. }
  1074. .search {
  1075. background: #FFFFFF;
  1076. height: 64rpx;
  1077. display: flex;
  1078. align-items: center;
  1079. border-radius: 64rpx;
  1080. padding: 0 20rpx;
  1081. margin-top: 20rpx;
  1082. image {
  1083. width: 28rpx;
  1084. height: 28rpx;
  1085. }
  1086. input {
  1087. width: 100%;
  1088. padding-left: 15rpx;
  1089. }
  1090. }
  1091. }
  1092. .classify-container {
  1093. margin-top: 40rpx;
  1094. position: relative;
  1095. z-index: 1;
  1096. padding: 0 20rpx;
  1097. .content {
  1098. border-radius: 20rpx;
  1099. padding-top: 30rpx;
  1100. display: flex;
  1101. flex-wrap: wrap;
  1102. background: #FFFFFF;
  1103. .item {
  1104. display: flex;
  1105. flex-direction: column;
  1106. align-items: center;
  1107. width: 142rpx;
  1108. margin-bottom: 30rpx;
  1109. image {
  1110. width: 78rpx;
  1111. height: 78rpx;
  1112. display: block;
  1113. border-radius: 50%;
  1114. overflow: hidden;
  1115. }
  1116. text {
  1117. font-size: 24rpx;
  1118. color: #666666;
  1119. margin-top: 10rpx;
  1120. width: 150rpx;
  1121. text-align: center;
  1122. }
  1123. }
  1124. }
  1125. }
  1126. .notice-container {
  1127. padding: 0 20rpx;
  1128. margin-top: 20rpx;
  1129. .content {
  1130. display: flex;
  1131. align-items: center;
  1132. height: 100rpx;
  1133. background: #FFFFFF;
  1134. border-radius: 20rpx;
  1135. }
  1136. .left {
  1137. display: flex;
  1138. align-items: center;
  1139. justify-content: center;
  1140. width: 96rpx;
  1141. height: 48rpx;
  1142. margin-right: 20rpx;
  1143. border-right: 2rpx solid #E5E5E5;
  1144. image {
  1145. width: 60rpx;
  1146. height: 30rpx;
  1147. display: block;
  1148. }
  1149. }
  1150. .swiper {
  1151. height: 100rpx;
  1152. flex: 1;
  1153. padding-right: 20rpx;
  1154. ::v-deep swiper-item {
  1155. display: block;
  1156. height: 100rpx;
  1157. width: 100%;
  1158. line-height: 100rpx;
  1159. }
  1160. }
  1161. }
  1162. .coupon-container {
  1163. position: relative;
  1164. margin-top: 20rpx;
  1165. padding: 0 20rpx;
  1166. .bg {
  1167. display: block;
  1168. width: 100%;
  1169. }
  1170. .list {
  1171. position: absolute;
  1172. top: 80rpx;
  1173. z-index: 1;
  1174. }
  1175. .list1 {
  1176. .item {
  1177. position: relative;
  1178. margin-bottom: 20rpx;
  1179. margin-left: 16rpx;
  1180. .cp {
  1181. width: 688rpx;
  1182. height: 178rpx;
  1183. display: block;
  1184. }
  1185. .content {
  1186. position: absolute;
  1187. left: 0;
  1188. top: 0;
  1189. width: 710rpx;
  1190. height: 160rpx;
  1191. display: flex;
  1192. align-items: center;
  1193. .left {
  1194. width: 210rpx;
  1195. display: flex;
  1196. align-items: center;
  1197. justify-content: center;
  1198. flex-direction: column;
  1199. .price {
  1200. font-size: 48rpx;
  1201. color: #FFFFFF;
  1202. }
  1203. .text {
  1204. color: #FFFFFF;
  1205. font-size: 28rpx;
  1206. }
  1207. }
  1208. .right {
  1209. display: flex;
  1210. align-items: center;
  1211. justify-content: space-between;
  1212. padding: 0 20rpx;
  1213. width: 470rpx;
  1214. height: 150rpx;
  1215. box-sizing: border-box;
  1216. .main {
  1217. width: 430rpx;
  1218. height: 150rpx;
  1219. padding: 16rpx 0 8rpx;
  1220. box-sizing: border-box;
  1221. display: flex;
  1222. flex-direction: column;
  1223. justify-content: space-between;
  1224. .row1 {
  1225. font-size: 28rpx;
  1226. line-height: 32rpx;
  1227. height: 64rpx;
  1228. }
  1229. .row2 {
  1230. font-size: 24rpx;
  1231. line-height: 28rpx;
  1232. color: #999999;
  1233. display: flex;
  1234. justify-content: space-between;
  1235. align-items: center;
  1236. }
  1237. }
  1238. }
  1239. }
  1240. }
  1241. }
  1242. .list2 {
  1243. display: flex;
  1244. .item {
  1245. position: relative;
  1246. margin-bottom: 20rpx;
  1247. &:first-child {
  1248. margin-left: 16rpx;
  1249. }
  1250. .cp {
  1251. width: 342rpx;
  1252. height: 308rpx;
  1253. display: block;
  1254. }
  1255. .content {
  1256. position: absolute;
  1257. left: 0;
  1258. top: 0;
  1259. width: 342rpx;
  1260. height: 328rpx;
  1261. display: flex;
  1262. flex-direction: column;
  1263. align-items: center;
  1264. .top {
  1265. width: 324rpx;
  1266. height: 130rpx;
  1267. display: flex;
  1268. align-items: center;
  1269. justify-content: center;
  1270. flex-direction: column;
  1271. .price {
  1272. font-size: 48rpx;
  1273. color: #FFFFFF;
  1274. line-height: 48rpx;
  1275. margin-top: 16rpx;
  1276. }
  1277. .text {
  1278. color: #FFFFFF;
  1279. font-size: 28rpx;
  1280. line-height: 28rpx;
  1281. margin-top: 10rpx;
  1282. }
  1283. }
  1284. .bottom {
  1285. width: 324rpx;
  1286. height: 160rpx;
  1287. padding: 16rpx;
  1288. box-sizing: border-box;
  1289. display: flex;
  1290. flex-direction: column;
  1291. justify-content: space-between;
  1292. align-items: center;
  1293. .name {
  1294. font-size: 28rpx;
  1295. text-align: left;
  1296. line-height: 32rpx;
  1297. width: 100%;
  1298. }
  1299. .date {
  1300. font-size: 24rpx;
  1301. color: #999999;
  1302. text-align: left;
  1303. width: 100%;
  1304. line-height: 28rpx;
  1305. }
  1306. }
  1307. }
  1308. }
  1309. }
  1310. .list3 {
  1311. display: flex;
  1312. align-items: center;
  1313. .left {
  1314. display: flex;
  1315. width: 630rpx;
  1316. overflow-x: scroll;
  1317. }
  1318. .right {
  1319. width: 80rpx;
  1320. display: flex;
  1321. justify-content: center;
  1322. .text {
  1323. width: 48rpx;
  1324. height: 200rpx;
  1325. border-radius: 48rpx;
  1326. background: #FFFFFF;
  1327. display: flex;
  1328. flex-direction: column;
  1329. align-items: center;
  1330. justify-content: center;
  1331. text {
  1332. font-size: 28rpx;
  1333. color: #FF3F42;
  1334. line-height: 32rpx;
  1335. }
  1336. image {
  1337. width: 32rpx;
  1338. height: 32rpx;
  1339. display: block;
  1340. flex-shrink: 0;
  1341. margin-top: 10rpx;
  1342. }
  1343. }
  1344. }
  1345. .item {
  1346. position: relative;
  1347. margin-bottom: 20rpx;
  1348. &:first-child {
  1349. margin-left: 16rpx;
  1350. }
  1351. .cp {
  1352. width: 278rpx;
  1353. height: 308rpx;
  1354. display: block;
  1355. }
  1356. .content {
  1357. position: absolute;
  1358. left: 0;
  1359. top: 0;
  1360. width: 278rpx;
  1361. height: 328rpx;
  1362. display: flex;
  1363. flex-direction: column;
  1364. align-items: center;
  1365. .top {
  1366. width: 260rpx;
  1367. height: 130rpx;
  1368. display: flex;
  1369. align-items: center;
  1370. justify-content: center;
  1371. flex-direction: column;
  1372. .price {
  1373. font-size: 48rpx;
  1374. color: #FFFFFF;
  1375. line-height: 48rpx;
  1376. margin-top: 16rpx;
  1377. }
  1378. .text {
  1379. color: #FFFFFF;
  1380. font-size: 28rpx;
  1381. line-height: 28rpx;
  1382. margin-top: 10rpx;
  1383. }
  1384. }
  1385. .bottom {
  1386. width: 260rpx;
  1387. height: 160rpx;
  1388. padding: 16rpx;
  1389. box-sizing: border-box;
  1390. display: flex;
  1391. flex-direction: column;
  1392. justify-content: space-between;
  1393. align-items: center;
  1394. .name {
  1395. font-size: 28rpx;
  1396. text-align: left;
  1397. line-height: 32rpx;
  1398. width: 100%;
  1399. }
  1400. .date {
  1401. font-size: 24rpx;
  1402. color: #999999;
  1403. text-align: left;
  1404. width: 100%;
  1405. line-height: 28rpx;
  1406. }
  1407. }
  1408. }
  1409. }
  1410. }
  1411. .button {
  1412. width: 120rpx;
  1413. height: 40rpx;
  1414. border-radius: 40rpx;
  1415. font-size: 24rpx;
  1416. flex-shrink: 0;
  1417. box-sizing: border-box;
  1418. display: flex;
  1419. justify-content: center;
  1420. align-items: center;
  1421. &.gary {
  1422. background: #AAAAAA;
  1423. color: #FFFFFF;
  1424. border: 1px solid #AAAAAA;
  1425. }
  1426. &.red {
  1427. background: #C434FF;
  1428. color: #FFFFFF;
  1429. border: 1px solid #C434FF;
  1430. }
  1431. &.white {
  1432. color: #FF3F42;
  1433. border: 1px solid #FF3F42;
  1434. }
  1435. }
  1436. }
  1437. .myManager-container {
  1438. padding: 0 20rpx;
  1439. .content {
  1440. display: flex;
  1441. justify-content: space-between;
  1442. align-items: center;
  1443. background: #FFFFFF;
  1444. border-radius: 20rpx;
  1445. padding: 20rpx;
  1446. .left {
  1447. display: flex;
  1448. align-items: center;
  1449. image {
  1450. width: 100rpx;
  1451. height: 100rpx;
  1452. border-radius: 50%;
  1453. }
  1454. .main {
  1455. font-size: 28rpx;
  1456. line-height: 48rpx;
  1457. margin-left: 20rpx;
  1458. }
  1459. }
  1460. .right {
  1461. width: 160rpx;
  1462. height: 60rpx;
  1463. line-height: 60rpx;
  1464. border-radius: 60rpx;
  1465. text-align: center;
  1466. font-size: 28rpx;
  1467. color: #E43B38;
  1468. border: 1px solid #E43B38;
  1469. }
  1470. }
  1471. }
  1472. .seckill-container {
  1473. position: relative;
  1474. margin-top: 20rpx;
  1475. min-height: 340rpx;
  1476. .bg {
  1477. display: block;
  1478. width: 750rpx;
  1479. position: absolute;
  1480. top: 0;
  1481. z-index: 0;
  1482. }
  1483. .content {
  1484. width: 710rpx;
  1485. padding: 0 20rpx;
  1486. position: relative;
  1487. z-index: 1;
  1488. }
  1489. .time-list {
  1490. display: flex;
  1491. overflow-x: scroll;
  1492. padding-top: 90rpx;
  1493. padding-bottom: 40rpx;
  1494. .item {
  1495. display: flex;
  1496. flex-direction: column;
  1497. align-items: center;
  1498. flex-shrink: 0;
  1499. width: 140rpx;
  1500. margin-right: 48rpx;
  1501. .time {
  1502. font-size: 32rpx;
  1503. color: #FFFFFF;
  1504. }
  1505. .tag {
  1506. width: 140rpx;
  1507. height: 44rpx;
  1508. border-radius: 44rpx;
  1509. border: 1px solid #FFFFFF;
  1510. font-size: 24rpx;
  1511. color: #FFFFFF;
  1512. box-sizing: border-box;
  1513. margin-top: 12rpx;
  1514. display: flex;
  1515. align-items: center;
  1516. justify-content: center;
  1517. }
  1518. &.current {
  1519. .tag {
  1520. background: #FFFFFF;
  1521. color: #FF3F42;
  1522. }
  1523. }
  1524. }
  1525. }
  1526. .product-list {
  1527. .item {
  1528. background: #FFFFFF;
  1529. border-radius: 10rpx;
  1530. display: flex;
  1531. padding: 20rpx;
  1532. margin-bottom: 20rpx;
  1533. image {
  1534. display: block;
  1535. width: 180rpx;
  1536. height: 180rpx;
  1537. flex-shrink: 0;
  1538. }
  1539. .right {
  1540. width: 490rpx;
  1541. box-sizing: border-box;
  1542. padding-left: 20rpx;
  1543. .title {
  1544. font-size: 30rpx;
  1545. color: #333333;
  1546. line-height: 36rpx;
  1547. font-weight: 600;
  1548. }
  1549. .des {
  1550. font-size: 24rpx;
  1551. line-height: 30rpx;
  1552. color: #999999;
  1553. margin-top: 6rpx;
  1554. }
  1555. .stock-sales {
  1556. display: flex;
  1557. justify-content: space-between;
  1558. align-items: center;
  1559. margin-top: 10rpx;
  1560. font-size: 24rpx;
  1561. color: #666666;
  1562. .stock {
  1563. display: flex;
  1564. align-items: center;
  1565. text {
  1566. font-size: 24rpx;
  1567. color: #666666;
  1568. }
  1569. .progress-box {
  1570. width: 140rpx;
  1571. border-radius: 6px;
  1572. overflow: hidden;
  1573. margin-left: 10rpx;
  1574. }
  1575. }
  1576. }
  1577. .bottom {
  1578. display: flex;
  1579. justify-content: space-between;
  1580. align-items: center;
  1581. margin-top: 10rpx;
  1582. .price {
  1583. display: flex;
  1584. flex-direction: column;
  1585. }
  1586. .price-1 {
  1587. font-size: 32rpx;
  1588. color: #FF3F42;
  1589. line-height: 36rpx;
  1590. }
  1591. .price-2 {
  1592. font-size: 26rpx;
  1593. color: #666666;
  1594. line-height: 30rpx;
  1595. text-decoration: line-through;
  1596. }
  1597. .btn {
  1598. width: 110rpx;
  1599. height: 44rpx;
  1600. background: #FF3F42;
  1601. border-radius: 5rpx;
  1602. font-size: 28rpx;
  1603. color: #FFFFFF;
  1604. text-align: center;
  1605. line-height: 44rpx;
  1606. }
  1607. .btn2 {
  1608. width: 110rpx;
  1609. height: 44rpx;
  1610. background: #AAAAAA;
  1611. border-radius: 5rpx;
  1612. font-size: 28rpx;
  1613. color: #FFFFFF;
  1614. text-align: center;
  1615. line-height: 44rpx;
  1616. }
  1617. }
  1618. }
  1619. }
  1620. }
  1621. .loadmore {
  1622. background: #FFFFFF;
  1623. border-radius: 10rpx;
  1624. display: flex;
  1625. justify-content: center;
  1626. align-items: center;
  1627. height: 88rpx;
  1628. }
  1629. }
  1630. .recom-container {
  1631. margin-top: 30rpx;
  1632. .top {
  1633. background: #FFFFFF;
  1634. padding: 30rpx 0 0;
  1635. .title {
  1636. display: flex;
  1637. align-items: center;
  1638. justify-content: center;
  1639. margin-bottom: 10rpx;
  1640. image {
  1641. width: 300rpx;
  1642. height: 40rpx;
  1643. display: block;
  1644. }
  1645. }
  1646. .tab {
  1647. display: flex;
  1648. margin-left: -10rpx;
  1649. .item {
  1650. display: flex;
  1651. flex-direction: column;
  1652. align-items: center;
  1653. flex-shrink: 0;
  1654. font-size: 28rpx;
  1655. color: #666666;
  1656. height: 80rpx;
  1657. line-height: 80rpx;
  1658. position: relative;
  1659. padding: 0 30rpx;
  1660. &.current {
  1661. color: #FF3F42;
  1662. font-weight: 600;
  1663. &::after {
  1664. content: '';
  1665. display: block;
  1666. width: 50rpx;
  1667. height: 6rpx;
  1668. background: #FF3F42;
  1669. position: absolute;
  1670. bottom: 0;
  1671. left: 50%;
  1672. margin-left: -25rpx;
  1673. }
  1674. }
  1675. }
  1676. }
  1677. }
  1678. .list {
  1679. display: flex;
  1680. flex-wrap: wrap;
  1681. padding: 20rpx;
  1682. .item {
  1683. width: 348rpx;
  1684. background: #FFFFFF;
  1685. margin-right: 14rpx;
  1686. margin-bottom: 20rpx;
  1687. border-radius: 20rpx;
  1688. overflow: hidden;
  1689. &:nth-child(2n) {
  1690. margin-right: 0;
  1691. }
  1692. .image {
  1693. width: 348rpx;
  1694. height: 348rpx;
  1695. flex-shrink: 0;
  1696. position: relative;
  1697. .img {
  1698. width: 348rpx;
  1699. height: 348rpx;
  1700. display: block;
  1701. }
  1702. .water {
  1703. width: 348rpx;
  1704. height: 348rpx;
  1705. display: block;
  1706. position: absolute;
  1707. left: 0;
  1708. top: 0;
  1709. z-index: 1;
  1710. }
  1711. }
  1712. .content {
  1713. padding: 15rpx 20rpx;
  1714. .title {
  1715. font-size: 30rpx;
  1716. color: #333333;
  1717. line-height: 36rpx;
  1718. font-weight: 600;
  1719. height: 72rpx;
  1720. }
  1721. .bottom {
  1722. display: flex;
  1723. justify-content: space-between;
  1724. align-items: center;
  1725. margin-top: 10rpx;
  1726. .price {
  1727. display: flex;
  1728. flex-direction: column;
  1729. }
  1730. .price-1 {
  1731. font-size: 32rpx;
  1732. color: #FF3F42;
  1733. line-height: 36rpx;
  1734. }
  1735. .price-2 {
  1736. font-size: 26rpx;
  1737. color: #666666;
  1738. line-height: 30rpx;
  1739. text-decoration: line-through;
  1740. }
  1741. .btn {
  1742. width: 60rpx;
  1743. height: 60rpx;
  1744. background: #FE781F;
  1745. border-radius: 50%;
  1746. display: flex;
  1747. align-items: center;
  1748. justify-content: center;
  1749. image {
  1750. width: 41rpx;
  1751. height: 36rpx;
  1752. display: block;
  1753. }
  1754. }
  1755. }
  1756. }
  1757. }
  1758. }
  1759. }
  1760. .app-container {
  1761. background: #F4F2F2;
  1762. box-sizing: border-box;
  1763. }
  1764. .couponDialog {
  1765. position: fixed;
  1766. top: 30%;
  1767. left: 75rpx;
  1768. z-index: 999;
  1769. width: 600rpx;
  1770. background: #FFFFFF;
  1771. border-radius: 20rpx;
  1772. image {
  1773. width: 600rpx;
  1774. }
  1775. .bottom {
  1776. padding: 0 40rpx 50rpx;
  1777. .text {
  1778. font-size: 32rpx;
  1779. line-height: 48rpx;
  1780. text-align: center;
  1781. }
  1782. .btn-group {
  1783. display: flex;
  1784. justify-content: space-between;
  1785. margin-top: 50rpx;
  1786. .button {
  1787. width: 240rpx;
  1788. height: 72rpx;
  1789. border-radius: 72rpx;
  1790. border: 1px solid #FF3F42;
  1791. font-size: 32rpx;
  1792. line-height: 72rpx;
  1793. text-align: center;
  1794. &.left {
  1795. color: #FF3F42;
  1796. }
  1797. &.right {
  1798. color: #FFFFFF;
  1799. background: #FF3F42;
  1800. }
  1801. }
  1802. &.onlyOne {
  1803. justify-content: center;
  1804. .button {
  1805. width: 300rpx;
  1806. }
  1807. }
  1808. }
  1809. }
  1810. }
  1811. .buyDialog {
  1812. position: fixed;
  1813. top: 30%;
  1814. left: 100rpx;
  1815. z-index: 999;
  1816. width: 550rpx;
  1817. background: #FFFFFF;
  1818. border-radius: 10rpx;
  1819. box-sizing: border-box;
  1820. padding: 20rpx 20rpx 30rpx;
  1821. display: flex;
  1822. flex-direction: column;
  1823. align-items: center;
  1824. .close {
  1825. width: 100%;
  1826. display: flex;
  1827. justify-content: flex-end;
  1828. image {
  1829. width: 32rpx;
  1830. height: 32rpx;
  1831. display: block;
  1832. }
  1833. }
  1834. .goods {
  1835. margin-top: 10rpx;
  1836. image {
  1837. width: 410rpx;
  1838. height: 300rpx;
  1839. display: block;
  1840. }
  1841. .name {
  1842. font-size: 28rpx;
  1843. line-height: 34rpx;
  1844. margin-top: 16rpx;
  1845. }
  1846. .des {
  1847. font-size: 26rpx;
  1848. color: #666666;
  1849. line-height: 30rpx;
  1850. margin-top: 10rpx;
  1851. }
  1852. }
  1853. .goodsList {
  1854. max-height: 400rpx;
  1855. overflow-y: scroll;
  1856. margin-top: 10rpx;
  1857. .item {
  1858. display: flex;
  1859. padding: 10rpx 20rpx;
  1860. image {
  1861. width: 120rpx;
  1862. height: 120rpx;
  1863. display: block;
  1864. flex-shrink: 0;
  1865. }
  1866. .right {
  1867. width: 334rpx;
  1868. margin-left: 16rpx;
  1869. .name {
  1870. font-size: 28rpx;
  1871. line-height: 34rpx;
  1872. margin-top: 8rpx;
  1873. }
  1874. .des {
  1875. font-size: 26rpx;
  1876. color: #666666;
  1877. line-height: 30rpx;
  1878. margin-top: 10rpx;
  1879. }
  1880. }
  1881. }
  1882. }
  1883. .num {
  1884. margin-top: 10rpx;
  1885. line-height: 40rpx;
  1886. text {
  1887. color: #FF3F42;
  1888. font-size: 32rpx;
  1889. font-weight: 600;
  1890. margin: 0 10rpx;
  1891. }
  1892. }
  1893. .price {
  1894. margin-top: 8rpx;
  1895. line-height: 40rpx;
  1896. text {
  1897. color: #FF3F42;
  1898. font-size: 32rpx;
  1899. font-weight: 600;
  1900. }
  1901. }
  1902. .button {
  1903. width: 300rpx;
  1904. height: 64rpx;
  1905. line-height: 64rpx;
  1906. text-align: center;
  1907. background: #FF3F42;
  1908. border-radius: 64rpx;
  1909. font-size: 28rpx;
  1910. color: #FFFFFF;
  1911. margin-top: 20rpx;
  1912. }
  1913. }
  1914. // ---------------------------------------------
  1915. .swiper-container {
  1916. position: relative;
  1917. margin-top: 20rpx;
  1918. swiper {
  1919. height: 350rpx;
  1920. }
  1921. image {
  1922. height: 350rpx;
  1923. width: 710rpx;
  1924. display: block;
  1925. margin: 0 auto 0;
  1926. border-radius: 15rpx;
  1927. overflow: hidden;
  1928. }
  1929. .dots-conatiner {
  1930. position: absolute;
  1931. width: 100%;
  1932. bottom: 40rpx;
  1933. display: flex;
  1934. align-items: center;
  1935. justify-content: center;
  1936. .con {
  1937. border-radius: 4rpx;
  1938. overflow: hidden;
  1939. height: 4rpx;
  1940. background-color: rgba($color: #FFFFFF, $alpha: 0.3);
  1941. }
  1942. .dot {
  1943. width: 20rpx;
  1944. height: 4rpx;
  1945. background-color: #FFFFFF;
  1946. transition: all .3s;
  1947. }
  1948. }
  1949. }
  1950. // ---------------------------------------------
  1951. .caidanrukou {
  1952. width: 95%;
  1953. height: auto;
  1954. border-radius: 30rpx;
  1955. overflow: hidden;
  1956. background: #ffffff;
  1957. margin: 30rpx auto;
  1958. padding: 30rpx;
  1959. box-sizing: border-box;
  1960. display: flex;
  1961. justify-content: space-between;
  1962. align-items: center;
  1963. .dangecaidanrukou {
  1964. width: 33.33%;
  1965. height: auto;
  1966. display: flex;
  1967. justify-content: center;
  1968. align-items: center;
  1969. flex-direction: column;
  1970. .tupiancaidan {
  1971. width: 80rpx;
  1972. height: 80rpx;
  1973. }
  1974. .dangecaidanrukouTitle {
  1975. font-size: 28rpx;
  1976. font-weight: 500;
  1977. }
  1978. }
  1979. }
  1980. // ---------------------------------------------
  1981. .sptjyangshi {
  1982. width: 100%;
  1983. font-size: 34rpx;
  1984. font-weight: bold;
  1985. box-sizing: border-box;
  1986. padding: 30rpx 20rpx;
  1987. }
  1988. .top-container2 {
  1989. background: #FFFFFF;
  1990. display: flex;
  1991. padding: 0 20rpx;
  1992. align-items: center;
  1993. box-sizing: border-box;
  1994. .tab {
  1995. flex: 1;
  1996. display: flex;
  1997. // padding: 0 80rpx 0 30rpx;
  1998. padding: 0 30rpx 0 30rpx;
  1999. box-sizing: border-box;
  2000. justify-content: space-between;
  2001. .item {
  2002. height: 88rpx;
  2003. display: flex;
  2004. align-items: center;
  2005. justify-content: center;
  2006. font-size: 30rpx;
  2007. color: #666666;
  2008. &.current {
  2009. color: #FF3F42;
  2010. }
  2011. image {
  2012. width: 18rpx;
  2013. height: 30rpx;
  2014. display: block;
  2015. margin-left: 10rpx;
  2016. }
  2017. }
  2018. }
  2019. .icon {
  2020. padding-right: 10rpx;
  2021. image {
  2022. width: 36rpx;
  2023. height: 36rpx;
  2024. display: block;
  2025. }
  2026. }
  2027. }
  2028. </style>