index.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177
  1. <template>
  2. <page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
  3. <view>
  4. <view class="product_image_box" v-if="!productInfo.photo_list.length">
  5. <image class="product_image" :src="sku_thumb"></image>
  6. </view>
  7. <view class="product_image_box" v-if="productInfo.photo_list.length">
  8. <swiper class="photo_list" :autoplay="true">
  9. <swiper-item v-for="(item,index) in productInfo.photo_list" :key="index">
  10. <image :src="item.thumb" class="photo_image"></image>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <view class="product_info">
  15. <view class="stock_price" v-if="isShowPrice">
  16. <view class="product_price">
  17. <text>¥{{productInfo.price}} </text>
  18. <text class="product_market">¥{{productInfo.market_price}} </text>
  19. </view>
  20. </view>
  21. <view class="product_name">
  22. <text v-if="productInfo.regiment_title" class="regiment_title">{{productInfo.regiment_title}}</text>
  23. <text v-if="productInfo.promo_title" class="regiment_title">{{productInfo.promo_title}}</text>
  24. {{productInfo.name}}
  25. </view>
  26. <view class="product_spec">
  27. <view class="spec_name">{{productInfo.spec}}</view>
  28. <view class="product_stock">剩{{productInfo.stock}}个</view>
  29. </view>
  30. </view>
  31. <view class="regiment_list" v-if="productInfo.regiment_list.length">
  32. <view class="regiment_list_title">
  33. <text class="title1">{{productInfo.regiment_list.length}}人正在拼单</text>
  34. <text class="title2" @click="openRegiment()">查看更多</text>
  35. </view>
  36. <view class="regiment">
  37. <swiper class="swiper" :indicator-dots="false" :autoplay="true" :interval="2000" :duration="2000"
  38. :circular="true" :vertical="true" :display-multiple-items="2" easing-function="linear">
  39. <swiper-item v-for="item in productInfo.regiment_list" :key="index">
  40. <view class="swiper-item">
  41. <view class="username">
  42. <image class="user_image" :src="item.userpic"></image>
  43. <text class="username_text">{{item.username}}</text>
  44. </view>
  45. <view class="regiment_right">
  46. <button class="regiment_but" data-eventsync="true"
  47. @click="showSpecPopup(4,item.id)">去拼单</button>
  48. </view>
  49. <view class="regiment_center">
  50. <view class="regiment_center_text">还差{{item.surplus_number}}人成团</view>
  51. <view class="regiment_center_time">
  52. <view class="center_title">还剩</view>
  53. <uni-countdown color="#E03519" :show-day="false" :hour="remainder(item.end_time,1)"
  54. :minute="remainder(item.end_time,2)"
  55. :second="remainder(item.end_time,3)"></uni-countdown>
  56. </view>
  57. </view>
  58. </view>
  59. </swiper-item>
  60. </swiper>
  61. </view>
  62. </view>
  63. <view class="product_business" v-if="productInfo.business_info.name">
  64. <image class="logopic" :src="productInfo.business_info.logopic"></image>
  65. <view class="business_info">
  66. <view class="business_name">
  67. {{productInfo.business_info.name}}
  68. </view>
  69. <view class="business_desc">
  70. {{productInfo.business_info.desc}}
  71. </view>
  72. </view>
  73. </view>
  74. <view class="product_description">
  75. <rich-text :nodes="productInfo.description"></rich-text>
  76. </view>
  77. <view class="product_poster" v-if="productInfo.poster">
  78. <image class="product_image" :src="productInfo.poster" mode="widthFix"></image>
  79. </view>
  80. <view class="order_car" v-if="productInfo.regiment_type === 2">
  81. <navigator url="/pages/car/index" open-type="switchTab" class="to_car">
  82. <image src="../../static/icon/car.png" class="car_icon"></image>
  83. </navigator>
  84. <button class="show_order" data-eventsync="true"
  85. @click="showSpecPopup(3)">{{this.productInfo.regiment_title}}专享/{{this.productInfo.regiment_price}}</button>
  86. <button class="show_car" data-eventsync="true"
  87. @click="showSpecPopup(1)">单独预约/{{this.productInfo.price}}</button>
  88. </view>
  89. <view class="order_car" v-else-if="productInfo.regiment_type === 1">
  90. <navigator url="/pages/car/index" open-type="switchTab" class="to_car">
  91. <image src="../../static/icon/car.png" class="car_icon"></image>
  92. </navigator>
  93. <view class="show_order_regiment" @click="showSpecPopup(4)">
  94. <view>立即参与多人团拼单</view>
  95. <view class="regiment_countdown">
  96. <uni-countdown color="#FFFFFF" :show-day="false"
  97. :hour="remainder(productInfo.automatic_info.end_time,1)"
  98. :minute="remainder(productInfo.automatic_info.end_time,2)"
  99. :second="remainder(productInfo.automatic_info.end_time,3)"></uni-countdown>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="order_car" v-else>
  104. <navigator url="/pages/car/index" open-type="switchTab" class="to_car">
  105. <image src="../../static/icon/car.png" class="car_icon"></image>
  106. </navigator>
  107. <button class="show_order" data-eventsync="true" @click="showSpecPopup(1)">立即预约</button>
  108. <button class="show_car" data-eventsync="true" @click="showSpecPopup(2)">加入购物车</button>
  109. </view>
  110. <view class="to_bottom"> --- 到底了 --- </view>
  111. <uni-popup ref="specPopup" :show="true" type="bottom" class="popup" background-color="#FFFFFF"
  112. @change="popupChange">
  113. <view class="order_info">
  114. <view class="custom_addr" v-if="specBtnType==1 || specBtnType==3 || specBtnType==4"
  115. @click="showAddrPopup()">
  116. <view class="contact_user">
  117. <text class="contact_none" v-if="!checkedAddr.id">请选择收货地址</text>
  118. <text class="contact_name">{{checkedAddr.contact_name}}</text>
  119. <text class="contact_phone">{{checkedAddr.contact_phone}}</text>
  120. <text class="contact_more"> &gt;</text>
  121. <text class="contact_shop">{{checkedAddr.contact_shop}}</text>
  122. </view>
  123. <view class="contact_addr" style="display: flex;">
  124. {{checkedAddr.contact_province}} {{checkedAddr.contact_city}} {{checkedAddr.contact_area}}
  125. {{checkedAddr.contact_addr}}
  126. <view v-if="checkedAddr.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[checkedAddr.shop_type] }})</view>
  127. </view>
  128. </view>
  129. <view class="car_item">
  130. <view class="box_left">
  131. <image class="car_image" :src="sku_thumb" mode=""></image>
  132. </view>
  133. <view class="box_right">
  134. <view class="car_name">{{productInfo.name}}</view>
  135. <view v-if="productInfo.promo_title" class="promo_title">{{productInfo.promo_title}}</view>
  136. <view class="stock_price">
  137. <view class="product_price" v-if="isShowPrice">
  138. <text v-if="specBtnType==1">¥{{productInfo.price}} </text>
  139. <text v-if="specBtnType==3 || specBtnType==4">¥{{productInfo.regiment_price}} </text>
  140. <text class="car_market">¥{{productInfo.market_price}}</text>
  141. </view>
  142. <view class="product_quantity_box">
  143. <button class="product_quantity_sub" @click="changeQuantity(-1)" data-eventsync="true">
  144. <image class="sub_icon" src="../../static/icon/sub_icon.png" mode=""></image>
  145. </button>
  146. <input type="number" class="product_quantity" placeholder="数量" v-model="quantity"
  147. @blur="changeQuantity(0)"></input>
  148. <button class="product_quantity_add" @click="changeQuantity(+1)" data-eventsync="true">
  149. <image class="add_icon" src="../../static/icon/add_icon.png" mode=""></image>
  150. </button>
  151. </view>
  152. </view>
  153. <view class="product_stock">剩{{productInfo.stock}}个</view>
  154. </view>
  155. </view>
  156. <view class="select_sku" v-if="productInfo.product_attr.length">
  157. <scroll-view scroll-y="true" class="scroll_max">
  158. <view class="product_attr" v-for="(spec,spec_index) in productInfo.product_attr"
  159. :key="spec_index">
  160. <scroll-view scroll-y="true" class="scroll_y">
  161. <view class="spec_name">{{ spec.spec_name }}</view>
  162. <view class="arrt_list">
  163. <view class="arrt_option" :class="option.active?'active':''"
  164. v-for="(option,attr_index) in spec.attr_list" :key="attr_index"
  165. @click="attrChange(spec_index,attr_index)">
  166. <text> {{option.name}}</text> <text
  167. v-if="option.remark">【{{option.remark}}】</text>
  168. </view>
  169. </view>
  170. </scroll-view>
  171. </view>
  172. </scroll-view>
  173. </view>
  174. <!-- 选择优惠券 -->
  175. <view class="to_select_coupon" v-if="specBtnType==1" @click="openCoupon()">
  176. <text>优惠券</text>
  177. <view class="coupon_deduction">{{couponUsed}}</view>
  178. </view>
  179. <view class="order_price" v-if="specBtnType==1 || specBtnType==3">合计: ¥{{priceTotal}}</view>
  180. <view class="order_btn">
  181. <button class="to_order" @click="createOrder()" v-if="specBtnType==1"
  182. data-eventsync="true">预约</button>
  183. <button class="to_car" @click="createCart()" v-if="specBtnType==2"
  184. data-eventsync="true">加入购物车</button>
  185. <button class="to_order" @click="createOrder()" v-if="specBtnType==3"
  186. data-eventsync="true">拼团预约</button>
  187. <button class="to_order" @click="createOrder()" v-if="specBtnType==4"
  188. data-eventsync="true">{{ productInfo.regiment_title }}预约</button>
  189. </view>
  190. </view>
  191. </uni-popup>
  192. <uni-popup ref="couponPopup" type="bottom" class="popup" background-color="#FFFFFF">
  193. <view class="popup_title">优惠券</view>
  194. <view class="coupon_list">
  195. <view class="coupon_item" v-for="(item,index) in couponList" @click="checkedCoupon(index,false)"
  196. :key="index">
  197. <view class="box_left">
  198. <view class="rebate" v-if="item.rebate_type == 1"> ¥{{item.rebate}}</view>
  199. <view class="rebate" v-if="item.rebate_type == 2"> 打 {{item.rebate}} 折</view>
  200. <view class="rebate" v-if="item.rebate_type == 3"> 赠 <text v-if="item.rebate_scope.length">
  201. {{item.rebate_scope[0].product_name}}
  202. </text> </view>
  203. <view class="std_pay"> 满{{item.std_pay}}</view>
  204. </view>
  205. <view class="box_right">
  206. <view class="coupon_title">
  207. <view class="coupon_name" v-if="item.rebate_type == 1">满减券</view>
  208. <view class="coupon_name" v-if="item.rebate_type == 2">折扣券</view>
  209. <view class="coupon_name" v-if="item.rebate_type == 3">赠品券</view>
  210. </view>
  211. <view class="product_scope">
  212. <text class="" v-if="item.type_id == 1">{{item.is_scope?"当前商品可用":"当前商品不可用"}}</text>
  213. <text class="" v-if="item.type_id == 2">全场可用</text>
  214. <text class="" v-if="item.type_id == 3">{{item.is_scope?"当前商品可用":"当前商品不可用"}}</text>
  215. <view class="check_label">
  216. <view class="isstd" v-if="!item.is_std">未达标</view>
  217. <image class="checkbox" v-if="item.is_std"
  218. :src="item.checked?'../../static/icon/checked.png':'../../static/icon/checkbox.png'">
  219. </image>
  220. </view>
  221. </view>
  222. <view class="coupon_info">
  223. <view class="coupon_exp">{{item.exp_time}} 到期</view>
  224. </view>
  225. </view>
  226. </view>
  227. </view>
  228. </uni-popup>
  229. <uni-popup ref="addrPopup" type="bottom" class="popup" background-color="#FFFFFF">
  230. <view class="popup_title">收货地址 <navigator url="/pages/addr/index?notify=addr" class="to_addr_page">管理
  231. </navigator>
  232. </view>
  233. <view class="addr_list">
  234. <view class="addr_item" v-for="(item,index) in addrList" :key="index" @click="checkedAddrItem(item)">
  235. <view class="radio_label">
  236. <image class="radio_icon"
  237. :src="item.id == checkedAddr.id? '../../static/icon/radioed.png' : '../../static/icon/radio.png'">
  238. </image>
  239. </view>
  240. <view class="contact_user">
  241. <text class="contact_name">{{item.contact_name}}</text>
  242. <text class="contact_phone">{{item.contact_phone}}</text>
  243. <text class="contact_default" v-if="item.is_default">默认</text>
  244. <text class="contact_shop">{{item.contact_shop}}</text>
  245. </view>
  246. <view class="contact_addr" style="display:flex">
  247. {{item.contact_province}} {{item.contact_city}} {{item.contact_area}} {{item.contact_addr}}
  248. <view v-if="item.shop_type">&nbsp;({{ $CONSTANTS.SHOP_TYPES[item.shop_type] }})</view>
  249. </view>
  250. </view>
  251. </view>
  252. <view class="create_box">
  253. <navigator url="/pages/addr/index?notify=addr&type=create" class="create_addr">新建收货地址</navigator>
  254. </view>
  255. </uni-popup>
  256. <uni-popup ref="addFollow" type="center" class="center_popup" @change="popupChange">
  257. <view class="add_follow">
  258. <view class="close_area"><button class="close_btn" @click="closeAddFollow()">关闭</button></view>
  259. <view class="info_alter">
  260. <text v-if="follow_linkurl">点击二维码添加客服</text>
  261. <text v-if="!follow_linkurl">长按二维码添加客服</text>
  262. </view>
  263. <view class="qr_code_area" @click="followLinkurl">
  264. <image v-if="followQrcode" :src="followQrcode" class="qr_code" mode="" show-menu-by-longpress>
  265. </image>
  266. </view>
  267. <view class="rule_info">
  268. <view class="">报单规则:</view>
  269. <view class="">1、预约报单需要添加客服人员</view>
  270. <view class="">2、添加完客服人员后填写小程序当前登录手机号以绑定账号</view>
  271. <view class="">3、开始预约报单</view>
  272. </view>
  273. </view>
  274. </uni-popup>
  275. <uni-popup ref="regiment" type="bottom" class="popup" background-color="#FFFFFF">
  276. <view class="popup_title">可参与的拼单</view>
  277. <view class="regiment_popup_list">
  278. <view class="regiment_popup_item" v-for="(item,index) in productInfo.regiment_list"
  279. @click="checkedCoupon(index,false)" :key="index">
  280. <view class="username">
  281. <image class="user_image" :src="item.userpic"></image>
  282. <text class="username_text">{{item.username}}</text>
  283. </view>
  284. <view class="regiment_right">
  285. <button class="regiment_but" data-eventsync="true"
  286. @click="showSpecPopup(4,item.id)">去拼单</button>
  287. </view>
  288. <view class="regiment_center">
  289. <view class="regiment_center_text">还差{{item.surplus_number}}人成团</view>
  290. <view class="regiment_center_time">
  291. <view class="center_title">还剩</view>
  292. <uni-countdown color="#E03519" :show-day="false" :hour="remainder(item.end_time,1)"
  293. :minute="remainder(item.end_time,2)"
  294. :second="remainder(item.end_time,3)"></uni-countdown>
  295. </view>
  296. </view>
  297. </view>
  298. </view>
  299. </uni-popup>
  300. </view>
  301. </template>
  302. <script>
  303. export default {
  304. data() {
  305. return {
  306. show: false, // 使用Popup组件时,阻止禁止滚动穿透
  307. productInfo: {
  308. id: 0,
  309. name: "",
  310. price: "0.00",
  311. market_price: "0.00",
  312. spec: "",
  313. stock: 0,
  314. thumb: "",
  315. poster: "",
  316. description: "",
  317. regiment_title: '',
  318. promo_title: '',
  319. automatic_info: {
  320. end_time: '',
  321. },
  322. regiment_active: [],
  323. business_info: {
  324. name: "",
  325. logopic: "",
  326. desc: "",
  327. },
  328. regiment_price: "0.00",
  329. regiment_quota: 0,
  330. regiment_list: [],
  331. product_attr: [],
  332. photo_list: [],
  333. product_sku: [],
  334. regiment_type: 0,
  335. regiment_number: 0,
  336. },
  337. requestParam: {
  338. id: 0,
  339. },
  340. // 数量
  341. quantity: 1,
  342. // 总价
  343. priceTotal: "0.00",
  344. // 优惠券列表
  345. couponList: [],
  346. // 总价
  347. priceTotal: '0.00',
  348. // 优惠券使用
  349. couponUsed: "去使用 >",
  350. // 扣减金额
  351. rebatePrice: 0.00,
  352. // 已经选择的优惠券ID
  353. customCoupon: 0,
  354. // 规格选择按钮类型
  355. specBtnType: 1, // 1预约。2购物车。3拼团
  356. // 地址列表
  357. addrList: [],
  358. // 已选地址
  359. checkedAddr: {
  360. id: 0,
  361. contact_name: "",
  362. contact_shop: "",
  363. contact_phone: "",
  364. contact_province: "",
  365. contact_city: "",
  366. contact_area: "",
  367. contact_addr: "",
  368. is_default: 0,
  369. show_type: 0
  370. },
  371. // 客服二维码
  372. followQrcode: "",
  373. // 二维码链接
  374. follow_linkurl: "",
  375. // 是否登录状态
  376. isShowPrice: false,
  377. // 选择的skuid
  378. sku_id: 0,
  379. sku_thumb: "",
  380. regiment_id: 0,
  381. specBtnType:0,
  382. }
  383. },
  384. onLoad(param) {
  385. // 接受路由参数,产品ID
  386. this.requestParam.id = param.product_id;
  387. // 如果有scene参数的话,获取其中的ID
  388. if( param.scene ) {
  389. // 转键值对参数
  390. let scene = this.$http.strToParam(param.scene);
  391. // 如果没有传入ID,但是传入了场景ID,获取场景ID
  392. if( !param.product_id && scene.id ) this.requestParam.id = scene.id;
  393. }
  394. var that = this;
  395. // 监听地址变动
  396. uni.$on('addr_list_change', function(data) {
  397. // 地址列表
  398. that.addrList = data.list;
  399. });
  400. // #ifdef MP-WEIXIN
  401. //分享按钮
  402. uni.showShareMenu({
  403. withShareTicket: true,
  404. menus: ['shareAppMessage', 'shareTimeline']
  405. })
  406. // #endif
  407. },
  408. onShareAppMessage(obj) {
  409. return {
  410. title: this.productInfo.name,
  411. path: '/pages/product/index?product_id=' + this.productInfo.id
  412. }
  413. },
  414. onShow() {
  415. // 没有添加客服就不显示
  416. this.isShowPrice = this.$checkAccess.checkShowPrice();
  417. // 如果有添加二维码的话,获取客户信息
  418. if (this.$checkAccess.getFollowQrcode()) {
  419. // 判断数据
  420. this.$http.request('api/custom/get_info').then((callback) => {
  421. if (callback.code == 'success') {
  422. if (!callback.data.userpic) callback.data.userpic = "../../static/icon/doctor.png";
  423. // 存储登录标识
  424. uni.setStorageSync('userInfo', callback.data);
  425. }
  426. });
  427. }
  428. // 如果存在产品ID的话
  429. if (this.requestParam.id > 0) {
  430. // 请求详情
  431. this.$http.request('api/product/get_detail', this.requestParam).then((re) => {
  432. // 成功渲染数据
  433. if (re.code == 'success') {
  434. // 刷新数据
  435. this.productInfo = re.data;
  436. if (this.productInfo.automatic_info.id) {
  437. this.regiment_id = this.productInfo.automatic_info.id
  438. }
  439. //设置默认sku
  440. this.sku_id = 0;
  441. // 显示图片
  442. this.sku_thumb = this.productInfo.thumb;
  443. } else {
  444. if (re.code != 'no_login') {
  445. uni.showModal({
  446. content: re.msg,
  447. showCancel: false,
  448. })
  449. }
  450. }
  451. });
  452. }
  453. },
  454. methods: {
  455. //计算剩余时间
  456. remainder(end_time, type) {
  457. const now = Math.floor(Date.now() / 1000);
  458. const distance = end_time - now;
  459. if (distance < 0) {
  460. return 0
  461. }
  462. const hours = Math.floor(distance / (60 * 60));
  463. const minutes = Math.floor((distance % (60 * 60)) / (60));
  464. const seconds = Math.floor((distance % (60)));
  465. if (type === 1) {
  466. return hours
  467. }
  468. if (type === 2) {
  469. return minutes
  470. }
  471. if (type === 3) {
  472. return seconds
  473. }
  474. },
  475. // 地址弹出层
  476. showAddrPopup() {
  477. // 显示下单弹出层
  478. this.$refs.addrPopup.open('bottom');
  479. },
  480. // 规格弹出层
  481. showSpecPopup(type, regiment_id = 0) {
  482. // 登录提示
  483. if (!this.$checkAccess.alterLogin()) return;
  484. // 判断是否弹出
  485. if (this.$checkAccess.getFollowQrcode()) return this.openAddFollow();
  486. if (regiment_id) {
  487. this.regiment_id = regiment_id
  488. }
  489. // 显示类型,1预约,2购物车,3拼团
  490. this.specBtnType = type;
  491. // 恢复优惠券使用按钮
  492. this.couponUsed = "去使用 >";
  493. // 恢复扣减金额
  494. this.rebatePrice = 0.00;
  495. // 选择优惠券重置
  496. this.customCoupon = 0;
  497. // 计算价格
  498. this.priceHandler();
  499. // 显示下单弹出层
  500. this.$refs.specPopup.open('bottom');
  501. // 结果
  502. this.$http.request('api/custom_coupon/get_checked', this.requestParam).then((re) => {
  503. if (re.code == 'success') {
  504. // 赋值
  505. this.couponList = re.data;
  506. // 优惠券是否可用
  507. this.checkCoupon();
  508. }
  509. });
  510. // 地址列表
  511. this.getAddrList();
  512. //只有一组sku时是否下架
  513. if (this.productInfo.product_sku.length === 1) {
  514. this.defaultSkuStatus();
  515. }
  516. },
  517. // 拼团列表弹出层
  518. openRegiment() {
  519. this.$refs.regiment.open('bottom')
  520. },
  521. // 优惠券弹出层
  522. openCoupon() {
  523. this.$refs.couponPopup.open('bottom')
  524. },
  525. // 数量调整
  526. changeQuantity(number) {
  527. // 如果不是0.表示两侧按钮点击,0表示输入的修改
  528. if (number != 0) {
  529. // 计算个数
  530. this.quantity = parseInt(this.quantity) + parseInt(number);
  531. }
  532. // 如果大于库存设置为库存
  533. if (this.quantity > this.productInfo.stock) {
  534. this.quantity = this.productInfo.stock;
  535. uni.showToast({
  536. title: "库存不足",
  537. icon: "none"
  538. })
  539. }
  540. if ((this.specBtnType === 3 || this.specBtnType == 4) && this.quantity > this.productInfo.regiment_quota) {
  541. this.quantity = this.productInfo.regiment_quota;
  542. uni.showToast({
  543. title: "拼团限购" + this.productInfo.regiment_quota + "份",
  544. icon: "none"
  545. })
  546. }
  547. // 如果小于1.设置为1
  548. if (this.quantity < 1) {
  549. this.quantity = 1;
  550. uni.showToast({
  551. title: "数量不可以小于0",
  552. icon: "none"
  553. })
  554. }
  555. // 计算价格
  556. this.priceHandler();
  557. // 优惠券是否可用
  558. this.checkCoupon();
  559. },
  560. // 创建订单
  561. createOrder() {
  562. // 不可预约
  563. if (!this.$checkAccess.alertCity()) return;
  564. // 如果有SKU,但是没有选择
  565. if (this.productInfo.product_sku.length && !this.sku_id) {
  566. // 选择提示
  567. let skuname = [];
  568. // 循环产品属性
  569. for ( let i in this.productInfo.product_attr) {
  570. // 属性名称
  571. skuname.push(this.productInfo.product_attr[i].spec_name);
  572. }
  573. uni.showToast({
  574. title: "请选择"+skuname.join(' 与 '),
  575. icon: "none"
  576. })
  577. return;
  578. }
  579. // 下单数量小于0
  580. if (this.quantity < 1) {
  581. uni.showToast({
  582. title: "至少购买1个",
  583. icon: "none"
  584. })
  585. return;
  586. }
  587. // 如果大于库存设置为库存
  588. if (this.productInfo.stock < 1) {
  589. uni.showToast({
  590. title: "库存不足",
  591. icon: "none"
  592. })
  593. return;
  594. }
  595. // 如果大于库存设置为库存
  596. if (this.productInfo.stock < this.quantity) {
  597. this.quantity = this.productInfo.stock;
  598. uni.showToast({
  599. title: "库存不足",
  600. icon: "none"
  601. })
  602. return;
  603. }
  604. if (this.specBtnType === 3 || this.specBtnType === 4) {
  605. if (this.quantity > this.productInfo.regiment_quota) {
  606. this.quantity = this.productInfo.regiment_quota;
  607. uni.showToast({
  608. title: "拼团限购" + this.productInfo.regiment_quota + "份",
  609. icon: "none"
  610. })
  611. return;
  612. }
  613. const timestamp = Math.round(new Date().getTime() / 1000).toString();
  614. if (timestamp > this.productInfo.regiment_active.end_time) {
  615. uni.showToast({
  616. title: "拼团活动已结束",
  617. icon: "none"
  618. })
  619. return;
  620. }
  621. if (this.specBtnType === 4 && timestamp > this.productInfo.automatic_info.end_time) {
  622. uni.showToast({
  623. title: "该团已过期",
  624. icon: "none"
  625. })
  626. return;
  627. }
  628. }
  629. // 地址未填
  630. if (!this.checkedAddr.id) {
  631. this.showAddrPopup();
  632. return;
  633. }
  634. //需要下单的产品信息参数传给completion页面
  635. let productInfo = [{
  636. name: this.productInfo.name,
  637. spec: this.productInfo.spec,
  638. price: this.productInfo.price
  639. }]
  640. //转成json字符串
  641. productInfo = JSON.stringify(productInfo);
  642. //加密json格式成编码数组
  643. let encodedArray = encodeURIComponent(productInfo);
  644. // 需要下单的产品列表
  645. let productList = [{
  646. product_id: this.productInfo.id,
  647. buy_num: this.quantity,
  648. product_skuid: this.sku_id
  649. }];
  650. // 转成json字符串传输
  651. productList = JSON.stringify(productList);
  652. if (this.specBtnType === 3 || this.specBtnType === 4) { //拼团
  653. // 请求接口
  654. this.$http.request('api/orders/create_regiment', {
  655. "product_list": productList,
  656. "custom_coupon_id": this.customCoupon,
  657. 'addr_id': this.checkedAddr.id,
  658. 'btn_type': this.specBtnType,
  659. 'regiment_id': this.regiment_id,
  660. 'regiment_active_id': this.productInfo.regiment_active_id
  661. }, 'post').then((re) => {
  662. // 判断结果
  663. if (re.code == 'success') {
  664. // 处理结果
  665. this.productInfo.stock = this.productInfo.stock - this.quantity;
  666. // 关闭弹窗
  667. this.$refs.specPopup.close();
  668. // 跳转到报单完成页面
  669. uni.navigateTo({
  670. url: `/pages/orders/completion?params=${encodedArray}`
  671. });
  672. } else {
  673. uni.showModal({
  674. title: re.msg,
  675. showCancel: false
  676. });
  677. }
  678. });
  679. } else {
  680. // 请求接口
  681. this.$http.request('api/orders/create', {
  682. "product_list": productList,
  683. "custom_coupon_id": this.customCoupon,
  684. 'addr_id': this.checkedAddr.id
  685. }, 'post').then((re) => {
  686. // 判断结果
  687. if (re.code == 'success') {
  688. // 处理结果
  689. this.productInfo.stock = this.productInfo.stock - this.quantity;
  690. // 关闭弹窗
  691. this.$refs.specPopup.close();
  692. // 跳转到报单完成页面
  693. uni.navigateTo({
  694. url: `/pages/orders/completion?params=${encodedArray}`
  695. });
  696. } else {
  697. uni.showModal({
  698. title: re.msg,
  699. showCancel: false
  700. });
  701. }
  702. });
  703. }
  704. },
  705. // 加入购物车
  706. createCart() {
  707. // 不可预约
  708. if (!this.$checkAccess.alertCity()) return;
  709. // 如果有SKU,但是没有选择
  710. if (this.productInfo.product_sku.length && !this.sku_id) {
  711. // 选择提示
  712. let skuname = [];
  713. // 循环产品属性
  714. for (let i in this.productInfo.product_attr) {
  715. // 属性名称
  716. skuname.push(this.productInfo.product_attr[i].spec_name);
  717. }
  718. uni.showToast({
  719. title: "请选择"+skuname.join(' 与 '),
  720. icon: "none"
  721. })
  722. return;
  723. }
  724. // 下单数量小于0
  725. if (this.quantity < 1) {
  726. uni.showToast({
  727. title: "至少购买1个"
  728. })
  729. return;
  730. }
  731. // 如果库存不足
  732. if (this.productInfo.stock < 1) {
  733. uni.showToast({
  734. title: "库存不足",
  735. icon: "none"
  736. })
  737. return;
  738. }
  739. // 如果大于库存设置为库存
  740. if (this.productInfo.stock < this.quantity) {
  741. this.quantity = this.productInfo.stock;
  742. uni.showToast({
  743. title: "库存不足",
  744. icon: "none"
  745. })
  746. return;
  747. }
  748. // 商品信息
  749. let data = {
  750. product_id: this.productInfo.id,
  751. buy_num: this.quantity,
  752. skuid: this.sku_id
  753. };
  754. // 请求接口
  755. this.$http.request('api/shop_cart/add', data, 'post').then((re) => {
  756. // 判断结果
  757. if (re.code == 'success') {
  758. // 跳转到订单列表
  759. uni.showToast({
  760. icon: "success",
  761. title: "加入购物车成功"
  762. })
  763. // 关闭结果
  764. this.$refs.specPopup.close();
  765. } else {
  766. // 跳转到订单列表
  767. uni.showToast({
  768. icon: "error",
  769. title: "加入购物车失败"
  770. })
  771. }
  772. });
  773. },
  774. // 检查优惠券是否可用
  775. checkCoupon() {
  776. // 如果存在的话
  777. if (this.couponList.length) {
  778. // 推荐使用的优惠券
  779. let oldrebatePrice = 0.00;
  780. let hasIsStd = false;
  781. // 循环优惠券
  782. for (let i in this.couponList) {
  783. /* 商品的总价格,决定是否可用 */
  784. let totalPrice = 0.00;
  785. // 如果是商品券
  786. if (this.couponList[i].type_id == 1) {
  787. // 判断商品是不是在商品范围
  788. let isScope = false;
  789. // 循环商品范围
  790. for (let k in this.couponList[i].product_scope) {
  791. // 如果存在商品范围
  792. if (this.couponList[i].product_scope[k].product_id == this.productInfo.id) isScope = true;
  793. }
  794. // 范围内的做计算
  795. if (isScope) totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.productInfo
  796. .price, this.quantity));
  797. // 是否在可用范围
  798. this.couponList[i].is_scope = isScope;
  799. // 排除券
  800. } else if (this.couponList[i].type_id == 3) {
  801. // 判断商品是不是在商品范围
  802. let isScope = true;
  803. // 循环排除范围
  804. for (let k in this.couponList[i].product_exclude) {
  805. // 如果在排除范围
  806. if (this.couponList[i].product_exclude[k].product_id == this.productInfo.id) isScope =
  807. false;
  808. }
  809. // 范围内的做计算
  810. if (isScope) totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.productInfo
  811. .price, this.quantity));
  812. // 是否在可用范围
  813. this.couponList[i].is_scope = isScope;
  814. // 店铺券
  815. } else {
  816. // 店铺券
  817. totalPrice = this.$decimal.add(totalPrice, this.$decimal.mul(this.productInfo.price, this
  818. .quantity));
  819. // 是否在可用范围
  820. this.couponList[i].is_scope = true;
  821. }
  822. // 判断价格到不到限额
  823. this.couponList[i].is_std = parseFloat(totalPrice.toFixed()) >= parseFloat(this.$decimal.mul(this
  824. .couponList[i].std_pay, 1).toFixed());
  825. // 如果不可用的话,该项已选择则不选
  826. if (!this.couponList[i].is_std && this.couponList[i].checked) this.checkedCoupon(i, false);
  827. // 如果可用的话,并且优惠券没有选中
  828. if (this.couponList[i].is_std) {
  829. // 优惠金额
  830. let newRebatePrice = 0.00;
  831. // 计算满减价格
  832. if (this.couponList[i].rebate_type == 1) {
  833. // 计算扣减数据
  834. newRebatePrice = this.$decimal.mul(this.couponList[i].rebate, 1);
  835. }
  836. // 计算折扣价格
  837. if (this.couponList[i].rebate_type == 2) {
  838. // 折扣
  839. newRebatePrice = this.$decimal.mul(totalPrice, this.couponList[i].rebate);
  840. // 减数
  841. newRebatePrice = this.$decimal.sub(totalPrice, newRebatePrice.mul(0.1));
  842. }
  843. // 判断哪个比较优惠
  844. if (parseFloat(oldrebatePrice.toFixed(2)) <= parseFloat(newRebatePrice.toFixed(2))) {
  845. // 覆盖价格
  846. oldrebatePrice = parseFloat(newRebatePrice.toFixed(2));
  847. // 如果选中的是自己,不需要取消
  848. if (this.customCoupon == this.couponList[i].id && this.couponList[i].checked) {
  849. // 选中
  850. this.checkedCoupon(i, true);
  851. } else {
  852. // 选中
  853. this.checkedCoupon(i, false);
  854. }
  855. }
  856. }
  857. }
  858. }
  859. },
  860. // 选择优惠券
  861. checkedCoupon(index, save_checked = false) {
  862. // 单个设置选中/未选(如果保持选中,则不变)
  863. this.couponList[index].checked = save_checked ? this.couponList[index].checked : (this.couponList[index]
  864. .checked ? 0 : 1);
  865. // 循环处理
  866. for (let i in this.couponList) {
  867. // 有未选的就不做全选
  868. if (index != i) this.couponList[i].checked = 0;
  869. }
  870. // 如果未选中,提示可用
  871. if (!this.couponList[index].checked) this.couponUsed = '去使用 >';
  872. // 已经选择的优惠券ID
  873. this.customCoupon = this.couponList[index].checked ? this.couponList[index].id : 0;
  874. // 计算扣减
  875. this.couponRebate();
  876. // 计算价格
  877. this.priceHandler();
  878. // 关闭弹窗
  879. this.$refs.couponPopup.close();
  880. },
  881. // 计算价格
  882. priceHandler() {
  883. // 总价格
  884. let priceTotal = 0
  885. if (this.specBtnType == 3) {
  886. priceTotal = this.$decimal.mul(this.productInfo.regiment_price, this.quantity);
  887. } else {
  888. priceTotal = this.$decimal.mul(this.productInfo.price, this.quantity);
  889. }
  890. // 扣减数据
  891. priceTotal = priceTotal.sub(this.rebatePrice);
  892. // 小数点保留
  893. this.priceTotal = priceTotal.toFixed(2);
  894. },
  895. // 计算优惠券扣减
  896. couponRebate() {
  897. // 默认扣减0
  898. this.rebatePrice = 0;
  899. // 循环优惠券
  900. for (let i in this.couponList) {
  901. // 判断是否选中
  902. if (this.couponList[i].id != this.customCoupon) {
  903. // 未选择的不管
  904. continue;
  905. }
  906. /* 商品的总价格,决定是否可用 */
  907. var totalPrice = 0.00;
  908. // 如果是商品券
  909. if (this.couponList[i].type_id == 1) {
  910. // 判断商品是不是在商品范围
  911. var isScope = false;
  912. // 循环商品范围
  913. for (let k in this.couponList[i].product_scope) {
  914. // 如果存在商品范围
  915. if (this.couponList[i].product_scope[k].product_id == this.productInfo.id) isScope = true;
  916. }
  917. // 范围内的做计算
  918. if (isScope) totalPrice = this.$decimal.mul(this.productInfo.price, this.quantity);
  919. // 排除券
  920. } else if (this.couponList[i].type_id == 3) {
  921. // 判断商品是不是在商品范围
  922. var isScope = true;
  923. // 循环排除范围
  924. for (let k in this.couponList[i].product_exclude) {
  925. // 如果存在排除范围
  926. if (this.couponList[i].product_exclude[k].product_id == this.productInfo.id) isScope = false;
  927. }
  928. // 范围内的做计算
  929. if (isScope) totalPrice = this.$decimal.mul(this.productInfo.price, this.quantity);
  930. // 店铺券
  931. } else {
  932. // 折扣券以及满减券的话,计算价格
  933. totalPrice = this.$decimal.mul(this.productInfo.price, this.quantity);
  934. }
  935. // 如果是可以用的话
  936. if (parseFloat(totalPrice.toFixed()) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay, 1)
  937. .toFixed())) {
  938. // 扣减金额
  939. let rebatePrice = this.$decimal.mul(1, 0);
  940. // 满减
  941. if (this.couponList[i].rebate_type == 1) {
  942. // 计算扣减数据
  943. rebatePrice = this.$decimal.mul(this.couponList[i].rebate, 1);
  944. // 替换文字
  945. this.couponUsed = "¥-" + rebatePrice.toFixed(2);
  946. }
  947. // 折扣
  948. if (this.couponList[i].rebate_type == 2) {
  949. // 折扣
  950. rebatePrice = this.$decimal.mul(totalPrice, this.couponList[i].rebate);
  951. // 减数
  952. rebatePrice = this.$decimal.sub(totalPrice, rebatePrice.mul(0.1));
  953. // 替换文字
  954. this.couponUsed = "¥-" + rebatePrice.toFixed(2);
  955. }
  956. // 赠品
  957. if (this.couponList[i].rebate_type == 3) {
  958. // 替换文字
  959. this.couponUsed = "送" + (this.couponList[i].rebate_scope.length ? this.couponList[i]
  960. .rebate_scope[0].product_name : "");
  961. }
  962. // 小数点保留
  963. this.rebatePrice = rebatePrice.toFixed(2);
  964. }
  965. }
  966. },
  967. popupChange(e) {
  968. // 禁止滚动穿透
  969. this.show = e.show
  970. },
  971. // 选择地址
  972. checkedAddrItem(item) {
  973. this.checkedAddr = item;
  974. this.$refs.addrPopup.close();
  975. },
  976. getAddrList() {
  977. // 判断数据
  978. this.$http.request('api/custom_addr/get_list').then((callback) => {
  979. // 获取成功
  980. if (callback.code == 'success') {
  981. this.addrList = callback.data;
  982. // 如果有的话
  983. if (this.addrList.length) {
  984. // 获取默认的
  985. for (let i in this.addrList) {
  986. // 如果是默认的
  987. if (this.addrList[i].is_default) this.checkedAddr = this.addrList[i];
  988. }
  989. // 如果没有默认的话
  990. if (!this.checkedAddr.id) {
  991. this.checkedAddr = this.addrList[this.addrList.length - 1];
  992. }
  993. }
  994. }
  995. });
  996. },
  997. // 客服显示
  998. openAddFollow() {
  999. // 返回结果
  1000. this.followQrcode = this.$checkAccess.getFollowQrcode();
  1001. // 返回结果
  1002. this.follow_linkurl = this.$checkAccess.getFollowLinkUrl();
  1003. // 有图才展示
  1004. if (this.followQrcode) this.$refs.addFollow.open('center');
  1005. },
  1006. closeAddFollow() {
  1007. this.$refs.addFollow.close();
  1008. },
  1009. // 属性变更
  1010. attrChange(spec_index, attr_index) {
  1011. // 判断当前属性是否选择。选择的跳过
  1012. if (this.productInfo.product_attr[spec_index].attr_list[attr_index].active) return;
  1013. // 先记录当前规格下所有属性原来的active状态
  1014. let originalActiveStates = {};
  1015. for (let i in this.productInfo.product_attr[spec_index].attr_list) {
  1016. originalActiveStates[i] = this.productInfo.product_attr[spec_index].attr_list[i].active;
  1017. }
  1018. //循环规格下的属性
  1019. for (let i in this.productInfo.product_attr[spec_index].attr_list) {
  1020. // 全部改为未选中
  1021. this.productInfo.product_attr[spec_index].attr_list[i].active = 0;
  1022. }
  1023. //选择选项
  1024. this.productInfo.product_attr[spec_index].attr_list[attr_index].active = 1;
  1025. //选中的规格
  1026. var attr_ids = [];
  1027. // 循环规格
  1028. for (let i in this.productInfo.product_attr) {
  1029. // 再循环属性
  1030. for (let j in this.productInfo.product_attr[i].attr_list) {
  1031. // 如果选中的
  1032. if (this.productInfo.product_attr[i].attr_list[j].active) {
  1033. attr_ids.push(this.productInfo.product_attr[i].attr_list[j].id);
  1034. }
  1035. }
  1036. }
  1037. // 转成字符串
  1038. var attrids = attr_ids.join(",");
  1039. // 如果选项不足的话
  1040. if (attr_ids.length != this.productInfo.product_attr.length) return;
  1041. // 如果当前点击的属性对应的SKU状态为未下架(初始化为0)
  1042. let currentSKUStatus = 0;
  1043. // 匹配规格
  1044. if (this.productInfo.product_sku.length) {
  1045. // 是否有对应的SKU
  1046. let haveSku = 0;
  1047. // 循环sku
  1048. for (let i in this.productInfo.product_sku) {
  1049. // 如果sku不匹配
  1050. if (this.productInfo.product_sku[i].attr_ids != attrids) continue;
  1051. // 设置有SKU
  1052. haveSku = 1;
  1053. // 获取当前匹配到的SKU的状态
  1054. currentSKUStatus = this.productInfo.product_sku[i].status;
  1055. // 如果商品已经下架(status等于1),则恢复当前规格下所有属性原来的active状态
  1056. if (currentSKUStatus === 1) {
  1057. uni.showToast({
  1058. title: "该规格已下架",
  1059. icon: "none"
  1060. });
  1061. for (let k in originalActiveStates) {
  1062. this.productInfo.product_attr[spec_index].attr_list[k].active = originalActiveStates[k];
  1063. }
  1064. continue;
  1065. }
  1066. // 如果商品没有库存
  1067. if (this.productInfo.product_sku[i].stock <= 0) {
  1068. uni.showToast({
  1069. title: "该规格库存不足",
  1070. icon: "none"
  1071. });
  1072. for (let k in originalActiveStates) {
  1073. this.productInfo.product_attr[spec_index].attr_list[k].active = originalActiveStates[k];
  1074. }
  1075. continue;
  1076. }
  1077. // 产品价格修改
  1078. this.productInfo.price = this.productInfo.product_sku[i].price;
  1079. // 产品规格修改
  1080. this.productInfo.spec = this.productInfo.product_sku[i].attr_names;
  1081. // 产品库存
  1082. this.productInfo.stock = this.productInfo.product_sku[i].stock;
  1083. // 产品SKU
  1084. this.sku_id = this.productInfo.product_sku[i].id;
  1085. // 有图替换,没图使用产品原缩略图
  1086. this.sku_thumb = this.productInfo.product_sku[i].sku_thumb ? this.productInfo.product_sku[i]
  1087. .sku_thumb : this.productInfo.thumb;
  1088. // 如果有图册
  1089. if (this.productInfo.photo_list.length) {
  1090. this.productInfo.photo_list[0].thumb = this.sku_thumb;
  1091. }
  1092. // 计算价格
  1093. this.priceHandler();
  1094. // 优惠券是否可用
  1095. this.checkCoupon();
  1096. }
  1097. // 如果没有对应的SKU
  1098. if (!haveSku) {
  1099. uni.showToast({
  1100. title: "该规格已下架",
  1101. icon: "none"
  1102. });
  1103. for (let k in originalActiveStates) {
  1104. this.productInfo.product_attr[spec_index].attr_list[k].active = originalActiveStates[k];
  1105. }
  1106. }
  1107. }
  1108. },
  1109. //只有一组sku默认规格是否已下架
  1110. defaultSkuStatus() {
  1111. if (this.productInfo.product_sku.length) {
  1112. if (this.productInfo.product_sku[0].status === 1) {
  1113. uni.showToast({
  1114. title: "该规格已下架",
  1115. icon: "none",
  1116. });
  1117. this.productInfo.stock = 0;
  1118. var attr_ids = this.productInfo.product_sku[0].attr_ids.split(",");
  1119. // 循环规格列表
  1120. for (let i in this.productInfo.product_attr) {
  1121. // 再循环属性
  1122. for (let j in this.productInfo.product_attr[i].attr_list) {
  1123. // 如果不等于id
  1124. if (attr_ids.includes(this.productInfo.product_attr[i].attr_list[j].id + '')) {
  1125. // 取消选中
  1126. this.productInfo.product_attr[i].attr_list[j].active = 0;
  1127. }
  1128. }
  1129. }
  1130. return;
  1131. }
  1132. }
  1133. },
  1134. // 去往webview
  1135. followLinkurl() {
  1136. // 获取登录标识
  1137. let userInfo = uni.getStorageSync('userInfo');
  1138. // 如果不存在的话
  1139. if (!userInfo) return '';
  1140. // 未添加好友
  1141. if (!userInfo.follow_linkurl) return '';
  1142. // 获取Url
  1143. let url = userInfo.follow_linkurl;
  1144. // 没有路径,不跳转
  1145. if (!url) return;
  1146. // 判断是不是小程序链接
  1147. if (url.includes('http')) {
  1148. // 转码
  1149. let link_url = encodeURIComponent(url);
  1150. // 跳转到webview
  1151. uni.redirectTo({
  1152. url: `/pages/webview/index?link_url=${link_url}`
  1153. })
  1154. } else {
  1155. // 跳转到webview
  1156. uni.navigateTo({
  1157. url: url
  1158. });
  1159. }
  1160. }
  1161. }
  1162. }
  1163. </script>
  1164. <style lang="less">
  1165. .product_image_box {
  1166. display: block;
  1167. overflow: hidden;
  1168. background: #FFFFFF;
  1169. margin: 10rpx auto;
  1170. .product_image {
  1171. display: block;
  1172. margin: 0 auto;
  1173. width: 750rpx;
  1174. height: 750rpx;
  1175. }
  1176. .photo_list {
  1177. display: block;
  1178. width: 750rpx;
  1179. height: 750rpx;
  1180. line-height: 750rpx;
  1181. text-align: center;
  1182. .photo_image {
  1183. width: 750rpx;
  1184. height: 750rpx;
  1185. }
  1186. }
  1187. }
  1188. .product_info {
  1189. display: block;
  1190. background: #FFFFFF;
  1191. margin: 10rpx 0rpx;
  1192. padding: 10px 10px;
  1193. .product_name {
  1194. max-height: 80rpx;
  1195. font-size: 30rpx;
  1196. line-height: 40rpx;
  1197. overflow: hidden;
  1198. padding: 10rpx 0rpx;
  1199. .regiment_title {
  1200. background-color: red;
  1201. color: #F9F9F9;
  1202. }
  1203. }
  1204. .product_spec {
  1205. color: #999999;
  1206. font-size: 24rpx;
  1207. line-height: 30rpx;
  1208. overflow: hidden;
  1209. .spec_name {
  1210. float: left;
  1211. }
  1212. .product_stock {
  1213. float: right;
  1214. }
  1215. }
  1216. .stock_price {
  1217. font-size: 20rpx;
  1218. overflow: hidden;
  1219. margin-top: 10rpx;
  1220. line-height: 30rpx;
  1221. .product_price {
  1222. float: left;
  1223. color: red;
  1224. font-size: 38rpx;
  1225. line-height: 60rpx;
  1226. .product_market {
  1227. font-size: 24rpx;
  1228. color: #999999;
  1229. line-height: 30rpx;
  1230. margin-left: 10rpx;
  1231. text-decoration: line-through;
  1232. }
  1233. }
  1234. }
  1235. }
  1236. // 描述简介
  1237. .product_business {
  1238. display: block;
  1239. overflow: hidden;
  1240. padding: 20rpx 20rpx;
  1241. margin: 10rpx auto;
  1242. background: #FFFFFF;
  1243. .logopic {
  1244. float: left;
  1245. width: 80rpx;
  1246. height: 80rpx;
  1247. border-radius: 50%;
  1248. margin-right: 20rpx;
  1249. }
  1250. .business_info {
  1251. float: left;
  1252. width: 600rpx;
  1253. overflow: hidden;
  1254. .business_name {
  1255. font-size: 26rpx;
  1256. line-height: 40rpx;
  1257. }
  1258. .business_desc {
  1259. color: #999999;
  1260. font-size: 24rpx;
  1261. line-height: 40rpx;
  1262. }
  1263. }
  1264. }
  1265. .product_description {
  1266. width: 700rpx;
  1267. display: block;
  1268. overflow: hidden;
  1269. background: #FFFFFF;
  1270. min-height: 600rpx;
  1271. font-size: 26rpx;
  1272. margin: 0rpx auto;
  1273. line-height: 50rpx;
  1274. padding: 10rpx 25rpx;
  1275. [alt] {
  1276. //web_view图片
  1277. max-width: 100%; // 避免图片超宽
  1278. vertical-align: bottom; // 避免图片之间间隙
  1279. }
  1280. }
  1281. .product_poster {
  1282. display: block;
  1283. overflow: hidden;
  1284. padding: 10rpx 0rpx;
  1285. margin: 10rpx auto;
  1286. background: #FFFFFF;
  1287. .product_image {
  1288. width: 750rpx;
  1289. display: block;
  1290. }
  1291. }
  1292. .order_car {
  1293. left: 0rpx;
  1294. width: 750rpx;
  1295. height: 140rpx;
  1296. display: block;
  1297. position: fixed;
  1298. padding-top: 20rpx;
  1299. background: #FFFFFF;
  1300. bottom: var(--window-bottom);
  1301. border-top: 2rpx solid #DDDDDD;
  1302. .show_order {
  1303. float: right;
  1304. width: 280rpx;
  1305. height: 80rpx;
  1306. display: block;
  1307. color: #FFFFFF;
  1308. font-size: 30rpx;
  1309. overflow: hidden;
  1310. line-height: 80rpx;
  1311. padding: 0rpx 0rpx;
  1312. text-align: center;
  1313. margin-right: 35rpx;
  1314. background-color: #E03519;
  1315. border-radius: 0rpx;
  1316. border-top-right-radius: 20rpx;
  1317. border-bottom-right-radius: 20rpx;
  1318. }
  1319. .show_order_regiment {
  1320. float: right;
  1321. width: 280rpx;
  1322. height: 80rpx;
  1323. display: block;
  1324. color: #FFFFFF;
  1325. font-size: 25rpx;
  1326. overflow: hidden;
  1327. padding: 0rpx 0rpx;
  1328. text-align: center;
  1329. margin-right: 35rpx;
  1330. background-color: #E03519;
  1331. border-radius: 20rpx;
  1332. .regiment_countdown {
  1333. padding-left: 50rpx;
  1334. }
  1335. }
  1336. .show_car {
  1337. float: right;
  1338. width: 280rpx;
  1339. height: 80rpx;
  1340. display: block;
  1341. color: #FFFFFF;
  1342. font-size: 30rpx;
  1343. overflow: hidden;
  1344. line-height: 80rpx;
  1345. padding: 0rpx 0rpx;
  1346. text-align: center;
  1347. background-color: #F59A23;
  1348. border-radius: 0rpx;
  1349. border-top-left-radius: 20rpx;
  1350. border-bottom-left-radius: 20rpx;
  1351. }
  1352. .to_car {
  1353. float: left;
  1354. width: 100rpx;
  1355. height: 60rpx;
  1356. display: block;
  1357. text-align: center;
  1358. margin-left: 35rpx;
  1359. padding-top: 10rpx;
  1360. .car_icon {
  1361. float: left;
  1362. width: 60rpx;
  1363. height: 60rpx;
  1364. display: block;
  1365. }
  1366. }
  1367. }
  1368. .popup {
  1369. overflow: hidden;
  1370. .popup_title {
  1371. display: block;
  1372. overflow: hidden;
  1373. margin: 0rpx auto;
  1374. font-size: 36rpx;
  1375. height: 120rpx;
  1376. line-height: 120rpx;
  1377. padding: 0rpx 20rpx;
  1378. border-bottom: 10rpx solid #F8F8F8;
  1379. .to_addr_page {
  1380. float: right;
  1381. color: #F59A23;
  1382. display: block;
  1383. height: 120rpx;
  1384. line-height: 120rpx;
  1385. font-size: 26rpx;
  1386. padding: 0rpx 10rpx;
  1387. }
  1388. }
  1389. .order_info {
  1390. overflow: hidden;
  1391. background: #FFFFFF;
  1392. .custom_addr {
  1393. width: 680rpx;
  1394. display: block;
  1395. font-size: 24rpx;
  1396. overflow: hidden;
  1397. margin: 0rpx auto;
  1398. line-height: 40rpx;
  1399. padding: 20rpx 35rpx;
  1400. background-color: #FFFFFF;
  1401. border-bottom: 2rpx solid #dddddd;
  1402. .contact_user {
  1403. display: block;
  1404. font-size: 24rpx;
  1405. line-height: 50rpx;
  1406. .contact_none {
  1407. font-size: 26rpx;
  1408. font-weight: bold;
  1409. }
  1410. .contact_name {
  1411. font-size: 26rpx;
  1412. font-weight: bold;
  1413. margin-right: 16rpx;
  1414. }
  1415. .contact_shop {
  1416. float: right;
  1417. font-size: 26rpx;
  1418. margin-right: 16rpx;
  1419. }
  1420. .contact_more {
  1421. float: right;
  1422. font-size: 40rpx;
  1423. font-weight: bold;
  1424. }
  1425. }
  1426. .contact_addr {
  1427. width: 620rpx;
  1428. display: block;
  1429. font-size: 24rpx;
  1430. line-height: 30rpx;
  1431. padding: 10rpx 5rpx;
  1432. }
  1433. }
  1434. .car_item {
  1435. height: 200rpx;
  1436. display: block;
  1437. background: #FFFFFF;
  1438. margin: 20rpx auto;
  1439. .box_left {
  1440. float: left;
  1441. width: 160rpx;
  1442. height: 200rpx;
  1443. margin-left: 35rpx;
  1444. .car_image {
  1445. width: 160rpx;
  1446. height: 160rpx;
  1447. margin: 20rpx 0rpx;
  1448. border-radius: 5rpx;
  1449. }
  1450. }
  1451. .box_right {
  1452. float: left;
  1453. width: 485rpx;
  1454. margin-left: 35rpx;
  1455. padding-top: 20rpx;
  1456. .car_name {
  1457. max-height: 80rpx;
  1458. font-size: 30rpx;
  1459. line-height: 40rpx;
  1460. overflow: hidden;
  1461. padding: 0rpx 0rpx;
  1462. }
  1463. .promo_title{
  1464. max-height: 80rpx;
  1465. font-size: 20rpx;
  1466. line-height: 40rpx;
  1467. overflow: hidden;
  1468. padding: 0rpx 0rpx;
  1469. color: #dd524d;
  1470. }
  1471. .car_spec {
  1472. color: #999999;
  1473. font-size: 24rpx;
  1474. line-height: 30rpx;
  1475. padding: 0rpx 0rpx;
  1476. }
  1477. .stock_price {
  1478. width: 485rpx;
  1479. color: #dddddd;
  1480. font-size: 20rpx;
  1481. overflow: hidden;
  1482. margin-top: 10rpx;
  1483. line-height: 30rpx;
  1484. .product_price {
  1485. float: left;
  1486. color: red;
  1487. font-size: 30rpx;
  1488. line-height: 60rpx;
  1489. .car_market {
  1490. font-size: 24rpx;
  1491. color: #999999;
  1492. line-height: 30rpx;
  1493. vertical-align: middle;
  1494. text-decoration: line-through;
  1495. }
  1496. }
  1497. .product_quantity_box {
  1498. float: right;
  1499. color: #333333;
  1500. overflow: hidden;
  1501. font-size: 24rpx;
  1502. margin-top: 10rpx;
  1503. text-align: center;
  1504. .product_quantity_sub {
  1505. float: left;
  1506. border: none;
  1507. height: 36rpx;
  1508. background: none;
  1509. text-align: center;
  1510. line-height: 36rpx;
  1511. padding: 10rpx 10rpx;
  1512. .sub_icon {
  1513. width: 22rpx;
  1514. height: 22rpx;
  1515. display: block;
  1516. }
  1517. }
  1518. .product_quantity_sub::after {
  1519. border: none;
  1520. background: none;
  1521. }
  1522. .product_quantity {
  1523. float: left;
  1524. width: 100rpx;
  1525. height: 36rpx;
  1526. font-size: 24rpx;
  1527. min-height: 36rpx;
  1528. line-height: 36rpx;
  1529. padding: 0rpx 0rpx;
  1530. border-radius: 8rpx;
  1531. border: 2rpx solid #dddddd;
  1532. }
  1533. .product_quantity_add {
  1534. float: left;
  1535. border: none;
  1536. height: 36rpx;
  1537. background: none;
  1538. text-align: center;
  1539. padding: 10rpx 10rpx;
  1540. line-height: 36rpx;
  1541. .add_icon {
  1542. width: 22rpx;
  1543. height: 22rpx;
  1544. display: block;
  1545. }
  1546. }
  1547. .product_quantity_add::after {
  1548. border: none;
  1549. background: none;
  1550. }
  1551. }
  1552. }
  1553. .product_stock {
  1554. font-size: 20rpx;
  1555. line-height: 60rpx;
  1556. }
  1557. }
  1558. }
  1559. .select_sku {
  1560. font-size: 28rpx;
  1561. padding: 20rpx 35rpx;
  1562. margin-bottom: 10rpx;
  1563. .scroll_max {
  1564. height: 440rpx;
  1565. .product_attr {
  1566. display: block;
  1567. overflow: hidden;
  1568. margin-bottom: 20rpx;
  1569. .spec_name {
  1570. display: block;
  1571. height: 40rpx;
  1572. font-size: 28rpx;
  1573. line-height: 40rpx;
  1574. }
  1575. .arrt_list {
  1576. display: block;
  1577. overflow: hidden;
  1578. background-color: #F5F5F5;
  1579. .arrt_option {
  1580. float: left;
  1581. font-size: 28rpx;
  1582. line-height: 40rpx;
  1583. text-align: center;
  1584. border-radius: 6rpx;
  1585. padding: 10rpx 20rpx;
  1586. margin: 10rpx 0rpx;
  1587. margin-right: 20rpx;
  1588. background-color: #EEEEEE;
  1589. }
  1590. .arrt_option.active {
  1591. color: #FFFFFF;
  1592. background-color: #fE6000;
  1593. }
  1594. }
  1595. }
  1596. }
  1597. }
  1598. .to_select_coupon {
  1599. font-size: 28rpx;
  1600. padding: 10rpx 35rpx;
  1601. margin-bottom: 10rpx;
  1602. .coupon_deduction {
  1603. color: red;
  1604. float: right;
  1605. }
  1606. }
  1607. .order_price {
  1608. font-size: 28rpx;
  1609. text-align: right;
  1610. margin: 0rpx 35rpx;
  1611. padding: 10rpx 0rpx;
  1612. border-top: 2rpx solid #DDDDDD;
  1613. .coupon_deduction {
  1614. color: red;
  1615. float: right;
  1616. }
  1617. }
  1618. .order_btn {
  1619. width: 700rpx;
  1620. height: 100rpx;
  1621. display: block;
  1622. margin: 0 auto;
  1623. margin-top: 20rpx;
  1624. line-height: 80rpx;
  1625. text-align: center;
  1626. font-size: 30rpx;
  1627. .to_car {
  1628. color: #FFFFFF;
  1629. float: right;
  1630. width: 700rpx;
  1631. height: 80rpx;
  1632. display: block;
  1633. overflow: hidden;
  1634. font-size: 30rpx;
  1635. line-height: 80rpx;
  1636. padding: 0rpx 0rpx;
  1637. border-radius: 40rpx;
  1638. border: 0rpx solid transparent;
  1639. background-color: #F59A23;
  1640. }
  1641. .to_car::after {
  1642. border: 0rpx solid transparent;
  1643. }
  1644. .to_order {
  1645. color: #FFFFFF;
  1646. float: right;
  1647. width: 700rpx;
  1648. height: 80rpx;
  1649. display: block;
  1650. font-size: 30rpx;
  1651. overflow: hidden;
  1652. line-height: 80rpx;
  1653. padding: 0rpx 0rpx;
  1654. border-radius: 40rpx;
  1655. background-color: #E03519;
  1656. border: 0rpx solid transparent;
  1657. }
  1658. .to_order::after {
  1659. border: 0rpx solid transparent;
  1660. }
  1661. }
  1662. }
  1663. .coupon_list {
  1664. display: block;
  1665. overflow: hidden;
  1666. min-height: 600rpx;
  1667. margin: 10rpx auto;
  1668. background: #FFFFFF;
  1669. padding-bottom: 50rpx;
  1670. .coupon_item {
  1671. height: 200rpx;
  1672. display: block;
  1673. margin: 10rpx auto;
  1674. border-bottom: 2rpx solid #DDDDDD;
  1675. .box_left {
  1676. float: left;
  1677. width: 160rpx;
  1678. height: 160rpx;
  1679. font-size: 20rpx;
  1680. text-align: center;
  1681. margin-left: 35rpx;
  1682. line-height: 60rpx;
  1683. margin-top: 20rpx;
  1684. background: pink;
  1685. .rebate {
  1686. width: 120rpx;
  1687. height: 60rpx;
  1688. margin: 0rpx auto;
  1689. line-height: 60rpx;
  1690. margin-top: 20rpx;
  1691. overflow: hidden;
  1692. white-space: nowrap;
  1693. text-overflow: ellipsis;
  1694. }
  1695. }
  1696. .box_right {
  1697. float: left;
  1698. width: 485rpx;
  1699. margin-left: 35rpx;
  1700. padding-top: 20rpx;
  1701. .coupon_title {
  1702. width: 485rpx;
  1703. max-height: 80rpx;
  1704. font-size: 30rpx;
  1705. overflow: hidden;
  1706. line-height: 40rpx;
  1707. padding: 0rpx 0rpx;
  1708. .coupon_name {
  1709. float: left;
  1710. height: 40rpx;
  1711. width: 380rpx;
  1712. }
  1713. .coupon_status {
  1714. width: 85rpx;
  1715. float: right;
  1716. color: #999999;
  1717. font-size: 24rpx;
  1718. }
  1719. }
  1720. .product_scope {
  1721. width: 485rpx;
  1722. height: 80rpx;
  1723. color: #999999;
  1724. font-size: 24rpx;
  1725. overflow: hidden;
  1726. line-height: 80rpx;
  1727. .check_label {
  1728. float: right;
  1729. display: block;
  1730. overflow: hidden;
  1731. padding: 20rpx 20rpx;
  1732. .isstd {
  1733. line-height: 40rpx;
  1734. }
  1735. .checkbox {
  1736. float: right;
  1737. width: 40rpx;
  1738. height: 40rpx;
  1739. }
  1740. }
  1741. }
  1742. .coupon_info {
  1743. width: 485rpx;
  1744. max-height: 80rpx;
  1745. font-size: 30rpx;
  1746. overflow: hidden;
  1747. line-height: 40rpx;
  1748. padding: 0rpx 0rpx;
  1749. .coupon_exp {
  1750. float: left;
  1751. font-size: 20rpx;
  1752. }
  1753. }
  1754. }
  1755. }
  1756. .coupon_item:last-child {
  1757. border-bottom: none;
  1758. }
  1759. }
  1760. .addr_list {
  1761. width: 730rpx;
  1762. display: block;
  1763. overflow: hidden;
  1764. margin: 0rpx auto;
  1765. min-height: 500rpx;
  1766. .addr_item {
  1767. display: block;
  1768. font-size: 24rpx;
  1769. overflow: hidden;
  1770. line-height: 40rpx;
  1771. padding: 15rpx 10rpx;
  1772. border-radius: 15rpx;
  1773. border-bottom: 2rpx solid #dddddd;
  1774. .radio_label {
  1775. width: 40rpx;
  1776. float: left;
  1777. height: 50rpx;
  1778. padding-top: 30rpx;
  1779. margin-right: 20rpx;
  1780. .radio_icon {
  1781. float: left;
  1782. width: 40rpx;
  1783. height: 40rpx;
  1784. }
  1785. }
  1786. .contact_user {
  1787. float: left;
  1788. width: 640rpx;
  1789. display: block;
  1790. height: 50rpx;
  1791. font-size: 24rpx;
  1792. line-height: 50rpx;
  1793. .contact_name {
  1794. font-size: 26rpx;
  1795. font-weight: bold;
  1796. margin-right: 16rpx;
  1797. }
  1798. .contact_default {
  1799. color: #F59A23;
  1800. font-size: 20rpx;
  1801. margin-left: 16rpx;
  1802. border: 1rpx solid #F59A23;
  1803. }
  1804. .contact_shop {
  1805. float: right;
  1806. font-size: 26rpx;
  1807. margin-right: 16rpx;
  1808. }
  1809. }
  1810. .contact_addr {
  1811. float: left;
  1812. width: 640rpx;
  1813. display: block;
  1814. font-size: 24rpx;
  1815. line-height: 30rpx;
  1816. padding: 10rpx 5rpx;
  1817. }
  1818. }
  1819. }
  1820. .create_box {
  1821. height: 140rpx;
  1822. display: block;
  1823. .create_addr {
  1824. width: 700rpx;
  1825. height: 80rpx;
  1826. display: block;
  1827. color: #FFFFFF;
  1828. font-size: 30rpx;
  1829. overflow: hidden;
  1830. line-height: 80rpx;
  1831. padding: 0rpx 0rpx;
  1832. text-align: center;
  1833. margin: 0rpx auto;
  1834. margin-top: 20rpx;
  1835. border-radius: 40rpx;
  1836. background-color: #E03519;
  1837. }
  1838. }
  1839. .regiment_popup_list {
  1840. display: block;
  1841. overflow: hidden;
  1842. min-height: 600rpx;
  1843. margin: 10rpx auto;
  1844. background: #FFFFFF;
  1845. padding-bottom: 50rpx;
  1846. .regiment_popup_item {
  1847. height: 100rpx;
  1848. display: block;
  1849. margin: 10rpx auto;
  1850. border-bottom: 2rpx solid #DDDDDD;
  1851. .username {
  1852. float: left;
  1853. padding-left: 20rpx;
  1854. padding-top: 20rpx;
  1855. .user_image {
  1856. float: left;
  1857. display: block;
  1858. width: 80rpx;
  1859. height: 80rpx;
  1860. border-radius: 40%;
  1861. }
  1862. .username_text {
  1863. height: 80rpx;
  1864. line-height: 80rpx;
  1865. }
  1866. }
  1867. .regiment_center {
  1868. float: right;
  1869. padding-right: 18rpx;
  1870. padding-top: 25rpx;
  1871. .regiment_center_text {
  1872. font-size: 25rpx;
  1873. }
  1874. .regiment_center_time {
  1875. font-size: 25rpx;
  1876. .center_title {
  1877. float: left;
  1878. }
  1879. }
  1880. }
  1881. .regiment_right {
  1882. float: right;
  1883. padding-top: 25rpx;
  1884. .regiment_but {
  1885. font-size: 25rpx;
  1886. background-color: #E03519;
  1887. color: #F9F9F9;
  1888. }
  1889. }
  1890. }
  1891. .coupon_item:last-child {
  1892. border-bottom: none;
  1893. }
  1894. }
  1895. }
  1896. // 添加客服
  1897. .center_popup {
  1898. .add_follow {
  1899. display: block;
  1900. color: #FFFFFF;
  1901. width: 700rpx;
  1902. height: 800rpx;
  1903. margin: 0 auto;
  1904. font-size: 26rpx;
  1905. border-radius: 40rpx;
  1906. background: linear-gradient(to bottom, #ff0091 0%, #2c82ff 100%);
  1907. .close_area {
  1908. height: 80rpx;
  1909. display: block;
  1910. line-height: 80rpx;
  1911. .close_btn {
  1912. color: #FFFFFF;
  1913. float: right;
  1914. width: 80rpx;
  1915. height: 80rpx;
  1916. font-size: 26rpx;
  1917. text-align: center;
  1918. line-height: 80rpx;
  1919. padding: 0rpx 0rpx;
  1920. border: 0rpx solid transparent;
  1921. background-color: transparent;
  1922. }
  1923. .close_btn::after {
  1924. border: 0rpx solid transparent;
  1925. }
  1926. }
  1927. .info_alter {
  1928. display: block;
  1929. height: 100rpx;
  1930. font-size: 42rpx;
  1931. font-weight: bold;
  1932. text-align: center;
  1933. line-height: 100rpx;
  1934. }
  1935. .qr_code_area {
  1936. display: block;
  1937. width: 300rpx;
  1938. height: 300rpx;
  1939. margin: 30rpx auto;
  1940. .qr_code {
  1941. float: left;
  1942. width: 300rpx;
  1943. height: 300rpx;
  1944. }
  1945. }
  1946. .save_btn {
  1947. color: #333333;
  1948. display: block;
  1949. width: 260rpx;
  1950. height: 80rpx;
  1951. font-size: 26rpx;
  1952. text-align: center;
  1953. line-height: 80rpx;
  1954. padding: 0rpx 0rpx;
  1955. margin: 40rpx auto;
  1956. border-radius: 40rpx;
  1957. background-color: #FFFFFF;
  1958. border: 0rpx solid transparent;
  1959. }
  1960. .rule_info {
  1961. width: 600rpx;
  1962. display: block;
  1963. font-size: 26rpx;
  1964. margin: 20rpx auto;
  1965. overflow: hidden;
  1966. line-height: 40rpx;
  1967. }
  1968. }
  1969. }
  1970. .regiment_list {
  1971. width: 700rpx;
  1972. margin-left: 20rpx;
  1973. background-color: red;
  1974. border-radius: 10px;
  1975. .regiment_list_title {
  1976. padding-top: 20rpx;
  1977. height: 60rpx;
  1978. .title1 {
  1979. margin-top: 20rpx;
  1980. padding-left: 20rpx;
  1981. color: #F9F9F9;
  1982. }
  1983. .title2 {
  1984. padding-left: 350rpx;
  1985. color: #F9F9F9;
  1986. }
  1987. }
  1988. .regiment {
  1989. width: 685rpx;
  1990. height: 250rpx;
  1991. background-color: #F9F9F9;
  1992. margin-left: 10rpx;
  1993. border-radius: 10px;
  1994. .swiper {
  1995. height: 250rpx;
  1996. .swiper-item {
  1997. .username {
  1998. float: left;
  1999. padding-left: 20rpx;
  2000. padding-top: 20rpx;
  2001. .user_image {
  2002. float: left;
  2003. display: block;
  2004. width: 80rpx;
  2005. height: 80rpx;
  2006. border-radius: 40%;
  2007. }
  2008. .username_text {
  2009. height: 80rpx;
  2010. line-height: 80rpx;
  2011. }
  2012. }
  2013. .regiment_center {
  2014. float: right;
  2015. padding-right: 18rpx;
  2016. padding-top: 25rpx;
  2017. .regiment_center_text {
  2018. font-size: 25rpx;
  2019. }
  2020. .regiment_center_time {
  2021. font-size: 25rpx;
  2022. .center_title {
  2023. float: left;
  2024. }
  2025. }
  2026. }
  2027. .regiment_right {
  2028. float: right;
  2029. padding-top: 25rpx;
  2030. .regiment_but {
  2031. font-size: 25rpx;
  2032. background-color: #E03519;
  2033. color: #F9F9F9;
  2034. }
  2035. }
  2036. }
  2037. }
  2038. }
  2039. }
  2040. </style>