index.vue 68 KB

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