index.vue 69 KB

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