index.vue 69 KB

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