index.vue 56 KB

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