activity.vue 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798
  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" 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" class="cart-left dir-left-nowrap">
  152. <view class="cart-icon">
  153. <image src="./../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() {
  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. this.attr_price = (+this.selectAttr.price * +this.number).toFixed(2);
  536. },
  537. imgLoad() {
  538. this.is_loading = true;
  539. },
  540. allBuy() {
  541. if(this.submitLock) {
  542. return false;
  543. }
  544. this.showCart = false;
  545. this.scrollTop = this.scrollHeight
  546. if(this.default) {
  547. this.$nextTick().then(() => {
  548. this.scrollTop = 9999999;
  549. this.default = false;
  550. })
  551. uni.showToast({
  552. title: '请确认手机号',
  553. icon: 'none',
  554. duration: 1000
  555. });
  556. return false;
  557. }
  558. if(this.mobile.length == 11 && (/0?(1)[0-9]{10}/.test(this.mobile))) {
  559. this.$subscribe(this.template_message_list).then(res => {
  560. this.submit();
  561. }).catch(() => {
  562. this.submit();
  563. });
  564. }else {
  565. this.$nextTick().then(() => {
  566. this.scrollTop = 9999999;
  567. })
  568. this.stopLoad = false;
  569. this.getList();
  570. uni.showToast({
  571. title: '请输入正确的手机号码',
  572. icon: 'none',
  573. duration: 1000
  574. });
  575. }
  576. },
  577. submit() {
  578. uni.showLoading({
  579. title: '提交订单...'
  580. });
  581. this.stopLoad = true;
  582. this.submitLock = true;
  583. let goods_list = [];
  584. for(let i in this.cart) {
  585. if(this.cart[i].is_exist == 1) {
  586. let para = {};
  587. para.id = this.cart[i].goods_id;
  588. para.goods_attr_id = this.cart[i].goods_attr_id;
  589. para.num = this.cart[i].num;
  590. para.cart_id = this.cart[i].id;
  591. para.attr = this.cart[i].attr_list;
  592. para.cat_id = 0;
  593. para.form_data = [];
  594. goods_list.push(para);
  595. }
  596. }
  597. if(goods_list.length === 0) {
  598. uni.showToast({
  599. title: '请添加有效商品',
  600. icon: 'none',
  601. duration: 1000
  602. });
  603. return false
  604. }
  605. let mch_list = [{
  606. mch_id: 0,
  607. activity_id: this.id,
  608. middleman_id: this.middleman.user_id,
  609. goods_list: goods_list,
  610. distance: 0,
  611. remark: this.remark,
  612. order_form: [],
  613. use_integral: 0,
  614. user_coupon_id: 0
  615. }];
  616. let form = {};
  617. form.list = mch_list;
  618. form.address_id = 0;
  619. form.address = {
  620. name: this.userInfo.nickname,
  621. mobile: this.mobile
  622. };
  623. this.$request({
  624. url: this.$api.community.order_submit,
  625. data: {
  626. form_data: JSON.stringify(form)
  627. },
  628. method: 'post'
  629. }).then(response => {
  630. if (response.code === 0) {
  631. this.getPayOrderId(response.data.queue_id, response.data.token);
  632. } else {
  633. this.submitLock = false;
  634. this.stopLoad = false;
  635. uni.hideLoading();
  636. uni.showModal({
  637. title: '提示',
  638. content: response.msg,
  639. showCancel: false,
  640. });
  641. }
  642. }).catch(e => {
  643. this.submitLock = false;
  644. this.stopLoad = false;
  645. uni.hideLoading();
  646. uni.showModal({
  647. title: '提示',
  648. content: e.errMsg,
  649. showCancel: false,
  650. });
  651. });
  652. },
  653. getPayOrderId(queue_id, token) {
  654. this.$request({
  655. url: this.$api.order.pay_data,
  656. method: 'post',
  657. data: {
  658. queue_id: queue_id,
  659. token: token,
  660. },
  661. }).then(response => {
  662. if (response.code === 0) {
  663. if (response.data.retry && response.data.retry === 1) {
  664. this.getPayDataTimer = setTimeout(() => {
  665. this.getPayOrderId(queue_id, token);
  666. }, 1000);
  667. } else {
  668. uni.hideLoading();
  669. this.cart = [];
  670. this.pay(response.data);
  671. }
  672. } else {
  673. this.submitLock = false;
  674. uni.hideLoading();
  675. uni.showModal({
  676. title: '提示',
  677. content: response.msg,
  678. showCancel: false,
  679. });
  680. }
  681. }).catch(e => {
  682. this.submitLock = false;
  683. uni.hideLoading();
  684. uni.showModal({
  685. title: '提示',
  686. content: e.errMsg,
  687. showCancel: false,
  688. });
  689. });
  690. },
  691. pay(data) {
  692. uni.removeStorage({
  693. key: 'middleman_info'
  694. });
  695. this.$payment.pay(data.id).then(() => {
  696. this.submitLock = false;
  697. let url = '/plugins/community/order/order';
  698. uni.navigateTo({
  699. url: `/pages/order-submit/pay-result?payment_order_union_id=${data.id}&order_page_url=${url}`
  700. });
  701. }).catch(() => {
  702. this.submitLock = false;
  703. this.toOrder();
  704. });
  705. },
  706. _calcValue(index,type) {
  707. if(type === 'minus') {
  708. this.cart[index].num--;
  709. }else if(type === 'plus') {
  710. this.cart[index].num++;
  711. }
  712. this._onBlur(index);
  713. },
  714. _onBlur(index) {
  715. this.total = 0;
  716. this.cartLength = 0;
  717. for(let i in this.cart) {
  718. this.total = (+this.total + (+this.cart[i].price*this.cart[i].num));
  719. this.cartLength += +this.cart[i].num;
  720. }
  721. let minus = 0;
  722. for(let i in this.activity.full_price) {
  723. if(+this.activity.full_price[i].full_price < +this.total || +this.activity.full_price[i].full_price == +this.total) {
  724. if(this.activity.full_price[i].reduce_price > minus) {
  725. minus = +this.activity.full_price[i].reduce_price;
  726. }
  727. }
  728. }
  729. this.total = (+this.total - minus).toFixed(2);
  730. this.minus = minus.toFixed(2);
  731. if(this.cart[index].num == 0) {
  732. this.delCart(index)
  733. }else {
  734. this.$request({
  735. url: this.$api.community.cart_edit,
  736. data: {
  737. list: JSON.stringify(this.cart)
  738. },
  739. });
  740. }
  741. },
  742. clearAll() {
  743. let cart = [];
  744. for(let i in this.cart) {
  745. cart.push(this.cart[i].id)
  746. }
  747. this.cart = [];
  748. this.showCart = false;
  749. this.$request({
  750. url: this.$api.community.cart_delete,
  751. data: {
  752. cart_id_list: JSON.stringify(cart),
  753. },
  754. }).then(() => {
  755. this.stopLoad = false;
  756. this.getList();
  757. })
  758. },
  759. delCart(index) {
  760. let list = [];
  761. list.push(this.cart[index].id)
  762. this.cart.splice(index,1);
  763. this.total = 0;
  764. this.cartLength = 0;
  765. for(let i in this.cart) {
  766. this.total = (+this.total + (+this.cart[i].price*this.cart[i].num));
  767. this.cartLength += +this.cart[i].num
  768. }
  769. let minus = 0;
  770. for(let i in this.activity.full_price) {
  771. if(+this.activity.full_price[i].full_price < +this.total || +this.activity.full_price[i].full_price == +this.total) {
  772. if(this.activity.full_price[i].reduce_price > minus) {
  773. minus = +this.activity.full_price[i].reduce_price
  774. }
  775. }
  776. }
  777. this.total = (+this.total - minus).toFixed(2);
  778. this.minus = minus.toFixed(2);
  779. if(this.cart.length === 0) {
  780. this.showCart = false
  781. }
  782. this.$request({
  783. url: this.$api.community.cart_delete,
  784. data: {
  785. cart_id_list: list,
  786. },
  787. }).then(() => {
  788. this.stopLoad = false;
  789. this.getList();
  790. }).catch(() => {
  791. this.attrShow = false;
  792. uni.hideLoading();
  793. });
  794. },
  795. add() {
  796. uni.showLoading({
  797. title: '加入购物车'
  798. });
  799. let para = {
  800. activity_id: this.id,
  801. goods_id: this.selectAttr.goods_id,
  802. goods_attr_id: this.selectAttr.id,
  803. num: this.number
  804. }
  805. this.$request({
  806. url: this.$api.community.cart_add,
  807. data: para,
  808. method: 'post'
  809. }).then(response => {
  810. if(response.code === 0) {
  811. this.addResult(response.data.queue_id, response.data.token);
  812. } else {
  813. uni.hideLoading();
  814. this.attrShow = false;
  815. uni.showToast({
  816. title: response.msg,
  817. icon: 'none',
  818. duration: 1000
  819. });
  820. }
  821. }).catch(() => {
  822. this.attrShow = false;
  823. uni.hideLoading();
  824. });
  825. },
  826. addResult(queue_id, token) {
  827. this.$request({
  828. url: this.$api.community.cart_result,
  829. method: 'post',
  830. data: {
  831. queue_id: queue_id,
  832. token: token,
  833. },
  834. }).then(response => {
  835. if (response.code === 0) {
  836. if (response.data && response.data.retry === 1) {
  837. this.getResult = setTimeout(() => {
  838. this.addResult(queue_id, token);
  839. }, 1000);
  840. } else {
  841. this.attrShow = false;
  842. let index = -1;
  843. for(let i in this.cart) {
  844. if(this.cart[i].goods_id == this.selectAttr.goods_id && this.cart[i].goods_attr_id == this.selectAttr.id) {
  845. index = i;
  846. }
  847. }
  848. if(index > -1) {
  849. this.cart[index].num += +this.number;
  850. } else {
  851. let para = {
  852. activity_id: this.id,
  853. community_goods_id: this.goods.id,
  854. goods_id: this.selectAttr.goods_id,
  855. goods_attr_id: this.selectAttr.id,
  856. num: this.number,
  857. name: this.goods.name,
  858. attr_list: this.selectAttr.attr_list,
  859. pic_url: this.selectAttr.pic_url,
  860. id: 0,
  861. price: this.selectAttr.price,
  862. is_exist: 1
  863. }
  864. this.cart.push(para);
  865. }
  866. this.total = 0;
  867. this.cartLength = 0;
  868. for(let item of this.cart) {
  869. this.total = (+this.total + (+item.price*item.num));
  870. this.cartLength += +item.num;
  871. }
  872. let minus = 0;
  873. for(let i in this.activity.full_price) {
  874. if(+this.activity.full_price[i].full_price < +this.total || +this.activity.full_price[i].full_price == +this.total) {
  875. if(this.activity.full_price[i].reduce_price > minus) {
  876. minus = +this.activity.full_price[i].reduce_price;
  877. }
  878. }
  879. }
  880. this.total = (+this.total - minus).toFixed(2);
  881. this.minus = minus.toFixed(2);
  882. uni.hideLoading();
  883. }
  884. } else {
  885. uni.hideLoading();
  886. uni.showModal({
  887. title: '提示',
  888. content: response.msg,
  889. showCancel: false
  890. });
  891. }
  892. }).catch(e => {
  893. this.attrShow = false;
  894. uni.hideLoading();
  895. uni.showModal({
  896. title: '提示',
  897. content: e.errMsg,
  898. showCancel: false
  899. });
  900. });
  901. },
  902. toBuy(item) {
  903. this.selectAttr = null;
  904. this.goods = item;
  905. this.attrShow = true;
  906. },
  907. getCart() {
  908. let that = this;
  909. if(that.stopLoad) {
  910. return false;
  911. }
  912. that.$request({
  913. url: that.$api.community.cart,
  914. data: {
  915. middleman_id: that.middleman.user_id,
  916. activity_id: that.activity.id,
  917. }
  918. }).then(response=>{
  919. if(that.stopLoad) {
  920. return false;
  921. }
  922. if(response.code === 0) {
  923. that.total = 0;
  924. that.cartLength = 0;
  925. that.cart = response.data.list;
  926. that.is_exist = 0;
  927. for(let i in that.cart) {
  928. if(that.cart[i].is_exist == 0) {
  929. that.is_exist++;
  930. }
  931. that.total = (+that.total + (+that.cart[i].price*that.cart[i].num));
  932. that.cartLength += +that.cart[i].num;
  933. }
  934. let minus = 0;
  935. for(let i in that.activity.full_price) {
  936. if(+that.activity.full_price[i].full_price < +that.total || +that.activity.full_price[i].full_price == +that.total) {
  937. if(that.activity.full_price[i].reduce_price > minus) {
  938. minus = +that.activity.full_price[i].reduce_price;
  939. }
  940. }
  941. }
  942. that.total = (+that.total - minus).toFixed(2);
  943. that.minus = minus.toFixed(2);
  944. }else {
  945. that.stopLoad = true;
  946. uni.showToast({
  947. title: response.msg,
  948. icon: 'none',
  949. duration: 1000
  950. });
  951. if(response.msg === '所选活动已下架') {
  952. setTimeout(()=>{
  953. uni.navigateBack({});
  954. },1000);
  955. }
  956. }
  957. }).catch(() => {
  958. that.$hideLoading();
  959. });
  960. },
  961. getTime(time) {
  962. if(time > 86399) {
  963. this.d = Math.floor(time / 86400);
  964. time = time - (86400*this.d);
  965. }else {
  966. this.d = 0;
  967. }
  968. if(time > 3599) {
  969. this.h = Math.floor(time / 3600);
  970. if(this.h < 10) {
  971. this.h = '0' + this.h;
  972. }
  973. time = time - (3600*this.h);
  974. }else {
  975. this.h = '00'
  976. }
  977. if(time > 59) {
  978. this.m = Math.floor(time / 60);
  979. if(this.m < 10) {
  980. this.m = '0' + this.m;
  981. }
  982. time = time - (60*this.m);
  983. }else {
  984. this.m = '00';
  985. }
  986. if(time < 60) {
  987. this.s = time;
  988. if(this.s < 10) {
  989. this.s = '0' + this.s;
  990. }
  991. }
  992. },
  993. getSetting() {
  994. let that = this;
  995. that.$request({
  996. url: that.$api.community.setting,
  997. }).then(response=>{
  998. if(response.code === 0) {
  999. that.head = that.community.a;
  1000. switch(that.getTheme) {
  1001. case 'b':
  1002. that.head = that.community.b;
  1003. break;
  1004. case 'c':
  1005. that.head = that.community.c;
  1006. break;
  1007. case 'd':
  1008. that.head = that.community.d;
  1009. break;
  1010. case 'e':
  1011. that.head = that.community.e;
  1012. break;
  1013. case 'g':
  1014. that.head = that.community.g;
  1015. break;
  1016. case 'h':
  1017. that.head = that.community.h;
  1018. break;
  1019. case 'i':
  1020. that.head = that.community.i;
  1021. break;
  1022. }
  1023. that.setting = response.data;
  1024. that.getList();
  1025. }else {
  1026. that.$hideLoading();
  1027. uni.showToast({
  1028. title: response.msg,
  1029. icon: 'none',
  1030. duration: 1000
  1031. });
  1032. }
  1033. }).catch(() => {
  1034. that.$hideLoading();
  1035. });
  1036. },
  1037. getList() {
  1038. let that = this;
  1039. let para = {
  1040. id: that.id,
  1041. longitude: that.longitude,
  1042. latitude: that.latitude
  1043. }
  1044. if(that.middleman_id > 0) {
  1045. para.middleman_id = that.middleman_id
  1046. }
  1047. that.$request({
  1048. url: that.$api.community.user_activity,
  1049. data: para
  1050. }).then(response=>{
  1051. that.$hideLoading();
  1052. if(response.code === 0) {
  1053. if(response.data.list.length === 0) {
  1054. that.stopLoad = true;
  1055. uni.showToast({
  1056. title: '活动商品异常,正在返回活动主页',
  1057. icon: 'none',
  1058. duration: 1000
  1059. });
  1060. setTimeout(()=>{
  1061. uni.redirectTo({
  1062. url: '/plugins/community/list/list'
  1063. });
  1064. },1000);
  1065. return false;
  1066. }
  1067. if(response.data.list.length < 20) {
  1068. that.list = response.data.list;
  1069. }else {
  1070. for(let i in response.data.list) {
  1071. that.list[i] = response.data.list[i];
  1072. }
  1073. }
  1074. if(that.first) {
  1075. that.first = false;
  1076. if(response.data.last_mobile) {
  1077. that.mobile = response.data.last_mobile;
  1078. that.default = true;
  1079. }
  1080. response.data.list.length < 20 ? that.more = false : that.more = true;
  1081. }
  1082. that.activity = response.data.activity;
  1083. that.is_middleman = response.data.is_middleman;
  1084. that.middleman = response.data.middleman_info;
  1085. if(that.middleman_id == 0) {
  1086. uni.getStorage({
  1087. key: 'middleman_info',
  1088. success: function (res) {
  1089. if(res.data && res.data.id > 0) {
  1090. that.middleman = res.data;
  1091. }
  1092. }
  1093. })
  1094. }
  1095. that.space = ~~that.middleman.distance +'m';
  1096. if(that.middleman.distance > 1000) {
  1097. that.space = (that.middleman.distance / 1000).toFixed(1) + 'km';
  1098. }
  1099. if(that.share) {
  1100. uni.setStorage({
  1101. key: 'middleman_info',
  1102. data: that.middleman
  1103. });
  1104. }
  1105. that.user_list = response.data.user_list;
  1106. if(that.user_list.length > that.activity.user_num){
  1107. that.user_list = that.user_list.slice(0,that.activity.user_num);
  1108. }
  1109. that.template_message_list = response.data.template_message_list;
  1110. if(that.activity.activity_status == 1) {
  1111. if(!that.stopLoad) {
  1112. setTimeout(function(){
  1113. that.getList();
  1114. },5000)
  1115. }
  1116. that.getCart();
  1117. let end_time = Math.floor(that.user_list[that.user_list.length - 1].time / 60);
  1118. if(end_time > 60) {
  1119. that.end_time = '1小时前';
  1120. }else if(end_time == 0) {
  1121. that.end_time = '刚刚';
  1122. }else {
  1123. that.end_time = end_time+ '分钟前';
  1124. }
  1125. }
  1126. if(that.activity.activity_status == 2 && response.data.recommend_activity.activity_id > 0) {
  1127. setTimeout(function(){
  1128. that.recommend = response.data.recommend_activity;
  1129. that.recommendDialog = true;
  1130. var animation = uni.createAnimation({
  1131. duration: 1000,
  1132. timingFunction: 'ease',
  1133. })
  1134. that.animation = animation;
  1135. setTimeout(function(){
  1136. animation.bottom(0).step();
  1137. that.animationData = animation.export();
  1138. setTimeout(function(){
  1139. that.showOther = true;
  1140. },1500);
  1141. },200);
  1142. },800);
  1143. }
  1144. if(that.activity.time > 0) {
  1145. let time = that.activity.time;
  1146. that.timeInterval = setInterval(() =>{
  1147. that.getTime(time);
  1148. time--;
  1149. if(time == 0) {
  1150. clearInterval(that.timeInterval);
  1151. that.getList();
  1152. }
  1153. },1000);
  1154. }
  1155. }else {
  1156. that.stopLoad = true;
  1157. if(response.msg === '周边没有活动可参加') {
  1158. uni.showToast({
  1159. title: '周边没有活动可参加,正在返回活动主页',
  1160. icon: 'none',
  1161. duration: 1000
  1162. });
  1163. setTimeout(()=>{
  1164. uni.redirectTo({
  1165. url: '/plugins/community/list/list'
  1166. });
  1167. },1000);
  1168. }else {
  1169. uni.showToast({
  1170. title: response.msg,
  1171. icon: 'none',
  1172. duration: 1000
  1173. });
  1174. }
  1175. }
  1176. }).catch(() => {
  1177. that.$hideLoading();
  1178. });
  1179. },
  1180. },
  1181. onShareAppMessage: function() {
  1182. return this.$shareAppMessage({
  1183. title: this.setting.app_share_title ? this.setting.app_share_title : this.title,
  1184. imageUrl: this.setting.app_share_pic ? this.setting.app_share_pic : this.list[0].cover_pic,
  1185. path: "/plugins/community/activity/activity",
  1186. params: {
  1187. id: this.id,
  1188. user_id: this.userInfo.options.user_id,
  1189. middleman_id: this.middleman.user_id
  1190. }
  1191. });
  1192. },
  1193. // #ifdef MP-WEIXIN
  1194. onShareTimeline: function() {
  1195. return this.$shareTimeline({
  1196. title: this.share_title ? this.share_title : this.title,
  1197. query: {
  1198. id: this.id,
  1199. user_id: this.userInfo.options.user_id,
  1200. middleman_id: this.middleman.user_id
  1201. }
  1202. });
  1203. }
  1204. // #endif
  1205. }
  1206. </script>
  1207. <style scoped lang="scss">
  1208. .middleman {
  1209. margin-top: -360rpx;
  1210. height: 190rpx;
  1211. color: #ffffff;
  1212. padding: 0 35rpx;
  1213. position: relative;
  1214. .space {
  1215. color: #fff;
  1216. font-size: 22rpx;
  1217. position: absolute;
  1218. top: 45rpx;
  1219. right: 30rpx;
  1220. }
  1221. .arrow-image {
  1222. margin-left: 36rpx;
  1223. width: #{12rpx};
  1224. height: #{24rpx};
  1225. position: absolute;
  1226. top: 50%;
  1227. right: 30rpx;
  1228. margin-top: -12rpx;
  1229. }
  1230. .location {
  1231. font-size: 40rpx;
  1232. width: 70%;
  1233. margin-bottom: 15rpx;
  1234. margin-top: -10rpx;
  1235. }
  1236. .middleman-info {
  1237. font-size: 26rpx;
  1238. .avatar {
  1239. width: 58rpx;
  1240. height: 58rpx;
  1241. border-radius: 50%;
  1242. margin-right: 20rpx;
  1243. flex-shrink: 0;
  1244. }
  1245. .user-info {
  1246. .icon {
  1247. height: 25rpx;
  1248. width: 25rpx;
  1249. margin-right: 6rpx;
  1250. color: #ff4544;
  1251. }
  1252. }
  1253. }
  1254. }
  1255. .time {
  1256. padding: 0 36rpx;
  1257. color: #ff4544;
  1258. height: 90rpx;
  1259. line-height: 90rpx;
  1260. margin: 0 24rpx;
  1261. width: 702rpx;
  1262. border-top-left-radius: 16rpx;
  1263. border-top-right-radius: 16rpx;
  1264. background-color: #F2F2F2;
  1265. position: relative;
  1266. z-index: 2;
  1267. font-size: 24rpx;
  1268. .icon {
  1269. color: #ff4544;
  1270. width: 24rpx;
  1271. height: 24rpx;
  1272. margin-right: 10rpx;
  1273. }
  1274. }
  1275. .status-area {
  1276. width: 702rpx;
  1277. margin: 0 24rpx;
  1278. padding-bottom: 24rpx;
  1279. border-radius: 16rpx;
  1280. background-color: #f7f7f7;
  1281. position: relative;
  1282. z-index: 2;
  1283. .status {
  1284. background-color: #fff;
  1285. border-radius: 16rpx;
  1286. padding: 24rpx;
  1287. .end-time {
  1288. color: #ff4544;
  1289. text-align: center;
  1290. font-size: 24rpx;
  1291. }
  1292. .condition {
  1293. color: #353535;
  1294. font-size: 24rpx;
  1295. width: 100%;
  1296. .end-time {
  1297. color: #ff4544;
  1298. }
  1299. }
  1300. .progress {
  1301. width: #{654rpx};
  1302. background-color: #f0f0f0;
  1303. border-radius: #{10rpx};
  1304. height: #{20rpx};
  1305. position: relative;
  1306. margin: 15rpx 0;
  1307. overflow: hidden;
  1308. view {
  1309. border-radius: #{10rpx};
  1310. height: #{20rpx};
  1311. position: absolute;
  1312. top: 0;
  1313. left: 0;
  1314. z-index: 2;
  1315. }
  1316. }
  1317. .buy-user {
  1318. height: 58rpx;
  1319. .user-list {
  1320. image {
  1321. width: 58rpx;
  1322. height: 58rpx;
  1323. margin-left: -14rpx;
  1324. border-radius: 50%;
  1325. border: 2rpx solid #ffffff;
  1326. }
  1327. }
  1328. .sales {
  1329. font-size: 24rpx;
  1330. line-height: 58rpx;
  1331. height: 58rpx;
  1332. margin-left: 14rpx;
  1333. text {
  1334. color: #ff4544;
  1335. }
  1336. }
  1337. }
  1338. .new-buy {
  1339. margin-top: 20rpx;
  1340. color: #999999;
  1341. font-size: 24rpx;
  1342. image {
  1343. width: 60rpx;
  1344. height: 60rpx;
  1345. border-radius: 50%;
  1346. display: block;
  1347. margin-right: 20rpx;
  1348. }
  1349. }
  1350. }
  1351. }
  1352. .list {
  1353. margin: 0 24rpx;
  1354. width: 702rpx;
  1355. .goods {
  1356. background-color: #fff;
  1357. border-radius: 16rpx;
  1358. width: 702rpx;
  1359. height: 220rpx;
  1360. margin-bottom: 20rpx;
  1361. position: relative;
  1362. z-index: 2;
  1363. .out-dialog {
  1364. width: #{220rpx};
  1365. height: #{220rpx};
  1366. border-radius: #{16rpx};
  1367. position: absolute;
  1368. top: 0;
  1369. left: 0;
  1370. z-index: 10;
  1371. background-color: rgba(0,0,0,.5);
  1372. image {
  1373. width: #{220rpx};
  1374. height: #{220rpx};
  1375. border-radius: #{16rpx};
  1376. }
  1377. }
  1378. .cover {
  1379. height: 220rpx;
  1380. width: 220rpx;
  1381. border-radius: 16rpx;
  1382. margin-right: 15rpx;
  1383. }
  1384. .info {
  1385. padding: 20rpx 0;
  1386. position: relative;
  1387. .name {
  1388. width: 445rpx;
  1389. // #ifndef MP-ALIPAY
  1390. height: 72rpx;
  1391. // #endif
  1392. // #ifdef MP-ALIPAY
  1393. height: 66rpx;
  1394. // #endif
  1395. font-size: 28rpx;
  1396. }
  1397. .sale {
  1398. height: 30rpx;
  1399. line-height: 28rpx;
  1400. font-size: 22rpx;
  1401. margin-top: 18rpx;
  1402. display: inline-block;
  1403. position: relative;
  1404. >view {
  1405. padding: 0 10rpx;
  1406. border: 2rpx solid;
  1407. display: inline-block;
  1408. }
  1409. .sale-bg {
  1410. padding: 0;
  1411. position: absolute;
  1412. top: 0;
  1413. left: 0;
  1414. opacity: 0.1;
  1415. border-top-left-radius: 15rpx;
  1416. border-bottom-left-radius: 15rpx;
  1417. border: 0;
  1418. height: 100%;
  1419. width: 100%;
  1420. }
  1421. view:first-of-type {
  1422. border-right: 0;
  1423. border-top-left-radius: 15rpx;
  1424. border-bottom-left-radius: 15rpx;
  1425. }
  1426. .stock {
  1427. border-top-right-radius: 15rpx;
  1428. border-bottom-right-radius: 15rpx;
  1429. border-left: 0;
  1430. background-color: #fff;
  1431. }
  1432. }
  1433. .price {
  1434. font-size: 32rpx;
  1435. position: absolute;
  1436. bottom: 20rpx;
  1437. left: 0;
  1438. }
  1439. .cart {
  1440. position: absolute;
  1441. bottom: 20rpx;
  1442. right: 0;
  1443. width: 80rpx;
  1444. height: 80rpx;
  1445. z-index: 2;
  1446. }
  1447. }
  1448. }
  1449. }
  1450. .cart-placeholder {
  1451. height: 450rpx;
  1452. &.cart-list-placeholder {
  1453. height: 150rpx;
  1454. &.again-placeholder {
  1455. height: 210rpx;
  1456. }
  1457. }
  1458. &.more-placeholder {
  1459. height: 540rpx;
  1460. }
  1461. }
  1462. .total-price {
  1463. width: 350rpx;
  1464. text {
  1465. font-size: 32rpx;
  1466. }
  1467. }
  1468. .minus-price {
  1469. width: 350rpx;
  1470. }
  1471. .discount {
  1472. position: fixed;
  1473. bottom: 145rpx;
  1474. left: 0;
  1475. height: 60rpx;
  1476. line-height: 60rpx;
  1477. width: 100%;
  1478. font-size: 24rpx;
  1479. z-index: 10;
  1480. background-color: #fff;
  1481. .discount-bg {
  1482. position: fixed;
  1483. bottom: 145rpx;
  1484. left: 0;
  1485. height: 60rpx;
  1486. line-height: 60rpx;
  1487. width: 100%;
  1488. opacity: 0.1;
  1489. z-index: 10;
  1490. }
  1491. text {
  1492. margin-right: 10rpx;
  1493. }
  1494. }
  1495. .cart-item {
  1496. position: fixed;
  1497. bottom: 0;
  1498. left: 0;
  1499. height: 145rpx;
  1500. width: 100%;
  1501. padding: 0 16rpx 24rpx;
  1502. background-color: #fff;
  1503. z-index: 20;
  1504. box-shadow: 0 0 #{10rpx} rgba(0,0,0,.3);
  1505. .cart-left {
  1506. font-size: 24rpx;
  1507. color: #353535;
  1508. height: 74rpx;
  1509. line-height: 74rpx;
  1510. .cart-icon {
  1511. position: relative;
  1512. margin-right: 45rpx;
  1513. image {
  1514. width: 74rpx;
  1515. height: 74rpx;
  1516. border-radius: 50%;
  1517. }
  1518. view {
  1519. position: absolute;
  1520. top: -5rpx;
  1521. left: 52rpx;
  1522. height: #{34rpx};
  1523. line-height: #{34rpx};
  1524. border-radius: #{17rpx};
  1525. color: #fff;
  1526. padding: 0 #{10rpx};
  1527. }
  1528. }
  1529. .price-info {
  1530. height: 74rpx;
  1531. >view {
  1532. height: 37rpx;
  1533. line-height: 37rpx;
  1534. }
  1535. }
  1536. }
  1537. .cart-right {
  1538. font-size: 28rpx;
  1539. color: #fff;
  1540. height: 78rpx;
  1541. line-height: 78rpx;
  1542. border-radius: 39rpx;
  1543. padding: 0 50rpx;
  1544. }
  1545. }
  1546. .dialog-btn {
  1547. position: fixed;
  1548. bottom: 175rpx;
  1549. left: 30rpx;
  1550. z-index: 10;
  1551. >view {
  1552. margin-top: 10rpx;
  1553. width: 80rpx;
  1554. height: 80rpx;
  1555. image {
  1556. width: 80rpx;
  1557. height: 80rpx;
  1558. }
  1559. }
  1560. }
  1561. .bg {
  1562. position: fixed;
  1563. top: 0;
  1564. left: 0;
  1565. width: 100%;
  1566. height: 100%;
  1567. background-color: rgba(0,0,0,.3);
  1568. z-index: 18;
  1569. .dialog {
  1570. background-color: #fff;
  1571. border-top-left-radius: 16rpx;
  1572. border-top-right-radius: 16rpx;
  1573. position: fixed;
  1574. bottom: -600rpx;
  1575. left: 0;
  1576. width: 100%;
  1577. z-index: 19;
  1578. padding: 0 24rpx;
  1579. &.cart-dialog {
  1580. bottom: 0
  1581. }
  1582. .cart-discount {
  1583. height: 60rpx;
  1584. line-height: 60rpx;
  1585. width: 100%;
  1586. font-size: 24rpx;
  1587. z-index: 10;
  1588. border-top-left-radius: 16rpx;
  1589. border-top-right-radius: 16rpx;
  1590. position: relative;
  1591. .discount-bg {
  1592. position: absolute;
  1593. top: 0;
  1594. left: 0;
  1595. width: 100%;
  1596. height: 100%;
  1597. opacity: 0.1;
  1598. }
  1599. text {
  1600. margin-right: 10rpx;
  1601. }
  1602. }
  1603. .title {
  1604. height: 84rpx;
  1605. line-height: 84rpx;
  1606. font-size: 26rpx;
  1607. padding: 0 24rpx;
  1608. color: #353535;
  1609. image {
  1610. display: block;
  1611. width: 40rpx;
  1612. height: 40rpx;
  1613. margin-right: 12rpx;
  1614. }
  1615. }
  1616. .goods-list {
  1617. padding: 0 24rpx;
  1618. max-height: 510rpx;
  1619. overflow: auto;
  1620. }
  1621. .goods {
  1622. background-color: #fff;
  1623. border-radius: 8rpx;
  1624. width: 702rpx;
  1625. margin-bottom: 20rpx;
  1626. padding-top: 20rpx;
  1627. border-top: 2rpx solid #e2e2e2;
  1628. position: relative;
  1629. z-index: 22;
  1630. &:first-of-type {
  1631. border-top: 0;
  1632. padding-top: 0;
  1633. }
  1634. .cover {
  1635. height: 180rpx;
  1636. width: 180rpx;
  1637. border-radius: 8rpx;
  1638. margin-right: 25rpx;
  1639. }
  1640. .info {
  1641. position: relative;
  1642. width: 492rpx;
  1643. .name {
  1644. width: 445rpx;
  1645. max-height: 72rpx;
  1646. font-size: 28rpx;
  1647. margin-bottom: 20rpx;
  1648. }
  1649. .attr {
  1650. font-size: 24rpx;
  1651. color: #999999;
  1652. .attr-group {
  1653. margin-left: 10rpx;
  1654. &:first-of-type {
  1655. margin-left: 0;
  1656. }
  1657. }
  1658. }
  1659. .price {
  1660. font-size: 30rpx;
  1661. position: absolute;
  1662. bottom: 0;
  1663. left: 0;
  1664. }
  1665. .app-add-subtract {
  1666. height: #{60rpx};
  1667. position: absolute;
  1668. bottom: 0;
  1669. right: 0;
  1670. .app-icon {
  1671. height: #{44rpx};
  1672. width: #{44rpx};
  1673. background-size: 100% 100%;
  1674. background-repeat: no-repeat;
  1675. }
  1676. .app-value {
  1677. height: #{60rpx};
  1678. width: #{88rpx};
  1679. input,view {
  1680. height: #{60rpx};
  1681. width: #{88rpx};
  1682. font-size: #{26rpx};
  1683. color: #353535;
  1684. background-color: #ffffff;
  1685. text-align: center;
  1686. }
  1687. view {
  1688. line-height: #{60rpx};
  1689. color: #999999;
  1690. }
  1691. }
  1692. }
  1693. }
  1694. }
  1695. .end-close {
  1696. position: fixed;
  1697. bottom: 488rpx;
  1698. right: 0;
  1699. z-index: 20;
  1700. width: 80rpx;
  1701. height: 80rpx;
  1702. padding: 25rpx;
  1703. image {
  1704. width: 30rpx;
  1705. height: 30rpx;
  1706. }
  1707. }
  1708. .end-title {
  1709. margin-top: 40rpx;
  1710. font-size: 32rpx;
  1711. color: #353535;
  1712. text-align: center;
  1713. }
  1714. .end-recommend {
  1715. font-size: 24rpx;
  1716. color: #999999;
  1717. height: 70rpx;
  1718. .end-line {
  1719. width: 40rpx;
  1720. height: 2rpx;
  1721. background-color: #999999;
  1722. margin: 0 15rpx;
  1723. }
  1724. }
  1725. .end-sec-title {
  1726. font-size: 28rpx;
  1727. color: #353535;
  1728. text-align: center;
  1729. }
  1730. .recommend-goods {
  1731. margin-top: 25rpx;
  1732. margin-bottom: 135rpx;
  1733. image {
  1734. width: 220rpx;
  1735. height: 220rpx;
  1736. border-radius: 8rpx;
  1737. display: block;
  1738. margin: 0 33rpx;
  1739. }
  1740. }
  1741. .to-activity {
  1742. position: fixed;
  1743. bottom: 0;
  1744. left: 0;
  1745. height: 100rpx;
  1746. width: 100%;
  1747. text-align: center;
  1748. line-height: 100rpx;
  1749. color: #fff;
  1750. font-size: 30rpx;
  1751. }
  1752. }
  1753. }
  1754. .attr-bottom {
  1755. position: fixed;
  1756. z-index: 1666;
  1757. bottom: 0;
  1758. left: 0;
  1759. height: #{110rpx};
  1760. width: 100%;
  1761. font-size: $uni-font-size-general-one;
  1762. .total-price {
  1763. margin-left: 25rpx;
  1764. }
  1765. }
  1766. .input-info {
  1767. margin: 0 24rpx;
  1768. background-color: #fff;
  1769. border-radius: 16rpx;
  1770. width: 702rpx;
  1771. .input-item {
  1772. font-size: 26rpx;
  1773. padding: 30rpx;
  1774. padding-bottom: 15rpx;
  1775. border-top: 2rpx solid #e2e2e2;
  1776. view.input {
  1777. line-height: 52rpx;
  1778. word-break: break-all;
  1779. }
  1780. &:first-of-type {
  1781. border-top: 0;
  1782. }
  1783. .input-label {
  1784. color: #666;
  1785. margin-bottom: 10rpx;
  1786. }
  1787. }
  1788. }
  1789. .u-add-btn {
  1790. color: #ffffff;
  1791. }
  1792. </style>