commoditydetail.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207
  1. <template>
  2. <view class="s-page-wrapper" v-if="showPage">
  3. <view class="index-goods" v-if="loadGoods">
  4. <view class="swiper">
  5. <swiper class="swiper-container" :autoplay="true" :interval="4000" :circular="true"
  6. :indicator-dots="true" indicator-active-color="#05C25C" indicator-color="#cccccc">
  7. <block v-for="(item, index) in imageView" :key="index">
  8. <swiper-item class="swiper-wrapper">
  9. <image :src="item" mode="widthFix" class="is-response" lazy-load="true"
  10. @tap="previewPhoto(index)"></image>
  11. </swiper-item>
  12. </block>
  13. </swiper>
  14. </view>
  15. <view class="goods_info" style="padding-top: 6px;padding-bottom: 16upx">
  16. <view class="coupon-price s-row">
  17. <view class="price" style="width: 70%">
  18. <text style="font-size: 24upx;margin-left: 4upx;">特惠价</text>
  19. <text style="font-size: 34upx">¥</text>
  20. <text style="font-weight: 700;">{{ ordersMoney }}</text>
  21. <text
  22. style="font-size: 24upx;color: grey;text-decoration:line-through;margin-left: 8px">¥{{ ordersList.originalPrice }}</text>
  23. </view>
  24. </view>
  25. <view style="padding: 16upx 16upx 16upx 16upx;display: flex;">
  26. <view style="width:99%;">
  27. <text
  28. style="color: #FFFFFF;background: #05C25C;font-size: 24upx;padding-left: 12upx;padding-right: 12upx;border-radius: 16upx;margin-right: 8upx;padding-top: 4upx;padding-bottom: 4upx;">
  29. <text>自营</text>
  30. </text>
  31. <text style="font-weight: bold;font-size: 32upx;">
  32. <text @longpress="copyTitle">{{ ordersList.title }}</text>
  33. </text>
  34. </view>
  35. <!-- <view
  36. style="width: 120upx;height:48upx; text-align: center;line-height: 48upx; background-color: #ebebeb;border-radius:24upx 0upx 0upx 24upx;">
  37. <text @click="onShare()">
  38. <text class="cuIcon cuIcon-share"></text>
  39. <text>分享</text>
  40. </text>
  41. </view> -->
  42. </view>
  43. <view style="width:100%;height: 170upx;background-color:#F2F2F2;" v-if="brandName">
  44. <view
  45. style="float: right;height: 140upx;width:100%;background-color:#FFFFFF;float: right; line-height: 68upx;margin-top: 16upx;margin-bottom:16upx;">
  46. <view style="display: flex;">
  47. <view style="margin-right:60upx ;margin-left: 20upx;">品牌</view>
  48. <view style="font-weight: bold;">{{brandName}}</view>
  49. </view>
  50. <view style="display: flex;">
  51. <view style="margin-right:60upx ;margin-left: 20upx;">店铺</view>
  52. <image style="height: 40upx;width:40upx;margin-top: 6px;margin-right: 4upx;"
  53. src="/static/image/icon_shop.png"></image>
  54. <view style="font-weight: bold;">上门服务自营店铺</view>
  55. </view>
  56. </view>
  57. </view>
  58. <view style="width:100%;height: 98upx;background-color:#F2F2F2;" v-if="brandName === ''">
  59. <view style="float: right;height: 68upx;width:100%;background-color:#FFFFFF;float: right; line-height: 68upx;margin-top: 16upx;margin-bottom:16upx;display: flex;">
  60. <view style="margin-right:60upx ;margin-left: 20upx;">店铺</view>
  61. <image style="height: 40upx;width:40upx;margin-top: 6px;margin-right: 4upx;"
  62. src="/static/image/icon_shop.png"></image>
  63. <view style="font-weight: bold;">上门服务自营店铺</view>
  64. </view>
  65. </view>
  66. <view style="width: 100%;padding:30upx">
  67. <view class="goods-info-title" style="color:#333333;width: 20%;text-align: center;float:left;">
  68. 必买理由
  69. </view>
  70. <view class="volume" style="font-size: 28upx;float: right;color:#333333;"><text
  71. style="color:#05C25C;font-weight: bold;">{{ ordersList.sales }}人付款</text></view>
  72. <view class="coupon-price s-row"></view>
  73. <view class="goods_reco"
  74. style="display: flex;margin-top: 20upx;background-color: #F2F2F2;width: 96%;margin:20upx auto 0;position: relative;border-radius: 8upx;">
  75. <image src="/static/image/icon_up.png"
  76. style="width:14upx;height:12upx;display: block;position: absolute;top:-12upx;left:34upx">
  77. </image>
  78. <view class="goods_desc" style="padding-bottom: 16upx;padding-top:20upx;" @click="TklmaskShow">
  79. <text>{{ ordersList.buyReason }}</text>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view style="margin: 20upx 0upx;border-radius: 15upx;background-color: #FFFFFF;"
  85. v-if="pinglunList.length > 0">
  86. <view style="padding:20upx;">
  87. <view style="display: flex;justify-content: space-between;">
  88. <view class="goods-info-title"
  89. style="color: #333;font-weight: bold;width: 78%;text-align: left;float:left;">
  90. 宝贝评论({{totalElements}})</view>
  91. <view style="color: #999999;" @tap="goPingLunList()">查看更多</view>
  92. <image src="/static/image/gray_right.png"
  93. style="width: 15rpx;height: 26rpx;margin-top: 8rpx;"></image>
  94. </view>
  95. <view style="display: flex;padding: 20rpx;">
  96. <image :src="pinglunList[0].userHeader ? pinglunList[0].userHeader : '/static/logo.png'"
  97. style="width: 80rpx;height: 80rpx;border-radius: 50rpx;"></image>
  98. <view style="margin-top: 5rpx;margin-left: 10rpx;width: 42%;">
  99. <view
  100. style="margin-left: 15rpx;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;">
  101. {{pinglunList[0].userName}}
  102. </view>
  103. <uni-rate style="margin-left: 15rpx;margin-top: 10rpx;" :size='15'
  104. :value="pinglunList[0].score" />
  105. </view>
  106. <view style="margin-left: 20rpx;margin-top: 20rpx;color: #666666;">{{pinglunList[0].createTime}}
  107. </view>
  108. </view>
  109. <!-- #ifdef MP-WEIXIN -->
  110. <view style="padding: 0 20rpx 0 20rpx;">{{pinglunList[0].content}}</view>
  111. <view style="display: flex;padding: 10rpx 0 0 10rpx;flex-wrap: wrap;"
  112. v-if="pinglunList[0].img &&pinglunList[0].img.length > 0">
  113. <view style="margin: 5rpx;" v-for="(item,index) in pinglunList[0].img">
  114. <image :src="item" lazy-load="true"
  115. style="width: 210rpx;height: 210rpx;border-radius: 10rpx;" @tap='selectPhoto(item)'>
  116. </image>
  117. </view>
  118. </view>
  119. <!-- #endif -->
  120. <!-- #ifndef MP-WEIXIN -->
  121. <view style="padding: 20rpx 20rpx 0 20rpx;">{{pinglunList[0].content}}</view>
  122. <view style="display: flex;padding: 10rpx 0 0 10rpx;flex-wrap: wrap;"
  123. v-if="pinglunList[0].img &&pinglunList[0].img.length > 0">
  124. <view style="margin: 5rpx;" v-for="(item,index) in pinglunList[0].img">
  125. <image :src="item" lazy-load="true"
  126. style="width: 210rpx;height: 210rpx;border-radius: 10rpx;" @tap='selectPhoto(item)'>
  127. </image>
  128. </view>
  129. </view>
  130. <!-- #endif -->
  131. </view>
  132. </view>
  133. <view class="goods_reco" style="margin-top: 20rpx;border-radius: 15upx;" v-if="ordersList.descrition">
  134. <view class="goods-info-title" style="color: #333;font-weight: bold;">宝贝详情</view>
  135. <view class="imglist">
  136. <uparse :content="ordersList.descrition" @navigate="navigate" class="is-response"></uparse>
  137. </view>
  138. </view>
  139. <!-- 购买按钮 -->
  140. <view class="goods_shop_cart">
  141. <view class="cent" style="display: flex">
  142. <view style="text-align: center;width: 10%;margin-top: 4px;margin-bottom: 4px;display: flex">
  143. <view style="width: 100%;text-align: center;">
  144. <view class="iconfont icon-shouye" @tap="goBackUp()"></view>
  145. <view style="font-size: 12px">首页</view>
  146. </view>
  147. <!-- <view style="width: 50%;text-align: center">
  148. <view class="iconfont icon-shoucang" :style="collect.isCollect" @tap="clickCollect()">
  149. </view>
  150. <view style="font-size: 12px" :style="collect.isCollect">{{ collect.name }}</view>
  151. </view> -->
  152. </view>
  153. <view style="width: 85%;display: flex;color: white">
  154. <!-- <view style="border-radius: 32upx;width: 50%;background: #e43939;text-align: center;padding-top:8px;margin: 4px"
  155. @tap="shopCartShare('fanxian')">{{ buyDes }}</view> -->
  156. <!-- @tap="shopCartShare('quan')">立即购买</view> -->
  157. <view class="getTbk"
  158. style="border-radius: 32upx;width: 100%;background:#05C25C; text-align: center;padding-top: 8px;margin: 4px"
  159. @tap="openPopus()">立即购买</view>
  160. </view>
  161. </view>
  162. </view>
  163. <view class="navBarButtonBox">
  164. <!-- 顶部右侧菜单 -->
  165. <view v-if="navBarButton" class="goods_shop_cart_bg navBarButton" @tap="showShopCartBg('nav')"
  166. @touchmove.stop.prevent="moveHandleStop"></view>
  167. <!-- #ifdef H5 -->
  168. <view style="margin-top: 66upx;" class="h_newlit" v-bind:class="[navBarButton ? 'active' : '', '']">
  169. <!-- #endif -->
  170. <!-- #ifndef H5 -->
  171. <view style="margin-top: 66upx;" class="h_newlit" v-bind:class="[navBarButton ? 'active' : '', '']">
  172. <!-- #endif -->
  173. <view class="em">
  174. <view style="font-size: 14px" @tap="navBarButtontO('home')">
  175. <text class="iconfont icon-shouye"></text>
  176. 返回首页
  177. </view>
  178. <!-- <view style="font-size: 14px" @tap="navBarButtontO('search')">
  179. <text class="iconfont icon-sousuo"></text>
  180. 超级搜索
  181. </view>
  182. <view style="font-size: 14px" @tap="navBarButtontO('footer')">
  183. <text class="iconfont icon-zuji"></text>
  184. 我的足迹
  185. </view> -->
  186. <view style="font-size: 14px" @tap="navBarButtontO('like')">
  187. <text class="iconfont icon-shoucang"></text>
  188. 个人中心
  189. </view>
  190. </view>
  191. </view>
  192. </view>
  193. </view>
  194. <!-- 淘口令分享 -->
  195. <simpleModal ref="simpleModalTkl" @maskClose="TklmaskClose">
  196. <view class="buy-box-title">复制分享文案</view>
  197. <view class="buy-box-center">
  198. <view class="code-cent">
  199. <div class="cente-text">
  200. <div>
  201. <view class="textarea">
  202. {{ ordersList.title }}
  203. <br />
  204. 【在售价】{{ ordersMoney }}元
  205. <br />
  206. 【下单链接】{{ erweima }}
  207. <br />
  208. 【必买理由】{{ ordersList.buyReason }}
  209. <br />
  210. </view>
  211. </div>
  212. </div>
  213. </view>
  214. <view class="buy-btn-copy" v-bind:class="[copyTklStatus ? 'active' : '', '']" @tap="copyTklWenAns">
  215. {{ copyTklStatus ? '已复制到剪切板' : '一键复制' }}
  216. </view>
  217. </view>
  218. </simpleModal>
  219. <!-- 淘口令分享 -->
  220. <view class="" v-if="!loadGoods">
  221. <view class="s-page">
  222. <view class="is-100vh is-flex is-column is-justify-center is-align-center ">
  223. <image src="/static/image/loadinig.gif"
  224. style="width:75px;height: 75px;" class="is-response" mode="widthFix"></image>
  225. </view>
  226. </view>
  227. </view>
  228. <uni-popup ref="popusshare" type="bottom">
  229. <view
  230. style="width: 100%;height: max-content;background: #FFFFFF;border-top-left-radius: 20upx;border-top-right-radius: 20upx;padding: 40upx;">
  231. <view style="display: flex;flex-wrap: wrap;flex-wrap: wrap;">
  232. <view style="width: 50%;text-align: center;" v-for='(item,index) in bottomData' :key='index'
  233. @tap='goShare(index)'>
  234. <button v-if="index === 0" style="text-align:center;background: #FFFFFF;" open-type='share'>
  235. <image :src="item.icon" style="width: 80rpx;height: 80rpx;"></image>
  236. <view style="color: #000000;">{{item.text}}</view>
  237. </button>
  238. <view v-if="index != 0">
  239. <image :src="item.icon" style="width: 80rpx;height: 80rpx;"></image>
  240. <view style="color: #000000;margin-top: 38rpx;">{{item.text}}</view>
  241. </view>
  242. </view>
  243. </view>
  244. </view>
  245. </uni-popup>
  246. <uni-popup ref="popus" type="bottom">
  247. <view
  248. style="width: 100%;height: max-content;background: #FFFFFF;border-top-left-radius: 20upx;border-top-right-radius: 20upx;padding: 40upx;">
  249. <view style="display: flex;">
  250. <image :src="attrValuecoverImg" style="width: 150upx;height: 150upx;"></image>
  251. <view style="margin-top: 70upx;margin-left: 20upx;">
  252. <view style="display: flex;">
  253. <view style="font-size: 28upx;color: #FF4733;">¥ {{numberMoney}}</view>
  254. <view v-if="Maxnumber != -1"
  255. style="margin-left: 20upx;font-size: 24upx;color: #333333;">库存:{{Maxnumber}}
  256. </view>
  257. </view>
  258. <view style="font-size: 28upx;color: #333333;margin-top: 10upx;">请选择产品类型</view>
  259. </view>
  260. </view>
  261. <view v-for="(item,index) in attrValue" :key='index'>
  262. <view style="margin-top: 50upx;font-size: 32upx;color: #000000;">{{item.value}}</view>
  263. <view style="display: flex;flex-wrap: wrap;flex-wrap: wrap;">
  264. <view style="display: flex;flex-wrap: wrap;" v-for="(de,ind) in item.detail"
  265. @tap='checkState(de,index,ind)'>
  266. <view
  267. :style="item.goodsId == index && item.attrId == ind && de.state != ''?
  268. 'width: 150rpx; height: 50rpx;background: #F2F2F2;text-align: center;border-radius: 50rpx;line-height: 50rpx;margin: 20rpx 0rpx 0rpx 10rpx;border: 1rpx solid #20C675;'
  269. : 'width: 150rpx; height: 50rpx;background: #F2F2F2;text-align: center;border-radius: 50rpx;line-height: 50rpx;margin: 20rpx 0rpx 0rpx 10rpx;'">
  270. {{de.name}}
  271. </view>
  272. </view>
  273. </view>
  274. </view>
  275. <view style="display: flex;" v-if='ordersList.isExpress === 1'>
  276. <view style="margin-top: 50upx;font-size: 32upx;color: #000000;width: 80%;">数量</view>
  277. <view
  278. style="width:200upx;height: 60upx;display: flex;margin-top: 30upx;border-radius: 5upx;border:1px solid #E6E6E6">
  279. <view
  280. style="border-right:1px solid #E6E6E6;width: 70upx;color: #999999;text-align: center;margin-top: 15upx;"
  281. @click="jian">-</view>
  282. <view
  283. style="width: 80upx;text-align: center;font-size: 24upx;color: #333333;margin-top: 15upx;">
  284. {{number}}
  285. </view>
  286. <view
  287. style="border-left:1px solid #E6E6E6;width: 70upx;color: #999999;text-align: center;margin-top: 15upx"
  288. @click="jia">+</view>
  289. </view>
  290. </view>
  291. <button style="background: #20C675;color: #FFFFFF;margin-top: 50upx;"
  292. @tap="shopCartShare('quan')">{{ShopCartOrMoney}}</button>
  293. </view>
  294. </uni-popup>
  295. </view>
  296. </template>
  297. <script>
  298. import simpleModal from '@/components/simple-pro/customModal.vue';
  299. import _app from '../../../../js_sdk/QuShe-SharerPoster/QS-SharePoster/app.js';
  300. import getSharePoster from '../../../../js_sdk/QuShe-SharerPoster/QS-SharePoster/QS-SharePoster.js';
  301. import wmPoster from '@/components/wm-poster/wm-posterorders.vue';
  302. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
  303. import uparse from '@/components/u-parse/u-parse.vue'
  304. export default {
  305. data() {
  306. return {
  307. erweima: '',
  308. erweimapath: '',
  309. ordersId: 0,
  310. member: 0,
  311. modalName: '',
  312. ShopCartOrMoney: '',
  313. ordersMoney: 0,
  314. logo: '../../../../static/img/mao.png',
  315. taobao: '../../../../static/img/taobao.png',
  316. buyDes: '口令购买',
  317. collect: {
  318. name: '收藏',
  319. isCollect: ''
  320. },
  321. show_share: false,
  322. attrValuecoverImg: '',
  323. attrValue: [],
  324. number: 0,
  325. Maxnumber: -1,
  326. numberMoney: 0,
  327. shengji: '',
  328. pinglunList: [],
  329. getQun: '立即领券',
  330. follow: false,
  331. showPage: false,
  332. loadGoods: true,
  333. goods: '',
  334. relation: false,
  335. taoBaoBuy: true,
  336. shopCartBg: false,
  337. scrollTop: false,
  338. couponlist: [],
  339. checkStateList: [],
  340. navBarButton: false,
  341. copyTklStatus: false,
  342. save: false,
  343. tkl: '',
  344. relation_id: null,
  345. money: 0,
  346. grade: '',
  347. isInvitation: 0,
  348. showFollow: false,
  349. isWeiXin: false,
  350. footprintKey: 'orange-sqx-footprint-zy',
  351. collectKey: 'orange-sqx-collect-zy',
  352. poster: {},
  353. imageView: [],
  354. coupon_click_url: '',
  355. userByinvitationId: '',
  356. qrShow: false,
  357. haibaoImg: null,
  358. haibaoShow: false,
  359. isEnable: '否',
  360. ordersList: {},
  361. messageList: [],
  362. maxMoney: "0.7",
  363. canvasId: 'default_PosterCanvasId',
  364. XCXErweima: '',
  365. brandName: '',
  366. totalElements: '',
  367. shareMessage: '',
  368. bottomData: [{
  369. text: '分享好友',
  370. icon: '/static/image/invite_weixin.png',
  371. name: 'wx'
  372. },
  373. {
  374. text: '生成海报',
  375. icon: '/static/image/invite_poster.png',
  376. name: 'more'
  377. }
  378. ]
  379. };
  380. },
  381. components: {
  382. simpleModal,
  383. tkiQrcode,
  384. wmPoster,
  385. uparse
  386. },
  387. onShow: function() {
  388. this.copyTklStatus = false;
  389. this.member = this.$queue.getData('member') ? this.$queue.getData('member') : 1;
  390. let relation_id = this.$queue.getData('relation_id');
  391. if (relation_id) {
  392. this.relation_id = relation_id;
  393. }
  394. },
  395. onLoad: function(e) {
  396. this.$queue.showLoading("加载中...")
  397. let a = this.$queue.getData('isEnable');
  398. if (a) {
  399. this.isEnable = a;
  400. }
  401. if (e.ordersId) {
  402. let InvitationUser = this.$queue.getData('userByinvitationId');
  403. if (e.userByinvitationId) {
  404. this.userByinvitationId = e.userByinvitationId;
  405. } else if (InvitationUser) {
  406. this.userByinvitationId = InvitationUser;
  407. this.$queue.remove("userByinvitationId");
  408. }
  409. this.ordersId = e.ordersId;
  410. this.getCommondityList(e.ordersId);
  411. }
  412. // #ifdef MP-WEIXIN
  413. if (e.scene) {
  414. const scene = decodeURIComponent(e.scene);
  415. var ordersId = '';
  416. var userByinvitationId = '';
  417. var className = '';
  418. this.userByinvitationId = '';
  419. let ss = scene.split(',');
  420. for (var i = 0; i < ss.length; i++) {
  421. console.log(ss[i])
  422. if (i === 0) {
  423. this.ordersId = ss[i];
  424. } else if (i === 1) {
  425. this.userByinvitationId = ss[i];
  426. this.$queue.setData('userByinvitationId', ss[i]);
  427. }
  428. }
  429. this.getCommondityList(this.ordersId);
  430. }
  431. wx.getSetting({
  432. success(res) {
  433. if (!res.authSetting['scope.writePhotosAlbum']) {
  434. wx.authorize({
  435. scope: 'scope.writePhotosAlbum',
  436. success() {
  437. console.log('授权成功');
  438. }
  439. });
  440. }
  441. }
  442. });
  443. this.shareMessage = '/package/pages/zysc/index/commoditydetail?ordersId=' + this.ordersId;
  444. this.XCXErweima = this.$queue.publicYuMing() +
  445. '/sqx_fast/user/getImg?page=package/pages/zysc/index/commoditydetail&scene=' + this.ordersId + '&width=200'
  446. // #endif
  447. //#ifdef H5
  448. let ua = navigator.userAgent.toLowerCase();
  449. if (ua.indexOf('micromessenger') !== -1) {
  450. this.isWeiXin = true;
  451. }
  452. if (window.location.href.indexOf('&relation_id=') !== -1) {
  453. let relation = window.location.href.split('&relation_id=')[1].split('&')[0];
  454. this.$queue.setData('relation', relation);
  455. }
  456. //#endif
  457. let relation_id = this.$queue.getData('relation_id');
  458. this.erweima = this.$queue.publicYuMing() + '/package/pages/zysc/index/commoditydetail?ordersId=' + e
  459. .ordersId;
  460. this.relation = false;
  461. this.getPingLunList();
  462. // let userId = this.$queue.getData('userId');
  463. // if (userId) {
  464. // this.$Request.postT('/app/selectUserById?userId=' + userId).then(res => {
  465. // if (res.status === 0) {
  466. // if (res.data.isInvitation) {
  467. // this.isInvitation = res.data.isInvitation;
  468. // this.$queue.setData('isInvitation', res.data.isInvitation);
  469. // }
  470. // this.$queue.setData('relation', res.data.invitation);
  471. // this.$queue.setData('grade', res.data.grade);
  472. // this.$queue.setData('pddpid', res.data.pdd);
  473. // this.$queue.setData('jdpid', res.data.jd);
  474. // if (res.data.image_url) {
  475. // this.$queue.setData('image_url', res.data.image_url);
  476. // }
  477. // this.$queue.setData('mobile', res.data.phone);
  478. // this.$queue.setData('nickName', res.data.nickName);
  479. // this.$queue.setData('relation_id', res.data.relationId);
  480. // this.$queue.setData('gender', parseInt(res.data.gender));
  481. // }
  482. // });
  483. // }
  484. },
  485. onPageScroll: function(e) {
  486. this.scrollTop = e.scrollTop > 200;
  487. },
  488. onNavigationBarButtonTap: function() {
  489. this.navBarButton = !this.navBarButton;
  490. },
  491. onShareAppMessage(res) {
  492. return {
  493. path: this.shareMessage, //这是为了传参 onload(data){let id=data.id;}
  494. title: '在售价' + this.ordersMoney + ' ' + this.ordersList.title,
  495. imageUrl: this.imageView[0]
  496. }
  497. },
  498. methods: {
  499. goPingLunList() {
  500. uni.navigateTo({
  501. url: './pinglunList?id=' + this.ordersId
  502. });
  503. },
  504. getPingLunList() {
  505. this.$Request.getT('/selfGoodsComment/list?page=0&size=1&scoreType=0&goodsId=' + this.ordersId).then(
  506. res => {
  507. if (res.status === 0) {
  508. res.data.content.forEach(d => {
  509. if (d.img) {
  510. let img = d.img.split(',');
  511. d.img = img;
  512. }
  513. this.pinglunList = res.data.content;
  514. });
  515. this.totalElements = res.data.totalElements;
  516. }
  517. });
  518. },
  519. goShare(index) {
  520. this.$refs.popusshare.close();
  521. //0,分享好友 1,生成海报
  522. if (index === 1) {
  523. this.showModal();
  524. }
  525. },
  526. onShare() {
  527. // #ifdef MP-WEIXIN
  528. this.$refs.popusshare.open();
  529. // #endif
  530. // #ifndef MP-WEIXIN
  531. this.showModal();
  532. // #endif
  533. },
  534. goMaijia() {
  535. let userId = this.$queue.getData('userId');
  536. if (userId) {
  537. uni.navigateTo({
  538. url: '/package/pages/chat/chat?className=shop&title=' + this.ordersList.title +
  539. '&ordersId=' + this
  540. .ordersId + '&image=' + this.attrValuecoverImg +
  541. '&money=' + this.ordersMoney + '&sales=' + this.ordersList.sales
  542. });
  543. } else {
  544. this.loginS();
  545. }
  546. },
  547. checkState(item, index, ind) {
  548. this.number = 1;
  549. this.attrValue[index].detail.forEach(d => {
  550. d.state = '';
  551. })
  552. this.checkStateList[index].name = item.name;
  553. this.attrValue[index].goodsId = index;
  554. this.attrValue[index].attrId = ind;
  555. this.attrValue[index].detail[ind].state = '123';
  556. this.checkString = '';
  557. this.checkStateList.forEach(d => {
  558. if (d.name) {
  559. if (this.checkString) {
  560. this.checkString = this.checkString + ',' + d.name;
  561. } else {
  562. this.checkString = d.name;
  563. }
  564. }
  565. });
  566. for (var i = 0; i < this.ordersList.sku.length; i++) {
  567. let d = this.ordersList.sku[i];
  568. if (d.detailJson == this.checkString) {
  569. if (d.stock > 0) {
  570. this.numberMoney = d.skuPrice;
  571. this.numberMoney1 = d.skuPrice;
  572. this.Maxnumber = d.stock;
  573. this.skuId = d.id;
  574. this.attrValuecoverImg = d.skuImg ? d.skuImg : this.ordersList.coverImg;
  575. this.CheckattrValue = true;
  576. } else {
  577. this.Maxnumber = 0;
  578. this.CheckattrValue = false;
  579. this.$queue.showToast('库存不足请选择其他的类型')
  580. }
  581. break
  582. } else {
  583. this.CheckattrValue = false;
  584. }
  585. }
  586. },
  587. jian() {
  588. if (this.CheckattrValue) {
  589. if (this.number != 1) {
  590. let number = this.number - 1
  591. this.number = number
  592. this.numberMoney = parseFloat(this.numberMoney - this.numberMoney1).toFixed(2);
  593. }
  594. } else {
  595. this.$queue.showToast('请先选择正确的商品规格');
  596. }
  597. },
  598. jia() {
  599. if (this.CheckattrValue) {
  600. let number = this.number + 1
  601. if (number <= this.Maxnumber) {
  602. this.number = number
  603. this.numberMoney = parseFloat(this.numberMoney1 * number).toFixed(2);
  604. } else {
  605. this.$queue.showToast('商品只能买这么多了');
  606. }
  607. } else {
  608. this.$queue.showToast('请先选择正确的商品规格');
  609. }
  610. },
  611. navigate(href, e) {
  612. // #ifdef H5
  613. window.location.href = href;
  614. //#endif
  615. //#ifdef APP-PLUS
  616. setTimeout(function() {
  617. plus.runtime.openURL(href);
  618. }, 500);
  619. // #endif
  620. },
  621. getCommondityList(id) {
  622. uni.showLoading({
  623. title: '加载中...'
  624. });
  625. this.$Request.getT('/goods/find?id=' + id).then(res => {
  626. if (res.status === 0) {
  627. this.imageView = [];
  628. this.ordersList = {};
  629. this.ordersMoney = res.data.memberPrice;
  630. this.numberMoney = res.data.memberPrice;
  631. this.ordersList = res.data;
  632. if (res.data.attr.length > 0) {
  633. this.attrValue = [];
  634. res.data.attr[0].attrValue.forEach(d => {
  635. let data = {
  636. name: ''
  637. }
  638. this.checkStateList.push(data);
  639. let detail = [];
  640. d.detail.split(',').forEach(d => {
  641. let data = {
  642. name: '',
  643. state: ''
  644. }
  645. data.name = d;
  646. detail.push(data);
  647. });
  648. d.detail = detail;
  649. d.attrId = '';
  650. d.goodsId = '';
  651. this.attrValue.push(d);
  652. });
  653. }
  654. console.log("this.attrValue____:" + this.attrValue)
  655. this.attrValuecoverImg = res.data.coverImg;
  656. this.imageView = res.data.img.split(',');
  657. console.log(JSON.stringify(this.imageView))
  658. // let isExists = this.$queue.isExistZy(this.collectKey, res.data.id);
  659. // if (isExists === true) {
  660. // this.collect.name = '已收藏';
  661. // this.collect.isCollect = 'color: #E41F19';
  662. // } else {
  663. // this.collect.name = '收藏';
  664. // this.collect.isCollect = false;
  665. // }
  666. if (res.data.brand) {
  667. this.brandName = res.data.brand.brandName;
  668. }
  669. this.loadGoods = true;
  670. // if (res.data.commissionPrice != 0) {
  671. // if (this.member == 1) {
  672. // this.money = ((parseFloat(res.data.helpRateList[0].rate) * parseFloat(res.data
  673. // .commissionPrice))).toFixed(2);
  674. // this.shengji = ((parseFloat(res.data.helpRateList[1].rate) * parseFloat(res.data
  675. // .commissionPrice))).toFixed(2);
  676. // } else if (this.member == 2) {
  677. // this.money = ((parseFloat(res.data.helpRateList[1].rate) * parseFloat(res.data
  678. // .commissionPrice))).toFixed(2);
  679. // this.shengji = ((parseFloat(res.data.helpRateList[2].rate) * parseFloat(res.data
  680. // .commissionPrice))).toFixed(2);
  681. // } else if (this.member == 3) {
  682. // this.money = ((parseFloat(res.data.helpRateList[2].rate) * parseFloat(res.data
  683. // .commissionPrice))).toFixed(2);
  684. // this.shengji = ((parseFloat(res.data.helpRateList[3].rate) * parseFloat(res.data
  685. // .commissionPrice))).toFixed(2);
  686. // } else if (this.member == 4) {
  687. // this.money = ((parseFloat(res.data.helpRateList[3].rate) * parseFloat(res.data
  688. // .commissionPrice))).toFixed(2);
  689. // this.shengji = ((parseFloat(res.data.helpRateList[3].rate) * parseFloat(res.data
  690. // .commissionPrice))).toFixed(2);
  691. // }
  692. // this.buyDes = '分享给好友';
  693. // }
  694. }
  695. uni.hideLoading();
  696. this.showPage = true;
  697. });
  698. },
  699. posterSuccess(haibaoImg) {
  700. this.haibaoImg = haibaoImg;
  701. this.modalName = 'Image';
  702. },
  703. showModal() {
  704. if (!this.haibaoImg) {
  705. this.haibaoShow = true;
  706. this.$queue.showLoading('海报生成中...');
  707. } else {
  708. this.modalName = 'Image';
  709. }
  710. },
  711. hideModal() {
  712. this.modalName = null;
  713. },
  714. TklmaskClose: function(e) {
  715. this.$refs.simpleModalTkl.hide();
  716. this.copyTklStatus = false;
  717. },
  718. TklmaskShow: function(e) {
  719. this.$refs.simpleModalTkl.show({
  720. showConfirmButton: false
  721. });
  722. },
  723. shengJiMethod() {
  724. let relation_id = this.$queue.getData('relation_id');
  725. if (relation_id) {
  726. uni.navigateTo({
  727. url: '/pages/member/yao'
  728. });
  729. } else {
  730. let token = this.$queue.getData('token');
  731. let userId = this.$queue.getData('userId');
  732. uni.navigateTo({
  733. url: '/pages/invitation/invitationUser'
  734. });
  735. }
  736. },
  737. qrR(path) {
  738. this.erweimapath = path;
  739. },
  740. /* 预览照片 */
  741. previewPhoto(index) {
  742. uni.previewImage({
  743. current: this.imageView[index],
  744. urls: this.imageView,
  745. longPressActions: {
  746. itemList: ['保存图片'],
  747. success: function(res) {
  748. uni.getImageInfo({
  749. src: this.imageView[res.index],
  750. success: function(image) {
  751. console.log('图片信息:', JSON.stringify(image));
  752. uni.saveImageToPhotosAlbum({
  753. filePath: image.path,
  754. success: function() {
  755. uni.showToast({
  756. title: '图片保存成功',
  757. icon: 'none',
  758. duration: 3000
  759. });
  760. }
  761. });
  762. }
  763. });
  764. }
  765. }
  766. });
  767. },
  768. openPopus() {
  769. let token = this.$queue.getData('token');
  770. let userId = this.$queue.getData('userId');
  771. if (token) {
  772. this.ShopCartOrMoney = '立即购买';
  773. if (this.ordersList.attr.length === 0) {
  774. this.shopCartShare('quan');
  775. } else {
  776. this.$refs.popus.open();
  777. }
  778. } else {
  779. this.loginS();
  780. }
  781. },
  782. shopCartShare: function(type) {
  783. this.$queue.setData('href', '/pages/zysc/index/commonditydetail?ordersId=' + this.ordersId);
  784. let token = this.$queue.getData('token');
  785. let userId = this.$queue.getData('userId');
  786. if (token) {
  787. if (this.ordersList.attr.length > 0) {
  788. if (this.checkString == '' || !this.CheckattrValue) {
  789. this.$queue.showToast('请选择正确的商品规格');
  790. return;
  791. }
  792. // this.hindPopus();
  793. uni.navigateTo({
  794. url: '../member/order?id=' + this.ordersId + '&userByinvitationId=' +
  795. this.userByinvitationId +
  796. '&numberMoney=' + this.numberMoney1 + '&checkString=' + this
  797. .checkString + '&number=' + this.number +
  798. '&money=' + this.numberMoney + '&skuId=' + this.skuId +
  799. '&attrValuecoverImg=' + this.attrValuecoverImg
  800. });
  801. } else {
  802. if (this.ordersList.sku.length > 0 && this.ordersList.sku[0].stock < 1) {
  803. this.$queue.showToast('库存不足,请稍后在来购买吧!');
  804. return;
  805. }
  806. var money = '';
  807. var stock = '';
  808. if (this.ordersList.sku && this.ordersList.sku.length > 0) {
  809. money = this.ordersList.sku[0].memberPrice;
  810. stock = this.ordersList.sku[0].stock;
  811. } else {
  812. money = this.ordersList.memberPrice;
  813. stock = 1;
  814. }
  815. uni.navigateTo({
  816. url: '../member/order?id=' + this.ordersId + '&userByinvitationId=' +
  817. this.userByinvitationId + '&money=' +
  818. money + '&maxNumber=' + stock
  819. });
  820. }
  821. // if (this.ordersList.isExpress === 2) {
  822. // if (this.ordersList.virtualCount > 0) {
  823. // uni.navigateTo({
  824. // url: '/pages/zysc/member/order?id=' + this.ordersId +
  825. // '&userByinvitationId=' + this.userByinvitationId
  826. // });
  827. // } else {
  828. // this.$queue.showToast('商品库存不足无法购买!');
  829. // }
  830. // } else {
  831. // uni.navigateTo({
  832. // url: '/pages/zysc/member/order?id=' + this.ordersId + '&userByinvitationId=' +
  833. // this.userByinvitationId
  834. // });
  835. // }
  836. } else {
  837. this.loginS();
  838. }
  839. },
  840. copyTklWenAns: function() {
  841. uni.setClipboardData({
  842. data: this.ordersList.title +
  843. '\n【在售价】' +
  844. this.ordersMoney +
  845. '元\n【必买理由】' +
  846. this.ordersList.buyReason +
  847. '\n下单链接:' +
  848. this.erweima,
  849. success: r => {
  850. this.$queue.showToast('复制成功')
  851. this.copyTklStatus = true;
  852. }
  853. });
  854. },
  855. goPublisher() {
  856. let token = this.$queue.getData('token');
  857. let userId = this.$queue.getData('userId');
  858. if (token) {
  859. uni.navigateTo({
  860. url: '/pages/invitation/invitationUser'
  861. });
  862. } else {
  863. this.loginS();
  864. }
  865. },
  866. /**
  867. * 保存图片
  868. * @param url
  869. */
  870. toSave(url) {
  871. //#ifndef H5
  872. uni.getImageInfo({
  873. src: url,
  874. success: function(image) {
  875. console.log('图片信息:', JSON.stringify(image));
  876. uni.saveImageToPhotosAlbum({
  877. filePath: image.path,
  878. success: function() {
  879. console.log('save success');
  880. uni.showToast({
  881. title: '图片保存成功',
  882. icon: 'none',
  883. duration: 3000
  884. });
  885. }
  886. });
  887. }
  888. });
  889. //#endif
  890. },
  891. /**
  892. * 返回
  893. */
  894. goBackUp() {
  895. uni.redirectTo({
  896. url: '/package/pages/zysc/index/index'
  897. });
  898. },
  899. haibao: function() {
  900. uni.navigateTo({
  901. url: '/pages/detail/share'
  902. });
  903. },
  904. topScrollTap: function() {
  905. uni.pageScrollTo({
  906. scrollTop: 0,
  907. duration: 300
  908. });
  909. },
  910. navBarButtontO: function(type) {
  911. if (type === 'home') {
  912. uni.switchTab({
  913. url: '/pages/zysc/index/index'
  914. });
  915. } else if (type === 'like') {
  916. uni.switchTab({
  917. url: '/pages/my/index'
  918. });
  919. }
  920. },
  921. loginS() {
  922. this.$queue.setData('href', '/pages/zysc/index/index');
  923. //#ifdef H5
  924. uni.navigateTo({
  925. url: '/pages/public/login'
  926. });
  927. //#endif
  928. //#ifndef H5
  929. uni.navigateTo({
  930. url: '/pages/public/login'
  931. });
  932. //#endif
  933. },
  934. copyTitle: function() {
  935. uni.setClipboardData({
  936. data: this.goods.title,
  937. success: r => {
  938. this.$queue.showToast('复制成功');
  939. }
  940. });
  941. },
  942. clickCollect() {
  943. //收藏
  944. let isExist = this.$queue.isExistZy(this.collectKey, this.ordersList.id);
  945. console.log(isExist);
  946. if (isExist) {
  947. let items = [];
  948. items.push(this.ordersList.id);
  949. this.$queue.removeItemId(this.collectKey, items);
  950. this.collect.name = "收藏";
  951. this.collect.isCollect = "";
  952. } else {
  953. this.$queue.insert({
  954. key: this.collectKey,
  955. value: this.ordersList,
  956. });
  957. this.collect.name = "已收藏";
  958. this.collect.isCollect = "color: #FC3F78";
  959. }
  960. },
  961. }
  962. };
  963. </script>
  964. <style>
  965. @import '../../../../static/css/index.css';
  966. page {
  967. background: #f8f8f8;
  968. }
  969. .view_button {
  970. margin-bottom: 10upx;
  971. padding-left: 20upx;
  972. float: right;
  973. margin-right: 20upx;
  974. line-height: 46upx;
  975. font-size: 24upx;
  976. color: #333333;
  977. width: 150upx;
  978. height: 45upx;
  979. box-shadow: rgba(183, 183, 183, 0.3) 1px 1px 10px 1px;
  980. border-radius: 100upx;
  981. border: 1upx solid #bababa;
  982. }
  983. .swiper-container {
  984. min-height: 100vw;
  985. }
  986. .hideCanvasView {
  987. position: relative;
  988. }
  989. .hideCanvas {
  990. position: fixed;
  991. top: -99999 upx;
  992. left: -99999 upx;
  993. z-index: -99999;
  994. }
  995. .flex_row_c_c {
  996. display: flex;
  997. flex-direction: row;
  998. justify-content: center;
  999. align-items: center;
  1000. }
  1001. .modalView {
  1002. width: 100%;
  1003. height: 100%;
  1004. position: fixed;
  1005. top: 0;
  1006. left: 0;
  1007. right: 0;
  1008. bottom: 0;
  1009. opacity: 0;
  1010. outline: 0;
  1011. transform: scale(3);
  1012. perspective: 2500 upx;
  1013. background: rgba(0, 0, 0, 0.6);
  1014. transition: all 0.3s ease-in-out;
  1015. pointer-events: none;
  1016. backface-visibility: hidden;
  1017. z-index: 999;
  1018. }
  1019. .modalView.show {
  1020. opacity: 1;
  1021. transform: scale(1);
  1022. pointer-events: auto;
  1023. }
  1024. .flex_column {
  1025. display: flex;
  1026. flex-direction: column;
  1027. }
  1028. .backgroundColor-white {
  1029. background-color: white;
  1030. }
  1031. .border_radius_10px {
  1032. border-radius: 10px;
  1033. }
  1034. .padding1vh {
  1035. padding: 1vh;
  1036. }
  1037. .posterImage {
  1038. width: 60vw;
  1039. }
  1040. .flex_row {
  1041. display: flex;
  1042. flex-direction: row;
  1043. }
  1044. .marginTop2vh {
  1045. margin-top: 2vh;
  1046. }
  1047. .shareInfos {
  1048. color: #FF2638;
  1049. }
  1050. .shareInfo::after {
  1051. border: none;
  1052. }
  1053. button {
  1054. font-size: 14px;
  1055. }
  1056. #shareit {
  1057. -webkit-user-select: none;
  1058. position: fixed;
  1059. width: 100%;
  1060. height: 2000px;
  1061. background: rgba(0, 0, 0, 0.85);
  1062. text-align: center;
  1063. top: 0;
  1064. left: 0;
  1065. z-index: 999;
  1066. }
  1067. #shareit img {
  1068. max-width: 100%;
  1069. }
  1070. .arrow {
  1071. width: 100px;
  1072. height: 150px;
  1073. position: absolute;
  1074. right: 5%;
  1075. top: 1%;
  1076. }
  1077. .b-btn {
  1078. right: 10px;
  1079. top: 16px;
  1080. width: 80px;
  1081. text-align: center;
  1082. font-size: 14px;
  1083. padding: 4px 1px 4px 6px;
  1084. color: #FCDFB8;
  1085. z-index: 1;
  1086. }
  1087. #follow {
  1088. width: 100%;
  1089. height: 50px;
  1090. line-height: 50px;
  1091. text-align: center;
  1092. text-decoration: none;
  1093. font-size: 18px;
  1094. color: white;
  1095. float: left;
  1096. margin-top: 160px;
  1097. }
  1098. #follow1 {
  1099. width: 100%;
  1100. height: 50px;
  1101. line-height: 50px;
  1102. text-align: center;
  1103. text-decoration: none;
  1104. font-size: 18px;
  1105. color: white;
  1106. float: left;
  1107. margin-top: 170px;
  1108. }
  1109. button::after {
  1110. border: none;
  1111. }
  1112. .swiper-wrapper {
  1113. width: 100%;
  1114. }
  1115. /* 星星 */
  1116. @font-face {
  1117. font-family: uniicons;
  1118. font-weight: normal;
  1119. font-style: normal;
  1120. src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
  1121. }
  1122. .ping-view2 {
  1123. font-size: 24upx;
  1124. color: #999999;
  1125. margin-top: 20upx;
  1126. }
  1127. .feedback-star {
  1128. font-family: uniicons;
  1129. margin-left: 18upx;
  1130. color: #999999;
  1131. }
  1132. .feedback-star-view {
  1133. margin-left: 0upx;
  1134. margin-top: -2upx;
  1135. }
  1136. .feedback-star:after {
  1137. content: '\e408';
  1138. }
  1139. .feedback-star.active {
  1140. color: #FF440C;
  1141. }
  1142. .feedback-star.active:after {
  1143. content: '\e438';
  1144. }
  1145. /* 星星 */
  1146. </style>