index.vue 69 KB

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