index.vue 68 KB

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