index.vue 59 KB

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