index.vue 67 KB

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