index.vue 68 KB

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