index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class="detail" style=" padding: 30rpx;">
  3. <scroll-view scroll-y="true" scroll-with-animation='true' style="height: calc(100% - 100rpx)">
  4. <view class="detail-img">
  5. <image
  6. src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/38e693de009644aa9de2dc6d6f7e747a_mergeImage.png"
  7. mode="scaleToFill" />
  8. </view>
  9. <view class="detail-content">
  10. <view style="display:flex; margin-bottom: 20rpx;">
  11. <text class="red"> ¥48.00</text>
  12. <text class="line-thr">¥52.00</text>
  13. </view>
  14. <view class="detail-content-t">
  15. 宫中秘策(GOONGBE)进口儿童韩国进口儿童防晒霜80g
  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">
  26. <view class="title">
  27. 商品信息
  28. </view>
  29. </view>
  30. </scroll-view>
  31. <view class="footer acea-row row-between-wrapper">
  32. <!-- <button open-type="contact" hover-class='none' class='item'>
  33. <view class='iconfont icon-kefu'></view>
  34. <view>客服</view>
  35. </button> -->
  36. <navigator hover-class="none" class="item skeleton-rect" open-type="switchTab" url="/pages/index/index">
  37. <view class="iconfont icon-shouye6"></view>
  38. <view class="p_center">{{ $t(`首页`) }}</view>
  39. </navigator>
  40. <view style=" margin-right: 30rpx;">
  41. <view class="bnt acea-row">
  42. <view class="buy-box" @submit="goBuy">
  43. <button class="share-btn ">
  44. 分享有礼
  45. </button>
  46. <button class="now-btn ">
  47. 立即购买
  48. </button>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. userEdit,
  58. } from '@/api/user.js';
  59. import {
  60. toLogin
  61. } from '@/libs/login.js';
  62. import {
  63. mapGetters
  64. } from "vuex";
  65. import dayjs from "@/plugin/dayjs/dayjs.min.js";
  66. // #ifdef MP
  67. import authorize from '@/components/Authorize';
  68. // #endif
  69. import colors from '@/mixins/color.js';
  70. export default {
  71. components: {
  72. // #ifdef APP-PLUS
  73. appUpdate,
  74. // #endif
  75. // #ifdef MP
  76. authorize
  77. // #endif
  78. },
  79. mixins: [colors],
  80. data () {
  81. return {
  82. };
  83. },
  84. computed: mapGetters(['isLogin']),
  85. watch: {
  86. isLogin: {
  87. handler: function (newV, oldV) {
  88. if (newV) {
  89. this.getUserInfo();
  90. }
  91. },
  92. deep: true
  93. }
  94. },
  95. onLoad () {
  96. if (this.isLogin) {
  97. this.getUserInfo();
  98. // #ifdef APP-PLUS
  99. this.formatSize()
  100. // 获取版本号
  101. plus.runtime.getProperty(plus.runtime.appid, (inf) => {
  102. console.log(inf.version)
  103. this.version = inf.version;
  104. });
  105. // #endif
  106. this.setLang();
  107. } else {
  108. toLogin();
  109. }
  110. },
  111. methods: {
  112. formSubmit: function (e) {
  113. let that = this,
  114. value = e.detail.value,
  115. userInfo = that.switchUserInfo[that.userIndex];
  116. if (!value.nickname) return that.$util.Tips({
  117. title: that.$t(`请输入姓名`)
  118. });
  119. value.avatar = this.userInfo.avatar;
  120. userEdit(value).then(res => {
  121. return that.$util.Tips({
  122. title: res.msg,
  123. icon: 'success'
  124. }, {
  125. tab: 3,
  126. url: 1
  127. });
  128. }).catch(msg => {
  129. return that.$util.Tips({
  130. title: msg || that.$t(`保存失败`)
  131. }, {
  132. tab: 3,
  133. url: 1
  134. });
  135. });
  136. }
  137. }
  138. }
  139. </script>
  140. <style scoped lang="scss">
  141. .time {
  142. height: 44rpx;
  143. font-size: 24rpx;
  144. font-weight: 400;
  145. color: #999999;
  146. line-height: 44rpx;
  147. image {
  148. width: 40rpx;
  149. height: 40rpx;
  150. margin: 0 10rpx;
  151. vertical-align: middle;
  152. }
  153. .imp_info {
  154. height: 44rpx;
  155. font-size: 24rpx;
  156. font-weight: 400;
  157. color: #333333;
  158. line-height: 44rpx;
  159. }
  160. }
  161. .detail {
  162. height: 80vh;
  163. }
  164. .detail-img {
  165. image {
  166. width: 702rpx;
  167. height: 702rpx;
  168. }
  169. margin-bottom: 20rpx;
  170. }
  171. .detail-content-t {
  172. flex: 1;
  173. font-size: 20rpx;
  174. font-weight: 400;
  175. color: #333333;
  176. line-height: 28rpx;
  177. margin-bottom: 20rpx;
  178. }
  179. .detail-content {
  180. .red {
  181. display: block;
  182. font-size: 28rpx;
  183. font-weight: 500;
  184. color: #B22338 !important;
  185. margin-right: 10rpx;
  186. }
  187. .line-thr {
  188. display: block;
  189. font-size: 28rpx;
  190. font-weight: 400;
  191. color: #999999;
  192. text-decoration: line-through;
  193. }
  194. }
  195. .detail-info {
  196. .title {
  197. margin: 30rpx 0;
  198. height: 44rpx;
  199. font-size: 32rpx;
  200. font-weight: 500;
  201. color: #111111;
  202. line-height: 44rpx;
  203. }
  204. }
  205. .footer {
  206. padding: 0 20rpx 0 10rpx;
  207. position: fixed;
  208. bottom: 0;
  209. width: 100%;
  210. box-sizing: border-box;
  211. background-color: #fff;
  212. z-index: 277;
  213. border-top: 1rpx solid #f0f0f0;
  214. height: 100rpx;
  215. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  216. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  217. }
  218. .footer .item .iconfont {
  219. text-align: center;
  220. font-size: 40rpx;
  221. }
  222. .footer .item .iconfont.icon-shoucang1 {
  223. color: var(--view-theme);
  224. }
  225. .footer .item .iconfont.icon-gouwuche1 {
  226. font-size: 40rpx;
  227. position: relative;
  228. }
  229. .buy-box{
  230. display: flex;
  231. width: 100%;
  232. }
  233. .share-btn{
  234. width: 280rpx;
  235. height: 84rpx;
  236. background: #F1F8E5;
  237. border-radius: 54rpx 0rpx 0rpx 54rpx;
  238. font-size: 28rpx;
  239. font-weight: 400;
  240. color: #75BE00;
  241. line-height: 84rpx;
  242. }
  243. .now-btn{
  244. width: 280rpx;
  245. height: 84rpx;
  246. background: #B42A3E;
  247. border-radius: 0rpx 54rpx 54rpx 0rpx;
  248. font-size: 28rpx;
  249. font-weight: 400;
  250. color: #fff;
  251. line-height: 84rpx;
  252. }
  253. </style>