Goodsdetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <!-- 商品详情 -->
  2. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  3. <home-base :show="false" ><view class="div">
  4. <scroll-view class="div product-detail-wrapper" v-if="ifLoad" style="height: 2000px;">
  5. <!-- header -->
  6. <detail-header @setnav="setnav" :navid="navid"></detail-header>
  7. <!-- body -->
  8. <detail-body :isStock="productDetail.goods_storage" @mbBodyposition="getmbBodyposition" @reviewposition="getreviewposition"></detail-body>
  9. <!-- footer -->
  10. <detail-footer></detail-footer>
  11. <!-- 预览图片 -->
  12. <preview-picture
  13. :defaultindex="swipeId"
  14. ></preview-picture>
  15. <!-- 促销信息 -->
  16. <promotion-popup
  17. ></promotion-popup>
  18. </scroll-view>
  19. <view class="div pre-load-wrapper" v-else><image mode="aspectFit" src="data:image/gif;base64,R0lGODlh9AF5A+YAAO7u7v7+/u/x9PHz9u/x9e/y9e7w8/P19/P09/j5+vL09/r6+u3t7e/v7/39/fT2+PX2+Pv7/Pn6+/Hz9ff4+v3+/vr7/Pr7+/L09vr6+/v8/fT1+Pb3+fz9/fz8/fX3+fb4+fHy9f39/vP09PX19/7+//v8/P7///T19/X2+fj5+/Lz9vf4+fv7/fDx9fDy9vDz9vn5+/j6+/j4+vb2+ff5+vX3+O7w9O7x9fb4+vLz9+7x9Pb3+vH09u7w9fr6/PT3+fHy9vL19+3v8//+//n5+vDz9fb3+Pz9/u/x8/Lz9fL09fDx9PDy9Pj6+vT29/P1+O3v8vX4+efp6/////Dy9QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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m6NzNop0cODxZ7NmhbTe/mGd59lync6oOXyv69M7W18/qPRP4/VbJtwl9AFp1H37M6FdgVf1h8t+CVQioCYEQVnEggsooWGGDlzy4oISZUAjhhRgioyGEHFriYYEgYiLigiSWaMyJC6ZYyYoAtnjJiwXGKCMxNBZoIyU47qejJTwC6OP/j8IECeCQkxRZ35GVJLnfkkwC4+R+UEoiJXxUUmJlfVhm6cuW9XUZyZfshTnJmPCVaSYvaMKnJiRsmuemJHCyJ+ecutTJ3p2P5BnenpH0ad6fgOIiqHmEOmIod4hComh4jDZqSwUuEODpp6CGKuqopJZqaqmRNtLTqay26iqrOAiRlgGv1mqrqwYUpmkxAUDg66/ABivssMQWa6yxFYy0wbHMNusssw9QwNOyz1ZrbbMbyLDrttx26+234IYr7rjklmvuueimq+667Lbr7rvwxivvvPTWa++9+Oar77789uvvvwBX0sHABBds8MEOJKzwwgw37PDDEEcs8cQUV2zx/8UYZ6zxxhx37PHHIIcs8sgkl1zxCCinrPLKLCdhwMswxyzzzDTXbPPNOOes88489+zzz0AHLfTQRBdt9NFIJ6300jqT4PTTUEcdNQoVVm311VhnrfXWXHft9ddghy322GSXbfbZaKet9tpst+3223DHLffcdNdt991456333nz37fffgAcu+OCEF2744YgnrvjijDfu+OOQRy755JRXbvnlmGeu+eacd+7556CHLvropJdu+umop6766qy37vrrsMcu++y012777bjnrvvuvPfu++/ABy/88MQXb/zxyCev/PLMN+/889BHL/301Fdv/fXYZ6/99tx37/334Icv/v/45Jdv/vnop6/++uy37/778Mcv//z012///fjnr//+/Pfv//8ADKAAB0jAAhrwgAhMoAIXyMAGOvCBEIygBCdIwQpa8IIYzKAGN8jBDnrwgyAMoQhHSMISmvCEKEyhClfIwha68IUwjKEMZ0jDGtrwhjjMoQ53yMMe+vCHQAyiEIdIxCIa8YhITKISl8jEJjrxiVCMohSnSMUqWvGKWMyiFrfIxS568YtgDKMYx0jGMprxjGhMoxrXyMY2uvGNcIyjHOdIxzra8Y54zKMe98jHPvrxj4AMp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OPCCbQ8WRu5m3fOm8P9+ENCSWAAY+x/8ZZX+sgkAivnhgFYOgc//SCn+6QkAMSjwEBXghWLxs5fggf4Oxkkac/P9eTX+2R4ABGkBhZ3gjvPhjxTghzzxcCUO9c/92lH+x80u8E3wgX0O8ojAg20O+Yf+p/zzqBf/vBveWG3xcEkOdUQPPMX/e3vgKy0eKEMPqKjfyUHwlhzhcEQAOQEADLLxwIkPmHYAGgz+DfzvaSr/0hHyWDnmaS0AFMPucrsOyNoAKJnvCRAAgQBFWEhYaHiImKi4yNjo+QkZKTlIYCU5iZmpucnZ6foKGio6Slpqeom1SrrK2urxIvBZMEKSWvuK8dGLOSBQoOucJUMlW9kQQcw8OClf/Oz9DR0tPPl6nX2Nna29zYy8saCoOPgxTfwwEQxo8FBSkB57gRK+OOBC8q8bjN1P3+/wADFrLWraDBgwgTZtKXqwSFAQSOIRoEwQNDYRIUFKg3sYoCCxdfBWABUeIhih1CtuInsKXLlzAHKpxJs6ZNTipFFjkwwJiAn4QUgLCYM5cFCD0L/BQwawAEkEVdiUhwgBCBn+MU5EgZlQrLmGDDiqVE8KbZs2hTdXVVwYSEBBQSZOhwa22uABrexpWgAZ7dVyIiyKhBQcWFDif+fh3LuLHjKmXTSp5MGdPfy5gza361+LHnzwIjVx5Neubm06hTM+wMurVraKJLy56tTbWY7du4Wb/ezdtRbNrAg4/CTbx4Zt29kysn9Fu48+cLjUufrhL58uuvm0PfDpy69+/LrGMf71k79/Okwatfv0o8+fdjzaOfL5m9fe/u4euHKZ++/5v3BWhcfvsVGFB//yWokIAM3kaggRBSg6CCFBbU4IWoPRjhhtVU6CGAGIaImYYclijJhB+miIqILNpFookwNoKiijSOEggAOw==" class="img pre-load"></view>
  20. <view class="div livebox" v-if="productDetail.live_apply_info" @click="goLive(productDetail.live_apply_info.live_apply_id)"><view class="div icon"><image mode="aspectFit" class="img living" src="../../../static/image/live/on-live.gif"></view>直播中</view>
  21. </view></home-base>
  22. </template>
  23. <script>
  24. import {getFontSize} from '@/util/common'
  25. import { urlencode } from '@/util/common'
  26. import HomeBase from '../HomeBase'
  27. import DetailHeader from './DetailHeader'
  28. import DetailBody from './DetailBody'
  29. import DetailFooter from './DetailFooter'
  30. import PreviewPicture from './child/PreviewPicture'
  31. import PromotionPopup from './child/PromotionPopup'
  32. // import { scoreGet } from '../../api/score'
  33. import { mapState, mapMutations, mapActions } from 'vuex'
  34. export default {
  35. data () {
  36. return {
  37. option:{},
  38. cartNumber: 0,
  39. productId: '',
  40. hideFooter: false,
  41. popupVisible: true,
  42. currentScore: 0,
  43. bargain_id: 0,
  44. ifLoad:false,
  45. mbBodyposition:0,
  46. reviewposition:0,
  47. navid:1,
  48. scrollTimer : null
  49. }
  50. },
  51. components:{
  52. HomeBase,
  53. DetailHeader,
  54. DetailBody,
  55. DetailFooter,
  56. PreviewPicture,
  57. PromotionPopup
  58. },
  59. onShareAppMessage(res) {
  60. return {
  61. title: this.productDetail.goods_name,
  62. path: "/pages/home/goodsdetail/Goodsdetail?"+urlencode(this.option),
  63. imageUrl:this.productDetail.photos[0]
  64. }
  65. },
  66. onShareTimeline(res) {
  67. return {
  68. title: this.productDetail.goods_name,
  69. path: "/pages/home/goodsdetail/Goodsdetail?"+urlencode(this.option),
  70. imageUrl:this.productDetail.photos[0]
  71. }
  72. },
  73. onLoad: function (option) {
  74. this.option=option
  75. this.productId=option.goods_id ? option.goods_id : ''
  76. this.bargain_id=option.bargain_id
  77. let extra = {}
  78. if (this.bargain_id) {
  79. extra['bargain_id'] = this.bargain_id
  80. }
  81. this.getGoodsDetail({ goods_id: this.productId, token: this.token, extra: extra }).then(res=>{
  82. this.ifLoad=true
  83. uni.setNavigationBarTitle({
  84. title: this.productDetail.goods_name
  85. })
  86. }).catch(error => {
  87. uni.showToast({icon:'none',title: error.message})
  88. })
  89. this.saveCartState(false)
  90. },
  91. computed: {
  92. fontSize(){
  93. return getFontSize()
  94. },
  95. ...mapState({
  96. productDetail: state => state.goodsdetail.detailInfo,
  97. currentProductId: state => state.goodsdetail.currentProductId,
  98. token: state => state.member.token,
  99. swipeId: state => state.goodsdetail.swipeId,
  100. config: state => state.config.config
  101. })
  102. },
  103. mounted () {
  104. this.$nextTick(() => {
  105. })
  106. },
  107. onPageScroll(res){
  108. // if(res.scrollTop > this.reviewposition && res.scrollTop < this.mbBodyposition){
  109. // this.navid = 2
  110. // }else if(res.scrollTop > this.mbBodyposition){
  111. // this.navid = 3
  112. // }else if(res.scrollTop < this.reviewposition){
  113. // this.navid = 1
  114. // }
  115. const that = this
  116. if(this.scrollTimer != null){
  117. clearTimeout(this.scrollTimer);
  118. }
  119. this.scrollTimer = setTimeout(()=>{
  120. let navid = 1
  121. if(res.scrollTop >= that.mbBodyposition) {
  122. navid = 3
  123. }else if(res.scrollTop >= that.reviewposition) {
  124. navid = 2
  125. }
  126. console.log('滚动触发了!')
  127. that.navid = navid
  128. }, 100)
  129. },
  130. methods: {
  131. setnav(id){
  132. let scrollTop = 0
  133. if(id == '#review'){
  134. scrollTop = this.reviewposition
  135. }else if(id == '#mbBody'){
  136. scrollTop = this.mbBodyposition
  137. }
  138. uni.pageScrollTo({
  139. duration: 300, //过渡时间
  140. scrollTop: scrollTop
  141. })
  142. },
  143. ...mapMutations({
  144. saveCartState: 'saveCartState'
  145. }),
  146. ...mapActions({
  147. fetchConfig: 'fetchConfig',
  148. getGoodsDetail: 'getGoodsDetail'
  149. }),
  150. getmbBodyposition(top){
  151. this.mbBodyposition = top
  152. console.log(this.mbBodyposition)
  153. },
  154. getreviewposition(top){
  155. this.reviewposition = top
  156. },
  157. goLive(live_apply_id){
  158. uni.navigateTo({ url: '/pages/member/live/LiveDetail'+'?'+urlencode( { 'live_apply_id': live_apply_id } )})
  159. },
  160. loadConfig (imgUrl, desc, link) {
  161. this.fetchConfig().then(
  162. response => {
  163. let wechat = response.config['wechat.web']
  164. // 微信已授权
  165. if (wechat) {
  166. this.setWechatConfig(wechat, imgUrl, desc, link)
  167. }
  168. },
  169. error => {}
  170. )
  171. },
  172. setWechatConfig (config, imgUrl, desc, link) {
  173. this.wxApi.wxRegister(config, '商品详情', imgUrl, desc, link)
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .product-detail-wrapper {
  180. height: 100%;
  181. width: auto;
  182. }
  183. .pre-load-wrapper{position:fixed;top:0;bottom:0;left:0;right:0}
  184. .pre-load{width:100%;height:100%}
  185. .livebox {
  186. position: fixed;
  187. right: 10px;
  188. top: 159px;
  189. width: 56px;
  190. height: 57px;
  191. border-radius: 10px;
  192. border: 1px solid #e5e5e5;
  193. background: hsla(0,0%,100%,.9);
  194. z-index: 11;
  195. display: flex;
  196. align-items: center;
  197. text-align: center;
  198. flex-direction: column;
  199. font-size:$fontSize;
  200. color: #000;
  201. }
  202. .livebox .icon {
  203. display: flex;
  204. align-items: center;
  205. width: 20px;
  206. height: 20px;
  207. background-image: linear-gradient(270deg,#ff4142,#ff4b2b);
  208. border-radius: 50%;
  209. margin-bottom: 5px;
  210. margin-top: 10px;
  211. }
  212. .livebox .icon .living {
  213. margin: 0 auto;
  214. width: 14px;
  215. height: 14px;
  216. }
  217. </style>