index.vue 68 KB

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