index.vue 60 KB

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