activity.vue 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846
  1. <template>
  2. <app-layout>
  3. <scroll-view @scrolltolower="getMore" :scroll-top="scrollTop" scroll-y @scroll="scroll" :style="{'height':`${windowHeight}px`}">
  4. <app-head v-if="getTheme" :theme="getTheme"></app-head>
  5. <!-- 团长信息 -->
  6. <view @click="toList" class="middleman dir-top-nowrap main-center">
  7. <view class="location t-omit">{{middleman.location}}</view>
  8. <view v-if="middleman.id > 0" class="middleman-info dir-left-nowrap">
  9. <image class="avatar" :src="middleman.avatar"></image>
  10. <view class="user-info">
  11. <view class="t-omit">{{middleman.name}} {{setting.middleman}} {{middleman.mobile}}</view>
  12. <view>
  13. <image class="icon" src="./../image/address.png"></image>
  14. <text>提货地址:{{middleman.province}}<text v-if="middleman.province != middleman.city">{{middleman.city}}</text>{{middleman.district}}{{middleman.detail}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view v-if="middleman.is_allow_change == 1" class="space">距离最近{{space}}</view>
  19. <image v-if="middleman.is_allow_change == 1" class="arrow-image" src="/static/image/icon/arrow-right-white.png"></image>
  20. </view>
  21. <!-- 团购活动状态 -->
  22. <view v-if="activity.time > 0" class="time dir-left-nowrap cross-center">
  23. <image class="icon" src="./../image/timeline.png"></image>
  24. <view>距离本次团购活动开始还有{{d}}天{{h}}时{{m}}分{{s}}秒</view>
  25. </view>
  26. <view v-if="activity.activity_status == 2" class="time">
  27. <text>团购已结束,下次记得早点来哦</text>
  28. </view>
  29. <view class="status-area" v-if="activity.activity_status == 1">
  30. <view class="status dir-top-nowrap main-center cross-center">
  31. <view v-if="activity.condition == 0" class="end-time">{{activity.end_at}}结束</view>
  32. <view v-else class="condition main-between">
  33. <view>
  34. <text v-if="activity.num - activity.condition_count > 0">还差<text class="end-time">{{activity.num - activity.condition_count}}</text>{{activity.condition == 1 ? '人':'件商品'}}</text>拼团成功
  35. </view>
  36. <view class="end-time">{{activity.end_at}}结束</view>
  37. </view>
  38. <!-- 进度条 -->
  39. <view class="progress" v-if="activity.condition > 0">
  40. <view :style="{'width': `${activity.rate}%`,'backgroundImage':`url(${bonusImg.progress})`}"></view>
  41. </view>
  42. <!-- 下单人数 -->
  43. <view class="main-center cross-center buy-user">
  44. <view class="user-list dir-right-nowrap">
  45. <image v-for="(item,index) in user_list" :key="index" class="avatar" :src="item.avatar"></image>
  46. </view>
  47. <view class="sales">
  48. <text>{{activity.user_num}}</text>
  49. 人已抢<text>{{activity.all_sales > activity.condition_count ? activity.all_sales : activity.condition_count}}</text>件
  50. </view>
  51. </view>
  52. <!-- 最新下单状态 -->
  53. <view v-if="user_list.length > 0" class="main-center cross-center new-buy">
  54. <image class="avatar" :src="user_list[user_list.length - 1].avatar"></image>
  55. <view>{{end_time}}参与团购</view>
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 商品 -->
  60. <view class="list">
  61. <view @click="toGoods(item)" class="goods dir-left-nowrap" v-for="item in list" :key="item.id">
  62. <view v-if="item.goods_stock === 0" class="out-dialog">
  63. <image :src="appSetting.is_use_stock == '1' ? appImg.plugins_out : appSetting.sell_out_pic"></image>
  64. </view>
  65. <image class="cover" mode='aspectFill' :src="item.cover_pic"></image>
  66. <view class="info">
  67. <view class="name t-omit-two">{{item.name}}</view>
  68. <view class="sale" :class="getTheme + '-m-text ' + getTheme +' '+getTheme+'-m-border'">
  69. <view style="position: relative">
  70. {{item.sales}}
  71. <view class="sale-bg" :class="getTheme + '-m-back ' + getTheme"></view>
  72. </view>
  73. <view class="stock">剩{{item.goods_stock}}{{item.goodsWarehouse.unit}}</view>
  74. </view>
  75. <view class="price" :class="getTheme + '-m-text ' + getTheme">¥{{item.min_price}}</view>
  76. <view class="cart" @click.stop="toBuy(item)" v-if="activity && activity.activity_status == 1 && item.goods_stock > 0">
  77. <app-cart-image src="/static/image/icon/cats.png" imageWidth="80rpx" imageHeight="80rpx" :theme="getTheme"></app-cart-image>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 购物车 -->
  83. <view @click="openCart(item)" v-if="showCart && cart.length > 0" class="bg">
  84. <view class="dialog cart-dialog" @click.stop="" style="padding: 0;">
  85. <view v-if="activity.full_price.length > 0" class="cart-discount main-center">
  86. <view :class="getTheme + '-m-text ' + getTheme" v-for="(item,index) in activity.full_price" :key="index"><view class="discount-bg" :class="getTheme + '-m-back ' + getTheme"></view><text v-if="index > 0">,</text>满{{item.full_price}}减{{item.reduce_price}}</view>
  87. </view>
  88. <view class="title main-between">
  89. <view>已选商品</view>
  90. <view class="dir-right-nowrap cross-center" @click.stop="clearAll">
  91. <view style="color: #999999">清空购物车</view>
  92. <image src="/static/image/icon/delete.png"></image>
  93. </view>
  94. </view>
  95. <view class="goods-list">
  96. <view v-if="item.num > 0 || item.num == ''" class="goods dir-left-nowrap" v-for="(item,index) in cart" :key="item.id">
  97. <image class="cover" mode='aspectFill' :src="item.pic_url"></image>
  98. <view class="info">
  99. <view class="name t-omit-two" :style="{'color': item.is_exist == 1 ? '#353535': '#999999'}">{{item.name}}</view>
  100. <view class="attr">
  101. <text class="attr-group" v-for="(attr,idx) in item.attr_list" :key="idx">
  102. {{attr.attr_group_name}}:{{attr.attr_name}}
  103. </text>
  104. </view>
  105. <view style="height: 60rpx"></view>
  106. <view class="price" v-if="item.is_exist == 1" :class="getTheme + '-m-text ' + getTheme">¥{{item.price}}</view>
  107. <view class="price" v-else style="color: #353535">商品已失效</view>
  108. <view class="app-add-subtract dir-left-nowrap cross-center">
  109. <image class="app-icon" @click.stop="_calcValue(index,'minus')"
  110. :src="item.is_exist == 0 ? '/static/image/cart/unreducible.png' : '/static/image/icon/subtract.png'"
  111. ></image>
  112. <view class="app-value">
  113. <input v-model="item.num" v-if="item.is_exist == 1" @blur.stop="_onBlur(index)" type="number">
  114. <view v-else>{{item.num}}</view>
  115. </view>
  116. <image class="app-icon" v-show="is_loading" @load="imgLoad" @click.stop="_calcValue(index,'plus')"
  117. :src="item.num >= 99 || item.is_exist == 0 ? '/static/image/cart/can-add.png' : '/static/image/icon/add-but.png'"
  118. :class="[ getTheme+ '-m-back', getTheme]"></image>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <view v-if="is_exist" class="discount main-center" style="background-color: #f0f0f0;color: #999999;">
  124. <view>{{is_exist}}件商品已失效</view>
  125. </view>
  126. <view class="cart-placeholder cart-list-placeholder" :class="{'again-placeholder': is_exist}"></view>
  127. </view>
  128. </view>
  129. <!-- 买家信息 -->
  130. <view id="input" v-if="cart.length > 0 && activity.activity_status == 1" class="input-info">
  131. <view class="input-item">
  132. <view class="input-label">手机号</view>
  133. <view class="input">
  134. <input placeholder-style="color:#999999" type="number" placeholder="请输入手机号" v-model="mobile">
  135. </view>
  136. </view>
  137. <view class="input-item" @click="inputRemark = false">
  138. <view class="input-label">备注</view>
  139. <view class="input" v-if="inputRemark" :style="{'color': remark ? '#353535': '#999999'}">{{remark ? remark : '请输入备注'}}</view>
  140. <view class="input" v-else>
  141. <input placeholder-style="color:#999999" :focus="!inputRemark" @blur="inputRemark = true" maxlength="50" v-model="remark" placeholder="请输入备注">
  142. </view>
  143. </view>
  144. </view>
  145. <!-- 结算栏 -->
  146. <view v-if="cart.length > 0 && activity.activity_status == 1 && activity.full_price.length > 0" class="discount main-center">
  147. <view :class="getTheme + '-m-text ' + getTheme" v-for="(item,index) in activity.full_price" :key="index"><view class="discount-bg" :class="getTheme + '-m-back ' + getTheme"></view><text v-if="index > 0">,</text>满{{item.full_price}}减{{item.reduce_price}}</view>
  148. </view>
  149. <view v-if="cart.length > 0 && activity.activity_status == 1" class="cart-placeholder" :class="{'more-placeholder': is_middleman}"></view>
  150. <view v-if="cart.length > 0 && activity.activity_status == 1" class="cart-item main-between cross-center">
  151. <view @click="openCart(item)" class="cart-left dir-left-nowrap">
  152. <view class="cart-icon">
  153. <image src="/static/image/cart.png" class="cart"></image>
  154. <view :class="getTheme + '-m-back ' + getTheme">{{cartLength > 99 ? '99+':cartLength}}</view>
  155. </view>
  156. <view class="price-info main-center dir-top-nowrap">
  157. <view class="total-price t-omit">总计<text :class="getTheme + '-m-text ' + getTheme">¥{{total < 0 ? '0.00':total}}</text></view>
  158. <view class="minus-price t-omit">已减<text :class="getTheme + '-m-text ' + getTheme">¥{{minus}}</text></view>
  159. </view>
  160. </view>
  161. <view @click="toSubmit" class="cart-right" :class="getTheme + '-m-back ' + getTheme">确认下单</view>
  162. </view>
  163. <!-- 悬浮按钮 -->
  164. <view class="dialog-btn">
  165. <view v-if="is_middleman" @click="toIndex">
  166. <image src="./../image/user-index.png"></image>
  167. </view>
  168. <view @click="toOrder">
  169. <image src="./../image/user-order.png"></image>
  170. </view>
  171. <view @click="toUser">
  172. <image src="./../image/user-center.png"></image>
  173. </view>
  174. <view @click="showHiddenClick">
  175. <image src="./../image/user-share.png"></image>
  176. </view>
  177. </view>
  178. <u-attr
  179. v-model="attrShow"
  180. :theme-object="themeObject"
  181. :goods="goods"
  182. :checked="selectAttr"
  183. @check="attr"
  184. :is_show_left="false"
  185. :is_show_right="false"
  186. >
  187. <template slot="right">
  188. <!-- 购物车信息 -->
  189. <view class="attr-bottom dir-left-nowrap">
  190. <view class="box-grow-1 dir-left-nowrap cross-center">
  191. <view class="total-price">总计<text :class="getTheme + '-m-text ' + getTheme">¥{{selectAttr ? attr_price : goods.price}}</text></view>
  192. </view>
  193. <view class="box-grow-1 u-add-btn main-center cross-center"
  194. :class="getTheme + '-m-back ' + getTheme" @click="add">加入购物车
  195. </view>
  196. </view>
  197. </template>
  198. </u-attr>
  199. <!-- 推荐 -->
  200. <view v-if="recommendDialog" @click="recommendDialog=!recommendDialog" class="bg">
  201. <view class="dialog" @click.stop="" :animation="animationData">
  202. <view v-show="showOther" @click="recommendDialog=!recommendDialog" class="end-close main-center cross-center">
  203. <image src="/static/image/icon/icon-close.png"></image>
  204. </view>
  205. <view class="end-title">当前团购已结束</view>
  206. <view class="end-recommend main-center cross-center">
  207. <view class="end-line"></view>
  208. <view>为您推荐</view>
  209. <view class="end-line"></view>
  210. </view>
  211. <view class="end-sec-title">以下{{recommend.count}}个商品正在团购</view>
  212. <view class="main-center recommend-goods">
  213. <image v-if="index < 3" v-for="(item,index) in recommend.goods_list" :key="index" :src="item.cover_pic"></image>
  214. </view>
  215. <view v-show="showOther" class="to-activity" :class="getTheme + '-m-back ' + getTheme" @click="toActivity">去看看</view>
  216. </view>
  217. </view>
  218. <!-- 分享 -->
  219. <view>
  220. <app-share-qr-code :posterUrl="'/plugins/community/poster/poster?activity_id='+id + '&middleman_id='+middleman.user_id" hasPosterNav="true" v-model="showShare" :url="poster" title="生成活动海报"></app-share-qr-code>
  221. </view>
  222. </scroll-view>
  223. <app-close v-if="showClose" :toBack="true" @update="getMall"></app-close>
  224. </app-layout>
  225. </template>
  226. <script>
  227. import {mapGetters, mapState} from 'vuex';
  228. import appHead from '../components/app-head.vue';
  229. import appShareQrCode from '../../../components/page-component/app-share-qr-code-poster/app-share-qr-code-poster.vue';
  230. import uAttr from '../../../components/page-component/goods/u-attr.vue';
  231. import AppClose from '../../../components/basic-component/app-close/app-close.vue';
  232. export default {
  233. data() {
  234. return {
  235. id: null,
  236. showCart: false,
  237. is_loading: false,
  238. submitLock: false,
  239. recommendDialog: false,
  240. showShare: false,
  241. stopLoad: false,
  242. showOther: false,
  243. more: false,
  244. is_middleman: false,
  245. share: false,
  246. default: false,
  247. inputRemark: true,
  248. cartLength: 0,
  249. windowHeight: 0,
  250. is_exist: 0,
  251. page: 1,
  252. poster: '',
  253. mobile: '',
  254. remark: '',
  255. d: '',
  256. h: '',
  257. m: '',
  258. s: '',
  259. selectAttr: {},
  260. animationData: {},
  261. animation: {},
  262. attr_price: '0.00',
  263. number: 1,
  264. space: '0m',
  265. display: 'none',
  266. // attrShow: 0,
  267. attrShow: false,
  268. scrollTop: 0,
  269. scrollHeight: 0,
  270. goods: null,
  271. timeInterval: null,
  272. buyBool: true,
  273. longitude: '',
  274. latitude: '',
  275. activity: {
  276. rate: 0
  277. },
  278. middleman: {},
  279. setting: {},
  280. recommend: {},
  281. list: [],
  282. cart: [],
  283. user_list: [],
  284. template_message_list: [],
  285. end_time: '1小时前',
  286. title: '',
  287. total: '0.00',
  288. minus: '0.00',
  289. middleman_id: 0,
  290. first: true,
  291. showClose: false,
  292. is_open: false
  293. }
  294. },
  295. components: {
  296. appShareQrCode,
  297. appHead,
  298. uAttr,
  299. AppClose
  300. },
  301. computed: {
  302. ...mapGetters('mallConfig', {
  303. getTheme: 'getTheme'
  304. }),
  305. ...mapState({
  306. community: state => state.mallConfig.__wxapp_img.community,
  307. bonusImg: state => state.mallConfig.__wxapp_img.bonus,
  308. appImg: state => state.mallConfig.__wxapp_img.mall,
  309. appSetting: state => state.mallConfig.mall.setting,
  310. userInfo: state => state.user.info
  311. }),
  312. themeObject:function() {
  313. return {
  314. back: this.getTheme + '-m-back ' + this.getTheme,
  315. theme: this.getTheme,
  316. color: this.getTheme + '-m-text ' + this.getTheme,
  317. sBack: this.getTheme + '-s-back ' + this.getTheme
  318. }
  319. }
  320. },
  321. onLoad: function (options) {
  322. let that = this;
  323. if(options.activity_id) {
  324. this.id = options.activity_id;
  325. }
  326. if(options.id) {
  327. this.id = options.id;
  328. }
  329. this.title = options.title;
  330. uni.setNavigationBarTitle({
  331. title: options.title,
  332. });
  333. uni.getSystemInfo({
  334. success: function (res) {
  335. that.windowHeight = res.windowHeight;
  336. }
  337. });
  338. uni.getLocation({
  339. success: (e) => {
  340. uni.hideLoading();
  341. that.longitude = e.longitude;
  342. that.latitude = e.latitude;
  343. uni.getStorage({
  344. key: 'middleman_info',
  345. success: function (res) {
  346. if(res.data && res.data.id > 0) {
  347. if(options.middleman_id) {
  348. that.middleman_id = options.middleman_id;
  349. that.share = true;
  350. }else {
  351. that.middleman_id = res.data.user_id
  352. }
  353. }
  354. },
  355. fail() {
  356. if(options.middleman_id) {
  357. that.middleman_id = options.middleman_id;
  358. that.share = true;
  359. }
  360. }
  361. })
  362. that.$showLoading({
  363. type: 'global',
  364. text: '加载中...'
  365. });
  366. that.getSetting();
  367. },
  368. fail: () => {
  369. uni.hideLoading();
  370. uni.showModal({
  371. title: '提示',
  372. content: '获取位置信息失败,需要授权获取您的位置信息',
  373. showCancel: false,
  374. confirmText: '打开授权',
  375. success(e) {
  376. if (e.confirm) {
  377. uni.openSetting({});
  378. }
  379. }
  380. });
  381. },
  382. });
  383. // #ifdef MP-WEIXIN
  384. wx.showShareMenu({
  385. menus: ['shareAppMessage', 'shareTimeline']
  386. });
  387. // #endif
  388. },
  389. onUnload() {
  390. this.stopLoad = true;
  391. clearInterval(this.timeInterval);
  392. },
  393. onShow() {
  394. let that = this;
  395. if(this.stopLoad) {
  396. this.stopLoad = false;
  397. uni.getStorage({
  398. key: 'bind',
  399. success: function (res) {
  400. if(res.data > 0) {
  401. that.$showLoading({
  402. type: 'global',
  403. text: '加载中...'
  404. });
  405. that.middleman = {};
  406. that.middleman_id = 0;
  407. uni.getStorage({
  408. key: 'middleman_info',
  409. success: function (res) {
  410. if(res.data && res.data.id > 0) {
  411. that.middleman_id = res.data.user_id;
  412. }
  413. that.getList();
  414. },
  415. fail() {
  416. that.getList();
  417. }
  418. })
  419. uni.removeStorage({
  420. key: 'bind'
  421. });
  422. }else {
  423. that.getList();
  424. }
  425. },
  426. fail() {
  427. that.getList();
  428. }
  429. });
  430. }
  431. },
  432. onHide() {
  433. this.stopLoad = true;
  434. clearInterval(this.timeInterval);
  435. },
  436. methods: {
  437. toSubmit() {
  438. this.showClose = false;
  439. setTimeout(()=>{
  440. this.showClose = true;
  441. })
  442. },
  443. getMall(e) {
  444. this.is_open = e.is_open == 1 ? true : false;
  445. if(this.is_open) {
  446. this.allBuy();
  447. }
  448. },
  449. scroll(e) {
  450. this.scrollHeight = e.detail.scrollTop;
  451. },
  452. getMore() {
  453. if(this.more) {
  454. this.page++;
  455. this.getOther();
  456. this.more = false;
  457. }
  458. },
  459. getOther() {
  460. let that = this;
  461. let para = {
  462. id: that.id,
  463. page: that.page,
  464. longitude: that.longitude,
  465. latitude: that.latitude
  466. }
  467. if(that.middleman_id > 0) {
  468. para.middleman_id = that.middleman_id;
  469. }
  470. that.$request({
  471. url: that.$api.community.user_activity,
  472. data: para
  473. }).then(response=>{
  474. that.$hideLoading();
  475. if(response.code === 0) {
  476. if(response.data.list.length === 20) {
  477. that.more = true;
  478. }
  479. that.list = that.list.concat(response.data.list);
  480. }
  481. })
  482. },
  483. openCart(item) {
  484. this.showCart = !this.showCart;
  485. this.stopLoad = true;
  486. if(this.showCart == false) {
  487. this.stopLoad = false;
  488. this.getList();
  489. }
  490. },
  491. toList() {
  492. if(this.middleman.is_allow_change === '0') {
  493. return false;
  494. }
  495. uni.navigateTo({
  496. url: '/plugins/community/captain/captain?longitude=' + this.longitude + '&latitude='+ this.latitude
  497. });
  498. },
  499. showHiddenClick() {
  500. this.showShare = !this.showShare;
  501. },
  502. toGoods(item) {
  503. this.stopLoad = true;
  504. uni.navigateTo({
  505. url: '/plugins/community/goods/goods?goods_id=' + item.id + '&middleman_id=' + this.middleman.user_id
  506. });
  507. },
  508. toIndex() {
  509. this.stopLoad = true;
  510. uni.navigateTo({
  511. url: '/plugins/community/index/index'
  512. });
  513. },
  514. toOrder() {
  515. this.stopLoad = true;
  516. uni.navigateTo({
  517. url: '/plugins/community/order/order?is_user=1'
  518. });
  519. },
  520. toUser() {
  521. this.stopLoad = true;
  522. uni.navigateTo({
  523. url: '/pages/user-center/user-center'
  524. });
  525. },
  526. toActivity() {
  527. this.stopLoad = true;
  528. uni.redirectTo({
  529. url: '/plugins/community/activity/activity?id=' + this.recommend.activity_id
  530. });
  531. },
  532. attr(e, num) {
  533. this.selectAttr = e;
  534. this.number = num;
  535. console.log(this.selectAttr)
  536. if(this.selectAttr.service_label){
  537. this.attr_price = (this.selectAttr.price * this.number + (this.selectAttr.service_label.price-0)).toFixed(2);
  538. }else{
  539. this.attr_price = (this.selectAttr.price * this.number).toFixed(2);
  540. }
  541. },
  542. imgLoad() {
  543. this.is_loading = true;
  544. },
  545. allBuy() {
  546. if(this.submitLock) {
  547. return false;
  548. }
  549. this.showCart = false;
  550. this.scrollTop = this.scrollHeight
  551. if(this.default) {
  552. this.$nextTick().then(() => {
  553. this.scrollTop = 9999999;
  554. this.default = false;
  555. })
  556. uni.showToast({
  557. title: '请确认手机号',
  558. icon: 'none',
  559. duration: 1000
  560. });
  561. return false;
  562. }
  563. if(this.mobile.length == 11 && (/0?(1)[0-9]{10}/.test(this.mobile))) {
  564. this.$subscribe(this.template_message_list).then(res => {
  565. this.submit();
  566. }).catch(() => {
  567. this.submit();
  568. });
  569. }else {
  570. this.$nextTick().then(() => {
  571. this.scrollTop = 9999999;
  572. })
  573. this.stopLoad = false;
  574. this.getList();
  575. uni.showToast({
  576. title: '请输入正确的手机号码',
  577. icon: 'none',
  578. duration: 1000
  579. });
  580. }
  581. },
  582. submit() {
  583. uni.showLoading({
  584. title: '提交订单...'
  585. });
  586. this.stopLoad = true;
  587. this.submitLock = true;
  588. let goods_list = [];
  589. for(let i in this.cart) {
  590. if(this.cart[i].is_exist == 1) {
  591. let para = {};
  592. para.id = this.cart[i].goods_id;
  593. para.goods_attr_id = this.cart[i].goods_attr_id;
  594. para.num = this.cart[i].num;
  595. para.cart_id = this.cart[i].id;
  596. para.attr = this.cart[i].attr_list;
  597. para.cat_id = 0;
  598. para.form_data = [];
  599. para.service_label = this.cart[i].service_label
  600. goods_list.push(para);
  601. }
  602. }
  603. if(goods_list.length === 0) {
  604. uni.showToast({
  605. title: '请添加有效商品',
  606. icon: 'none',
  607. duration: 1000
  608. });
  609. return false
  610. }
  611. let mch_list = [{
  612. mch_id: 0,
  613. activity_id: this.id,
  614. middleman_id: this.middleman.user_id,
  615. goods_list: goods_list,
  616. distance: 0,
  617. remark: this.remark,
  618. order_form: [],
  619. use_integral: 0,
  620. user_coupon_id: 0
  621. }];
  622. let form = {};
  623. form.list = mch_list;
  624. form.address_id = 0;
  625. form.address = {
  626. name: this.userInfo.nickname,
  627. mobile: this.mobile
  628. };
  629. this.$request({
  630. url: this.$api.community.order_submit,
  631. data: {
  632. form_data: JSON.stringify(form)
  633. },
  634. method: 'post'
  635. }).then(response => {
  636. if (response.code === 0) {
  637. this.getPayOrderId(response.data.queue_id, response.data.token);
  638. } else {
  639. this.submitLock = false;
  640. this.stopLoad = false;
  641. uni.hideLoading();
  642. uni.showModal({
  643. title: '提示',
  644. content: response.msg,
  645. showCancel: false,
  646. });
  647. }
  648. }).catch(e => {
  649. this.submitLock = false;
  650. this.stopLoad = false;
  651. uni.hideLoading();
  652. uni.showModal({
  653. title: '提示',
  654. content: e.errMsg,
  655. showCancel: false,
  656. });
  657. });
  658. },
  659. getPayOrderId(queue_id, token) {
  660. this.$request({
  661. url: this.$api.order.pay_data,
  662. method: 'post',
  663. data: {
  664. queue_id: queue_id,
  665. token: token,
  666. },
  667. }).then(response => {
  668. if (response.code === 0) {
  669. if (response.data.retry && response.data.retry === 1) {
  670. this.getPayDataTimer = setTimeout(() => {
  671. this.getPayOrderId(queue_id, token);
  672. }, 1000);
  673. } else {
  674. uni.hideLoading();
  675. this.cart = [];
  676. this.pay(response.data);
  677. }
  678. } else {
  679. this.submitLock = false;
  680. uni.hideLoading();
  681. uni.showModal({
  682. title: '提示',
  683. content: response.msg,
  684. showCancel: false,
  685. });
  686. }
  687. }).catch(e => {
  688. this.submitLock = false;
  689. uni.hideLoading();
  690. uni.showModal({
  691. title: '提示',
  692. content: e.errMsg,
  693. showCancel: false,
  694. });
  695. });
  696. },
  697. pay(data) {
  698. uni.removeStorage({
  699. key: 'middleman_info'
  700. });
  701. this.$payment.pay(data.id).then(() => {
  702. this.submitLock = false;
  703. let url = '/plugins/community/order/order';
  704. uni.navigateTo({
  705. url: `/pages/order-submit/pay-result?payment_order_union_id=${data.id}&order_page_url=${url}`
  706. });
  707. }).catch(() => {
  708. this.submitLock = false;
  709. this.toOrder();
  710. });
  711. },
  712. _calcValue(index,type) {
  713. if(type === 'minus') {
  714. this.cart[index].num--;
  715. }else if(type === 'plus') {
  716. this.cart[index].num++;
  717. }
  718. this._onBlur(index);
  719. },
  720. _onBlur(index) {
  721. this.total = 0;
  722. this.cartLength = 0;
  723. for(let i in this.cart) {
  724. this.total = (+this.total + (+this.cart[i].price*this.cart[i].num));
  725. this.cartLength += +this.cart[i].num;
  726. }
  727. let minus = 0;
  728. for(let i in this.activity.full_price) {
  729. if(+this.activity.full_price[i].full_price < +this.total || +this.activity.full_price[i].full_price == +this.total) {
  730. if(this.activity.full_price[i].reduce_price > minus) {
  731. minus = +this.activity.full_price[i].reduce_price;
  732. }
  733. }
  734. }
  735. this.total = (+this.total - minus).toFixed(2);
  736. this.minus = minus.toFixed(2);
  737. if(this.cart[index].num == 0) {
  738. this.delCart(index)
  739. }else {
  740. this.$request({
  741. url: this.$api.community.cart_edit,
  742. data: {
  743. list: JSON.stringify(this.cart)
  744. },
  745. });
  746. }
  747. },
  748. clearAll() {
  749. let cart = [];
  750. for(let i in this.cart) {
  751. cart.push(this.cart[i].id)
  752. }
  753. this.cart = [];
  754. this.showCart = false;
  755. this.$request({
  756. url: this.$api.community.cart_delete,
  757. data: {
  758. cart_id_list: JSON.stringify(cart),
  759. },
  760. }).then(() => {
  761. this.stopLoad = false;
  762. this.getList();
  763. })
  764. },
  765. delCart(index) {
  766. let list = [];
  767. list.push(this.cart[index].id)
  768. this.cart.splice(index,1);
  769. this.total = 0;
  770. this.cartLength = 0;
  771. for(let i in this.cart) {
  772. this.total = (+this.total + (+this.cart[i].price*this.cart[i].num));
  773. this.cartLength += +this.cart[i].num
  774. }
  775. let minus = 0;
  776. for(let i in this.activity.full_price) {
  777. if(+this.activity.full_price[i].full_price < +this.total || +this.activity.full_price[i].full_price == +this.total) {
  778. if(this.activity.full_price[i].reduce_price > minus) {
  779. minus = +this.activity.full_price[i].reduce_price
  780. }
  781. }
  782. }
  783. this.total = (+this.total - minus).toFixed(2);
  784. this.minus = minus.toFixed(2);
  785. if(this.cart.length === 0) {
  786. this.showCart = false
  787. }
  788. this.$request({
  789. url: this.$api.community.cart_delete,
  790. data: {
  791. cart_id_list: list,
  792. },
  793. }).then(() => {
  794. this.stopLoad = false;
  795. this.getList();
  796. }).catch(() => {
  797. this.attrShow = false;
  798. uni.hideLoading();
  799. });
  800. },
  801. add() {
  802. uni.showLoading({
  803. title: '加入购物车'
  804. });
  805. let service
  806. if(this.selectAttr.service_label){
  807. service = this.selectAttr.service_label.id
  808. }else{
  809. service = ''
  810. }
  811. let para = {
  812. activity_id: this.id,
  813. goods_id: this.selectAttr.goods_id,
  814. goods_attr_id: this.selectAttr.id,
  815. service_id:service,
  816. num: this.number
  817. }
  818. this.$request({
  819. url: this.$api.community.cart_add,
  820. data: para,
  821. method: 'post'
  822. }).then(response => {
  823. if(response.code === 0) {
  824. this.addResult(response.data.queue_id, response.data.token);
  825. } else {
  826. uni.hideLoading();
  827. this.attrShow = false;
  828. uni.showToast({
  829. title: response.msg,
  830. icon: 'none',
  831. duration: 1000
  832. });
  833. }
  834. }).catch(() => {
  835. this.attrShow = false;
  836. uni.hideLoading();
  837. });
  838. },
  839. addResult(queue_id, token) {
  840. this.$request({
  841. url: this.$api.community.cart_result,
  842. method: 'post',
  843. data: {
  844. queue_id: queue_id,
  845. token: token,
  846. },
  847. }).then(response => {
  848. if (response.code === 0) {
  849. if (response.data && response.data.retry === 1) {
  850. this.getResult = setTimeout(() => {
  851. this.addResult(queue_id, token);
  852. }, 1000);
  853. } else {
  854. this.attrShow = false;
  855. let index = -1;
  856. for(let i in this.cart) {
  857. if(this.cart[i].goods_id == this.selectAttr.goods_id && this.cart[i].goods_attr_id == this.selectAttr.id) {
  858. index = i;
  859. }
  860. }
  861. if(index > -1) {
  862. this.cart[index].num += +this.number;
  863. } else {
  864. let service
  865. if(this.selectAttr.service_label){
  866. service = this.selectAttr.service_label
  867. }else{
  868. service = null
  869. }
  870. let para = {
  871. activity_id: this.id,
  872. community_goods_id: this.goods.id,
  873. goods_id: this.selectAttr.goods_id,
  874. goods_attr_id: this.selectAttr.id,
  875. num: this.number,
  876. name: this.goods.name,
  877. attr_list: this.selectAttr.attr_list,
  878. pic_url: this.selectAttr.pic_url,
  879. service_label:service,
  880. id: 0,
  881. price: this.selectAttr.price,
  882. is_exist: 1
  883. }
  884. this.cart.push(para);
  885. }
  886. this.total = 0;
  887. this.cartLength = 0;
  888. console.log(this.cart,"===================")
  889. for(let item of this.cart) {
  890. this.total = (this.total + (item.price*item.num+(item.service_label.price-0)));
  891. this.cartLength += +item.num;
  892. }
  893. let minus = 0;
  894. for(let i in this.activity.full_price) {
  895. if(+this.activity.full_price[i].full_price < +this.total || +this.activity.full_price[i].full_price == +this.total) {
  896. if(this.activity.full_price[i].reduce_price > minus) {
  897. minus = +this.activity.full_price[i].reduce_price;
  898. }
  899. }
  900. }
  901. this.total = (+this.total - minus).toFixed(2);
  902. this.minus = minus.toFixed(2);
  903. uni.hideLoading();
  904. }
  905. } else {
  906. uni.hideLoading();
  907. uni.showModal({
  908. title: '提示',
  909. content: response.msg,
  910. showCancel: false
  911. });
  912. }
  913. }).catch(e => {
  914. this.attrShow = false;
  915. uni.hideLoading();
  916. uni.showModal({
  917. title: '提示',
  918. content: e.errMsg,
  919. showCancel: false
  920. });
  921. });
  922. },
  923. toBuy(item) {
  924. if (this.$user.isLogin() && this.$store.state.user.info) {
  925. let member_level =this.$store.state.user.info.identity.member_level;
  926. if(member_level<item.member_level){
  927. uni.showModal({
  928. title:"提示",
  929. content:"需达到"+item.member_name+"会员才可购买",
  930. showCancel:true,
  931. buttonText: '升级',
  932. success:(res)=>{
  933. if (res.confirm) {
  934. uni.navigateTo({
  935. // url:"/pages/member/index/index",
  936. url: '/pages/member/upgrade/upgrade?level=' + member_level + '&other=' + item.member_level
  937. })
  938. } else if (res.cancel) {
  939. console.log('用户点击取消');
  940. }
  941. }
  942. })
  943. return;
  944. }
  945. }
  946. this.selectAttr = null;
  947. this.goods = item;
  948. this.attrShow = true;
  949. },
  950. getCart() {
  951. let that = this;
  952. if(that.stopLoad) {
  953. return false;
  954. }
  955. that.$request({
  956. url: that.$api.community.cart,
  957. data: {
  958. middleman_id: that.middleman.user_id,
  959. activity_id: that.activity.id,
  960. }
  961. }).then(response=>{
  962. if(that.stopLoad) {
  963. return false;
  964. }
  965. if(response.code === 0) {
  966. that.total = 0;
  967. that.cartLength = 0;
  968. that.cart = response.data.list;
  969. that.is_exist = 0;
  970. for(let i in that.cart) {
  971. if(that.cart[i].is_exist == 0) {
  972. that.is_exist++;
  973. }
  974. that.total = (+that.total + (+that.cart[i].price*that.cart[i].num));
  975. that.cartLength += +that.cart[i].num;
  976. }
  977. let minus = 0;
  978. for(let i in that.activity.full_price) {
  979. if(+that.activity.full_price[i].full_price < +that.total || +that.activity.full_price[i].full_price == +that.total) {
  980. if(that.activity.full_price[i].reduce_price > minus) {
  981. minus = +that.activity.full_price[i].reduce_price;
  982. }
  983. }
  984. }
  985. that.total = (+that.total - minus).toFixed(2);
  986. that.minus = minus.toFixed(2);
  987. }else {
  988. that.stopLoad = true;
  989. uni.showToast({
  990. title: response.msg,
  991. icon: 'none',
  992. duration: 1000
  993. });
  994. if(response.msg === '所选活动已下架') {
  995. setTimeout(()=>{
  996. uni.navigateBack({});
  997. },1000);
  998. }
  999. }
  1000. }).catch(() => {
  1001. that.$hideLoading();
  1002. });
  1003. },
  1004. getTime(time) {
  1005. if(time > 86399) {
  1006. this.d = Math.floor(time / 86400);
  1007. time = time - (86400*this.d);
  1008. }else {
  1009. this.d = 0;
  1010. }
  1011. if(time > 3599) {
  1012. this.h = Math.floor(time / 3600);
  1013. if(this.h < 10) {
  1014. this.h = '0' + this.h;
  1015. }
  1016. time = time - (3600*this.h);
  1017. }else {
  1018. this.h = '00'
  1019. }
  1020. if(time > 59) {
  1021. this.m = Math.floor(time / 60);
  1022. if(this.m < 10) {
  1023. this.m = '0' + this.m;
  1024. }
  1025. time = time - (60*this.m);
  1026. }else {
  1027. this.m = '00';
  1028. }
  1029. if(time < 60) {
  1030. this.s = time;
  1031. if(this.s < 10) {
  1032. this.s = '0' + this.s;
  1033. }
  1034. }
  1035. },
  1036. getSetting() {
  1037. let that = this;
  1038. that.$request({
  1039. url: that.$api.community.setting,
  1040. }).then(response=>{
  1041. if(response.code === 0) {
  1042. that.head = that.community.a;
  1043. switch(that.getTheme) {
  1044. case 'b':
  1045. that.head = that.community.b;
  1046. break;
  1047. case 'c':
  1048. that.head = that.community.c;
  1049. break;
  1050. case 'd':
  1051. that.head = that.community.d;
  1052. break;
  1053. case 'e':
  1054. that.head = that.community.e;
  1055. break;
  1056. case 'g':
  1057. that.head = that.community.g;
  1058. break;
  1059. case 'h':
  1060. that.head = that.community.h;
  1061. break;
  1062. case 'i':
  1063. that.head = that.community.i;
  1064. break;
  1065. }
  1066. that.setting = response.data;
  1067. that.getList();
  1068. }else {
  1069. that.$hideLoading();
  1070. uni.showToast({
  1071. title: response.msg,
  1072. icon: 'none',
  1073. duration: 1000
  1074. });
  1075. }
  1076. }).catch(() => {
  1077. that.$hideLoading();
  1078. });
  1079. },
  1080. getList() {
  1081. let that = this;
  1082. let para = {
  1083. id: that.id,
  1084. longitude: that.longitude,
  1085. latitude: that.latitude
  1086. }
  1087. if(that.middleman_id > 0) {
  1088. para.middleman_id = that.middleman_id
  1089. }
  1090. that.$request({
  1091. url: that.$api.community.user_activity,
  1092. data: para
  1093. }).then(response=>{
  1094. that.$hideLoading();
  1095. if(response.code === 0) {
  1096. if(response.data.list.length === 0) {
  1097. that.stopLoad = true;
  1098. uni.showToast({
  1099. title: '活动商品异常,正在返回活动主页',
  1100. icon: 'none',
  1101. duration: 1000
  1102. });
  1103. setTimeout(()=>{
  1104. uni.redirectTo({
  1105. url: '/plugins/community/list/list'
  1106. });
  1107. },1000);
  1108. return false;
  1109. }
  1110. if(response.data.list.length < 20) {
  1111. that.list = response.data.list;
  1112. }else {
  1113. for(let i in response.data.list) {
  1114. that.list[i] = response.data.list[i];
  1115. }
  1116. }
  1117. if(that.first) {
  1118. that.first = false;
  1119. if(response.data.last_mobile) {
  1120. that.mobile = response.data.last_mobile;
  1121. that.default = true;
  1122. }
  1123. response.data.list.length < 20 ? that.more = false : that.more = true;
  1124. }
  1125. that.activity = response.data.activity;
  1126. that.is_middleman = response.data.is_middleman;
  1127. that.middleman = response.data.middleman_info;
  1128. if(that.middleman_id == 0) {
  1129. uni.getStorage({
  1130. key: 'middleman_info',
  1131. success: function (res) {
  1132. if(res.data && res.data.id > 0) {
  1133. that.middleman = res.data;
  1134. }
  1135. }
  1136. })
  1137. }
  1138. that.space = ~~that.middleman.distance +'m';
  1139. if(that.middleman.distance > 1000) {
  1140. that.space = (that.middleman.distance / 1000).toFixed(1) + 'km';
  1141. }
  1142. if(that.share) {
  1143. uni.setStorage({
  1144. key: 'middleman_info',
  1145. data: that.middleman
  1146. });
  1147. }
  1148. that.user_list = response.data.user_list;
  1149. if(that.user_list.length > that.activity.user_num){
  1150. that.user_list = that.user_list.slice(0,that.activity.user_num);
  1151. }
  1152. that.template_message_list = response.data.template_message_list;
  1153. if(that.activity.activity_status == 1) {
  1154. if(!that.stopLoad) {
  1155. setTimeout(function(){
  1156. that.getList();
  1157. },5000)
  1158. }
  1159. that.getCart();
  1160. let end_time = Math.floor(that.user_list[that.user_list.length - 1].time / 60);
  1161. if(end_time > 60) {
  1162. that.end_time = '1小时前';
  1163. }else if(end_time == 0) {
  1164. that.end_time = '刚刚';
  1165. }else {
  1166. that.end_time = end_time+ '分钟前';
  1167. }
  1168. }
  1169. if(that.activity.activity_status == 2 && response.data.recommend_activity.activity_id > 0) {
  1170. setTimeout(function(){
  1171. that.recommend = response.data.recommend_activity;
  1172. that.recommendDialog = true;
  1173. var animation = uni.createAnimation({
  1174. duration: 1000,
  1175. timingFunction: 'ease',
  1176. })
  1177. that.animation = animation;
  1178. setTimeout(function(){
  1179. animation.bottom(0).step();
  1180. that.animationData = animation.export();
  1181. setTimeout(function(){
  1182. that.showOther = true;
  1183. },1500);
  1184. },200);
  1185. },800);
  1186. }
  1187. if(that.activity.time > 0) {
  1188. let time = that.activity.time;
  1189. that.timeInterval = setInterval(() =>{
  1190. that.getTime(time);
  1191. time--;
  1192. if(time == 0) {
  1193. clearInterval(that.timeInterval);
  1194. that.getList();
  1195. }
  1196. },1000);
  1197. }
  1198. }else {
  1199. that.stopLoad = true;
  1200. if(response.msg === '周边没有活动可参加') {
  1201. uni.showToast({
  1202. title: '周边没有活动可参加,正在返回活动主页',
  1203. icon: 'none',
  1204. duration: 1000
  1205. });
  1206. setTimeout(()=>{
  1207. uni.redirectTo({
  1208. url: '/plugins/community/list/list'
  1209. });
  1210. },1000);
  1211. }else {
  1212. uni.showToast({
  1213. title: response.msg,
  1214. icon: 'none',
  1215. duration: 1000
  1216. });
  1217. }
  1218. }
  1219. }).catch(() => {
  1220. that.$hideLoading();
  1221. });
  1222. },
  1223. },
  1224. onShareAppMessage: function() {
  1225. return this.$shareAppMessage({
  1226. title: this.setting.app_share_title ? this.setting.app_share_title : this.title,
  1227. imageUrl: this.setting.app_share_pic ? this.setting.app_share_pic : this.list[0].cover_pic,
  1228. path: "/plugins/community/activity/activity",
  1229. params: {
  1230. id: this.id,
  1231. user_id: this.userInfo.options.user_id,
  1232. middleman_id: this.middleman.user_id
  1233. }
  1234. });
  1235. },
  1236. // #ifdef MP-WEIXIN
  1237. onShareTimeline: function() {
  1238. return this.$shareTimeline({
  1239. title: this.share_title ? this.share_title : this.title,
  1240. query: {
  1241. id: this.id,
  1242. user_id: this.userInfo.options.user_id,
  1243. middleman_id: this.middleman.user_id
  1244. }
  1245. });
  1246. }
  1247. // #endif
  1248. }
  1249. </script>
  1250. <style scoped lang="scss">
  1251. .middleman {
  1252. margin-top: -360rpx;
  1253. height: 190rpx;
  1254. color: #ffffff;
  1255. padding: 0 35rpx;
  1256. position: relative;
  1257. .space {
  1258. color: #fff;
  1259. font-size: 22rpx;
  1260. position: absolute;
  1261. top: 45rpx;
  1262. right: 30rpx;
  1263. }
  1264. .arrow-image {
  1265. margin-left: 36rpx;
  1266. width: #{12rpx};
  1267. height: #{24rpx};
  1268. position: absolute;
  1269. top: 50%;
  1270. right: 30rpx;
  1271. margin-top: -12rpx;
  1272. }
  1273. .location {
  1274. font-size: 40rpx;
  1275. width: 70%;
  1276. margin-bottom: 15rpx;
  1277. margin-top: -10rpx;
  1278. }
  1279. .middleman-info {
  1280. font-size: 26rpx;
  1281. .avatar {
  1282. width: 58rpx;
  1283. height: 58rpx;
  1284. border-radius: 50%;
  1285. margin-right: 20rpx;
  1286. flex-shrink: 0;
  1287. }
  1288. .user-info {
  1289. .icon {
  1290. height: 25rpx;
  1291. width: 25rpx;
  1292. margin-right: 6rpx;
  1293. color: #ff4544;
  1294. }
  1295. }
  1296. }
  1297. }
  1298. .time {
  1299. padding: 0 36rpx;
  1300. color: #ff4544;
  1301. height: 90rpx;
  1302. line-height: 90rpx;
  1303. margin: 0 24rpx;
  1304. width: 702rpx;
  1305. border-top-left-radius: 16rpx;
  1306. border-top-right-radius: 16rpx;
  1307. background-color: #F2F2F2;
  1308. position: relative;
  1309. z-index: 2;
  1310. font-size: 24rpx;
  1311. .icon {
  1312. color: #ff4544;
  1313. width: 24rpx;
  1314. height: 24rpx;
  1315. margin-right: 10rpx;
  1316. }
  1317. }
  1318. .status-area {
  1319. width: 702rpx;
  1320. margin: 0 24rpx;
  1321. padding-bottom: 24rpx;
  1322. border-radius: 16rpx;
  1323. background-color: #f7f7f7;
  1324. position: relative;
  1325. z-index: 2;
  1326. .status {
  1327. background-color: #fff;
  1328. border-radius: 16rpx;
  1329. padding: 24rpx;
  1330. .end-time {
  1331. color: #ff4544;
  1332. text-align: center;
  1333. font-size: 24rpx;
  1334. }
  1335. .condition {
  1336. color: #353535;
  1337. font-size: 24rpx;
  1338. width: 100%;
  1339. .end-time {
  1340. color: #ff4544;
  1341. }
  1342. }
  1343. .progress {
  1344. width: #{654rpx};
  1345. background-color: #f0f0f0;
  1346. border-radius: #{10rpx};
  1347. height: #{20rpx};
  1348. position: relative;
  1349. margin: 15rpx 0;
  1350. overflow: hidden;
  1351. view {
  1352. border-radius: #{10rpx};
  1353. height: #{20rpx};
  1354. position: absolute;
  1355. top: 0;
  1356. left: 0;
  1357. z-index: 2;
  1358. }
  1359. }
  1360. .buy-user {
  1361. height: 58rpx;
  1362. .user-list {
  1363. image {
  1364. width: 58rpx;
  1365. height: 58rpx;
  1366. margin-left: -14rpx;
  1367. border-radius: 50%;
  1368. border: 2rpx solid #ffffff;
  1369. }
  1370. }
  1371. .sales {
  1372. font-size: 24rpx;
  1373. line-height: 58rpx;
  1374. height: 58rpx;
  1375. margin-left: 14rpx;
  1376. text {
  1377. color: #ff4544;
  1378. }
  1379. }
  1380. }
  1381. .new-buy {
  1382. margin-top: 20rpx;
  1383. color: #999999;
  1384. font-size: 24rpx;
  1385. image {
  1386. width: 60rpx;
  1387. height: 60rpx;
  1388. border-radius: 50%;
  1389. display: block;
  1390. margin-right: 20rpx;
  1391. }
  1392. }
  1393. }
  1394. }
  1395. .list {
  1396. margin: 0 24rpx;
  1397. width: 702rpx;
  1398. .goods {
  1399. background-color: #fff;
  1400. border-radius: 16rpx;
  1401. width: 702rpx;
  1402. height: 220rpx;
  1403. margin-bottom: 20rpx;
  1404. position: relative;
  1405. z-index: 2;
  1406. .out-dialog {
  1407. width: #{220rpx};
  1408. height: #{220rpx};
  1409. border-radius: #{16rpx};
  1410. position: absolute;
  1411. top: 0;
  1412. left: 0;
  1413. z-index: 10;
  1414. background-color: rgba(0,0,0,.5);
  1415. image {
  1416. width: #{220rpx};
  1417. height: #{220rpx};
  1418. border-radius: #{16rpx};
  1419. }
  1420. }
  1421. .cover {
  1422. height: 220rpx;
  1423. width: 220rpx;
  1424. border-radius: 16rpx;
  1425. margin-right: 15rpx;
  1426. }
  1427. .info {
  1428. padding: 20rpx 0;
  1429. position: relative;
  1430. .name {
  1431. width: 445rpx;
  1432. // #ifndef MP-ALIPAY
  1433. height: 72rpx;
  1434. // #endif
  1435. // #ifdef MP-ALIPAY
  1436. height: 66rpx;
  1437. // #endif
  1438. font-size: 28rpx;
  1439. }
  1440. .sale {
  1441. height: 30rpx;
  1442. line-height: 28rpx;
  1443. font-size: 22rpx;
  1444. margin-top: 18rpx;
  1445. display: inline-block;
  1446. position: relative;
  1447. >view {
  1448. padding: 0 10rpx;
  1449. border: 2rpx solid;
  1450. display: inline-block;
  1451. }
  1452. .sale-bg {
  1453. padding: 0;
  1454. position: absolute;
  1455. top: 0;
  1456. left: 0;
  1457. opacity: 0.1;
  1458. border-top-left-radius: 15rpx;
  1459. border-bottom-left-radius: 15rpx;
  1460. border: 0;
  1461. height: 100%;
  1462. width: 100%;
  1463. }
  1464. view:first-of-type {
  1465. border-right: 0;
  1466. border-top-left-radius: 15rpx;
  1467. border-bottom-left-radius: 15rpx;
  1468. }
  1469. .stock {
  1470. border-top-right-radius: 15rpx;
  1471. border-bottom-right-radius: 15rpx;
  1472. border-left: 0;
  1473. background-color: #fff;
  1474. }
  1475. }
  1476. .price {
  1477. font-size: 32rpx;
  1478. position: absolute;
  1479. bottom: 20rpx;
  1480. left: 0;
  1481. }
  1482. .cart {
  1483. position: absolute;
  1484. bottom: 20rpx;
  1485. right: 0;
  1486. width: 80rpx;
  1487. height: 80rpx;
  1488. z-index: 2;
  1489. }
  1490. }
  1491. }
  1492. }
  1493. .cart-placeholder {
  1494. height: 450rpx;
  1495. &.cart-list-placeholder {
  1496. height: 150rpx;
  1497. &.again-placeholder {
  1498. height: 210rpx;
  1499. }
  1500. }
  1501. &.more-placeholder {
  1502. height: 540rpx;
  1503. }
  1504. }
  1505. .total-price {
  1506. width: 350rpx;
  1507. text {
  1508. font-size: 32rpx;
  1509. }
  1510. }
  1511. .minus-price {
  1512. width: 350rpx;
  1513. }
  1514. .discount {
  1515. position: fixed;
  1516. bottom: 145rpx;
  1517. left: 0;
  1518. height: 60rpx;
  1519. line-height: 60rpx;
  1520. width: 100%;
  1521. font-size: 24rpx;
  1522. z-index: 10;
  1523. background-color: #fff;
  1524. .discount-bg {
  1525. position: fixed;
  1526. bottom: 145rpx;
  1527. left: 0;
  1528. height: 60rpx;
  1529. line-height: 60rpx;
  1530. width: 100%;
  1531. opacity: 0.1;
  1532. z-index: 10;
  1533. }
  1534. text {
  1535. margin-right: 10rpx;
  1536. }
  1537. }
  1538. .cart-item {
  1539. position: fixed;
  1540. bottom: 0;
  1541. left: 0;
  1542. height: 145rpx;
  1543. width: 100%;
  1544. padding: 0 16rpx 24rpx;
  1545. background-color: #fff;
  1546. z-index: 20;
  1547. box-shadow: 0 0 #{10rpx} rgba(0,0,0,.3);
  1548. .cart-left {
  1549. font-size: 24rpx;
  1550. color: #353535;
  1551. height: 74rpx;
  1552. line-height: 74rpx;
  1553. .cart-icon {
  1554. position: relative;
  1555. margin-right: 45rpx;
  1556. image {
  1557. width: 74rpx;
  1558. height: 74rpx;
  1559. border-radius: 50%;
  1560. }
  1561. view {
  1562. position: absolute;
  1563. top: -5rpx;
  1564. left: 52rpx;
  1565. height: #{34rpx};
  1566. line-height: #{34rpx};
  1567. border-radius: #{17rpx};
  1568. color: #fff;
  1569. padding: 0 #{10rpx};
  1570. }
  1571. }
  1572. .price-info {
  1573. height: 74rpx;
  1574. >view {
  1575. height: 37rpx;
  1576. line-height: 37rpx;
  1577. }
  1578. }
  1579. }
  1580. .cart-right {
  1581. font-size: 28rpx;
  1582. color: #fff;
  1583. height: 78rpx;
  1584. line-height: 78rpx;
  1585. border-radius: 39rpx;
  1586. padding: 0 50rpx;
  1587. }
  1588. }
  1589. .dialog-btn {
  1590. position: fixed;
  1591. bottom: 175rpx;
  1592. left: 30rpx;
  1593. z-index: 10;
  1594. >view {
  1595. margin-top: 10rpx;
  1596. width: 80rpx;
  1597. height: 80rpx;
  1598. image {
  1599. width: 80rpx;
  1600. height: 80rpx;
  1601. }
  1602. }
  1603. }
  1604. .bg {
  1605. position: fixed;
  1606. top: 0;
  1607. left: 0;
  1608. width: 100%;
  1609. height: 100%;
  1610. background-color: rgba(0,0,0,.3);
  1611. z-index: 18;
  1612. .dialog {
  1613. background-color: #fff;
  1614. border-top-left-radius: 16rpx;
  1615. border-top-right-radius: 16rpx;
  1616. position: fixed;
  1617. bottom: -600rpx;
  1618. left: 0;
  1619. width: 100%;
  1620. z-index: 19;
  1621. padding: 0 24rpx;
  1622. &.cart-dialog {
  1623. bottom: 0
  1624. }
  1625. .cart-discount {
  1626. height: 60rpx;
  1627. line-height: 60rpx;
  1628. width: 100%;
  1629. font-size: 24rpx;
  1630. z-index: 10;
  1631. border-top-left-radius: 16rpx;
  1632. border-top-right-radius: 16rpx;
  1633. position: relative;
  1634. .discount-bg {
  1635. position: absolute;
  1636. top: 0;
  1637. left: 0;
  1638. width: 100%;
  1639. height: 100%;
  1640. opacity: 0.1;
  1641. }
  1642. text {
  1643. margin-right: 10rpx;
  1644. }
  1645. }
  1646. .title {
  1647. height: 84rpx;
  1648. line-height: 84rpx;
  1649. font-size: 26rpx;
  1650. padding: 0 24rpx;
  1651. color: #353535;
  1652. image {
  1653. display: block;
  1654. width: 40rpx;
  1655. height: 40rpx;
  1656. margin-right: 12rpx;
  1657. }
  1658. }
  1659. .goods-list {
  1660. padding: 0 24rpx;
  1661. max-height: 510rpx;
  1662. overflow: auto;
  1663. }
  1664. .goods {
  1665. background-color: #fff;
  1666. border-radius: 8rpx;
  1667. width: 702rpx;
  1668. margin-bottom: 20rpx;
  1669. padding-top: 20rpx;
  1670. border-top: 2rpx solid #e2e2e2;
  1671. position: relative;
  1672. z-index: 22;
  1673. &:first-of-type {
  1674. border-top: 0;
  1675. padding-top: 0;
  1676. }
  1677. .cover {
  1678. height: 180rpx;
  1679. width: 180rpx;
  1680. border-radius: 8rpx;
  1681. margin-right: 25rpx;
  1682. }
  1683. .info {
  1684. position: relative;
  1685. width: 492rpx;
  1686. .name {
  1687. width: 445rpx;
  1688. max-height: 72rpx;
  1689. font-size: 28rpx;
  1690. margin-bottom: 20rpx;
  1691. }
  1692. .attr {
  1693. font-size: 24rpx;
  1694. color: #999999;
  1695. .attr-group {
  1696. margin-left: 10rpx;
  1697. &:first-of-type {
  1698. margin-left: 0;
  1699. }
  1700. }
  1701. }
  1702. .price {
  1703. font-size: 30rpx;
  1704. position: absolute;
  1705. bottom: 0;
  1706. left: 0;
  1707. }
  1708. .app-add-subtract {
  1709. height: #{60rpx};
  1710. position: absolute;
  1711. bottom: 0;
  1712. right: 0;
  1713. .app-icon {
  1714. height: #{44rpx};
  1715. width: #{44rpx};
  1716. background-size: 100% 100%;
  1717. background-repeat: no-repeat;
  1718. }
  1719. .app-value {
  1720. height: #{60rpx};
  1721. width: #{88rpx};
  1722. input,view {
  1723. height: #{60rpx};
  1724. width: #{88rpx};
  1725. font-size: #{26rpx};
  1726. color: #353535;
  1727. background-color: #ffffff;
  1728. text-align: center;
  1729. }
  1730. view {
  1731. line-height: #{60rpx};
  1732. color: #999999;
  1733. }
  1734. }
  1735. }
  1736. }
  1737. }
  1738. .end-close {
  1739. position: fixed;
  1740. bottom: 488rpx;
  1741. right: 0;
  1742. z-index: 20;
  1743. width: 80rpx;
  1744. height: 80rpx;
  1745. padding: 25rpx;
  1746. image {
  1747. width: 30rpx;
  1748. height: 30rpx;
  1749. }
  1750. }
  1751. .end-title {
  1752. margin-top: 40rpx;
  1753. font-size: 32rpx;
  1754. color: #353535;
  1755. text-align: center;
  1756. }
  1757. .end-recommend {
  1758. font-size: 24rpx;
  1759. color: #999999;
  1760. height: 70rpx;
  1761. .end-line {
  1762. width: 40rpx;
  1763. height: 2rpx;
  1764. background-color: #999999;
  1765. margin: 0 15rpx;
  1766. }
  1767. }
  1768. .end-sec-title {
  1769. font-size: 28rpx;
  1770. color: #353535;
  1771. text-align: center;
  1772. }
  1773. .recommend-goods {
  1774. margin-top: 25rpx;
  1775. margin-bottom: 135rpx;
  1776. image {
  1777. width: 220rpx;
  1778. height: 220rpx;
  1779. border-radius: 8rpx;
  1780. display: block;
  1781. margin: 0 33rpx;
  1782. }
  1783. }
  1784. .to-activity {
  1785. position: fixed;
  1786. bottom: 0;
  1787. left: 0;
  1788. height: 100rpx;
  1789. width: 100%;
  1790. text-align: center;
  1791. line-height: 100rpx;
  1792. color: #fff;
  1793. font-size: 30rpx;
  1794. }
  1795. }
  1796. }
  1797. .attr-bottom {
  1798. position: fixed;
  1799. z-index: 1666;
  1800. bottom: 0;
  1801. left: 0;
  1802. height: #{110rpx};
  1803. width: 100%;
  1804. font-size: $uni-font-size-general-one;
  1805. .total-price {
  1806. margin-left: 25rpx;
  1807. }
  1808. }
  1809. .input-info {
  1810. margin: 0 24rpx;
  1811. background-color: #fff;
  1812. border-radius: 16rpx;
  1813. width: 702rpx;
  1814. .input-item {
  1815. font-size: 26rpx;
  1816. padding: 30rpx;
  1817. padding-bottom: 15rpx;
  1818. border-top: 2rpx solid #e2e2e2;
  1819. view.input {
  1820. line-height: 52rpx;
  1821. word-break: break-all;
  1822. }
  1823. &:first-of-type {
  1824. border-top: 0;
  1825. }
  1826. .input-label {
  1827. color: #666;
  1828. margin-bottom: 10rpx;
  1829. }
  1830. }
  1831. }
  1832. .u-add-btn {
  1833. color: #ffffff;
  1834. }
  1835. </style>