index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336
  1. <template>
  2. <view class="group-con" v-if="allData">
  3. <view class="w-full header-gradient relative z-99">
  4. <view class="swiper-box" v-if="allData.groupBuyUserActivityDoneList">
  5. <swiper :indicator-dots="false" autoplay interval="2500" duration="500" vertical="true" circular="true">
  6. <block v-for="(item,index) in allData.groupBuyUserActivityDoneList" :key='index' v-if="item.id>0">
  7. <swiper-item>
  8. <view class='line1'>
  9. <image class="swiper-img" :src="item.groupAvatar" mode=""></image>
  10. <text class="swiper-text">{{item.groupNickname}} 拼团成功</text>
  11. </view>
  12. </swiper-item>
  13. </block>
  14. </swiper>
  15. </view>
  16. <view class="p-20 p-bottom" @click="toGroupProduct">
  17. <view class="w-full bg--w111-fff rd-24rpx p-20 flex relative">
  18. <easy-loadimage mode="widthFix" :image-src="allData.productDetailResponse.productInfo.image"
  19. width="240rpx" height="240rpx" :radius="10"></easy-loadimage>
  20. <view class="flex-1 h-240 pl-20 flex-col justify-between">
  21. <view class="w-full">
  22. <view class="w-full fs-28 lh-40rpx line2">{{allData.productDetailResponse.productInfo.name}}
  23. </view>
  24. <view class="flex fs-20 mt-14">
  25. <view class="tuan-num text--w111-fff flex-center">
  26. {{allData.recordForShare.buyingCountNum}}人团
  27. </view>
  28. <view class="complete font-red flex-center">已拼{{allData.recordForShare.latestBuyCount}}份
  29. </view>
  30. </view>
  31. </view>
  32. <view class="w-full flex-between-center">
  33. <view>
  34. <view class="flex items-baseline">
  35. <text class="fs-22 lh-30rpx font-red fw-500">拼团价:</text>
  36. <priceStyle :price="allData.recordForShare.activePrice"></priceStyle>
  37. </view>
  38. <view class="text-line text--w111-999 fs-22 lh-30rpx mt-12">
  39. ¥{{allData.productDetailResponse.productInfo.price}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="abs-badge">
  44. <image class="w-full h-full" src="../static/images/pinkSucess.png" v-if="pinkBool === 10">
  45. </image>
  46. <image class="w-full h-full" src="../static/images/pinkErr.png" v-else-if="pinkBool === -1">
  47. </image>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="px-20">
  53. <view class="wrapper">
  54. <view class="tips sucess-tips" v-if="pinkBool === 10">恭喜您拼团成功</view>
  55. <view class="tips font-num-err" v-else-if="pinkBool === -1">还差<span
  56. class="font-num pl-10 pr-10">{{ allData.recordForShare.buyingCountNum-allData.recordForShare.yetBuyingNum }}人</span>,拼团失败
  57. </view>
  58. <view class="tips" v-else-if="pinkBool === 0">拼团中,还差<span
  59. class="font-num font-num-sucess pl-10 pr-10">{{ allData.recordForShare.buyingCountNum-allData.recordForShare.yetBuyingNum }}人</span>拼团成功
  60. </view>
  61. <view class="title acea-row row-center-wrapper" v-if="pinkBool === 0">
  62. <view class="name acea-row row-center-wrapper">
  63. 剩余
  64. <CountDown :is-day="true" :tip-text="' '" :day-text="' : '" :hour-text="' : '"
  65. :minute-text="' : '" :second-text="' '" :isCol="false" :datatime="dataTimeLimit"
  66. :bgColor="bgColor"></CountDown>结束
  67. </view>
  68. </view>
  69. <view class="list acea-row row-middle result" :class="[ iShidden ? 'on' : '']">
  70. <view class="pictrue" v-if="(fictiStatus===1&&pinkBool!==10)||fictiStatus!==1"
  71. v-for="(item, index) in allData.groupBuyUserList" :key="index">
  72. <view class="image-box" v-if="item.id">
  73. <image class="groupAvater" :src="item.groupAvatar" />
  74. </view>
  75. <image v-else src="../static/images/pinkNo.png" mode=""></image>
  76. <view v-if="item.isLeader" class="group-leader">团长</view>
  77. </view>
  78. <view class="pictrue" v-if="fictiStatus===1&&pinkBool===10"
  79. v-for="(item, index) in allData.groupBuyUserList" :key="index">
  80. <view class="image-box" v-if="item.id">
  81. <image class="groupAvater" :src="item.groupAvatar" />
  82. </view>
  83. <view class="image-box" v-else>
  84. <image src="../static/images/normal.png" mode=""></image>
  85. </view>
  86. <view v-if="item.isLeader" class="group-leader">团长</view>
  87. </view>
  88. </view>
  89. <view v-if=" allData.groupBuyUserList.length > 10" class="lookAll acea-row row-center-wrapper"
  90. @click="lookAll">
  91. {{ iShidden ? '收起' : '查看全部' }}
  92. <span class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></span>
  93. </view>
  94. <view v-if="userBool === 1 && isOk == 0 && pinkBool === 0">
  95. <view class="teamBnt" @click="listenerActionSheet">邀请好友参团</view>
  96. </view>
  97. <view class="teamBnt" v-else-if="userBool === 0 && pinkBool === 0">
  98. <view @click="toAddGroup">我要参团</view>
  99. </view>
  100. <view class="teamBnt" v-if="pinkBool === 10 || pinkBool === -1"
  101. @click="goDetail(allData.recordForShare.productId,allData.recordForShare.groupActivityId)">
  102. {{`${pinkBool === 10?'再次':'重新'}开团`}}
  103. </view>
  104. <view class="lookOrder" v-if="pinkBool === 10" @click="goOrder">
  105. 查看订单信息
  106. <span class="iconfont icon-xiangyou"></span>
  107. </view>
  108. </view>
  109. <!-- -->
  110. <view class="play-wrapper">
  111. <view class="w-full flex-center">
  112. <image class="zs" src="../static/images/pinkLeft.png"></image>
  113. <text class="fs-28 fw-500 text--w111-333 lh-44rpx px-6">拼团玩法</text>
  114. <image class="zs" src="../static/images/pinkRight.png"></image>
  115. </view>
  116. <view class="wrapper-main acea-row row-center-wrapper">
  117. <view class="progress-box">
  118. <view class="progress">
  119. <view v-if="!nowShow&&pinkBool != 10" class="inner inner1 bg-red"></view>
  120. <view v-if="nowShow&&pinkBool !== 10" class="inner inner2 bg-red"></view>
  121. <view v-if="pinkBool === 10" class="inner inner3 bg-red"></view>
  122. </view>
  123. <view class="steps acea-row">
  124. <view class="item">
  125. <view class="head bg-red">1</view>
  126. <view class="main">开团/参团享团购价</view>
  127. </view>
  128. <view class="item">
  129. <view class="head bg-red" :class="nowShow&&pinkBool !== 10?'bg-red':''">2</view>
  130. <view class="main">邀请好友参团优惠多</view>
  131. </view>
  132. <view class="item">
  133. <view class="head" :class="pinkBool === 10 ? 'bg-red' : ''">3</view>
  134. <view class="main">人满发货不满退款</view>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. <view class="mt-40 all-pink">
  141. <view class="w-full flex-center">
  142. <image class="zs" src="../static/images/pinkLeft.png"></image>
  143. <text class="fs-28 fw-500 text--w111-333 lh-44rpx px-6">大家都在拼</text>
  144. <image class="zs" src="../static/images/pinkRight.png"></image>
  145. </view>
  146. <view class="card w-full bg--w111-fff rd-24rpx p-20 flex mt-24" v-for="(item,index) in groupGood"
  147. :key="index" @tap="goDetail(item.productId,item.groupActivityId)">
  148. <view class="relative">
  149. <view v-show="item.quota===0" class="sellOut">已售罄</view>
  150. <easy-loadimage mode="widthFix" :image-src="item.imageUrl" width="240rpx" height="240rpx"
  151. :radius="10"></easy-loadimage>
  152. </view>
  153. <view class="flex-1 h-240 pl-20 flex-col justify-between">
  154. <view class="w-full">
  155. <view class="w-full fs-28 lh-40rpx line2">{{item.productName}}</view>
  156. <view class="flex fs-20 mt-14">
  157. <view class="tuan-num text--w111-fff flex-center">{{item.buyCount}}人团</view>
  158. <view class="complete font-red flex-center">已拼{{item.latestBuyCount}}份</view>
  159. </view>
  160. </view>
  161. <view class="w-full flex-between-center flex-special">
  162. <view>
  163. <view class="flex items-baseline">
  164. <text class="fs-22 lh-30rpx font-red fw-500">拼团价:</text>
  165. <priceStyle :price="item.activePrice"></priceStyle>
  166. </view>
  167. <view class="text-line text--w111-999 fs-22 lh-30rpx mt-12">¥{{item.price}}</view>
  168. </view>
  169. <view class="groupBtn">参与拼团</view>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. <!-- 分享按钮 -->
  176. <view class="generate-posters" :class="posters ? 'on' : ''">
  177. <view class="generateCon acea-row row-middle">
  178. <!-- #ifdef MP -->
  179. <button class="item" open-type="share" hover-class="none">
  180. <view class="pictrue">
  181. <image src="../static/images/weixin.png"></image>
  182. </view>
  183. <view class="">分享给好友</view>
  184. </button>
  185. <!-- #endif -->
  186. <!-- #ifdef APP-PLUS -->
  187. <view class="item" @click="appShare('WXSceneSession')">
  188. <view class="iconfont icon-weixin3"></view>
  189. <view class="">微信好友</view>
  190. </view>
  191. <view class="item" @click="appShare('WXSenceTimeline')">
  192. <view class="iconfont icon-pengyouquan"></view>
  193. <view class="">微信朋友圈</view>
  194. </view>
  195. <!-- #endif -->
  196. <!-- #ifdef H5 || MP -->
  197. <view class="item" @click="getpreviewImage">
  198. <view class="pictrue">
  199. <image src="../static/images/changan.png"></image>
  200. </view>
  201. <view class="">预览发图</view>
  202. </view>
  203. <!-- #endif -->
  204. <!-- #ifdef MP -->
  205. <button class="item" hover-class="none" @click="savePosterPath">
  206. <view class="pictrue">
  207. <image src="../static/images/haibao.png"></image>
  208. </view>
  209. <view class="">保存海报</view>
  210. </button>
  211. <!-- #endif -->
  212. </view>
  213. <view class="generateClose acea-row row-center-wrapper" @click="posterImageClose">取消</view>
  214. </view>
  215. <view class="mask" v-if="canvasStatus"></view>
  216. <!-- 海报展示 -->
  217. <view class='poster-pop' v-if="canvasStatus">
  218. <image :src='imagePath'></image>
  219. </view>
  220. <view class="canvas" v-else>
  221. <canvas style="width:750px;height:1190px;" canvas-id="firstCanvas"></canvas>
  222. <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
  223. </view>
  224. <!-- 发送给朋友图片 -->
  225. <view class="share-box" v-if="H5ShareBox">
  226. <image :src="urlDomain + 'crmebimage/presets/share-info.png'" @click="H5ShareBox = false"></image>
  227. </view>
  228. </view>
  229. </view>
  230. </template>
  231. <script>
  232. import {
  233. HTTP_H5_URL
  234. } from "@/config/app.js";
  235. // #ifdef MP
  236. import {
  237. base64src
  238. } from '@/utils/base64src.js'
  239. import {
  240. mpQrcode
  241. } from '@/api/api.js';
  242. // #endif
  243. import {
  244. groupBuySkuListApi
  245. } from '@/api/group'
  246. import {
  247. imageBase64
  248. } from "@/api/public";
  249. import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
  250. import CountDown from '@/components/countDown';
  251. import BaseMoney from '@/components/BaseMoney.vue';
  252. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  253. import priceStyle from '@/components/priceStyle'
  254. import {
  255. groupbuySkuOrderShare,
  256. groupbuySkuOrderReadShare
  257. } from '@/api/activity.js'
  258. import {
  259. toLogin
  260. } from '@/libs/login.js';
  261. import {
  262. tokenIsExistApi
  263. } from "@/api/api.js";
  264. import {
  265. silenceBindingSpread
  266. } from "@/utils";
  267. import {
  268. mapGetters
  269. } from "vuex";
  270. const app = getApp();
  271. export default {
  272. components: {
  273. CountDown,
  274. BaseMoney,
  275. easyLoadimage,
  276. priceStyle
  277. },
  278. data: function() {
  279. return {
  280. where: {
  281. page: 1,
  282. limit: 5,
  283. showgroup: 1,
  284. },
  285. pinkPriceImg: '../static/images/pinkPrice.png',
  286. pinkbackgd: 'http://39.105.58.247:20800/crmebimage/public/store/2025/05/20/523c1b940a614e9fa22eb4a97b07dc5590yf5x3wco.png',
  287. pinkWhiteBg: '../static/images/whiteBg.png',
  288. qrcodeSize: 600,
  289. canvasStatus: false, //是否显示海报
  290. bgColor: {
  291. 'bgColor': 'rgba(233,51,35,0.2)',
  292. 'Color': '#E93323',
  293. 'width': '36rpx',
  294. 'timeTxtwidth': '16rpx',
  295. 'isDay': true
  296. },
  297. isOk: 0, //判断拼团是否完成
  298. pinkBool: 0, //判断拼团是否成功
  299. userBool: 1, //判断当前用户是否在团内|0=未在,1=在
  300. pinkT: [], //团长信息
  301. iShidden: false,
  302. userInfo: {},
  303. posters: false,
  304. weixinStatus: false,
  305. H5ShareBox: false, //公众号分享图片
  306. attrValue: '', //已选属性
  307. /* imgHost: HTTP_REQUEST_URL, */
  308. endTime: false,
  309. allData: null,
  310. loadend: false,
  311. loading: false,
  312. loadTitle: '加载更多',
  313. groupGood: [],
  314. imgTop: '',
  315. storeImage: '', //海报产品图
  316. errT: '',
  317. imagePath: '', //海报路径
  318. publicLoginType: app.globalData.publicLoginType, //公众号登录方式(单选),1微信授权,2手机号登录
  319. orderNo: '',
  320. nowShow: '',
  321. sd: null,
  322. fictiStatus: 0,
  323. groupLeaderAvatar: '',
  324. urlDomain: this.$Cache.get("imgHost"),
  325. };
  326. },
  327. onShow() {
  328. // #ifdef MP
  329. uni.setNavigationBarColor({
  330. frontColor: '#ffffff',
  331. backgroundColor: '#E93323',
  332. })
  333. // #endif
  334. //绑定分销关系
  335. this.getTokenIsExist();
  336. },
  337. onLoad(options) {
  338. let value;
  339. //小程序扫码进入
  340. if (options.scene) {
  341. value = this.$util.getUrlParams(decodeURIComponent(options.scene));
  342. } else {
  343. value = options
  344. }
  345. value.sd && (this.sd = value.sd)
  346. value.orderNo && this.getData(value.orderNo)
  347. if (value.sd) this.$store.commit('Change_Spread', value.sd);
  348. if (!value.orderNo) {
  349. this.getShareData(value)
  350. }
  351. this.getGroupList();
  352. },
  353. // 滚动监听
  354. onPageScroll(e) {
  355. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  356. uni.$emit('scroll');
  357. },
  358. // #ifdef MP
  359. /**
  360. * 用户点击右上角分享
  361. */
  362. onShareAppMessage: function() {
  363. let that = this;
  364. return {
  365. title: that.allData.productDetailResponse.productInfo.name || '',
  366. imageUrl: that.allData.productDetailResponse.productInfo.image || '',
  367. path: `/pages/activity/status/index?gt=${that.allData.recordForShare.groupActivityId}&pt=${that.allData.recordForShare.productId}&rd=${that.allData.recordForShare.groupRecordId}&sd=${that.uid}`,
  368. }
  369. },
  370. // #endif
  371. computed: {
  372. dataTimeLimit() {
  373. let date;
  374. if (this.allData) {
  375. date = new Date(this.allData.recordForShare.endTime.replace(/-/g, "/")).getTime() / 1000
  376. }
  377. return date
  378. },
  379. ...mapGetters(['isLogin', 'globalData', 'uid']),
  380. },
  381. methods: {
  382. toGroupProduct() {
  383. uni.navigateTo({
  384. url: `/pages/goods/goods_details/index?id=${this.allData.recordForShare.productId}&mt=2&gd=${this.allData.recordForShare.groupActivityId}`
  385. })
  386. },
  387. nowShowChange() {
  388. let arr = this.allData.groupBuyUserList.filter(val => val.id > 0)
  389. this.nowShow = arr.length > 1 ? true : false
  390. },
  391. //校验token是否有效,true为有效,false为无效
  392. getTokenIsExist() {
  393. tokenIsExistApi().then((res) => {
  394. silenceBindingSpread(this.isLogin, this.globalData.spread);
  395. }).catch(err => {});
  396. },
  397. //去订单
  398. goOrder() {
  399. uni.navigateTo({
  400. url: '/pages/goods/order_details/index?orderNo=' + this.orderNo
  401. })
  402. },
  403. //to商品详情
  404. goDetail(productId, groupActivityId) {
  405. uni.navigateTo({
  406. url: `/pages/goods/goods_details/index?id=${productId}&mt=2&gd=${groupActivityId}`
  407. })
  408. },
  409. //我要参团
  410. toAddGroup() {
  411. uni.navigateTo({
  412. url: `/pages/goods/goods_details/index?id=${this.allData.recordForShare.productId}&mt=2&gd=${this.allData.recordForShare.groupActivityId}&rd=${this.allData.recordForShare.groupRecordId}&sd=${this.sd}`
  413. })
  414. },
  415. lookAll: function() {
  416. this.iShidden = !this.iShidden;
  417. },
  418. getData(orderNo) {
  419. groupbuySkuOrderShare(orderNo).then(res => {
  420. this.allData = res.data
  421. this.pinkBool = res.data.recordForShare.recordStatus
  422. this.isOk = res.data.recordForShare.recordStatus == 0 ? 0 : 1
  423. this.fictiStatus = res.data.recordForShare.fictiStatus
  424. this.orderNo = res.data.orderNo
  425. this.getShareInfo()
  426. this.nowShowChange()
  427. }).catch(err => {
  428. uni.showToast({
  429. title: err,
  430. icon: 'none'
  431. })
  432. setTimeout(() => {
  433. uni.switchTab({
  434. url: '/pages/index/index'
  435. })
  436. }, 500)
  437. })
  438. },
  439. getShareData(options) {
  440. groupbuySkuOrderReadShare(options.gt, options.pt, options.rd).then(res => {
  441. this.allData = res.data
  442. this.pinkBool = res.data.recordForShare.recordStatus
  443. this.isOk = res.data.recordForShare.recordStatus == 0 ? 0 : 1
  444. this.fictiStatus = res.data.recordForShare.fictiStatus
  445. this.userBool = res.data.recordForShare.canBuyFlag
  446. this.orderNo = res.data.orderNo
  447. this.getShareInfo()
  448. this.nowShowChange()
  449. }).catch(err => {
  450. uni.showToast({
  451. title: err,
  452. icon: 'none'
  453. })
  454. setTimeout(() => {
  455. uni.switchTab({
  456. url: '/pages/index/index'
  457. })
  458. }, 500)
  459. })
  460. },
  461. getShareInfo() {
  462. if (this.isLogin) {
  463. //#ifdef H5
  464. this.make();
  465. this.ShareInfo();
  466. this.getImageBase64(this.allData.productDetailResponse.productInfo.image);
  467. // #endif
  468. };
  469. // #ifdef MP
  470. this.getQrcode();
  471. // #endif
  472. // #ifdef MP
  473. this.imgTop = this.allData.productDetailResponse.productInfo.image
  474. // #endif
  475. // #ifndef H5
  476. this.downloadFilestoreImage();
  477. // #endif
  478. },
  479. /**
  480. * 分享打开
  481. *
  482. */
  483. listenerActionSheet: function() {
  484. this.goPoster()
  485. this.posters = true;
  486. // #ifdef H5
  487. if (!this.isLogin) {
  488. toLogin();
  489. } else {
  490. if (this.$wechat.isWeixin()) {
  491. this.weixinStatus = true;
  492. }
  493. }
  494. // #endif
  495. },
  496. closePosters: function() {
  497. this.posters = false;
  498. this.currentPage = false;
  499. },
  500. //隐藏海报
  501. posterImageClose: function() {
  502. this.canvasStatus = false
  503. this.posters = false;
  504. },
  505. //替换安全域名
  506. setDomain: function(url) {
  507. url = url ? url.toString() : '';
  508. //本地调试打开,生产请注销
  509. if (url.indexOf("https://") > -1) return url;
  510. else return url.replace('http://', 'https://');
  511. },
  512. // #ifdef APP-PLUS
  513. appShare(scene) {
  514. let that = this;
  515. uni.share({
  516. provider: "weixin",
  517. scene: scene,
  518. type: 0,
  519. href: `${HTTP_H5_URL}/pages/activity/status/index?gt=${this.allData.recordForShare.groupActivityId}&pt=${this.allData.recordForShare.productId}&rd=${this.allData.recordForShare.groupRecordId}&sd=${this.uid}`,
  520. title: that.allData.productDetailResponse.productInfo.name,
  521. imageUrl: that.allData.productDetailResponse.productInfo.image,
  522. success: function(res) {
  523. that.posters = false;
  524. },
  525. fail: function(err) {
  526. uni.showToast({
  527. title: "分享失败",
  528. icon: "none",
  529. duration: 2000,
  530. });
  531. that.posters = false;
  532. },
  533. });
  534. },
  535. // #endif
  536. //获取海报产品图(解决跨域问题,只适用于小程序)
  537. downloadFilestoreImage: function() {
  538. let that = this;
  539. uni.downloadFile({
  540. url: that.setDomain(that.allData.recordForShare.groupLeaderAvatar),
  541. success: function(res) {
  542. that.groupLeaderAvatar = res.tempFilePath;
  543. },
  544. fail: function() {
  545. return that.$util.Tips({
  546. title: ''
  547. });
  548. that.groupLeaderAvatar = '';
  549. },
  550. });
  551. },
  552. // 小程序关闭分享弹窗;
  553. goFriend: function() {
  554. this.posters = false;
  555. },
  556. // 小程序二维码
  557. getQrcode() {
  558. let that = this;
  559. let data = {
  560. scene: `gt=${this.allData.recordForShare.groupActivityId}&pt=${this.allData.recordForShare.productId}&rd=${this.allData.recordForShare.groupRecordId}&sd=${this.uid}`,
  561. page: 'pages/activity/status/index'
  562. }
  563. mpQrcode(data).then(res => {
  564. base64src(res.data.code, Date.now(), res => {
  565. that.PromotionCode = res;
  566. });
  567. }).catch(err => {
  568. that.errT = err;
  569. });
  570. },
  571. // 生成二维码;
  572. make() {
  573. let href =
  574. `${this.globalData.frontDomain}/pages/activity/status/index?gt=${this.allData.recordForShare.groupActivityId}&pt=${this.allData.recordForShare.productId}&rd=${this.allData.recordForShare.groupRecordId}&sd=${this.uid}`
  575. uQRCode.make({
  576. canvasId: 'qrcode',
  577. text: href,
  578. size: this.qrcodeSize,
  579. margin: 10,
  580. success: res => {
  581. this.PromotionCode = res;
  582. },
  583. complete: () => {},
  584. fail: res => {
  585. this.$util.Tips({
  586. title: '海报二维码生成失败!'
  587. });
  588. }
  589. })
  590. },
  591. getImageBase64: function(images) {
  592. let that = this;
  593. imageBase64({
  594. url: images
  595. }).then(res => {
  596. that.imgTop = res.data.code;
  597. })
  598. imageBase64({
  599. url: that.allData.recordForShare.groupLeaderAvatar
  600. }).then(res => {
  601. that.groupLeaderAvatar = res.data.code;
  602. })
  603. },
  604. /**
  605. * 生成海报
  606. */
  607. goPoster: function() {
  608. let that = this;
  609. uni.showLoading({
  610. title: '海报生成中',
  611. mask: true
  612. });
  613. that.posters = false;
  614. let arrImagesUrl = '';
  615. let arrImagesUrlTop = '';
  616. if (!that.PromotionCode) {
  617. uni.hideLoading();
  618. that.$util.Tips({
  619. title: that.errT
  620. });
  621. return
  622. }
  623. setTimeout(() => {
  624. if (!that.imgTop || !that.groupLeaderAvatar) {
  625. uni.hideLoading();
  626. that.$util.Tips({
  627. title: '无法生成商品海报!'
  628. });
  629. return
  630. }
  631. }, 1000);
  632. uni.downloadFile({
  633. url: that.imgTop, //仅为示例,并非真实的资源
  634. success: (res) => {
  635. arrImagesUrlTop = res.tempFilePath;
  636. let arrImages = [that.pinkbackgd, arrImagesUrlTop, that.PromotionCode, that
  637. .pinkWhiteBg, that.pinkPriceImg, that.groupLeaderAvatar
  638. ];
  639. let name = that.allData.productDetailResponse.productInfo.name;
  640. let price = that.allData.recordForShare.activePrice;
  641. let people = that.allData.recordForShare.buyingCountNum - that.allData
  642. .recordForShare.yetBuyingNum;
  643. let groupLeaderNickname = that.allData.recordForShare.groupLeaderNickname
  644. setTimeout(() => {
  645. that.$util.groupCanvas(arrImages, name, price, people,
  646. groupLeaderNickname,
  647. function(tempFilePath) {
  648. that.imagePath = tempFilePath;
  649. that.canvasStatus = true;
  650. uni.hideLoading();
  651. });
  652. }, 500);
  653. }
  654. });
  655. },
  656. // 图片预览;
  657. getpreviewImage: function() {
  658. if (this.imagePath) {
  659. let photoList = [];
  660. photoList.push(this.imagePath)
  661. uni.previewImage({
  662. urls: photoList,
  663. current: this.imagePath
  664. });
  665. } else {
  666. this.$util.Tips({
  667. title: '您的海报尚未生成'
  668. });
  669. }
  670. },
  671. /*
  672. * 保存到手机相册
  673. */
  674. // #ifdef MP
  675. savePosterPath: function() {
  676. let that = this;
  677. uni.getSetting({
  678. success(res) {
  679. if (!res.authSetting['scope.writePhotosAlbum']) {
  680. uni.authorize({
  681. scope: 'scope.writePhotosAlbum',
  682. success() {
  683. uni.saveImageToPhotosAlbum({
  684. filePath: that.imagePath,
  685. success: function(res) {
  686. that.posterImageClose();
  687. that.$util.Tips({
  688. title: '保存成功',
  689. icon: 'success'
  690. });
  691. },
  692. fail: function(res) {
  693. that.$util.Tips({
  694. title: '保存失败'
  695. });
  696. }
  697. })
  698. }
  699. })
  700. } else {
  701. uni.saveImageToPhotosAlbum({
  702. filePath: that.imagePath,
  703. success: function(res) {
  704. that.posterImageClose();
  705. that.$util.Tips({
  706. title: '保存成功',
  707. icon: 'success'
  708. });
  709. },
  710. fail: function(res) {
  711. that.$util.Tips({
  712. title: '保存失败'
  713. });
  714. },
  715. })
  716. }
  717. }
  718. })
  719. },
  720. // #endif
  721. ShareInfo() {
  722. let data = this.allData.productDetailResponse.productInfo;
  723. let href =
  724. `${this.globalData.frontDomain}/pages/activity/status/index?gt=${this.allData.recordForShare.groupActivityId}&pt=${this.allData.recordForShare.productId}&rd=${this.allData.recordForShare.groupRecordId}&sd=${this.uid}`;
  725. if (this.$wechat.isWeixin() && this.publicLoginType == 1) {
  726. let configAppMessage = {
  727. // desc: data.storeInfo,
  728. title: data.name,
  729. link: href,
  730. imgUrl: data.image
  731. };
  732. this.$wechat.wechatEvevt([
  733. "updateAppMessageShareData",
  734. "updateTimelineShareData",
  735. "onMenuShareAppMessage",
  736. "onMenuShareTimeline"
  737. ], configAppMessage).then(res => {}).catch(err => {
  738. console.log(err);
  739. })
  740. }
  741. },
  742. //拼团商品列表
  743. getGroupList() {
  744. if (this.loadend) return;
  745. if (this.loading) return;
  746. this.loading = true;
  747. groupBuySkuListApi(this.where).then(res => {
  748. let list = res.data;
  749. let limit = this.where.limit;
  750. this.where.page++;
  751. this.loadend = limit > list.length;
  752. this.groupGood = this.groupGood.concat(list);
  753. this.loading = false;
  754. this.loadTitle = this.loadend ? '没有更多内容啦~' : '加载更多';
  755. }).catch(err => {
  756. this.loading = false;
  757. this.loadTitle = '加载更多';
  758. return this.$util.Tips({
  759. title: err
  760. });
  761. })
  762. },
  763. onReachBottom() {
  764. this.getGroupList();
  765. }
  766. }
  767. };
  768. </script>
  769. <style lang="scss" scoped>
  770. .header-gradient {
  771. background: linear-gradient(180deg, #E93323 0%, #E93323 52%, #F5F5F5 100%);
  772. }
  773. .tuan-num {
  774. width: 70rpx;
  775. height: 32rpx;
  776. background: #E93323;
  777. border-radius: 8rpx 0 0 8rpx;
  778. }
  779. .complete {
  780. width: 110rpx;
  781. height: 32rpx;
  782. background: rgba(233, 51, 35, 0.1);
  783. border-radius: 0 8rpx 8rpx 0;
  784. }
  785. .font-red {
  786. color: #e93323;
  787. }
  788. .bg-red {
  789. background: linear-gradient(90deg, #FF7931 0%, #E93323 100%) !important;
  790. }
  791. .notice-box {
  792. width: 348rpx;
  793. background: linear-gradient(270deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 99%);
  794. }
  795. .zs {
  796. width: 42rpx;
  797. height: 36rpx;
  798. }
  799. .abs-badge {
  800. width: 102rpx;
  801. height: 102rpx;
  802. position: absolute;
  803. right: 20rpx;
  804. bottom: 20rpx;
  805. border-radius: 50%;
  806. }
  807. .generate-posters {
  808. width: 100%;
  809. background-color: #fff;
  810. position: fixed;
  811. left: 0;
  812. bottom: 0;
  813. z-index: 300;
  814. transform: translate3d(0, 100%, 0);
  815. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  816. border-top: 1rpx solid #eee;
  817. }
  818. .generate-posters.on {
  819. transform: translate3d(0, 0, 0);
  820. }
  821. .generate-posters .item {
  822. display: flex;
  823. flex-direction: column;
  824. align-items: center;
  825. flex: 1;
  826. text-align: center;
  827. font-size: 30rpx;
  828. }
  829. .generate-posters .item .pictrue {
  830. width: 86rpx;
  831. height: 86rpx;
  832. margin-bottom: 10rpx;
  833. image {
  834. width: 100%;
  835. height: 100%;
  836. border-radius: 50%;
  837. }
  838. }
  839. .generate-posters .item .iconfont {
  840. font-size: 80rpx;
  841. color: #5eae72;
  842. }
  843. .generate-posters .item .iconfont.icon-haibao {
  844. color: #5391f1;
  845. }
  846. .group-con {
  847. padding-bottom: 30rpx !important;
  848. }
  849. .group-con .wrapper {
  850. background-color: #fff;
  851. margin-top: 20rpx;
  852. padding: 48rpx 0;
  853. border-radius: 24rpx;
  854. }
  855. .group-con .wrapper .title {
  856. margin-top: 48rpx;
  857. }
  858. .group-con .wrapper .title .line {
  859. width: 136rpx;
  860. height: 1px;
  861. background-color: #ddd;
  862. }
  863. .group-con .wrapper .title .name {
  864. // margin: 0 45rpx;
  865. font-size: 24rpx;
  866. line-height: 36rpx;
  867. color: #3D3D3D;
  868. }
  869. .group-con .wrapper .title .name .time {
  870. margin: 0 12rpx;
  871. }
  872. .group-con .wrapper .title .name .timeTxt {
  873. color: #fc4141;
  874. }
  875. .group-con .wrapper .title .name /deep/.time .styleAll {
  876. text-align: center;
  877. border-radius: 8rpx;
  878. font-size: 24rpx;
  879. font-weight: bold;
  880. display: inline-block;
  881. vertical-align: middle;
  882. width: 36rpx;
  883. height: 36rpx;
  884. line-height: 36rpx;
  885. }
  886. .group-con .wrapper .tips {
  887. font-size: 32rpx;
  888. font-weight: bold;
  889. text-align: center;
  890. // margin-top: 30rpx;
  891. line-height: 42rpx;
  892. color: #333333;
  893. }
  894. .group-con .wrapper .list {
  895. // padding: 0 30rpx;
  896. padding-left: 44rpx;
  897. margin-top: 40rpx;
  898. }
  899. .group-con .wrapper .list.result {
  900. position: relative;
  901. max-height: 240rpx;
  902. overflow: hidden;
  903. padding-top: 20rpx;
  904. .group-leader {
  905. position: absolute;
  906. width: 72rpx;
  907. height: 30rpx;
  908. background: #E93323;
  909. border-radius: 16rpx;
  910. font-size: 20rpx;
  911. color: #FFFFFF;
  912. text-align: center;
  913. line-height: 30rpx;
  914. top: 72rpx;
  915. left: 10rpx;
  916. }
  917. }
  918. .group-con .wrapper .list.result.on {
  919. max-height: 2000rpx;
  920. }
  921. .group-con .wrapper .list .pictrue {
  922. width: 94rpx;
  923. height: 94rpx;
  924. margin: 0 38rpx 30rpx 0;
  925. position: relative;
  926. }
  927. .group-con .wrapper .list .pictrue .label {
  928. position: absolute;
  929. bottom: 0;
  930. left: 50%;
  931. width: 72rpx;
  932. height: 30rpx;
  933. margin: 18rpx 0 0 -36rpx;
  934. color: #fff;
  935. font-size: 20rpx;
  936. background-color: var(--view-theme);
  937. text-align: center;
  938. line-height: 30rpx;
  939. border-radius: 15rpx;
  940. }
  941. .group-con .wrapper .list .pictrue img,
  942. .group-con .wrapper .list .pictrue image {
  943. width: 100%;
  944. height: 100%;
  945. border-radius: 50%;
  946. border: 2rpx solid var(--view-theme);
  947. }
  948. .group-con .wrapper .list .pictrue image.img-none {
  949. border: none;
  950. }
  951. .group-con .wrapper .lookAll {
  952. font-size: 24rpx;
  953. color: #282828;
  954. padding-top: 10rpx;
  955. }
  956. .group-con .wrapper .lookAll .iconfont {
  957. font-size: 25rpx;
  958. margin: 2rpx 0 0 10rpx;
  959. }
  960. .group-con .wrapper .teamBnt {
  961. font-size: 28rpx;
  962. width: 646rpx;
  963. height: 88rpx;
  964. border-radius: 44rpx;
  965. text-align: center;
  966. line-height: 88rpx;
  967. color: #fff;
  968. margin: 32rpx auto 0;
  969. background-color: #e93323;
  970. }
  971. .group-con .wrapper .cancel,
  972. .group-con .wrapper .lookOrder {
  973. text-align: center;
  974. font-size: 24rpx;
  975. color: #333333;
  976. padding-top: 30rpx;
  977. }
  978. .group-con .wrapper .cancel .iconfont {
  979. font-size: 35rpx;
  980. color: #2c2c2c;
  981. vertical-align: -4rpx;
  982. margin-right: 9rpx;
  983. }
  984. .group-con .wrapper .lookOrder .iconfont {
  985. font-size: 25rpx;
  986. color: #2c2c2c;
  987. margin-left: 10rpx;
  988. }
  989. .share-box {
  990. z-index: 1000;
  991. position: fixed;
  992. left: 0;
  993. top: 0;
  994. width: 100%;
  995. height: 100%;
  996. image {
  997. width: 100%;
  998. height: 100%;
  999. }
  1000. }
  1001. .play-wrapper {
  1002. padding: 32rpx 0 132rpx;
  1003. border-radius: 24rpx;
  1004. margin-top: 20rpx;
  1005. background-color: #FFFFFF;
  1006. }
  1007. .play-wrapper .wrapper-header {
  1008. text-align: center;
  1009. }
  1010. .play-wrapper .wrapper-header .title {
  1011. display: inline-block;
  1012. height: 40rpx;
  1013. padding: 0 48rpx;
  1014. font-weight: 500;
  1015. font-size: 28rpx;
  1016. line-height: 40rpx;
  1017. color: #333333;
  1018. }
  1019. .play-wrapper .wrapper-main {
  1020. margin-top: 42rpx;
  1021. }
  1022. .play-wrapper .wrapper-main .item {
  1023. position: relative;
  1024. margin-right: 210rpx;
  1025. }
  1026. .play-wrapper .wrapper-main .item:last-child {
  1027. margin-right: 0;
  1028. }
  1029. .play-wrapper .wrapper-main .item .head {
  1030. position: relative;
  1031. width: 36rpx;
  1032. height: 36rpx;
  1033. border-radius: 18rpx;
  1034. background-color: #DDDDDD;
  1035. text-align: center;
  1036. font-weight: 600;
  1037. font-size: 24rpx;
  1038. line-height: 36rpx;
  1039. color: #FFFFFF;
  1040. }
  1041. .play-wrapper .wrapper-main .item .main {
  1042. position: absolute;
  1043. top: 0;
  1044. left: 50%;
  1045. width: 120rpx;
  1046. margin: 68rpx 0 0 -60rpx;
  1047. text-align: center;
  1048. font-size: 24rpx;
  1049. line-height: 34rpx;
  1050. color: #333333;
  1051. }
  1052. .play-wrapper .wrapper-main .progress-box {
  1053. position: relative;
  1054. }
  1055. .play-wrapper .wrapper-main .progress {
  1056. position: absolute;
  1057. top: 50%;
  1058. left: 50%;
  1059. width: 494rpx;
  1060. height: 12rpx;
  1061. background-color: #EEEEEE;
  1062. transform: translate(-50%, -50%);
  1063. }
  1064. .play-wrapper .wrapper-main .progress .inner {
  1065. width: 70%;
  1066. height: 12rpx;
  1067. border-radius: 6rpx;
  1068. background: linear-gradient(90deg, #E93323 0%, #FF7931 100%);
  1069. }
  1070. .play-wrapper .wrapper-main .progress .inner.inner1 {
  1071. width: 30% !important;
  1072. }
  1073. .play-wrapper .wrapper-main .progress .inner.inner2 {
  1074. width: 70% !important;
  1075. }
  1076. .play-wrapper .wrapper-main .progress .inner.inner3 {
  1077. width: 100% !important;
  1078. }
  1079. .font-num-sucess {
  1080. color: #E93323 !important;
  1081. }
  1082. .font-num-err {
  1083. color: #999 !important;
  1084. }
  1085. .canvas {
  1086. position: fixed;
  1087. z-index: -5;
  1088. opacity: 0;
  1089. }
  1090. .poster-pop {
  1091. position: fixed;
  1092. width: 500rpx;
  1093. height: 714rpx;
  1094. top: 50%;
  1095. left: 50%;
  1096. transform: translateX(-50%);
  1097. margin-top: -432rpx;
  1098. z-index: 399;
  1099. }
  1100. .poster-pop image {
  1101. width: 100%;
  1102. height: 100%;
  1103. display: block;
  1104. }
  1105. .poster-pop .close {
  1106. width: 46rpx;
  1107. height: 75rpx;
  1108. position: fixed;
  1109. right: 0;
  1110. top: -73rpx;
  1111. display: block;
  1112. }
  1113. .poster-pop .save-poster {
  1114. background-color: #df2d0a;
  1115. font-size: :22rpx;
  1116. color: #fff;
  1117. text-align: center;
  1118. height: 76rpx;
  1119. line-height: 76rpx;
  1120. width: 100%;
  1121. }
  1122. .poster-pop .keep {
  1123. color: #fff;
  1124. text-align: center;
  1125. font-size: 25rpx;
  1126. margin-top: 10rpx;
  1127. }
  1128. .mask {
  1129. position: fixed;
  1130. top: 0;
  1131. left: 0;
  1132. right: 0;
  1133. bottom: 0;
  1134. background-color: rgba(0, 0, 0, 0.6);
  1135. z-index: 99;
  1136. }
  1137. .generate-posters {
  1138. width: 100%;
  1139. height: 318rpx;
  1140. background-color: #fff;
  1141. position: fixed;
  1142. left: 0;
  1143. bottom: 0;
  1144. z-index: 388;
  1145. transform: translate3d(0, 100%, 0);
  1146. transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  1147. border-top: 1rpx solid #eee;
  1148. .generateCon {
  1149. height: 220rpx;
  1150. }
  1151. .generateClose {
  1152. height: 98rpx;
  1153. font-size: 28rpx;
  1154. color: #333333;
  1155. border-top: 1px solid #eee;
  1156. }
  1157. .item {
  1158. .pictrue {
  1159. width: 96rpx;
  1160. height: 96rpx;
  1161. border-radius: 50%;
  1162. margin: 0 auto 6rpx auto;
  1163. /deep/image,
  1164. .easy-loadimage,
  1165. image,
  1166. uni-image {
  1167. width: 100%;
  1168. height: 100%;
  1169. border-radius: 50%;
  1170. }
  1171. }
  1172. }
  1173. }
  1174. .generate-posters.on {
  1175. transform: translate3d(0, 0, 0);
  1176. }
  1177. .generate-posters .item {
  1178. flex: 1;
  1179. text-align: center;
  1180. font-size: 30rpx;
  1181. }
  1182. .generate-posters .item .iconfont {
  1183. font-size: 80rpx;
  1184. color: #5eae72;
  1185. }
  1186. .generate-posters .item .iconfont.icon-haibao {
  1187. color: #5391f1;
  1188. }
  1189. .generate-posters .item .iconfont.icon-haowuquan1 {
  1190. color: #ff954d;
  1191. }
  1192. .img {
  1193. width: 240rpx;
  1194. height: 240rpx;
  1195. border-radius: 20rpx;
  1196. }
  1197. .groupBtn {
  1198. width: 144rpx;
  1199. height: 56rpx;
  1200. background: linear-gradient(90deg, #FF7931 0%, #E93323 100%);
  1201. border-radius: 50rpx;
  1202. text-align: center;
  1203. line-height: 56rpx;
  1204. font-weight: 500;
  1205. font-size: 24rpx;
  1206. color: #FFFFFF;
  1207. }
  1208. .flex-special {
  1209. align-items: end !important;
  1210. }
  1211. .p-bottom {
  1212. padding-bottom: 4rpx;
  1213. }
  1214. .swiper-box {
  1215. height: 70rpx !important;
  1216. padding: 20rpx;
  1217. color: #fff;
  1218. font-size: 24rpx;
  1219. .swiper-img {
  1220. width: 48rpx;
  1221. height: 48rpx;
  1222. border-radius: 24rpx;
  1223. }
  1224. .line1 {
  1225. display: flex;
  1226. align-items: center;
  1227. width: 348rpx;
  1228. height: 56rpx;
  1229. background: linear-gradient(to right, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 99%);
  1230. border-radius: 200rpx;
  1231. padding-left: 4rpx;
  1232. }
  1233. .swiper-text {
  1234. margin-left: 8rpx;
  1235. }
  1236. }
  1237. .all-pink {
  1238. min-height: 20rpx;
  1239. }
  1240. .image-box {
  1241. width: 100%;
  1242. height: 100%;
  1243. border-radius: 50%;
  1244. border: 4rpx solid #E93323;
  1245. }
  1246. .sucess-tips {
  1247. color: #e93323 !important;
  1248. }
  1249. </style>