goodsDetail.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. <template>
  2. <view class="box">
  3. <view class="spwBox">
  4. <swiper class="swiper" circular :autoplay="false" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#EC0F0A">
  5. <swiper-item v-for="(item,index) in info.ImgList">
  6. <view class="swiper-item">
  7. <img mode="aspectFit" :src="item.url" alt="" class="swiper-itemImg" v-if="item.bizType==1">
  8. <video :src="item.url" v-if="item.bizType==2" show-fullscreen-btn controls style="width: 100%;height: 100%;"></video>
  9. </view>
  10. </swiper-item>
  11. </swiper>
  12. </view>
  13. <view class="shopCont">
  14. <view class="shopCtop">
  15. <view class="goodsPrice">
  16. <view class="goodsPrice1" v-if="info.saleLabel">{{info.saleLabel}}</view>
  17. <view class="goodsPrice2">¥</view>
  18. <view class="goodsPrice3">{{info.salePrice?info.salePrice:info.scribingPrice}}
  19. <span v-if="info.categoryIds=='7B97D114-C419-42B2-9C1E-0B4CA284CDA0'">万</span>
  20. </view>
  21. <view class="goodsPrice4" v-if="info.showLabel&&info.scribingPrice&&info.showLabel.indexOf('1')!=-1">¥{{info.scribingPrice}}</view>
  22. </view>
  23. <view class="Sold" v-if="info.showLabel&&info.showLabel.indexOf('3')!=-1">已售 {{info.saleQty>0?info.saleQty:0}}</view>
  24. </view>
  25. <view class="goodsName">{{info.name}}</view>
  26. <view class="goodsMd" v-if="info.sellingPoint">{{info.sellingPoint}}</view>
  27. </view>
  28. <view class="modeBox">
  29. <view class="modeline">
  30. <view class="modelineLeft">配送方式</view>
  31. <view class="modeLineRight">{{info.distributionType==1?'到店取货':'到店使用'}}</view>
  32. </view>
  33. <view class="modeline" v-if="info.oneQty">
  34. <view class="modelineLeft">限购数量</view>
  35. <view class="modeLineRight" >{{info.oneQty}}</view>
  36. </view>
  37. <view class="modeline" v-if="info.afterService">
  38. <view class="modelineLeft">售后服务</view>
  39. <view class="modeLineRight">{{info.afterService}}</view>
  40. </view>
  41. </view>
  42. <!-- 服务流程 -->
  43. <view class="fuwuliucBox" v-if="info.showLabel&&info.showLabel.indexOf('4')!=-1">
  44. <view class="fwlcTitle">服务流程</view>
  45. <view class="fwlcxian">
  46. <view class="fwlcyuan"></view>
  47. <view class="fwHx"></view>
  48. <view class="fwlcyuan"></view>
  49. <view class="fwHx"></view>
  50. <view class="fwlcyuan"></view>
  51. <view class="fwHx"></view>
  52. <view class="fwlcyuan"></view>
  53. </view>
  54. <view class="fwTxt">
  55. <view class="fwTxtline">选择商品</view>
  56. <view class="fwTxtline">选择门店</view>
  57. <view class="fwTxtline">在线支付</view>
  58. <view class="fwTxtline">到店服务</view>
  59. </view>
  60. </view>
  61. <!-- 套餐内容 -->
  62. <view class="mealBox" v-if="info.bizType==3">
  63. <view class="fwlcTitle">套餐内容</view>
  64. <view class="mealLine" v-if="info.itemPackTimesDetails">
  65. <view class="mealTop">
  66. <view class="mealName">项目名称</view>
  67. <view class="mealTopRight">
  68. <view>数量</view>
  69. <view style="padding-left: 60rpx;">有效期</view>
  70. </view>
  71. </view>
  72. <view class="itemlinebOX">
  73. <view class="itemline" v-for="(item,index) in info.itemPackTimesDetails">
  74. <view class="itemname">{{item.flowName}}</view>
  75. <view>{{item.flowQty}}</view>
  76. <view class="expireNumber" v-if="item.expireNumber">{{item.expireNumber}}个月</view>
  77. <view class="expireNumber" v-else>永久</view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="mealLine" v-if="info.goodsPackTimesDetails">
  82. <view class="mealTop">
  83. <view class="mealName">商品名称</view>
  84. <view class="mealTopRight">
  85. <view>数量</view>
  86. <view style="padding-left: 60rpx;">有效期</view>
  87. </view>
  88. </view>
  89. <view class="itemlinebOX">
  90. <view class="itemline" v-for="(item,index) in info.goodsPackTimesDetails">
  91. <view class="itemname">{{item.flowName}}</view>
  92. <view>{{item.flowQty}}</view>
  93. <view class="expireNumber" v-if="item.expireNumber">{{item.expireNumber}}个月</view>
  94. <view class="expireNumber" v-else>永久</view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 商品详情 -->
  100. <view class="goodsDetail" v-if="info.details">
  101. <view class="goodsDetailTitle">商品详情</view>
  102. <!-- <view v-html="info.details" style="background: #fff;"></view> -->
  103. <rich-text :nodes="info.details" style="background: #fff;"></rich-text>
  104. </view>
  105. <view style="height: 200rpx;padding-bottom: env(safe-area-inset-bottom)"></view>
  106. <view class="bottomHz">
  107. <view class="timeTbox" v-if="!activityEnd">
  108. <view class="timeK">{{shengyuD}}</view>
  109. <view class="timeviewTxt" > 天</view>
  110. <view class="timeK">{{shengyuH}}</view>
  111. <view class="timeviewTxt"> 时</view>
  112. <view class="timeK">{{shengyuM}}</view>
  113. <view class="timeviewTxt" > 分 &nbsp;&nbsp; 后结束抢购</view>
  114. </view>
  115. <view class="timeTbox2" v-if="activityEnd"></view>
  116. <view class="bottomBox">
  117. <view class="bottomImgBox" @click="goINdex">
  118. <image src="../../static/timg/home.png" mode="" class="bottomImg"></image>
  119. <view class="bottomTxt">首页</view>
  120. </view>
  121. <view class="bottomImgBox" style="margin-left: 20rpx;" @click="sharewx">
  122. <image src="../../static/timg/share.png" mode="" class="bottomImg"></image>
  123. <view class="bottomTxt">分享</view>
  124. </view>
  125. <!-- <button open-type="share" class="bottomImgBox shareBtn" >
  126. <image src="../../static/timg/share.png" mode="" class="bottomImg"></image>
  127. <view class="bottomTxt">分享</view>
  128. </button> -->
  129. <view class="bottomBtn commonBtn" @click="ljbuy" v-if="!activityEnd&&info.goodsDownTime&&info.goodsState==1">立即购买</view>
  130. <view class="bottomBtn commonBtn" @click="ljbuy" v-if="activityEnd&&!info.goodsDownTime&&info.goodsState==1">立即购买</view>
  131. <view class="bottomBtn2" v-if="activityEnd&&info.goodsDownTime&&info.goodsState!=2">抢购结束</view>
  132. <view class="bottomBtn2" v-if="info.goodsState==2">商品已下架</view>
  133. </view>
  134. </view>
  135. <!-- 立即购买 -->
  136. <view class="buyBox" v-if="buyShow" @click="buyShow=false">
  137. <view class="buyCont" @click.stop="">
  138. <image src="../../static/timg/chahao.png" mode="" class="buyContCh" @click="buyShow=false"></image>
  139. <view class="goodsBox">
  140. <view class="hotGoodsLine" >
  141. <view>
  142. <image :src="info.ImgList[0].url" mode="" v-if="info.ImgList.length>0" class="hotGoodsLineImg"></image>
  143. <image src="../../static/timg/noimg.png" class="hotGoodsLineImg" v-else></image>
  144. </view>
  145. <view class="hotGoodsLineRIght">
  146. <view class="goodsName2">{{info.name}}</view>
  147. <view class="Sold" v-if="info.showLabel&&info.showLabel.indexOf('3')!=-1">
  148. 已售 {{info.saleQty>0?info.saleQty:0}}</view>
  149. <view class="goodsPrice">
  150. <view class="goodsPrice11" v-if="info.saleLabel">{{info.saleLabel}}</view>
  151. <view class="goodsPrice22">¥</view>
  152. <view class="goodsPrice33">{{info.salePrice?info.salePrice:info.scribingPrice}}
  153. <span v-if="info.categoryIds=='7B97D114-C419-42B2-9C1E-0B4CA284CDA0'">万</span>
  154. </view>
  155. <view class="goodsPrice44" v-if="info.showLabel&&info.scribingPrice&&info.showLabel.indexOf('1')!=-1">¥{{info.scribingPrice}}</view>
  156. </view>
  157. </view>
  158. </view>
  159. </view>
  160. <view class="buyNumBox">
  161. <view class="bugNUm">
  162. <view class="bugNUmLeft">
  163. <view class="buySl">数量</view>
  164. <view class="buyXg" v-if="info.oneQty">限购{{info.oneQty}}件</view>
  165. </view>
  166. <view class="numJsbox">
  167. <view class="numJj" @click="calculation(1)">-</view>
  168. <view class="goodsnum">
  169. <input type="number" value="" v-model="goodsnum" class="goodsnumInput"/>
  170. </view>
  171. <view class="numJj" @click="calculation(2)">+</view>
  172. </view>
  173. </view>
  174. <view class="buySHop" @click="ckShop">
  175. <view>服务门店</view>
  176. <view class="buyShopRight" >
  177. <view v-if="shopInfo.shopId">切换门店</view><!-- {{shopInfo.shopName}} -->
  178. <view v-else>请选择</view>
  179. <image src="../../static/timg/icon_arrow_right.png" mode="" class="buyShopRightJt"></image>
  180. </view>
  181. </view>
  182. <view class="buyShopBox" v-if="shopInfo.shopId">
  183. <view class="buyShop">
  184. <view class="buyShopTop">
  185. <view class="buyShopTleft">
  186. <!-- <view class="shopbq">距离最近</view> -->
  187. <view class="buyshopName">{{shopInfo.shopName}}</view>
  188. </view>
  189. <view class="buyShopTRgiht">
  190. <image src="/static/timg/icon_checked@2x.png" mode="" class="duihao"></image>
  191. </view>
  192. </view>
  193. <view class="buyShopCont">
  194. <image :src="shopInfo.doorImg1" v-if="shopInfo.doorImg1" mode="" class="buyShopContImg"></image>
  195. <image :src="shopInfo.doorImg2" v-else-if="shopInfo.doorImg2" mode="" class="buyShopContImg"></image>
  196. <image src="/static/timg/noimg.png" v-else class="buyShopContImg"></image>
  197. <view class="buyShopContAdress">{{shopInfo.address}}</view>
  198. <view class="buyShopJl" v-if="shopInfo.distance&&shopInfo.distance!= '0.00'">{{shopInfo.distance}}km</view>
  199. </view>
  200. </view>
  201. </view>
  202. <view v-else class="nobuyShopBox"></view>
  203. </view>
  204. <view class="buybtnBox">
  205. <!-- 1上家 2下架 GoodsState -->
  206. <view v-if="info.goodsState!=2" class="buyBtn commonBtn" @click="goBuy" >立即购买</view>
  207. <view v-else class="buyBtn2" >商品已下架</view>
  208. </view>
  209. </view>
  210. </view>
  211. <!-- 手机号授权 -->
  212. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  213. <view class="authorizCont" @click.stop="">
  214. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  215. <view class="authorizMs">未注册的手机号登录后将自动创建会员账号,如果您不同意授权获取手机号,会影响您使用我们的产品和服务。</view>
  216. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  217. </view>
  218. <view style="text-align: center;padding-top: 56rpx;">
  219. <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  220. </view>
  221. </view>
  222. <!-- <view :style="{color:colorX}">asdfas</view> -->
  223. <view class="shareBox" v-if="shareShow" @click="shareShow=false">
  224. <img :src="shareQrCode" alt=""style="width: 300rpx;height:300rpx">
  225. <view class="shareCont" @click.stop="">
  226. <button open-type="share" class=" shareBtn" >
  227. <image src="../../static/timg/icon_wxhy.png" mode="" class="shareBimg"></image>
  228. <view class="bottomTxtshare">分享</view>
  229. </button>
  230. <view @click="gowp">
  231. <img src="../../static/timg/icon_haibao.png" alt="" class="shareBimg">
  232. <view class="bottomTxtshare">生成海报</view>
  233. </view>
  234. </view>
  235. </view>
  236. </view>
  237. </template>
  238. <script>
  239. export default {
  240. components: {
  241. },
  242. data() {
  243. return {
  244. userInfo:'',
  245. goodsnum:1,
  246. buyShow:false,
  247. id:'',
  248. info:'',
  249. shopInfo:{
  250. shopName:'',
  251. shopId:''
  252. },
  253. authorizShow:false,
  254. code:'',
  255. wxOpenData:'',
  256. categoryIds:'',
  257. thenShow:false,
  258. activityEnd:true,
  259. shengyuD:1,
  260. shengyuH:12,
  261. shengyuM:21,
  262. shareShow:false,
  263. ext:'',
  264. shareId:'',
  265. shareQrCode:'',
  266. scene:'',
  267. themeColor:'',
  268. }
  269. },
  270. onLoad(opt) {
  271. var ext=this.$common.getExtStoreId();
  272. this.ext=ext
  273. this.id=opt.id;
  274. if(opt.shareId){
  275. this.shareId=opt.shareId
  276. }
  277. //this.userInfo = uni.getStorageSync("userInfo");
  278. this.userInfo=this.$store.state.userInfo;
  279. this.ext=this.$common.getExtStoreId();
  280. //opt.scene='10003'
  281. console.log(opt)
  282. if(this.userInfo){
  283. this.themeColor = uni.getStorageSync("themeColor");
  284. this.wxOpenData=this.$store.state.wxOpenData;
  285. if(opt.scene&&opt.scene!='undefined'){
  286. this.scene=opt.scene;
  287. this.getShareParams()
  288. }else{
  289. this.openGoodsDetailById();
  290. }
  291. }else{
  292. this.$common.automaticlogin().then(val => {
  293. this.userInfo=this.$store.state.userInfo;
  294. this.wxOpenData=this.$store.state.wxOpenData;
  295. this.themeColor = uni.getStorageSync("themeColor");
  296. if(opt.scene&&opt.scene!='undefined'){
  297. this.scene=opt.scene;
  298. this.getShareParams()
  299. }else{
  300. this.openGoodsDetailById();
  301. }
  302. })
  303. }
  304. },
  305. onShow() {
  306. this.shopInfo=this.$store.state.ckshopInfo;
  307. //console.log(this.shopInfo)
  308. },
  309. onPullDownRefresh(){
  310. this.openGoodsDetailById();
  311. setTimeout(() => {
  312. uni.stopPullDownRefresh(); // 关闭下拉刷新
  313. }, 2000);
  314. },
  315. methods: {
  316. getShareParams(){
  317. this.$http('openMall/getShareParams', {
  318. scene:this.scene,
  319. },'GET').then(res => {
  320. this.id=res.data.goodsID;
  321. this.shareId=res.data.operatorID
  322. this.openGoodsDetailById();
  323. })
  324. },
  325. gowp(){
  326. // uni.scanCode({
  327. // success: function (res) {
  328. // console.log('条码类型:' + res.scanType);
  329. // console.log(res)
  330. // }
  331. // });
  332. // return false
  333. var time=''
  334. if(this.info.goodsDownTime){
  335. var time = this.info.createTime.slice(0,10) + '~' +this.info.goodsDownTime.slice(0,10)
  336. }else{
  337. }
  338. this.shareShow=false;
  339. uni.navigateTo({
  340. url:'wp?img='+this.info.ImgList[0].url+'&name='+this.info.name+'&time='+time+'&sellingPoint'+this.info.sellingPoint+'&id='+this.id
  341. })
  342. },
  343. sharewx(){
  344. this.shareShow=true;
  345. },
  346. ckShop(){
  347. uni.navigateTo({
  348. url:'ckshopList?goodsId='+this.id
  349. })
  350. },
  351. openGoodsDetailById(){
  352. this.$http('openMall/openGoodsDetailById', {
  353. id:this.id,
  354. GoodsID:this.id,
  355. },'GET').then(res => {
  356. this.info=res.data;
  357. if(this.info.details){
  358. this.info.details = this.info.details.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
  359. }
  360. this.shopInfo='';
  361. this.$store.commit('mutationsckshopInfo', '')
  362. //this.szShop()
  363. if(this.info.goodsDownTime){
  364. if (Number(new Date().getTime()) > (Number(new Date(this.info.goodsDownTime.replace(/-/g, '/')).getTime()) || 0)) {
  365. console.log("现在时间大于结束时间")
  366. this.activityEnd = true
  367. } else {
  368. this.activityEnd=false;
  369. //this.info.goodsDownTime="2022-08-18 11:57:00"
  370. this.clock()
  371. }
  372. }
  373. })
  374. },
  375. clock(){
  376. let _this = this
  377. let today = new Date() // 当前时间
  378. let h = today.getHours()
  379. let m = today.getMinutes()
  380. let s = today.getSeconds()
  381. let stopTime = new Date(_this.info.goodsDownTime.replace(/-/g, '/')) // 结束时间
  382. if (Number(new Date().getTime()) >(Number(new Date(this.info.goodsDownTime.replace(/-/g, '/')).getTime()) || 0) ) {
  383. this.activityEnd = true
  384. return false;
  385. }
  386. let stopH = stopTime.getHours()
  387. let stopM = stopTime.getMinutes()
  388. let stopS = stopTime.getSeconds()
  389. let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
  390. let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
  391. let D = parseInt(shenyu) - parseInt(shengyuD * 60 * 60 * 24 * 1000)// 除去天的毫秒数
  392. let shengyuH = parseInt(D / (60 * 60 * 1000)) // 除去天的毫秒数转换成小时
  393. let H = D - shengyuH * 60 * 60 * 1000 // 除去天、小时的毫秒数
  394. let shengyuM = parseInt(H / (60 * 1000)) // 除去天的毫秒数转换成分钟
  395. let M = H - shengyuM * 60 * 1000// 除去天、小时、分的毫秒数
  396. let S = parseInt((shenyu - shengyuD * 60 * 60 * 24 * 1000 - shengyuH * 60 * 60 * 1000 - shengyuM * 60 * 1000) / 1000)// 除去天、小时、分的毫秒数转化为秒
  397. this.daojishi = '报名倒计时:' + shengyuD + '天' + shengyuH + '小时' + shengyuM + '分' + S + '秒'
  398. // setTimeout("clock()",500);
  399. this.shengyuM=shengyuM;
  400. this.shengyuD=shengyuD;
  401. this.shengyuH=shengyuH;
  402. setTimeout(_this.clock, 500)
  403. },
  404. ljbuy(){
  405. if(!this.userInfo){
  406. this.authorizShow=true
  407. }else{
  408. this.buyShow=true
  409. }
  410. },
  411. szShop(){
  412. if(this.userInfo){
  413. this.$http('openMall/openStoreList', {
  414. goodsId:this.id,
  415. // lat: '',
  416. // lng: '',
  417. }, 'GET').then(res => {
  418. var queryShopList = res.data
  419. //console.log('list+=', this.queryShopList);
  420. queryShopList.forEach(item=>{
  421. if(item.shopId==this.info.shopId){
  422. var item={
  423. shopId:this.info.shopId,
  424. shopName:this.info.shopName
  425. }
  426. this.shopInfo=item
  427. this.$store.commit('mutationsckshopInfo', item)
  428. }
  429. })
  430. })
  431. }
  432. },
  433. goINdex(){
  434. uni.switchTab({
  435. url:'../index/index'
  436. })
  437. },
  438. goBuy(){
  439. if(!this.shopInfo.shopId){
  440. uni.showToast({
  441. title: '请选择服务门店',
  442. icon: 'none',
  443. duration: 3000
  444. });
  445. return false;
  446. }
  447. if(this.info.oneQty){
  448. if(this.goodsnum>this.info.oneQty){
  449. uni.showToast({
  450. title: '超过限购数量',
  451. icon: 'none',
  452. duration: 3000
  453. });
  454. return false;
  455. }
  456. }
  457. var that=this;
  458. uni.setStorage({
  459. key: 'goodsDetail',
  460. data: that.info,
  461. success: function () {
  462. uni.navigateTo({
  463. url:'confirm?itemQty='+that.goodsnum+'&shopID='+that.shopInfo.shopId+'&shopName='+that.shopInfo.shopName+'&shareId='+that.shareId
  464. })
  465. }
  466. });
  467. },
  468. calculation(type){
  469. if(type==1){
  470. if(this.goodsnum>1){
  471. this.goodsnum--
  472. }
  473. }else{
  474. console.log("+++")
  475. if(this.info.oneQty!=null){
  476. if(this.info.oneQty>this.goodsnum){
  477. this.goodsnum++
  478. }
  479. }else{
  480. this.goodsnum++
  481. }
  482. }
  483. },
  484. decryptPhoneNumber: function(e) {
  485. console.log(e);
  486. this.code=e.detail.code
  487. this.wxPhoneLogin()
  488. this.authorizShow=false;
  489. },
  490. wxPhoneLogin(){
  491. var that=this;
  492. this.$http('miniApp2/sys/wxPhoneLogin', {
  493. appId:this.ext.appId,
  494. unionId:this.ext.unionId,
  495. code:this.code,
  496. openId:this.wxOpenData.openid
  497. },'POST').then(res => {
  498. var data = res.data;
  499. if(data.loginInfo){
  500. this.userInfo=data.loginInfo.openUser;
  501. this.wxOpenData=data.loginInfo;
  502. this.$store.commit('mutationswxOpenData', data)
  503. this.$store.commit('mutationsuserInfo', this.userInfo)
  504. //this.szShop()
  505. }
  506. })
  507. },
  508. },
  509. onShareAppMessage(res) {
  510. var img='';
  511. if(this.info.ImgList.length>0){
  512. img=this.info.ImgList[0].url
  513. }
  514. return {
  515. title: this.info.name,
  516. imageUrl:img,
  517. path: 'pages/shop/goodsDetail?id=' + this.id+'&shareId='+this.userInfo.openId,
  518. success(res){
  519. uni.showToast({
  520. title:'分享成功'
  521. })
  522. },
  523. fail(res){
  524. uni.showToast({
  525. title:'分享失败',
  526. icon:'none',
  527. duration: 3000
  528. })
  529. }
  530. }
  531. },
  532. }
  533. </script>
  534. <style scoped lang="less">
  535. .shareBtn{
  536. /* width: 100rpx; */
  537. background: #F4F5F7;
  538. }
  539. .shareBimg{
  540. width: 102rpx;
  541. height: 102rpx;
  542. }
  543. .bottomTxtshare{
  544. color: #333333;
  545. font-size: 22rpx;
  546. padding-top: 20rpx;
  547. }
  548. .shareBox{
  549. width: 100%;
  550. height: 100vh;
  551. background: rgba(0, 0, 0, 0.5);
  552. position: fixed;
  553. left: 0;
  554. bottom: 0;
  555. z-index: 11;
  556. }
  557. .shareCont{
  558. width: 100%;
  559. background: #F4F5F7;
  560. position: absolute;
  561. left: 0;
  562. bottom: 0;
  563. display: flex;
  564. justify-content: space-around;
  565. padding: 50rpx 0;
  566. border-radius: 40rpx 40rpx 0px 0px;
  567. }
  568. .timeTbox{
  569. width: 750rpx;
  570. height: 60rpx;
  571. background:#FFF5F0;
  572. border-radius: 24rpx 24rpx 0px 0px;
  573. border: 1px solid #EFE1D5;
  574. display: flex;
  575. justify-content: center;
  576. font-size: 24rpx;
  577. font-family: PingFangSC-Regular, PingFang SC;
  578. font-weight: 400;
  579. color: #764D49;
  580. }
  581. .timeTbox2{
  582. height: 60rpx;
  583. }
  584. .timeviewTxt{
  585. line-height: 41rpx;
  586. padding-top: 10rpx;
  587. }
  588. .timeDivTxt{
  589. line-height: 60rpx;
  590. padding: 0 10rpx;
  591. }
  592. .timeK{
  593. height: 41rpx;
  594. line-height: 41rpx;
  595. color: #FFFFFF;
  596. width: 41rpx;
  597. text-align: center;
  598. background: #EC0F0A;
  599. border-radius: 6rpx;
  600. margin-top: 9rpx;
  601. margin-left: 15rpx;
  602. margin-right: 15rpx;
  603. }
  604. .bottomHz{
  605. width: 750rpx;
  606. /* height: 180rpx; */
  607. position: fixed;left: 0;
  608. bottom: 0;
  609. border-radius: 24rpx 24rpx 0px 0px;
  610. }
  611. .box{
  612. background: #F4F5F7;
  613. min-height: 100vh;
  614. }
  615. .buySHop{
  616. display: flex;
  617. justify-content: space-between;
  618. font-size:28rpx ;
  619. color: #666666;
  620. padding-top: 30rpx;
  621. }
  622. .buybtnBox{
  623. width: 750rpx;
  624. height: 120rpx;
  625. background: #FFFFFF;
  626. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.2000);
  627. padding-top: 20rpx;
  628. }
  629. .buyBox{
  630. width: 750rpx;
  631. height: 100vh;
  632. position: fixed;
  633. left: 0;
  634. top: 0;
  635. background: rgba(0,0,0,0.5);
  636. }
  637. .buyBtn{
  638. width: 690rpx;
  639. height: 74rpx;
  640. background: #EC0F0A;
  641. border-radius: 37rpx;
  642. text-align: center;
  643. line-height: 74rpx;
  644. color: #FFFFFF;
  645. font-size: 30rpx;
  646. margin-left: 30rpx;
  647. }
  648. .buyBtn2{
  649. width: 690rpx;
  650. height: 74rpx;
  651. background: #EC0F0A;
  652. border-radius: 37rpx;
  653. text-align: center;
  654. line-height: 74rpx;
  655. color: #FFFFFF;
  656. font-size: 30rpx;
  657. margin-left: 30rpx;
  658. }
  659. .buyShopRightJt{
  660. width: 12rpx;
  661. height: 20rpx;
  662. margin-top: 8rpx;
  663. margin-left: 10rpx;
  664. }
  665. .buyShopRight{
  666. display: flex;
  667. }
  668. .bugNUm{
  669. border-top: 1px solid #EEEEEE;
  670. border-Bottom: 1px solid #EEEEEE;
  671. padding: 28rpx 0;
  672. display: flex;
  673. justify-content: space-between;
  674. }
  675. .buyXg{
  676. min-width: 110rpx;
  677. height: 36rpx;
  678. border-radius: 4rpx;
  679. border: 1px solid #F19D01;
  680. text-align: center;
  681. line-height: 36rpx;
  682. color: #F19D01;
  683. font-size: 24rpx;
  684. }
  685. .numJj{
  686. width: 60rpx;
  687. height: 44rpx;
  688. background: #F4F5F7;
  689. border-radius: 0px 6rpx 6rpx 0px;
  690. text-align: center;
  691. line-height: 44rpx;
  692. font-size: 32rpx;
  693. color: #999999;
  694. }
  695. .bugNUmLeft{
  696. display: flex;
  697. }
  698. .buySl{
  699. color: #666666;font-size: 28rpx;padding-right: 30rpx;
  700. }
  701. .goodsnum{
  702. width: 80rpx;
  703. height: 44rpx;
  704. background: #F4F5F7;
  705. line-height: 44rpx;
  706. text-align: center;
  707. font-weight: 500;
  708. color: #333333;
  709. font-size: 24rpx;
  710. margin: 0 4rpx;
  711. }
  712. .goodsnumInput{
  713. width: 80rpx;
  714. height: 44rpx;
  715. background: #F4F5F7;
  716. line-height: 44rpx;
  717. text-align: center;
  718. font-weight: 500;
  719. color: #333333;
  720. font-size: 24rpx;
  721. }
  722. .numJsbox{
  723. display: flex;
  724. }
  725. .buyCont{
  726. position: absolute;
  727. left: 0;
  728. bottom: 0;
  729. width: 750rpx;
  730. height: 850rpx;
  731. background: #FFFFFF;
  732. border-radius: 26rpx 26rpx 0px 0px;
  733. }
  734. .buyNumBox{
  735. padding: 30rpx;
  736. padding-top: 10rpx;
  737. /* padding-bottom: 70rpx; */
  738. }
  739. .buyContCh{
  740. position: absolute;
  741. top: 53rpx;
  742. right: 36rpx;
  743. width: 36rpx;
  744. height: 36rpx;
  745. }
  746. .hotGoodsLine{
  747. margin-top: 30rpx;
  748. padding: 20rpx;
  749. background: #FFFFFF;
  750. border-radius: 16rpx;
  751. display: flex;
  752. }
  753. .hotGoodsLineImg{
  754. width: 208rpx;
  755. height: 194rpx;
  756. border-radius: 16rpx;
  757. border: 1px solid #EEEEEE;
  758. }
  759. .goodsName2{
  760. font-size: 28rpx;
  761. font-family: PingFangSC-Regular, PingFang SC;
  762. font-weight: 400;
  763. color: #333333;
  764. line-height: 40rpx;
  765. text-overflow: -o-ellipsis-lastline;
  766. overflow: hidden;
  767. text-overflow: ellipsis;
  768. display: -webkit-box;
  769. -webkit-line-clamp: 2;
  770. line-clamp: 2;
  771. -webkit-box-orient: vertical;
  772. min-height: 80rpx;
  773. width: 370rpx;
  774. }
  775. .hotGoodsLineRIght{
  776. padding-left: 24rpx;
  777. }
  778. .goodsPrice{
  779. display: flex;
  780. padding-top: 10rpx;
  781. }
  782. .goodsPrice11{
  783. font-size: 24rpx;
  784. font-weight: 400;
  785. color: #EC0F0A;
  786. padding-top: 8rpx;
  787. padding-right: 10rpx;
  788. }
  789. .goodsPrice22{
  790. font-size: 22rpx;
  791. font-weight: 400;
  792. color: #EC0F0A;
  793. padding-top: 8rpx;
  794. }
  795. .goodsPrice33{
  796. font-size: 32rpx;
  797. font-weight: 500;
  798. color: #EC0F0A;
  799. }
  800. .goodsPrice44{
  801. font-size: 24rpx;
  802. font-weight: 400;
  803. color: #999999;
  804. padding-top: 8rpx;
  805. padding-left: 5rpx;
  806. text-decoration:line-through;
  807. }
  808. .bottomBox{
  809. width: 750px;
  810. height: 120rpx;
  811. background: #FFFFFF;
  812. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.2000);
  813. padding-bottom: env(safe-area-inset-bottom);
  814. background: #FFFFFF;
  815. display: flex;
  816. }
  817. .bottomTxt{
  818. color: #666666;font-size: 22rpx;
  819. }
  820. .bottomImg{
  821. width: 48rpx;height: 48rpx;
  822. }
  823. .bottomImgBox{
  824. text-align: center;
  825. padding-top: 20rpx;
  826. padding-left: 40rpx;
  827. }
  828. button::after{
  829. border: none;
  830. }
  831. button{
  832. position: relative;
  833. display: block;
  834. margin-left: 0;
  835. margin-right: 0;
  836. padding-left: 0px;
  837. padding-right: 0px;
  838. box-sizing: border-box;
  839. // font-size: 18px;
  840. text-align: center;
  841. text-decoration: none;
  842. // line-height: 1;
  843. line-height: 1.35;
  844. // border-radius: 5px;
  845. -webkit-tap-highlight-color: transparent;
  846. overflow: hidden;
  847. color: #000000;
  848. background-color: #fff;
  849. height: 100%;
  850. }
  851. .bottomBtn{
  852. width: 450rpx;
  853. height: 74rpx;
  854. background: #EC0F0A;
  855. border-radius: 37rpx;
  856. line-height: 74rpx;
  857. text-align: center;
  858. color: #FFFFFF;
  859. font-size: 30rpx;
  860. margin-top: 23rpx;
  861. margin-left: 70rpx;
  862. }
  863. .bottomBtn2{
  864. width: 450rpx;
  865. height: 74rpx;
  866. background: #DDDDDD;
  867. border-radius: 37rpx;
  868. line-height: 74rpx;
  869. text-align: center;
  870. color: #FFFFFF;
  871. font-size: 30rpx;
  872. margin-top: 23rpx;
  873. margin-left: 70rpx;
  874. }
  875. .goodsDetailTitle{
  876. color: #333333;
  877. font-size: 30rpx;
  878. font-weight: 500;
  879. background: #FFFFFF;
  880. padding: 20rpx 24rpx;
  881. }
  882. .goodsDetail{
  883. margin-top: 20rpx;
  884. padding-bottom: 30rpx;
  885. background: #FFFFFF;
  886. }
  887. .goodsDetail img{
  888. width: 750rpx;
  889. }
  890. .goodsDetail image{
  891. width: 750rpx;
  892. }
  893. .mealBox{
  894. background: #FFFFFF;
  895. padding: 20rpx 24rpx;
  896. margin-top: 20rpx;
  897. }
  898. .mealTopRight{
  899. display: flex;
  900. }
  901. .mealLine{
  902. margin-top: 20rpx;
  903. }
  904. .itemname{
  905. width: 441rpx;
  906. text-overflow: -o-ellipsis-lastline;
  907. overflow: hidden;
  908. text-overflow: ellipsis;
  909. display: -webkit-box;
  910. -webkit-line-clamp: 2;
  911. line-clamp: 2;
  912. -webkit-box-orient: vertical;
  913. }
  914. .itemline{
  915. display: flex;
  916. padding: 10rpx 20rpx;
  917. justify-content: space-between;
  918. line-height: 37rpx;
  919. font-size: 26rpx;
  920. color: #333333;
  921. }
  922. .itemlinebOX{
  923. border-radius: 0px 0px 10px 10px;
  924. border: 2Rpx solid #EEEEEE;
  925. padding: 10rpx 0;
  926. }
  927. .mealTop{
  928. display: flex;
  929. justify-content: space-between;
  930. height: 72rpx;
  931. background: #F19D01 linear-gradient(90deg, #FFF7EB 0%, #FFEFD5 100%);
  932. border-radius: 10rpx 10rpx 0px 0px;
  933. line-height: 72rpx;
  934. color: #333333;
  935. font-size: 26rpx;
  936. padding: 0 20rpx;
  937. }
  938. .fwlcTitle{
  939. color: #333333;font-size: 30rpx;font-weight: 500;
  940. }
  941. .fuwuliucBox{
  942. background: #FFFFFF;
  943. padding: 20rpx 24rpx;
  944. margin-top: 20rpx;
  945. }
  946. .fwlcxian{
  947. padding:30rpx 42rpx 10rpx 42rpx ;
  948. display: flex;
  949. }
  950. .fwlcyuan{
  951. width: 16rpx;
  952. height: 16rpx;
  953. background: #EC0F0A;
  954. border-radius: 50%;
  955. }
  956. .fwHx{
  957. height: 4rpx;
  958. background: #EC0F0A;
  959. width: 186rpx;
  960. margin-top: 7rpx;
  961. }
  962. .fwTxt{
  963. display: flex;
  964. justify-content: space-between;
  965. }
  966. .fwTxtline{
  967. color: #333333;
  968. line-height: 37px;
  969. font-size: 26rpx;
  970. }
  971. .swiper{
  972. width: 750rpx;
  973. height: 700rpx;
  974. background: #FFFFFF;
  975. border-bottom: 1px solid #EEEEEE;
  976. }
  977. .swiper-item{
  978. width: 750rpx;
  979. height: 700rpx;
  980. }
  981. .swiper-itemImg{
  982. width: 750rpx;
  983. height: 700rpx;
  984. }
  985. .shopCtop{
  986. display: flex;
  987. padding: 20rpx 24rpx;
  988. justify-content: space-between;
  989. background: #FFFFFF;
  990. }
  991. .goodsPrice{
  992. display: flex;
  993. }
  994. .goodsPrice1{
  995. font-size: 24rpx;
  996. font-weight: 400;
  997. color: #EC0F0A;
  998. padding-top: 14rpx;
  999. padding-right: 14rpx;
  1000. }
  1001. .goodsPrice2{
  1002. font-size: 28rpx;
  1003. font-weight: 400;
  1004. color: #EC0F0A;
  1005. padding-top: 10rpx;
  1006. }
  1007. .goodsPrice3{
  1008. font-size: 40rpx;
  1009. font-weight: 500;
  1010. color: #EC0F0A;
  1011. }
  1012. .goodsPrice4{
  1013. font-size: 24rpx;
  1014. font-weight: 400;
  1015. color: #999999;
  1016. padding-top: 14rpx;
  1017. text-decoration:line-through;
  1018. padding-left: 10rpx;
  1019. }
  1020. .Sold{
  1021. font-weight: 400;
  1022. color: #999999;
  1023. font-size: 24rpx;
  1024. padding-top: 18rpx;
  1025. }
  1026. .goodsName{
  1027. font-size: 30rpx;
  1028. line-height: 42rpx;
  1029. font-weight: 500;
  1030. color: #333333;
  1031. padding: 20rpx 24rpx;
  1032. padding-top: 0;
  1033. padding-bottom: 16rpx;
  1034. }
  1035. .goodsMd{
  1036. font-weight: 400;
  1037. color: #999999;
  1038. font-size: 26rpx;
  1039. padding: 0 24rpx;
  1040. padding-bottom: 20rpx;
  1041. }
  1042. .shopCont{
  1043. background: #FFFFFF;
  1044. }
  1045. .modeBox{
  1046. margin-top:20rpx ;
  1047. padding: 5rpx 0;
  1048. background: #FFFFFF;
  1049. }
  1050. .modeline{
  1051. display: flex;
  1052. padding: 15rpx 24rpx;
  1053. }
  1054. .modelineLeft{
  1055. color: #999999;
  1056. font-size: 26rpx;
  1057. width: 150rpx;
  1058. }
  1059. .modeLineRight{
  1060. color: #333333;
  1061. font-size: 26rpx;
  1062. width: 550rpx;
  1063. }
  1064. .expireNumber{
  1065. width: 110rpx;
  1066. text-align: right;
  1067. }
  1068. .authorizBox{
  1069. width: 100vw;
  1070. height: 100vh;
  1071. background: rgba(0, 0, 0, 0.5);
  1072. position: fixed;
  1073. top: 0;
  1074. left: 0;
  1075. }
  1076. .authorizCont{
  1077. margin-top: 30vh;
  1078. width: 564rpx;
  1079. height: 408rpx;
  1080. background: #FFFFFF;
  1081. border-radius: 24rpx;
  1082. margin-left: 93rpx;
  1083. position: relative;
  1084. }
  1085. .authorizCloseImg{
  1086. width: 62rpx;
  1087. height: 62rpx;
  1088. }
  1089. .sqLogoBox{
  1090. width: 180rpx;
  1091. height: 180rpx;
  1092. background: #FFFFFF;
  1093. border-radius: 90rpx;
  1094. text-align: center;
  1095. position: absolute;
  1096. top: -50rpx;
  1097. left: 192rpx;
  1098. }
  1099. .authorizName{
  1100. color: #333333;
  1101. line-height: 42rpx;
  1102. font-size: 30rpx;
  1103. text-align: center;
  1104. padding-top: 58rpx;
  1105. }
  1106. .authorizMs{
  1107. color: #999999;
  1108. line-height: 36rpx;
  1109. font-size: 26rpx;
  1110. width: 452rpx;
  1111. padding-top: 24rpx;
  1112. text-align: center;
  1113. margin-left: 56rpx;
  1114. }
  1115. .authorizContbutton{
  1116. width: 422rpx;
  1117. height: 88rpx;
  1118. background: #EC0F0A;
  1119. border-radius: 44rpx;
  1120. line-height: 88rpx;
  1121. text-align: center;
  1122. font-size:30rpx;
  1123. color: #FFFFFF;
  1124. margin-top: 62rpx;
  1125. margin-left:71rpx;
  1126. }
  1127. .buyShopBox{
  1128. /* padding: 0 24rpx; */
  1129. padding-top: 20rpx;
  1130. }
  1131. .nobuyShopBox{
  1132. height: 220rpx;
  1133. }
  1134. .duihao{
  1135. width: 28rpx;height: 28rpx;
  1136. }
  1137. .buyShopTRgiht{
  1138. display: flex;
  1139. align-items: center;
  1140. }
  1141. .buyShop{
  1142. background: #F9F9F9;
  1143. border-radius:6rpx;
  1144. }
  1145. .buyShopTop{
  1146. display: flex;justify-content: space-between;
  1147. padding: 16rpx 22rpx;
  1148. background: #F9EFF0;
  1149. }
  1150. .shopbq{
  1151. color: #FF063A;font-size: 22rpx;
  1152. border-radius: 6rpx;
  1153. border: 1rpx solid #FF063A;
  1154. padding: 0rpx 6rpx;
  1155. height: 30rpx;line-height: 30rpx;
  1156. margin-top: 4rpx;
  1157. }
  1158. .buyShopTleft{
  1159. display: flex;
  1160. }
  1161. .buyshopName{
  1162. font-size: 26rpx;
  1163. color: #222222;
  1164. line-height: 37rpx;
  1165. padding-left: 8rpx;
  1166. }
  1167. .buyShopCont{
  1168. display: flex;
  1169. padding: 22rpx;
  1170. }
  1171. .buyShopContImg{
  1172. width: 102rpx;
  1173. height: 102rpx;
  1174. border-radius: 6rpx;
  1175. }
  1176. .buyShopContAdress{
  1177. font-weight: 400;
  1178. font-size: 22rpx;
  1179. color: #666E80;
  1180. line-height: 34rpx;
  1181. width: 440rpx;
  1182. padding-left: 12rpx;
  1183. }
  1184. .buyShopJl{
  1185. font-size: 22rpx;
  1186. color: #666E80; line-height: 34rpx;
  1187. width: 110rpx;
  1188. text-align: right;
  1189. }
  1190. .buyNumlineActive{
  1191. border-radius: 25rpx;
  1192. border: 1rpx solid #FF0035;
  1193. color: #FF0035;
  1194. background: #ffffff;
  1195. height: 48rpx;
  1196. line-height: 48rpx;width: 147rpx;
  1197. }
  1198. </style>