index.vue 58 KB

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