index.vue 58 KB

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