index.vue 67 KB

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