index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <view class="detail" style=" padding: 30rpx;">
  3. <scroll-view scroll-y="true" scroll-with-animation='true' style="height: 100%">
  4. <view class="detail-img">
  5. <productConSwiperGroupbuying class="skeleton-rect" :imgUrls="goodsInfo.slideshowList" :h="351"
  6. :videoline="goodsInfo.videoUrl" @videoPause="videoPause"></productConSwiperGroupbuying>
  7. <!-- <image :src="goodsInfo.goodsCover" mode="scaleToFill" />-->
  8. </view>
  9. <view class="detail-content">
  10. <view style="display:flex; margin-bottom: 20rpx;">
  11. <text class="red"> ¥{{ goodsInfo.grouponPrice }}</text>
  12. <text class="line-thr">¥{{ goodsInfo.salePrice }}</text>
  13. </view>
  14. <view class="detail-content-t">
  15. {{ goodsInfo.goodsName }}
  16. </view>
  17. <!-- <view class='time '>
  18. <image src="http://www.gzzzyd.com/groupon/home_slices/编辑@2x.png" mode="scaleToFill" />
  19. 发布于:
  20. <text class="imp_info">
  21. 1天20小时36分钟前
  22. </text>
  23. </view> -->
  24. </view>
  25. <view class="detail-info product-intro">
  26. <view class="title">
  27. 商品信息
  28. </view>
  29. <!-- <u-album :urls="goodsInfo.detailImgUrlList" :rowCount="1" :multipleSize="albumWidth" maxCount="9999"-->
  30. <!-- multipleMode="widthFix"></u-album>-->
  31. <u-parse :content="goodsInfo.detailContent"></u-parse>
  32. </view>
  33. </scroll-view>
  34. <!-- <view class="footer acea-row row-between-wrapper">-->
  35. <!-- &lt;!&ndash; <button open-type="contact" hover-class='none' class='item'>-->
  36. <!-- <view class='iconfont icon-kefu'></view>-->
  37. <!-- <view>客服</view>-->
  38. <!-- </button> &ndash;&gt;-->
  39. <!-- <navigator hover-class="none" class="item skeleton-rect" open-type="switchTab" url="/pages/index/index">-->
  40. <!-- <view class="iconfont icon-shouye6"></view>-->
  41. <!-- <view class="p_center">{{ $t(`首页`) }}</view>-->
  42. <!-- </navigator>-->
  43. <!-- <view style=" margin-right: 30rpx;">-->
  44. <!-- <view class="bnt acea-row">-->
  45. <!-- <view class="buy-box">-->
  46. <!-- <button class="share-btn ">-->
  47. <!-- 分享有礼-->
  48. <!-- </button>-->
  49. <!-- <button class="now-btn " @submit="goBuy">-->
  50. <!-- 立即购买-->
  51. <!-- </button>-->
  52. <!-- </view>-->
  53. <!-- </view>-->
  54. <!-- </view>-->
  55. <!-- </view>-->
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. userEdit,
  61. } from '@/api/user.js';
  62. import productConSwiperGroupbuying from "@/components/productConSwiperGroupbuying";
  63. import {
  64. toLogin
  65. } from '@/libs/login.js';
  66. import {
  67. mapGetters
  68. } from "vuex";
  69. import dayjs from "@/plugin/dayjs/dayjs.min.js";
  70. // #ifdef MP
  71. import authorize from '@/components/Authorize';
  72. // #endif
  73. import colors from '@/mixins/color.js';
  74. export default {
  75. props: {
  76. goodsInfo: {
  77. type: Object,
  78. default: () => { }
  79. }
  80. },
  81. components: {
  82. productConSwiperGroupbuying,
  83. // #ifdef APP-PLUS
  84. appUpdate,
  85. // #endif
  86. // #ifdef MP
  87. authorize
  88. // #endif
  89. },
  90. mixins: [colors],
  91. data () {
  92. return {
  93. albumWidth: 0,
  94. };
  95. },
  96. computed: mapGetters(['isLogin']),
  97. watch: {
  98. isLogin: {
  99. handler: function (newV, oldV) {
  100. if (newV) {
  101. }
  102. },
  103. deep: true
  104. }
  105. },
  106. created(options) {
  107. console.log('???')
  108. let that = this;
  109. uni.getSystemInfo({
  110. success: function (res) {
  111. console.log(res,'getSystemInfo')
  112. that.albumWidth = res.windowWidth - 30
  113. that.height = res.windowHeight;
  114. //res.windowHeight:获取整个窗口高度为px,*2为rpx;98为头部占据的高度;
  115. // #ifndef APP-PLUS || H5 || MP-ALIPAY
  116. that.navbarRight =
  117. res.windowWidth - uni.getMenuButtonBoundingClientRect().left;
  118. // #endif
  119. },
  120. });
  121. },
  122. methods: {
  123. videoPause () {
  124. let that = this;
  125. this.$nextTick(() => {
  126. that.infoScroll();
  127. });
  128. },
  129. formSubmit: function (e) {
  130. let that = this,
  131. value = e.detail.value,
  132. userInfo = that.switchUserInfo[that.userIndex];
  133. if (!value.nickname) return that.$util.Tips({
  134. title: that.$t(`请输入姓名`)
  135. });
  136. value.avatar = this.userInfo.avatar;
  137. userEdit(value).then(res => {
  138. return that.$util.Tips({
  139. title: res.msg,
  140. icon: 'success'
  141. }, {
  142. tab: 3,
  143. url: 1
  144. });
  145. }).catch(msg => {
  146. return that.$util.Tips({
  147. title: msg || that.$t(`保存失败`)
  148. }, {
  149. tab: 3,
  150. url: 1
  151. });
  152. });
  153. }
  154. }
  155. }
  156. </script>
  157. <style scoped lang="scss">
  158. .time {
  159. height: 44rpx;
  160. font-size: 24rpx;
  161. font-weight: 400;
  162. color: #999999;
  163. line-height: 44rpx;
  164. image {
  165. width: 40rpx;
  166. height: 40rpx;
  167. margin: 0 10rpx;
  168. vertical-align: middle;
  169. }
  170. .imp_info {
  171. height: 44rpx;
  172. font-size: 24rpx;
  173. font-weight: 400;
  174. color: #333333;
  175. line-height: 44rpx;
  176. }
  177. }
  178. .detail {
  179. height: 80vh;
  180. }
  181. .detail-img {
  182. image {
  183. width: 702rpx;
  184. height: 702rpx;
  185. }
  186. margin-bottom: 20rpx;
  187. }
  188. .detail-content-t {
  189. flex: 1;
  190. font-size: 20rpx;
  191. font-weight: 400;
  192. color: #333333;
  193. line-height: 28rpx;
  194. margin-bottom: 20rpx;
  195. }
  196. .detail-content {
  197. .red {
  198. display: block;
  199. font-size: 28rpx;
  200. font-weight: 500;
  201. color: #B22338 !important;
  202. margin-right: 10rpx;
  203. }
  204. .line-thr {
  205. display: block;
  206. font-size: 28rpx;
  207. font-weight: 400;
  208. color: #999999;
  209. text-decoration: line-through;
  210. }
  211. }
  212. .detail-info {
  213. .title {
  214. margin: 30rpx 0;
  215. height: 44rpx;
  216. font-size: 32rpx;
  217. font-weight: 500;
  218. color: #111111;
  219. line-height: 44rpx;
  220. }
  221. }
  222. .footer {
  223. padding: 0 20rpx 0 10rpx;
  224. position: fixed;
  225. bottom: 0;
  226. width: 100%;
  227. box-sizing: border-box;
  228. background-color: #fff;
  229. z-index: 277;
  230. border-top: 1rpx solid #f0f0f0;
  231. height: 100rpx;
  232. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  233. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  234. }
  235. .footer .item .iconfont {
  236. text-align: center;
  237. font-size: 40rpx;
  238. }
  239. .footer .item .iconfont.icon-shoucang1 {
  240. color: var(--view-theme);
  241. }
  242. .footer .item .iconfont.icon-gouwuche1 {
  243. font-size: 40rpx;
  244. position: relative;
  245. }
  246. .buy-box {
  247. display: flex;
  248. width: 100%;
  249. }
  250. .share-btn {
  251. width: 280rpx;
  252. height: 84rpx;
  253. background: #F1F8E5;
  254. border-radius: 54rpx 0rpx 0rpx 54rpx;
  255. font-size: 28rpx;
  256. font-weight: 400;
  257. color: #75BE00;
  258. line-height: 84rpx;
  259. }
  260. .now-btn {
  261. width: 280rpx;
  262. height: 84rpx;
  263. background: #B42A3E;
  264. border-radius: 0rpx 54rpx 54rpx 0rpx;
  265. font-size: 28rpx;
  266. font-weight: 400;
  267. color: #fff;
  268. line-height: 84rpx;
  269. }
  270. </style>